Prev: A81A Up: Map Next: A865
A842: Character routine: a character eats Bilbo
If the character is in Bilbo's room, it 'eats' him: the EAT action is reported with Bilbo as the target (9EBF), the food code is run (921F) and Bilbo dies (903C).
A842 LD A,($B5E7) A = the room the character started this turn in
A845 LD HL,$B5E6 Is Bilbo in that same room?
A848 CP (HL)
A849 RET NZ No: nothing happens
A84A CALL $9C99 Dry run? Then stop here: it always works
A84D LD A,$1B A = the EAT action
A84F LD ($B5D8),A
A852 LD A,$00 The target is Bilbo (object 0)
A854 LD ($B5D9),A
A857 LD A,$FF No instrument
A859 LD ($B5DA),A
A85C CALL $9EBF Report it in words ("the hideous troll eats you.")
A85F CALL $921F Run the ordinary eating code (for its side effects)
A862 JP $903C Bilbo dies
Prev: A81A Up: Map Next: A865