Prev: 32143 Up: Map Next: 32498
32385: DrawCrewCondition
Prints the room-info line "NAME is <injury> and/ but <morale>" for the selected crew member (slot in 31241), using (CrewInjuryText, index = strength clamped to 0-3) and (CrewMoraleText, index = morale byte clamped to 0-4); "but" is picked when injury and morale disagree.
Used by the routines at 32719, 35451, 39365, 45295, 45338, 45373, 45510 and 45539.
32385 LD A,(31241) A = selected crew slot
32388 LD HL,20640 draw pointer -> condition row
32391 LD (31257),HL (row 21, col 0)
32394 CALL 31690 PrintName
32397 LD DE,32238 " is " (shared tail of the grille text)
32400 LD B,4 4 characters
32402 PUSH BC
32403 PUSH DE
32404 CALL 31369 DrawSpriteRow: one glyph
32407 POP DE
32408 INC DE
32409 LD HL,31257 advance one cell
32412 INC (HL)
32413 POP BC
32414 DJNZ 32402
32416 LD A,(IX+4) injury index from strength:
32419 CP 3 0/1/2 as-is (Dead/Collapsed/Wounded),
32421 JR C,32429 3 -> 2 (Wounded), >3 -> 3 (OK)
32423 LD A,3
32425 JR NZ,32429
32427 LD A,2
32429 LD DE,30110 print CrewInjuryText[A]
32432 CALL 31693 PrintName's list-walk entry: skip A entries
32435 LD DE,32254 "and "
32438 LD A,(IX+4) pick the conjunction: "but " when
32441 CP 4 injury and morale disagree (healthy
32443 JR C,32454 but low morale, or hurt but high
32445 LD A,(IX+6) morale), else "and "
32448 CP 3
32450 JR NC,32464
32452 JR 32461
32454 LD A,(IX+6)
32457 CP 3
32459 JR C,32464
32461 LD DE,32258 "but "
32464 LD B,4 draw the 4-character conjunction
32466 PUSH BC
32467 PUSH DE
32468 CALL 31369 DrawSpriteRow: one glyph
32471 POP DE
32472 INC DE
32473 LD HL,31257 advance one cell
32476 INC (HL)
32477 POP BC
32478 DJNZ 32466
32480 LD A,(IX+6) morale index, clamped to 0-4
32483 CP 5
32485 JR C,32489
32487 LD A,4
32489 LD DE,30140 print CrewMoraleText[A]
32492 CALL 31693 PrintName's list-walk entry
32495 JP 45695 PanelColCheck: blank-pad the rest of the row
Prev: 32143 Up: Map Next: 32498