Thanks Nitku. Much better.
Similar situation:
Treasures are hidden everywhere, and they all have a similar name. What I don’t want is for the player to start up the game, enter a room, say “Take treasure” on pure whim, and be rewarded for that. So in most cases I have the treasure appearing, say in a container, only after she examines the container. This tends to work fine.
In one case I have a NPC carrying a treasure. I don’t want you to know that until you examine Suzy, so that you don’t walk into a room, ask for a treasure and get a response when you’ve bypassed the game play that leads you to know that Suzy is carrying it.
I started with “Rule for determinining the concealed possessions of Suzy: yes.”
But that meant:
x suzy
Suzy is carrying the red treasure.
Take red treasure
You can’t see any such thing.
So what I want is (sloppycode)
Instead of taking the red treasure:
if Suzy has been examined at least once,
say “Suzy won’t give it up easily”
otherwise,
say “you don’t see it here”.
and
Instead of asking Suzy for the red treasure
(same thing).
“Examined at least once” didn’t work and I couldn’t find a syntax that did.
I ended up doing this, which seems inelegant:
A person can be examined or unexamined.
After examining Suzy for the first time, now Suzy is examined.
If Suzy is examined, … game recognizes that you know about the treasure.
Is there a better way? I keep finding that most of my booleans aren’t necessary and are only making the code weirder, longer or harder to read.
Edited to add: The reason I don’t have Suzy’s treasure appearing only after you examine her is because I want to say
The description of Suzy is “[if Suzy carries the treasure]Suzy is carrying…[otherwise]Suzy looks like whatever”
I think there might have been another reason too. I’ll have to think about that.