Prev: 96DA Up: Map Next: 970B
96DD: Kill a character
If A is 0, it is Bilbo who has died, and 903C ends the game. Otherwise the character's dead flag (bit 3) is set, everything it carries is dropped where it stands (9CA8), it is removed from the character table (C9BA) so it no longer acts, its adjectives are replaced by DEAD (A0BC), and any orders waiting for it are cancelled (894D).
Input
A Character
96DD AND A Is it Bilbo (object 0)?
96DE JP Z,$903C Yes: the game is over
96E1 PUSH BC
96E2 PUSH IY
96E4 PUSH IX
96E6 LD C,A C = the character
96E7 CALL $9B25 IX = its record
96EA SET 3,(IX+$07) Mark it dead
96EE CALL $9CA8 It drops everything it carries
96F1 LD A,C
96F2 CALL $99E0 Find it in the character table
96F5 CP $FF
96F7 LD A,C
96F8 JR Z,$96FE Not there: skip
96FA LD (IY+$00),$00 Clear its slot: it will never act again
96FE CALL $A0BC Its adjective becomes DEAD
9701 LD A,C
9702 CALL $894D Cancel any orders it was given
9705 POP IX
9707 POP IY
9709 POP BC
970A RET
Prev: 96DA Up: Map Next: 970B