Routines |
Prev: E77E | Up: Map | Next: E7C2 |
Used by the routine at E77E.
|
||||
The player has selected (FIRE button press) and then confirmed (second FIRE button press) a spell from the list.
|
||||
E7A2 | LD A,$00 | Reset fire button register, store zero value | ||
E7A4 | LD ($EB32),A | |||
The following routine decrements the number of charges left for the spell.
'Active effect' spells (SHIELD, UNSEEN etc.) are deactivated by casting the same spell again. Therefore, spell charges for these spells are not reduced now, but later at EA34 when the spell is cast again to 'deactivate' it.
|
||||
E7A7 | LD A,($EBC7) | Check the 'spell type' byte | ||
E7AA | CP $04 | Is it an 'ongoing effect' spell (SHIELD, UNSEEN, PROTECT, AMULET, DEFENCE, WRAITHBANE, CHALICE)? | ||
E7AC | JR Z,$E7C2 | If so, skip this routine | ||
E7AE | LD A,($EBC8) | Number of spell 'charges' left | ||
E7B1 | CP $FF | 255 = infinite charges - no need to decrease charges | ||
E7B3 | JR Z,$E7C0 | |||
E7B5 | DEC A | Otherwise, reduce charges by 1 | ||
E7B6 | LD ($EBC8),A | ...and re-store. | ||
E7B9 | CP $00 | Zero charges left? | ||
E7BB | JR NZ,$E7C0 | |||
E7BD | LD ($EBC5),A | If so, set the spell to 'not acquired' (0) to remove it from the list as this is its last use | ||
E7C0 | JR $E7ED | ...and set the flashing icon in the top right of the scroll |
Prev: E77E | Up: Map | Next: E7C2 |