Prev: 45373 Up: Map Next: 45470
45401: UpdateAllCrew — pairwise companion morale support
Called from 36457. Walks every pair of crew records (slots 1-7): whenever two crew share a room, each gains the other's courage minus 2 as a morale adjustment — company emboldens (or, with a Broken companion, depresses) the crew. The kill/redraw and courage/morale maintenance helpers used by the simulation follow as their own routines (KillActorRefresh, BumpCourageMorale, KillActorMoraleHit, WitnessMoraleLoss, PreDispatchHook...).
45401 LD IX,29574 IX = slot 1 record
45405 LD C,6 6 later slots to pair it with
45407 LD H,(IX+1) H = this actor's room
45410 LD L,(IX+5) L = this actor's courage
45413 LD B,C
45414 PUSH IX
45416 CALL 45470 step IX to the next slot
45419 LD A,H same room?
45420 CP (IX+1)
45423 JR Z,45444 yes: apply the mutual boost
45425 DJNZ 45416
45427 POP IX
45429 DEC C advance to the next base slot
45430 CALL 45470
45433 LD A,IXl
45435 CP 182 stop after slot 7 ($73B6)
45437 JR NZ,45407
45439 CALL 37322 blank the message line
45442 RET
45443 NOP
45444 LD A,L mate's morale += this actor's courage - 2
45445 SUB 2
45447 ADD A,(IX+6)
45450 LD (IX+6),A
45453 POP DE and the other way round:
45454 PUSH DE DE -> this actor's morale byte (+6)
45455 INC E
45456 INC E
45457 INC E
45458 INC E
45459 INC E
45460 INC E
45461 LD A,(DE) += the mate's courage - 2
45462 ADD A,(IX+5)
45465 SUB 2
45467 LD (DE),A
45468 JR 45425
Prev: 45373 Up: Map Next: 45470