![]() |
Data |
| Prev: C9B1 | Up: Map | Next: C9F0 |
|
What bard 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.
|
||||
| BARD_SCRIPTS | C9D7 | DEFB $00 | Key 0, an ordinary script: BARD_A | |
| C9D8 | DEFW BARD_A | |||
| C9DA | DEFB $0F | Key $0F, ATTACK WITH: its reaction, BARD_ON_ATTACK_WITH | ||
| C9DB | DEFW BARD_ON_ATTACK_WITH | |||
| C9DD | DEFB $FF | End of the table | ||
|
BARD_A -- An ordinary script: BARD_TAKES_ORDER, TAKE: wooden chest, Go to BARD_A.
|
||||
| BARD_A | C9DE | DEFB $43 | Call BARD_TAKES_ORDER (an order cannot interrupt it) | |
| C9DF | DEFW BARD_TAKES_ORDER | |||
| C9E1 | DEFB $00 | Not used | ||
| BARD_ORDER_STEP | C9E2 | DEFB $42 | TAKE: wooden chest (an order cannot interrupt it) -- rewritten by BARD_TAKES_ORDER with each order Bard is given | |
| BARD_ORDER_ACTION | C9E3 | DEFB $13 | The action | |
| BARD_ORDER_OBJECTS | C9E4 | DEFB $25,$FF | Its objects | |
| C9E6 | DEFB $0E | Go to BARD_A | ||
| C9E7 | DEFW BARD_A | |||
|
BARD_ON_ATTACK_WITH -- The reaction to ATTACK WITH: SHOOT, Go to BARD_ON_ATTACK_WITH.
|
||||
| BARD_ON_ATTACK_WITH | C9E9 | DEFB $54,$3A | SHOOT (an order cannot interrupt it) | |
| C9EB | DEFW ON_ATTACK_WITH | If it is refused: ON_ATTACK_WITH | ||
| C9ED | DEFB $0E | Go to BARD_ON_ATTACK_WITH | ||
| C9EE | DEFW BARD_ON_ATTACK_WITH | |||
| Prev: C9B1 | Up: Map | Next: C9F0 |