Giving different actions a range of durations using a time allotment rulebook.

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".
Test me with "z / n / s / u".
Quai
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.

>(Testing.)

>[1] z
Time passes.

>[2] n

Cafe
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.

>[3] s

Quai
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.

>[4] u
You struggle uphill for some distance...

City
The bells ring out from Place Carnot.