Prev: 31468 Up: Map Next: 31688
31537: Process command to wear / unwear an object
Used by the routine at 55726.
31537 LD A,11 Draw window 11...
31539 CALL 34982 ...
31542 LD HL,41830 Point HL at wear/unwear menu text...
31545 CALL 34762 ...and print to screen
31548 CALL 35296 Process keyboard / joystick input on a menu and load A with selected item index
31551 JR NZ,31627 If UNWEAR selected then skip ahead to 31627
31553 CALL 33834 Display "YOU ARE NOT CARRYING ANYTHING" window and set zero flag if Magic Knight's inventory (carrying) is empty
31556 JP Z,29482 If Magic Knight's inventory (carrying) is empty then return to game
31559 LD IX,25164 Point IX at Magic Knight's current inventory (carrying)
31563 LD B,5 Load B with 5 (five inventory slots)
31565 LD HL,41848 Point HL at "WEAR WHICH OBJECT ?" text
31568 LD DE,41841 Point DE at "WEAR THE " text
31571 CALL 33952 Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with selected item index
31574 LD HL,25164 Point HL at start of Magic Knight's current inventory (carrying)
31577 CALL 33911 Print name of object in inventory slot A of inventory data at HL in command summary window
31580 CALL 55115 Display execute / reject command window and return here if execute chosen, else exit to main game loop
31583 LD HL,25173 If last slot in Magic Knight's current inventory (wearing) is not empty...
31586 LD A,(HL) ...
31587 OR A ...
31588 JP NZ,55170 ...then display "YOU ARE WEARING TOO MUCH" window (13) and return to game
31591 LD A,(29526) Load A with index of Current Object
31594 LD E,1 If object's can-be-worn flag is reset...
31596 CALL 33525 ...
31599 BIT 3,(HL) ...
31601 JP Z,55182 ...then display "YOU CANNOT WEAR THAT" window (13) and return to game
31604 LD A,(29526) Load C with index of Current Object...
31607 LD C,A ...
31608 LD B,5 Load B with 5 (five inventory slots)
31610 PUSH BC Store BC (B = number of slots to process, C = Current Object)
31611 LD HL,25164 Point HL at start of Magic Knight's current inventory (carrying)
31614 CALL 36254 Remove object C from this inventory
31617 POP BC Restore BC (B = number of slots to process, C = Current Object)
31618 LD HL,25169 Point HL at Magic Knight's current inventory (wearing)...
31621 CALL 33516 ...and load object C into the first empty slot
31624 JP 29467 Show Magic Knight's current inventory and jump back to main game loop
31627 CALL 33824 Display "YOU ARE NOT WEARING ANYTHING" window and set zero flag if Magic Knight's inventory (wearing) is empty
31630 JP Z,29482 If Magic Knight's inventory (wearing) is empty then return to game
31633 LD IX,25169 Point IX at Magic Knight's current inventory (wearing)
31637 LD B,5 Load B with 5 (five inventory slots)
31639 LD HL,41846 Point HL at "UNWEAR WHICH OBJECT ?" text
31642 LD DE,41839 Point DE at "UNWEAR THE " text
31645 CALL 33952 Show list of objects in Magic Knight's inventory (wearing) as a menu and load A with selected item index
31648 LD HL,25169 Point HL at Magic Knight's current inventory (wearing)
31651 CALL 33911 Print name of object in inventory slot A of inventory data at HL in command summary window
31654 CALL 55115 Display execute / reject command window and return here if execute chosen, else exit to main game loop
31657 LD HL,25168 Load A with index of object in Magic Knight's fifth inventory slot (carrying)...
31660 LD A,(HL) ...
31661 OR A If this is not zero (i.e. Magic Knight's hands are full)...
31662 JP NZ,55165 ...then display "YOUR HANDS ARE FULL" window and return to game
31665 LD A,(29526) Load C with index of Current Object...
31668 LD C,A ...
31669 LD B,5 Load B with 5 (five inventory slots)
31671 PUSH BC Store BC (B = number of slots to process, C = Current Object)
31672 LD HL,25169 Point HL at Magic Knight's current inventory (wearing)
31675 CALL 36254 Remove object C from Magic Knight's current inventory (wearing)
31678 POP BC Restore BC (B = number of slots to process, C = Current Object)
31679 LD HL,25164 Point HL at start of Magic Knight's current inventory (carrying)...
31682 CALL 33516 ...and load object C into the first empty slot
31685 JP 29467 Show Magic Knight's current inventory and jump back to main game loop
Prev: 31468 Up: Map Next: 31688