Prev: 35669 Up: Map Next: 35749
35709: Set the cast-a-spell-enabled flag if carrying a magic object
Used by the routine at 35495.
35709 LD A,(65532) Reset cast-a-spell-enabled flag (i.e. false)...
35712 RES 5,A ...
35714 LD (65532),A ...
35717 LD B,5 Set counter to 5 (as Magic Knight can carry 5 objects)
35719 LD IX,25395 Point IX to start of Magic Knight's current inventory
35723 LD A,(IX+0) Load index of object carried by Magic Knight into A
35726 LD E,3 Point HL to property 3 ("magic power") of this object (in table at 42242)...
35728 CALL 34160 ...
35731 LD A,(HL) ...and load into A
35732 OR A If "magic power" property is not zero (i.e. if object is magic)...
35733 JR NZ,35740 ...then skip to 35740...
35735 INC IX ...else advance to next inventory slot...
35737 DJNZ 35723 ...and repeat
35739 RET If this was last slot, then return with cast-a-spell-enabled flag unset
35740 LD A,(65532) Set cast-a-spell-enabled flag (i.e. true)...
35743 SET 5,A ...
35745 LD (65532),A ...
35748 RET Return
Prev: 35669 Up: Map Next: 35749