1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-05 16:44:21 +03:00
inform7/resources/Documentation/Examples/Noise.txt
2019-03-16 13:12:11 +00:00

29 lines
1.7 KiB
Plaintext

*** The other four senses
(LISTEN command extended--Noisemaking gadgets which can be heard with LISTEN; The Art of Noise)
Things are all assigned their own noise (or silence). Listening to the room in general reports on all the things that are currently audible.
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".