Skeleton Keys by Emily Short

Extension built in to Inform


This extension replaces the default behavior of Inform, which allows one key per lock, with a more generous system in which unlocking applies to multiple objects. That means that it is possible to write a skeleton key like so:

Every door is unlocked by the skeleton key.

Because it is possible for more than one key to unlock a given door, the property "matching key" is now meaningless.

The drawback to this arrangement is that it adds more information to every item in the game, which will mean using up several K of dynamic memory. This is not important when compiling to Glulx, but may be problematic for projects targeting the Z-machine.

Skeleton Keys is compatible with, but does not require, Locksmith by Emily Short.

Example: * Vault - Demonstration of a simple skeleton key.

"Vault"

Include Skeleton Keys by Emily Short.

The Vault is a room.

The player carries a casket and a box. The casket is a closed locked container. The box is a closed locked container.

The player carries a silver key. Everything is unlocked by the silver key.

Test me with "unlock casket with silver / unlock box with silver key / open casket / i / lock casket with silver / close casket / lock casket with silver".

Example: * Cereal Bar Revisited - Demonstrating compatibility with Locksmith.

"Cereal Bar Revisited"

Include Locksmith by Emily Short. Include Skeleton Keys by Emily Short.

The player carries a passkey called the tin key. The tin key unlocks the tin box. The tin box is closed, openable, lockable, and locked. In the box is a single Cheerio.

Cereality is a room. "The newly-opened 'cereal bar' allows you to mix and match cereal types at will." The box is in Cereality.

The passkey description rule is not listed in any rulebook.

The description of a passkey is usually "[if the item described unbolts something][The item described] unlocks [the list of things unbolted by the item described][otherwise]You have yet to discover what [the item described] unlocks[end if]."

The player carries a skeleton key. Every thing is unlocked by the skeleton key.

Test me with "i / x key / unlock box / i / x key".