Routines |
Prev: 30540 | Up: Map | Next: 30880 |
30602 | CALL 38075 | Play upward scale sound | ||
30605 | LD HL,44051 | Point HL at "TAKE AN OBJECT FROM ?" text | ||
30608 | LD DE,45619 | Point DE at "TAKE SOMETHING FROM" text | ||
30611 | CALL 35141 | Display and process input for character selection menu (current room's characters only), setting Current Character | ||
The operand of the instruction at 30614 represents the index of the Current Character used in multiple routines. This is modified by the instructions at 31430, 34893, 35258, 35349, 35383 and 55462.
|
||||
30614 | LD A,0 | Load A with index of Current Character | ||
30616 | CALL 34186 | Point IX at current inventory of character in A | ||
30619 | LD A,(IX+0) | Load character's first inventory object into A | ||
30622 | OR A | If first object is zero (i.e. character's hands are empty)... | ||
30623 | JP Z,34448 | ...display "[CHARACTER]'S HANDS ARE EMPTY" window and exit | ||
30626 | PUSH IX | Store IX (pointer to current inventory of Current Character) | ||
30628 | LD B,5 | Load B with 5 (as there are 5 inventory slots) | ||
30630 | LD HL,45609 | Point HL at "TAKE WHICH OBJECT?" text | ||
30633 | LD DE,0 | Set DE to zero so command summary window is not updated upon selecting a character | ||
30636 | CALL 34914 | Show list of objects (window or menu) and handle selection, loading ASCII index code of chosen object into A | ||
30639 | PUSH AF | Store AF (A = ASCII code of letter of chosen object, e.g. A = first object, B = second, etc.) | ||
30640 | CALL 37654 | Display / update command summary window at bottom of screen | ||
30643 | LD DE,45616 | Point DE at "TAKE" text... | ||
30646 | CALL 38693 | ...and print in command summary window at bottom of screen | ||
30649 | POP AF | Restore AF (ASCII code of index of selected object) | ||
30650 | POP HL | Restore HL (previously IX, pointer to current inventory of Current Character) | ||
30651 | CALL 34864 | Point DE at name of a selected object in object names table and print in command summary window | ||
30654 | LD DE,45623 | Point DE at "FROM" text... | ||
30657 | CALL 38693 | ...and print in command summary window | ||
30660 | LD A,(30615) | Load A with index of Current Character | ||
30663 | CALL 34896 | Print short name of Current Character in command summary window | ||
30666 | CALL 38725 | Display execute / reject command window and return if execute chosen, else exit | ||
30669 | LD HL,25399 | Point HL at Magic Knight's fifth inventory slot... | ||
30672 | LD A,(HL) | ...and if this is not empty... | ||
30673 | OR A | ... | ||
30674 | JP NZ,34418 | ...then display "YOUR HANDS ARE FULL" window and return to game | ||
30677 | CALL 34202 | Check whether object has a weight greater than Magic Knight's surplus strength... | ||
30680 | JP P,34424 | ...and if it does, display "THAT OBJECT IS TOO HEAVY" message and return to game | ||
30683 | CALL 34137 | Load happiness of Current Character into A | ||
30686 | CP 30 | If character's happiness is less than 30... | ||
30688 | JP C,34454 | ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game | ||
30691 | LD A,(30467) | Load B with index of Current Object... | ||
30694 | LD B,A | ... | ||
30695 | LD A,(30615) | Load index of Current Character into A | ||
30698 | OR A | If character index is not zero (i.e. not Gimbal)... | ||
30699 | JP NZ,30705 | ...then skip ahead to 30705 (Thor's section) | ||
30702 | JP 30847 | Skip ahead to 30847 (transfer object from Gimbal's inventory to Magic Knight's and return to game) | ||
30705 | CP 1 | If character index is not 1 (i.e. not Thor)... | ||
30707 | JP NZ,30745 | ...then skip ahead to 30745 (Florin's section) | ||
30710 | LD A,B | Load index of selected object into B | ||
30711 | CP 3 | If selected object is not Miolnir... | ||
30713 | JR NZ,30742 | ...then skip ahead to 30742 | ||
30715 | LD HL,45668 | Point HL at "THOR IS ANGRY..." text | ||
30718 | LD A,(HL) | Load text height (rows) into A... | ||
30719 | LD (41981),A | ...and then into stored bottom y-coordinate of window #13 | ||
30722 | INC HL | Advance HL to start of actual text data | ||
30723 | PUSH HL | Store HL | ||
30724 | LD A,13 | Draw window 13... | ||
30726 | CALL 36987 | ... | ||
30729 | POP HL | Restore HL (pointer to text) | ||
30730 | CALL 36725 | Print text into window | ||
30733 | CALL 38749 | Display "PRESS SPACE OR FIRE TO CONTINUE" window and wait for space / fire | ||
30736 | LD HL,45798 | Point HL at "THOR KILLED YOU" text | ||
30739 | JP 35101 | Jump to "game over" window routine and exit | ||
30742 | JP 30847 | Skip ahead to 30847 (transfer object from Current Character's inventory to Magic Knight's and return to game) | ||
30745 | CP 2 | If character index is not 2 (i.e. not Florin)... | ||
30747 | JP NZ,30784 | ...then skip ahead to 30784 (Orik's section) | ||
30750 | LD A,B | Load index of selected object into B | ||
30751 | CP 5 | If selected object is the Sticky Bun... | ||
30753 | JP Z,34454 | ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game | ||
30756 | CP 11 | If selected object is the Broken Talisman... | ||
30758 | JP Z,34454 | ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game | ||
30761 | CP 10 | If selected object is the Tube of Glue... | ||
30763 | JP Z,34454 | ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game | ||
30766 | CP 30 | If selected object is the Gold Bar... | ||
30768 | JP Z,34454 | ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game | ||
30771 | CP 26 | If object is not Bottle of Liquid... | ||
30773 | JP NZ,30847 | ...then skip ahead to 30847 (transfer object from Current Character's inventory to Magic Knight's and return to game) | ||
30776 | LD A,96 | Set Magic Knight's strength to 96... | ||
30778 | LD (25315),A | ... | ||
30781 | JP 30847 | Jump to 30847 (transfer object from Current Character's inventory to Magic Knight's and return to game) | ||
30784 | CP 3 | If character index is not 3 (i.e. not Orik)... | ||
30786 | JP NZ,30798 | ...then skip ahead to 30798 (Samsun's section) | ||
30789 | LD A,B | Load index of selected object into B | ||
30790 | CP 2 | If selected object is the Book of Shadows... | ||
30792 | JP Z,34454 | ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game | ||
30795 | JP 30847 | Skip ahead to 30847 (transfer object from Current Character's inventory to Magic Knight's and return to game) | ||
30798 | CP 4 | If character index is not 4 (i.e. not Samsun)... | ||
30800 | JP NZ,30817 | ...then skip ahead to 30817 (Elrand's section) | ||
30803 | LD A,B | Load index of selected object into B | ||
30804 | CP 8 | If selected object is the Javelin... | ||
30806 | JP Z,34454 | ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game | ||
30809 | CP 29 | If selected object is the Platform... | ||
30811 | JP Z,34454 | ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game | ||
30814 | JP 30847 | Skip ahead to 30847 (transfer object from Current Character's inventory to Magic Knight's and return to game) | ||
30817 | CP 5 | If character index is not 5 (i.e. not Elrand)... | ||
30819 | JP NZ,30831 | ...then skip ahead to 30831 (Rosmar's section) | ||
30822 | LD A,B | Load index of selected object into B | ||
30823 | CP 40 | If selected object is the Trumpet... | ||
30825 | JP Z,34454 | ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game | ||
30828 | JP 30847 | Skip ahead to 30847 (transfer object from Current Character's inventory to Magic Knight's and return to game) | ||
30831 | CP 6 | If character index is not 6 (i.e. not Rosmar)... | ||
30833 | JP NZ,30847 | ...then skip ahead to 30847 (transfer object from Current Character's inventory to Magic Knight's and return to game) | ||
30836 | LD A,B | Load index of selected object into B | ||
30837 | CP 36 | If selected object is the Pocket Laser... | ||
30839 | JP Z,34454 | ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game | ||
30842 | CP 18 | If selected object is the Fast Blow Fuse... | ||
30844 | JP Z,34454 | ...then display "[CHARACTER] WANTS TO KEEP THAT" window and return to game | ||
30847 | LD A,(30615) | Load A with index of Current Character | ||
30850 | CALL 34186 | Point IX at current inventory of character in A | ||
30853 | PUSH IX | Transfer pointer to current inventory of Current Character from IX to HL... | ||
30855 | POP HL | ... | ||
30856 | LD A,(30467) | Load C with index of Current Object... | ||
30859 | LD C,A | ... | ||
30860 | LD B,5 | Load B with 5 (as five inventory slots) | ||
30862 | CALL 38674 | Remove current (selected) object from character's inventory | ||
30865 | LD A,(30467) | Load C with index of Current Object... | ||
30868 | LD C,A | ... | ||
30869 | LD B,5 | Load B with 5 (as five inventory slots) | ||
30871 | LD HL,25395 | Point HL at start of Magic Knight's inventory | ||
30874 | CALL 34151 | Load current (selected) object into Magic Knight's first empty inventory slot | ||
30877 | JP 30410 | Display Magic Knight's current inventory and return to game |
Prev: 30540 | Up: Map | Next: 30880 |