Prev: 59933 Up: Map Next: 60065
59956: Deactivate the currently active effect spell
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:
shield spell active
59956 LD L,249 Low byte of screen display address for left-hand character in scroll
59958 LD A,7 7 characters to clear
59960 LD B,8 8 pixel lines in each character
59962 LD H,80 High byte of screen display address
59964 LD (HL),0 Clear display byte
59966 INC H Move down one pixel
59967 DJNZ 59964 Repeat x 8 pixels
59969 INC L Move right one character square
59970 DEC A Repeat for 7 character squares
59971 JR NZ,59960
Check which spell was deactivated, and reset the relevant effect accordingly:
59973 LD A,(60137) Check which effect spell was activated - spell number (0-27) in list at 28156
59976 CP 2 SHIELD spell
59978 JR Z,59990
59980 CP 11 PROTECT spell
59982 JR Z,59990
59984 CP 18 DEFENCE spell
59986 LD A,0
59988 JR NZ,59992
59990 LD A,255 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.
59992 LD (60137),A Set active 'effect' spell to 0, or 255 if SHIELD, PROTECT or DEFENCE.
59995 LD A,0
59997 LD (60373),A Spell no longer active, so set the ongoing energy drain (e.g. SHIELD) or heal (e.g. CHALICE) byte value to zero
60000 LD A,(60360) Check number of charges for spell
60003 CP 255 If unlimited charges, no need to decrease
60005 JR Z,60018
Decrease number of spell charges
60007 DEC A Decrement spell charges counter
60008 LD (60360),A ..and store new value.
60011 CP 0 Out of spell charges?
60013 JR NZ,60018
60015 LD (60357),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).
60018 LD HL,23127 Top right of scroll
60021 LD (HL),48 Set to INK 0, PAPER 6
60023 INC HL Adjacent square
60024 LD (HL),48 Ditto
60026 LD HL,23159 Same for the 2 squares below
60029 LD (HL),48
60031 INC HL
60032 LD (HL),48
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.
60034 LD HL,23239 Bottom left of scroll
60037 LD B,16 16 characters along the bottom of the scroll
60039 LD (HL),48 Set to INK 0, PAPER 6
60041 INC HL
60042 DJNZ 60039 Continue for rest of the row
Copy current spell data (at 60357) into corresponding spell data at 28156
60044 LD HL,60357 Spell data buffer
60047 LD DE,(60135) Get spell data address pointer to spell in list at 28156
60051 LD BC,16 16 bytes of data to copy
60054 LDIR
60056 LD A,0 Set spell selection status byte to 0
60058 LD (60129),A
60061 CALL 57081 Clear all of the scroll text
This entry point is used by the routines at 59262, 59869 and 59933.
60064 RET
Prev: 59933 Up: Map Next: 60065