Prev: 60569 Up: Map Next: 60774
60598: Handler: Injury Check
Used by the routines at Action_Down, Action_Climb, Action_Enter and GameStart.
Refuse the move while the player is badly hurt. Otherwise change rooms and arm the local dangers.
Handler_InjuryCheck 60598 LD C,A Call IsObjectInCurrentRoom to test whether the injury is in this room. Jump to Handler_InjuryCheck_Next when the player is not too badly hurt.
60599 LD A,72
60601 CALL IsObjectInCurrentRoom
60604 JR NZ,Handler_InjuryCheck_Next
60606 LD HL,56120 Print "You can't move. You are too badly injured.".
60609 CALL PrintStringAndANewline
60612 RET Return.
Handler_InjuryCheck_Next 60613 LD A,C Call MovePlayerToRoom to move the player into that room.
60614 CALL MovePlayerToRoom
60617 LD E,0 Call Handler_DisplayRoom to describe the current room.
60619 CALL Handler_DisplayRoom
60622 LD A,65 Jump to Handler_InjuryCheck_SlimeMonster if object 65 (the giant spider) is not here.
60624 CALL IsObjectInCurrentRoom
60627 JR NZ,Handler_InjuryCheck_SlimeMonster
60629 LD HL,47670 Arm the giant spider for six turns.
60632 SET 1,(HL)
60634 LD A,6
60636 LD (47672),A
Handler_InjuryCheck_SlimeMonster 60639 LD A,30 Jump to Handler_InjuryCheck_Demons if object 30 (the slime monster) is not here.
60641 CALL IsObjectInCurrentRoom
60644 JR NZ,Handler_InjuryCheck_Demons
60646 LD HL,47670 Arm the slime monster for six turns.
60649 SET 2,(HL)
60651 LD A,6
60653 LD (47673),A
Handler_InjuryCheck_Demons 60656 LD A,41 Jump to Handler_InjuryCheck_Zarn if object 41 (the demons) is not here.
60658 CALL IsObjectInCurrentRoom
60661 JR NZ,Handler_InjuryCheck_Zarn
60663 LD HL,47670 Arm the demons for six turns.
60666 SET 3,(HL)
60668 LD A,6
60670 LD (47674),A
Handler_InjuryCheck_Zarn 60673 LD A,42 Jump to Handler_InjuryCheck_Witch if object 42 (Zarn) is not here.
60675 CALL IsObjectInCurrentRoom
60678 JR NZ,Handler_InjuryCheck_Witch
60680 LD HL,47670 Arm Zarn for six turns.
60683 SET 4,(HL)
60685 LD A,6
60687 LD (47675),A
Handler_InjuryCheck_Witch 60690 LD A,46 Jump to Handler_InjuryCheck_OldMan if object 46 (the witch) is not here.
60692 CALL IsObjectInCurrentRoom
60695 JR NZ,Handler_InjuryCheck_OldMan
60697 LD A,67 Jump to Handler_InjuryCheck_WitchSeesRing when the player is carrying object 67 (the ring being worn).
60699 CALL IsObjectCarried
60702 JR Z,Handler_InjuryCheck_WitchSeesRing
60704 LD HL,56163 Print "The Witch sees you,chuckles gleefully,then throws some majic powder at you. You cannot move. She beats you with her broom.".
60707 CALL PrintStringAndANewline
60710 POP HL Discard the return address on the stack.
60711 LD HL,60195 Switch GameOver onto the stack so the player dies.
60714 EX (SP),HL
60715 RET Return.
Handler_InjuryCheck_WitchSeesRing 60716 LD HL,56286 Print "The Witch sees the ring on your hand,then she screams and vanishes in a puff of smoke.".
60719 CALL PrintStringAndANewline
60722 LD A,46 Destroy object 46 (the witch).
60724 CALL Handler_DestroyItem
Handler_InjuryCheck_OldMan 60727 LD A,47 Jump to Handler_InjuryCheck_GreatValley if object 47 (the old man) is not here.
60729 CALL IsObjectInCurrentRoom
60732 JR NZ,Handler_InjuryCheck_GreatValley
60734 LD A,47 Destroy object 47 (the old man).
60736 CALL Handler_DestroyItem
60739 LD A,3 Move object 3 (the bow) into the current room.
60741 CALL Handler_UpdateItemForTheCurrentRoom
60744 LD A,4 Move object 4 (the arrows) into the current room.
60746 CALL Handler_UpdateItemForTheCurrentRoom
60749 LD HL,55613 Print "He suddenly vanishes.".
60752 CALL PausePrintStringAndScroll
Handler_InjuryCheck_GreatValley 60755 LD A,(47771) Jump to Handler_InjuryCheck_Return unless the player is in room 5 (The Great Valley).
60758 CP 5
60760 JR NZ,Handler_InjuryCheck_Return
60762 LD A,44 Jump to Handler_InjuryCheck_Return if object 44 (Princess Mara) is not here.
60764 CALL IsObjectInCurrentRoom
60767 JR NZ,Handler_InjuryCheck_Return
60769 POP HL Discard the return address on the stack.
60770 JP GameComplete Jump back to GameComplete to announce the win.
Handler_InjuryCheck_Return 60773 RET Return.
Prev: 60569 Up: Map Next: 60774