"Hanging Around" [Don't read too much into this. It's inspired by a programming question asked here: http://www.intfiction.org/forum/viewtopic.php?f=7&t=19656] Section 1 - The Lab and the Lighting Fixture Lab is a room. "A dismal room with a lighting fixture overhead. A hallway is to the south." The lighting fixture is scenery in the Lab. The description of the lighting fixture is "This rectangular enclosure of frosted glass protrudes about six inches from the ceiling.[if the rope is attached to the lighting fixture] [A rope] has been tied to the fixture.[end if]". Understand "light" or "lights" as the lighting fixture. Instead of doing something other than examining to the lighting fixture when the player is not on the stool: say "You can't reach the lighting fixture from here." Instead of doing something when the lighting fixture is the second noun and the player is not on the stool: say "You can't reach the lighting fixture from here." Instead of tying the rope to the lighting fixture: if the rope is attached to the lighting fixture: instead say "[The rope] is already tied to the lighting fixture."; if the player does not enclose the rope: instead say "You're not carrying [the rope]."; if the player is not on the stool: instead say "You can't reach the lighting fixture from here."; now the rope is attached to the lighting fixture; say "You wrap [the rope] around the lighting fixture and secure it with a strong knot." Instead of untying the rope when the rope is attached to the lighting fixture: try untying the rope from the lighting fixture. Instead of untying the rope from the lighting fixture when the rope is attached to the lighting fixture: if the player is not on the stool: instead say "You can't reach the lighting fixture from here."; now the rope is unattached; now the player carries the rope; say "You untie the knot, grab hold of [the rope], and remove it from around the lighting fixture." Section 2 - The Stool A stool is here. The stool is an enterable supporter. The stool is not fixed in place. The stool can be upright or kicked over. The stool is upright. The description of the stool is "Tall, but flimsy." Rule for writing a paragraph about the stool: if the stool is kicked over: say "A stool lies on its side on the ground here."; otherwise: say "There is a stool [no line break]"; if there is something on the stool: say "(on which [are] [a list of things on the stool]) [no line break]"; say "here." Before taking the stool when the stool is kicked over: if the player's command includes "pick up": instead try straightening the stool. After taking the stool when the stool is kicked over: say "(righting the stool)"; now the stool is upright; continue the action. After dropping the stool: say "You set down the stool." Before straightening the stool: if the stool is upright: instead say "The stool is already upright." After straightening the stool: now the stool is upright; say "You pick up the stool and set it down upright." Before entering the stool when the stool is kicked over: instead say "You'll need to pick up the stool first." Before putting something on the stool when the stool is kicked over: instead say "You'll need to pick up the stool first." To flatten the stool: now the stool is kicked over; repeat with item running through things that are on the stool: if item is not the player: now item is in the location of the stool. To take a fall with action text (T - a text): if the rope is worn by the player and the rope is attached to the lighting fixture: say "You [T] the stool and feel the noose tighten around your neck as you plummet...[paragraph break]"; now the rope is in the Lab; now the player is in the Afterlife; continue the action; otherwise if the rope is worn by the player and the rope is unattached: say "You [T] the stool and fall to the floor. The noose is tight around your neck, but the rope trails loosely and ineffectually behind you."; otherwise if the rope is attached to the lighting fixture and the player encloses the rope: now the rope is in the Lab; say "You [T] the stool and begin to fall. [The rope], firmly attached to the lighting fixture, slips from your hands as you crash to the ground[no line break]"; if the current action is jumping off: flatten the stool; say ", knocking over the stool[no line break]"; say "."; if the rope is tied into a noose and the rope is not thought provoking: now the rope is thought provoking; say "It occurs to you that things could have gone very differently had you been wearing the noose."; now the player is in the location of the stool; continue the action; After kicking over the stool: flatten the stool; if the player is on the stool: if the rope is worn by the player or (the rope is attached to the lighting fixture and the player encloses the rope): instead take a fall with action text "kick over"; say "You kick over the stool and fall to the floor."; now the player is in the location of the stool; otherwise: say "You kick over the stool." After jumping off the stool: if the rope is worn by the player or (the rope is attached to the lighting fixture and the player encloses the rope): instead take a fall with action text "jump off"; continue the action; Instead of jumping when the player is on the stool: try jumping off the stool. Instead of going down when the player is on the stool: try jumping off the stool. Instead of going up when the stool is in the location of the player: try entering the stool. Instead of climbing the stool: try entering the stool. Instead of getting off the stool: try jumping off the stool. Section 3 - The Rope and the Noose A rope is here. The rope can be attached to the lighting fixture or unattached. The rope can be tied into a noose or untied. The rope can be thought provoking. The rope is unattached and untied and not thought provoking. Understand "noose" as the rope when the rope is tied into a noose. Instead of examining the rope: say "Sturdy.[no line break]"; if the rope is tied into a noose: say " One end of the rope has been tied into a noose[no line break]"; if the player is wearing the rope: say " (which is secured around your neck)[no line break]"; say ".[no line break]"; if the rope is attached to the lighting fixture: if the rope is tied into a noose: say " The other end is[no line break]"; otherwise: say " One end of the rope has been[no line break]"; say " tied to the lighting fixture.[no line break]"; say "[line break]". Rule for writing a paragraph about the rope: if the rope is attached to the lighting fixture: say "[The rope] hangs from the lighting fixture[if the player is not on the stool], out of reach[end if].[no line break]"; if the player encloses the rope: if the rope is worn: say " The noose is secured around your neck.[no line break]"; otherwise: say " You're holding one the loose end of the rope.[no line break]"; say "[line break]"; After looking when the Lab encloses the player and the player encloses the rope and the rope is attached to the lighting fixture: if the rope is worn: say "The rope extends from the noose around your neck up to the lighting fixture, where it is attached."; otherwise: say "[The rope] that you're holding extends up to the lighting fixture, where it is attached." Rule for printing inventory details of the rope: if the rope is worn: say " (around your neck)"; if the rope is attached to the lighting fixture: say " (attached to the lighting fixture)"; Instead of doing something other than examining to the rope when the player is on the stool and the rope is unattached and the rope is in the location of the stool: say "You can't reach [the rope] from up here." Instead of doing something when the rope is the second noun and the player is on the stool and the rope is unattached and the rope is in the location of the stool: say "You can't reach [the rope] from up here." After dropping the rope when the rope is attached to the lighting fixture: now the rope is in the Lab; instead say "You let go of [the rope]. It continues to hang from the lighting fixture where you attached it." Before taking the rope when the rope is attached to the lighting fixture: if the player is not on the stool: instead say "You can't reach [the rope] from down here." After taking the rope when the rope is attached to the lighting fixture: Instead say "You take hold of [the rope]." Instead of rope shaping the rope when the second noun is a noose: if the rope is tied into a noose: instead say "The rope is already tied into a noose."; if the player does not enclose the rope and (the rope is not attached to the lighting fixture or the player is not on the stool): instead say "You're not carrying the rope."; now the rope is tied into a noose; now the rope is wearable; now the printed name of the rope is "noose"; say "You tie [if the rope is unattached]one end[otherwise]the loose end[end if] of the rope into a noose." Instead of untying the rope from the rope when the rope is tied into a noose and the rope is not attached to the lighting fixture: try untying the rope. Instead of untying the rope when the rope is unattached and the rope is tied into a noose: if the player does not enclose the rope: instead say "You're not carrying the noose."; if the player is wearing the rope: now the player carries the rope; say "(first taking off the noose)[line break]"; now the rope is untied; now the rope is not wearable; now the printed name of the rope is "rope"; say "You untie the noose. Now it's just a rope." After wearing the rope: say "You slip the noose around your neck and tighten it." After taking off the rope: say "You loosen the noose and slip it off." Section 4 - The Hallway and the Afterlife Hallway is south of the Lab. "The lab is to the north." Afterlife is a room. "Fluffy clouds and long lines. You should have made a reservation.[if Afterlife is not visited][paragraph break]None of your friends are here.[end if]" Every turn when the player is in the Afterlife: If the player has been in the Afterlife for five turns: end the story finally saying "You must wait". Section 5 - Actions and Parsing Kicking over is an action applying to one visible thing. Understand "kick [something]" or "kick over [something]" as kicking over. Check kicking over: if the player encloses the noun: instead say "You'll have to put down [the noun] first." Understand "set down [something]" as dropping. Straightening is an action applying to one visible thing. Understand "straighten [something]" or "right [something]" as straightening. Report straightening: instead say "[The noun] doesn't need straightening." Jumping off is an action applying to one visible thing. Understand "jump off [something]" or "jump off of [something]" as jumping off. Check jumping off: if the player is not on the noun: instead say "You're not on [the noun]." Carry out jumping off: move the player to the location of the noun, without printing a room description. Report jumping off: say "You jump off of [the noun]."; try looking. A rope shape is a kind of thing. A rope shape is privately-named. A noose is a rope shape. Understand "noose" as a noose. [Anonymous shape is here to make the desired rope shape ambiguous and force the player to explicitly choose noose] An anonymous rope shape is a rope shape. Rope shaping is an action applying to one visible thing and one visible thing. Understand "tie [something] into [any rope shape]" or "tie [something] to [any rope shape]" as rope shaping. Understand "make [any rope shape] with [something]" or "form [any rope shape] with [something]" or "tie [any rope shape] with [something]" as rope shaping (with nouns reversed). Report rope shaping: instead say "You can't make [a second noun] out of [the noun]." Does the player mean tying the rope to the rope: It is unlikely. Does the player mean tying the rope to the lighting fixture: It is likely. Does the player mean kicking over the stool: It is likely. Untying is an action applying to one visible thing. Understand "untie [something]" or "detach [something]" as untying. Untying it from is an action applying to one visible thing and one visible thing. Understand "untie [something] from [something]" or "detach [something] from [something]" as untying it from. Does the player mean untying the rope from the lighting fixture: if the rope is attached to the lighting fixture: it is very likely. Report untying: instead say "[The noun] isn't attached to anything." Report untying it from: instead say "[The noun] isn't attached to [the second noun]." test me with "take rope / make noose / stand on stool / tie rope to fixture / wear noose / kick stool / z / z / z / z / z"