mirror of
https://github.com/ganelson/inform.git
synced 2024-07-08 01:54:21 +03:00
57 lines
2.5 KiB
Plaintext
57 lines
2.5 KiB
Plaintext
Example: ** The Man of Steel Excuses Himself
|
|
Location: Report rules for actions by other people
|
|
RecipeLocation: Goal-Seeking Characters
|
|
Index: Reporting rules for other characters' behaviour
|
|
Description: Elaborating the report rules to be more interesting than "Clark goes west."
|
|
For: Z-Machine
|
|
|
|
Report rules can be a good point at which to add local colour: while Inform provides default descriptions of character behaviour, these are rather generic and can stand to be customised.
|
|
|
|
For instance, if we wanted to liven up our previous Clark Kent example:
|
|
|
|
{*}"The Man of Steel Excuses Himself"
|
|
|
|
Escaping is an action applying to nothing.
|
|
|
|
Carry out someone escaping:
|
|
let space be the holder of the person asked;
|
|
let place be a random room which is adjacent to the space;
|
|
let way be the best route from the space to the place;
|
|
try the person asked going way.
|
|
|
|
Every turn:
|
|
if Clark Kent can see kryptonite, try Clark Kent escaping.
|
|
|
|
The Daily Planet Newsroom is a room.
|
|
|
|
Perry White's Office is west of the Newsroom. In Perry White's Office are a desk and a poster of Elvis. On the desk is a lead-lined box. The box is openable. In the box is the green kryptonite crystal.
|
|
|
|
The Supply Closet is east of the Newsroom. The Elevator Bank is north of the Newsroom.
|
|
|
|
Clark Kent is a man in the Newsroom. "Clark [if Clark can see the kryptonite]looks a bit ill[otherwise]is here, frowning as he revises his latest article[end if]."
|
|
|
|
Report Clark Kent going a direction (called the way):
|
|
say "[one of]With a particularly weak excuse[or]Muttering[at random] about [random excuse subject], Clark heads [way]." instead.
|
|
|
|
To say random excuse subject:
|
|
choose a random row in the Table of Lame Excuses; say "[reply entry]".
|
|
|
|
Table of Lame Excuses
|
|
reply
|
|
"needing a paper-clip"
|
|
"wanting an English-Tuvalu dictionary"
|
|
"walking a neighbor's dog"
|
|
"hearing air-raid sirens"
|
|
"having drunk too much coffee"
|
|
"thinking he smells smoke"
|
|
"wondering where Lois got to"
|
|
"needing to speak to Jimmy"
|
|
"noticing the Good Year blimp"
|
|
|
|
Test me with "west / get box / east / close box / east / west / north / south / west".
|
|
|
|
It's good to be careful, as the library report rules have been designed and tested to describe every contingency (going through doors, going in vehicles, etc.): so when replacing a report rule, we should try to consider all the possible variations of the action that we might want to describe.
|
|
|
|
However, in this case, our scenario is so simple that there are no doors, vehicles, or pushable objects, so we're safe in giving Clark a very simple reporting scheme.
|
|
|