3 !============================================================================
\r
4 Constant Story "William Tell";
\r
6 "^A simple Inform example
\r
7 ^by Roger Firth and Sonja Kesserich.^";
\r
8 !Release 1; Serial "020428"; ! IBG first edition (public beta)
\r
9 !Release 2; Serial "020827"; ! IBG second edition
\r
10 Release 3; Serial "040804"; ! for keeping track of public releases
\r
12 Constant MAX_SCORE = 3;
\r
17 !============================================================================
\r
28 print_ret "You don't need to worry about ", (the) self, ".";
\r
34 Take,Pull,Push,PushDir:
\r
35 print_ret (The) self, " is too heavy for that.";
\r
37 has static supporter;
\r
40 with name 'arrow' 'arrows//p',
\r
43 description "Just like all your other arrows -- sharp and true.",
\r
46 print_ret "Your arrows are sharp, and you guard them carefully.";
\r
51 Answer,Ask,Order,Tell:
\r
52 print_ret "Just use T[ALK] [TO ", (the) self, "].";
\r
56 !============================================================================
\r
59 Room street "A street in Altdorf"
\r
61 print "The narrow street runs north towards the town square.
\r
62 Local folk are pouring into the town through the gate to the
\r
63 south, shouting greetings, offering produce for sale,
\r
64 exchanging news, enquiring with exaggerated disbelief about
\r
65 the prices of the goods displayed by merchants whose stalls
\r
66 make progress even more difficult.^";
\r
67 if (self hasnt visited)
\r
68 print "^~Stay close to me, son,~ you say,
\r
69 ~or you'll get lost among all these people.~^";
\r
73 "The crowd, pressing north towards the square,
\r
74 makes that impossible.";
\r
76 Prop "south gate" street
\r
77 with name 'south' 'southern' 'wooden' 'gate',
\r
78 description "The large wooden gate in the town walls is wide open.";
\r
80 Prop "assorted stalls"
\r
81 with name 'assorted' 'stalls',
\r
82 description "Food, clothing, mountain gear; the usual stuff.",
\r
83 found_in street below_square,
\r
86 Prop "produce" !! added
\r
87 with name 'goods' 'produce' 'food' 'clothing' 'mountain' 'gear' 'stuff',
\r
88 description "Nothing special catches your eye.",
\r
89 found_in street below_square,
\r
93 with name 'merchant' 'merchants' 'trader' 'traders',
\r
95 "A few crooks, but mostly decent traders touting their wares
\r
96 with raucous overstatement.",
\r
97 found_in street below_square,
\r
98 has animate pluralname;
\r
100 Prop "local people"
\r
101 with name 'people' 'folk' 'local' 'crowd',
\r
102 description "Mountain folk, just like yourself.",
\r
103 found_in [; return true; ],
\r
104 has animate pluralname;
\r
106 !----------------------------------------------------------------------------
\r
108 Room below_square "Further along the street"
\r
110 "People are still pushing and shoving their way from the southern
\r
111 gate towards the town square, just a little further north.
\r
112 You recognise the owner of a fruit and vegetable stall.",
\r
116 Furniture stall "fruit and vegetable stall" below_square
\r
117 with name 'fruit' 'veg' 'vegetable' 'stall' 'table',
\r
119 "It's really only a small table, with a big heap of potatoes,
\r
120 some carrots and turnips, and a few apples.",
\r
127 Prop "potatoes" below_square
\r
128 with name 'potato' 'potatoes' 'spuds',
\r
130 "Must be a particularly early variety... by some 300 years!",
\r
133 Prop "fruit and vegetables" below_square
\r
134 with name 'carrot' 'carrots' 'turnip' 'turnips' 'apples' 'vegetables',
\r
135 description "Fine locally grown produce.",
\r
138 NPC stallholder "Helga" below_square
\r
139 with name 'stallholder' 'greengrocer' 'monger' 'shopkeeper' 'merchant'
\r
140 'owner' 'Helga' 'dress' 'scarf' 'headscarf',
\r
142 "Helga is a plump, cheerful woman,
\r
143 concealed beneath a shapeless dress and a spotted headscarf.",
\r
145 print "Helga pauses from sorting potatoes
\r
146 to give you a cheery wave.^";
\r
147 if (location hasnt visited) {
\r
148 move apple to player;
\r
149 print "^~Hello, Wilhelm, it's a fine day for trade! Is this
\r
150 young Walter? My, how he's grown. Here's an apple for him
\r
151 -- tell him to mind that scabby part, but the rest's good
\r
152 enough. How's Frau Tell? Give her my best wishes.~^";
\r
155 times_spoken_to 0, ! for counting the conversation topics
\r
158 print_ret "~Ooh, you saucy thing!~";
\r
160 self.times_spoken_to = self.times_spoken_to + 1;
\r
161 switch (self.times_spoken_to) {
\r
162 1: score = score + 1;
\r
163 print_ret "You warmly thank Helga for the apple.";
\r
164 2: print_ret "~See you again soon.~";
\r
171 !----------------------------------------------------------------------------
\r
173 Room south_square "South side of the square"
\r
175 "The narrow street to the south has opened onto the town square,
\r
176 and resumes at the far side of this cobbled meeting place.
\r
177 To continue along the street towards your destination --
\r
178 Johansson's tannery -- you must walk north across the square,
\r
179 in the middle of which you see Gessler's hat set on that
\r
180 loathsome pole. If you go on, there's no way you can avoid
\r
181 passing it. Imperial soldiers jostle rudely through the throng,
\r
182 pushing, kicking and swearing loudly.",
\r
186 Prop "hat on a pole" !! changed
\r
187 with name 'hat' 'pole',
\r
190 print_ret "You're too far away at the moment.";
\r
192 found_in south_square north_square;
\r
194 Prop "Gessler's soldiers"
\r
195 with name 'soldier' 'soldiers' 'guard' 'guards', !! added
\r
196 description "They're uncouth, violent men, not from around here.",
\r
199 print_ret "You're outnumbered many times.";
\r
201 print_ret "Such scum are beneath your contempt.";
\r
203 found_in south_square mid_square north_square marketplace,
\r
204 has animate pluralname proper;
\r
206 !----------------------------------------------------------------------------
\r
208 Room mid_square "Middle of the square"
\r
210 "There is less of a crush in the middle of the square; most
\r
211 people prefer to keep as far away as possible from the pole
\r
212 which towers here, topped with that absurd ceremonial hat. A
\r
213 group of soldiers stands nearby, watching everyone who passes.",
\r
216 warnings_count 0, ! for counting the soldier's warnings
\r
219 if (noun == s_obj) {
\r
220 self.warnings_count = 0;
\r
221 pole.has_been_saluted = false;
\r
223 if (noun == n_obj) {
\r
224 if (pole.has_been_saluted == true) {
\r
225 print "^~Be sure to have a nice day.~^";
\r
227 } ! end of (pole has_been_saluted)
\r
229 self.warnings_count = self.warnings_count + 1;
\r
230 switch (self.warnings_count) {
\r
231 1: print_ret "A soldier bars your way. ^^
\r
232 ~Oi, you, lofty; forgot yer manners, didn't you?
\r
233 How's about a nice salute for the vogt's hat?~";
\r
234 2: print_ret "^~I know you, Tell, yer a troublemaker,
\r
235 ain't you? Well, we don't want no bovver here,
\r
236 so just be a good boy and salute the friggin'
\r
237 hat. Do it now: I ain't gonna ask you again...~";
\r
240 style underline; print "Herr"; style roman;
\r
241 print " Tell, now you're in real trouble. I asked you
\r
242 nice, but you was too proud and too stupid. I
\r
243 think it's time that the vogt had a little word
\r
246 And with that the soldiers seize you and Walter
\r
247 and, while the sergeant hurries off to fetch
\r
248 Gessler, the rest drag you roughly towards the
\r
249 old lime tree growing in the marketplace.^";
\r
251 PlayerTo(marketplace);
\r
254 } ! end of (pole has_NOT_been_saluted)
\r
255 } ! end of (noun == n_obj)
\r
258 Furniture pole "hat on a pole" mid_square !! changed
\r
259 with name 'wooden' 'pole' 'pine' 'hat' 'black' 'red' 'brim' 'feathers',
\r
261 "The pole, the trunk of a small pine some few inches in diameter,
\r
262 stands about nine or ten feet high. Set carefully on top is
\r
263 Gessler's ludicrous black and red leather hat, with a widely
\r
264 curving brim and a cluster of dyed goose feathers.",
\r
265 has_been_saluted false,
\r
268 print_ret "Tempting, but you're not looking for trouble.";
\r
270 self.has_been_saluted = true;
\r
271 print_ret "You salute the hat on the pole. ^^
\r
272 ~Why, thank you, sir,~ sneers the soldier.";
\r
276 !----------------------------------------------------------------------------
\r
278 Room north_square "North side of the square"
\r
280 "A narrow street leads north from the cobbled square. In its
\r
281 centre, a little way south, you catch a last glimpse of the pole
\r
285 print_ret "With Walter at your side, you leave the square by the
\r
286 north street, heading for Johansson's tannery.";
\r
288 s_to "You hardly feel like going through all that again.";
\r
290 !----------------------------------------------------------------------------
\r
292 Room marketplace "Marketplace near the square"
\r
294 "Altdorf's marketplace, close by the town square, has been hastily
\r
295 cleared of stalls. A troop of soldiers has pushed back the crowd
\r
296 to leave a clear space in front of the lime tree, which has been
\r
297 growing here for as long as anybody can remember. Usually it
\r
298 provides shade for the old men of the town, who gather below to
\r
299 gossip, watch the girls, and play cards. Today, though, it
\r
300 stands alone... apart, that is, from Walter, who has been lashed
\r
301 to the trunk. About forty yards away, you are restrained by two
\r
302 of the vogt's men.",
\r
303 cant_go "What? And leave your son tied up here?";
\r
305 Object tree "lime tree" marketplace
\r
306 with name 'lime' 'tree',
\r
307 description "It's just a large tree.",
\r
310 if (BowOrArrow(second) == true) {
\r
312 print_ret "Your hand shakes a little, and your arrow flies
\r
313 high, hitting the trunk a few inches above Walter's
\r
320 NPC governor "governor" marketplace
\r
321 with name 'governor' 'vogt' 'Hermann' 'Gessler',
\r
323 "Short, stout but with a thin, mean face, Gessler relishes the
\r
324 power he holds over the local community.",
\r
326 print "Gessler is watching from a safe distance,
\r
327 a sneer on his face.^";
\r
328 if (location hasnt visited)
\r
329 print "^~It appears that you need to be taught a lesson,
\r
330 fool. Nobody shall pass through the square without paying
\r
331 homage to His Imperial Highness Albert; nobody, hear me?
\r
332 I could have you beheaded for treason, but I'm going to
\r
333 be lenient. If you should be so foolish again, you can
\r
334 expect no mercy, but this time, I'll let you go free...
\r
335 just as soon as you demonstrate your archery skills by
\r
336 hitting this apple from where you stand. That shouldn't
\r
337 prove too difficult; here, sergeant, catch. Balance it on
\r
338 the little bastard's head.~^";
\r
342 print_ret "You cannot bring yourself to speak to him.";
\r
346 if (BowOrArrow(second) == true) {
\r
348 print_ret "Before the startled soldiers can react, you turn
\r
349 and fire at Gessler; your arrow pierces his heart,
\r
350 and he dies messily. A gasp, and then a cheer,
\r
351 goes up from the crowd.";
\r
357 !============================================================================
\r
358 ! The player's possessions
\r
362 description "Your trusty yew bow, strung with flax.",
\r
365 print_ret "You're never without your trusty bow.";
\r
369 Object quiver "quiver"
\r
370 with name 'quiver',
\r
372 "Made of goatskin, it usually hangs over your left shoulder.",
\r
375 print_ret "But it was a present from Hedwig, your wife.";
\r
377 has container open clothing;
\r
379 Arrow "arrow" quiver;
\r
380 Arrow "arrow" quiver;
\r
381 Arrow "arrow" quiver;
\r
384 with name 'son' 'your' 'boy' 'lad' 'Walter',
\r
386 if (location == marketplace)
\r
387 print_ret "He stares at you, trying to appear brave and
\r
388 remain still. His arms are pulled back and tied behind
\r
389 the trunk, and the apple nestles amid his blond hair.";
\r
391 print_ret "A quiet, blond lad of eight summers, he's fast
\r
392 learning the ways of mountain folk.";
\r
398 print_ret "~Thank you, Papa.~";
\r
400 if (location == marketplace)
\r
401 print_ret "~Stay calm, my son, and trust in God.~";
\r
403 print_ret "You point out a few interesting sights.";
\r
406 Examine,Listen,Salute,Talk:
\r
409 if (location == marketplace) {
\r
410 if (BowOrArrow(second) == true) {
\r
412 print_ret "Oops! Surely you didn't mean to do that?";
\r
419 if (location == marketplace)
\r
420 print_ret "Your guards won't permit it.";
\r
424 found_in [; return true; ],
\r
425 has male proper scenery transparent;
\r
427 Object apple "apple"
\r
430 if (location == marketplace)
\r
431 print_ret "At this distance you can barely see it.";
\r
433 print_ret "The apple is blotchy green and brown.";
\r
437 print_ret "An apple is worth quite a bit --
\r
438 better hang on to it.";
\r
440 print_ret "Helga intended it for Walter...";
\r
442 if (location == marketplace) {
\r
443 if (BowOrArrow(second) == true) {
\r
446 print_ret "Slowly and steadily, you place an arrow in
\r
447 the bow, draw back the string, and take aim with
\r
448 more care than ever in your life. Holding your
\r
449 breath, unblinking, fearful, you release the
\r
450 arrow. It flies across the square towards your
\r
451 son, and drives the apple against the trunk of
\r
452 the tree. The crowd erupts with joy;
\r
453 Gessler looks distinctly disappointed.";
\r
461 !============================================================================
\r
462 ! Entry point routines
\r
466 lookmode = 2; ! like the VERBOSE command
\r
467 move bow to player;
\r
468 move quiver to player; give quiver worn;
\r
469 player.description =
\r
470 "You wear the traditional clothing of a Swiss mountaineer.";
\r
472 The place: Altdorf, in the Swiss canton of Uri. The year is 1307,
\r
473 at which time Switzerland is under rule by the Emperor Albert of
\r
474 Habsburg. His local governor -- the vogt -- is the bullying
\r
475 Hermann Gessler, who has placed his hat atop a wooden pole in
\r
476 the centre of the town square; everybody who passes through the
\r
477 square must bow to this hated symbol of imperial might.
\r
479 You have come from your cottage high in the mountains,
\r
480 accompanied by your younger son, to purchase provisions. You are
\r
481 a proud and independent man, a hunter and guide, renowned both
\r
482 for your skill as an archer and, perhaps unwisely (for his soldiers
\r
483 are everywhere), for failing to hide your dislike of the vogt.
\r
485 It's market-day: the town is packed with people from the
\r
486 surrounding villages and settlements.^";
\r
489 [ DeathMessage; print "You have screwed up a favourite folk story"; ];
\r
491 !============================================================================
\r
492 ! Standard and extended grammar
\r
496 !----------------------------------------------------------------------------
\r
499 if (noun == player) print_ret "Nothing you hear surprises you.";
\r
500 if (RunLife(noun,##Talk) ~= false) return; ! consult life[; Talk: ]
\r
501 print_ret "At the moment, you can't think of anything to say.";
\r
504 Verb 'talk' 't//' 'converse' 'chat' 'gossip'
\r
505 * 'to'/'with' creature -> Talk
\r
506 * creature -> Talk;
\r
508 !----------------------------------------------------------------------------
\r
511 if (o == bow or nothing || o ofclass Arrow) return true;
\r
512 print "That's an unlikely weapon, isn't it?^";
\r
517 if (noun == nothing)
\r
518 print_ret "What, just fire off an arrow at random?";
\r
519 if (BowOrArrow(second) == true)
\r
520 print_ret "Unthinkable!";
\r
523 Verb 'fire' 'shoot' 'aim'
\r
526 * 'at' noun -> FireAt
\r
527 * 'at' noun 'with' noun -> FireAt
\r
528 * noun 'with' noun -> FireAt
\r
529 * noun 'at' noun -> FireAt reverse;
\r
531 Extend 'attack' replace
\r
534 !----------------------------------------------------------------------------
\r
537 if (noun has animate) print_ret (The) noun, " acknowledges you.";
\r
538 print_ret (The) noun, " takes no notice.";
\r
541 Verb 'bow' 'nod' 'kowtow' 'genuflect'
\r
542 * 'at'/'to'/'towards' noun -> Salute;
\r
544 Verb 'salute' 'greet' 'acknowledge'
\r
548 * 'homage' 'to' noun -> Salute;
\r
551 * 'at' noun -> Salute;
\r
553 !----------------------------------------------------------------------------
\r
555 [ UntieSub; print_ret "You really shouldn't try that."; ];
\r
557 Verb 'untie' 'unfasten' 'unfix' 'free' 'release'
\r
560 !============================================================================
\r