![]() |
Routines |
| Prev: 36916 | Up: Map | Next: 37074 |
|
Shoots an arrow at the current object. Reached through the action table at ActionTable, dispatched by Turn_RunTheHandlerIfPresent.
|
||||
| Action_Shoot | 36982 | LD A,25 | Pass object id 25 to the carried test. | |
| 36984 | CALL ConditionIsTheObjectCarried_0 | Call ConditionIsTheObjectCarried_0 to test whether the character whose turn it is is carrying it. | ||
| 36987 | LD HL,45345 | Point at the message "You are not carrying the bow" (45345). | ||
| 36990 | JP NC,PrintMessage | Jump back to PrintMessage if ConditionIsTheObjectCarried_0 found the object not carried, to print "You are not carrying the bow". | ||
| 36993 | CALL Action_TestTheSharedFlagBits | Call Action_TestTheSharedFlagBits to test the shared flag bits. | ||
|
If the message is held back, no arrow is shot.
|
||||
| 36996 | CALL ConditionSuppressTheMessage | Call ConditionSuppressTheMessage. If the message is held back, no arrow is shot. | ||
| 36999 | LD A,15 | Write 15 (attack) to *CurrentAction. | ||
| 37001 | LD (46823),A | |||
|
Test whose turn it is.
|
||||
| 37004 | LD A,(46826) | Jump to Action_Shoot_PointAtTheArrow if *CurrentCharacter is 70. | ||
| 37007 | CP 70 | |||
| 37009 | JR Z,Action_Shoot_PointAtTheArrow | |||
| 37011 | LD A,(46824) | Read *CurrentObject. | ||
| 37014 | CP 60 | Jump back to PrintMessage if the current object is 60. | ||
| 37016 | LD HL,45351 | |||
| 37019 | JP Z,PrintMessage | |||
| 37022 | LD A,8 | Roll a random number below 8. | ||
|
Roll a random number.
|
||||
| 37024 | CALL GetRandomNumber | Call GetRandomNumber to roll a number from the limit in A. | ||
| 37027 | CP 3 | Jump back to PrintMessage if the roll is below 3. | ||
| 37029 | JP C,PrintMessage | |||
| Action_Shoot_PointAtTheArrow | 37032 | LD IX,50410 | Point IX at 26 - "Strong Arrow". | |
|
Test the current object.
|
||||
| 37036 | LD A,(46824) | Jump to Action_Shoot_PrintTheHit if *CurrentObject is 26. | ||
| 37039 | CP 26 | |||
| 37041 | JR Z,Action_Shoot_PrintTheHit | |||
| 37043 | LD (IX+1),255 | Mark where this object is as unset. | ||
| Action_Shoot_PrintTheHit | 37047 | LD HL,45366 | Point at the message "the arrow{5} hits[0x07][0x15]" (45366). | |
|
Print the message at HL.
|
||||
| 37050 | CALL PrintMessage | Call PrintMessage to print message. | ||
| 37053 | LD IX,(46856) | Read *46856. | ||
| 37057 | CALL Condition_AnimalAndNotBroken | Call Condition_AnimalAndNotBroken to test whether the object is an animal and not broken. | ||
| 37060 | JP NZ,Action_UseTheOtherObject | Jump to Action_UseTheOtherObject unless Condition_AnimalAndNotBroken found the object is an animal and not broken. | ||
| 37063 | LD A,(46824) | Read *CurrentObject. | ||
| 37066 | CALL Turn_ThePlayerHasDied_0 | Call Turn_ThePlayerHasDied_0. The player dies if no object is left. | ||
| 37069 | LD A,6 | Pass 6 to the routine that names this object. | ||
| 37071 | JP Message_NameFromThisRecord | Jump to Message_NameFromThisRecord to print the object's name. | ||
| Prev: 36916 | Up: Map | Next: 37074 |