I want to limit what the player can interact with when they’re sitting on the bed. There’s a bedside table which has stuff they can interact with, everything else is out of reach.
I’m using this code to manage that:
A thing can be reachable from bed.
Instead of doing something to anything not reachable from bed when the player is on the bed and the action requires a touchable noun,
Say "You'll have to get off of the bed first."
Instead of going when the player is on the bed, instead say "It's hard to walk somewhere when you're on your bed..."
It’s functionally working, however, I have a few things to tidy up that my I7 experience doesn’t know how to.
- When I go West, between which there is a closed door, I get this output:
w
(first opening the Sliding Door)
You’ll have to get off of the bed first.x door
the sliding door’s description. It is closed
It’s a little confusing stating that the door is being opened when in actuality the action does not succeed.
- I need to modify the reachable from bed state for objects as the player interacts with them. Currently, everything on or in the bedside table is hard-coded the property ‘reachable from bed’ - is there a cleaner way to do so, such as claiming everything on the table is reachable from bed? Also, an item carried should be reachable obviously and an item dropped while on the bed should be too - however, if it is dropped on the floor while standing, it should not be.