Prev: 44635 Up: Map Next: 44933
44861: Process command to teleport
Used by the routine at 64623.
44861 LD B,2 Print or update command summary window at top of screen...
44863 CALL 45206 ...with "TELEPORT" text
44866 CALL 64207 Display execute / reject command window and return here if execute chosen, else exit to main game loop
44869 LD A,(25018) If the Teleport Pad's current room is not 99...
44872 CP 99 ...
44874 JR NZ,44900 ...then skip ahead to 44900
44876 XOR A Set Magic Knight's current room...
44877 LD (23702),A ...to be zero (Limbo)
44880 LD A,120 Set Magic Knight's x- and y-coordinates to be 120...
44882 LD (24840),A ...
44885 LD (24841),A ...
44888 LD A,1 Set animate-puff-of-smoke flag...
44890 LD (23480),A ...
44893 LD HL,56462 Point HL at "IT WAS NOT SAFE TO TELEPORT SO YOU HAVE WOUND UP IN LIMBO" text
44896 CALL 64317 Display "IT WAS NOT SAFE TO TELEPORT..." window (17) and return to game...
44899 DEFB 17 ...
Teleport Pad's room is not 99
44900 LD HL,25018 Point HL to current position data of Teleport Pad
44903 LD A,(HL) Load A with current room of Teleport Pad...
44904 LD (23702),A ...and update Magic Knight's current room to match
44907 INC HL Advance HL to x-coordinate of Teleport Pad...
44908 LD A,(HL) ...and load this into A
44909 ADD A,A Multiply x-coordinate by eight...
44910 ADD A,A ...
44911 ADD A,A ...
44912 LD (24840),A ...and update Magic Knight's current x-coordinate to match
44915 INC HL Advance HL to y-coordinate of Teleport Pad...
44916 LD A,(HL) ...and load this into A
44917 SUB 3 Subtract three (because Magic Knight is four character blocks tall)...
44919 ADD A,A ...multiply by eight...
44920 ADD A,A ...
44921 ADD A,A ...
44922 LD (24841),A ...and update Magic Knight's current y-coordinate to match
44925 LD A,1 Set animate-puff-of-smoke flag...
44927 LD (23480),A ...
44930 JP 41742 Set Magic Knight's available action flags and jump to start of main game loop
Prev: 44635 Up: Map Next: 44933