Prev: 9974 Up: Map Next: 9A59
99C6: A character tries the action in ACTION to INSTRUMENT
Used by the routines at SCRIPT_DO, SCRIPT_BARE and CAPTIVE.
Checked by WOULD_WORK first, as the player's sentences are; then carried out by DO_ACTION, and the player is told of anyone who has just come into view -- "... enters." for the actor, "... appears." for the second object, through ANNOUNCE_ARRIVAL. ACTOR_DOES is the way in for an order the character was given, skipping the check.
Output
F NZ if it was done, Z if it was refused
ACTOR_TRIES 99C6 PUSH IX Refused by the check: Z
99C8 CALL WOULD_WORK
99CB JP Z,ACTOR_TRIES_6
This entry point is used by the routine at CHARACTERS_ACT.
ACTOR_DOES 99CE LD A,(TARGET_IS_PLACE) TARGET_IS_PLACE set? Straight to doing it
99D1 CP $01
99D3 JR Z,ACTOR_TRIES_4
99D5 LD A,(ACTION) Going through something, away from the player: straight to doing it
99D8 CP $1E
99DA JR NZ,ACTOR_TRIES_0
99DC LD A,(ACTOR_AT)
99DF LD HL,PLAYER_WHERE
99E2 CP (HL)
99E3 JR NZ,ACTOR_TRIES_4
ACTOR_TRIES_0 99E5 LD A,(TARGET) Not yet worked out: two ways into NARRATE_ACTION
99E8 CP $FF
99EA JR Z,ACTOR_TRIES_3
99EC CALL LOCATION_OF
99EF LD (TARGET_AT),A
99F2 CP $FF
99F4 JR NZ,ACTOR_TRIES_3
99F6 LD BC,(PLAYER_AT)
99FA LD A,C
99FB CP B
99FC JR Z,ACTOR_TRIES_3
99FE LD B,(IX+$00)
ACTOR_TRIES_1 9A01 CP (IX+$10)
9A04 JR Z,ACTOR_TRIES_2
9A06 INC IX
9A08 DJNZ ACTOR_TRIES_1
9A0A JR ACTOR_TRIES_3
ACTOR_TRIES_2 9A0C LD A,(ACTING)
9A0F LD B,A
9A10 LD A,$FF
9A12 LD (ACTING),A
9A15 LD A,$01
9A17 LD (PRINTING_ON),A
9A1A PUSH IY
9A1C CALL NARRATE_ACTION
9A1F POP IY
9A21 SUB A
9A22 LD (PRINTING_ON),A
9A25 LD A,B
9A26 LD (ACTING),A
9A29 JR ACTOR_TRIES_4
ACTOR_TRIES_3 9A2B PUSH IY
9A2D CALL NARRATE_ACTION
9A30 POP IY
ACTOR_TRIES_4 9A32 CALL DO_ACTION Do it
9A35 LD A,(ACTING) The actor has come into the player's view? "... enters."
9A38 LD HL,ACTOR_AT
9A3B LD DE,MSG_ENTER
9A3E CALL ANNOUNCE_ARRIVAL
9A41 LD A,(TARGET_IS_PLACE) The second object too? "... appears."
9A44 CP $01
9A46 JR Z,ACTOR_TRIES_5
9A48 LD A,(TARGET)
9A4B LD HL,TARGET_AT
9A4E LD DE,MSG_APPEAR
9A51 CALL ANNOUNCE_ARRIVAL
ACTOR_TRIES_5 9A54 OR $01 Done: NZ
ACTOR_TRIES_6 9A56 POP IX
9A58 RET
Prev: 9974 Up: Map Next: 9A59