People wander around some small map, on errands. One, sad to tell, has Gelato's Syndrome, a tragic condition turning one's skin the colour of a random flavour of ice cream (raspberry ripple, neapolitan, etc.). When two people are in the same room, there's a 1/3 chance that an infected person will infect a non-infected one. The player can cure any single person: victory condition - to stamp out the disease."
When play begins:
say "Gelato's Syndrome. It's struck, and it's struck hard. In these sticky summer months, there's no telling who will contract the disease next.";
now the command prompt is "[if the destination of the player is not blank](heading to [destination of the player]) [end if]>".
Protection relates a door (called X) to a room (called Y) when the front side of X is Y or the back side of X is Y. The verb to protect means the protection relation.
An artwork is a kind of thing. Before printing the name of an artwork, say italic type. After printing the name of an artwork, say roman type. An artwork can be submitted or reserved.
A book is a kind of artwork.
Before someone resolving a book when the person asked is not in the Public Library:
try the person asked approaching the Public Library instead.
Infection color is a kind of value. The infection colors are french vanilla, whole-bean vanilla, mint, chocolate, dark chocolate, chocolate chip, chocolate fudge, mint chocolate chip, chocolate chocolate chip, triple chocolate, white chocolate, white chocolate chip, aztec cocoa-chili, raspberry ripple, neapolitan, rum raisin, dulce de leche, strawberry chunk, rocky road, blackberry sorbet, lemon sherbet, lime ice, caramel swirl, mango, saffron silk, and cookie dough cream.
An ice cream cone is a kind of thing. An ice cream cone is always edible. An ice cream cone has an infection color. An ice cream cone can be half-eaten or fresh. Understand the infection color property as referring to an ice cream cone.
if the player is clean, say "You're not sickly." instead;
if the noun is the player, say "Ew." instead;
if the noun is not a person, say "[The noun] cannot be infected." instead.
Carry out sneezing on:
now the noun is infected;
now the infection color of the noun is a random infection color.
Carry out someone sneezing on:
now the noun is infected;
now the infection color of the noun is a random infection color.
Report sneezing on:
say "Unable to control yourself, you sneeze on [noun].".
Report someone sneezing on:
say "[The person asked] sneezes on [if the noun is the player]you[otherwise][noun][end if]!".
Understand "inject [someone] with [something]" as injecting it with. Understand "inject [someone] with [syringe]" as injecting it with. Understand "use [syringe] on [someone]" as injecting it with. Understand the commands "innoculate" and "vaccinate" as "inject".
if the noun is the location, say "You're already in [the location]." instead.
Carry out going toward:
now the destination of the player is the noun;
let heading be the best route from the location to the noun, using even locked doors;
if heading is not a direction, say "You can't think how to get there from here." instead;
try going heading;
if the location is the destination of the player, now the destination of the player is blank.
Instead of waiting when the destination of the player is not blank:
if the destination of the player is the location:
now the destination of the player is blank;
otherwise:
try going toward destination of the player;
if the location is the destination of the player, now the destination of the player is blank.
Understand "stop" or "cease" as stopping. Stopping is an action applying to nothing. Carry out stopping: now the destination of the player is blank. Report stopping: say "You stop in your tracks."
After going to an air-conditioned room:
say "You step into the mercifully air-conditioned surroundings of...";
The Alfred Cralle Pool Hall is a room. "The town's most popular gathering-place, the pool hall is decorated in honor of the inventor of the ice cream scoop." The air conditioner is a device in the Pool Hall. "[if switched off]An air conditioner sits in the corner, unhappily inert[otherwise]The air conditioner hums briskly[end if]."
The felt door is west of the Pool Hall. The felt door is a door. The felt door is open. The felt door is lockable and unlocked. The key to the city unlocks the felt door. The description of the felt door is "It has a prominent lock, designed for an old-fashioned key."
After locking a door with something in the presence of an other person (called audience):
say "[The audience] looks a little non-plussed when you lock [the noun], but shrugs."
Nancy Johnson Memorial Square is west of the felt door. The description of Nancy Johnson Memorial Square is "Waves of August heat rise from the pavement: more than once you've had the fancy that your shoes are simply going to stick. At the center of the square, rubbed to a brownish polish by many adoring hands, is the statue of Mrs. Nancy Johnson of New Jersey."
The statue is scenery in Memorial Square. Understand "nancy" or "johnson" or "mrs" as the statue. The description of the statue is "Mrs. Johnson is pictured with a hand-cranked ice cream freezer tucked under one arm. Her other hand grips an ice cream scoop, ready to serve frozen dessert to the huddled masses." A hand-cranked ice cream freezer is part of the statue. The description is "The hand-cranked ice cream freezer was Mrs. Johnson's invention in 1846, though it was William Young who had the sense to patent the thing in 1848." The scoop is part of the statue. The description of the scoop is "An anachronism: Alfred Cralle would not invent the tool until 1897."
The Post Office is northwest of Nancy Johnson Memorial Square. "Service at the post office is on the slow side since everything went automated." The slot is scenery in the post office. The slot is a container. Carry out inserting something into the slot: now the noun is nowhere. Report inserting something into the slot: say "[The noun] falls out of sight, and you know you will never see it again."
Hamwi Street is northeast of an iron gate. "A U-shaped street running from Main Street around to the Memorial Square, Hamwi Street was recently added by ambitious city planners. The small and straggly line of trees has yet to grow enough to provide perceptible shade, so the street is even hotter and more unforgiving than the other parts of town."
Cold Comfort Ice Cream is north of a metal door. The metal door is north of Hamwi Street. A poster is fixed in place in Cold Comfort. "A poster fills one wall with the blazing promise of treats to come." The description of the poster is "Coming soon! Thai ice creams! Durian, jackfruit, taro, and coconut flavors!"
The metal door is a door. "A frosty metallic door separates [the location] from [the other side of the metal door]." The metal door is lockable and unlocked. The key to the city unlocks the metal door.
Marciony Street is southeast of Nancy Johnson Memorial Square. "A semi-circular terrace, named somewhat fancifully after one claimant to the invention of the ice cream cone -- though Hamwi Street competes for the same honor. There are wedges of cool shadow here and there thanks to the buildings, but for the most part the southern exposure keeps Marciony unpleasantly hot."
The Movie Rental Store is west of a glass door. The glass door is a door. It is west of Marciony Street. The glass door is lockable and unlocked. The key to the city unlocks the glass door.
The emergency box is in Main Street. The emergency box is fixed in place. "A fire-red box with a glass front faces the sidewalk, with 'In case of emergency, BREAK GLASS' lettered on it." The emergency box is closed and transparent. Understand "glass" as the box. Instead of attacking the closed emergency box: say "You hit the emergency box, which shatters open."; now the emergency box is open. Instead of attacking the open emergency box: say "The glass has already been thoroughly broken."
The syringe is in the emergency box. The description of the syringe is "It contains the cure for Gelato's Syndrome. You can inject anyone you like with it."
The bronze gates are northeast of Marciony Street. The bronze gates are a door. The bronze gates are lockable and unlocked. The description of the bronze gates is "Erected during the milk-taint revolution of 1937, they were designed to keep Main Street safe from the depredations of dairy-starved rioters."
The Public Library is east of Main Street. "Built in the 1920s during the height of the dairy boom, the public library has lush pink velvet seats, marble walls the color of fresh cream, and a motif of cherries carved around every doorframe. An incongruous sign hangs from the ceiling." The incongruous sign is scenery in the Public Library. The description of the incongruous sign is "Eating and drinking in the library is STRICTLY PROHIBITED."
Town Hall is southeast of Main Street. "Town Hall was built during the slow days of the ice-cream bust, and therefore it is as joyless and utilitarian as the Public Library is ridiculous. Unwilling to be reminded of their pain, the inhabitants steered clear of any decoration that might remotely be construed to resemble a scoop of anything: so there are no curves, only disciplined right angles." The key to the city is in Town Hall. It unlocks the iron gate. It unlocks the bronze gates. The description of the key to the city is "A skeleton key."
say "From here you can head into [the list of adjacent indoors rooms][if a proximate door is not mentioned], or go through [the list of proximate doors which are not mentioned][end if]. [run paragraph on]";
if an outdoors room is adjacent:
say "You could[if started printing is true] also[end if] go ";
let count be the number of adjacent outdoors rooms;
let index be count;
repeat with next room running through adjacent outdoors rooms:
let way be the best route from the location to the next room;
say "[way] to [the next room]";
decrement index;
make delimiter index of count, continuing;
if a proximate door is not mentioned:
let started printing be true;
say "[if started printing is true]Also available[otherwise]Your available exits[end if] [is-are the list of proximate doors which are not mentioned].";
Francine is a woman in the Public Library. Francine carries a book called Phlox for Phyllis. Francine carries a stamped envelope called a pink stamped envelope.
Lewis is a man in the Alfred Cralle Pool Hall. Lewis carries 3 stamped envelopes. Lewis carries a book called Idiot's Guide to Dating. Lewis carries a book called How to Meet Women. Lewis carries a book called Seduction in Three Easy Steps. Lewis carries a DVD called Sleepless in Seattle.
Gene is a man in Nancy Johnson Memorial Square. Gene carries a stamped envelope. Gene carries a DVD called Casablanca. Gene carries a coupon.
Rhoda is a woman in Marciony Street. Rhoda carries a book called The Marciony Street Murders. Rhoda carries a DVD called Unsolved Serial Killings XVIII. Rhoda carries a stamped envelope called a squashy package.
Martin is a man in Main Street. Martin carries a DVD called The Lifecycle of the South Sea Tortoise. Martin carries a coupon.
Antony is a man in Movie Rental. Antony carries a coupon. Antony carries a stamped envelope called a postcard.
Shelby is a man in the Town Hall. Shelby carries a DVD called Conducting An Orderly Meeting. Shelby carries 5 stamped envelopes. Shelby carries an ice cream cone. Shelby carries a coupon.
After printing the name of someone (called target) while listing contents: if the target owns the location of the target, say " (the owner)".
The description of a person is usually "[The noun] [if the noun is clean]looks healthy[otherwise]is the color of [infection color of the noun][end if]."
After examining another person who is carrying something: say "[if the noun is female]She[otherwise]He[end if] is carrying [a list of things carried by the noun]."
When play begins: let Patient Zero be a random other person; now patient zero is infected.
This is a light variation of a previous example, but we use it here because it is convenient:
{**}Section 5 - Conversation
A person has a table name called conversation.
Instead of asking someone about something:
let the source be the conversation of the noun;
if topic understood is a topic listed in source:
if there is a turn stamp entry:
say "You have already heard that [summary entry].";
Understand "recap" or "recall" or "review" as recalling conversations.
Recalling conversations is an action applying to nothing.
Carry out recalling conversations:
repeat with speaker running through other people:
let source be the conversation of the speaker;
sort source in turn stamp order;
say "[The speaker] has so far told you: [line break]";
let index be 0;
repeat through source:
if there is a turn stamp entry and the speaker is character entry:
let index be 1;
say " [summary entry][line break]";
if index is 0, say " absolutely nothing[line break]";
say line break.
The conversation of a person is usually Table of General ChitChat.
Table of General ChitChat
topic reply summary turn stamp character
"weather/heat/warmth" "'It's appalling, isn't it? You'd think we didn't pay our taxes.'" "that the weather is appalling" a number a person
"sun/sunlight" "'Good thing the town mostly switched to solar power, har, har.'" "that the town is mostly relying on solar power"
"rain" "'Nope, there isn't going to be rain for 132 days,' replies [the noun]." "that rain is not expected for another 132 days"
"snow/hail/ice" "This hilarious sally is greeted with hoots of laughter only." "that the concept of snow is downright laughable"
"disease/sickness/illness/syndrome" "You get a cold, fixed stare in response. 'That's not funny,' [the noun] replies finally." "that discussing the disease is more or less taboo"
"cold comfort" "'If you haven't tried it, you should,' says [the noun]. 'Best ice cream in town, and that's saying something, you bet.'" "that Cold Comfort has the best ice cream in town"
"town/city/village" "'Yeah, it's a mite odd,' allows [the noun]. 'Not to everyone's taste, like...' [the noun as pronoun] considers for a moment. 'Like ginger ice cream. Big pieces of crystallized ginger... not everyone likes that.'" "that the town is a mite odd"
"forecast/weatherman" or "weather forecast/man" "'Oh, the weather man's gotten a lot more reliable since the gummint started making it for us,' says [the noun]. 'Now he just reads off the schedule on the air every morning. Pretty much takes the fun right out of the news, if you ask me.'" "that the weather is all generated by schedule"
"taxes/tax" or "weather tax" "A snort. 'You'd think for the rates we pay we'd get something a little pleasanter, don't you?'" "that the weather tax really ought to be paying for something nicer than what you get"
"job/employment/work" "'[if the noun owns a room (called the shop)]I own [the shop],' replies [the noun][otherwise]Work at the creamery, like most folk around here,' answers [the noun]." "this and that about employment in town"
"book/books/reading" "'The Public Library has a good selection, excepting only the cookbook section,' says [the noun]. 'That got censored way back when-- well, way back.'" "that the Public Library has a good collection, except for the cookbook section"
The conversation of Vanessa is the Table of Vanessa Chatter.
Table of Vanessa Chatter
topic reply summary turn stamp character
"ice cream" or "sorbet/sherbet/flavor/flavors/flavour/flavours/ice/ices" "'The flavors are [list of flavors],' she responds promptly, without needing to draw breath." "that the flavors are [list of flavors]" a number a person
After reading a command:
while player's command includes "the":
cut the matched text.
This strips 'the' out of the command, so that ASK PERSON ABOUT THE RAIN will be understood as well as ASK PERSON ABOUT RAIN.
Now we try something a bit unusual. Inform on its own will report each action on its own line, so that each character who walks into or out of a room will be described in a separate paragraph. This is usually fine, but in a game with a lot of characters moving around simultaneously, it can become a bit overwhelming. Instead, we may want to condense these reports into a single line, such as "Ben and Jerry enter from the south". The following accomplishes that goal by replacing some of the reporting rules, storing the information in a table, and then reading the table back later, once all the character movement has been resolved and the reports can usefully be collated:
{**}Section 6 - Movement Description
A person has some text called walk style. The walk style of a man is usually "stride". The walk style of a woman is usually "strut". The walk style of Gene is "[one of]wander[or]stroll[purely at random]". The walk style of Francine is "waddle". The walk style of Antony is "scamper". The walk style of Rhoda is "sashay".
Report someone going through a door (called route):
if the person asked is not the last opener of the route, continue the action;
if the person asked is the last person named, say "[The person asked as pronoun]";
otherwise say "[The person asked]";
say " [if the person asked is in the location]comes[otherwise]goes[end if] through[if the last thing named is not the route] [the route][end if]." instead.
The last thing named is a thing that varies. Before printing the name of something (called target) which is not a person: now the last thing named is the target.
if the total entry is 1 and count is 1 and accomplice carries something, say ", carrying [a list of things carried by the accomplice]";
decrement index;
make delimiter index of count, continuing;
now group size is total entry;
if a marked for listing person is infected:
[eliminate the case in which we have already seen this description because we just typed LOOK and the patient was in the room at the time]
if looking and a marked for listing person is not in the location:
clear marked people;
say paragraph break;
otherwise:
describe patients;
otherwise:
clear marked people;
say paragraph break.
The last person named is a person that varies. Before printing the name of a person (called target): now the last person named is the target. Group size is a number that varies. Group size is 1.
To clear marked people:
repeat with named party running through people:
now the named party is not marked for listing.
Before listing nondescript items:
if the number of people who are marked for listing is 0, make no decision;
say "You can see [a list of people who are marked for listing] here. ";
now group size is the number of people who are marked for listing;
describe patients;
now every marked for listing person is not marked for listing.
if every marked for listing person is infected and at least three people are marked for listing:
say "They are all sick as dogs, every one.";
clear marked people;
rule succeeds;
otherwise:
if the number of people who are marked for listing is greater than two and the number of infected people who are marked for listing is greater than the number of clean people who are marked for listing:
say "Only [the list of clean people who are marked for listing] currently remain[if the number of clean people who are marked for listing is 1]s[end if] untainted.";
To say (named character - a woman) as pronoun: if group size is 1, say "She"; if group size is 2, say "The latter"; if group size is greater than 2, say "The last".
The next part could be simpler, but for rigor we will write it in such a way that it will work whether or not the serial comma is in use. This requires some extra work.
{**}To make delimiter (index - a number) of (count - a number), continuing or halting:
if index is 0:
if continuing, say ". [run paragraph on]";
otherwise say ".";
otherwise if index is 1:
if count is 2, say " and ";
otherwise say "[optional comma] and ";
otherwise:
say ", ".
To say optional comma:
if the serial comma option is active:
say ",".
Test me with "go to cold comfort / z / z / z / z / ask vanessa for french vanilla / ask vanessa for chocolate / ask vanessa about flavors / ask vanessa for chocolate chocolate chip".
Because so much of this game is randomized, it will not be possible to provide a test command that systematically solves it. A good strategy is to go to Main Street, get the syringe; go to the Town Hall and get the key; then visit the shops, inject everyone, and lock them in when they've all been injected. Then go to the Pool Hall, turn on the air conditioner, and wait for the remaining parties to show up.
This is also something that could get fairly slow if we added many more rooms and characters to it. In that case, we might want to select fast route-finding so that character movement won't take as long. This will cost memory, possibly forcing the game into Glulx format if it isn't already, but significantly reduce the run-time for large maps with numerous people moving each turn: