![]() |
Routines |
| Prev: EA1D | Up: Map | Next: EAA1 |
|
|
||||
|
The player has cast the same spell as the current active ongoing effect spell - this deactivates the effect.
Clear the active spell name from small scroll in bottom right of screen:
|
||||
| EA34 | LD L,$F9 | Low byte of screen display address for left-hand character in scroll | ||
| EA36 | LD A,$07 | 7 characters to clear | ||
| EA38 | LD B,$08 | 8 pixel lines in each character | ||
| EA3A | LD H,$50 | High byte of screen display address | ||
| EA3C | LD (HL),$00 | Clear display byte | ||
| EA3E | INC H | Move down one pixel | ||
| EA3F | DJNZ $EA3C | Repeat x 8 pixels | ||
| EA41 | INC L | Move right one character square | ||
| EA42 | DEC A | Repeat for 7 character squares | ||
| EA43 | JR NZ,$EA38 | |||
|
Check which spell was deactivated, and reset the relevant effect accordingly:
|
||||
| EA45 | LD A,($EAE9) | Check which effect spell was activated - spell number (0-27) in list at 6DFC | ||
| EA48 | CP $02 | SHIELD spell | ||
| EA4A | JR Z,$EA56 | |||
| EA4C | CP $0B | PROTECT spell | ||
| EA4E | JR Z,$EA56 | |||
| EA50 | CP $12 | DEFENCE spell | ||
| EA52 | LD A,$00 | |||
| EA54 | JR NZ,$EA58 | |||
| EA56 | LD A,$FF | SHIELD, PROTECT and DEFENCE also have a graphic shimmering barrier effect, which will need to be deactivated/erased. Set flag (255) to indicate that any current on-screen graphics will get erased. | ||
|
For 'effect' spells, the number of charges for the spell is reduced when the spell is deactivated, otherwise the final charge would make the effect permanent.
|
||||
| EA58 | LD ($EAE9),A | Set active 'effect' spell to 0, or 255 if SHIELD, PROTECT or DEFENCE. | ||
| EA5B | LD A,$00 | |||
| EA5D | LD ($EBD5),A | Spell no longer active, so set the ongoing energy drain (e.g. SHIELD) or heal (e.g. CHALICE) byte value to zero | ||
| EA60 | LD A,($EBC8) | Check number of charges for spell | ||
| EA63 | CP $FF | If unlimited charges, no need to decrease | ||
| EA65 | JR Z,$EA72 | |||
|
Decrease number of spell charges
|
||||
| EA67 | DEC A | Decrement spell charges counter | ||
| EA68 | LD ($EBC8),A | ..and store new value. | ||
| EA6B | CP $00 | Out of spell charges? | ||
| EA6D | JR NZ,$EA72 | |||
| EA6F | LD ($EBC5),A | ...If so, set the spell's acquired/owned flag to 0, so that the spell gets removed from Maroc's spell list | ||
|
Sets the attributes of a 2x2 square in the top right of the scroll (that may have been flashing), and a line of 16 characters of the bottom of the scroll, to INK 0 (black) PAPER 6 (yellow).
|
||||
| EA72 | LD HL,$5A57 | Top right of scroll | ||
| EA75 | LD (HL),$30 | Set to INK 0, PAPER 6 | ||
| EA77 | INC HL | Adjacent square | ||
| EA78 | LD (HL),$30 | Ditto | ||
| EA7A | LD HL,$5A77 | Same for the 2 squares below | ||
| EA7D | LD (HL),$30 | |||
| EA7F | INC HL | |||
| EA80 | LD (HL),$30 | |||
|
It's not clear why the bottom row of the scroll also needs setting - it may be that originally active effect spell names appeared here, rather than over on the bottom right.
|
||||
| EA82 | LD HL,$5AC7 | Bottom left of scroll | ||
| EA85 | LD B,$10 | 16 characters along the bottom of the scroll | ||
| EA87 | LD (HL),$30 | Set to INK 0, PAPER 6 | ||
| EA89 | INC HL | |||
| EA8A | DJNZ $EA87 | Continue for rest of the row | ||
| EA8C | LD HL,$EBC5 | Spell data buffer | ||
| EA8F | LD DE,($EAE7) | Get spell data address pointer to spell in list at 6DFC | ||
| EA93 | LD BC,$0010 | 16 bytes of data to copy | ||
| EA96 | LDIR | |||
| EA98 | LD A,$00 | Set spell selection status byte to 0 | ||
| EA9A | LD ($EAE1),A | |||
| EA9D | CALL $DEF9 | Clear all of the scroll text | ||
| EAA0 | RET | |||
| Prev: EA1D | Up: Map | Next: EAA1 |