Prev: 44253 Up: Map Next: 44615
44337: Process command to blow an object
Used by the routine at 64623.
44337 LD IX,24848 Point IX at start of Magic Knight's current inventory (carrying)
44341 LD B,5 Load B with 5 (five inventory slots)
44343 LD HL,51920 Point HL at "[Current Command] WHICH OBJECT ?" text
44346 LD DE,51928 Point DE at "[Current Command] THE " text
44349 CALL 45809 Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with selected item index
44352 LD HL,24848 Point HL at start of Magic Knight's current inventory (carrying)
44355 CALL 45766 Print name of selected object in Magic Knight's current inventory (carrying) in command summary window
44358 LD A,(41779) Load A with index of Current Object
44361 CP 22 If the selected object is not the Elf-Horn...
44363 JP NZ,44557 ...then skip ahead to 44557
44366 LD A,(23702) Load BC with double index of Magic Knight's current room...
44369 ADD A,A ...
44370 LD C,A ...
44371 LD B,0 ...
44373 LD HL,48915 Load HL with start address of character movement restriction data
44376 ADD HL,BC Add BC as offset
44377 LD A,(HL) Load current room's movement restriction data...
44378 LD (44454),A ...into operand of instruction at 44453
44381 CALL 63399 Print or update command summary window at top of screen
44384 LD DE,56163 Point DE at "SUMMON " text...
44387 CALL 63349 ...and print in command summary window at top of screen
44390 LD HL,51413 Point HL at "SUMMON ?" text
44393 PUSH HL Store HL (address of "SUMMON ?" text)
44394 LD HL,48598 Load HL with start address of list of characters for "SUMMON" character selection menu
44397 CALL 46106 Display and process input for character selection menu ("SUMMON")
44400 CALL 64207 Display execute / reject command window and return here if execute chosen, else exit to main game loop
44403 LD A,(41779) Load A with index of Current Object (see trivia)
44406 CALL 45601 Point HL at current position data for Current Character
44409 LD A,(23702) Load A with Magic Knight's current room...
44412 CP (HL) ...and set zero flag if this is the same as the Current Character's current room
44413 LD HL,56275 Point HL at "[Current Character's full name] IS ALREADY HERE!" text
44416 JP Z,64309 If zero flag is set then display "[Character] IS ALREADY HERE!" window (28) and return to game
44419 LD A,(41937) Point HL at Current Character's strength...
44422 LD E,0 ...
44424 CALL 45406 ...
44427 PUSH HL Load IX with address of Current Character's strength...
44428 POP IX ...
44430 BIT 7,(IX+6) Set zero flag to inverse of Current Character's asleep flag (i.e. awake flag)
44434 LD HL,56213 Point HL at "[Current Character's full name] IS ASLEEP" text
44437 JP NZ,64309 If zero flag is not set then display "[Character] IS ASLEEP" window (28) and return to game
44440 LD A,(IX+1) If character's happiness is less than 35...
44443 AND 127 ...
44445 CP 35 ...then set carry flag
44447 LD HL,56224 Point HL at "[Current Character's full name] DOES NOT WANT TO BE SUMMONED" text
44450 JP C,64309 If carry flag is set then display "[Character] DOES NOT WANT TO BE SUMMONED" window (28) and return to game
The operand of the instruction at 44453 represents the movement restriction data for the current room. This is modified by the instruction at 44378.
44453 LD A,0 If movement restriction data is 98 (i.e. room not accessible by character)...
44455 CP 98 ...
44457 JP Z,64309 ...then display "[Character] DOES NOT WANT TO BE SUMMONED" window (28) and return to game
44460 LD A,(IX+2) If Current Character's stamina is less than 25...
44463 AND 127 ...
44465 CP 25 ...then set carry flag
44467 LD HL,56248 Point HL at "[Current Character's full name] IS TOO TIRED TO BE SUMMONED" text
44470 JP C,64309 If carry flag is set then display "[Character] IS TOO TIRED TO BE SUMMONED" window (28) and return to game
44473 CALL 45601 Point HL at current position data for Current Character
44476 CALL 44615 Load BC with coordinates of character's arrival point when summoned to current room and if character does not want to come here then skip ahead to 44585
44479 JP Z,44585
44482 LD A,(24840) Load A with Magic Knight's current x-coordinate (characters)...
44485 RRCA ...
44486 RRCA ...
44487 RRCA ...
44488 AND 31 ...
44490 SUB C Subtract arrival x-coordinate to give horizontal distance from Magic Knight...
44491 JP Z,44591 ...and if zero then skip ahead to 44591 (check vertical distance to Magic Knight)
44494 CP 1 If horizontal distance is 1...
44496 JP Z,44591 ...then skip ahead to 44591 (check vertical distance to Magic Knight)
44499 CP 255 If horizontal distance is -1...
44501 JP Z,44591 ...then skip ahead to 44591 (check vertical distance to Magic Knight)
44504 CP 254 If horizontal distance is -2...
44506 JP Z,44591 ...then skip ahead to 44591 (check vertical distance to Magic Knight)
Have character arrive in new room
44509 LD A,(23702) Load A with index of Magic Knight's current room...
44512 OR 128 ...and set MSB
44514 LD (HL),A Set this as character's current room
44515 INC HL Advance to character's x-coordinate...
44516 LD (HL),C ...and set to value in C
44517 INC HL Advance to character's y-coordinate...
44518 LD (HL),B ...and set to value in B
44519 LD A,(IX+0) Decrease character's strength by 4...
44522 SUB 4 ...
44524 LD (IX+0),A ...
44527 LD A,(IX+1) Decrease character's happiness by 3...
44530 SUB 3 ...
44532 LD (IX+1),A ...
44535 LD A,(IX+2) Decrease character's stamina by 7...
44538 SUB 7 ...
44540 LD (IX+2),A ...
44543 LD A,(24771) Decrease Magic Knight's current magic level by 3...
44546 SUB 3 ...
44548 LD (24771),A ...
44551 LD HL,56347 Point HL at "[Current Character's full name] APPEARS IN A THICK PUFF OF SMOKE" text
44554 JP 64309 Display "[Character] APPEARS IN A THICK PUFF OF SMOKE" window (28) and return to game
Blown object is not the Elf-Horn
44557 CALL 64207 Display execute / reject command window and return here if execute chosen, else exit to main game loop
44560 LD A,(41779) Load A with index of Current Object...
44563 CALL 45685 ...and if this is 4 (Teddy Bear) then display "THE BEAR SAYS..." message and wait for fire to be pressed
44566 LD E,0 Load E with 0 (prepare to check can-be-blown flag)
44568 CALL 45390 Point HL to byte 0 of the A-th record in object properties table
44571 BIT 6,(HL) Set zero flag if object's can-be-blown flag is reset, otherwise reset
44573 LD HL,56304 Point HL at "WHAT A LOT OF DUST..." text
44576 JP Z,64305 If zero flag is set then display "WHAT A LOT OF DUST..." window (27) and return to game
44579 LD HL,56165 Point HL at "I THINK YOU SHOULD GIVE UP TRYING TO PLAY THE [name of Current Object]..." text
44582 JP 64305 Display "I THINK YOU SHOULD GIVE UP..." window (27) and return to game
Character does not want to come to current room
44585 LD HL,56284 Point HL at "[Current Character's short name] DOES NOT WANT TO COME HERE!" text
44588 JP 64305 Display "[Character] DOES NOT WANT TO COME HERE!" window (27) and return to game
Magic Knight is within two characters horizontally of character's intended arrival point
44591 LD A,(24841) Load A with Magic Knight's current y-coordinate (characters)...
44594 RRCA ...
44595 RRCA ...
44596 RRCA ...
44597 AND 31 ...
44599 SUB B Subtract arrival y-coordinate to give vertical distance from Magic Knight...
44600 AND 252 If bits 2-7 are all reset (i.e. distance was 0 - 3)...
44602 JR Z,44609 ...then skip ahead to 44609
44604 CP 252 If bits 2-7 are not all set (i.e. distance was not -1 - -4)...
44606 JP NZ,44509 ...then jump back to 44509 (have character arrive)
44609 LD HL,56070 Point HL at "[Current Character's short name] SAYS 'I CANNOT COME TO THAT ROOM ... YOU ARE IN MY WAY!'" text
44612 JP 64293 Display "[Character] SAYS 'I CANNOT COME TO THAT ROOM...'" window (15) and return to game
Prev: 44253 Up: Map Next: 44615