Prev: 36457 Up: Map Next: 37018
36859: UpdateJones
Walks Jones the cat around the ship. 33706 (JonesRoom) is the cat's current room (255 = off-map / disabled); 33707 (JonesMoveTimer) is a frame countdown — when it hits zero (every 255 frames, ~5s) Jones takes one step along the corridor adjacency map (29171), steered by the ROM script via ScriptNibbleToDirection like every other wanderer.
Input
House-keeping around each step:
- if Jones LEFT the room currently shown in the room view (mode 1),
cell 14 of the corridor strip (29630 + 14) is cleared;
- if a living crew member (record +7 = 0) occupies Jones's new room,
message #0 "{actor} sees Jones the cat" is enqueued via 37176;
- if Jones stepped into the ALIEN's room (slot 0 byte +1), the move
is re-rolled — the cat refuses to share a room with the alien;
- if Jones ENTERED the viewed room, sprite strip 51 (the cat) is
drawn into corridor cell 14.
36859 LD A,(33706) A = primary alien-event timer
36862 CP 255 255 = disabled
36864 RET Z disabled: do nothing this frame
36865 LD HL,33707 HL → JonesMoveTimer
36868 DEC (HL) tick it down
36869 RET NZ not yet zero: wait another frame
36870 LD (HL),255 expired: reset secondary counter to 255
36872 EX AF,AF' save A for later use
36873 LD A,(33706) A = Jones's current room
36876 LD HL,29171 corridor adjacency map (RoomAdjCorridors)
36879 LD E,A
36880 LD D,0
36882 LD B,5
36884 ADD HL,DE
36885 DJNZ 36884 HL = map + room*5
36887 PUSH HL
36888 CALL 33589 AdvanceScriptPtr: next ROM script nibble
36891 CALL 36763 ScriptNibbleToDirection: nibble -> slot 0-4
36894 LD E,A
36895 POP HL
36896 ADD HL,DE
36897 LD A,(HL) A = Jones's destination room
36898 LD HL,33706
36901 LD (HL),A JonesRoom = destination
36902 LD A,(31252)
36905 CP 1 is the room view in corridor mode 1?
36907 JR NZ,36941 no: skip the display update
36909 LD HL,31242 HL -> currently viewed room
36912 EX AF,AF' A = Jones's OLD room
36913 CP (HL) did Jones just leave the viewed room?
36914 JR NZ,36941 no: nothing to erase
36916 LD A,255
36918 LD (29644),A corridor cell 14 (Jones's slot) := empty
36921 LD HL,18678
36924 LD (31257),HL draw pointer -> cell 14's screen position
36927 CALL 31634 blit blank strip (erase the cat)
36930 LD A,(33683)
36933 CP 14 player cursor parked on Jones's cell?
36935 CALL Z,34743 yes: nudge it forward one position
36938 CALL 39670 one-shot Jones (tail) animation
36941 LD A,(33706) A = Jones's new room
36944 LD HL,29567 slot 0 byte +1: walk the +1 (room) column
36947 LD BC,2048 B = 8 slots, C = slot counter (0)
36950 LD DE,8 record stride
36953 CP (HL) is this actor in Jones's room?
36954 JR Z,36961
36956 INC C
36957 ADD HL,DE
36958 DJNZ 36953 next slot
36960 RET nobody shares Jones's room
36961 LD A,C
36962 AND A slot 0 = the ALIEN's room:
36963 JR Z,36873 the cat won't stay - re-roll the move
36965 PUSH HL
36966 PUSH DE
36967 LD E,6
36969 ADD HL,DE HL -> the slot's +7 status byte
36970 XOR A
36971 CP (HL) alive (status 0)?
36972 POP DE
36973 POP HL
36974 LD A,(33706)
36977 JR NZ,36956 not alive: keep scanning
36979 XOR A A = message #0
36980 LD L,C L = witnessing crew slot
36981 LD H,0
36983 CALL 37176 enqueue "{actor} sees Jones the cat"
36986 LD A,(31252)
36989 CP 1 corridor view mode?
36991 RET NZ
36992 LD A,(33706)
36995 LD HL,31242
36998 CP (HL) did Jones walk into the viewed room?
36999 RET NZ
37000 LD HL,18678 yes: draw pointer -> corridor cell 14
37003 LD (31257),HL
37006 LD A,51 sprite strip 51 = Jones the cat
37008 LD (29644),A corridor cell 14 := Jones
37011 CALL 31634 blit the cat into the corridor
37014 CALL 39655 start the Jones animation from frame 0
37017 RET
Prev: 36457 Up: Map Next: 37018