Greetings!
I’m completely new to I7 and am having a heck of a time figuring out what the right syntax is to interact with properties on a thing.
The mechanic I’m trying to implement is a “danger factor” for a room. What I can’t seem to get, is the right wording for querying and interacting with that number.
My story looks like this so far:
A dangometer is a kind of device. The description of the dangometer is "A thin strip of plastic containing an antenna and a small digital display. The display, so you're told, indicates how dangerous your surroundings are. 0 is 'completely safe' and 10 is 'imminent death'." The dangometer is always switched on.
A room has a number called danger level. The danger level of a room is usually 0.
Definition: A room is safe if its danger level is 0.
Definition: A room is dangerous if its danger level is 1 or more.
Definition: A room is deadly if its danger level is 9 or more.
Every turn while the player is in a dangerous room:
Increase danger level by 1.
Every turn (this is the dangometer rule):
If player carries a dangometer, and the dangometer is switched on:
say "The dangometer in your pocket beeps - the danger level of this room is now [danger level of this room]"
The dungeon is a room. The dungeon has danger level 0.
The feeding chamber is south of the dungeon. The dungeon has danger level 1.
As written above, entering second room results in a runtime error:
*** Run-time problem P31: Attempt to use a property of the 'nothing' non-object: property danger level
I’ve tried a couple of different ways of rewriting the rules, but none of them lead to the desired behavior. It looks like I haven’t quite mumbled the right incantation to refer to the danger level of the room the player is currently in.
What is the “right” way to access this danger level property from within rules and Say blocks?