| 10.10. Magic (Breaking the Laws of Physics) |
Every previous section of this chapter have been about adding further realism constraints to Inform, to give it a more advanced understanding of physics (and chemistry). But Inform has plenty of physical laws built into it already, even if they are more mundane: inanimate objects do not spontaneously move or change, one solid object cannot pass through another, there are opaque barriers through which light cannot pass, and so on. These rules stop many attempted actions. (GO EAST - "The oak door is closed." GET EMERALD - "You can't, since the glass display case is in the way.")
In the real world, physics is not negotiable. ("Gravity: it's not just a good idea, it's the law.") But in stories, magic can sometimes happen, and in these examples procedural rules are used to waive selected rules built into Inform which in effect cancel certain physical laws in certain cases. Very many other magical tricks could be achieved: if you want to make a given command work despite realism constraints, try typing ACTIONS - a testing command which reveals what is happening behind the scenes - and then typing the command you want. This should reveal which named rule is stopping it: you can then try suspending that rule, and seeing if the effect now works.
See Magic Words for ways to create new single-word spell commands
| Example Magneto's Revenge Kitty Pryde of the X-Men is able to reach through solid objects, so we might implement her with special powers that the player does not have... | |
"Magneto's Revenge"
The School for Gifted Youngsters is a room. Kitty Pryde is a woman in the School for Gifted Youngsters. "Kitty Pryde waits for you to say why you summoned her out of class." The description is "You see nothing special about Kitty Pryde. But that is only because she has learned to conceal her mutant powers: in fact she has the alternative name Shadowcat, and the ability to phase through solid objects."
The glass box is a container in the School for Gifted Youngsters. It is closed, openable, and transparent. In the box is a quantity of poisonous gas. In the box is a thing called the message from Magneto.
Instead of examining the message when the player is not carrying the message:
say "You'd need to be holding it before you could read it."
Instead of opening the glass box: say "You're deterred by the swirling bottle-green mist within."
Check someone taking the gas (this is the gaseous object rule): rule fails.
Unsuccessful attempt by someone taking the gas: say "The gas isn't something one can pick up in one's bare hands."
Every turn:
if the player can touch the gas:
say "The gas has reached your lungs!";
end the story.
A rule for reaching inside something:
if the person reaching is Kitty, allow access.
Persuasion rule for asking someone to try doing something: persuasion succeeds.
Test me with "get message / kitty, get message / open box / kitty, open box".
Now the player can get Kitty to take the message without releasing the poisonous gas:
Kitty Pride waits for you to tell her why you summoned her out of class.
You can also see a glass box (closed) (in which are some poisonous gas and a message from Magneto) here.
>kitty, get message
Kitty Pryde picks up a message from Magneto.
|
| Example Interrogation A wand which, when waved, reveals the concealed items carried by people the player can see. | |