XYZZY
Example 287
★We have seen before how to define a new action from scratch, but we may want to review here, using a simple command that requires no objects.
"XYZZY"
Understand "xyzzy" or "say xyzzy" or "cast xyzzy" as casting xyzzy.
Casting xyzzy is an action applying to nothing.
Check casting xyzzy:
if the player does not wear the amulet of elocution, say "You are unable to articulate the second 'z' separately from the first, and the spell fails in a disdainful puff. Must be Parisian magic." instead;
if the player has the plate, say "The plate of cheeses twitches uncomfortably, aware that it should be doing something, but not sure what." instead.
Carry out casting xyzzy:
move the plate to the player.
Report casting xyzzy:
say "Under the influence of the Amulet of Elocution, you pronounce this as Xhi-zee. And lo, from nowhere, a [plate] appears!"
The amulet of elocution is a wearable thing. It is carried by the player. The description is "A heavy gold ring on a chain. If heated in an ordinary house fire, it glows with the words, 'Moses Supposes His Toeses Are Roses.'"
The plate is a portable supporter. On the plate is a very ripe ooze. Instead of smelling the ooze, say "It smells like socks. This is going to be wonderful." The ooze is edible. The printed name of the plate is "plate[if the plate supports the ooze] of cheese[end if]". The description of the ooze is "Definitely genuinely cheese." Understand "cheese" as the ooze.
Instead of eating the ooze: now the ooze is nowhere; say "You are transported..."; move the player to Paradise.
The Cheez Factory is a room. "All around you are squares of pressed orange polymer, or possibly cheez. Your only hope is the magic word your uncle taught you: XYZZY." The squares of pressed orange polymer are scenery in the Factory. The description is "You see nothing special about the squares of pressed orange polymer. Nothing special at all." Understand "square" or "cheez" as the squares.
Paradise is a room. The description is "Well, it might just be one of the posh upper rings of purgatory, if you're entirely honest with yourself."
Test me with "x squares / x amulet / x cheese / xyzzy / wear amulet / xyzzy / x ooze / smell ooze / eat ooze".
Test me with "x squares / x amulet / x cheese / xyzzy / wear amulet / xyzzy / x ooze / smell ooze / eat ooze".
Cheez Factory
All around you are squares of pressed orange polymer, or possibly cheez. Your only hope is the magic word your uncle taught you: XYZZY.
>(Testing.)
>[1] x squares
You see nothing special about the squares of pressed orange polymer. Nothing special at all.
>[2] x amulet
A heavy gold ring on a chain. If heated in an ordinary house fire, it glows with the words, "Moses Supposes His Toeses Are Roses."
>[3] x cheese
You can't see any such thing.
>[4] xyzzy
You are unable to articulate the second "z" separately from the first, and the spell fails in a disdainful puff. Must be Parisian magic.
>[5] wear amulet
You put on the amulet of elocution.
>[6] xyzzy
Under the influence of the Amulet of Elocution, you pronounce this as Xhi-zee. And lo, from nowhere, a plate of cheese appears!
>[7] x ooze
Definitely genuinely cheese.
>[8] smell ooze
It smells like socks. This is going to be wonderful.
>[9] eat ooze
You are transported...
Paradise
Well, it might just be one of the posh upper rings of purgatory, if you're entirely honest with yourself.
All around you are squares of pressed orange polymer, or possibly cheez. Your only hope is the magic word your uncle taught you: XYZZY.
>(Testing.)
>[1] x squares
You see nothing special about the squares of pressed orange polymer. Nothing special at all.
>[2] x amulet
A heavy gold ring on a chain. If heated in an ordinary house fire, it glows with the words, "Moses Supposes His Toeses Are Roses."
>[3] x cheese
You can't see any such thing.
>[4] xyzzy
You are unable to articulate the second "z" separately from the first, and the spell fails in a disdainful puff. Must be Parisian magic.
>[5] wear amulet
You put on the amulet of elocution.
>[6] xyzzy
Under the influence of the Amulet of Elocution, you pronounce this as Xhi-zee. And lo, from nowhere, a plate of cheese appears!
>[7] x ooze
Definitely genuinely cheese.
>[8] smell ooze
It smells like socks. This is going to be wonderful.
>[9] eat ooze
You are transported...
Paradise
Well, it might just be one of the posh upper rings of purgatory, if you're entirely honest with yourself.
XYZZY is a magic word from the original Adventure, and many other games respond to it with some sort of amusing message.