Prev: 9034 Up: Map Next: 90D2
9076: Action: Shoot
Shoots an arrow at the current object. Reached through the action table at ActionTable, dispatched by Turn_RunTheHandlerIfPresent.
Action_Shoot 9076 LD A,$19 Pass object id 19 to the carried test.
9078 CALL ConditionIsTheObjectCarried_0 Call ConditionIsTheObjectCarried_0 to test whether the character whose turn it is is carrying it.
907B LD HL,$B121 Point at the message "You are not carrying the bow" (B121).
907E JP NC,PrintMessage Jump back to PrintMessage if ConditionIsTheObjectCarried_0 found the object not carried, to print "You are not carrying the bow".
9081 CALL Action_TestTheSharedFlagBits Call Action_TestTheSharedFlagBits to test the shared flag bits.
If the message is held back, no arrow is shot.
9084 CALL ConditionSuppressTheMessage Call ConditionSuppressTheMessage. If the message is held back, no arrow is shot.
9087 LD A,$0F Write 0F (attack) to *CurrentAction.
9089 LD ($B6E7),A
Test whose turn it is.
908C LD A,($B6EA) Jump to Action_Shoot_PointAtTheArrow if *CurrentCharacter is 46.
908F CP $46
9091 JR Z,Action_Shoot_PointAtTheArrow
9093 LD A,($B6E8) Read *CurrentObject.
9096 CP $3C Jump back to PrintMessage if the current object is 3C.
9098 LD HL,$B127
909B JP Z,PrintMessage
909E LD A,$08 Roll a random number below 08.
Roll a random number.
90A0 CALL GetRandomNumber Call GetRandomNumber to roll a number from the limit in A.
90A3 CP $03 Jump back to PrintMessage if the roll is below 03.
90A5 JP C,PrintMessage
Action_Shoot_PointAtTheArrow 90A8 LD IX,$C4EA Point IX at $1A - "Strong Arrow".
Test the current object.
90AC LD A,($B6E8) Jump to Action_Shoot_PrintTheHit if *CurrentObject is 1A.
90AF CP $1A
90B1 JR Z,Action_Shoot_PrintTheHit
90B3 LD (IX+$01),$FF Mark where this object is as unset.
Action_Shoot_PrintTheHit 90B7 LD HL,$B136 Point at the message "the arrow{5} hits[0x07][0x15]" (B136).
Print the message at HL.
90BA CALL PrintMessage Call PrintMessage to print message.
90BD LD IX,($B708) Read *B708.
90C1 CALL Condition_AnimalAndNotBroken Call Condition_AnimalAndNotBroken to test whether the object is an animal and not broken.
90C4 JP NZ,Action_UseTheOtherObject Jump to Action_UseTheOtherObject unless Condition_AnimalAndNotBroken found the object is an animal and not broken.
90C7 LD A,($B6E8) Read *CurrentObject.
90CA CALL Turn_ThePlayerHasDied_0 Call Turn_ThePlayerHasDied_0. The player dies if no object is left.
90CD LD A,$06 Pass 06 to the routine that names this object.
90CF JP Message_NameFromThisRecord Jump to Message_NameFromThisRecord to print the object's name.
Prev: 9034 Up: Map Next: 90D2