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/Flashlight.txt
2023-07-24 11:56:58 +01:00

30 lines
1.4 KiB
Plaintext

Example: * Flashlight
Location: Changing visibility
RecipeLocation: Looking Under and Hiding
Index: LOOK UNDER shows nothing unless the player has a light
Description: Visibility set so that looking under objects produces no result unless the player has a light source to shine there (regardless of the light level of the room).
For: Z-Machine
{*}"Flashlight"
The Schoolhouse is a room. "Though normally comfortable, the room is dark and menacing during the storm; rain sheets on the windows, and you can barely see the flash of the lighthouse only a few miles away."
The cabinet is a fixed in place openable container in the Schoolhouse. The hurricane lantern is a thing in the Schoolhouse. "A hurricane lantern hangs from a peg." The lantern is lit.
Visibility rule when looking under something:
if the player is carrying a lit thing (called lamp):
say "You shine [the lamp] under [the noun]...";
there is sufficient light;
there is insufficient light.
There is a marble. The marble can be found or lost. The marble is lost.
Instead of looking under the cabinet when the marble is lost:
move the marble to the player;
now the marble is found;
say "Billy's lost marble! So that's where it got to!"
Test me with "look under cabinet / get lantern / look under cabinet".
Because visibility is checked before instead rules, this discovery will (correctly) occur only when the player does have enough light.