Prev: 6A81 Up: Map Next: 6AAD
6A83: Action: Wear
Wears the object. It must be carried and in this room, and it must not already be worn. The worn id replaces the object's location and the carried count drops.
Input
B Object number
C Object location
WearObject 6A83 CALL ObjectAddress Call ObjectAddress.
6A86 LD A,($5D8A) Jump to WearObject_Held if it is not *WornObject.
6A89 CP C
6A8A JR NZ,WearObject_Held
Print "you are wearing it.".
6A8C LD A,$1D Print SystemMessage_1D using PrintSystemMessage.
6A8E JP GetObject_Refuse
Wear it if it is carried or here.
WearObject_Held 6A91 LD A,($5D89) Jump to WearObject_Count if it is *CarriedObject.
6A94 CP C
6A95 JR Z,WearObject_Count
6A97 LD A,($5D87) Jump to WearObject_Take if it is *CurrentRoom.
6A9A CP C
6A9B JR Z,WearObject_Take
Print "sorry, I don't see it here.".
6A9D LD A,$16 Print SystemMessage_16 using PrintSystemMessage.
6A9F JP GetObject_Refuse
Count one fewer carried object.
WearObject_Count 6AA2 PUSH HL Stash HL on the stack.
6AA3 LD HL,$5D8C Decrement *CarriedCount.
6AA6 DEC (HL)
6AA7 POP HL Restore HL from the stack.
Mark the object as worn.
WearObject_Take 6AA8 LD A,($5D8A) Write *WornObject into the object's location.
6AAB LD (HL),A
6AAC RET Return.
Prev: 6A81 Up: Map Next: 6AAD