Prev: 96B3 Up: Map Next: 977C
9728: Is somebody else carrying this object?
Used by the routine at DO_ACTION.
Only asked for the player. If a character holds the object, the player is told so -- "the ... is carrying ...", with the two names -- and it cannot be acted on. Something the player has, however deep, and something held by a non-character, are fine.
Input
A The object, or $FF
Output
F NZ if another character has it
CARRIED_BY_ANOTHER 9728 CP $FF
972A RET Z
972B PUSH IX
972D PUSH IY
972F PUSH BC
9730 LD B,A
9731 LD A,(ACTING) Only for the player
9734 CP $00
9736 JR Z,CARRIED_BY_ANOTHER_0
9738 XOR A
9739 JR CARRIED_BY_ANOTHER_1
CARRIED_BY_ANOTHER_0 973B LD A,B Held by nothing: fine
973C CALL GET_OBJECT
973F LD A,(IX+$01)
9742 CP $FF
9744 JR Z,CARRIED_BY_ANOTHER_1
9746 LD A,B Held, at any depth, by the player: fine
9747 PUSH IX
9749 POP IY
974B CALL ACTOR_HAS_A
974E JR C,CARRIED_BY_ANOTHER_1
9750 CALL GET_OBJECT Its holder a character, and PLAYER_FLAGS bit 7 set?
9753 BIT 6,(IX+$07)
9757 JR Z,CARRIED_BY_ANOTHER_1
9759 LD A,(PLAYER_FLAGS)
975C BIT 7,A
975E JR Z,CARRIED_BY_ANOTHER_1
9760 LD L,(IY+$08) Then "the ... is carrying ..."
9763 LD H,(IY+$09)
9766 PUSH HL
9767 LD L,(IX+$08)
976A LD H,(IX+$09)
976D PUSH HL
976E LD HL,MSG_IS_CARRYING
9771 CALL RUN_MESSAGE_HL
9774 OR $01
CARRIED_BY_ANOTHER_1 9776 POP BC
9777 POP IY
9779 POP IX
977B RET
Prev: 96B3 Up: Map Next: 977C