Prev: 9055 Up: Map Next: 90A2
9078: OPEN
Checks that the target is not locked or already open (A129; if it is, A09C says so, e.g. 'the door is locked'). Then sets bit 5 (open) of its flags. If the target is an ordinary object (a container rather than a door) and has something in it, the contents are listed (9EF8) unless the actor is in the dark (9F89).
9078 CALL $A129 Is the target locked, or already open?
907B JP NZ,$A09C If either, explain why it cannot be opened ("the door is locked."/"the chest is open.")
907E CALL $9C99 Dry run? Then stop here: it would work
This entry point is used by the routines at 8FCF and A28E.
9081 SET 5,(IX+$07) Open it
9085 LD A,(IX+$00) Is the target an ordinary, single-place object (not a door, which needs no further reply)?
9088 DEC A
9089 RET NZ A door: nothing more to say
908A LD A,($B5D9) An ordinary container: does it hold anything visible?
908D CALL $9CEC
9090 AND A
9091 RET Z Nothing inside: nothing more to say
9092 LD A,($B5D9) Something inside: print the heading for it ("in the chest there is")
9095 CALL $9F89
9098 RET C Nothing worth listing after all: stop
9099 LD B,(IX+$10) B = the target's own room
909C LD A,($B5D9) List everything it holds
909F JP $9EF8
Prev: 9055 Up: Map Next: 90A2