Prev: 8CE0 Up: Map Next: 8D33
8CF1: Can the actor pick the first object up?
Used by the routines at DO_TAKE and DO_THROW_AT.
Its weight and all it holds must fit what the actor can carry -- byte 3 of the actor's record less its own weight and load -- or "the ... is too heavy to lift." and "you are carrying too much."; and a liquid cannot be picked up at all. A refusal leaves the handler that called it.
CAN_LIFT 8CF1 LD IX,(TARGET_RECORD) Its weight with all it holds, at most 255
8CF5 LD A,(TARGET)
8CF8 CALL WEIGHT_HELD
8CFB ADD A,(IX+$03)
8CFE JR NC,CAN_LIFT_0
8D00 LD A,$FF
CAN_LIFT_0 8D02 LD B,A
8D03 LD IY,(ACTOR) More than the actor can carry at all? "too heavy to lift"
8D07 LD A,(IY+$03)
8D0A SUB B
8D0B LD HL,MSG_IS_TOO_HEAVY_TO
8D0E JR C,CAN_LIFT_1
8D10 PUSH AF More than it can carry besides its load? "you are carrying too much"
8D11 LD A,(ACTING)
8D14 CALL WEIGHT_HELD
8D17 LD B,A
8D18 POP AF
8D19 SUB B
8D1A JP P,CAN_LIFT_HERE
8D1D LD HL,MSG_CARRYING_TOO_MUCH
CAN_LIFT_1 8D20 EX (SP),HL Refused, from the caller
8D21 POP HL
8D22 JP RUN_MESSAGE_HL
This entry point is used by the routines at DO_PUT_IN and INTO_THE_RIVER.
CAN_LIFT_HERE 8D25 CALL ONE_PLACE Fine, unless ONE_PLACE objects or it is a liquid
8D28 JR NZ,CAN_LIFT_2
8D2A BIT 1,(IX+$07)
8D2E RET Z
CAN_LIFT_2 8D2F POP HL Refused
8D30 JP REFUSE
Prev: 8CE0 Up: Map Next: 8D33