Is there a way to make an action depend on a varying number?
Tiredness is a number which varies. Tiredness is initially 0.
Every turn:
increase tiredness by 1.
Works. Now, what I would like to do is make it so the player is only able to sleep if tiredness is more than a certain number. I would also like to know how to change the number to 0 again, after the player has slept, but I figure “now tiredness is 0” will work where I also write how much time has passed.
I have written this redefining how sleep works, much of which I picked up online. I’m going to add a passage of time associated with sleeping, and maybe dream sequences as well. (But I have found examples of how to do that.)
Include Postures by Emily Short.
The player is in Abandoned Hovel.
Tiredness is a number which varies. Tiredness is initially 0.
Every turn:
increase tiredness by 1.
A person is either awake or asleep. A person is usually awake.
A check sleeping rule:
if the player is not on a supporter:
say “You are unable to sleep while standing.” instead.
The block sleeping rule is not listed in any rulebook.
After sleeping: now the player is asleep; say “You fall asleep.”
Instead of doing something other than waking up, waiting or sleeping when the player is asleep:
say “Deep within the realms of dreams and terrors, you are unable to do that!”
Instead of sleeping when the player is asleep:
say “Zzzz.”
Instead of waking up when the player is asleep:
now the player is awake;
say “You come to suddenly, wiping drool from your lips.”
Instead of lying down:
if the player is not on a supporter:
say “You don’t feel like lying down on the ground.” instead.
I’m trying to forbid the player from lying down on the ground. I have checked that the verb is “lying down”, and it does work for other verbs. I’m thinking it has something to do with the extension. Is there a rule I have to forbid or change, or what is going on?