If a single command asks to do many things, some dull and some exciting, we may want to save the good ones for the end.
"The Best Till Last"
The Funky Ignition Lounge is a room. "This is where all evenings end." The stick of gelignite, the solid magnesium footstool, the vetiver candle, and the vodka bottle are here.
The burn description of the vetiver candle is "It burns right down, expensively but gothically."
The player carries an inexpensive firework. The description of the firework is "It is a cardboard tube with red and green stripes along the outside, and a fuse sticking out of the end." The burn description of the firework is "It ignites gloriously! You take a few hasty steps back in order to avoid burning yourself, and not a moment too soon. Red and green sparks fly out of the tube, and there's a whistling noise punctuated by several loud cracks."
The player carries a lighter. The description of the lighter is "You don't smoke, but you like to have access to flame now and then anyway."
Burning it with is an action applying to one thing and one carried thing.
Understand "burn [things] with [something preferably held]" as burning it with.
The block burning rule is not listed in any rulebook.
A thing has some text called the burn description.
Check burning something:
if the player carries the lighter:
try burning the noun with the lighter;
else:
try burning the noun with the noun.
Check burning something with something when the second noun is not the lighter:
say "Your trusty lighter is the best flame source available to you." instead.
Check burning something with something:
if the burn description of the noun is "":
say "Best not." instead.
Carry out burning something with something:
now the noun is nowhere.
Report burning something with something:
say "[burn description of the noun][line break]".
A multiple action processing rule when the action name part of the current action is the burning it with action (this is the orderly burn rule):
let L be the multiple object list;
let dull list be a list of objects;
let fun list be a list of objects;
repeat with item running through L:
if the burn description of the item is "":
add item to dull list;
else:
add item to fun list;
let F be the dull list;
add fun list to F;
alter the multiple object list to F.
Test me with "burn all with lighter".
In a gallery, there are many individual things to look at, but you can also get a general impression by just examining them as a collection.
First, we'll make a kind for the paintings exhibited in the gallery, and then we'll also make a special object to represent all of them as a mass:
"Western Art History 305"
A painting is a kind of thing. A painting is usually fixed in place. Understand "painting" as a painting. Understand "paintings" as the plural of painting.
The painting-collective is a thing. The printed name of the painting-collective is "paintings". The description of the painting-collective is "There's [a list of visible paintings]."
We could if we wanted tweak the description to be different in style in different rooms of the gallery, but this will do for now. Next we need to make it possible to type something like EXAMINE PAINTINGS, which normally wouldn't work because the Standard Rules don't tell Inform to recognise multiple objects with the EXAMINE command (unlike, say, DROP or TAKE). This is easy:
Understand "examine [things]" as examining.
Now to make use of the special object. If the player types EXAMINE PAINTINGS, the multiple object list will become a list of the visible paintings. The following rule looks at this list: if it contains more than one painting, it replaces them with the painting-collective instead. Now there's only one examining action, so we get a reply like "There's an abstract painting, a pointilist painting and a French academic painting." instead of a list of descriptions of each in turn.
A multiple action processing rule when the current action is examining (this is the examine kinds rule):
let L be the multiple object list;
let F be L;
let the painting count be 0;
repeat with item running through L:
if the item is a painting:
increment the painting count;
remove the item from F;
if the painting count is greater than one:
add the painting-collective to F;
alter the multiple object list to F.
And now some art to try this out on:
Gallery is a room. "Various paintings hang on the walls of this gallery, awaiting critical attention. A side chamber to the north contains smaller works."
The abstract painting, the pointilist painting, and the French academic painting are paintings in the Gallery.
North of the Gallery is the Side Chamber. A handsome miniature is a painting in the Side Chamber. The description of the handsome miniature is "The miniature depicts a uniformed soldier of the late 18th century, with braid on his shoulders and a curl in his beard."
The player carries a small notebook. The description of the notebook is "It contains the notes you've taken so far towards a paper for Western Art History 305. So far you're still feeling a bit uninspired."
Test me with "x paintings / x all / n / x paintings / x all".