Hi,
Bit of a newbie question here. How can I check if the player has eaten the spinach before opening a door? If they have, the door opens, otherwise, say “you don’t have enough strength”.
Any help would be much appreciated. Here’s the code I have so far:
The can is on the table.
The can is a container.
The can is openable.
The can is closed.
The can is opaque.
Inside the can is spinach.
The spinach is edible.
After eating the spinach, say "You eat the spinach and feel envigorated and fortified."
The description of the can is "The label on the can reads: 'Class A Spinach - Gives you Strength and Vitality'."
The sewer is a room. "You are in the sewer. It has a most unpleasant odour and there are rats here."
The grate is a door.
The grate is closed.
The grate is down from the kitchen and up from the Sewer.
The description of the grate is "The metal grate is heavy and rusty."
Before opening the grate:
if player has eaten spinach:
say "You easily lift the heavy grate.";
else:
say "you don't have enough strength to open the heavy grate.";
stop the action.
Running the code produces the following error:
I was trying to match this phrase:
if (spinach is not eaten - a condition):
This was what I found out:
spinach is not eaten = something unrecognised
How would I rephrase this condition: if player has eaten spinach ?
Many thanks.