Prev: 30123 Up: Map Next: 30533
30145: Process command to examine yourself / a character / an object / USS Pisces
Used by the routine at 55726.
30145 CALL 54333 Print or update command summary window at top of screen
30148 LD DE,39152 Point DE at "EXAMINE"...
30151 CALL 54283 ...and print in command summary window at top of screen
30154 LD A,16 Draw "EXAMINE WHAT?" menu window...
30156 CALL 34982 ...
30159 LD HL,39154 Point HL at "EXAMINE WHAT ?" menu text...
30162 CALL 34762 ...and print to screen
30165 CALL 35296 Process keyboard / joystick input on a menu and load A with selected item index
30168 OR A If "OBJECT" selected...
30169 JP Z,30432 ...then skip ahead to 30432
30172 CP 1 If "CHARACTER" selected...
30174 JP Z,30300 ...then skip ahead to 30300
30177 CP 2 If "YOURSELF" selected...
30179 JP Z,30250 ...then skip ahead to 30250
Examine USS Pisces
30182 LD A,17 Set bottom edge of window 20 to 17...
30184 LD (37252),A ...
30187 LD DE,39524 Point DE at "USS PISCES" text...
30190 CALL 54283 ...and print in command summary window at top of screen
30193 CALL 55115 Display execute / reject command window and return here if execute chosen, else exit to main game loop
30196 LD A,(23701) Load A with Magic Knight's current room...
30199 CP 12 ...and if this is at least 12... (bug)
30201 JP NC,55267 ...then display "YOU CANNOT EXAMINE THE USS PISCES IF..." window (29) and return to game
30204 LD A,20 Draw window 20 ("EXAMINE OBJECT" / "EXAMINE USS PISCES" window)...
30206 CALL 34990 ...
30209 LD HL,39283 Point HL at "      EXAMINE" text...
30212 CALL 34762 ...and print to screen
30215 LD HL,25012 Point HL at USS Pisces' current stats
30218 CALL 30533 Insert numeric stats (at HL) of USS Pisces into "examine USS Pisces" window text
30221 LD HL,39359 Point HL at USS Pisces stats text...
30224 CALL 34762 ...and print to screen
30227 LD C,0 Load C with 0 (don't apply mirror)
30229 LD A,64 Load A with 64 (graphic index of left half of USS Pisces picture)
30231 LD HL,2061 Load H (y-coordinate) with 8 and L (x-coordinate) with 13
30234 CALL 28631 Draw the left half of the USS Pisces picture
30237 LD C,1 Load C with 1 (apply vertical mirror)
30239 LD A,64 Load A with 64 (graphic index of left half of USS Pisces picture)
30241 LD HL,2065 Load H (y-coordinate) with 8 and L (x-coordinate) with 17
30244 CALL 28631 Draw the right half of the USS Pisces picture
30247 JP 29479 Display "PRESS FIRE TO CONTINUE" window and wait for input and return to main game loop
Examine yourself
30250 LD A,16 Set left edge of window 19 ("examine portrait frame") to 16...
30252 LD (37241),A ...
30255 LD DE,39352 Point DE at "YOURSELF"...
30258 CALL 54283 ...and print in command summary window at top of screen
30261 CALL 55115 Display execute / reject command window and return here if execute chosen, else exit to main game loop
30264 LD A,18 Draw window 18...
30266 CALL 34990 ...
30269 LD A,205 Set Current Character index to 205 (i.e. -51)...
30271 LD (29632),A ...as index of "MAGIC KNIGHT" text is -51 relative to start of characters' names at 44088
30274 LD HL,47501 Point HL at percentage completion text
30277 LD DE,47513 Point DE at time left text
30280 CALL 33657 Insert current time and score into "time left" and "percentage completion" texts
30283 LD HL,25020 Point HL at start of Magic Knight's current stats
30286 LD A,1 Set graphic index to 1...
30288 LD (30412),A ...and store as operand to instruction at 30411
30291 LD A,(25162) Load character's magic level / attribute value into...
30294 LD (37248),A ...content attribute slot of window 19 (examine portrait frame)
30297 JP 30353 Skip ahead to 30353 (display window as in examine character)
Examine character
30300 LD A,17 Set left edge of window 19 ("examine portrait frame") to 17...
30302 LD (37241),A ...
30305 LD HL,38665 Point HL at "EXAMINE ?" text (end of sub-menu title, after "WHO DO YOU WANT TO ")
30308 LD DE,0 Load DE with zero (i.e. no command summary text)
30311 CALL 34122 Display and process input for character selection menu (current room's characters only), setting Current Character
30314 JP Z,29482 If there are no characters in the room then return to game
30317 CALL 55115 Display execute / reject command window and return here if execute chosen, else exit to main game loop
30320 LD A,5 Increase Current Character's happiness by 5...
30322 CALL 33569 ...
30325 LD A,18 Draw window 18...
30327 CALL 34990 ...
30330 LD A,(29632) Load A with index of Current Character
30333 LD E,0 Point HL at start of character's stats...
30335 CALL 33541 ...
30338 PUSH HL Transfer address from HL...
30339 POP IX ...into IX
30341 LD A,(IX+5) Load character graphic index into A...
30344 LD (30412),A ...and modify operand of instruction at 30411 to match
30347 LD A,(IX+4) Load character's magic level / attribute value into...
30350 LD (37248),A ...content attribute slot of window 19 (examine portrait frame)
30353 CALL 30583 Insert numeric stats (at HL) of a character into "EXAMINE CHARACTER" window text
30356 PUSH HL Store HL (points to start of character's current stats)
30357 LD HL,39187 Print examine character window text (i.e. "EXAMINE [CHARACTER] ... STRENGTH XX..." text)...
30360 CALL 34762 ...
30363 POP IX Restore IX (points to start of character's current stats)
30365 LD A,(IX+6) Load A with character's asleep flag (bit 7)...
30368 AND 128 ...
30370 RRCA Divide value (0 for awake / 128 for asleep) by 8...
30371 RRCA ...
30372 RRCA ...to give 0 for awake / 16 for asleep
30373 LD B,A Load this awake / asleep offset value into B
30374 LD A,(IX+7) Load A with index of character's current status text...
30377 AND 15 ...
30379 ADD A,B Add value in B to this index to select between "awake" and "asleep" versions...
30380 LD B,A ...and place result back in B to get index of string required
30381 LD HL,47491 Point HL at start of characters' "current status" texts
30384 CALL 54269 Advance HL to B-th entry in list of zero-terminated strings starting at HL...
30387 CALL 34762 ...and print
30390 LD A,(30412) If character graphic index is zero...
30393 OR A ...
30394 JP Z,30420 ...then skip ahead to 30420
30397 LD A,19 Draw window 19 (examine portrait frame)...
30399 CALL 34990 ...
30402 LD BC,(23493) Load BC with top-left coordinate of current window
30406 LD A,71 Store 71 (white INK, black PAPER, BRIGHT) at 23695...
30408 LD (23695),A ...
The operand of the instruction at 30411 represents the character's graphic index. This is modified by the instructions at 30288 and 30344.
30411 LD A,0 Load A with character's graphic index...
30413 CP 1 ...and if this is 1 (i.e. Magic Knight)...
30415 JR Z,30423 ...then skip ahead to 30423
30417 CALL 54411 Draw the graphic with lookup index A at character coordinates (C, B) with width 2 and height 4
30420 JP 29479 Display "PRESS FIRE TO CONTINUE" window and wait for input and return to main game loop
30423 XOR A Draw a graphic with lookup index 0 at character coordinates (C, B) with width 3 and height 4...
30424 LD DE,1027 ...(Magic Knight facing right, frame 1)...
30427 CALL 54414 ...
30430 JR 30420 Display "PRESS FIRE TO CONTINUE" window and wait for input and return to main game loop
Examine Object
30432 CALL 33834 Display "YOU ARE NOT CARRYING ANYTHING" window and set zero flag if Magic Knight's inventory (carrying) is empty
30435 JP Z,29482 If Magic Knight's inventory (carrying) is empty then return to game
30438 LD A,15 Set bottom edge of window 20 to 15...
30440 LD (37252),A ...
30443 LD IX,25164 Point IX at Magic Knight's current inventory (carrying)
30447 LD B,5 Load B with 5 (five inventory slots)
30449 LD HL,39140 Point HL at "EXAMINE WHICH OBJECT ?" text
30452 LD DE,0 Load DE with zero (i.e. no command summary text)
30455 CALL 33952 Show list of objects in Magic Knight's inventory (carrying) as a menu and load A with selected item index
30458 LD HL,25164 Point HL at start of characters' current inventories table
30461 CALL 33911 Print name of object in inventory slot A of inventory data at HL in command summary window
30464 CALL 55115 Display execute / reject command window and return here if execute chosen, else exit to main game loop
30467 LD A,(29526) Load A with index of Current Object
30470 LD E,0 Point HL to the start of the Current Object's record in object properties table...
30472 CALL 33525 ...
30475 PUSH HL Store HL (pointer to Current Object's properties)
30476 CALL 30643 Insert numeric / text properties of the object into "examine object" window text
30479 LD A,20 Draw window 20 ("EXAMINE OBJECT" / "EXAMINE USS PISCES" window)...
30481 CALL 34990 ...
30484 LD HL,39283 Point HL at "      EXAMINE" text...
30487 CALL 34762 ...and print to screen
30490 LD A,(29526) Load B with index of Current Object...
30493 LD B,A ...
30494 CALL 54266 ...and point HL at its entry in table of object names
30497 CALL 34762 Print the Current Object's name
30500 LD HL,39288 Point HL at object properties text...
30503 CALL 34762 ...and print to screen
30506 POP IX Restore IX (pointer to Current Object's properties)
30508 LD A,(IX+6) Set content attribute of window 21 (frame around object in "EXAMINE OBJECT" window)...
30511 LD (37264),A ...to match attribute of object
30514 LD A,21 Draw window 21...
30516 CALL 34990 ...
30519 LD BC,(23493) Load BC with top-left coordinate of current window
30523 INC B Increase y-coordinate by 1 (as object positions are based upon their bottom-left corner)
30524 LD A,(29526) Load A with index of Current Object
30527 CALL 36104 Set terrain interaction data for character blocks spanned by object and draw the object
30530 JP 29479 Display "PRESS FIRE TO CONTINUE" window and wait for input and return to main game loop
Prev: 30123 Up: Map Next: 30533