



		
		 Inventory This is the complete source code of the example game Museum.inf.
			
		
				 
		Back to List 
				
Complete
					 
			Browsing Museum.inf
					0001  ! ----------------------------------------------------------------------------
0002  !   Museum 961111                   One of the standard Inform 6 example games
0003  !
0004  !                                                            created: 20.12.95
0005  !                                             translated to Inform 6: 11.11.96
0006  !
0007  !   This "game" is a compendium of solved exercises from the Designer's
0008  !   Manual.  Room numbers are section numbers within the Third Edition.
0009  !   Many of these exercises are difficult, and so is some of the code below.
0010  ! ----------------------------------------------------------------------------
0011   
0012  Constant Story "MUSEUM OF INFORM";
0013  Constant Headline
0014      "^An Interactive Companion to the Designer's Manual (Third Edition)^";
0015   
0016  !   The game is meant to be experimented with, so we always define:
0017  Constant DEBUG;
0018   
0019  Release 2;
0020  Serial "961111";
0021   
0022  Replace DrawStatusLine;
0023  Include "Parser";
0024   
0025  ! --------------------------------------------------------------------------
0026   
0027  Object samples_bag "samples bag"
0028    with description "A capacious SACK_OBJECT (see section 20).",
0029         name "samples" "bag", article "your",
0030         when_closed "Your samples bag lies on the floor.",
0031         when_open "Your samples bag lies open on the floor.",
0032    has  container open openable;
0033   
0034  Constant SACK_OBJECT = samples_bag;
0035   
0036  Include "VerbLib";
0037   
0038  ! --------------------------------------------------------------------------
0039   
0040  Attribute crewmember;
0041   
0042  Property weight 10;
0043   
0044  Class Key with name "key";
0045   
0046  ! --------------------------------------------------------------------------
0047   
0048  Object  Foyer "Foyer"
0049   has    light
0050   with   description
0051             "The foyer of the magnificent Museum of Inform. A flight of 
0052              stairs sweeps upward to Chapters V and VI, and corridors 
0053              fan out on this level into Chapter IV. These run:^
0054              ^  north into Room 10 (the Halls of Sense and Direction),
0055              ^  south along Corridor 12 (doors) to Room 13 (switches),
0056              ^  @00 to Room 11 (the Wonderful World of Containers)
0057              ^  and @01 to Room 14 (which houses larger exhibits).^^
0058              (And a plain ladder descends into the basement; you can also 
0059               step out onto a balcony.)",
0060          e_to Room11, u_to Second_Floor, n_to Room10,
0061          s_to Corridor12, w_to Room14,
0062          d_to basement, out_to balcony;
0063   
0064  Object -> "map"
0065    with name "map" "ground" "floor",
0066         initial "A map of the ground floor is embossed in one wall.",
0067         description
0068         [;  font off;
0069             print
0070            "^+------------------------------------------+
0071             ^|                              (mirror)    |
0072             ^|   Weights      Room 10  ---  Room 10a    |
0073             ^|    Room         senses      directions   |
0074             ^|      |            |                      |
0075             ^|   Room 14 ---   Foyer   ---   Room 11    |
0076             ^|  (changing  (you are here)   containers  |
0077             ^|  character)       |                      |
0078             ^|                   |                      |
0079             ^|   Room 15 --- Corridor 12                |
0080             ^|  (MS room)  (door, curator)              |
0081             ^|   (Bible)         |                      |
0082             ^|             Switches Hall 13             |
0083             ^|                (chasm)                   |
0084             ^|                   |                      |
0085             ^|           Far Side of Room 13            |
0086             ^+------------------------------------------+^";
0087             font on;
0088         ],
0089    has  static;
0090   
0091  ! --------------------------------------------------------------------------
0092   
0093  Object basement "Museum Basement"
0094    with u_to Foyer,
0095         description
0096            "Once Room 17, this space has been abandoned by the curators,
0097             who have simply sprayed its walls with moth-repellent and
0098             abandoned it.",
0099         before
0100         [;  Smell: "Napthalene.";
0101         ];
0102   
0103  ! --------------------------------------------------------------------------
0104   
0105  Object Room10 "Hall of Senses"
0106    with description
0107            "This is Room 10, north of the foyer. If you try going further 
0108             north, a string will be printed instead. The exit to the @00 
0109             has a routine attached, and randomly leads either to the 
0110             Directions Room or back to the foyer.",
0111         s_to Foyer,
0112         n_to "This string is the ~n_to~ value for this room.",
0113         e_to
0114         [;  if (random(2)==1) return Foyer; return Room10a; ],
0115    has  light;
0116   
0117  Object -> "TRAP lever"
0118    with name "trap" "lever",
0119         before
0120         [;  Pull, Push:
0121                 if (self has on) <<SwitchOff self>>;
0122                 <<SwitchOn self>>;
0123         ],
0124         after
0125         [;  SwitchOn: move orange_cloud to location;
0126                "Clunk! An orange cloud suddenly descends upon you.";
0127             SwitchOff: remove orange_cloud;
0128                "Click! The orange cloud vanishes.";
0129         ],
0130    has  switchable static;
0131   
0132  Object -> "gold watch"
0133    with name "gold" "watch",
0134         description "The watch has no hands, oddly.",
0135         react_before
0136         [;  Listen: if (noun==0 or self) "The watch ticks loudly."; ];
0137   
0138  Object -> "sprig of lavender"
0139    with name "sprig" "of" "lavender",
0140         react_before
0141         [;  Smell: if (noun==0 or self) "Lavender-perfume. Ahh!"; ];
0142   
0143  Object orange_cloud "orange cloud"
0144    with name "orange" "cloud",
0145         react_before
0146         [;  Look: "You can't see for the orange cloud surrounding you.";
0147             Go, Exit: "You wander round in circles, choking.";
0148             Smell: if (noun==0 or self) "Cinnamon? No, nutmeg.";
0149         ],
0150    has  scenery;
0151   
0152  ! --------------------------------------------------------------------------
0153  !   For east-west reflection
0154  ! --------------------------------------------------------------------------
0155   
0156  Lowstring east_str "east"; Lowstring west_str "west";
0157  [ NormalWorld; string 0 east_str; string 1 west_str;
0158    e_obj.door_dir = e_to; w_obj.door_dir = w_to;
0159  ];
0160  [ ReversedWorld; string 0 west_str; string 1 east_str;
0161    w_obj.door_dir = e_to; e_obj.door_dir = w_to;
0162  ];
0163   
0164  Object Room10a "Hall of Directions"
0165    with name "mirror",
0166         description
0167            "An annexe to Room 10: the main exit is back @01, and there's a 
0168             curiously misty mirror on the north wall. Also, there's an exit 
0169             in the fourth, ~hyper~ dimension (which is only visible in the 
0170             weird geometry of this room).",
0171         initial
0172         [;  move hyper to compass; StartDaemon(hyper);
0173         ],
0174         w_to Room10,
0175         n_to
0176         [;  print "Walking through the mirror is confusing...^";
0177             if (self has general) NormalWorld(); else ReversedWorld();
0178             if (self has general) give self ~general; else give self general;
0179             <<Look>>;
0180         ],
0181         in_to [; print "Amazing! Your body corkscrews as you pass.^";
0182                  return Room11; ],
0183    has  light;
0184   
0185  Object hyper "hyper-dimensional direction"
0186    with name "hyper" "fourth" "dimension", article "the", door_dir in_to,
0187         daemon
0188         [;  if (location ~= Room10a) { remove self; StopDaemon(self); }
0189         ],
0190    has  scenery;
0191   
0192  ! --------------------------------------------------------------------------
0193   
0194  Object Room11 "Wonderful World of Containers"
0195    with description
0196            "This is Room 11, @00 of the foyer. You notice a typical piece 
0197             of scenery which turns out to be a supporter: a mantelpiece.",
0198         w_to Foyer,
0199    has  light;
0200   
0201  Object -> "bearded psychiatrist"
0202    with name "bearded" "doctor" "psychiatrist" "psychologist" "shrink",
0203         initial "A bearded psychiatrist has you under observation.",
0204         life
0205         [;  "He is fascinated by your behaviour, but makes no attempt to 
0206              interfere with it.";
0207         ],
0208         react_after
0209         [;  Insert: print "~Subject puts ", (a) noun, " in ", (the) second,
0210                        ". Interesting.~^";
0211             PutOn:  print "~Subject puts ", (a) noun, " in ", (the) second,
0212                        ". Interesting.~^";
0213         ],
0214         react_before
0215         [;  Take, Remove: print "~Subject feels lack of ", (the) noun,
0216                 ". Suppressed Oedipal complex? Mmm.~^";
0217         ],
0218    has  animate;
0219   
0220  Object -> "mantelpiece"
0221    with name "mantel" "mantle" "piece" "mantelpiece"
0222    has  scenery supporter;
0223   
0224  Object -> "green ball" with name "green" "ball";
0225  Object -> "red cone" with name "red" "cone";
0226  Object -> "blue pyramid" with name "blue" "pyramid";
0227   
0228  Object -> "plain shopping bag (which can only hold 2 things)"
0229    with name "plain" "shopping" "bag", capacity 2,
0230    has  container open;
0231   
0232  Object -> "glass box with a lid" with name "glass" "box" "with" "lid"
0233    has  container transparent openable open;
0234  Object -> "steel box with a lid" with name "steel" "box" "with" "lid"
0235    has  container openable open;
0236   
0237  Key -> bolted_key "bolted key" with name "bolted";
0238   
0239  Object -> "toothed bag"
0240    with name "toothed" "bag",
0241         description "A capacious bag with a toothed mouth.",
0242         before
0243         [; LetGo: "The bag defiantly bites itself 
0244                    shut on your hand until you desist.";
0245            Close: "The bag resists all attempts to close it.";
0246         ],
0247         after
0248         [; Receive:
0249                   "The bag wriggles hideously as it swallows ",
0250                   (the) noun, ".";
0251         ],
0252    has  container open;
0253   
0254  Object -> "bolted cupboard"
0255    with name "bolted" "cupboard",
0256         describe
0257         [; if (self hasnt open)
0258                "^A pretty typical shut cupboard is bolted to one wall.";
0259            "^Bolted up on one wall is an open cupboard.";
0260         ],
0261         with_key bolted_key
0262    has  locked container openable lockable static;
0263   
0264  Object -> "portable television set"
0265    with name "tv" "television" "set" "portable",
0266         initial "A portable television set has two sub-objects attached: 
0267                  a power button and a screen.",
0268         before
0269         [;  SwitchOn: <<SwitchOn power_button>>;
0270             SwitchOff: <<SwitchOff power_button>>;
0271             Examine: <<Examine screen>>;
0272         ],
0273    has  transparent;
0274  Object -> -> power_button "power button"
0275    with name "power" "button" "switch",
0276         after
0277         [;  SwitchOn, SwitchOff: <<Examine screen>>;
0278         ],
0279    has  switchable;
0280  Object -> -> screen "television screen"
0281    with name "screen",
0282         before
0283         [;  Examine: if (power_button hasnt on) "The screen is black.";
0284                 "The screen writhes with a strange Japanese cartoon.";
0285         ];
0286   
0287  Object -> "macrame bag"
0288    with name "macrame" "bag" "string" "net" "sack",
0289         react_before
0290         [;  Examine, Search, Listen, Smell: ;
0291             default:
0292                 if (inp1>1 && inp1 in self)
0293                     print_ret (The) inp1, " is tucked away in the bag.";
0294                 if (inp2>1 && inp2 in self)
0295                     print_ret (The) inp2, " is tucked away in the bag.";
0296         ],
0297         describe
0298         [;  print "^A macrame bag hangs from the ceiling, shut tight";
0299             if (child(self)==0) ".";
0300             print ". Inside you can make out ";
0301             WriteListFrom(child(self), ENGLISH_BIT); ".";
0302         ],
0303    has  container transparent static;
0304  Object -> -> "music box"
0305    with name "music" "box" "musical",
0306         description "Attractively lacquered.",
0307         react_before
0308         [;  Listen: if (noun==0 or self)
0309                "The musical box chimes some Tchaikovsky."; ];
0310   
0311  ! --------------------------------------------------------------------------
0312   
0313  Object Corridor12 "Corridor 12"
0314    with description
0315            "Runs south of the foyer. A side exit leads @01 to Room 15, 
0316             the manuscripts room.",
0317         n_to Foyer, s_to Oak_Door, w_to Room15,
0318    has  light;
0319   
0320  Object -> "sinister curator"
0321    with name "sinister" "curator",
0322         initial
0323         [;  if (self hasnt general)
0324                "A sinister curator leans against the wall, asleep.";
0325            "The curator is here, casting menacing looks.";
0326         ],
0327         daemon
0328         [ i p j n k;
0329             if (random(3)~=1 || self hasnt general) rfalse;
0330             p=parent(self);
0331             objectloop (i in compass)
0332             {   j=p.(i.door_dir);
0333                 if (ZRegion(j)==1 && j hasnt door) n++;
0334             }
0335             if (n==0) rfalse;
0336             k=random(n); n=0;
0337             objectloop (i in compass)
0338             {   j=p.(i.door_dir);
0339                 if (ZRegion(j)==1 && j hasnt door) n++;
0340                 if (n==k)
0341                 {   move self to j;
0342                     if (p==location) "^The curator stalks away.";
0343                     if (j==location) "^The curator stalks in.";
0344                     rfalse;
0345                 }
0346             }
0347         ],
0348         orders
0349         [;  if (self hasnt general) "The curator only snores.";
0350            "He raises a skeletal finger to his lips. ~Shh!~";
0351         ],
0352         life
0353         [;  WakeOther:
0354                 if (self hasnt general)
0355                 {   give self general; move self to Foyer;
0356                    "He wakes and rouses to his feet, pushes past you 
0357                     and stalks away.";
0358                 }
0359             default: "He rears back with disdain.";
0360         ],
0361    has  animate;
0362   
0363  Object Oak_Door "oaken door"
0364    with name "oak" "door" "oaken",
0365         description "Despite appearances, there is no key to this door.",
0366         door_dir
0367         [; if (location==Corridor12) return s_to; return n_to; ],
0368         door_to
0369         [; if (location==Corridor12) return Room13; return Corridor12; ],
0370         describe
0371         [; if (self has open) "^The oaken door stands open.";
0372            if (self hasnt locked) "^The corridor ends in an oaken door.";
0373         ],
0374         found_in  Corridor12  Room13
0375    has  static door openable lockable;
0376   
0377  ! --------------------------------------------------------------------------
0378   
0379  Object Room15 "Manuscripts Room"
0380    with description
0381            "This is Room 15, adjoining a corridor to the @00.",
0382         e_to Corridor12,
0383    has  light;
0384   
0385  Object -> "black Tyndale Bible"
0386    with name "bible" "black" "book",
0387         initial "A black Bible rests on a spread-eagle lectern.",
0388         description "A splendid foot-high Bible, which must have survived 
0389             the burnings of 1520.",
0390         before
0391         [ w x; Consult:
0392                 wn = consult_from; w = NextWord();
0393                 switch(w)
0394                 {   'matthew': x="Gospel of St Matthew";
0395                     'mark': x="Gospel of St Mark";
0396                     'luke': x="Gospel of St Luke";
0397                     'john': x="Gospel of St John";
0398                     default: "There are only the four Gospels.";
0399                 }
0400                 if (consult_words==1)
0401                     "You read the ", (string) x, " right through.";
0402                 w = TryNumber(wn);
0403                 if (w==-1000)
0404                     "I was expecting a chapter number in the ",
0405                               (string) x, ".";
0406                 "Chapter ", (number) w, " of the ", (string) x,
0407                       " is too sacred for you to understand now.";
0408         ];
0409   
0410  ! --------------------------------------------------------------------------
0411   
0412  Object Room13 "Switches Hall"
0413    with description
0414            "This is Room 13, at the south end of a long corridor leading 
0415             north. Progress further south is blocked by a chasm.",
0416         n_to Oak_Door, s_to PlankBridge,
0417    has  light;
0418   
0419  Object -> "Gotham City searchlight"
0420    with name "gotham" "city" "search" "light" "template" "searchlight",
0421         article "the",
0422         description "It has some kind of template on it.",
0423         when_on "The old city searchlight shines out a bat against 
0424                  the alabaster ceiling of the Museum.",
0425         when_off "The old Gotham city searchlight has been lovingly 
0426                  restored and housed here."
0427    has  switchable static;
0428   
0429  Object -> "basement light switch"
0430    with name "basement" "light" "switch",
0431         after
0432         [;  SwitchOn: give basement light; "Click!";
0433             SwitchOff: give basement ~light; "Click!";
0434         ],
0435    has  switchable static;
0436   
0437  Object -> PlankBridge "plank bridge"
0438    with description "Extremely fragile and precarious.",
0439         name "precarious" "fragile" "wooden" "plank" "bridge",
0440         when_open
0441             "A precarious plank bridge spans the chasm.",
0442         door_to
0443         [;  if (children(player)~=0)
0444              {   deadflag=1;
0445                 "You step gingerly across the plank, which bows under 
0446                  your weight. But your meagre possessions are the straw 
0447                  which breaks the camel's back! There is a horrid crack...";
0448              }
0449              print "You step gingerly across the plank, grateful that 
0450                     you're not burdened.^";
0451             if (location==Room13) return FarSide; return Room13;
0452         ],
0453         door_dir
0454         [;  if (location==Room13) return s_to; return n_to;
0455         ],
0456         found_in Room13 FarSide,
0457    has  static door open;
0458   
0459  Object FarSide "Far Side of Chasm in Room 13"
0460    with description
0461            "This side of the chasm is dull and dusty after all.",
0462         n_to PlankBridge,
0463    has  light;
0464   
0465  ! --------------------------------------------------------------------------
0466   
0467  Object Room14 "Large Exhibits Room"
0468    with description
0469            "This is Room 14, @01 of the foyer, which gives onto the Weights 
0470             Room to the north.",
0471         e_to Foyer, n_to Weights_Room,
0472    has  light;
0473   
0474  Object -> "hypnotic portrait"
0475    with name "hypnotic" "portrait" "warthog" "picture" "of" "hog",
0476         initial "A somewhat hypnotic full-length portrait of a warthog hangs 
0477             on the wall.",
0478         before
0479         [;  Examine: <Examine hog>; print "^...and somehow, so do you...^";
0480                 ChangePlayer(hog); <<Look>>;
0481         ],
0482    has  static;
0483   
0484  Object -> "Louis XV chair"
0485    with name "louis" "xv" "quinze" "chair",
0486         initial "A valuable Louis XV chair takes pride of place.",
0487    has  enterable supporter;
0488   
0489  Object -> car "little red car"
0490    with name "little" "red" "car" "kar1",
0491         description "Large enough to sit inside. Among the controls is a 
0492                   prominent on/off switch. The numberplate is KAR 1.",
0493         when_on  "The red car sits here, its engine still running.",
0494         when_off "A little red car is parked here.",
0495         before
0496         [; PushDir: AllowPushDir(); rtrue;
0497            Go: if (car has on) { Achieved(1); "Brmm! Brmm!"; }
0498                print "(The ignition is off at the moment.)^";
0499         ],
0500         after
0501         [; PushDir: "The car rolls very slowly as you push it.";
0502         ],
0503    has  switchable enterable static container open;
0504   
0505  Object -> -> "small note"
0506    with name "small" "note",
0507         description
0508             "  !!!! FROBOZZ MAGIC CAR COMPANY !!!!^
0509             ^Hello, Driver!^
0510             ^Instructions for use:^
0511             ^Switch on the ignition and off you go!^
0512             ^Warranty:^
0513             ^This car is guaranteed against all defects for a period of 
0514              76 milliseconds from date of purchase or until used, 
0515              whichever comes first.^
0516             ^Good Luck!";
0517   
0518  Object -> "Giant"
0519    with name "giant",
0520         initial "A Giant is here. (And you know the old legend... push a 
0521             Giant, become a Giant!)",
0522         before
0523         [;  Push: ChangePlayer(self); <<Look>>;
0524             Take: rtrue;
0525         ],
0526         number 0,
0527         orders
0528         [;  if (player==self)
0529             {   if (actor~=self)
0530                    "You only become tongue-tied and gabble.";
0531                 if (action==##Push && noun==selfobj)
0532                 {   ChangePlayer(selfobj); <<Look>>; }
0533                 rfalse;
0534             }
0535             Attack: "The Giant looks at you with doleful eyes. 
0536                      ~Me not be so bad!~";
0537             default: "The Giant is unable to comprehend your instructions.";
0538         ],
0539    has  animate;
0540   
0541   
0542  ! --------------------------------------------------------------------------
0543   
0544  Object "Caldera"
0545    with description
0546            "An old volcanic crater of mud and ash, from which there is 
0547             nowhere to go.",
0548    has  light;
0549   
0550  Object -> hog "Warthog"
0551    with name "wart" "hog" "warthog",
0552         description "Muddy, sniffing and grunting.",
0553         number,
0554         orders
0555         [;  if (player~=self || actor~=self) rfalse;
0556   
0557             ! So now we have just the case where the player
0558             ! is currently the warthog, ordering himself about:
0559   
0560             Go, Look, Examine, Eat, Smell, Taste, Touch: rfalse;
0561             default: "Warthogs can't do anything as tricky as that!";
0562         ],
0563    has  animate proper;
0564   
0565  Object -> "red berry"
0566    with name "red" "berry" "magic",
0567         initial "A magic red berry is half-uncovered in the mud.",
0568         before
0569         [;  Smell, Taste, Touch:
0570                 print "The blood-smell of the berry brings you back, 
0571                      back...^";
0572                  ChangePlayer(selfobj); <<Look>>;
0573         ];
0574   
0575  ! --------------------------------------------------------------------------
0576   
0577  Constant CARRYING_STRENGTH = 500;
0578  Constant HEAVINESS_THRESHOLD = 100;
0579   
0580  Object Weights_Room "Weights Room"
0581    with description
0582            "This is an annexe, south of Room 14. In here (though nowhere 
0583             else) objects have given weights, and 
0584             you can carry only a limited total weight. (Items from elsewhere 
0585             in the museum all weigh 10 zobs, regardless of what they are.)
0586             The longer you carry heavy objects, the more tired you become,
0587             until you're forced to drop them; your strength recovers once
0588             you're carrying only a light load.",
0589         initial [; weight_monitor.activate(); ],
0590         s_to Room14,
0591    has  light;
0592   
0593  Object -> "feather" with name "feather", weight 1;
0594  Object -> "iron anvil" with name "iron" "anvil", article "an", weight 300;
0595  Object -> "five-zob weight" with name "five" "zob" "weight", weight 5;
0596  Object -> "ten-zob weight" with name "ten" "zob" "weight", weight 10;
0597  Object -> "twenty-zob weight" with name "twenty" "zob" "weight", weight 20;
0598  Object -> "fifty-zob weight" with name "fifty" "zob" "weight", weight 50;
0599  Object -> "hundred-zob weight" with name "hundred" "zob" "weight", weight 100;
0600   
0601  [ WeightOf obj t i;
0602     t = obj.weight;
0603     objectloop (i in obj) t = t + WeightOf(i);
0604     return t;
0605  ];
0606   
0607  Object weight_monitor
0608    with
0609         players_strength,
0610         warning_level 5,
0611   
0612         activate
0613         [;  self.players_strength = CARRYING_STRENGTH; StartDaemon(self);
0614         ],
0615         daemon
0616         [ w s b bw;
0617              if (location ~= Weights_Room) { StopDaemon(self); return; }
0618   
0619              s = self.players_strength
0620                  - WeightOf(player) + HEAVINESS_THRESHOLD;
0621              if (s<0) s=0; if (s>CARRYING_STRENGTH) s=CARRYING_STRENGTH;
0622              self.players_strength = s;
0623   
0624              if (s==0)
0625              {   bw=-1;
0626                  objectloop(b in player)
0627                      if (WeightOf(b) > bw) { bw = WeightOf(b); w=b; }
0628                  self.players_strength = self.players_strength + bw;
0629                  print "^Exhausted with carrying so much, you decide 
0630                      to discard ", (the) w, ": "; <<Drop w>>;
0631              }
0632   
0633              w=s/100; if (w==self.warning_level) return;
0634   
0635              self.warning_level = w;
0636              switch(w)
0637              {   3: "^You are feeling a little tired.";
0638                  2: "^You possessions are weighing you down.";
0639                  1: "^Carrying so much weight is wearing you out.";
0640                  0: "^You're nearly exhausted enough to drop everything
0641                       at an inconvenient moment.";
0642              }
0643         ];
0644   
0645  ! --------------------------------------------------------------------------
0646   
0647  Constant SUNRISE  360;  ! i.e., 6 am
0648  Constant SUNSET  1140;  ! i.e., 7 pm
0649  Global day_state = 2;
0650   
0651  Object balcony "Balcony"
0652    with description
0653         [;  print "An open-air balcony on the cliffside wall of the 
0654                 cathedral-like Museum, hundreds of feet above ";
0655             if (day_state==1) "sunlit plains of farms and settlements.";
0656             "a darkling plain. Dim light from the walls above is 
0657              the only beacon in this vast night.";
0658         ],
0659         in_to Foyer,
0660         cant_go "The only way is back inside.",
0661         each_turn
0662         [ f;
0663             if (the_time >= SUNRISE && the_time < SUNSET) f=1;
0664             if (day_state == f) return;
0665             if (day_state==2) { day_state = f; return; }
0666             day_state = f;
0667             if (f==1) "^The sun rises, illuminating the landscape!";
0668           "^As the sun sets, the landscape is plunged into darkness.";
0669         ],
0670    has  light;
0671   
0672  Object -> "giant clock"
0673    with name "giant" "clock" "face" "clockface" "clock-face",
0674         before
0675         [;  Examine: "According to the giant clockface on the wall 
0676                 above, it is now ", the_time/60, ":", (the_time%60)/10,
0677                 the_time%10, ".";
0678             default: "The giant clock-face is too high above you.";
0679         ],
0680         react_after [; Look: new_line; <Examine self>; ],
0681    has  static concealed;
0682   
0683  Object -> moth "moth"
0684    with name "moth",
0685         initial "A catchable moth flits about.";
0686   
0687  [ GoMothGo;
0688     if (moth in player)
0689     {   remove moth;
0690        "As your eyes try to adjust, you feel a ticklish sensation 
0691         and hear a tiny fluttering sound.";
0692     }
0693  ];
0694   
0695  Object -> "Commander Data"
0696    with name "data" "commander",
0697         orders
0698         [; "~I regret that I am only here to make an example work elsewhere. 
0699              Please proceed upstairs to 10 Forward to see.~";
0700         ],
0701    has  proper animate crewmember;
0702   
0703  ! ==========================================================================
0704   
0705  Object Second_Floor "Mezzanine"
0706    with description
0707            "Halfway up the marble staircase of the building, a second floor 
0708             mezzanine which leads south into Grammar Hall (an extension 
0709             purpose-built for the Room 16 exhibition).",
0710         d_to Foyer,
0711         s_to Grammar_Hall,
0712         u_to Third_Floor,
0713    has  light;
0714   
0715  Object -> "map"
0716    with name "map" "mezzanine" "level",
0717         initial "A map of the mezzanine level is embossed in one wall.",
0718         description
0719         [;  font off;
0720             print
0721            "^+------------------------------------------+
0722             ^|                                          |
0723             ^|                                          |
0724             ^|                                          |
0725             ^|                                          |
0726             ^|               Mezzanine                  |
0727             ^|             (you are here)               |
0728             ^|                   |                      |
0729             ^|                   |                      |
0730             ^|             Grammar Hall 16              |
0731             ^|       (telepathy, clock)                 |
0732             ^|       (Charlotte, Dan)   --- Ten Forward |
0733             ^|                   |         (replicator) |
0734             ^|               Liberator     (computer)   |
0735             ^|                Bridge       (tricorder)  |
0736             ^|                 (Zen)                    |
0737             ^+------------------------------------------+^";
0738             font on;
0739         ],
0740    has  static;
0741   
0742  Object -> "Room 16 exhibition leaflet"
0743    with name "leaflet" "exhibition" "guide" "room" "sixteen",
0744         initial "An exhibition leaflet has fallen to the floor.",
0745         description
0746            "Among the rare & fascinating exhibits in Room 16 are:...^^
0747             Telekinetic (and telepathic) Martha. In the telepathy
0748             booth, you can speak to her as though she were in Room 16
0749             with you -- but she's not, she is far away. Tell her to
0750             ~look~ to find out where, and you can also ask her to give
0751             you things (by telekinesis).^^
0752             Charlotte, who is playing Simon Says. She'll obey
0753             instructions you give as long as you preface it with
0754             ~simon says~. (Though she only knows how to wave, or how to
0755             clap many times (just tell her a number).)^^
0756             Dyslexic Dan knows how to take and drop things and how to
0757             perform an inventory, but unfortunately confuses Take and
0758             Drop orders.^^
0759             The alarm clock can be told ~on~, ~off~ or a time of day
0760             (to set its alarm to).";
0761             
0762  ! --------------------------------------------------------------------------
0763   
0764  Object Grammar_Hall "Grammar Hall"
0765    has  light,
0766    with description
0767            "The main exhibit on the second floor: Room 16, south of the 
0768             mezzanine. A Jeffreys Tube runs @00 into a Star Trek: The
0769             Next Generation room, while a hexagonal corridor to the south
0770             leads to the bridge of the spaceship ~Liberator~.",
0771         n_to Second_Floor, e_to Star_Trek, s_to Blakes_Seven;
0772   
0773  Object -> booth "telepathy booth"
0774    with name "booth" "telepathy",
0775         initial
0776            "A telepathy booth stands invitingly open: 
0777             ~Talk To Telekinetic Martha~.",
0778    has  enterable static;
0779   
0780  Object -> "Charlotte"
0781    with name "charlotte" "charlie" "chas",
0782         number 0,
0783         grammar
0784         [;  give self ~general;
0785             wn=verb_wordnum;
0786             if (NextWord()=='simon' && NextWord()=='says')
0787             {   give self general;
0788                 verb_wordnum=verb_wordnum+2;
0789             }
0790             self.number=TryNumber(verb_wordnum);
0791             if (self.number~=-1000)
0792             {    action=##Clap; noun=0; second=0; rtrue; }
0793         ],
0794         orders
0795         [ i;  if (self hasnt general) "Charlotte sticks her tongue out.";
0796             WaveHands: "Charlotte waves energetically.";
0797             Clap: if (self.number==0) "Charlotte folds her arms.";
0798                   for (i=0:i<self.number:i++)
0799                   {   print "Clap! ";
0800                       if (i==100)
0801                           print "(You must be regretting this by now.) ";
0802                       if (i==200)
0803                           print "(What a determined girl she is.) ";
0804                   }
0805                   if (self.number>100)
0806                       "^^Charlotte's a bit out of breath now.";
0807                  "^^~Easy!~ says Charlotte.";
0808             default: "~Don't know how,~ says Charlotte.";
0809         ],
0810         initial "Charlotte wants to play Simon Says.",
0811    has  animate female proper crewmember;
0812   
0813  Object -> "Dyslexic Dan"
0814    with name "dan" "dyslexic",
0815         grammar
0816         [;  if (verb_word == 'take') { verb_wordnum++; return 'drop'; }
0817             if (verb_word == 'drop') { verb_wordnum++; return 'take'; }
0818         ],
0819         orders
0820         [;
0821             Take: "~What,~ says Dan, ~ you want me to take ",
0822                       (the) noun, "?~";
0823             Drop: "~What,~ says Dan, ~ you want me to drop ",
0824                       (the) noun, "?~";
0825             Inv: "~That I can do,~ says Dan. ~I'm empty-handed.~";
0826             default: "~Don't know how,~ says Dan.";
0827         ],
0828         initial "Dyslexic Dan is here.",
0829    has  animate proper crewmember;
0830   
0831  [ PrintTime x;
0832    print (x/60), ":", (x%60)/10, (x%60)%10;
0833  ];
0834   
0835  Object -> "alarm clock"
0836    with name "alarm" "clock", article "an",
0837         number 480,
0838         description
0839         [;  print "The alarm is ";
0840             if (self has general) print "on, "; else print "off, but ";
0841             "the clock reads ", (PrintTime) the_time,
0842             " and the alarm is set for ", (PrintTime) self.number, ".";
0843         ],
0844         react_after
0845         [;  Inv:  if (self in player)   { new_line; <<Examine self>>; }
0846             Look: if (self in location) { new_line; <<Examine self>>; }
0847         ],
0848         daemon
0849         [;  if (the_time >= self.number && the_time <= self.number+3
0850                 && self has general) "^Beep! Beep! The alarm goes off.";
0851         ],
0852         grammar
0853         [;  return 'alarm,';
0854         ],
0855         orders
0856         [;  SwitchOn: give self general; StartDaemon(self); "~Alarm set.~";
0857             SwitchOff: give self ~general; StopDaemon(self);
0858                 "~Alarm cancelled.~";
0859             SetTo:   self.number=noun; <<Examine self>>;
0860             default: "~Commands are on, off or a time of day only, pliz.~";
0861         ],
0862         life
0863         [;  Ask, Answer, Tell:
0864             "[Try ~clock, something~ to address the clock.]";
0865         ],
0866    has  talkable;
0867   
0868  ! --------------------------------------------------------------------------
0869   
0870  Object Blakes_Seven "Spaceship Liberator: Bridge"
0871    has  light,
0872    with description
0873            "The great serried bridge of the alien spaceship Liberator,
0874             captured by Blake's group of revolutionary criminals on the
0875             run from the oppressive Earth Federation.  (Don't worry --
0876             it's just a convincing replica, and the museum still lies
0877             back north.)",
0878         n_to Grammar_Hall;
0879   
0880  Object -> "informative plaque"
0881    with name "informative" "plaque",
0882         article "an",
0883         description
0884            "[Among the commands which Zen was often given by the hard-pressed
0885             Liberator crew were:^^
0886             zen, scan 360 orbital^
0887             zen, speed standard by six^
0888             zen, clear the neutron blasters for firing^
0889             zen, raise the force wall^
0890             zen, set course for centauro]",
0891    has  static;
0892   
0893  Object -> "Zen"
0894    with name "zen" "flight" "computer",
0895         initial
0896            "Square lights flicker unpredictably across a hexagonal fascia 
0897             on one wall, indicating that the flight computer Zen is on-line.",
0898         grammar
0899         [;  return -'zen,';
0900         ],
0901         orders
0902         [;  Show: "The main screen shows a starfield, 
0903                    turning through ", noun, " degrees.";
0904             Go:  "~Confirmed.~  The ship turns to a new bearing.";
0905             SetTo: if (noun==0) "~Confirmed.~  The ship comes to a stop.";
0906                 if (noun>12) "~Standard by ", (number) noun,
0907                              " exceeds design tolerances.~";
0908                 "~Confirmed.~  The ship's engines step to 
0909                  standard by ", (number) noun, ".";
0910             Take: if (noun~=force_wall) "~Please clarify.~";
0911                  "~Force wall raised.~";
0912             Drop: if (noun~=blasters)   "~Please clarify.~";
0913                "~Battle-computers on line. 
0914                  Neutron blasters cleared for firing.~";
0915             NotUnderstood: "~Language banks unable to decode.~";
0916             default: "~Information. That function is unavailable.~";
0917         ],
0918    has  talkable proper static;
0919  Object -> -> force_wall "force wall"     with name "force" "wall" "shields";
0920  Object -> -> blasters "neutron blasters" with name "neutron" "blasters";
0921   
0922  ! --------------------------------------------------------------------------
0923   
0924  Object "Captain Picard"
0925    with name "captain" "picard",
0926    has  proper animate crewmember;
0927   
0928  Object Star_Trek "10 Forward"
0929    has  light,
0930    with description
0931            "The starswept observation lounge forward of deck 10
0932             of the Starship Enterprise, where many milkshakes have
0933             been consumed in crisis situations. (It's only a replica,
0934             of course, and the museum lies back @01.)",
0935         w_to Grammar_Hall;
0936   
0937  Object -> "informative plaque"
0938    with name "informative" "plaque",
0939         article "an",
0940         description
0941            "[The computer, called just ~computer~, is useful for locating
0942             crew-members: try ~computer, where is commander data~, or
0943             ~...captain picard~, or any of the other people who can be
0944             found in the Museum.^^
0945             The tricorder will scan something if you tell it the name of
0946             whom or what you wish to scan.^^
0947             The replicator is a superior drinks machine: for instance,
0948             Captain Picard is fond of saying ~replicator, tea earl grey~.
0949             There's also brandy and distilled water.]",
0950    has  static;
0951   
0952  Object -> "computer"
0953    with name "computer",
0954         initial "The computer, of course, always responds to your voice here.",
0955         grammar
0956         [;  return 'stc,';
0957         ],
0958         orders
0959         [;  Examine:
0960                 if (parent(noun)==0)
0961                     "~", (name) noun,
0962                     " is no longer aboard this demonstration game.~";
0963                 "~", (name) noun, " is in ", (name) parent(noun), ".~";
0964             default: "The computer's only really good for locating the crew.";
0965         ],
0966         life
0967         [;  Ask, Answer, Tell: "The computer is too simple.";
0968         ],
0969    has  talkable static;
0970   
0971  Object -> "tricorder"
0972    with name "tricorder",
0973         grammar
0974         [;  return 'tc,';
0975         ],
0976         orders
0977         [;  Examine: if (noun==player) "~You radiate life signs.~";
0978                 print "~", (The) noun, " radiates ";
0979                 if (noun hasnt animate) print "no ";
0980                "life signs.~";
0981             default: "The tricorder bleeps. It can only accept commands 
0982                 ~tricorder, 
  
    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.