Prev: 35790 Up: Map Next: 35973
35814: SetActionTimer
Used by the routines at 35382, 35560, 35790, 36579 and 37493.
(IX+0) = A + ActionTimeBySlot[slot] + ActionTimeByStrength[(IX+4) & 7] — the shared countdown formula for every queued crew action (move, grille, attack, ...).
35814 PUSH AF A = base time from the caller
35815 LD HL,33786
35818 LD A,(31241) + per-slot adjustment
35821 LD D,0
35823 LD E,A
35824 ADD HL,DE
35825 LD C,(HL)
35826 LD A,(IX+4) + per-strength adjustment
35829 AND 7 (Wounded +48, strength 3 +16, else +0)
35831 LD E,A
35832 LD HL,33778
35835 ADD HL,DE
35836 LD A,(HL)
35837 ADD A,C C = slot + strength adjustments
35838 LD C,A
35839 POP AF recover the caller's base time
35840 ADD A,C
35841 LD (IX+0),A arm the countdown
35844 RET
GetJonesHandler — the "Get Jones" menu row (mode-1 row 14), reached through RoomDispatchTailExtra. Needs the Net (item 16) or the Cat Box (17) in the front hand; rolls a script nibble against JonesCatchBySlot — the Net gets -4 on the threshold, so it is the easier tool. Failure spooks Jones into moving at once; success destroys the tool, puts "Cat in Net"/"Cat in Box" (tool+4) in the catcher's hand and takes Jones off the map.
35845 LD (IX+0),0 park the actor's action countdown
35849 LD A,(31248) front-hand item...
35852 CP 17 ...the Cat Box?
35854 JR Z,35859
35856 CP 16 ...or the Net?
35858 RET NZ neither: cannot catch Jones
35859 LD A,(31241) E = JonesCatchBySlot[slot],
35862 LD E,A this crew member's catch threshold
35863 LD D,0
35865 LD HL,33762
35868 ADD HL,DE
35869 LD E,(HL)
35870 LD A,(31248) using the Cat Box?
35873 CP 17
35875 JR Z,35881
35877 LD A,E no, the Net: threshold -4
35878 SUB 4 (easier to succeed)
35880 LD E,A
35881 CALL 33589 roll the next script nibble (0-15)
35884 CP E beat the threshold?
35885 JR NC,35896 yes: caught him
35887 LD HL,33707 no: JonesMoveTimer = 1 —
35890 LD (HL),1 the cat bolts,
35892 CALL 36859 and UpdateJones moves him right now
35895 RET
35896 LD A,(31248) ItemLocations[tool] = 255:
35899 LD HL,29940 the Net / Cat Box ceases to exist...
35902 LD E,A
35903 LD D,0
35905 ADD HL,DE
35906 LD (HL),255
35908 LD E,4 ...and tool+4 ("Cat in Net" 20 /
35910 ADD HL,DE "Cat in Box" 21) appears
35911 LD A,(31241)
35914 ADD A,160 in the catcher's front hand (160+slot)
35916 LD (HL),A
35917 CALL 31820 refresh the HeldItemFront/Back cache
35920 LD A,(31248) front-hand strip cell ($73C6) =
35923 CALL 31857 the new "Cat in ..." item's string id
35926 LD (29638),A
35929 LD HL,18486 redraw the front-hand row
35932 LD (31257),HL (screen row 9, col 22)
35935 CALL 31634
35938 CALL 45510 +1 courage/morale for the catcher, and...
35941 LD (HL),255 ...JonesRoom = 255: Jones is off the map
35943 LD HL,18678 blank the "Get Jones" row
35946 LD (31257),HL (screen row 15, col 22)
35949 LD A,255
35951 LD (29644),A its strip cell 14 = empty
35954 CALL 31634
35957 CALL 34743 step the cursor off the now-empty row
35960 CALL 39670 run the cat animation once
35963 LD A,(31241)
35966 LD L,A L = capturing crew slot
35967 LD A,2 msg #2 "{actor} has captured Jones"
35969 CALL 37176
35972 RET
Prev: 35790 Up: Map Next: 35973