Prev: 30643 Up: Map Next: 30804
30686: Process command to command a character
Used by the routine at 55726.
30686 LD HL,38669 Point HL at "COMMAND ?" text (end of sub-menu title, after "WHO DO YOU WANT TO ")
30689 LD DE,39574 Point DE (command summary text pointer) at "COMMAND " text
30692 CALL 34122 Display and process input for character selection menu (current room's characters only), setting Current Character
30695 JP Z,29482 If there are no characters in the room then return to game
30698 LD DE,39082 Point DE at "TO"...
30701 CALL 54283 ...and print in command summary window at top of screen
30704 LD A,23 Draw "WHICH COMMAND DO YOU WANT TO USE?" menu window...
30706 CALL 34982 ...
30709 LD HL,39577 Print "WHICH COMMAND DO YOU WANT TO USE" menu text...
30712 CALL 34762 ...
30715 CALL 35296 Process keyboard / joystick input on a menu and load A with selected item index
30718 LD (30797),A Load index of selected command into operand of instruction at 30796...
30721 LD B,A ...and into B
30722 CALL 54256 Point HL at start of B-th entry in list of "COMMAND A CHARACTER" commands at 39626
30725 EX DE,HL Swap HL and DE (command summary text pointer, now at selected command string)
30726 CALL 54283 Print text at DE in command summary window at top of screen
30729 CALL 55115 Display execute / reject command window and return here if execute chosen, else exit to main game loop
30732 LD A,250 Decrease Current Character's happiness by 6...
30734 CALL 33569 ...
30737 LD A,27 If Magic Knight is wearing the Gas Mask (27)...
30739 CALL 33640 ...
30742 JP Z,55322 ...then display "[Character] HEARS A MUFFLED VOICE..." window (12) and return to game
30745 LD A,(29632) Load A with index of Current Character
30748 LD E,6 Point HL at Current Character's flags...
30750 CALL 33541 ...
30753 LD A,(HL) Load flags into A
30754 AND 3 If is-artificial flag is set and dislikes-Starfleet flag is reset...
30756 CP 2 ...
30758 JR Z,30791 ...then skip ahead to 30791
30760 EX AF,AF' Switch AF and AF' (character's is-artificial and dislikes-Starfleet flags now in A')
30761 LD A,1 If Magic Knight is wearing the Cloak of Invisibility (01)...
30763 CALL 33640 ...
30766 JP Z,55303 ...then display "[Character] HEARS A VOICE AND IGNORES IT" window, and jump to main game loop
30769 EX AF,AF' Switch AF and AF' (character's is-artificial and dislikes-Starfleet flags now in A)
30770 OR A If character is not artificial, and likes Starfleet...
30771 JR Z,30783 ...then skip ahead to 30783
30773 LD A,3 If Magic Knight is wearing the Valid I.D. Card (03)...
30775 CALL 33640 ...
30778 JP Z,55317 ...then display "[Character] DOES NOT LIKE STARFLEET SO HE IGNORES YOU" window (12) and return to game
30781 JR 30791 Skip ahead to 30791
30783 LD A,3 If Magic Knight is not wearing the Valid I.D. Card (03)...
30785 CALL 33640 ...
30788 JP NZ,55312 ...then display "[Character] DOES NOT RECOGNISE YOUR AUTHORITY" window (12) and return to game
30791 LD A,7 Increase Current Character's happiness by 7...
30793 CALL 33569 ...
The operand of the instruction at 30796 is the index of the currently selected command from the "COMMAND A CHARACTER TO" menu. This is modified by the instruction at 30718.
30796 LD A,0 Load A with index of selected "COMMAND A CHARACTER TO" command
30798 LD HL,30804 Point HL at start of table of "command a character" routine addresses
30801 JP 55726 Advance HL by A words, load HL with word at location HL as address and jump to it
Prev: 30643 Up: Map Next: 30804