Inform - Resources - Examples

Back to List

Inventory
Complete

Plain
Coloured
Gaudy

Browsing Adventureland.inf

This is the complete source code of the example game Adventureland.inf.

001  ! ----------------------------------------------------------------------------
002  !  Adventureland 961111             One of the standard Inform 6 example games
003  !
004  !                                             Designed by Scott Adams: c. 1979
005  !                                                   Ported to Inform: 16.10.94
006  !                                                  Slightly corrected: 11.5.96
007  !                    Modernised to Inform 6 and library 6/1 or later: 11.11.96
008  ! ----------------------------------------------------------------------------
009   
010  Constant Story "ADVENTURELAND";
011  Constant Headline
012             "^An Interactive Classic by Scott Adams (circa 1979/80)^";
013   
014  Release 1;
015  Serial "961111";
016   
017  Constant MAX_CARRIED = 6;
018  Constant MAX_SCORE = 100;
019   
020  Replace BurnSub;
021   
022  Include "Parser";
023  Include "VerbLib";
024   
025  Global genie_gifts;
026  Global dark_warning;
027   
028  Class Treasure
029   with depositpoints 7,
030        after
031        [; Take: if (location==Inside_Stump) "Taken!";
032           Drop: if (location==Inside_Stump) "Safely deposited.";
033        ];
034   
035  Class Sign
036   with name "sign",
037        short_name
038        [;  print "sign reads- ", (object) self; rtrue;
039        ],
040    has static;
041   
042  Class ScottRoom
043   with initial
044        [;  give self ~visited;
045        ],
046        describe
047        [ i c d;  print (string) self.description;
048            print "^^Obvious exits: ";
049            for (i=n_to: i<=d_to: i++)
050                if (self.i ~= 0) c++;
051            if (c==0) print "none!";
052            else
053            {   for (i=n_to: i<=d_to: i++)
054                    if (self.i ~= 0)
055                    {   if (d++>0) print ", ";
056                        if (i==n_to) print "North";
057                        if (i==s_to) print "South";
058                        if (i==e_to) print "East";
059                        if (i==w_to) print "West";
060                        if (i==u_to) print "Up";
061                        if (i==d_to) print "Down";
062                    }
063                print ".";
064            }
065            new_line;
066            c=0; d=0;
067            objectloop (i in self)
068                if (i ~= player) { c++; give i concealed; }
069            if (c==0) rtrue;
070            print "^You can also see: ";
071            objectloop (i in self)
072                if (i ~= player)
073                {   if (d++>0) print " - "; PrintShortName(i);
074                }
075            new_line; rtrue;
076        ];
077   
078  [ GamePreRoutine i c d;
079     if (action~=##Inv) rfalse;
080     c=0; d=0;
081     objectloop (i in player) c++;
082     if (c==0) "You're carrying nothing.";
083     print "You're carrying:^";
084     objectloop (i in player)
085     {   if (d++>0) print " - "; PrintShortName(i);
086     }
087     new_line; rtrue;
088  ];
089   
090  [ GamePostRoutine i;
091      if (action==##Look)
092          objectloop (i in location)
093              if (i ~= player && i has concealed)
094                  give i ~concealed;
095      rfalse;
096  ];
097   
098  ! ----------------------------------------------------------------------------
099  !   Into Adventureland...
100  ! ----------------------------------------------------------------------------
101   
102  ScottRoom Lake_Shore "Lakeside"
103    with description "You're on the shore of a lake.",
104         n_to Forest,  s_to Lake_Shore,  w_to Dismal_Swamp,
105         d_to Quicksand,
106         before
107         [;  Swim: "Below you and before the lake is quicksand.";
108         ],
109    has  light;
110  Object -> water "water"
111    with name "water", article "some",
112         before
113         [; Drink: "Boy, that really hit the spot.";
114            Take: if (bottle notin player)
115                      "You have nothing in which to carry the water.";
116                  <<Fill bottle>>;
117            Insert: if (second == bottle) <<Fill bottle>>;
118                      "You have nothing in which to carry the water.";
119            Receive: if (noun == bottle) <<Fill bottle>>;
120                  remove noun; CDefArt(noun); " washes away into the lake.";
121         ],
122    has  scenery;
123  Treasure -> "*GOLDEN FISH*"
124    with name "gold" "golden" "fish",
125         each_turn
126         [;  if (self notin player) rfalse;
127             if (net notin player && random(100) <= 75)
128             {   move self to Lake_Shore;
129                 "^The fish escape back to the lake.";
130             }
131             if ((water_in_the_bottle notin bottle
132                  || bottle notin player) && random(100)<=50)
133             {   remove self; move dead_fish to player;
134                 "^Too dry. Fish die.";
135             }
136         ];
137  Object -> axe "rusty axe (magic word- BUNYON -on it)"
138    with name "rusty" "axe",
139         description "The magic word BUNYON is written on the haft.";
140  Sign -> "NO SWIMMING ALLOWED";
141  Object dead_fish "dead fish"
142    with name "dead" "fish"
143    has  edible;
144   
145  ScottRoom Quicksand "Bog"
146    with description "You're in a quick-sand bog.",
147         before
148         [;  Swim: if (child(player)==nothing)
149                   {   PlayerTo(Lake_Shore); rtrue; }
150                   "Something's too heavy.";
151         ],
152    has  light;
153  Treasure -> ox "*SMALL STATUE OF A BLUE OX*"
154    with name "ox" "blue" "small" "statue";
155   
156  ScottRoom Forest "Forest"
157    with description "You're in a forest.",
158         n_to Forest,  s_to Forest,  e_to Sunny_Meadow,  w_to Forest,
159         u_to trees
160    has  light;
161  Object -> trees "trees"
162    with name "tree" "trees",
163         before
164         [;   Climb: <<Enter self>>;
165         ],
166         door_to Up_Oak, door_dir u_to
167    has  open door static;
168   
169  ScottRoom Up_Oak "Branch"
170    with description "You're in a branch on the top of an old oak tree.^
171                      To the east you see a meadow beyond a lake.",
172         d_to Forest,  
173    has  light;
174   
175  ScottRoom Sunny_Meadow "Meadow"
176    with description "You're in a sunny meadow.",
177         n_to Lake_Shore,  s_to Dismal_Swamp,  e_to Lake_Shore,
178         w_to Forest,
179    has  light;
180  Object -> dragon "sleeping Dragon"
181    with name "dragon" "sleeping" "sleepy",
182         before
183         [;  WakeOther: deadflag=1; "The dragon wakes!";
184         ],
185         life
186         [;  Order, Answer, Ask: "Shh! You don't want to wake the dragon.";
187             Give:    "The dragon is too drowsy to notice.";
188             ThrowAt: if (noun==axe) 
189                      {   move axe to location; "The dragon isn't bothered."; }
190         ],
191         each_turn
192         [;  if (mud in location && random(100)<=50)
193             {   deadflag=1;
194                 "Dragon smells something - awakens - attacks you!";
195             }
196         ],
197    has  animate;
198  Sign -> "IN SOME CASES MUD IS GOOD, IN OTHERS...";
199  Treasure eggs "*DRAGON EGGS* (very rare)"
200    with name "dragon" "eggs" "very" "rare", depositpoints 12;
201  Object gore "smoking hole - pieces of dragon and gore"
202    with name "gore" "hole" "dragon" "smoking"
203    has  static;
204   
205  ScottRoom Hidden_Grove "Grove"
206    with description "You're in a hidden grove.",
207         n_to Forest,  e_to Dismal_Swamp,  w_to Forest,  
208    has  light;
209  Treasure -> "*JEWELLED FRUIT*"
210    with name "jewelled" "jewel" "fruit",
211         after
212         [;  Eat: "Boy that really hit the spot!"; ],
213    has  edible;
214  Sign -> "PAUL'S PLACE";
215   
216  ScottRoom Dismal_Swamp "Dismal Swamp"
217    with description "You're in a dismal swamp.",
218         n_to Sunny_Meadow,  s_to Dismal_Swamp,  e_to Dismal_Swamp,
219         w_to Hidden_Grove,  in_to 0,            u_to cypress_tree
220    has  light;
221  Object -> cypress_tree "cypress tree"
222    with name "cypress" "tree",
223         before
224         [;   Climb: <<Enter self>>;
225              Cut:    if (axe notin player) rfalse;
226                      remove self; move tree_remains to Dismal_Swamp;
227                      Dismal_Swamp.in_to = tree_remains;
228                      Dismal_Swamp.u_to = 0;
229                      print "TIMBER..";
230                      if (keys in Tree_Top)
231                      {   remove keys;
232                          ". Something fell from the treetop and vanished!";
233                      }
234                      ".";
235         ],
236         door_to Tree_Top, door_dir u_to
237    has  open door static;     
238   
239  Object -> mud "evil smelling mud"
240    with name "evil" "smelling" "mud", article "some",
241         after
242         [ f; Take:
243                  if (infected_bites in player) { remove infected_bites; f=1; }
244                  if (chigger_bites in player)  { remove chigger_bites; f=1; }
245                  if (f==1) "Boy that really hit the spot!";
246         ],
247         each_turn
248         [;  if (self notin player) rtrue;
249             if (random(100)<=5 &&
250                 (bottle notin player || water_in_the_bottle notin bottle))
251             {   move self to Dismal_Swamp;
252                 "The mud dried up and fell off.";
253             }
254         ];
255   
256  Object -> gas "swamp gas"
257    with name "swamp" "gas", article "some",
258         before
259         [;  Take:
260                 if (distended_bladder in player) "Bladder full already.";
261                 if (wine_bladder notin player) "You have nothing suitable.";
262                 <<Insert self wine_bladder>>;
263             Insert:
264                 if (second == distended_bladder) "The bladder's full.";
265                 if (second ~= wine_bladder)
266                     "That won't hold gas.";
267                 move distended_bladder to player; remove wine_bladder;
268                 itobj = distended_bladder;
269                 "The bladder distends with swamp gas.";
270         ],
271    has  static;
272  Object -> slime "floating patch of oily slime"
273    with name "patch" "oil" "slime" "oily",
274         before
275         [;  Take: brass_lantern.time_left=125; give brass_lantern general;
276                   remove self; move brass_lantern to player;
277                   "Magic oil attracts magic lamp. Lamp is now full.";
278         ],
279    has  static;
280  Object -> chiggers "chiggers"
281    with name "chiggers", article "a swarm of",
282         daemon
283         [;  if (chigger_bites in player && mud notin player && random(100)<=10)
284             {   remove chigger_bites; move infected_bites to player;
285                 "^Your chigger bites are now infected.";
286             }
287             if (infected_bites in player && random(100)<=8)
288             {   deadflag=1;
289                 "^The bites have rotted your whole body.";
290             }
291             if (infected_bites notin player
292                 && chigger_bites notin player
293                 && slime in location && mud notin player
294                 && random(100)<=5)
295             {   move chigger_bites to player;
296                 "^You're bitten by chiggers.";
297             }
298             if (infected_bites notin player
299                 && chigger_bites notin player
300                 && chiggers in player
301                 && random(100)<=30)
302             {   move chigger_bites to player;
303                 "^You're bitten by chiggers.";
304             }
305         ];
306  Object chigger_bites "chigger bites"
307    with name "chigger" "bites", article "some",
308         before [; "The bites are annoying. Perhaps medicine would help?"; ];
309  Object infected_bites "infected chigger bites"
310    with name "chigger" "bites" "infected", article "some",
311         before [; "The bites are frightening. Get medicine!"; ];
312   
313  Object tree_remains "hollow stump and remains of a felled tree"
314    with name "tree" "stump" "hollow" "remains",
315         door_to Inside_Stump, door_dir in_to
316    has  open door static;
317   
318  ScottRoom Tree_Top "Tree Top"
319    with description "You're in the top of a tall cypress tree.",
320         d_to Dismal_Swamp,  
321    has  light;
322   
323  Object -> "spider web with writing on it"
324    with name "spider" "web" "writing",
325         description "~CHOP IT DOWN!~",
326         before
327         [;  Take: deadflag=1; "You're bitten by a spider.";
328         ];
329  Object -> keys "ring of skeleton keys"
330    with name "keys" "ring" "skeleton" "keyring";
331   
332  ScottRoom Inside_Stump "Inside Stump"
333    with description "You're in a large hollow damp stump in the swamp.",
334         n_to Dismal_Swamp,  s_to Dismal_Swamp,  e_to Dismal_Swamp,
335         w_to Dismal_Swamp,  u_to Dismal_Swamp,  d_to Root_Chamber, 
336    has  light;
337  Sign -> "LEAVE TREASURE HERE - (say 'SCORE')";
338  Object -> bottle "the bottle"
339    with name "bottle" "jar" "flask",
340         short_name
341         [;  if (water_in_the_bottle in self) { print "bottle of water"; rtrue; }
342             if (bees in self) { print "bottle of bees"; rtrue; }
343             print "empty bottle"; rtrue;
344         ],
345         before
346         [ x; LetGo:
347               if (noun in bottle)
348                   "You're holding that already (in the bottle).";
349           Receive:
350               if (noun==water or bees) <<Fill self>>;
351               "That won't go in the bottle.";
352           Fill:
353               if (child(bottle)~=0)
354                 "The bottle is full already.";
355               if (water in location)
356               {   move water_in_the_bottle to bottle;
357                   "The bottle is now full of water.";
358               }
359               if (bees in location)
360               {   move bees to bottle;
361                   "The bottle is now full of bees.";
362               }
363               "There is nothing here with which to fill the bottle.";
364           Empty: if (child(bottle)==0) "The bottle is already empty!";
365               x=child(bottle);
366               remove x;
367               if (x==bees)
368               {   move x to location; "You release the bees.";
369               }
370               "Your bottle is now empty and the ground is now wet.";
371         ],
372    has  container open;
373   
374  Object -> brass_lantern "old fashioned lamp"
375    with name "lamp" "fashioned" "lamp", article "an",
376         power 125,
377         time_left 0,
378         daemon
379         [ t; if (self hasnt on) { StopDaemon(self); rtrue; }
380            t=--(self.power);
381            if (t==0) give self ~on ~light;
382            if (self in player or location)
383            {   if (t==0) "Your lamp has run out of power.";
384                if (t==30) "Your lamp is getting dim.";
385            }
386         ],
387         before
388         [; Examine: print "It is a shiny brass lamp";
389                  if (self hasnt on)
390                      ". It is not currently lit.";
391                  if (self.power < 30)
392                      ", glowing dimly.";
393                  ", glowing brightly.";
394            Burn: <<SwitchOn self>>;
395            Rub:  if (self has on) "No! It's too hot.";
396                  if (self hasnt general) "Nothing happens.";
397                  switch(++genie_gifts)
398                  {   1: move ring to location;
399                         "A glowing genie appears -
400                          drops something - then vanishes.";
401                      2: move bracelet to location;
402                         "A glowing genie appears -
403                          drops something - then vanishes.";
404                      3: if (ring in Inside_Stump)
405                             score=score-ring.depositpoints;
406                         remove ring; move player to Misty_Room;
407                         "A genie appears - says ~boy you're selfish~ - takes 
408                          something - then vanishes!";
409                      4: if (bracelet in Inside_Stump)
410                             score=score-bracelet.depositpoints;
411                         remove bracelet; move player to Misty_Room;
412                         "A genie appears - says ~boy you're selfish~ - takes 
413                          something - then vanishes!";
414                      default: "Nothing happens.";
415                  }
416            SwitchOn: if (self.power <= 0) "It's run out.";
417            Receive, Open:
418                  "You can't put things in the lamp.";
419         ],
420         after
421         [; SwitchOn: give self light; StartDaemon(self);
422                "Flameless lamp now on.";
423            SwitchOff: give self ~light;
424         ],
425    has  switchable;
426   
427  Treasure ring "*DIAMOND RING*"
428    with name "diamond" "ring";
429  Treasure bracelet "*DIAMOND BRACELET*"
430    with name "diamond" "bracelet";
431   
432  Object water_in_the_bottle "bottled water" bottle
433    with name "bottled" "water" "h2o", article "some",
434         before
435         [; Drink:  remove water_in_the_bottle; <<Drink water>>;
436         ],
437         description "It looks like ordinary water to me.";
438   
439  ScottRoom Root_Chamber "Root Chamber"
440    with description "You're in a root chamber under the stump.",
441         u_to Inside_Stump,  d_to dark_hole,  
442    has  light;
443  Object -> dark_hole "dark hole"
444    with description "Leading below.",
445         door_dir d_to,
446         door_to Semidark_Hole
447    has  open door static;
448  Treasure -> "*POT OF RUBIES*"
449    with name "pot" "of" "rubies";
450   
451  ScottRoom Semidark_Hole "Hole"
452    with description "You're in a semi-dark hole by the root chamber.",
453         u_to Root_Chamber, d_to root_door
454    has  light;
455  Object -> root_door "the door"
456    with name "door",
457         short_name
458         [;  if (self has locked) { print "locked door"; rtrue; }
459             if (self has open)
460             {   print "open door with a hallway beyond"; rtrue; }
461             print "closed door"; rtrue;
462         ],
463         before
464         [;  ThrowAt:
465                 if (second==axe)
466                 {   give self ~locked ~lockable ~openable open;
467                     "Lock shatters!";
468                 }
469         ],
470         door_to Long_Hall, door_dir d_to, with_key keys
471    has  static door openable lockable locked;
472   
473  ScottRoom Long_Hall "Hall"
474    with description "You're in a long down-sloping hall.",
475         u_to Semidark_Hole,  d_to Large_Cavern;
476   
477  ScottRoom Large_Cavern "Cavern"
478    with description "You're in a large cavern.",
479         n_to Hive,  s_to Royal_Anteroom,  w_to Memory_RAM,
480         u_to Long_Hall,  d_to Maze1;
481   
482  ScottRoom Hive "Octagonal Hive"
483    with description "You're in a large 8-sided room.",
484         s_to Large_Cavern;
485  Treasure -> "*ROYAL HONEY*"
486    with name "royal" "honey", article "some",
487         before
488         [;  Take:
489                 if (bees in location && mud notin player)
490                 {   deadflag=1; "Bees sting you."; }
491             Drop:
492                 if (bear in location)
493                 {   remove self; give bear general;
494                     "The bear eats the honey and falls asleep.";
495                 }
496         ],
497    has  edible;
498  Object -> bees "large African bees"
499    with name "large" "african" "bees", article "a swarm of",
500         before
501         [;  Take:
502                 if (mud notin player)
503                 {   deadflag=1; "Bees sting you."; }
504                 if (bottle in player) <<Fill bottle>>;
505                 "You have nothing to carry the bees in.";
506             Drop:
507                 if (self in bottle
508                     && dragon in location)
509                 {   move self to location;
510                     move eggs to location; remove dragon;
511                     "The bees attack the dragon which gets up and flies away...";
512                 }
513                 if (self in bottle
514                     && bear in location)
515                 {   move self to location;
516                     give bear ~general; deadflag=1;
517                     "Bees madden the bear. Bear then attacks you!";
518                 }
519         ],
520         each_turn
521         [;  #IFNDEF DEBUG;
522             !  A completely unfair rule! And in the original the bees are lost.
523             if (self in bottle && random(100)<=8)
524             {   move self to Hive; "^The bees in the bottle all suffocated."; }
525             #ENDIF;
526             if (self in bottle) rfalse;
527             if (self in location && mud notin player && mud notin location &&
528                 random(100)<=8)
529             {   deadflag=1; "Bees sting you."; }
530         ];
531   
532  ScottRoom Royal_Anteroom "Anteroom"
533    with description "You're in a royal anteroom.",
534         n_to Large_Cavern,  u_to Royal_Chamber;
535  Object -> wine_bladder "empty wine bladder"
536    with name "empty" "wine" "bladder",
537         before
538         [;  Fill: if (gas notin location)
539                       "The bladder could only just hold a vapour nowadays.";
540                   <<Insert gas self>>;
541         ];
542  Object distended_bladder "distended gas bladder"
543    with name "distended" "gas" "bladder",
544         before
545         [;  Open: move wine_bladder to parent(self); remove self;
546                   "Gas dissipates!";
547         ];
548   
549  ScottRoom Maze1 "Maze"
550    with description "You're in a maze of pits.",
551         n_to Maze2,  s_to Maze4,  e_to Maze4,  d_to Maze2;
552   
553  ScottRoom Maze2 "Maze"
554    with description "You're in a maze of pits.",
555         w_to Maze3,  u_to Maze1;
556  Object -> flint_and_steel "flint and steel"
557    with name "flint" "steel";
558   
559  ScottRoom Maze3 "Maze"
560    with description "You're in a maze of pits.",
561         n_to Maze6,  s_to Maze1,  e_to Maze2,  w_to Maze5,
562         u_to Maze5,  d_to Maze6;
563  Object -> "scratchings"
564    with name "scratchings", article "strange",
565         short_name "strange scratchings on rock reveals- ALADDIN WAS HERE",
566    has  static;
567   
568  ScottRoom Maze4 "Maze"
569    with description "You're in a maze of pits.",
570         n_to Maze1,  e_to Maze2,  w_to Maze1,  u_to Maze2;
571   
572  ScottRoom Maze5 "Maze"
573    with description "You're in a maze of pits.",
574         s_to Maze6,  u_to Maze3,  d_to Maze6;
575   
576  ScottRoom Maze6 "Maze"
577    with description "You're in a maze of pits.",
578         n_to Maze6,  s_to Maze1,  e_to Maze1,  w_to Maze4,
579         u_to Maze3,  d_to Chasm_Bottom;
580  Treasure -> rug "*THICK PERSIAN RUG*"
581    with name "thick" "persian" "rug" "carpet";
582  Object -> "arrow pointing down"
583    with name "arrow"
584    has  static;
585   
586  ScottRoom Chasm_Bottom "Chasm"
587    with description "You're in a bottom of a chasm. Above 2 ledges. 
588                      One has a bricked up window.",
589         u_to Maze6;
590  Treasure -> net "*GOLDEN NET*"
591    with name "gold" "golden" "net";
592  Sign -> "MAGIC WORD IS AWAY. X LA -(rest of sign is missing)";
593  Object -> lava "the lava"
594    with name "stream" "of" "lava",
595         short_name
596         [;  print "stream of lava";
597             if (self has general) print " with a brick dam";
598             rtrue;
599         ],
600         description
601         [;  if (self hasnt general)
602               "There's something there all right! Maybe you should go there?";
603             "Just more dammed lava.";
604         ],
605         before
606         [;  Enter, Push, Pull, Take: "NO! It's too hot.";
607         ],
608    has  static;
609  Treasure firestone "*FIRESTONE* (cold now)"
610    with name "firestone", depositpoints 11;
611   
612  ScottRoom Narrow_Ledge_1 "Ledge"
613    with description "You're on a narrow ledge by a chasm. 
614                      Across the chasm is a throne room.",
615         before
616         [;  Jump: if (firebricks in player)
617                   {   deadflag=1; "Oh no! Something was too heavy!"; }
618                   print "You leap across the chasm...^";
619                   PlayerTo(Narrow_Ledge_2); rtrue;
620         ],
621         w_to Royal_Chamber;
622   
623  ScottRoom Royal_Chamber "Royal Chamber"
624    with description "You're in the Royal Chamber.",
625         d_to Royal_Anteroom, e_to 0;
626  Object -> bricked_window "bricked-up window"
627    with name "window" "bricked" "brick" "bricks"
628    has  static;
629  Object holed_window "bricked up window with a hole in it - beyond is a ledge"
630    with name "window" "bricked" "hole" "ledge",
631         door_dir e_to, door_to Narrow_Ledge_1
632    has  static door open;
633  Object firebricks "loose fire bricks"
634    with name "loose" "fire" "bricks", article "some",
635         after
636         [;  Take: "Taken. (Heavy!)";
637             Drop: if (location~=Chasm_Bottom) rfalse;
638                   remove self; give lava general;
639                   move firestone to location;
640                   "The bricks dam the lava, revealing a *FIRESTONE*!";
641         ];
642   
643  ScottRoom Narrow_Ledge_2 "Ledge"
644    with description
645            "You're on a narrow ledge by the throne room-across chasm-ledge.",
646         before
647         [;  Sing:
648             if (bear in location && bear hasnt general)
649             {   move dead_bear to Chasm_Bottom;
650                 remove bear;
651                 "The bear got startled and fell off the ledge!";
652             }
653             Jump: print "You leap across the chasm...^";
654                   PlayerTo(Narrow_Ledge_1); rtrue;
655         ],
656         e_to
657         [;  if (bear in location && bear hasnt general)
658                 "The bear won't let you!";
659             return Throne_Room;
660         ];
661  Treasure -> mirror "*MAGIC MIRROR*"
662    with name "magic" "mirror",
663         side_up 0,
664         before
665         [;  Take:
666                 if (bear in location && bear hasnt general)
667                     "The bear won't let you!";
668         ],
669         after
670         [;  Drop:
671               if (rug in location)
672               {   print "Mirror lands softly on the rug - lights up and says:^";
673                   self.side_up++;
674                   if (self.side_up % 2 == 1)
675                     "*DRAGON STINGS* and fades. I don't get it - hope you do.";
676                   "Don't waste *HONEY*. Get mad instead. Dam lava!";
677               }
678               remove self; move broken_glass to location;
679               "The mirror hits the floor and shatters into a million pieces!";
680         ];
681  Object -> bear "the bear"
682    with name "thin" "black" "bear",
683         short_name
684         [;  if (self has general) { print "sleeping bear"; rtrue; }
685             print "thin black bear"; rtrue;
686         ],
687         before
688         [;  WakeOther: give self ~general; "The bear rouses!^";
689         ],
690         life
691         [;  Ask, Order, Answer: <<Sing>>;
692             Attack, ThrowAt:
693                 if (self has general) <WakeOther self>;
694                 remove mirror; move broken_glass to location;
695                 "Oh no...Bear dodges...CRASH!";
696         ],
697    has  animate;
698  Object broken_glass "broken glass"
699    with name "broken" "glass" "jagged" "fragments", article "some";
700  Object dead_bear "dead bear"
701    with name "dead" "bear" "black" "thin"
702    has  static;
703   
704  ScottRoom Throne_Room "Throne Room"
705    with description "You're in a throne room.",
706         w_to Narrow_Ledge_2;
707  Treasure -> "*GOLD CROWN*"
708    with name "gold" "golden" "crown";
709   
710  ScottRoom Real_Trouble "Trouble!"
711    with description
712             "I think you're in real trouble. Here's a guy with a pitchfork!^^
713              You lost *ALL* treasures.",
714         initial
715         [;  deadflag=3;
716         ],
717    has  light;
718   
719  ScottRoom Memory_RAM "Ugly Place"
720    with description
721            "You're in the memory RAM of an IBM-PC. You took a wrong turn!",
722         e_to Large_Cavern,  
723    has  light;
724  Sign -> "To the Architects - TSURRIS";
725   
726  ScottRoom Misty_Room "Misty Room"
727    with description "You're in a large misty room with strange letters
728                      over the exits.",
729         s_to Real_Trouble,  e_to Forest,  w_to Real_Trouble,
730         u_to Up_Oak,  d_to Real_Trouble,  
731    has  light;
732  Sign -> "LIMBO. FIND RIGHT EXIT AND LIVE AGAIN!";
733   
734  ! ----------------------------------------------------------------------------
735  !   A soupcon of code
736  ! ----------------------------------------------------------------------------
737   
738  [ Initialise;
739    location=Forest; score = 0;
740   
741    StartDaemon(chiggers);
742   
743    "^^^^^A voice booms out ...^
744    Treasures have an * in their name. Say 'SCORE'^
745    If you need a hint on something, try 'HELP'.^";
746  ];
747   
748  [ TimePasses i;
749    if (location ~= Inside_Stump) rfalse;
750   
751    score=0;
752    objectloop (i in Inside_Stump && i ofclass Treasure)
753        score = score + i.depositpoints;
754   
755    if (score ~= 100) rfalse;
756   
757    deadflag=2;
758    "Congratulations! By finding and depositing all 13 *TREASURES*, you 
759     have solved Scott Adams's ~Adventureland~ and it remains only to say 
760     that...";
761  ];
762   
763  [ AfterLife;
764     if (deadflag==3) { deadflag=1; rfalse; }
765     remove chigger_bites; remove infected_bites;
766     deadflag=0; PlayerTo(Misty_Room);
767  ];
768   
769  [ PrintRank; "."; ]; 
770   
771  [ DarkToDark;
772    if (dark_warning==0)
773    {   dark_warning=1; "It is now pitch dark. 
774                         If you proceed you will likely fall into a pit.";
775    }
776    if (random(4) == 1)
777    {   deadflag=1;
778        "You fell into a pit and broke every bone in your body!";
779    }
780    rfalse;
781  ];
782   
783  [ BunyonSub;
784    if (axe notin player) "Nothing happens.";
785    if (ox in player or location)
786    {   move ox to Hidden_Grove;
787        move axe to Hidden_Grove;
788        "Something you're holding vibrated and...";
789    }
790    if (player notin Quicksand)
791    {   move axe to Hidden_Grove;
792        print "Something you're holding vibrated and...";
793        <<Inv>>;
794    }
795    "Nothing happens.";
796  ];
797   
798  [ TsurrisSub;
799    if (location ~= Memory_RAM) "Nothing happens.";
800    "A voice booms out...^
801     May all your teeth but one fall out, and may that one give you toothache.^
802     (You can't help feeling you have stumbled on a private quarrel which is 
803      nothing to do with your game.)";
804  ];
805   
806  [ BurnSub;
807    if (flint_and_steel notin player)
808        "You have nothing to strike a light with.";
809    if (noun==gas) "Gas needs to be contained before it will burn.";
810    if (noun==distended_bladder)
811    {   if (noun in player)
812        {   remove noun; deadflag=1; "Gas bladder blew up in your hands!";
813        }
814        remove noun;
815        print "Gas bladder blew up!^";
816        if (dragon in location)
817        {   remove dragon; move gore to location;
818            "The dragon has been blown to bits!";
819        }
820        if (bricked_window in location)
821        {   remove bricked_window;
822            move holed_window to location; move firebricks to location;
823            Royal_Chamber.e_to = holed_window;
824            "The bricked window has been blown to bits!";
825        }
826        rtrue;
827    }
828    "That won't ignite.";
829  ];
830   
831  [ HelpSub;
832     print "A voice booms out...^";
833     print "Try:  LOOK,JUMP,SWIM,CLIMB,THROW,FIND,GO,TAKE,INVENTORY,SCORE.^";
834     if (chigger_bites in player || infected_bites in player)
835         "Medicine is good for bites.";
836     if (location == Quicksand) "You may need magic words here.";
837     if (location == Sunny_Meadow)
838         "Only 3 things will wake the dragon. One of them is dangerous!";
839     if (location == Hive)
840         "Read the sign in the meadow!";
841     if (location == Maze1 or Maze2 or Maze3
842         || location == Maze4 or Maze5 or Maze6)
843         "You may need magic words here.";
844     if (location == Royal_Chamber) "Blow it up. Try the swamp.";
845  ];
846   
847  [ AwaySub;
848    if (rug notin player || location~=Maze3) "Nothing happens.";
849    print "Something you're holding vibrates, and...^";
850    PlayerTo(Sunny_Meadow);
851  ];
852   
853  [ FindSub;
854    "A voice booms out...^Find it yourself.";
855  ];
856   
857  ! ----------------------------------------------------------------------------
858  !   Grammar: the usual grammar and some extensions
859  ! ----------------------------------------------------------------------------
860   
861  Include "Grammar";
862   
863  Extend "cut"
864                  * "up" noun                      -> Cut
865                  * "down" noun                    -> Cut;
866   
867  Verb "bunyon"   *                                -> Bunyon;
868  Verb "away"     *                                -> Away;
869  Verb "tsurris"  *                                -> Tsurris;
870  Verb "help"     *                                -> Help;
871  Verb "find"     * special                        -> Find;
872   
873  ! ----------------------------------------------------------------------------


Last updated 23 June 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.