Prev: 39365 Up: Map Next: 39531
39400: VictimItemDrop — a victim collapses
Entered with HL -> the victim's strength byte (+4, just dropped below 2) and C = his slot: mark him dead with witness-morale processing (KillActorRefresh -> KillActorMoraleHit), park his countdown, drop everything he carried onto the floor, and if he is the crew member on screen, log msg #21 and rebuild the view.
Used by the routines at 39256 and 40757.
39400 INC HL HL -> his morale byte (+6):
39401 INC HL the KillActorMoraleHit entry point
39402 CALL 45476 mark dead + witness morale + redraw
39405 LD DE,65529 countdown (+0) = 0:
39408 ADD HL,DE the body never acts again
39409 LD (HL),0
39411 LD A,C A = the victim's slot
39412 PUSH AF
39413 ADD A,128 E = his back-hand marker
39415 LD E,A
39416 ADD A,32 D = his front-hand marker
39418 LD D,A
39419 LD C,(IX+1) C = the room he fell in
39422 LD B,22 all 22 items:
39424 LD HL,29940
39427 LD A,(HL)
39428 CP E held in either hand?
39429 JR Z,39434
39431 CP D
39432 JR NZ,39435
39434 LD (HL),C yes: it drops to the floor here
39435 INC HL
39436 DJNZ 39427
39438 POP AF is the victim the crew member
39439 LD L,A on screen?
39440 LD A,(31252)
39443 CP 1
39445 RET NZ
39446 LD A,(31241)
39449 CP L
39450 RET NZ no: done
39451 LD A,21 msg #21 "{actor} has collapsed"
39453 CALL 37176
39456 JP 31417 and rebuild the whole view
Wound_PanicRoll — the alien's chosen victim is already dead. If the alien is not carrying a body (+5 = 0), a 4-in-16 script roll lets it DRAG THE CORPSE OFF: the body's room becomes 255 (gone from the ship) and its slot is remembered in the alien's +5. Otherwise another gathered slot is attacked instead, or the alien moves on.
39459 XOR A already carrying a body (+5 != 0)?
39460 CP (IX+5)
39463 JR NZ,39484 yes: try another victim
39465 PUSH HL no: script roll < 4
39466 CALL 33589 (4 in 16)?
39469 POP HL
39470 CP 4
39472 JR NC,39484
39474 LD DE,65530 yes: drag the corpse away —
39477 ADD HL,DE its room byte (+1) = 255,
39478 LD (HL),255 gone from the ship,
39480 CALL 45533 and the alien's +5 = the slot
39483 RET
39484 LD DE,1 scan the gathered slots for another
39487 LD HL,33695 victim (direction picked by the
39490 CP 7 leftover roll: < 7 forward from C,
39492 JR C,39500 else backward from B)
39494 LD DE,65535
39497 LD HL,33697
39500 LD B,3
39502 LD A,(HL) skip empties and the corpse
39503 CP 255 we just tried
39505 JR Z,39516
39507 CP C
39508 JR Z,39516
39510 LD (HL),255 take this one off the list
39512 LD C,A
39513 JP 39328 and attack him instead
39516 ADD HL,DE
39517 DJNZ 39502
39519 CALL 36717 nobody left: the alien moves on
39522 LD (IX+0),40 (move/idle, timer 40)
39526 LD (IX+3),1
39530 RET
Prev: 39365 Up: Map Next: 39531