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

33 lines
1.7 KiB
Plaintext

Example: *** The Art of Noise
Location: The other four senses
RecipeLocation: Sounds
Index: LISTEN command extended
Description: Things are all assigned their own noise (or silence). Listening to the room in general reports on all the things that are currently audible.
For: Z-Machine
This example involves redesigning the LISTEN command, removing its built-in function and replacing that with something more ambitious. We will learn more about how to do this later on.
{*}"The Art of Noise"
A thing has some text called sound. The sound of a thing is usually "silence".
The report listening rule is not listed in the report listening to rules.
Carry out listening to something:
say "From [the noun] you hear [the sound of the noun]."
Instead of listening to a room:
if an audible thing can be touched by the player, say "You hear [the list of audible things which can be touched by the player].";
otherwise say "Nothing of note."
Definition: a thing is audible if the sound of it is not "silence".
Before printing the name of something audible while listening to a room:
say "[sound] from the "
The Sharper Image is a room. The pet rock is a thing in the Sharper Image. The toy car is a thing in the Sharper Image. The sound of the car is "whirring and zooming". The plastic widget is a thing in the Sharper Image. The sound of the plastic widget is "bleeps and bloops". The pointless gadget is a thing in Sharper Image. The sound of the pointless gadget is "buzzbuzzbuzz".
The soundproof case is a transparent openable container in the Sharper Image. It is closed and fixed in place.
Test me with "listen / listen to rock / listen to car / get all / open case / put all in case / listen / close case / listen / listen to car".