Prev: EC99 Up: Map Next: ED66
ECB6: 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 ECB6 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.
ECB7 LD A,$48
ECB9 CALL IsObjectInCurrentRoom
ECBC JR NZ,Handler_InjuryCheck_Next
ECBE LD HL,$DB38 Print "You can't move. You are too badly injured.".
ECC1 CALL PrintStringAndANewline
ECC4 RET Return.
Handler_InjuryCheck_Next ECC5 LD A,C Call MovePlayerToRoom to move the player into that room.
ECC6 CALL MovePlayerToRoom
ECC9 LD E,$00 Call Handler_DisplayRoom to describe the current room.
ECCB CALL Handler_DisplayRoom
ECCE LD A,$41 Jump to Handler_InjuryCheck_SlimeMonster if object 41 (the giant spider) is not here.
ECD0 CALL IsObjectInCurrentRoom
ECD3 JR NZ,Handler_InjuryCheck_SlimeMonster
ECD5 LD HL,$BA36 Arm the giant spider for six turns.
ECD8 SET 1,(HL)
ECDA LD A,$06
ECDC LD ($BA38),A
Handler_InjuryCheck_SlimeMonster ECDF LD A,$1E Jump to Handler_InjuryCheck_Demons if object 1E (the slime monster) is not here.
ECE1 CALL IsObjectInCurrentRoom
ECE4 JR NZ,Handler_InjuryCheck_Demons
ECE6 LD HL,$BA36 Arm the slime monster for six turns.
ECE9 SET 2,(HL)
ECEB LD A,$06
ECED LD ($BA39),A
Handler_InjuryCheck_Demons ECF0 LD A,$29 Jump to Handler_InjuryCheck_Zarn if object 29 (the demons) is not here.
ECF2 CALL IsObjectInCurrentRoom
ECF5 JR NZ,Handler_InjuryCheck_Zarn
ECF7 LD HL,$BA36 Arm the demons for six turns.
ECFA SET 3,(HL)
ECFC LD A,$06
ECFE LD ($BA3A),A
Handler_InjuryCheck_Zarn ED01 LD A,$2A Jump to Handler_InjuryCheck_Witch if object 2A (Zarn) is not here.
ED03 CALL IsObjectInCurrentRoom
ED06 JR NZ,Handler_InjuryCheck_Witch
ED08 LD HL,$BA36 Arm Zarn for six turns.
ED0B SET 4,(HL)
ED0D LD A,$06
ED0F LD ($BA3B),A
Handler_InjuryCheck_Witch ED12 LD A,$2E Jump to Handler_InjuryCheck_OldMan if object 2E (the witch) is not here.
ED14 CALL IsObjectInCurrentRoom
ED17 JR NZ,Handler_InjuryCheck_OldMan
ED19 LD A,$43 Jump to Handler_InjuryCheck_WitchSeesRing when the player is carrying object 43 (the ring being worn).
ED1B CALL IsObjectCarried
ED1E JR Z,Handler_InjuryCheck_WitchSeesRing
ED20 LD HL,$DB63 Print "The Witch sees you,chuckles gleefully,then throws some majic powder at you. You cannot move. She beats you with her broom.".
ED23 CALL PrintStringAndANewline
ED26 POP HL Discard the return address on the stack.
ED27 LD HL,$EB23 Switch GameOver onto the stack so the player dies.
ED2A EX (SP),HL
ED2B RET Return.
Handler_InjuryCheck_WitchSeesRing ED2C LD HL,$DBDE Print "The Witch sees the ring on your hand,then she screams and vanishes in a puff of smoke.".
ED2F CALL PrintStringAndANewline
ED32 LD A,$2E Destroy object 2E (the witch).
ED34 CALL Handler_DestroyItem
Handler_InjuryCheck_OldMan ED37 LD A,$2F Jump to Handler_InjuryCheck_GreatValley if object 2F (the old man) is not here.
ED39 CALL IsObjectInCurrentRoom
ED3C JR NZ,Handler_InjuryCheck_GreatValley
ED3E LD A,$2F Destroy object 2F (the old man).
ED40 CALL Handler_DestroyItem
ED43 LD A,$03 Move object 03 (the bow) into the current room.
ED45 CALL Handler_UpdateItemForTheCurrentRoom
ED48 LD A,$04 Move object 04 (the arrows) into the current room.
ED4A CALL Handler_UpdateItemForTheCurrentRoom
ED4D LD HL,$D93D Print "He suddenly vanishes.".
ED50 CALL PausePrintStringAndScroll
Handler_InjuryCheck_GreatValley ED53 LD A,($BA9B) Jump to Handler_InjuryCheck_Return unless the player is in room 05 (The Great Valley).
ED56 CP $05
ED58 JR NZ,Handler_InjuryCheck_Return
ED5A LD A,$2C Jump to Handler_InjuryCheck_Return if object 2C (Princess Mara) is not here.
ED5C CALL IsObjectInCurrentRoom
ED5F JR NZ,Handler_InjuryCheck_Return
ED61 POP HL Discard the return address on the stack.
ED62 JP GameComplete Jump back to GameComplete to announce the win.
Handler_InjuryCheck_Return ED65 RET Return.
Prev: EC99 Up: Map Next: ED66