Prev: 31280 Up: Map Next: 31468
31312: Cast Lightning Bolt if possible, otherwise display failure message
Used by the routine at 55726.
31312 LD A,(25024) Load Magic Knight's current magic level into A...
31315 AND 127 ...
31317 CP 65 If this is less than 65...
31319 JP C,55332 ...then display "YOU CANNOT CAST THAT SPELL NOW..." window (10) and return to game
31322 SUB 65 Subtract 65 from magic level...
31324 LD B,A ...and load into B
31325 LD A,(25024) Load A with unused bit...
31328 AND 128 ...
31330 OR B ...combine with remaining magic level value...
31331 LD (25024),A ...and store
31334 CALL 55651 Flash border and screen (as in cast a spell)
31337 LD HL,46894 Point HL at "YOUR LIGHTNING BOLT HAS ALERTED THE SECURITY SYSTEM..." text
31340 LD A,(23701) Load A with Magic Knight's current room
31343 CP 7 If Magic Knight's current room is Retreat, 0, "Murphy's Moon" (07)...
31345 JP Z,55685 ...then jump to "game over" window routine and return to control selection menu
31348 CP 8 If Magic Knight's current room is Retreat, 1 (08)...
31350 JP Z,55685 ...then jump to "game over" window routine and return to control selection menu
31353 CP 21 If Magic Knight's current room is Monopole, 0, "Hooper's Emergency Exit" (21)...
31355 JP Z,55685 ...then jump to "game over" window routine and return to control selection menu
31358 CP 22 If Magic Knight's current room is Monopole, 1, "This Way to Hooper ==>>" (22)...
31360 JP Z,55685 ...then jump to "game over" window routine and return to control selection menu
31363 CP 24 If Magic Knight's current room is not USS Pisces, 6A, "The Control Column" (24)...
31365 JR NZ,31392 ...then skip ahead to 31392
31367 LD A,(23403) If tyme-machine-charged flag is set...
31370 AND 2 ...
31372 JR NZ,31392 ...then skip ahead to 31392
31374 OR 3 Set tyme-machine-charged and barriers-removed flags... (bug)
31376 LD (23403),A ...
31379 LD A,(23397) Increase bonus score by 10...
31382 ADD A,10 ...
31384 LD (23397),A ...
31387 LD HL,46682 Point HL at "YOUR LIGHTNING BOLT HAS HIT THE ANCIENT TYME MACHINE..." text
31390 JR 31449 Display text in message window and return to main game loop
31392 LD HL,46598 Point HL at "YOU HAVE THROWN A LIGHTNING BOLT BUT..." text
31395 LD A,(23701) Load B with Magic Knight's current room...
31398 LD B,A ...
31399 LD A,(25340) Load A with current room of Part of a Sundial (1)...
31402 CP B ...and if this is not the same as Magic Knight's current room...
31403 JR NZ,31449 ...then display text in message window and return to main game loop
31405 LD A,(25343) Load A with current room of Part of a Sundial (2)...
31408 CP B ...and if this is not the same as Magic Knight's current room...
31409 JR NZ,31449 ...then display text in message window and return to main game loop
31411 LD A,(25346) Load A with current room of Part of a Sundial (3)...
31414 CP B ...and if this is not the same as Magic Knight's current room...
31415 JR NZ,31449 ...then display text in message window and return to main game loop
31417 LD A,99 Set current room of three sundial parts to 99 (i.e. out of game area)...
31419 LD (25340),A ...
31422 LD (25343),A ...
31425 LD (25346),A ...
31428 LD A,B Load A with Magic Knight's current room...
31429 LD (25325),A ...and set this as the current room of the Golden Sundial of Alpha
31432 LD HL,(25344) Copy x- and y-coordinates of Part of a Sundial (2)...
31435 LD (25326),HL ...to Golden Sundial of Alpha
31438 LD A,(23397) Increase bonus score by 10...
31441 ADD A,10 ...
31443 LD (23397),A ...
31446 LD HL,46804 Point HL at "THE SEGMENTS OF THE GOLDEN SUNDIAL OF ALPHA..." text
31449 LD DE,37323 Adjust height of window 29 to accommodate text...
31452 CALL 33774 ...
31455 PUSH HL Store HL (pointer to start of text to print)
31456 LD A,29 Draw window 29...
31458 CALL 34990 ...
31461 POP HL Restore HL (pointer to start of text to print)...
31462 CALL 34762 ...and print
31465 JP 29479 Display "PRESS FIRE TO CONTINUE" window and wait for input and return to main game loop
Prev: 31280 Up: Map Next: 31468