Western Art History 305
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:
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:
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.
And now some art to try this out on:
Test me with "x paintings / x all / n / x paintings / x all".
Various paintings hang on the walls of this gallery, awaiting critical attention. A side chamber to the north contains smaller works.
You can see an abstract painting, a pointilist painting and a French academic painting here.
>(Testing.)
>[1] x paintings
There's an abstract painting, a pointilist painting and a French academic painting.
>[2] x all
small notebook: 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.
paintings: There's an abstract painting, a pointilist painting and a French academic painting.
>[3] n
Side Chamber
You can see a handsome miniature here.
>[4] x paintings
The miniature depicts a uniformed soldier of the late 18th century, with braid on his shoulders and a curl in his beard.
>[5] x all
small notebook: 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.
handsome miniature: The miniature depicts a uniformed soldier of the late 18th century, with braid on his shoulders and a curl in his beard.