Prev: EC99 Up: Map Next: ED66
ECB6: Handler: Injury Check
Used by the routines at MovePlayer, 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 C=A.
ECB7 LD A,$48 Call ValidateItemPresent with item 48: "You are seriously injured".
ECB9 CALL ValidateItemPresent
ECBC JR NZ,Handler_InjuryCheck_Next Jump to Handler_InjuryCheck_Next if "You are seriously injured" is not in the current room.
Print "You can't move. You are too badly injured.".
ECBE LD HL,$DB38 HL=Messaging_YouCantMove.
ECC1 CALL PrintStringAndNewline Call PrintStringAndNewline.
ECC4 RET Return.
Move into the requested room and arm local dangers.
Handler_InjuryCheck_Next ECC5 LD A,C A=C.
ECC6 CALL MovePlayerToRoom Call MovePlayerToRoom.
ECC9 LD E,$00 E=00.
ECCB CALL Handler_DisplayRoom Call Handler_DisplayRoom.
ECCE LD A,$41 Jump to Handler_InjuryCheck_SlimeMonster if ValidateItemPresent reports that "A giant spider. It advances toward you" isn't in the current room.
ECD0 CALL ValidateItemPresent
ECD3 JR NZ,Handler_InjuryCheck_SlimeMonster
Arm the giant spider for six turns.
ECD5 LD HL,$BA36 HL=Flag_TurnBasedEventState.
ECD8 SET 1,(HL) Set bit 1 of *HL.
ECDA LD A,$06 A=06.
ECDC LD ($BA38),A Write A to *Counter_Spider.
Is the slime monster here?
Handler_InjuryCheck_SlimeMonster ECDF LD A,$1E Jump to Handler_InjuryCheck_Demons if ValidateItemPresent reports that "A monster from the slime" isn't in the current room.
ECE1 CALL ValidateItemPresent
ECE4 JR NZ,Handler_InjuryCheck_Demons
Arm the slime monster for six turns.
ECE6 LD HL,$BA36 HL=Flag_TurnBasedEventState.
ECE9 SET 2,(HL) Set bit 2 of *HL.
ECEB LD A,$06 A=06.
ECED LD ($BA39),A Write A to *Counter_SlimeMonster.
Are the demons here?
Handler_InjuryCheck_Demons ECF0 LD A,$29 Jump to Handler_InjuryCheck_Zarn if ValidateItemPresent reports that "Some demons are attacking you. They scream and jab at you with vicious tridents" isn't in the current room.
ECF2 CALL ValidateItemPresent
ECF5 JR NZ,Handler_InjuryCheck_Zarn
Arm the demons for six turns.
ECF7 LD HL,$BA36 HL=Flag_TurnBasedEventState.
ECFA SET 3,(HL) Set bit 3 of *HL.
ECFC LD A,$06 A=06.
ECFE LD ($BA3A),A Write A to *Counter_Demons.
Is Zarn here?
Handler_InjuryCheck_Zarn ED01 LD A,$2A Jump to Handler_InjuryCheck_Witch if ValidateItemPresent reports that "The Wizard,Zarn. He prepares to cast a spell over you" isn't in the current room.
ED03 CALL ValidateItemPresent
ED06 JR NZ,Handler_InjuryCheck_Witch
Arm Zarn for six turns.
ED08 LD HL,$BA36 HL=Flag_TurnBasedEventState.
ED0B SET 4,(HL) Set bit 4 of *HL.
ED0D LD A,$06 A=06.
ED0F LD ($BA3B),A Write A to *Counter_Wizard.
Is the witch here?
Handler_InjuryCheck_Witch ED12 LD A,$2E Jump to Handler_InjuryCheck_OldMan if ValidateItemPresent reports that "The Witch" isn't in the current room.
ED14 CALL ValidateItemPresent
ED17 JR NZ,Handler_InjuryCheck_OldMan
ED19 LD A,$43 Jump to Handler_InjuryCheck_WitchSeesRing if "A ring,which you are wearing" is held.
ED1B CALL IsObjectCarried
ED1E JR Z,Handler_InjuryCheck_WitchSeesRing
Print "The Witch sees you,chuckles gleefully,then throws some majic powder at you. You cannot move. She beats you with her broom.".
ED20 LD HL,$DB63 HL=Messaging_TheWitchSeesYouChuckles.
ED23 CALL PrintStringAndNewline Call PrintStringAndNewline.
ED26 POP HL Restore HL from the stack.
ED27 LD HL,$EB23 Switch GameOver onto the stack so the next return actions a "game over".
ED2A EX (SP),HL
ED2B RET Return.
Print "The Witch sees the ring on your hand,then she screams and vanishes in a puff of smoke.".
Handler_InjuryCheck_WitchSeesRing ED2C LD HL,$DBDE HL=Messaging_TheWitchSeesTheRingOn.
ED2F CALL PrintStringAndNewline Call PrintStringAndNewline.
ED32 LD A,$2E Call Handler_DestroyItem with item 2E: "The Witch".
ED34 CALL Handler_DestroyItem
Is the old man here?
Handler_InjuryCheck_OldMan ED37 LD A,$2F Jump to Handler_InjuryCheck_GreatValley if ValidateItemPresent reports that "The Old Man. He lays down a bow and some arrows. He says:- 'These are tipped wit" isn't in the current room.
ED39 CALL ValidateItemPresent
ED3C JR NZ,Handler_InjuryCheck_GreatValley
ED3E LD A,$2F Call Handler_DestroyItem with item 2F: "The Old Man. He lays down a bow and some arrows. He says:- 'These are tipped wit".
ED40 CALL Handler_DestroyItem
ED43 LD A,$03 Call Handler_UpdateItemForTheCurrentRoom with item 03: "A bow".
ED45 CALL Handler_UpdateItemForTheCurrentRoom
ED48 LD A,$04 Call Handler_UpdateItemForTheCurrentRoom with item 04: "Some arrows".
ED4A CALL Handler_UpdateItemForTheCurrentRoom
Print "He suddenly vanishes.".
ED4D LD HL,$D93D HL=Messaging_HeSuddenlyVanishes.
ED50 CALL PausePrintStringAndScroll Call PausePrintStringAndScroll.
Has the player brought Mara to the Great Valley?
Handler_InjuryCheck_GreatValley ED53 LD A,($BA9B) Jump to Handler_InjuryCheck_Return if *CurrentRoom isn't room 05: " The Great Valley".
ED56 CP $05
ED58 JR NZ,Handler_InjuryCheck_Return
ED5A LD A,$2C Jump to Handler_InjuryCheck_Return if ValidateItemPresent reports that "The Princess,Mara" isn't in the current room.
ED5C CALL ValidateItemPresent
ED5F JR NZ,Handler_InjuryCheck_Return
ED61 POP HL Restore HL from the stack.
ED62 JP GameComplete Jump to GameComplete.
Handler_InjuryCheck_Return ED65 RET Return.
Prev: EC99 Up: Map Next: ED66