Prev: C834 Up: Map Next: C8A1
C83B: Scripts: horrible goblin, mean goblin, disgusting goblin
What horrible goblin, mean goblin, disgusting goblin does, turn by turn. CHARACTERS_ACT runs one step of a character's script each turn it can, and a step is an action the character tries as if it had typed it: RUN, TAKE, GIVE TO. A step that names nothing acts on whatever fits.
First comes the script table: one entry per script, a key and the script's address. Key 0 is an ordinary script -- the ones a character wanders between, picked at random by a 'switch at random' step. Any other key is an action code, and that script is the character's reaction when that is done to it: attacked, given something, captured.
Then the scripts, one step to a line. A step's first byte says what it is: its low four bits $00-$03 an action with objects (or, $01 and $03, a routine to call), $04 an action with none, $0E go to, $0F switch at random, $0C switch to a reaction. $10 added means an address follows, where the script goes on if the step is refused; $20 that the step is used up once it works (SCRIPT_DO zeroes its first byte); $40 that an order from the player cannot interrupt it. So $14 is an action with no objects, with somewhere to go if it is refused. The Characters page has every script written out.
HORRIBLE_GOBLIN_SCRIPTS C83B DEFB $00 Key 0, an ordinary script: HORRIBLE_GOBLIN_A
C83C DEFW HORRIBLE_GOBLIN_A
C83E DEFB $0F Key $0F, ATTACK WITH: its reaction, GOBLINS_ON_ATTACK_WITH
C83F DEFW GOBLINS_ON_ATTACK_WITH
C841 DEFB $FF End of the table
NASTY_GOBLIN_A -- An ordinary script: OPEN: small insignificant crack, then on as GOBLINS_A.
NASTY_GOBLIN_A C842 DEFB $02,$10,$06,$FF OPEN: small insignificant crack
GOBLINS_A -- Where a jump or a refusal goes on: CAPTURE, Go to GOBLINS_A.
GOBLINS_A C846 DEFB $14,$30 CAPTURE
C848 DEFW GOBLINS_B If it is refused: GOBLINS_B
C84A DEFB $0E Go to GOBLINS_A
C84B DEFW GOBLINS_A
GOBLINS_B -- Where a jump or a refusal goes on: GO UP, then on as GOBLINS_C.
GOBLINS_B C84D DEFB $04,$09 GO UP
GOBLINS_C -- Where a jump or a refusal goes on: CAPTURE, Go to GOBLINS_C.
GOBLINS_C C84F DEFB $14,$30 CAPTURE
C851 DEFW GOBLINS_D If it is refused: GOBLINS_D
C853 DEFB $0E Go to GOBLINS_C
C854 DEFW GOBLINS_C
GOBLINS_D -- Where a jump or a refusal goes on: GO DOWN, then on as GOBLINS_E.
GOBLINS_D C856 DEFB $04,$0A GO DOWN
GOBLINS_E -- Where a jump or a refusal goes on: CAPTURE, Go to GOBLINS_E.
GOBLINS_E C858 DEFB $14,$30 CAPTURE
C85A DEFW GOBLINS_F If it is refused: GOBLINS_F
C85C DEFB $0E Go to GOBLINS_E
C85D DEFW GOBLINS_E
GOBLINS_F -- Where a jump or a refusal goes on: CLOSE: small insignificant crack, GO SOUTH, then on as GOBLINS_G.
GOBLINS_F C85F DEFB $02,$0C,$06,$FF CLOSE: small insignificant crack
C863 DEFB $04,$02 GO SOUTH
GOBLINS_G -- Where a jump or a refusal goes on: CAPTURE, Go to GOBLINS_G.
GOBLINS_G C865 DEFB $14,$30 CAPTURE
C867 DEFW GOBLINS_H If it is refused: GOBLINS_H
C869 DEFB $0E Go to GOBLINS_G
C86A DEFW GOBLINS_G
GOBLINS_H -- Where a jump or a refusal goes on: GO NORTH, Go to NASTY_GOBLIN_A.
GOBLINS_H C86C DEFB $04,$01 GO NORTH
C86E DEFB $0E Go to NASTY_GOBLIN_A
C86F DEFW NASTY_GOBLIN_A
VICIOUS_GOBLIN_A -- An ordinary script: GO NORTHWEST, then on as GOBLINS_I.
VICIOUS_GOBLIN_A C871 DEFB $04,$06 GO NORTHWEST
GOBLINS_I -- Where a jump or a refusal goes on: CAPTURE, Go to GOBLINS_I.
GOBLINS_I C873 DEFB $14,$30 CAPTURE
C875 DEFW GOBLINS_J If it is refused: GOBLINS_J
C877 DEFB $0E Go to GOBLINS_I
C878 DEFW GOBLINS_I
GOBLINS_J -- Where a jump or a refusal goes on: GO NORTH, then on as GOBLINS_K.
GOBLINS_J C87A DEFB $04,$01 GO NORTH
GOBLINS_K -- Where a jump or a refusal goes on: CAPTURE, Go to GOBLINS_K.
GOBLINS_K C87C DEFB $14,$30 CAPTURE
C87E DEFW GOBLINS_L If it is refused: GOBLINS_L
C880 DEFB $0E Go to GOBLINS_K
C881 DEFW GOBLINS_K
GOBLINS_L -- Where a jump or a refusal goes on: GO SOUTHWEST, then on as GOBLINS_M.
GOBLINS_L C883 DEFB $04,$08 GO SOUTHWEST
GOBLINS_M -- Where a jump or a refusal goes on: CAPTURE, Go to GOBLINS_M.
GOBLINS_M C885 DEFB $14,$30 CAPTURE
C887 DEFW GOBLINS_N If it is refused: GOBLINS_N
C889 DEFB $0E Go to GOBLINS_M
C88A DEFW GOBLINS_M
GOBLINS_N -- Where a jump or a refusal goes on: GO UP, then on as GOBLINS_O.
GOBLINS_N C88C DEFB $04,$09 GO UP
GOBLINS_O -- Where a jump or a refusal goes on: CAPTURE, Go to GOBLINS_O.
GOBLINS_O C88E DEFB $14,$30 CAPTURE
C890 DEFW VICIOUS_GOBLIN_A If it is refused: VICIOUS_GOBLIN_A
C892 DEFB $0E Go to GOBLINS_O
C893 DEFW GOBLINS_O
HORRIBLE_GOBLIN_A -- An ordinary script: RUN, ATTACK WITH, CAPTURE, Go to HORRIBLE_GOBLIN_A.
HORRIBLE_GOBLIN_A C895 DEFB $04,$24 RUN
C897 DEFB $04,$0F ATTACK WITH
C899 DEFB $04,$30 CAPTURE
C89B DEFB $0E Go to HORRIBLE_GOBLIN_A
C89C DEFW HORRIBLE_GOBLIN_A
GOBLINS_ON_ATTACK_WITH -- The reaction to ATTACK WITH: CAPTURE, Back to its first script.
GOBLINS_ON_ATTACK_WITH C89E DEFB $04,$30 CAPTURE
C8A0 DEFB $07 Back to its first script
Prev: C834 Up: Map Next: C8A1