Prev: 54782 Up: Map Next: 54865
54842: Gradual energy drain/restore for Maroc's ongoing effect spells
Used by the routine at 54782.
The following spells have a 'trickle' drain/heal effect on Maroc's energy while they're in effect:
Spell Effect on energy
SHIELD -1
UNSEEN -1
PROTECT -1
AMULET -1
DEFENCE -1
WRAITHBANE -4
CHALICE +5
Each 'trickle' of drain/restore takes place every 16 game cycles:
54842 LD A,(60074) Incrementing game counter
54845 LD C,A (This instruction/C register not needed)
54846 AND 15 Check if any of bits 0-3 are set
54848 CP 0
54850 JR NZ,54865 If so, don't do anything but instead skip to next routine
Every 16th game cycle:
54852 LD A,(60137) Currently active 'effect' spell
54855 CP 0
54857 JR Z,54865 If no active effect spells, jump to next routine
54859 LD A,(60373) Ongoing effect spell - amount of energy to drain/heal (see table)
54862 CALL 58316 Increase/decrease Maroc's energy accordingly
Prev: 54782 Up: Map Next: 54865