1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-07 17:44:22 +03:00
inform7/resources/Documentation/Examples/LollipopGuild.txt
2023-07-24 21:57:30 +01:00

45 lines
3.2 KiB
Plaintext

Example: *** Lollipop Guild
Location: Implicitly taking something
RecipeLocation: Taking, Dropping, Inserting and Putting
Index: SHOW something without taking it first
Description: Overriding the rules to allow the player to show something to another character without first taking it.
For: Z-Machine
As mentioned in this section, the "implicitly taking" activity does not allow us to skip an implicit take entirely. In order to do this, we need to borrow from the chapter on Rulebooks and tell Inform that one of the rules normally built in to the Standard Rules does nothing in certain circumstances:
{*}"Lollipop Guild"
The carrying requirements rule does nothing when showing something to the guardian.
The can't show what you haven't got rule does nothing when showing something to the guardian.
The block showing rule does nothing.
Candyland is a room. "A fizzing, popping wonderland of sugary delights. A path tiled with butterscotch sweets leads to the horizon."
The butterscotch path is scenery in Candyland.
The player carries a basket. In the basket are a licorice gumdrop and a can of tuna. The gumdrop is edible. The description of the gumdrop is "Covered all over with grains of sugar." The can of tuna is edible. The description of the can of tuna is "A rare import in this place."
The giant lollipop is a fixed in place edible thing in Candyland. "Growing right next to the path, on a trunk of white paper, is a giant lollipop colored green and red and white." The description of the lollipop is "If you were very blind, like Aunt Myrtle, you might mistake it for a young sapling just planted: the lollipop is just that leafy shade of green, with swirls of white and red that might be branches or flowers."
The guardian is a man in Candyland. "Right beside you is a guardian in a mint-colored uniform." The description of the guardian is "A killjoy wielding a gigantic toothbrush." The guardian carries a gigantic toothbrush. The description of the toothbrush is "Bristles as long as your hand. Firm bristles, too, not those soft ones. The guardian doesn't care about your tender gums."
A thing can be sweet. The butterscotch path, the lollipop, and the gumdrop are sweet.
Carry out showing a sweet thing to the guardian:
say "The guardian shrieks! You don't understand its language, but from its ululations you understand the idea of decay. There may have been a bit in there about a root canal." instead.
Carry out showing something to the guardian:
say "The guardian nods approvingly at the unsweetened [noun]." instead.
Report eating a sweet thing in the presence of the guardian:
say "The guardian looks mournful, but unholsters his tube of paste and begins applying it to the toothbrush, as though to say that he really did not want to have to do this...";
end the story saying "Everything goes minty" instead.
Report eating something:
say "You consume [the noun] with gusto." instead.
Test me with "x guardian / x toothbrush / show gumdrop to guardian / show path to guardian / show tuna to guardian / look / eat gumdrop".
Note that because we only deactivate the carrying requirements rule for showing purposes, the player still takes the gumdrop before eating it.