Croft
Example 202
★★★Suppose that we have a design in which the player spends lots of time on enterable supporters, and in which we want to report certain actions -- dropping things onto those supporters, or leaping from one to another -- in a new way. We might begin by adding some action variables to help us keep track of the situation:
"Croft"
The dropping action has an object called the container dropped into (matched as "into").
The dropping action has an object called the supporter dropped onto (matched as "onto").
Rule for setting action variables for dropping:
if the actor is in a container (called C), now the container dropped into is C;
if the actor is on a supporter (called C), now the supporter dropped onto is C.
Report dropping a heavy thing onto a metallic thing:
say "You drop [the noun], and [the supporter dropped onto] clangs protestingly." instead.
Report someone dropping a heavy thing onto a metallic thing:
say "[The actor] drops [the noun] onto [the supporter dropped onto], which clangs protestingly." instead.
A thing can be heavy or light. A thing can be metallic or ordinary. A thing is usually ordinary. A thing is usually light.
The Ancient Cambodian Temple is a room. "A vast space built for ancient and forgotten rituals. The stone floor crawls with vermin. Well above the floor, and separated by some feet, are twin platforms built into the wall: the one carved of jointed wood, the other of sheets of graven bronze."
A platform is a kind of supporter. A platform is always enterable. A platform is usually scenery.
The bronze platform is a metallic platform in the Temple. Lara is a woman. She is on the bronze platform. She wears safari pants and a tank top. She carries a gun and a map. The gun is heavy.
The wood platform is an ordinary platform in the Temple. The player is on the wood platform. The player carries a rope, an Ancient Cambodian/English Phrasebook, a pickaxe, and a precious idol. The idol and the pickaxe are heavy.
Persuasion rule: persuasion succeeds.
The entering action has an object called the place left (matched as "from").
Check entering a platform from a platform:
if actor is the player, say "You leap into midair to cross the distance...";
otherwise say "[The actor] leaps gracefully across the distance...";
move the actor to the holder of the noun, without printing a room description.
Because this rule occurs before the "implicitly pass through other barriers rule", that rule will not occur when we move from platform to platform; we'll use our own custom rule instead.
Rule for setting action variables for entering:
now the place left is the holder of the actor.
Report entering a platform from a platform:
say "You land in a cat-like crouch on [the noun]." instead.
Report Lara entering a platform from a platform:
say "Lara lands soundlessly on [the noun][if the noun supports the player] beside you[end if]." instead.
Report entering a platform from the location:
say "You jump, catch the edge of [the noun] in your hands, and -- exerting considerable upper-body strength -- pull yourself up onto it." instead.
Report Lara entering a platform from a location:
say "Lara jumps, catches the edge of [the noun], and is standing upright on it, all in less time than it takes to tell."
Instead of examining a person who is not the player:
say "[The noun] carries [list of things carried by the noun] and wears [list of things worn by the noun]."
Instead of climbing a platform, try entering the noun.
Test me with "Lara, drop map / lara, drop gun / drop idol / enter bronze platform / drop pickaxe / get off / climb wood".
Test me with "Lara, drop map / lara, drop gun / drop idol / enter bronze platform / drop pickaxe / get off / climb wood".
Ancient Cambodian Temple (on the wood platform)
A vast space built for ancient and forgotten rituals. The stone floor crawls with vermin. Well above the floor, and separated by some feet, are twin platforms built into the wall: the one carved of jointed wood, the other of sheets of graven bronze.
On the bronze platform is Lara.
>(Testing.)
>[1] lara, drop map
Lara puts down the map.
>[2] lara, drop gun
Lara drops the gun onto the bronze platform, which clangs protestingly.
>[3] drop idol
Dropped.
>[4] enter bronze platform
You leap into midair to cross the distance...
You land in a cat-like crouch on the bronze platform.
>[5] drop pickaxe
You drop the pickaxe, and the bronze platform clangs protestingly.
>[6] get off
You get off the bronze platform.
Ancient Cambodian Temple
A vast space built for ancient and forgotten rituals. The stone floor crawls with vermin. Well above the floor, and separated by some feet, are twin platforms built into the wall: the one carved of jointed wood, the other of sheets of graven bronze.
On the bronze platform are a pickaxe, a gun, a map and Lara.
On the wood platform is a precious idol.
>[7] climb wood
You jump, catch the edge of the wood platform in your hands, and -- exerting considerable upper-body strength -- pull yourself up onto it.
A vast space built for ancient and forgotten rituals. The stone floor crawls with vermin. Well above the floor, and separated by some feet, are twin platforms built into the wall: the one carved of jointed wood, the other of sheets of graven bronze.
On the bronze platform is Lara.
>(Testing.)
>[1] lara, drop map
Lara puts down the map.
>[2] lara, drop gun
Lara drops the gun onto the bronze platform, which clangs protestingly.
>[3] drop idol
Dropped.
>[4] enter bronze platform
You leap into midair to cross the distance...
You land in a cat-like crouch on the bronze platform.
>[5] drop pickaxe
You drop the pickaxe, and the bronze platform clangs protestingly.
>[6] get off
You get off the bronze platform.
Ancient Cambodian Temple
A vast space built for ancient and forgotten rituals. The stone floor crawls with vermin. Well above the floor, and separated by some feet, are twin platforms built into the wall: the one carved of jointed wood, the other of sheets of graven bronze.
On the bronze platform are a pickaxe, a gun, a map and Lara.
On the wood platform is a precious idol.
>[7] climb wood
You jump, catch the edge of the wood platform in your hands, and -- exerting considerable upper-body strength -- pull yourself up onto it.