Prev: 40504 Up: Map Next: 40826
40757: CrewAction7_Handler — the Android's attack tick (action state 7)
Dispatched via CrewActionDispatch entry 7 for the activated Android (see UpdateAndroid). Gathers the crew sharing the Android's room (37876) and wounds the first live one found (NearestCrewA, then NearestCrewB): strength (+4) -1. Below 2 the victim collapses (VictimItemDrop, msg #21); at 2-3, msg #29 announces the assault; a still-fit victim (4+) suffers silently. Returns without action when no live room-mate remains.
40757 CALL 37876 gather the crew in the Android's room
40760 LD A,(33696) A = first room-mate (255 = none)
40763 CP 255
40765 JR Z,40782
40767 LD C,A C = victim slot
40768 ADD A,A HL -> his status byte (+7)
40769 ADD A,A
40770 ADD A,A
40771 LD E,A
40772 LD D,0
40774 LD HL,29573
40777 ADD HL,DE
40778 XOR A alive?
40779 CP (HL)
40780 JR Z,40802 yes: wound him
40782 LD A,(33697) try the second room-mate
40785 CP 255
40787 RET Z nobody to attack
40788 LD C,A C = victim slot
40789 ADD A,A HL -> his status byte (+7)
40790 ADD A,A
40791 ADD A,A
40792 LD E,A
40793 LD D,0
40795 LD HL,29573
40798 ADD HL,DE
40799 XOR A alive?
40800 CP (HL)
40801 RET NZ no: give up this tick
40802 DEC HL HL -> the victim's strength (+4)
40803 DEC HL
40804 DEC HL
40805 DEC (HL) the Android saps a strength point
40806 LD A,(HL)
40807 CP 2 below 2: the victim collapses
40809 JP C,39400
40812 CP 4 4+: shrugs it off silently
40814 RET NC
40815 LD L,C wounded (2-3): L = victim,
40816 LD A,(33703) H = the Android,
40819 LD H,A
40820 LD A,29 msg #29 "{target} is attacking {actor}"
40822 CALL 37176 — "<Android> is attacking <victim>"
40825 RET
Prev: 40504 Up: Map Next: 40826