Section - Picking a New Activity for Progue
[ To decide what to do next, Progue consults his animus table, and also considers such factors as whether it is time for bed or whether it is raining. Once decided, if present we describe him completing the old activity (stored in prior animus).]
To pick a new activity for Progue:
if Progue is being debugged, say "// Progue: pick a new activity.";
now the prior animus of Progue is the animus of Progue;
if the next animus of Progue is not null-endeavour begin;
now the animus of Progue is the next animus of Progue;
now the next animus of Progue is null-endeavour;
otherwise if it is after 7:00 PM or it is before 4:59 AM;
now the animus of Progue is resting;
otherwise;
if the psyche of Progue is ignorance begin; choose a random row in the Table of Progue Ignorance Endeavours;
otherwise if the psyche of Progue is denial; choose a random row in the Table of Progue Denial Endeavours;
otherwise if the psyche of Progue is fear; choose a random row in the Table of Progue Fear Endeavours;
otherwise if the psyche of Progue is suppression; choose a random row in the Table of Progue Suppression Endeavours;
otherwise if the psyche of Progue is uncertainty; choose a random row in the Table of Progue Uncertainty Endeavours;
otherwise if the psyche of Progue is emotional; choose a random row in the Table of Progue Emotional Endeavours;
otherwise; choose a random row in the Table of Progue Fugue Endeavours;
end if;
if raining and the psyche of Progue is denial, now the animus of Progue is ruminating;
otherwise now the animus of Progue is pick entry;
end if;
now Progue is wishing;
now the activity counter of progue is 0;
if Progue is being debugged, say "// Progue: picked a new animus ([animus of Progue]) replacing [prior animus of Progue].";
if the prior animus of Progue is cleaning begin;
mark workbench cleaned;
end if;
if the prior animus of Progue is paint-making begin;
while there is a pick of paint-making in Table of Progue Suppression Endeavours begin;
choose row with pick of paint-making in Table of Progue Suppression Endeavours;
blank out the whole row;
end while;
while there is a pick of paint-making in Table of Progue Uncertainty Endeavours begin;
choose row with pick of paint-making in Table of Progue Uncertainty Endeavours;
blank out the whole row;
end while;
while the number of paintpots enclosed by Progue > 0 repeatedly move a random paintpot enclosed by Progue to Studio;
end if;
if the prior animus of Progue is beach-combing and location of Progue is regionally in Beachfront, cleanify the beach in location of Progue;
if the prior animus of Progue is the animus of Progue begin;
unless current episode is rendezvous and location is not meeting place of current episode, now Progue is fulfilling; [ already there; job's done ]
otherwise if location of Progue is not progue-venue and location of Progue is not UnRoom;
if progue is being debugged, say "// Progue: skipping description because location of Progue ([location of Progue]) is not progue-venue ([progue-venue]).";
do nothing; [ Progue was pulled away from the natural location of his last task, so it may not be safe to describe him finishing it here. ]
otherwise if Progue is enclosed by location and dont_describe_Progue is false;
let skipdecision be false; [ We can set this to true if we don't want to show Progue deciding what to do for various reasons; this later adjusts line breaks as necessary.]
if the prior animus of Progue is ruminating begin; say "[The Progue] [one of]stands[or]gets up[or]gets to his feet[at random], [one of]seems to shake himself[or]rubs his face and blinks a few times[or]stretches[at random], and [one of]looks around, seemingly surprised at the time[or]glances around him, bemused[at random]";
otherwise if the prior animus of Progue is scrapbooking; say "Finally putting the items aside, Progue rises with a sigh, brushing his hands off on his pants";
otherwise if the prior animus of Progue is resting; if the psyche of Progue is emotional, say "Progue opens his eyes slowly, blinking and seeming unable to focus. Finally he stretches and sits up a little bit, glancing around the room blearily"; otherwise say "[one of]With a great yawn, [the Progue] opens his eyes and stretches[or][The Progue] suddenly sits up with a start, looking around wildly for a moment before calming down[or][The Progue] rolls over and opens his eyes, scratching his eyes and then blinking them blearily open[at random]. After a moment, he gets to his feet and rubs his hands together";
otherwise if the prior animus of Progue is fishing; say "[one of]With a look of disgust, [the Progue] gathers in his fishing line and wades back to dry land[or]With a satisfied grunt, [the Progue] disassembles his pole and brushes off his hands[or][The Progue] reels in his fishing line hand over hand, returns it to a pocket, and sloshes noisily back to shore[at random]";
otherwise if the prior animus of Progue is mending; say "[The Progue] [one of]tucks[or]puts[at random] the needle and thread [one of]back in his pocket[or]away[at random] and [one of]gets up[or]stands[or]rises[at random]";
otherwise if the prior animus of Progue is hand-standing; say "Balancing carefully, [the Progue] executes a neat little flip that leaves him standing back on his feet again. He brushes his hands off in satisfaction, as if something terribly important has been accomplished";
otherwise if the prior animus of Progue is cleaning; say "Progue nods at the cleaned-up workbench in satisfaction. 'Good then, ready to be used again,' he says";
otherwise if the prior animus of Progue is paint-making; say "Progue sets the pot full of vivid paint on the counter and wipes his hands off on a konokuk leaf. 'Excellent: should last for weeks,' he says";
otherwise if the prior animus of Progue is frog-catching; say "[if caught-frog is true]Sadly, [the Progue] puts his hands near the ground and lets his captive leap away[otherwise]Grunting, [the Progue] rises to his feet and brushes his hands on his pants, sighing despondently[end if]";
otherwise if the prior animus of Progue is beach-combing; say "[The Progue] takes one final look around the now-immaculate beach, and nods in satisfaction";
otherwise if the prior animus of Progue is hottubbing; say "Hopping lithely from the water, [the Progue] quickly slips back into his patchwork garments and dances from foot to foot in a beam of sunlight, shaking his arms"; move Progue to Hot Springs;
otherwise if the prior animus of Progue is swimming; say "Abruptly, [the Progue] kicks and sinks backwards into the water, only to surface again and begin kicking back to shore with a powerful stroke";
otherwise; now skipdecision is true; [ If the animus of Progue was something else, we were probably talking to him, and so we probably already described him finishing what he was doing (talking).]
end if;
if the prior animus of Progue is not swimming and the animus of Progue is fishing begin; say ". He pulls out a short length of bamboo with a line attached to it from somewhere in his patchwork costume.";
otherwise if skipdecision is false; say "."; end if;
end if;
unless current episode is rendezvous and location is not meeting place of current episode, now progue-venue is UnRoom;
if the prior animus of Progue is fishing, remove fishing-pole from play;
if the animus of Progue is fishing, move fishing-pole to Progue.
[ To determine where to perform an animus at, we define valid locations for each one by hand.]
To select a progue-venue for Progue:
if the animus of Progue is ruminating begin; now progue-venue is a random room in Beachfront;
otherwise if the animus of Progue is resting;
if the psyche of Progue is fear begin;
now progue-venue is Ledge;
otherwise;
if the psyche of Progue is emotional begin; now progue-venue is Hut;
otherwise if a random chance of 1 in 2 succeeds and nothing dramatic is up; now progue-venue is a random room in Beachfront;
otherwise; now progue-venue is Ledge; end if;
end if;
if progue-venue is Lower Beach, now progue-venue is North Beach;
otherwise if the animus of Progue is fishing; if tidein, now progue-venue is a random room in Beachfront; otherwise now progue-venue is Lower Beach;
otherwise if the animus of Progue is swimming; now progue-venue is Ocean Waters;
otherwise if the animus of Progue is mending; now progue-venue is a random room in Beachfront;
otherwise if the animus of Progue is loitering; now progue-venue is location of Progue;
otherwise if the animus of Progue is hand-standing; let brp be a random number from 1 to 3; if brp is 1, now progue-venue is Stumps; if brp is 2, now progue-venue is Rise; if brp is 3, now progue-venue is Chairlift Base;
otherwise if the animus of Progue is cleaning; now progue-venue is Studio;
otherwise if the animus of Progue is paint-making; now progue-venue is Studio;
otherwise if the animus of Progue is frog-catching; now progue-venue is a random room in Marshlands;
otherwise if the animus of Progue is hiding or the animus of Progue is spying or the animus of Progue is scrapbooking; now progue-venue is Ledge;
otherwise if the animus of Progue is conch-blowing; now progue-venue is Center Beach;
otherwise if the animus of Progue is player-seeking; now progue-venue is location of player;
otherwise if the animus of Progue is beach-combing; now progue-venue is Among the Boulders; while progue-venue is Among the Boulders begin; now progue-venue is a random room in Beachfront; end while;
otherwise if the animus of Progue is hottubbing; now progue-venue is Hot Springs;
otherwise if the animus of Progue is convalescing; now progue-venue is Hut;
otherwise; now progue-venue is a random room in Beachfront;
end if;
if Progue is being debugged, say "// Progue: selected a progue-venue ([progue-venue]).".