I’m working on making a room where you can’t leave without finding a hidden key in the room. It seems to mostly work except for a problem: The game doesn’t recognize the key at all. I want it to work whether the key is in a pocket or your main inventory and it works in neither. You cannot ever leave. Here’s the code in question:
Clothing is a kind of thing. Clothing is wearable.
Understand "clothing/clothes/garment/garments" as clothing.
Pants is a kind of clothing.
A pocket is a kind of container. The carrying capacity of a pocket is 2. A pocket is a part of every Pants.
A burlap pants is a kind of pants. The description is "These are extremely uncomfortable itchy pants. They have a small pocket sewn on by you that looks like it may fall off at any moment."
The old burlap pants is a burlap pants.
The shack key is a thing. The description is "This is a small iron key for the lock of your shack door. Not that there's anything in there anyone would want."
That creates the pants in question. The following handles the key and the condition that keeps you from leaving:
After taking the shack key for the first time:
if the player wears the old burlap pants:
now the shack key is in the pocket;
say "You pick up the key and put in your pants pocket for safe keeping. Hopefully.";
else:
say "You pick up the key. If only you had a pocket to put it in...";
Before going north from Your shack:
if the player does not carry the Adventurer's Cloak:
say "You feel like you've forgotten something." instead;
if the player does not carry the shack key or the shack key is not in the pocket:
say "You realize you don't have your key. You should probably find that before you leave." instead.
North, of course, is the direction you leave the room.
My assumption is that “if the player does not carry the shack key or the shack key is not in the pocket:” doesn’t work how I think it does. (though the game runs, so it’s apparently valid syntax.) What I’m trying to say is “If the player doesn’t have a key in their inventory or in their pocket, then say”
So, any ideas on how to make this work?