Prev: 26987 Up: Map Next: 27023
26996: Fire Repellent Spray
Used by the routine at FireWeapon.
Starts a repellent spray in the weapon slot held in FreeWeaponSlot, in front of Robbie. It is not fired if Robbie is too close to the edge of the play area.
Input
DE State_Robbie_Colour (the colour of Robbie)
HL The weapon object
FireRepellentSpray 26996 CALL GetRobbieDirection Get the X position and the direction using GetRobbieDirection.
26999 JR Z,FireRepellentSpray_Right Jump to FireRepellentSpray_Right if the spray goes to the right.
27001 CP 48 Return if Robbie is too close to the left edge.
27003 RET C
27004 SUB 12 Subtract 12 from the X position (so it starts to the left of Robbie).
27006 LD (HL),72 Write 72 (a repellent spray moving left) to the state of the weapon.
FireRepellentSpray_Colour 27008 LD B,69 B=69 (the colour of the spray).
27010 JP CreateWeapon Jump to CreateWeapon to create the weapon.
FireRepellentSpray_Right 27013 CP 192 Return if Robbie is too close to the right edge.
27015 RET NC
27016 ADD A,24 Add 24 to the X position (so it starts to the right of Robbie).
27018 LD (HL),8 Write 8 (a repellent spray moving right) to the state of the weapon.
27020 JP FireRepellentSpray_Colour Jump to FireRepellentSpray_Colour.
Prev: 26987 Up: Map Next: 27023