Prev: F2FD Up: Map Next: F48B
F30B: Handler: Fight Opponent
Used by the routine at Action_Kill.
Fight whichever opponent the player named.
Handler_FightOpponent F30B LD HL,$E87D Jump to Handler_FightOpponent_ElfBow unless the player named the elf with the sword.
F30E CALL Parser_AdvanceToSeparator
F311 JR NZ,Handler_FightOpponent_ElfBow
F313 LD HL,$E711 Call Parser_SkipToken to skip to the object named by this phrase.
F316 CALL Parser_SkipToken
F319 BIT 7,A Jump back to Response_HesAlreadyDead when the named opponent is already dead.
F31B JP Z,Response_HesAlreadyDead
F31E LD ($BB4D),A Call Handler_RequireSword to make sure the player is holding the sword.
F321 CALL Handler_RequireSword
F324 LD A,$0A Call Handler_ResolveAttack to resolve the attack on the named opponent.
F326 CALL Handler_ResolveAttack
F329 CALL Handler_ApplyCombatResult Call Handler_ApplyCombatResult to turn the defeated opponent into its corpse.
F32C LD A,($BB4D) Jump to Handler_FightOpponent_Next unless the value 82 matches.
F32F CP $82
F331 JR NZ,Handler_FightOpponent_Next
F333 LD A,$86 Remove object 86 (the centaur) from the game.
F335 CALL Handler_RemoveItemFromPlay
Handler_FightOpponent_Next F338 LD HL,$DF44 Print "Your blow strikes true.".
F33B CALL PausePrintStringAndScroll
Reply with "The Elf is dead.".
F33E LD HL,$DFA3 Print "The Elf is dead." and return to the game loop.
F341 JP PrintResponse
Handler_FightOpponent_ElfBow F344 LD HL,$E881 Jump to Handler_FightOpponent_WarriorSword unless the player named the elf with the bow.
F347 CALL Parser_AdvanceToSeparator
F34A JR NZ,Handler_FightOpponent_WarriorSword
F34C LD HL,$E711 Call Parser_SkipToken to skip to the object named by this phrase.
F34F CALL Parser_SkipToken
F352 BIT 7,A Jump back to Response_HesAlreadyDead when the named opponent is already dead.
F354 JP Z,Response_HesAlreadyDead
F357 LD ($BB4D),A Call Handler_CheckWeapon to make sure the player is holding the bow and some arrows.
F35A CALL Handler_CheckWeapon
F35D LD A,$05 Call Handler_AnnounceArrow to announce the arrow.
F35F CALL Handler_AnnounceArrow
F362 CALL Handler_ApplyCombatResult Call Handler_ApplyCombatResult to turn the defeated opponent into its corpse.
F365 LD A,($BB4D) Jump to Handler_FightOpponent_PerfectShot unless the value 82 matches.
F368 CP $82
F36A JR NZ,Handler_FightOpponent_PerfectShot
F36C LD A,$86 Remove object 86 (the centaur) from the game.
F36E CALL Handler_RemoveItemFromPlay
Handler_FightOpponent_PerfectShot F371 LD HL,$DF0E Print "Well done! A perfect shot.".
F374 CALL PausePrintStringAndScroll
Reply with "The Elf is dead.".
F377 LD HL,$DFA3 Print "The Elf is dead." and return to the game loop.
F37A JP PrintResponse
Handler_FightOpponent_WarriorSword F37D LD HL,$E885 Jump to Handler_FightOpponent_WarriorBow unless the player named the dead warrior.
F380 CALL Parser_AdvanceToSeparator
F383 JR NZ,Handler_FightOpponent_WarriorBow
F385 LD HL,$E71F Call Parser_SkipToken to skip to the object named by this phrase.
F388 CALL Parser_SkipToken
F38B BIT 7,A Jump back to Response_ItsAlreadyDead when the named opponent is already dead.
F38D JP Z,Response_ItsAlreadyDead
F390 LD ($BB4D),A Call Handler_RequireSword to make sure the player is holding the sword.
F393 CALL Handler_RequireSword
F396 LD A,$01 Call Handler_ResolveAttack to resolve the attack on the named opponent.
F398 CALL Handler_ResolveAttack
F39B CALL Handler_ApplySecondCombatResult Call Handler_ApplySecondCombatResult to turn the second defeated opponent into its corpse.
F39E LD HL,$DF44 Print "Your blow strikes true.".
F3A1 CALL PausePrintStringAndScroll
Reply with "The lizard falls to the ground. It is dead.".
F3A4 LD HL,$DFB4 Print "The lizard falls to the ground. It is dead." and return to the game loop.
F3A7 JP PrintResponse
Handler_FightOpponent_WarriorBow F3AA LD HL,$E88E Jump to Handler_FightOpponent_MonsterBow unless the player named the dead warrior.
F3AD CALL Parser_AdvanceToSeparator
F3B0 JR NZ,Handler_FightOpponent_MonsterBow
F3B2 LD HL,$E71F Call Parser_SkipToken to skip to the object named by this phrase.
F3B5 CALL Parser_SkipToken
F3B8 BIT 7,A Jump back to Response_ItsAlreadyDead when the named opponent is already dead.
F3BA JP Z,Response_ItsAlreadyDead
F3BD LD ($BB4D),A Call Handler_CheckWeapon to make sure the player is holding the bow and some arrows.
F3C0 CALL Handler_CheckWeapon
F3C3 LD A,$05 Call Handler_AnnounceArrow to announce the arrow.
F3C5 CALL Handler_AnnounceArrow
F3C8 CALL Handler_ApplySecondCombatResult Call Handler_ApplySecondCombatResult to turn the second defeated opponent into its corpse.
F3CB LD HL,$DF0E Print "Well done! A perfect shot.".
F3CE CALL PausePrintStringAndScroll
Reply with "The lizard falls to the ground. It is dead.".
F3D1 LD HL,$DFB4 Print "The lizard falls to the ground. It is dead." and return to the game loop.
F3D4 JP PrintResponse
Handler_FightOpponent_MonsterBow F3D7 LD HL,$E8A4 Jump to Handler_FightOpponent_GlowingRock unless the player named the monster with the bow.
F3DA CALL Parser_AdvanceToSeparator
F3DD JR NZ,Handler_FightOpponent_GlowingRock
F3DF CALL Handler_CheckWeapon Call Handler_CheckWeapon to make sure the player is holding the bow and some arrows.
F3E2 LD A,$05 Call Handler_AnnounceArrow to announce the arrow.
F3E4 CALL Handler_AnnounceArrow
F3E7 LD A,$1E Destroy object 1E (the slime monster).
F3E9 CALL Handler_DestroyItem
F3EC LD HL,$DF0E Print "Well done! A perfect shot.".
F3EF CALL PausePrintStringAndScroll
Reply with "The stricken monster slides back into the oozing slime.".
F3F2 LD HL,$E009 Print "The stricken monster slides back into the oozing slime." and return to the game loop.
F3F5 JP PrintResponse
Handler_FightOpponent_GlowingRock F3F8 LD HL,$E897 Jump to Handler_FightOpponent_ClosedDoor unless the player named the glowing rock.
F3FB CALL Parser_AdvanceToSeparator
F3FE JR NZ,Handler_FightOpponent_ClosedDoor
F400 LD A,$16 Jump to Response_ItsAlreadyDead if object 16 (the dragon) is not here.
F402 CALL IsObjectInCurrentRoom
F405 JP NZ,Response_ItsAlreadyDead
F408 CALL Handler_CheckWeapon Call Handler_CheckWeapon to make sure the player is holding the bow and some arrows.
F40B XOR A Call Handler_AnnounceArrow to announce the arrow.
F40C CALL Handler_AnnounceArrow
F40F LD BC,$1617 Replace object 16 (the dragon) with object 17 (the dead dragon).
F412 CALL TransformItem
Reply with "You have killed it.".
F415 LD HL,$DFE0 Print "You have killed it." and return to the game loop.
F418 JP PauseAndPrintResponse
Handler_FightOpponent_ClosedDoor F41B LD HL,$E89B Jump to Handler_FightOpponent_LogBridgeSword unless the player named a closed door.
F41E CALL Parser_AdvanceToSeparator
F421 JR NZ,Handler_FightOpponent_LogBridgeSword
F423 LD A,$8A Jump to Response_ShesAlreadyDead if object 8A (the wood nymph) is not here.
F425 CALL IsObjectInCurrentRoom
F428 JP NZ,Response_ShesAlreadyDead
F42B CALL Handler_CheckWeapon Call Handler_CheckWeapon to make sure the player is holding the bow and some arrows.
F42E XOR A Call Handler_AnnounceArrow to announce the arrow.
F42F CALL Handler_AnnounceArrow
F432 LD BC,$8A1C Replace object 8A (the wood nymph) with object 1C (the dead wood nymph).
F435 CALL TransformItem
F438 LD A,$89 Destroy object 89 (the nymph's glimpse).
F43A CALL Handler_DestroyItem
Reply with "You have killed her.".
F43D LD HL,$DFF4 Print "You have killed her." and return to the game loop.
F440 JP PauseAndPrintResponse
Handler_FightOpponent_LogBridgeSword F443 LD HL,$E8A8 Jump to Handler_FightOpponent_LogBridgeBow unless the player named the log bridge.
F446 CALL Parser_AdvanceToSeparator
F449 JR NZ,Handler_FightOpponent_LogBridgeBow
F44B CALL Handler_RequireSword Call Handler_RequireSword to make sure the player is holding the sword.
F44E LD A,$0A Call Handler_ResolveAttack to resolve the attack on the named opponent.
F450 CALL Handler_ResolveAttack
F453 LD A,$29 Destroy object 29 (the demons).
F455 CALL Handler_DestroyItem
F458 LD A,$49 Open the way east, then pause and print "The demons scream with panic, then fade away." and return to the game loop.
F45A LD ($EADA),A
F45D LD HL,$E041
F460 JP PauseAndPrintResponse
Handler_FightOpponent_LogBridgeBow F463 LD HL,$E8AC Jump to Handler_FightOpponent_RingWornSword unless the player named the log bridge.
F466 CALL Parser_AdvanceToSeparator
F469 JR NZ,Handler_FightOpponent_RingWornSword
F46B CALL Handler_CheckWeapon Call Handler_CheckWeapon to make sure the player is holding the bow and some arrows.
Reply with "Arrows have no effect.".
F46E LD HL,$E06F Print "Arrows have no effect." and return to the game loop.
F471 JP PrintResponse
Handler_FightOpponent_RingWornSword F474 LD HL,$E8B0 Jump to Handler_KillTheWarrior_RingWornBow unless the player named the ring being worn.
F477 CALL Parser_AdvanceToSeparator
F47A JR NZ,Handler_KillTheWarrior_RingWornBow
F47C LD A,$27 Jump to Response_HesAlreadyDead when object 27 (the dead blacksmith) is here.
F47E CALL IsObjectInCurrentRoom
F481 JP Z,Response_HesAlreadyDead
F484 CALL Handler_RequireSword Call Handler_RequireSword to make sure the player is holding the sword.
F487 XOR A Call Handler_ResolveAttack to resolve the attack on the named opponent.
F488 CALL Handler_ResolveAttack
Prev: F2FD Up: Map Next: F48B