Prev: F851 Up: Map Next: F91B
F8D9: Action: Shooting
Used by the routine at Action_Kill.
Action_Shooting F8D9 PUSH BC Stash BC on the stack.
Print "You take a shot....".
F8DA LD HL,$E0EB HL=Messaging_TakeAShot.
F8DD CALL PrintStringAndNewline Call PrintStringAndNewline.
F8E0 LD A,$05 A=05.
F8E2 CALL GenerateRandomNumber Call GenerateRandomNumber.
F8E5 POP BC Restore BC from the stack.
F8E6 JR NZ,Action_Shooting_Success Jump to Action_Shooting_Success if the random generator returns a non-zero response.
Print "Bad luck. You missed.".
F8E8 LD HL,$E122 HL=Messaging_YouMissed.
F8EB JP PausePrintStringAndScroll_Alias Jump to PausePrintStringAndScroll_Alias.
Action_Shooting_Success F8EE LD A,B A=B.
F8EF SUB $03 A-=03.
F8F1 RES 7,A Reset bit 7 of A.
F8F3 LD E,A E=A.
F8F4 LD D,$00 D=00.
F8F6 LD HL,$F904 HL=F904.
F8F9 ADD HL,DE HL+=DE.
F8FA LD C,(HL) C=*HL.
F8FB CALL TransformItem Call TransformItem.
Print "Good shooting! The pirate is dead.".
F8FE LD HL,$E0FF HL=Messaging_PirateDead.
F901 JP PausePrintStringAndScroll_Alias Jump to PausePrintStringAndScroll_Alias.
The dead pirate that takes the place of each pirate when it is shot. Action_Shooting_Success indexes this table with the scenic event number minus 03 (so event 83 is the first entry), and TransformItem swaps the event for the item.
F904 DEFB $23 Event 83 (a pirate): item 23, "A dead pirate".
F905 DEFB $24 Event 84 (a pirate): item 24, "A dead pirate".
F906 DEFB $25 Event 85 (a pirate): item 25, "A dead pirate".
F907 DEFB $00,$00 Events 86 and 87 (the water snake and the spider): not used, as Action_Kill_3 only ever finds a pirate.
F909 DEFB $26 Event 88 (the pirate from the beach): item 26, "A dead pirate".
This entry point is used by the routine at Action_Kill.
Action_Shooting_0 F90A LD HL,$EAA2 Call MatchPhraseTokens with PhraseTokens_ParrotWithGun.
F90D CALL MatchPhraseTokens
F910 JR NZ,Action_Shooting_1 Jump to Action_Shooting_1 if the token isn't for the parrot with the gun.
Print "It's already dead.".
F912 LD HL,$E14B HL=Messaging_AlreadyDead.
F915 JP PrintStringAndNewline_Alias Jump to PrintStringAndNewline_Alias.
Action_Shooting_1 F918 JP Response_YouCant_Duplicate Jump to Response_YouCant_Duplicate.
Prev: F851 Up: Map Next: F91B