| 6.6. Looking Under and Hiding |
Finding hidden objects is a classic puzzle in IF. Beachfront provides the most basic example, an object that becomes visible only when we have searched the papers on a cluttered desk. Beneath the Surface takes this further, giving all large furnishings the ability to conceal items, and allowing the player to put things underneath other things, as well as find them. Flashlight adds an extra twist to the puzzle by requiring that the player have a flashlight to shine under a bulky object in order to find what lies underneath.
Looking inside an object is generally handled by the searching action, and we could extend that to allow the player to search multiple or complex objects. Matreshka turns the puzzle on its head by allowing the player to search a whole room systematically with only a single command.
See Kitchen and Bathroom for the related case of needing to look in a mirror
| Example Beachfront An item that the player can't interact with until he has found it by searching the scenery. | |
| Example Flashlight 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). | |
| Example Matreshka A SEARCH [room] action that will open every container the player can see, stopping only when there don't remain any that are closed, unlocked, and openable. | |
"Matreshka"
Ransacking is an action applying to one thing.
Check ransacking:
if the noun is not the location, say "You can hardly search [the noun] from here." instead.
Carry out ransacking:
while the player can see a closed openable unlocked container (called target):
say "[target]: [run paragraph on]";
try opening the target.
Report ransacking:
say "You can see nothing further worth searching."
The Russian Gift Shop is a room. In the Russian Gift Shop is a large wooden doll. It is closed and openable. In the large wooden doll is a medium wooden doll. It is closed and openable. In the medium wooden doll is a small wooden doll. It is closed and openable. In the small wooden doll is a tiny solid wooden doll.
And now we need to borrow from a later chapter for the command that will make this work:
Understand "search [any visited room]" as ransacking.
Test me with "search gift shop".
|