1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-16 22:14:23 +03:00
inform7/resources/Documentation/Examples/ExtraSupplies.txt

32 lines
1.8 KiB
Plaintext
Raw Normal View History

Example: ** Extra Supplies
Location: Removing things from play
RecipeLocation: Dispensers and Supplies of Small Objects
Index: Faux-infinite supply of red pens
Description: A supply of red pens from which the player can take another pen only if he doesn't already have one somewhere in the game world.
For: Z-Machine
2019-02-05 02:44:07 +02:00
2023-05-14 05:51:20 +03:00
Suppose we have a supply closet in our game from which the player is allowed to take red pens. To keep modeling simple, we only allow them to have one in play at a time, and we test this by seeing whether the red pen is "off-stage" before moving it to their possession.
2019-02-05 02:44:07 +02:00
This approach might seem no different from having a single red pen sitting in the closet, but it may be preferable, for two reasons. First, it's not very plausible for a supply closet to contain nothing but a single red pen (well, assuming a well-regulated supplier, anyway); and second, it gives the player a way to get a new red pen should the original be destroyed in a tragic handwriting accident.
{*}"Extra Supplies"
The Supply Closet is a room. A supply of red pens is in the Supply Closet. Understand "pen" as the supply of red pens when the red pen is not visible.
2019-02-05 02:44:07 +02:00
There is a red pen.
Instead of taking the supply of red pens:
if the red pen is off-stage:
move the red pen to the player;
say "You help yourself to a fresh red pen.";
otherwise:
say "You're only allowed one pen at a time. The department secretary is very strict."
2019-02-05 02:44:07 +02:00
South of the Supply Closet is the Furnace Room. The incinerator is a thing in the Furnace Room. It is a container. "The incinerator is here, working full blast."
2019-02-05 02:44:07 +02:00
After inserting something into the incinerator:
now the noun is nowhere;
say "A fiery blast consumes [the noun]!"
2023-05-14 05:51:20 +03:00
Test me with "get pen / i / get pen / get supply / s / put pen in incinerator / n / get pen".