Prev: 37493 Up: Map Next: 37584
37520: CrewAction4_Handler
Dispatched via CrewActionDispatch entry 4: a queued ATTACK order fires. The actor attacks whatever hostile shares his room — the actor's room byte (+1) is compared with each hostile's:
  • 1. The actor stands in the alien's room ($737F) → CALL CrewHitsAlien — message #3 "nets the ALIEN" or #4 "hits the ALIEN".
  • 2. Else, if the alien is loose (AlienActiveFlag) and the actor stands in the ANDROID's room (record via AlienTargetPtr) → CALL CrewHitsAndroid — message #31 "nets {target}" or #32 "hits the Android".
  • 3. Neither hostile is here (it moved away before the countdown expired): the attack fizzles silently.
The Android role: LongGameInit randomly picks one of crew slots {1, 2, 4, 6} (Dallas / Kane / Ash / Parker) and stores it in AlienTargetID. That crew member is dormant at first — they appear and behave like a normal crew member.
UpdateAndroid turns them hostile the first frame the alien is loose and the slot is still in its template state (the "first encounter"), stamping them into action state 7 and giving them targets via NearestCrewA/B (see 37876).
After activation the Android wounds nearby crew through CrewAction7_Handler; CrewHitsAndroid here is the PLAYER-RESPONSE branch, dispatched when other crew engage the Android in combat state 4. (The Short Game hard-wires AlienTargetID = 9 and never re-points AlienTargetPtr, so branch 2 is inert there.)
After dispatch, CALL 44924 parks IX+3 (action state) and returns.
37520 LD A,(29567) A = the alien's current room (slot 0 byte +1)
37523 CP (IX+1) does the actor stand in it?
37526 JR Z,37547 yes → CrewHitsAlien branch
37528 LD A,(33704) A = AlienActiveFlag
37531 AND A alien loose on ship?
37532 RET Z no: nothing to dispatch
37533 LD HL,(33701) HL = pointer to the Android's crew record
37536 INC HL HL → its current-room byte (+1)
37537 LD A,(HL) A = the Android's room
37538 CP (IX+1) does the actor stand in it?
37541 RET NZ no: neither hostile is here — fizzle
37542 CALL 40941 yes → CrewHitsAndroid (msg #32 / #31)
37545 JR 37550
37547 CALL 37584 alien's room → CrewHitsAlien (msg #4 / #3)
37550 CALL 44924 reset IX+3 = 0 (action state cleared post-combat)
37553 NOP
37554 RET
37555 LD A,(31252) room view on screen (mode 1)?
37558 CP 1
37560 RET NZ no: done
37561 LD A,(31241) is the attacker the viewed crew member?
37564 LD HL,33700
37567 CP (HL)
37568 RET NZ no: done
37569 LD A,52 keep " ATTACK " on the Special slot
37571 CALL 45269 (the hostile is still in the room)
37574 LD HL,18646 and redraw the special row
37577 LD (31257),HL (screen row 14, col 22)
37580 CALL 31634
37583 RET
Prev: 37493 Up: Map Next: 37584