Prev: A244 Up: Map Next: A2B4
A248: TIE TO
Only with the rope. TIE ROPE TO X is made TIE X TO ROPE by swapping the objects (SWAPPED_OBJECTS). Not a liquid, not anything with something visible in it ("the ... is already tied."), and not a living character -- a dead one can be. The thing is then held by the rope; and the rope goes to the one who tied it if they have the thing, or could take it, and is left lying otherwise.
DO_TIE A248 LD A,(TARGET) TIE ROPE TO X: swap them round
A24B CP $12
A24D JR Z,DO_TIE_3
A24F LD A,(INSTRUMENT) Only to the rope
A252 CP $12
A254 JP NZ,REFUSE
A257 LD IX,(TARGET_RECORD) Not a liquid
A25B BIT 1,(IX+$07)
A25F JP NZ,REFUSE
A262 CALL COUNT_HELD Nothing in it already
A265 CP $00
A267 LD HL,MSG_IS_ALREADY_TIE_D
A26A JP NZ,RUN_MESSAGE_HL
A26D BIT 3,(IX+$07) Not a living character
A271 JR NZ,DO_TIE_0
A273 BIT 6,(IX+$07)
A277 JP NZ,REFUSE
DO_TIE_0 A27A CALL FOR_REAL The test ends here
A27D LD IY,(INSTRUMENT_RECORD) Tied: held by the rope
A281 CALL ACTOR_HAS_FIRST
A284 LD A,(INSTRUMENT)
A287 LD (IX+$01),A
A28A JR C,DO_TIE_1 Could the actor take it? A test of TAKE
A28C SUB A
A28D LD (DOING_IT),A
A290 CALL DO_TAKE
A293 LD A,(SUCCEEDED)
A296 CP $00
A298 LD A,$01
A29A LD (DOING_IT),A
A29D LD (SUCCEEDED),A
A2A0 JR Z,DO_TIE_2
DO_TIE_1 A2A2 LD A,(ACTING) Then the rope is the actor's...
A2A5 LD (IY+$01),A
A2A8 RET
DO_TIE_2 A2A9 LD (IY+$01),$FF ...otherwise it is left
A2AD RET
DO_TIE_3 A2AE LD HL,DO_TIE The objects swapped round, and again
A2B1 JP SWAPPED_OBJECTS
Prev: A244 Up: Map Next: A2B4