Prev: 32982 Up: Map Next: 33129
33036: Cast Project Physical Body if possible, otherwise display failure message
Used by the routine at 32655.
33036 CALL 37654 Display / update command summary window at bottom of screen
33039 LD DE,50200 Point DE at "PROJECT PHYSICAL BODY TO" text...
33042 CALL 38693 ...and print in command summary window at bottom of screen
33045 LD HL,44092 Point HL at "TRAVEL TO ?" text
33048 PUSH HL Store HL
33049 CALL 35293 Display and handle full character selection menu
33052 CALL 38725 Display execute / reject command window and return if execute chosen, else exit
33055 LD A,6 Load A with index of object 6 (Crystal Ball)
33057 CALL 34256 Check whether Magic Knight is holding the Crystal Ball...
33060 JP NZ,34634 ...and if not, then display "THAT SPELL CANNOT YET BE CAST..." window and exit
33063 LD A,12 Load A with index of object 12 (Magic Talisman)
33065 CALL 34256 Check whether Magic Knight is holding the Magic Talisman...
33068 JP NZ,34634 ...and if not, then display "THAT SPELL CANNOT YET BE CAST..." window and exit
33071 LD A,(30615) Load A with index of Current Character...
33074 LD B,A ...and copy into B
33075 ADD A,A Multiply index by three...
33076 ADD A,B ...
33077 LD B,0 ...and load into BC...
33079 LD C,A ...
33080 LD HL,25440 Point HL at characters' current locations table
33083 ADD HL,BC Add three times index of Current Character as offset to this address (as entries are three bytes wide)
33084 LD A,(65529) If Magic Knight's current room...
33087 CP (HL) ...is the same as the Current Character's current room...
33088 JP Z,34634 ...then display the "THAT SPELL CANNOT YET BE CAST..." window and return to game
33091 LD A,(HL) If Current Character's room is set to 99...
33092 CP 99 ...
33094 JP Z,34634 ...then display the "THAT SPELL CANNOT YET BE CAST..." window and return to game
33097 CP 100 If Current Character's room is set to 100...
33099 JP Z,34634 ...then display the "THAT SPELL CANNOT YET BE CAST..." window and return to game
33102 LD (65529),A Make Magic Knight's current room same as that for Current Character
33105 INC HL Advance to next byte
33106 LD A,(HL) Load Current Character's x-coordinate into A
33107 INC A Add two...
33108 INC A ...
33109 ADD A,A ...and multiply by eight...
33110 ADD A,A ...
33111 ADD A,A ...
33112 LD (25387),A ...and set as Magic Knight's x-coordinate
33115 INC HL Advance to next byte
33116 LD A,(HL) Load Current Character's y-coordinate into A
33117 ADD A,A Multiply this by eight...
33118 ADD A,A ...
33119 ADD A,A ...
33120 LD (25388),A ...and set as Magic Knight's y-coordinate
33123 CALL 33278 Flash border and screen (as in cast a spell)
33126 JP 34694 Display Project Physical Body successful window and return to game
Prev: 32982 Up: Map Next: 33129