"Safety"
The Vault is a room. "Snug yet paranoid, this represents the state of the art in cheerless security." The Safe is here. "A mammoth safe, with a dial which can spin to any number, has pride of place. It must weigh about the same as a small car, so don't get any ideas." Instead of opening the safe, say "The safe opens only when turned to the correct combination."
In the Safe is a silver florin. The Safe is closed and fixed in place. Understand "dial" as the Safe.
Spinning it to is an action applying to one thing and one number. Check spinning it to: if the noun is not the Safe, say "[The noun] does not spin." instead. Report spinning it to: say "Click! and nothing else happens."
Understand "spin [something] to [a number]" as spinning it to.
After spinning the closed Safe to 1384: now the Safe is open; say "Clonk! and the safe door swings slowly open, revealing [a list of things in the Safe]."
Test me with "open safe / spin safe to 1131 / open safe / spin safe to 1384 / x safe / get florin".
Time can also be understood as a token, and the time parsed will be recorded as "the time understood". So therefore, if we wish for clocks which may be set:
"Tom's Midnight Garden"
A clock is a kind of device. A clock has a time called the current time. A clock can be analog or digital. The current time of a clock is usually 9:01 AM. The description of a clock is "It shows the time to be [if analog]about [the current time to the nearest five minutes in words][otherwise][the current time][end if]."
Understand "set [clock] to [time]" as setting it by time. Setting it by time is an action applying to one thing and one time.
Instead of setting a clock to something:
say "[The noun] can be set only to a time of day, such as 8:00 AM, or midnight."
Carry out setting a clock by time:
now the current time of the noun is the time understood.
Report setting a clock by time:
say "You set [the noun] to [time understood]."
Every turn:
repeat with item running through switched on clocks:
now the current time of the item is one minute after the current time of the item.
The Hall is a room. The grandfather clock is a fixed in place analog clock in the Hall. The travel clock is a switched on digital clock in the Hall. When play begins: now the right hand status line is "[time of day]".
Test me with "examine grandfather clock / set it to midnight / switch it on / wait / wait / wait / examine it / set travel clock to 4:12 / examine it".
"Hitchhiker's Guide to the Galaxy" introduced the idea of footnoted descriptions, and various IF games since have toyed with the idea. The recommended implementation in Inform 6 involved keeping an assortment of footnote objects around, but in Inform 7 the table is a much tidier way of handling the same problem.
"Ibid."
The Ship Inn is a room. "Here you are in a lovely pub which your guidebook assures you is extremely authentic. [1 as a footnote].
To your left sits a party of Italians, with their guidebook.
To your right is a silent, but not unappealing, young man.".
A party of Italians and a silent young man are people in the Ship Inn. The Italians and the young man are scenery.
The table is a supporter in the Ship Inn. On the table is a mysterious pie. The description of the pie is "Your waitress told you it was the specialty of the day, Steak and Owl Pie. [2 as a footnote]." The pie is edible.
Table of Footnotes
assignment
|
note
|
a number
|
"Francis Drake ate here, if the sign on the door is to be believed"
|
--
|
"this is unlikely, considering that owls are protected animals in England these days [3 as a footnote]"
|
--
|
"moreover, you can't imagine that owl would be very tasty"
|
Footnotes mentioned is a number that varies.
Whenever we mention a footnote for the first time, we need to assign it a number, which we will use consistently thereafter. And it's probably a good idea to protect ourselves against the author accidentally using a number too large for the footnote table, too. So:
To say (footnote - a number) as a footnote:
if footnote > number of filled rows in the Table of Footnotes:
say "Programming error: footnote assignment out of range.";
otherwise:
choose row footnote in the Table of Footnotes;
if there is an assignment entry:
say "([assignment entry])";
otherwise:
increment footnotes mentioned;
choose row footnote in the Table of Footnotes;
now assignment entry is footnotes mentioned;
say "([assignment entry])".
Now, in order to let the player view these footnotes, we'll need to parse numbers.
Understand "footnote [number]" as looking up a footnote.
Looking up a footnote is an action applying to one number.
Check looking up a footnote:
if the number understood > footnotes mentioned, say "You haven't seen any such footnote." instead;
if the number understood < 1, say "Footnotes are numbered from 1." instead.
Carry out looking up a footnote:
choose row with assignment of number understood in the Table of Footnotes;
say "([assignment entry]): [note entry]."
Test me with "footnote 1 / examine pie / footnote 2 / footnote 3".
This method does require us to keep track of where a footnote appears in the table. If we found this inconvenient, we could add a column to the footnote table so that we could invoke it with tags like "[appearance quip as a footnote]".