|  | Routines | 
| Prev: B96B | Up: Map | Next: B9EF | 
| 
Used by the routine at D46C.
 
 | ||||||||
| B98E | LD HL,$A093 | Set A093 to the energy to increase | ||||||
| B991 | LD (HL),A | |||||||
| B992 | LD A,($A014) | Return if weapon energy level equals to 6 | ||||||
| B995 | CP $06 | |||||||
| B997 | RET Z | |||||||
| B998 | LD A,($A018) | Increment accumulated weapon energy | ||||||
| B99B | ADD A,(HL) | |||||||
| B99C | LD ($A018),A | |||||||
| B99F | CP $78 | Return if accumulated energy less than 120 | ||||||
| B9A1 | RET C | |||||||
| B9A2 | SUB $78 | Substract 120 to the accumulated energy | ||||||
| B9A4 | LD ($A018),A | |||||||
| B9A7 | LD A,($A014) | Increment weapon energy level | ||||||
| B9AA | INC A | |||||||
| B9AB | CP $06 | If weapon energy level is equal to 6 jump to increase the number of weapon that has energy | ||||||
| B9AD | JP Z,$B9C0 | |||||||
| B9B0 | LD ($A014),A | Set the new weapon energy level | ||||||
| B9B3 | SLA A | Set new laser duration based on energy level duration = energy level * 5 | ||||||
| B9B5 | SLA A | |||||||
| B9B7 | ADD A,$04 | |||||||
| B9B9 | LD ($A068),A | |||||||
| B9BC | CALL $A628 | Initialise drones configuration data buffer | ||||||
| B9BF | RET | |||||||
| 
increase the number of weapons that has energy
 | ||||||||
| B9C0 | LD A,($A06E) | Increase number of weapons that has energy | ||||||
| B9C3 | INC A | |||||||
| B9C4 | CP $05 | Return if number is 5 | ||||||
| B9C6 | RET Z | |||||||
| B9C7 | LD ($A06E),A | Set the new number into A06E | ||||||
| B9CA | LD HL,($A015) | Increment address into attribute file to point to the next weapon icon in HUD | ||||||
| B9CD | INC HL | |||||||
| B9CE | INC HL | |||||||
| B9CF | LD ($A015),HL | |||||||
| B9D2 | LD A,$01 | Set the new weapon energy level to 1 | ||||||
| B9D4 | LD ($A014),A | |||||||
| B9D7 | LD HL,$A04F | Set HL to point to data buffer for weapons inventory | ||||||
| B9DA | LD A,($A06E) | Set A the accumulated energy weapon | ||||||
| B9DD | INC A | Set B to the number of weapons that permits the accumulated energy | ||||||
| B9DE | LD B,A | |||||||
| B9DF | LD E,$00 | Set E the current possible weapon | ||||||
| B9E1 | LD A,(HL) | Rex has this weapon in inventory? | ||||||
| B9E2 | OR A | |||||||
| B9E3 | JP Z,$B9EA | Jump forward if not | ||||||
| B9E6 | LD A,E | Set this weapon for the current weapon of Rex | ||||||
| B9E7 | LD ($A013),A | |||||||
| B9EA | INC E | Increase the weapon number | ||||||
| B9EB | INC HL | Increase the addres to point to the next weapon in inventory | ||||||
| B9EC | DJNZ $B9E1 | Jump back until looped all the permited weapons for the accumulated energy | ||||||
| B9EE | RET | |||||||
| Prev: B96B | Up: Map | Next: B9EF |