Fix up action list in Appendix A.
[ibg.git] / examples / Fate.inf
1 !% -SD\r
2 \r
3 !============================================================================\r
4 Constant Story "Captain Fate";\r
5 Constant Headline\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
11 \r
12 Constant MANUAL_PRONOUNS;\r
13 Constant MAX_SCORE     2;\r
14 Constant OBJECT_SCORE  1;\r
15 Constant ROOM_SCORE    1;\r
16 \r
17 Replace MakeMatch;              ! required by pname.h\r
18 Replace Identical;\r
19 Replace NounDomain;\r
20 Replace TryGivenObject;\r
21 \r
22 Include "Parser";\r
23 Include "pname";                ! pname.h is from the Archive\r
24 \r
25 Object  LibraryMessages         ! must be defined between Parser and VerbLib\r
26   with  before [;\r
27           Buy:    "Petty commerce interests you only on COUNTED occasions.";\r
28           Dig:    "Your keen senses detect NOTHING underground worth your\r
29                    immediate attention.";\r
30           Pray:   "You won't need to bother almighty DIVINITIES to save\r
31                    the day.";\r
32           Sing:   "Alas! That is not one of your many superpowers.";\r
33           Sleep:  "A hero is ALWAYS on the watch.";\r
34           Sorry:  "Captain FATE prefers ACTION over apologies.";\r
35           Strong: "An unlikely vocabulary for a HERO like you.";\r
36           Swim:   "You quickly turn all your ATTENTION towards locating a\r
37                    suitable place to EXERCISE your superior strokes,\r
38                    but alas! you find none.";\r
39           Miscellany:\r
40             if (lm_n == 19)\r
41                 if (clothes has worn)\r
42                     "In your secret identity's outfit, you manage most\r
43                      efficaciously to look like a two-cent loser, a\r
44                      good-for-nothing wimp.";\r
45                 else\r
46                     "Now that you are wearing your costume, you project\r
47                      the image of power UNBOUND, of ballooned,\r
48                      multicoloured MUSCLE, of DASHING yet MODEST chic.";\r
49             if (lm_n == 38)\r
50                 "That's not a verb you need to SUCCESSFULLY save the day.";\r
51             if (lm_n == 39)\r
52                 "That's not something you need to refer to in order to\r
53                  SAVE the day.";\r
54         ];\r
55 \r
56 Include "VerbLib";\r
57 \r
58 !============================================================================\r
59 ! Object classes\r
60 \r
61 Class   Room\r
62   with  description "UNDER CONSTRUCTION",\r
63   has   light;\r
64 \r
65 Class   Appliance\r
66   with  before [;\r
67           Take,Pull,Push,PushDir:\r
68             "Even though your SCULPTED adamantine muscles are up to the task,\r
69              you don't favour property damage.";\r
70         ],\r
71   has   scenery;\r
72 \r
73 !============================================================================\r
74 ! The game objects\r
75 \r
76 Room    street "On the street"\r
77   with  name 'city' 'buildings' 'skyscrapers' 'shops' 'apartments' 'cars',\r
78         description [;\r
79             if (player in booth)\r
80                 "From this VANTAGE point, you are rewarded with a broad view\r
81                  of the sidewalk and the entrance to Benny's cafe.";\r
82             else\r
83                 "On one side -- which your HEIGHTENED sense of direction\r
84                  indicates is NORTH -- there's an open cafe now serving\r
85                  lunch. To the south, you can see a phone booth.";\r
86         ],\r
87         before [;\r
88           Go:\r
89             if (player in booth && noun == n_obj) <<Exit booth>>;\r
90         ],\r
91         n_to [; <<Enter outside_of_cafe>>; ],\r
92         s_to [; <<Enter booth>>; ],\r
93         in_to "But which way?",\r
94         cant_go\r
95             "No time now for exploring! You'll move much faster in your\r
96              Captain FATE costume.";\r
97 \r
98 Object  "pedestrians" street\r
99   with  name 'passing' 'people' 'pedestrians',\r
100         description\r
101             "They're just PEOPLE going about their daily HONEST business.",\r
102         before [;\r
103           Examine:\r
104             return false;\r
105           default:\r
106             "The passing pedestrians are of NO concern to you.";\r
107         ],\r
108   has   animate pluralname scenery;\r
109 \r
110 Appliance booth "phone booth" street\r
111   with  name 'old' 'red' 'picturesque' 'phone' 'booth' 'cabin'\r
112             'telephone' 'box',\r
113         description\r
114             "It's one of the old picturesque models, a red cabin with room\r
115              for one caller.",\r
116         before [;\r
117           Open:\r
118             "The booth is already open.";\r
119           Close:\r
120             "There's no way to close this booth.";\r
121         ],\r
122         after [;\r
123           Enter:\r
124             "With implausible celerity, you dive inside the phone booth.";\r
125         ],\r
126   has   enterable container open;\r
127 \r
128 Appliance "sidewalk" street\r
129   with  name 'sidewalk' 'pavement' 'street',\r
130         article "the",\r
131         description\r
132             "You make a quick surveillance of the sidewalk and discover much\r
133              to your surprise that it looks JUST like any other sidewalk in\r
134              the CITY!";\r
135 \r
136 Appliance outside_of_cafe "Benny's cafe" street\r
137   with  name 'benny^s' 'cafe' 'entrance',\r
138         description\r
139             "The town's favourite for a quick snack, Benny's cafe has a 50's\r
140              ROCKETSHIP look.",\r
141         before [;\r
142           Enter:\r
143             print "With an impressive mixture of hurry and nonchalance you\r
144                 step into the open cafe.^";\r
145             PlayerTo(cafe);\r
146             return true;\r
147         ],\r
148   has   enterable proper;\r
149 \r
150 !----------------------------------------------------------------------------\r
151 \r
152 Room    cafe "Inside Benny's cafe"\r
153   with  description\r
154             "Benny's offers the FINEST selection of pastries and sandwiches.\r
155              Customers clog the counter, where Benny himself manages to\r
156              serve, cook and charge without missing a step. At the north side\r
157              of the cafe you can see a red door connecting with the toilet.",\r
158         before [;\r
159           Go:   ! The player is about to depart. Is he making for the street?\r
160             if (noun ~= s_obj) return false;\r
161             if (benny.coffee_not_paid == true ||\r
162                 benny.key_not_returned == true) {\r
163                 print "Just as you are stepping into the street, the big hand\r
164                     of Benny falls on your shoulder.";\r
165                 if (benny.coffee_not_paid == true &&\r
166                     benny.key_not_returned == true)\r
167                     "^^~Hey! You've got my key and haven't paid for the\r
168                      coffee. Do I look like a chump?~ You apologise as only a\r
169                      HERO knows how to do and return inside.";\r
170                 if (benny.coffee_not_paid == true)\r
171                     "^^~Just waidda minute here, Mister,~ he says.\r
172                      ~Sneaking out without paying, are you?~ You quickly\r
173                      mumble an excuse and go back into the cafe. Benny\r
174                      returns to his chores with a mistrusting eye.";\r
175                 if (benny.key_not_returned == true)\r
176                     "^^~Just where you think you're going with the toilet\r
177                      key?~ he says. ~You a thief?~ As Benny forces you back\r
178                      into the cafe, you quickly assure him that it was only\r
179                      a STUPEFYING mistake.";\r
180             }\r
181             if (costume has worn) {\r
182                 deadflag = 5;           ! you win!\r
183                 "You step onto the sidewalk, where the passing pedestrians\r
184                  recognise the rainbow EXTRAVAGANZA of Captain FATE's costume\r
185                  and cry your name in awe as you JUMP with sensational\r
186                  momentum into the BLUE morning skies!";\r
187             }\r
188         ],\r
189         first_time_out false,           ! Captain Fate's first appearance?\r
190         after [;\r
191           Go:   ! The player has just arrived. Did he come from the toilet?\r
192             if (noun ~= s_obj) return false;\r
193             if (costume has worn && self.first_time_out == false) {\r
194                 self.first_time_out = true;\r
195                 StartDaemon(customers);\r
196             }\r
197         ],\r
198         s_to street,\r
199         n_to toilet_door;\r
200 \r
201 Appliance counter "counter" cafe\r
202   with  name 'counter' 'bar',\r
203         article "the",\r
204         description\r
205             "The counter is made of an astonishing ALLOY of metals,\r
206              STAIN-PROOF, SPILL-RESISTANT and VERY EASY to clean. Customers\r
207              enjoy their snacks with UTTER tranquillity, safe in the notion\r
208              that the counter can take it all.",\r
209         before [;\r
210           Receive:\r
211             <<Give noun benny>>;\r
212         ],\r
213   has   supporter;\r
214 \r
215 Object  food "Benny's snacks" cafe\r
216   with  name 'food' 'pastry' 'pastries' 'sandwich' 'sandwiches' 'snack'\r
217             'snacks' 'doughnut',\r
218         before [; "There is no time for FOOD right now."; ],\r
219   has   scenery proper;\r
220 \r
221 Object  menu "menu" cafe\r
222   with  name 'informative' 'menu' 'board' 'picture' 'writing',\r
223         description\r
224             "The menu board lists Benny's food and drinks, along with their\r
225              prices. Too bad you've never learnt how to read, but luckily\r
226              there is a picture of a big cup of coffee among the\r
227              incomprehensible writing.",\r
228         before [;\r
229           Take:\r
230             "The board is mounted on the wall behind Benny. Besides, it's\r
231              useless WRITING.";\r
232         ],\r
233   has   scenery;\r
234 \r
235 Object  customers "customers" cafe\r
236   with  name 'customers' 'people' 'customer' 'men' 'women',\r
237         description [;\r
238             if (costume has worn)\r
239                 "Most seem to be concentrating on their food, but some do\r
240                  look at you quite blatantly. Must be the MIND-BEFUDDLING\r
241                  colours of your costume.";\r
242             else\r
243                 "A group of HELPLESS and UNSUSPECTING mortals, the kind\r
244                  Captain FATE swore to DEFEND the day his parents choked on a\r
245                  DEVIOUS slice of RASPBERRY PIE.";\r
246         ],\r
247         life [;\r
248           Ask,Tell,Answer:\r
249             if (costume has worn)\r
250                 "People seem to MISTRUST the look of your FABULOUS costume.";\r
251             else\r
252                 "As John Covarth, you attract LESS interest than Benny's\r
253                  food.";\r
254           Kiss:\r
255             "There's no telling what sorts of MUTANT bacteria these\r
256              STRANGERS may be carrying around.";\r
257           Attack:\r
258             "Mindless massacre of civilians is the qualification for\r
259              VILLAINS. You are SUPPOSED to protect the likes of these\r
260              people.";\r
261         ],\r
262         orders [;\r
263             "These people don't appear to be of the cooperative sort.";\r
264         ],\r
265         number_of_comments 0,           ! for counting the customer comments\r
266         daemon [;\r
267             if (location ~= cafe) return;\r
268             if (self.number_of_comments == 0) {\r
269                 self.number_of_comments = 1;\r
270                 print "^Nearby customers glance at your costume with open\r
271                     curiosity.^";\r
272             }\r
273             if (random(2) == 1) {       ! do this 50% of the time\r
274                 self.number_of_comments = self.number_of_comments + 1;\r
275                 switch (self.number_of_comments) {\r
276                  2: "^~Didn't know there was a circus in town,~ comments one\r
277                       customer to another. ~Seems like the clowns have the\r
278                       day off.~";\r
279                  3: "^~These fashion designers don't know what to do to show\r
280                      off,~ snorts a fat gentleman, looking your way. Those\r
281                      within earshot try to conceal their smiles.";\r
282                  4: "^~Must be carnival again,~ says a man to his wife, who\r
283                      giggles, stealing a peek at you. ~Time sure flies.~";\r
284                  5: "^~Bad thing about big towns~, comments someone to his\r
285                      table companion, ~is you get the damnedest bugs coming\r
286                      out from toilets.~";\r
287                  6: "^~I sure WISH I could go to work in my pyjamas,~ says a\r
288                      girl in an office suit to some colleagues. ~It looks SO\r
289                      comfortable.~";\r
290                  default: StopDaemon(self);\r
291                 }\r
292             }\r
293         ],\r
294   has   scenery animate pluralname;\r
295 \r
296 Object  benny "Benny" cafe\r
297   with  name 'benny',\r
298         description\r
299             "A deceptively FAT man of uncanny agility, Benny entertains his\r
300              customers crushing coconuts against his forehead when the mood\r
301              strikes him.",\r
302         coffee_asked_for false,         ! has player asked for a coffee?\r
303         coffee_not_paid  false,         ! is Benny waiting to be paid?\r
304         key_not_returned false,         ! is Benny waiting for the key?\r
305         life [;\r
306           Give:\r
307             switch (noun) {\r
308               clothes:\r
309                 "You NEED your unpretentious John Covarth clothes.";\r
310               costume:\r
311                 "You NEED your stupendous ACID-PROTECTIVE suit.";\r
312               toilet_key:\r
313                 self.key_not_returned = false;\r
314                 move toilet_key to benny;\r
315                 "Benny nods as you ADMIRABLY return his key.";\r
316               coin:\r
317                 remove coin;\r
318                 self.coffee_not_paid = false;\r
319                 print "With marvellous ILLUSIONIST gestures, you produce the\r
320                     coin from the depths of your ";\r
321                 if (costume has worn) print "BULLET-PROOF costume";\r
322                 else                  print "ordinary street clothes";\r
323                 " as if it had dropped on the counter from Benny's ear!\r
324                  People around you clap politely. Benny takes the coin\r
325                  and gives it a SUSPICIOUS bite. ~Thank you, sir. Come\r
326                  back anytime,~ he says.";\r
327             }\r
328           Attack:\r
329             if (costume has worn) {\r
330                 deadflag = 4;\r
331                 print "Before the horror-stricken eyes of the surrounding\r
332                     people, you MAGNIFICENTLY jump OVER the counter and\r
333                     attack Benny with REMARKABLE, albeit NOT sufficient,\r
334                     speed. Benny receives you with a TREACHEROUS upper-cut\r
335                     that sends your GRANITE JAW flying through the cafe.^^\r
336                     ~These guys in pyjamas think they can bully innocent\r
337                     folk,~ snorts Benny, as the EERIE hands of DARKNESS\r
338                     engulf your vision and you lose consciousness.";\r
339             }\r
340             else\r
341                 "That would be an unlikely act for MEEK John Covarth.";\r
342           Kiss:\r
343             "This is no time for MINDLESS infatuation.";\r
344           Ask,Tell,Answer:\r
345             "Benny is too busy for idle chit-chat.";\r
346         ],\r
347         orders [;   ! handles ASK BENNY FOR X and BENNY, GIVE ME XXX\r
348           Give:\r
349             if (second ~= player or nothing) "Benny looks at you strangely.";\r
350             switch (noun) {\r
351               toilet_key:\r
352                 if (toilet_key in player) "But you DO have the key already.";\r
353                 if (self.coffee_asked_for == true)\r
354                     if (toilet_key in self) {\r
355                         move toilet_key to player;\r
356                         self.key_not_returned = true;\r
357                         "Benny tosses the key to the rest rooms on the\r
358                          counter, where you grab it with a dextrous and\r
359                          precise movement of your HYPER-AGILE hand.";\r
360                     }\r
361                     else\r
362                         "~Last place I saw that key, it was in YOUR\r
363                          possession,~ grumbles Benny. ~Be sure to return it\r
364                          before you leave.~";\r
365                 else\r
366                     "~Toilet is only fer customers,~ he grumbles, looking\r
367                      pointedly at a menu board behind him.";\r
368               coffee:\r
369                 if (self.coffee_asked_for == true)\r
370                     "One coffee should be enough.";\r
371                 move coffee to counter;\r
372                 self.coffee_asked_for = self.coffee_not_paid = true;\r
373                 "With two gracious steps, Benny places his world-famous\r
374                  Cappuccino in front of you.";\r
375               food:\r
376                 "Food will take too much time, and you must change NOW.";\r
377               menu:\r
378                 "With only the smallest sigh, Benny nods towards the menu\r
379                  on the wall behind him.";\r
380               default:\r
381                 "~I don't think that's on the menu, sir.~";\r
382             }\r
383         ],\r
384   has   scenery animate male proper transparent;\r
385 \r
386 Object  coffee "cup of coffee" benny\r
387   with  name 'cup' 'of' 'coffee' 'steaming' 'cappuccino'\r
388             'cappucino' 'capuccino' 'capucino',\r
389         description [;\r
390             if (self in benny)\r
391                 "The picture on the menu board SURE looks good.";\r
392             else\r
393                 "It smells delicious.";\r
394         ],\r
395         before [;\r
396           Take,Drink,Taste:\r
397             if (self in benny) "You should ask Benny for one first.";\r
398             else {\r
399                 move self to benny;\r
400                 print "You pick up the cup and swallow a mouthful. Benny's\r
401                     WORLDWIDE REPUTATION is well deserved. Just as you\r
402                     finish, Benny takes away the empty cup.";\r
403                 if (benny.coffee_not_paid == true)\r
404                     " ~That will be one quidbuck, sir.~";\r
405                 else\r
406                     "";\r
407             }\r
408           Buy:\r
409             if (coin in player) <<Give coin benny>>;\r
410             else                "You have no money.";\r
411           Smell:\r
412             "If your HYPERACTIVE pituitary glands are to be trusted,\r
413              it's Colombian.";\r
414         ];\r
415 \r
416 Object  outside_of_toilet "toilet" cafe\r
417   with  name 'toilet' 'bath' 'rest' 'room' 'bathroom' 'restroom',\r
418         before [;\r
419           Enter:\r
420             if (toilet_door has open) {\r
421                 PlayerTo(toilet);\r
422                 return true;\r
423             }\r
424             else\r
425                 "Your SUPERB deductive mind detects that the DOOR is\r
426                  CLOSED.";\r
427           Examine:\r
428             if (toilet_door has open)\r
429                 "A brilliant thought flashes through your SUPERLATIVE\r
430                  brain: detailed examination of the toilet would be\r
431                  EXTREMELY facilitated if you entered it.";\r
432             else\r
433                 "With a TREMENDOUS effort of will, you summon your\r
434                  unfathomable ASTRAL VISION and project it FORWARD towards\r
435                  the closed door... until you remember that it's\r
436                  Dr Mystere who's the one with mystic powers.";\r
437           Open:\r
438             <<Open  toilet_door>>;\r
439           Close:\r
440             <<Close toilet_door>>;\r
441           Take,Push,Pull:\r
442             "That would be PART of the building.";\r
443         ],\r
444   has   scenery openable enterable;\r
445 \r
446 Object  toilet_door\r
447   with  pname '.x' 'red' '.x' 'toilet' 'door',\r
448         short_name [;\r
449             if (location == cafe) print "door to the toilet";\r
450             else                  print "door to the cafe";\r
451             return true;\r
452         ],\r
453         description [;\r
454             if (location == cafe)\r
455                 "A red door with the unequivocal black man-woman silhouettes\r
456                  marking the entrance to hygienic facilities. There is a\r
457                  scribbled note stuck on its surface.";\r
458             else\r
459                 "A red door with no OUTSTANDING features.";\r
460         ],\r
461         found_in cafe toilet,\r
462         before [ ks;\r
463           Open:\r
464             if (self hasnt locked || toilet_key notin player) return false;\r
465             ks = keep_silent; keep_silent = true;\r
466             <Unlock self toilet_key>; keep_silent = ks;\r
467             return true;\r
468           Lock:\r
469             if (self hasnt open) return false;\r
470             print "(first closing ", (the) self, ")^";\r
471             ks = keep_silent; keep_silent = true;\r
472             <Close self>; keep_silent = ks;\r
473             return false;\r
474         ],\r
475         after [ ks;\r
476           Unlock:\r
477             if (self has locked) return false;\r
478             print "You unlock ", (the) self, " and open it.^";\r
479             ks = keep_silent; keep_silent = true;\r
480             <Open self>; keep_silent = ks;\r
481             return true;\r
482           Open:\r
483             give toilet light;\r
484           Close:\r
485             give toilet ~light;\r
486         ],\r
487         door_dir [;\r
488             if (location == cafe) return n_to;\r
489             else                  return s_to;\r
490         ],\r
491         door_to [;\r
492             if (location == cafe) return toilet;\r
493             else                  return cafe;\r
494         ],\r
495         with_key toilet_key,\r
496   has   scenery door openable lockable locked;\r
497 \r
498 Object  toilet_key "toilet key" benny\r
499   with  pname '.x' 'toilet' 'key',\r
500         article "the",\r
501         invent [;\r
502             if (clothes has worn) print "the CRUCIAL key";\r
503             else                  print "the used and IRRELEVANT key";\r
504             return true;\r
505         ],\r
506         description\r
507             "Your SUPRA PERCEPTIVE senses detect nothing of consequence\r
508              about the toilet key.",\r
509         before [;\r
510             if (self in benny)\r
511                 "You SCAN your surroundings with ENHANCED AWARENESS,\r
512                  but fail to detect any key.";\r
513           Drop:\r
514             "Benny is trusting you to look after that key.";\r
515         ];\r
516 \r
517 Object  "scribbled note" cafe\r
518   with  name 'scribbled' 'note',\r
519         description [;\r
520             if (self.read_once == false) {\r
521                 self.read_once = true;\r
522                 "You apply your ENHANCED ULTRAFREQUENCY vision to the note\r
523                  and squint in concentration, giving up only when you see the\r
524                  borders of the note begin to blacken under the incredible\r
525                  intensity of your burning stare. You reflect once more how\r
526                  helpful it would've been if you'd ever learnt to read.\r
527                  ^^A kind old lady passes by and explains:\r
528                  ~You have to ask Benny for the key, at the counter.~^^\r
529                  You turn quickly and begin, ~Oh, I KNOW that, but...~^^\r
530                  ~My pleasure, son,~ says the lady, as she exits the cafe.";\r
531                 }\r
532             else\r
533                 "The scorched undecipherable note holds no SECRETS from\r
534                  you NOW! Ha!";\r
535         ],\r
536         read_once false,                ! has the player read the note once?\r
537         before [;\r
538           Take:\r
539             "No reason to start collecting UNDECIPHERABLE notes.";\r
540         ],\r
541   has   scenery;\r
542 \r
543 !----------------------------------------------------------------------------\r
544 \r
545 Room    toilet "Unisex toilet"\r
546   with  description\r
547             "A surprisingly CLEAN square room covered with glazed-ceramic\r
548              tiles, featuring little more than a lavatory and a light switch.\r
549              The only exit is south, through the door and into the cafe.",\r
550         s_to toilet_door,\r
551   has   ~light scored;\r
552 \r
553 Appliance light_switch "light switch" toilet\r
554   with  name 'light' 'switch',\r
555         description\r
556             "A notorious ACHIEVEMENT of technological SCIENCE, elegant yet\r
557              EASY to use.",\r
558         before [;\r
559           Push:\r
560             if (self has on) <<SwitchOff self>>;\r
561             else             <<SwitchOn  self>>;\r
562         ],\r
563         after [;\r
564           SwitchOn:\r
565             give self light;\r
566             "You turn on the light in the toilet.";\r
567           SwitchOff:\r
568             give self ~light;\r
569             "You turn off the light in the toilet.";\r
570         ],\r
571   has   switchable ~on;\r
572 \r
573 Appliance lavatory "lavatory" toilet\r
574   with  name 'lavatory' 'wc' 'toilet' 'loo' 'bowl' 'can' 'john' 'bog',\r
575         before [;\r
576           Examine,Search,LookUnder:\r
577             if (coin in self) {\r
578                 move coin to parent(self);\r
579                 "The latest user CIVILLY flushed it after use, but failed to\r
580                  pick up the VALUABLE coin that fell from his pants.";\r
581             }\r
582           Receive:\r
583             "While any other MORTALS might unwittingly throw just about\r
584              ANYTHING into ", (the) self, ", you remember the WISE teachings\r
585              of your mentor, Duke ELEGANT, about elderly plumbing and rising\r
586              waters.";\r
587         ];\r
588 \r
589 Object  coin "valuable coin" lavatory\r
590   with  name 'valuable' 'coin' 'silver' 'quidbuck',\r
591         description "It's a genuine SILVER QUIDBUCK.",\r
592         before [;\r
593           Drop:\r
594             if (self notin player) return false;\r
595             "Such a valuable coin? Har, har! This must be a demonstration of\r
596              your ULTRA-FLIPPANT jesting!";\r
597         ],\r
598         after [;\r
599           Take:\r
600             "You crouch into the SLEEPING DRAGON position and deftly, with\r
601              PARAMOUNT STEALTH, you pocket the lost coin.";\r
602         ],\r
603   has   scored;\r
604 \r
605 !============================================================================\r
606 ! The player's possessions\r
607 \r
608 Object  clothes "your clothes"\r
609   with  name 'ordinary' 'street' 'clothes' 'clothing',\r
610         description\r
611             "Perfectly ORDINARY-LOOKING street clothes for a NOBODY like\r
612              John Covarth.",\r
613         before [;\r
614           Wear:\r
615             if (self has worn)\r
616                 "You are already dressed as John Covarth.";\r
617             else\r
618                 "The town NEEDS the power of Captain FATE, not the anonymity\r
619                  of John Covarth.";\r
620           Change,Disrobe:\r
621             if (self hasnt worn)\r
622                 "Your KEEN eye detects that you're no longer wearing them.";\r
623             switch (location) {\r
624               street:\r
625                 if (player in booth)\r
626                     "Lacking Superman's super-speed, you realise that it\r
627                      would be awkward to change in plain view of the passing\r
628                      pedestrians.";\r
629                 else\r
630                     "In the middle of the street? That would be a PUBLIC\r
631                      SCANDAL, to say nothing of revealing your secret\r
632                      identity.";\r
633               cafe:\r
634                 "Benny allows no monkey business in his establishment.";\r
635               toilet:\r
636                 if (toilet_door has open)\r
637                     "The door to the bar stands OPEN at tens of curious eyes.\r
638                      You'd be forced to arrest yourself for LEWD conduct.";\r
639                 print "You quickly remove your street clothes and bundle them\r
640                     up together into an INFRA MINUSCULE pack ready for easy\r
641                     transportation. ";\r
642                 if (toilet_door has locked) {\r
643                     give clothes ~worn; give costume worn;\r
644                     "Then you unfold your INVULNERABLE-COTTON costume and\r
645                      turn into Captain FATE, defender of free will, adversary\r
646                      of tyranny!";\r
647                 }\r
648                 else {\r
649                     deadflag = 3;\r
650                     "Just as you are slipping into Captain FATE's costume,\r
651                      the door opens and a young woman enters. She looks at\r
652                      you and starts screaming, ~RAPIST! NAKED RAPIST IN THE\r
653                      TOILET!!!~^^\r
654                      Everybody in the cafe quickly comes to the rescue, only\r
655                      to find you ridiculously jumping on one leg while trying\r
656                      to get dressed. Their laughter brings a QUICK END to\r
657                      your crime-fighting career!";\r
658                 }\r
659               thedark:\r
660                 "Last time you changed in the dark, you wore the suit inside\r
661                  out!";\r
662               default:                  ! this _should_ never happen...\r
663                 "There must be better places to change your clothes!";\r
664             }\r
665         ],\r
666   has   clothing proper pluralname;\r
667 \r
668 Object  costume "your costume"\r
669   with  name 'captain' 'captain^s' 'fate' 'fate^s' 'costume' 'suit',\r
670         description\r
671             "STATE OF THE ART manufacture, from chemically reinforced 100%\r
672              COTTON-lastic(tm).",\r
673         before [;\r
674           Wear:\r
675             if (self has worn)\r
676                  "You are already dressed as Captain FATE.";\r
677             else\r
678                 "First you'd have to take off your commonplace unassuming\r
679                  John Covarth INCOGNITO street clothes.";\r
680           Change,Disrobe:\r
681             if (self has worn)\r
682                 "You need to wear your costume to FIGHT crime!";\r
683             else\r
684                 "But you're not yet wearing it!";\r
685           Drop:\r
686             "Your UNIQUE Captain FATE multi-coloured costume? The most\r
687              coveted clothing ITEM in the whole city? Certainly NOT!";\r
688         ],\r
689   has   clothing proper;\r
690 \r
691 !============================================================================\r
692 ! Entry point routines\r
693 \r
694 [ Initialise;\r
695     #Ifdef DEBUG; pname_verify(); #Endif;       ! suggested by pname.h\r
696     location = street;\r
697     move costume to player;\r
698     move clothes to player; give clothes worn;\r
699     lookmode = 2;\r
700     "^^Impersonating mild mannered John Covarth, assistant help boy at an\r
701      insignificant drugstore, you suddenly STOP when your acute hearing\r
702      deciphers a stray radio call from the POLICE. There's some MADMAN\r
703      attacking the population in Granary Park! You must change into your\r
704      Captain FATE costume fast...!^^";\r
705 ];\r
706 \r
707 [ DeathMessage;\r
708     if (deadflag == 3) print "Your secret identity has been revealed";\r
709     if (deadflag == 4) print "You have been SHAMEFULLY defeated";\r
710     if (deadflag == 5) print "You fly away to SAVE the DAY";\r
711 ];\r
712 \r
713 [ InScope person item;\r
714     if (person == player && location == thedark && real_location == toilet) {\r
715         PlaceInScope(light_switch);\r
716         PlaceInScope(toilet_door);\r
717     }\r
718     if (person == player && location == thedark)\r
719         objectloop (item in parent(player))\r
720             if (item has moved) PlaceInScope(item);\r
721     return false;\r
722 ];\r
723 \r
724 !============================================================================\r
725 ! Standard and extended grammar\r
726 \r
727 Include "Grammar";\r
728 \r
729 [ ChangeSub;\r
730     if (noun has pluralname) print "They're";\r
731     else                     print "That's";\r
732     " not something you must change to save the day.";\r
733 ];\r
734 \r
735 Verb 'change' 'exchange' 'swap' 'swop'\r
736     * noun                  -> Change;\r
737 \r
738 Extend 'ask'\r
739     * creature 'for' topic  -> AskFor;\r
740 \r
741 !============================================================================\r