1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-07 17:44:22 +03:00
inform7/resources/Documentation/Examples/Endurance.txt
2023-07-24 21:57:30 +01:00

62 lines
2.5 KiB
Plaintext

Example: ** Endurance
Location: Two rulebooks used internally
RecipeLocation: The Passage Of Time
Index: All actions given different durations
Description: Giving different actions a range of durations using a time allotment rulebook.
For: Z-Machine
Here we move to a systematic way of giving different durations to different actions, including even variations on the same act -- so that for instance climbing a steep hill might take several minutes more than other going actions. We do this by setting a number, "work duration", to represent the number of minutes consumed by a given action, and then consulting a rulebook to find out how long the past turn's action should take. By default, an action will take 1 minute.
We'll start by emulating the behavior of "Uptempo": each turn we'll set the clock forward most of the way, then check to see what has changed since the last turn, print any relevant events, and only then set the clock forward the final minute. The exception is when an action is set to take no time at all; in that case, we'll skip the rest of the turn sequence rules entirely.
{*}"Endurance"
Work duration is a number that varies.
Every turn:
now work duration is 0;
increment the turn count;
follow the time allotment rules;
if work duration is 0, rule succeeds;
increase the time of day by (work duration minutes - 1 minute).
The time allotment rules are a rulebook.
A time allotment rule for examining or looking:
now work duration is 0;
rule succeeds.
A time allotment rule for going:
now work duration is 2;
rule succeeds.
A time allotment rule for going up:
now work duration is 5;
rule succeeds.
A time allotment rule for waiting:
now work duration is 10;
rule succeeds.
The last time allotment rule:
now work duration is 1.
When play begins: now the right hand status line is "[time of day]".
The Quai is a room. "An attractive park at the edge of the river Aude: here you can wander among palm trees, and watch cyclists go by on the bike path; in the water there are ducks. In the cafe to your north, patrons sip their pastis; and above you is the medieval walled city and its castle."
The Cafe is north of the Quai. "A charming collection of umbrella-shaded tables, from which one can watch the river and the walls of the city beyond. The noise of traffic is only a minor distraction."
The City is above the Quai.
After going to the City:
say "You struggle uphill for some distance...";
continue the action.
At 9:15 AM:
say "The bells ring out from Place Carnot."
Test me with "z / n / s / u".