Prev: BA09 Up: Map Next: BAB8
BA6A: Handle weapon energy loss
Used by the routines at B3B8 and BAB8.
Input
A The quantity of energy to loss
BA6A LD HL,$A22C Set A22C to the energy to loss
BA6D LD (HL),A
BA6E LD A,($A1AD) Return if weapon energy level equals zero
BA71 OR A
BA72 RET Z
BA73 LD A,($A1B1) Decrement weapon energy
BA76 SUB (HL)
BA77 LD ($A1B1),A
BA7A RET P Return if energy still a positive value
Weapon energy quantity has been depleated
BA7B ADD A,$32 Increment weapon energy by 50
BA7D LD ($A1B1),A
BA80 LD A,($A1AD) Decrement weapon energy level
BA83 DEC A
BA84 OR A if weapon energy level reaches zero jump forward
BA85 JP Z,$BA8C
BA88 LD ($A1AD),A Set the new weapon energy level
BA8B RET
weapon energy level is zero
BA8C LD A,($A207) Decrement the accumulated energy for weapons
BA8F DEC A
BA90 CP $FF Return if the accumulated energy is alredy zero
BA92 RET Z
BA93 LD ($A207),A Set the new number of accumulated energy for weapon
BA96 LD A,$01 Set color attribute blue for weapon icon
BA98 LD HL,($A1AE) Set HL to point to the current weapon icon HUD in attribute file
BA9B CALL $B9FE Set weapon icon in HUD to the color at A (atribute file)
BA9E LD HL,($A1AE) Point HL to the weapon icon into the attribute buffer
BAA1 LD DE,$8CFF
BAA4 ADD HL,DE
BAA5 CALL $B9FE Set weapon icon in HUD to the color at A (attribute buffer)
BAA8 LD HL,($A1AE) Set A015 to point to the previous weapon icon
BAAB DEC HL
BAAC DEC HL
BAAD LD ($A1AE),HL
BAB0 LD A,$05 Set weapon energy level to max
BAB2 LD ($A1AD),A
BAB5 JP $BA52 Jump to change the current weapon for Rex
Prev: BA09 Up: Map Next: BAB8