1
! ----------------------------------------------------------------------------
2
! Museum 961111 One of the standard Inform 6 example games
5
! translated to Inform 6: 11.11.96
7
! This "game" is a compendium of solved exercises from the Designer's
8
! Manual. Room numbers are section numbers within the Third Edition.
9
! Many of these exercises are difficult, and so is some of the code below.
10
! ----------------------------------------------------------------------------
12
Constant Story "MUSEUM OF INFORM";
14
"^An Interactive Companion to the Designer's Manual (Third Edition)^";
16
! The game is meant to be experimented with, so we always define:
22
Replace DrawStatusLine;
25
! --------------------------------------------------------------------------
27
Object samples_bag "samples bag"
28
with description "A capacious SACK_OBJECT (see section 20).",
29
name "samples" "bag", article "your",
30
when_closed "Your samples bag lies on the floor.",
31
when_open "Your samples bag lies open on the floor.",
32
has container open openable;
34
Constant SACK_OBJECT = samples_bag;
38
! --------------------------------------------------------------------------
44
Class Key with name "key";
46
! --------------------------------------------------------------------------
51
"The foyer of the magnificent Museum of Inform. A flight of
52
stairs sweeps upward to Chapters V and VI, and corridors
53
fan out on this level into Chapter IV. These run:^
54
^ north into Room 10 (the Halls of Sense and Direction),
55
^ south along Corridor 12 (doors) to Room 13 (switches),
56
^ @00 to Room 11 (the Wonderful World of Containers)
57
^ and @01 to Room 14 (which houses larger exhibits).^^
58
(And a plain ladder descends into the basement; you can also
59
step out onto a balcony.)",
60
e_to Room11, u_to Second_Floor, n_to Room10,
61
s_to Corridor12, w_to Room14,
62
d_to basement, out_to balcony;
65
with name "map" "ground" "floor",
66
initial "A map of the ground floor is embossed in one wall.",
70
"^+------------------------------------------+
72
^| Weights Room 10 --- Room 10a |
73
^| Room senses directions |
75
^| Room 14 --- Foyer --- Room 11 |
76
^| (changing (you are here) containers |
79
^| Room 15 --- Corridor 12 |
80
^| (MS room) (door, curator) |
85
^| Far Side of Room 13 |
86
^+------------------------------------------+^";
91
! --------------------------------------------------------------------------
93
Object basement "Museum Basement"
96
"Once Room 17, this space has been abandoned by the curators,
97
who have simply sprayed its walls with moth-repellent and
100
[; Smell: "Napthalene.";
103
! --------------------------------------------------------------------------
105
Object Room10 "Hall of Senses"
107
"This is Room 10, north of the foyer. If you try going further
108
north, a string will be printed instead. The exit to the @00
109
has a routine attached, and randomly leads either to the
110
Directions Room or back to the foyer.",
112
n_to "This string is the ~n_to~ value for this room.",
114
[; if (random(2)==1) return Foyer; return Room10a; ],
117
Object -> "TRAP lever"
118
with name "trap" "lever",
121
if (self has on) <<SwitchOff self>>;
125
[; SwitchOn: move orange_cloud to location;
126
"Clunk! An orange cloud suddenly descends upon you.";
127
SwitchOff: remove orange_cloud;
128
"Click! The orange cloud vanishes.";
130
has switchable static;
132
Object -> "gold watch"
133
with name "gold" "watch",
134
description "The watch has no hands, oddly.",
136
[; Listen: if (noun==0 or self) "The watch ticks loudly."; ];
138
Object -> "sprig of lavender"
139
with name "sprig" "of" "lavender",
141
[; Smell: if (noun==0 or self) "Lavender-perfume. Ahh!"; ];
143
Object orange_cloud "orange cloud"
144
with name "orange" "cloud",
146
[; Look: "You can't see for the orange cloud surrounding you.";
147
Go, Exit: "You wander round in circles, choking.";
148
Smell: if (noun==0 or self) "Cinnamon? No, nutmeg.";
152
! --------------------------------------------------------------------------
153
! For east-west reflection
154
! --------------------------------------------------------------------------
156
Lowstring east_str "east"; Lowstring west_str "west";
157
[ NormalWorld; string 0 east_str; string 1 west_str;
158
e_obj.door_dir = e_to; w_obj.door_dir = w_to;
160
[ ReversedWorld; string 0 west_str; string 1 east_str;
161
w_obj.door_dir = e_to; e_obj.door_dir = w_to;
164
Object Room10a "Hall of Directions"
167
"An annexe to Room 10: the main exit is back @01, and there's a
168
curiously misty mirror on the north wall. Also, there's an exit
169
in the fourth, ~hyper~ dimension (which is only visible in the
170
weird geometry of this room).",
172
[; move hyper to compass; StartDaemon(hyper);
176
[; print "Walking through the mirror is confusing...^";
177
if (self has general) NormalWorld(); else ReversedWorld();
178
if (self has general) give self ~general; else give self general;
181
in_to [; print "Amazing! Your body corkscrews as you pass.^";
185
Object hyper "hyper-dimensional direction"
186
with name "hyper" "fourth" "dimension", article "the", door_dir in_to,
188
[; if (location ~= Room10a) { remove self; StopDaemon(self); }
192
! --------------------------------------------------------------------------
194
Object Room11 "Wonderful World of Containers"
196
"This is Room 11, @00 of the foyer. You notice a typical piece
197
of scenery which turns out to be a supporter: a mantelpiece.",
201
Object -> "bearded psychiatrist"
202
with name "bearded" "doctor" "psychiatrist" "psychologist" "shrink",
203
initial "A bearded psychiatrist has you under observation.",
205
[; "He is fascinated by your behaviour, but makes no attempt to
209
[; Insert: print "~Subject puts ", (a) noun, " in ", (the) second,
211
PutOn: print "~Subject puts ", (a) noun, " in ", (the) second,
215
[; Take, Remove: print "~Subject feels lack of ", (the) noun,
216
". Suppressed Oedipal complex? Mmm.~^";
220
Object -> "mantelpiece"
221
with name "mantel" "mantle" "piece" "mantelpiece"
222
has scenery supporter;
224
Object -> "green ball" with name "green" "ball";
225
Object -> "red cone" with name "red" "cone";
226
Object -> "blue pyramid" with name "blue" "pyramid";
228
Object -> "plain shopping bag (which can only hold 2 things)"
229
with name "plain" "shopping" "bag", capacity 2,
232
Object -> "glass box with a lid" with name "glass" "box" "with" "lid"
233
has container transparent openable open;
234
Object -> "steel box with a lid" with name "steel" "box" "with" "lid"
235
has container openable open;
237
Key -> bolted_key "bolted key" with name "bolted";
239
Object -> "toothed bag"
240
with name "toothed" "bag",
241
description "A capacious bag with a toothed mouth.",
243
[; LetGo: "The bag defiantly bites itself
244
shut on your hand until you desist.";
245
Close: "The bag resists all attempts to close it.";
249
"The bag wriggles hideously as it swallows ",
254
Object -> "bolted cupboard"
255
with name "bolted" "cupboard",
257
[; if (self hasnt open)
258
"^A pretty typical shut cupboard is bolted to one wall.";
259
"^Bolted up on one wall is an open cupboard.";
262
has locked container openable lockable static;
264
Object -> "portable television set"
265
with name "tv" "television" "set" "portable",
266
initial "A portable television set has two sub-objects attached:
267
a power button and a screen.",
269
[; SwitchOn: <<SwitchOn power_button>>;
270
SwitchOff: <<SwitchOff power_button>>;
271
Examine: <<Examine screen>>;
274
Object -> -> power_button "power button"
275
with name "power" "button" "switch",
277
[; SwitchOn, SwitchOff: <<Examine screen>>;
280
Object -> -> screen "television screen"
283
[; Examine: if (power_button hasnt on) "The screen is black.";
284
"The screen writhes with a strange Japanese cartoon.";
287
Object -> "macrame bag"
288
with name "macrame" "bag" "string" "net" "sack",
290
[; Examine, Search, Listen, Smell: ;
292
if (inp1>1 && inp1 in self)
293
print_ret (The) inp1, " is tucked away in the bag.";
294
if (inp2>1 && inp2 in self)
295
print_ret (The) inp2, " is tucked away in the bag.";
298
[; print "^A macrame bag hangs from the ceiling, shut tight";
299
if (child(self)==0) ".";
300
print ". Inside you can make out ";
301
WriteListFrom(child(self), ENGLISH_BIT); ".";
303
has container transparent static;
304
Object -> -> "music box"
305
with name "music" "box" "musical",
306
description "Attractively lacquered.",
308
[; Listen: if (noun==0 or self)
309
"The musical box chimes some Tchaikovsky."; ];
311
! --------------------------------------------------------------------------
313
Object Corridor12 "Corridor 12"
315
"Runs south of the foyer. A side exit leads @01 to Room 15,
316
the manuscripts room.",
317
n_to Foyer, s_to Oak_Door, w_to Room15,
320
Object -> "sinister curator"
321
with name "sinister" "curator",
323
[; if (self hasnt general)
324
"A sinister curator leans against the wall, asleep.";
325
"The curator is here, casting menacing looks.";
329
if (random(3)~=1 || self hasnt general) rfalse;
331
objectloop (i in compass)
333
if (ZRegion(j)==1 && j hasnt door) n++;
337
objectloop (i in compass)
339
if (ZRegion(j)==1 && j hasnt door) n++;
342
if (p==location) "^The curator stalks away.";
343
if (j==location) "^The curator stalks in.";
349
[; if (self hasnt general) "The curator only snores.";
350
"He raises a skeletal finger to his lips. ~Shh!~";
354
if (self hasnt general)
355
{ give self general; move self to Foyer;
356
"He wakes and rouses to his feet, pushes past you
359
default: "He rears back with disdain.";
363
Object Oak_Door "oaken door"
364
with name "oak" "door" "oaken",
365
description "Despite appearances, there is no key to this door.",
367
[; if (location==Corridor12) return s_to; return n_to; ],
369
[; if (location==Corridor12) return Room13; return Corridor12; ],
371
[; if (self has open) "^The oaken door stands open.";
372
if (self hasnt locked) "^The corridor ends in an oaken door.";
374
found_in Corridor12 Room13
375
has static door openable lockable;
377
! --------------------------------------------------------------------------
379
Object Room15 "Manuscripts Room"
381
"This is Room 15, adjoining a corridor to the @00.",
385
Object -> "black Tyndale Bible"
386
with name "bible" "black" "book",
387
initial "A black Bible rests on a spread-eagle lectern.",
388
description "A splendid foot-high Bible, which must have survived
389
the burnings of 1520.",
392
wn = consult_from; w = NextWord();
394
{ 'matthew': x="Gospel of St Matthew";
395
'mark': x="Gospel of St Mark";
396
'luke': x="Gospel of St Luke";
397
'john': x="Gospel of St John";
398
default: "There are only the four Gospels.";
400
if (consult_words==1)
401
"You read the ", (string) x, " right through.";
404
"I was expecting a chapter number in the ",
406
"Chapter ", (number) w, " of the ", (string) x,
407
" is too sacred for you to understand now.";
410
! --------------------------------------------------------------------------
412
Object Room13 "Switches Hall"
414
"This is Room 13, at the south end of a long corridor leading
415
north. Progress further south is blocked by a chasm.",
416
n_to Oak_Door, s_to PlankBridge,
419
Object -> "Gotham City searchlight"
420
with name "gotham" "city" "search" "light" "template" "searchlight",
422
description "It has some kind of template on it.",
423
when_on "The old city searchlight shines out a bat against
424
the alabaster ceiling of the Museum.",
425
when_off "The old Gotham city searchlight has been lovingly
426
restored and housed here."
427
has switchable static;
429
Object -> "basement light switch"
430
with name "basement" "light" "switch",
432
[; SwitchOn: give basement light; "Click!";
433
SwitchOff: give basement ~light; "Click!";
435
has switchable static;
437
Object -> PlankBridge "plank bridge"
438
with description "Extremely fragile and precarious.",
439
name "precarious" "fragile" "wooden" "plank" "bridge",
441
"A precarious plank bridge spans the chasm.",
443
[; if (children(player)~=0)
445
"You step gingerly across the plank, which bows under
446
your weight. But your meagre possessions are the straw
447
which breaks the camel's back! There is a horrid crack...";
449
print "You step gingerly across the plank, grateful that
450
you're not burdened.^";
451
if (location==Room13) return FarSide; return Room13;
454
[; if (location==Room13) return s_to; return n_to;
456
found_in Room13 FarSide,
457
has static door open;
459
Object FarSide "Far Side of Chasm in Room 13"
461
"This side of the chasm is dull and dusty after all.",
465
! --------------------------------------------------------------------------
467
Object Room14 "Large Exhibits Room"
469
"This is Room 14, @01 of the foyer, which gives onto the Weights
471
e_to Foyer, n_to Weights_Room,
474
Object -> "hypnotic portrait"
475
with name "hypnotic" "portrait" "warthog" "picture" "of" "hog",
476
initial "A somewhat hypnotic full-length portrait of a warthog hangs
479
[; Examine: <Examine hog>; print "^...and somehow, so do you...^";
480
ChangePlayer(hog); <<Look>>;
484
Object -> "Louis XV chair"
485
with name "louis" "xv" "quinze" "chair",
486
initial "A valuable Louis XV chair takes pride of place.",
487
has enterable supporter;
489
Object -> car "little red car"
490
with name "little" "red" "car" "kar1",
491
description "Large enough to sit inside. Among the controls is a
492
prominent on/off switch. The numberplate is KAR 1.",
493
when_on "The red car sits here, its engine still running.",
494
when_off "A little red car is parked here.",
496
[; PushDir: AllowPushDir(); rtrue;
497
Go: if (car has on) { Achieved(1); "Brmm! Brmm!"; }
498
print "(The ignition is off at the moment.)^";
501
[; PushDir: "The car rolls very slowly as you push it.";
503
has switchable enterable static container open;
505
Object -> -> "small note"
506
with name "small" "note",
508
" !!!! FROBOZZ MAGIC CAR COMPANY !!!!^
510
^Instructions for use:^
511
^Switch on the ignition and off you go!^
513
^This car is guaranteed against all defects for a period of
514
76 milliseconds from date of purchase or until used,
515
whichever comes first.^
520
initial "A Giant is here. (And you know the old legend... push a
521
Giant, become a Giant!)",
523
[; Push: ChangePlayer(self); <<Look>>;
530
"You only become tongue-tied and gabble.";
531
if (action==##Push && noun==selfobj)
532
{ ChangePlayer(selfobj); <<Look>>; }
535
Attack: "The Giant looks at you with doleful eyes.
536
~Me not be so bad!~";
537
default: "The Giant is unable to comprehend your instructions.";
542
! --------------------------------------------------------------------------
546
"An old volcanic crater of mud and ash, from which there is
550
Object -> hog "Warthog"
551
with name "wart" "hog" "warthog",
552
description "Muddy, sniffing and grunting.",
555
[; if (player~=self || actor~=self) rfalse;
557
! So now we have just the case where the player
558
! is currently the warthog, ordering himself about:
560
Go, Look, Examine, Eat, Smell, Taste, Touch: rfalse;
561
default: "Warthogs can't do anything as tricky as that!";
565
Object -> "red berry"
566
with name "red" "berry" "magic",
567
initial "A magic red berry is half-uncovered in the mud.",
569
[; Smell, Taste, Touch:
570
print "The blood-smell of the berry brings you back,
572
ChangePlayer(selfobj); <<Look>>;
575
! --------------------------------------------------------------------------
577
Constant CARRYING_STRENGTH = 500;
578
Constant HEAVINESS_THRESHOLD = 100;
580
Object Weights_Room "Weights Room"
582
"This is an annexe, south of Room 14. In here (though nowhere
583
else) objects have given weights, and
584
you can carry only a limited total weight. (Items from elsewhere
585
in the museum all weigh 10 zobs, regardless of what they are.)
586
The longer you carry heavy objects, the more tired you become,
587
until you're forced to drop them; your strength recovers once
588
you're carrying only a light load.",
589
initial [; weight_monitor.activate(); ],
593
Object -> "feather" with name "feather", weight 1;
594
Object -> "iron anvil" with name "iron" "anvil", article "an", weight 300;
595
Object -> "five-zob weight" with name "five" "zob" "weight", weight 5;
596
Object -> "ten-zob weight" with name "ten" "zob" "weight", weight 10;
597
Object -> "twenty-zob weight" with name "twenty" "zob" "weight", weight 20;
598
Object -> "fifty-zob weight" with name "fifty" "zob" "weight", weight 50;
599
Object -> "hundred-zob weight" with name "hundred" "zob" "weight", weight 100;
603
objectloop (i in obj) t = t + WeightOf(i);
607
Object weight_monitor
613
[; self.players_strength = CARRYING_STRENGTH; StartDaemon(self);
617
if (location ~= Weights_Room) { StopDaemon(self); return; }
619
s = self.players_strength
620
- WeightOf(player) + HEAVINESS_THRESHOLD;
621
if (s<0) s=0; if (s>CARRYING_STRENGTH) s=CARRYING_STRENGTH;
622
self.players_strength = s;
626
objectloop(b in player)
627
if (WeightOf(b) > bw) { bw = WeightOf(b); w=b; }
628
self.players_strength = self.players_strength + bw;
629
print "^Exhausted with carrying so much, you decide
630
to discard ", (the) w, ": "; <<Drop w>>;
633
w=s/100; if (w==self.warning_level) return;
635
self.warning_level = w;
637
{ 3: "^You are feeling a little tired.";
638
2: "^You possessions are weighing you down.";
639
1: "^Carrying so much weight is wearing you out.";
640
0: "^You're nearly exhausted enough to drop everything
641
at an inconvenient moment.";
645
! --------------------------------------------------------------------------
647
Constant SUNRISE 360; ! i.e., 6 am
648
Constant SUNSET 1140; ! i.e., 7 pm
649
Global day_state = 2;
651
Object balcony "Balcony"
653
[; print "An open-air balcony on the cliffside wall of the
654
cathedral-like Museum, hundreds of feet above ";
655
if (day_state==1) "sunlit plains of farms and settlements.";
656
"a darkling plain. Dim light from the walls above is
657
the only beacon in this vast night.";
660
cant_go "The only way is back inside.",
663
if (the_time >= SUNRISE && the_time < SUNSET) f=1;
664
if (day_state == f) return;
665
if (day_state==2) { day_state = f; return; }
667
if (f==1) "^The sun rises, illuminating the landscape!";
668
"^As the sun sets, the landscape is plunged into darkness.";
672
Object -> "giant clock"
673
with name "giant" "clock" "face" "clockface" "clock-face",
675
[; Examine: "According to the giant clockface on the wall
676
above, it is now ", the_time/60, ":", (the_time%60)/10,
678
default: "The giant clock-face is too high above you.";
680
react_after [; Look: new_line; <Examine self>; ],
681
has static concealed;
683
Object -> moth "moth"
685
initial "A catchable moth flits about.";
690
"As your eyes try to adjust, you feel a ticklish sensation
691
and hear a tiny fluttering sound.";
695
Object -> "Commander Data"
696
with name "data" "commander",
698
[; "~I regret that I am only here to make an example work elsewhere.
699
Please proceed upstairs to 10 Forward to see.~";
701
has proper animate crewmember;
703
! ==========================================================================
705
Object Second_Floor "Mezzanine"
707
"Halfway up the marble staircase of the building, a second floor
708
mezzanine which leads south into Grammar Hall (an extension
709
purpose-built for the Room 16 exhibition).",
716
with name "map" "mezzanine" "level",
717
initial "A map of the mezzanine level is embossed in one wall.",
721
"^+------------------------------------------+
731
^| (telepathy, clock) |
732
^| (Charlotte, Dan) --- Ten Forward |
734
^| Liberator (computer) |
735
^| Bridge (tricorder) |
737
^+------------------------------------------+^";
742
Object -> "Room 16 exhibition leaflet"
743
with name "leaflet" "exhibition" "guide" "room" "sixteen",
744
initial "An exhibition leaflet has fallen to the floor.",
746
"Among the rare & fascinating exhibits in Room 16 are:...^^
747
Telekinetic (and telepathic) Martha. In the telepathy
748
booth, you can speak to her as though she were in Room 16
749
with you -- but she's not, she is far away. Tell her to
750
~look~ to find out where, and you can also ask her to give
751
you things (by telekinesis).^^
752
Charlotte, who is playing Simon Says. She'll obey
753
instructions you give as long as you preface it with
754
~simon says~. (Though she only knows how to wave, or how to
755
clap many times (just tell her a number).)^^
756
Dyslexic Dan knows how to take and drop things and how to
757
perform an inventory, but unfortunately confuses Take and
759
The alarm clock can be told ~on~, ~off~ or a time of day
760
(to set its alarm to).";
762
! --------------------------------------------------------------------------
764
Object Grammar_Hall "Grammar Hall"
767
"The main exhibit on the second floor: Room 16, south of the
768
mezzanine. A Jeffreys Tube runs @00 into a Star Trek: The
769
Next Generation room, while a hexagonal corridor to the south
770
leads to the bridge of the spaceship ~Liberator~.",
771
n_to Second_Floor, e_to Star_Trek, s_to Blakes_Seven;
773
Object -> booth "telepathy booth"
774
with name "booth" "telepathy",
776
"A telepathy booth stands invitingly open:
777
~Talk To Telekinetic Martha~.",
778
has enterable static;
780
Object -> "Charlotte"
781
with name "charlotte" "charlie" "chas",
784
[; give self ~general;
786
if (NextWord()=='simon' && NextWord()=='says')
788
verb_wordnum=verb_wordnum+2;
790
self.number=TryNumber(verb_wordnum);
791
if (self.number~=-1000)
792
{ action=##Clap; noun=0; second=0; rtrue; }
795
[ i; if (self hasnt general) "Charlotte sticks her tongue out.";
796
WaveHands: "Charlotte waves energetically.";
797
Clap: if (self.number==0) "Charlotte folds her arms.";
798
for (i=0:i<self.number:i++)
801
print "(You must be regretting this by now.) ";
803
print "(What a determined girl she is.) ";
806
"^^Charlotte's a bit out of breath now.";
807
"^^~Easy!~ says Charlotte.";
808
default: "~Don't know how,~ says Charlotte.";
810
initial "Charlotte wants to play Simon Says.",
811
has animate female proper crewmember;
813
Object -> "Dyslexic Dan"
814
with name "dan" "dyslexic",
816
[; if (verb_word == 'take') { verb_wordnum++; return 'drop'; }
817
if (verb_word == 'drop') { verb_wordnum++; return 'take'; }
821
Take: "~What,~ says Dan, ~ you want me to take ",
823
Drop: "~What,~ says Dan, ~ you want me to drop ",
825
Inv: "~That I can do,~ says Dan. ~I'm empty-handed.~";
826
default: "~Don't know how,~ says Dan.";
828
initial "Dyslexic Dan is here.",
829
has animate proper crewmember;
832
print (x/60), ":", (x%60)/10, (x%60)%10;
835
Object -> "alarm clock"
836
with name "alarm" "clock", article "an",
839
[; print "The alarm is ";
840
if (self has general) print "on, "; else print "off, but ";
841
"the clock reads ", (PrintTime) the_time,
842
" and the alarm is set for ", (PrintTime) self.number, ".";
845
[; Inv: if (self in player) { new_line; <<Examine self>>; }
846
Look: if (self in location) { new_line; <<Examine self>>; }
849
[; if (the_time >= self.number && the_time <= self.number+3
850
&& self has general) "^Beep! Beep! The alarm goes off.";
856
[; SwitchOn: give self general; StartDaemon(self); "~Alarm set.~";
857
SwitchOff: give self ~general; StopDaemon(self);
858
"~Alarm cancelled.~";
859
SetTo: self.number=noun; <<Examine self>>;
860
default: "~Commands are on, off or a time of day only, pliz.~";
863
[; Ask, Answer, Tell:
864
"[Try ~clock, something~ to address the clock.]";
868
! --------------------------------------------------------------------------
870
Object Blakes_Seven "Spaceship Liberator: Bridge"
873
"The great serried bridge of the alien spaceship Liberator,
874
captured by Blake's group of revolutionary criminals on the
875
run from the oppressive Earth Federation. (Don't worry --
876
it's just a convincing replica, and the museum still lies
880
Object -> "informative plaque"
881
with name "informative" "plaque",
884
"[Among the commands which Zen was often given by the hard-pressed
885
Liberator crew were:^^
886
zen, scan 360 orbital^
887
zen, speed standard by six^
888
zen, clear the neutron blasters for firing^
889
zen, raise the force wall^
890
zen, set course for centauro]",
894
with name "zen" "flight" "computer",
896
"Square lights flicker unpredictably across a hexagonal fascia
897
on one wall, indicating that the flight computer Zen is on-line.",
902
[; Show: "The main screen shows a starfield,
903
turning through ", noun, " degrees.";
904
Go: "~Confirmed.~ The ship turns to a new bearing.";
905
SetTo: if (noun==0) "~Confirmed.~ The ship comes to a stop.";
906
if (noun>12) "~Standard by ", (number) noun,
907
" exceeds design tolerances.~";
908
"~Confirmed.~ The ship's engines step to
909
standard by ", (number) noun, ".";
910
Take: if (noun~=force_wall) "~Please clarify.~";
911
"~Force wall raised.~";
912
Drop: if (noun~=blasters) "~Please clarify.~";
913
"~Battle-computers on line.
914
Neutron blasters cleared for firing.~";
915
NotUnderstood: "~Language banks unable to decode.~";
916
default: "~Information. That function is unavailable.~";
918
has talkable proper static;
919
Object -> -> force_wall "force wall" with name "force" "wall" "shields";
920
Object -> -> blasters "neutron blasters" with name "neutron" "blasters";
922
! --------------------------------------------------------------------------
924
Object "Captain Picard"
925
with name "captain" "picard",
926
has proper animate crewmember;
928
Object Star_Trek "10 Forward"
931
"The starswept observation lounge forward of deck 10
932
of the Starship Enterprise, where many milkshakes have
933
been consumed in crisis situations. (It's only a replica,
934
of course, and the museum lies back @01.)",
937
Object -> "informative plaque"
938
with name "informative" "plaque",
941
"[The computer, called just ~computer~, is useful for locating
942
crew-members: try ~computer, where is commander data~, or
943
~...captain picard~, or any of the other people who can be
944
found in the Museum.^^
945
The tricorder will scan something if you tell it the name of
946
whom or what you wish to scan.^^
947
The replicator is a superior drinks machine: for instance,
948
Captain Picard is fond of saying ~replicator, tea earl grey~.
949
There's also brandy and distilled water.]",
953
with name "computer",
954
initial "The computer, of course, always responds to your voice here.",
962
" is no longer aboard this demonstration game.~";
963
"~", (name) noun, " is in ", (name) parent(noun), ".~";
964
default: "The computer's only really good for locating the crew.";
967
[; Ask, Answer, Tell: "The computer is too simple.";
971
Object -> "tricorder"
972
with name "tricorder",
977
[; Examine: if (noun==player) "~You radiate life signs.~";
978
print "~", (The) noun, " radiates ";
979
if (noun hasnt animate) print "no ";
981
default: "The tricorder bleeps. It can only accept commands
982
~tricorder, <something>~.";
985
[; Ask, Answer, Tell: "The tricorder is too simple.";
989
Object -> "replicator"
990
with name "replicator",
992
"A replicator (i.e. Star Trek drinks machine) occupies a niche
999
"The replicator serves up a cup of ",
1000
(name) noun, " which you drink eagerly.";
1001
default: "The replicator is unable to oblige. You must give
1002
it the name of a drink it knows about.";
1005
[; Ask, Answer, Tell: "The replicator has no conversation skill.";
1007
has talkable static;
1008
Object -> -> "Earl Grey tea" with name "earl" "grey" "tea";
1009
Object -> -> "Aldebaran brandy" with name "aldebaran" "brandy";
1010
Object -> -> "distilled water" with name "distilled" "water";
1012
! --------------------------------------------------------------------------
1014
Object "Sealed Room"
1016
"I'm in a sealed room, like a squash court without a door,
1017
maybe six or seven yards across",
1019
Object -> "fish" with name "fish";
1020
Key -> "cadmium key"
1021
with name "cadmium",
1023
[; Drop: remove self; "The key smashes into smithereens!";
1026
Object -> martha "Martha"
1027
has animate female concealed proper crewmember
1030
[ r; r=parent(self);
1032
if (noun notin r) "~That's beyond my telekinesis.~";
1033
if (noun==self) "~Teleportation's too hard for me.~";
1034
move noun to player;
1035
"~Here goes...~ and Martha's telekinetic talents
1036
magically bring ", (the) noun, " to your hands.";
1038
print "~", (string) r.description;
1039
if (children(r)==1) ". There's nothing here but me.~";
1040
print ". I can see ";
1041
WriteListFrom(child(r),CONCEAL_BIT+ENGLISH_BIT);
1043
default: "~Afraid I can't help you there.~";
1046
[; Ask: "~You're on your own this time.~";
1047
Tell: "Martha clucks sympathetically.";
1048
Answer: "~I'll be darned,~ Martha replies.";
1051
! ==========================================================================
1053
Object Third_Floor "Third Floor"
1054
with name "trapdoor",
1056
"Atop the marble staircase, this third floor
1057
foyer fans out into Rooms from Chapter V. These run:^
1058
^ south to Corridor 22 (inventories)
1059
and the List Property Office,
1060
^ @00 to Room 24 (Curious Names),
1061
^ @01 to Room 28, which is divided by a glass window.^
1062
^Only a very rickety
1063
ladder goes further up, through an open trapdoor to the roof.",
1064
d_to Second_Floor, u_to roof,
1065
e_to Room24, w_to window_w, s_to Corridor22,
1069
with name "map" "third" "floor",
1070
initial "A map of the third floor is embossed in one wall.",
1074
"^+------------------------------------------+
1079
^| Room ! 28 --- Stairs --- Room 24 |
1080
^| ! (you are here) Names |
1087
^| Room 23 W --- Room 23 --- Room 23 E |
1088
^| (listing List Property (I Ching) |
1089
^| machine) Office |
1090
^+------------------------------------------+^";
1096
with name "lexicon",
1098
"On the top step is a discarded Lexicon of verbs.",
1100
"(The lexicon has the number 27 written on the spine.)^^
1101
Inside are many familiar verbs that you regularly use
1102
when navigating through Inform games. There are also
1103
some special ones, only available in the Museum...^^
1104
~megalook~ : like ~look~ but much fuller;^
1105
~threefold <noun> <noun> <noun>~ : this doesn't
1106
actually do anything, but it shows how a verb can
1107
be parsed which has three objects, not just 0 to 2
1109
~time <time of day>~ : sets the current time of day
1110
(go out onto the Balcony to see sunrise at 6 AM);^
1111
~fp <floating-point number>~ : shows how floating-point
1112
numbers can be parsed;^
1113
~dial <phone-style number>~ : likewise phone numbers.^^
1114
Also, in the Museum, ~lock~ and ~unlock~ are cunningly
1115
able to presume keys as their second objects.";
1117
! --------------------------------------------------------------------------
1119
Object Corridor22 "Corridor 22"
1121
"Runs south of the top floor foyer, and leads to Room 23,
1122
such a long room that you can enter it to southwest, south
1124
In the floor is a curious solid quartz window.",
1126
s_to Room23, se_to Room23b, sw_to Room23a,
1127
d_to "Solid quartz.",
1130
Object -> "quartz window"
1131
with name "quartz" "window",
1133
[; Examine, Search, LookUnder:
1134
print "Through the window you can hazily make out the contents
1135
of the Grammar Hall below...^";
1136
if (Locale(Grammar_Hall, "You can see",
1137
"You can also see")~=0)
1138
" on the floor below.";
1143
Object -> "Geoffrey's book"
1144
with name "book" "old" "harmless" "lethal" "of" "geoffrey^s",
1145
invent "that harmless old book of Geoffrey's",
1148
self.invent = "that lethal old book of Geoffrey's";
1149
"The apparently harmless book turns fiery hot in your hands,
1150
and your eyes are dragged toward the hideous sigils
1151
inscribed within it... Just in time, you break the gorgon
1152
gaze and look away.^^
1153
[From this moment, its inventory entry changes.]";
1157
Object -> "platinum pyramid"
1158
with name "platinum" "pyramid",
1159
description "No matter how many times you pick this up and put it
1160
down again, it never becomes an ~ordinary~ object for room
1161
description purposes -- it always has a line to itself.",
1163
[; "^The platinum pyramid catches the light beautifully.";
1166
Object -> "ornate box"
1167
with name "decorated" "ornate" "box",
1169
[; if (inventory_stage==1) give self general;
1170
else give self ~general;
1173
[; if (self has general) { print "box"; rtrue; } ],
1175
[; if (self has general)
1176
{ print "that most remarkably decorated"; rtrue;
1180
"[What's interesting about the ornate box is that its
1181
inventory listing overrides its short name entirely,
1182
and yet its contents will still be inventoried.]",
1183
has open openable container;
1185
Object -> -> "pearl"
1187
description "Don't look at me - I'm irrelevant.";
1189
! --------------------------------------------------------------------------
1191
Object Room23a "Room 23 @01: Inventory Annexe"
1193
"The @01ern end of Room 23 is a housing for the Listing Machine.",
1194
e_to Room23, ne_to Corridor22,
1197
Object -> list_machine "listing machine"
1198
with name "listing" "list" "machine",
1200
[ i; print "The listing machine has a go button and a number of
1201
switches, whose current settings are as follows:^";
1202
objectloop (i in self)
1204
{ print (address) (i.&name)-->0, " ";
1205
if (i has on) print "(on)^"; else print "(off)^";
1210
has transparent static;
1212
Object -> -> list_go "go button"
1213
with name "go" "button" "control",
1216
objectloop (i in list_machine)
1217
if (i~=self && i has on) j=j+i.number;
1218
print "~In this style, your inventory is listed as
1220
WriteListFrom(child(player), j, 1);
1226
with name "switch" "control",
1227
has switchable static;
1229
BitSwitch -> -> "newline switch"
1230
with name "newline", number NEWLINE_BIT;
1231
BitSwitch -> -> "indent switch"
1232
with name "indent", number INDENT_BIT;
1233
BitSwitch -> -> "fullinv switch"
1234
with name "fullinv", number FULLINV_BIT, has on;
1235
BitSwitch -> -> "english switch"
1236
with name "english", number ENGLISH_BIT, has on;
1237
BitSwitch -> -> "recurse switch"
1238
with name "recurse", number RECURSE_BIT, has on;
1239
BitSwitch -> -> "always switch"
1240
with name "always", number ALWAYS_BIT;
1241
BitSwitch -> -> "terse switch"
1242
with name "terse", number TERSE_BIT;
1243
BitSwitch -> -> "partinv switch"
1244
with name "partinv", number PARTINV_BIT;
1245
BitSwitch -> -> "defart switch"
1246
with name "defart", number DEFART_BIT;
1247
BitSwitch -> -> "workflag switch"
1248
with name "workflag", number WORKFLAG_BIT;
1249
BitSwitch -> -> "isare switch"
1250
with name "isare", number ISARE_BIT;
1251
BitSwitch -> -> "conceal switch"
1252
with name "conceal", number CONCEAL_BIT;
1254
! --------------------------------------------------------------------------
1256
[ CoinsTogether cla i x y;
1257
objectloop (i ofclass cla)
1259
if (y==0) y=x; else { if (x~=y) return 0; }
1264
[ Face x; if (x.number==1) print "Heads"; else print "Tails"; ];
1266
Array gold_trigrams --> "fortune" "change" "river flowing" "chance"
1267
"immutability" "six stones in a circle"
1268
"grace" "divine assistance";
1269
Array silver_trigrams --> "happiness" "sadness" "ambition" "grief"
1270
"glory" "charm" "sweetness of nature"
1271
"the countenance of the Hooded Man";
1273
[ Trigram cla i k state;
1274
objectloop (i ofclass cla)
1275
{ print (Face) i; if (k++<2) print ","; print " ";
1276
state=state*2 + (i.number-1);
1278
if (cla == GoldCoin) i=gold_trigrams; else i=silver_trigrams;
1279
print "(", (string) i-->state, ")";
1282
[ CoinsLT cla k i c;
1283
if (inventory_stage==1)
1284
{ if (cla == GoldCoin) print "the gold"; else print "the silver";
1286
k=CoinsTogether(cla);
1287
if (k==location || k has supporter)
1288
{ objectloop (i ofclass cla)
1291
{ 1: print ", "; 2: print " and ";
1292
3: print " (showing the trigram ", (Trigram) cla, ")";
1297
c_style = c_style | (ENGLISH_BIT+NOARTICLE_BIT);
1298
if (c_style & NEWLINE_BIT ~= 0) c_style = c_style - NEWLINE_BIT;
1299
if (c_style & INDENT_BIT ~= 0) c_style = c_style - INDENT_BIT;
1305
with number 1, article "the",
1308
if (parser_action==##TheSame) return -2;
1309
w='gold'; if (self ofclass SilverCoin) w='silver';
1312
if (j=='coins') parser_action=##PluralFound;
1313
else if (j~='coin' or w or self.name) return i;
1319
self.number=random(2); print (Face) self, ". ";
1320
if (self ofclass GoldCoin) j=GoldCoin; else j=SilverCoin;
1321
if (CoinsTogether(j)~=0)
1323
if (j == GoldCoin) print "gold"; else print "silver";
1324
" trigram is now ", (Trigram) j, ".";
1329
Class GoldCoin class Coin
1330
with list_together [; return CoinsLT(GoldCoin); ];
1331
Class SilverCoin class Coin
1332
with list_together [; return CoinsLT(SilverCoin); ];
1334
Object Room23b "Room 23 @00: Chinese Room"
1335
with description "A small, well-composed Chinese room for meditation,
1336
through which ~a wind can blow~. (But only if it blows from
1337
@01 back to north@01, because they're the only exits.)
1338
From each cornice of the ceiling, a cherub looks down.",
1339
w_to Room23, nw_to Corridor22,
1342
Object -> "Chinese scroll"
1343
with name "chinese" "scroll" "instructions",
1344
initial "A scroll hangs on one wall.",
1346
"Instructing you in the arts of the I Ching, the scroll advises
1347
you to throw the two trigrams of gold and silver coins, that
1348
you may find wisdom in the result.";
1350
GoldCoin -> "goat" with name "goat";
1351
GoldCoin -> "deer" with name "deer";
1352
GoldCoin -> "chicken" with name "chicken";
1354
SilverCoin -> "robin" with name "robin";
1355
SilverCoin -> "snake" with name "snake";
1356
SilverCoin -> "bison" with name "bison";
1358
Global cherub_warning_given;
1362
for (flag=1:flag==1:)
1365
if (j=='cherub' || j==self.name) flag=1;
1367
{ parser_action=##PluralFound; flag=1;
1368
if (cherub_warning_given==0)
1369
print "(I'll let this go,
1370
but the plural of ~cherub~ is ~cherubim~.)^";
1371
cherub_warning_given = true;
1374
{ parser_action=##PluralFound; flag=1; }
1381
Cherub -> "northeast cherub" with name "northeast";
1382
Cherub -> "southeast cherub" with name "southeast";
1383
Cherub -> "northwest cherub" with name "northwest";
1384
Cherub -> "southwest cherub" with name "southwest";
1386
! --------------------------------------------------------------------------
1388
Object Room23 "Room 23: List Property Office"
1390
"This the List Property Office (it seems that an ~O~
1391
was lost some time ago), at the southern end of the top floor;
1392
the management have kindly provided a green baize table, while
1393
the rest is presumably the work of patrons.^^
1394
Room 23 continues @00 to @01.",
1400
Object -> "green baize table"
1401
with name "green" "baize" "table"
1402
has scenery supporter;
1404
Class PlasticCutlery
1405
with name "plastic" "cutlery", article "a plastic",
1407
[; if (inventory_stage==1)
1408
{ if (c_style & NOARTICLE_BIT == 0) c_style=c_style+NOARTICLE_BIT;
1409
if (c_style & ENGLISH_BIT == 0) c_style=c_style+ENGLISH_BIT;
1410
if (c_style & NEWLINE_BIT ~= 0) c_style=c_style-NEWLINE_BIT;
1411
if (c_style & INDENT_BIT ~= 0) c_style=c_style-INDENT_BIT;
1416
PlasticCutlery -> "fork" with name "fork";
1417
PlasticCutlery -> "knife" with name "knife";
1418
PlasticCutlery -> "spoon" with name "spoon";
1420
Class Hat with list_together "hats", name "hat" "hats", has clothing;
1422
Hat -> "fez" with name "fez";
1423
Hat -> "Panama" with name "panama";
1424
Hat -> "sombrero" with name "sombrero";
1428
[; if (inventory_stage==1)
1429
{ print "the letters ";
1430
c_style = c_style | (ENGLISH_BIT+NOARTICLE_BIT);
1431
if (c_style & NEWLINE_BIT ~= 0) c_style = c_style - NEWLINE_BIT;
1432
if (c_style & INDENT_BIT ~= 0) c_style = c_style - INDENT_BIT;
1434
else print " from a Scrabble set";
1437
[; if (listing_together ofclass Letter) rfalse;
1438
print "letter ", (object) self, " from a Scrabble set"; rtrue;
1442
Letter -> "X" with name "x";
1443
Letter -> "Y" with name "y";
1444
Letter -> "Z" with name "z";
1445
Letter -> "P" with name "p";
1446
Letter -> "Q" with name "q";
1447
Letter -> "R" with name "r";
1449
Object -> "defrosting Black Forest gateau"
1450
with name "black" "forest" "gateau" "cake",
1453
Object -> "Punch magazine"
1454
with name "punch" "magazine",
1456
"Five years out of date by the cover, a hundred by the contents.",
1459
Object -> "issue of the Spectator"
1460
with name "spectator" "issue" "magazine", article "a recent",
1462
"Up to date by the cover, a nightmare view of the future within.",
1466
with name "die" "dice",
1467
after [; Drop: print "It comes up ", random(6); "!"; ];
1473
"A little star of precious-metal, perhaps exotic currency.",
1476
if (parser_action==##TheSame)
1477
{ if ((parser_one.&name)-->0 == (parser_two.&name)-->0) return -1;
1483
if (j=='stars') parser_action=##PluralFound;
1484
else if (j~='star' or w) return i;
1487
list_together "stars",
1489
[; print (address) (self.&name)-->0;
1490
if (~~(listing_together ofclass Star)) print " stars";
1493
[; if (listing_together ofclass Star)
1494
{ print (address) (self.&name)-->0; rtrue; }
1497
[; if (listing_together ofclass Star) print "one"; else print "a";
1500
Class GoldStar class Star with name "gold";
1501
Class SilverStar class Star with name "silver";
1502
Class BronzeStar class Star with name "bronze";
1504
SilverStar -> "silver star";
1505
SilverStar -> "silver star";
1506
SilverStar -> "silver star";
1507
SilverStar -> "silver star";
1508
BronzeStar -> "bronze star";
1509
GoldStar -> "gold star";
1510
GoldStar -> "gold star";
1511
GoldStar -> "gold star";
1513
! --------------------------------------------------------------------------
1515
Object Room24 "Curious Names"
1517
"This is Room 24, @00 of the mezzanine. The exhibits are
1518
packed in here, but fortunately there's a plaque making
1519
some sense of it all.",
1520
w_to Third_Floor, s_to Museum_Cafe,
1523
Object -> plaque "plaque"
1527
Princess is capable of a startling change of name when kissed.^^
1528
The genie's lamp, when rubbed, may make alarming things
1529
happen to your ability to refer to the colours ~black~ and
1530
~white~. The stones may help you to experiment with this.^^
1531
Carrying the magnifying glass allows you to ~magnify~ things.^^
1532
The game's parser has been specially programmed for the
1533
fly in amber object, so that ~put the fly in amber in box~
1534
will work correctly (and not be interpreted as ~put (the fly) in
1538
Object -> genies_lamp "genie's lamp"
1542
if (self hasnt general) give self general;
1543
else give self ~general;
1544
"A genie appears from the lamp, declaring:^^
1545
~Mischief is my sole delight:^
1546
If white means black, black means white!~";
1549
Object -> "white stone" with name "white" "stone";
1550
Object -> "black stone" with name "black" "stone";
1552
Object -> "fly in amber" with name "fly" "amber";
1554
Object -> magnifier "magnifying glass"
1555
with name "glass" "magnifying" "magnifier" "lense",
1556
description "Using this, you can ~magnify~ things.";
1559
if (magnifier notin player)
1560
"You're not holding a magnifying glass.";
1561
if (noun==magnifier) "Light is not so flexible as that.";
1562
print "You can just make out that ", (the) noun,
1563
" is inscribed as being ~object ", noun, "~.^";
1564
if (magnifier hasnt general)
1565
{ give magnifier general;
1566
"^(When you're carrying the magnifier, you can refer to
1567
things by their numbers like this; and you can even use
1568
# to mean ~any single object~ and * to mean ~all objects~.)";
1573
if (magnifier notin player) return -1;
1574
if (NextWord() == 'object' && TryNumber(wn) == obj) return 2;
1576
if (WordLength(wn)==1 && WordAddress(wn)->0 == '#') return 1;
1577
if (WordLength(wn)==1 && WordAddress(wn)->0 == '*')
1578
{ parser_action = ##PluralFound; return 1; }
1582
Object -> "/?%?/ (the artiste formally known as Princess)"
1583
with name "princess" "artiste" "formally" "known" "as",
1584
description "You somehow feel it would be appropriate
1587
[; if (self hasnt general) { print "Princess"; rtrue; }
1590
[; Listen: print_ret (name) self, " sings a soft siren song.";
1593
[; print_ret (name) self, " is singing softly.";
1596
[ x n; if (self hasnt general)
1597
{ if (NextWord()=='princess') return 1;
1601
if ( x->0 == '/' && x->1 == '?' && x->2 == '%'
1602
&& x->3 == '?' && x->4 == '/')
1603
{ while (wn<=parse->1 && WordAddress(wn++)<x+5) n++;
1609
[; Kiss: give self general; self.life = NULL;
1610
"In a fairy-tale transformation, the Princess
1611
steps back and astonishes the world by announcing
1612
that she will henceforth be known as ~/?%?/~.";
1614
has animate proper female;
1616
! --------------------------------------------------------------------------
1618
Object Museum_Cafe "Room 24 Annexe: The Museum Cafe"
1620
"Very much a self-service refreshments area, which
1621
somehow cunningly continues the exhibition from the north.",
1625
Object -> "upright fridge"
1626
with name "upright" "fridge",
1627
initial "There is an upright fridge in one corner.",
1631
"On the inside of the door is a note to the effect
1632
that the pepper is a standardly-named Inform object
1633
and can be called ~green~, ~pepper~, ~green pepper~,
1634
~pepper green~, etc.;
1635
whereas, in the case of the red tomato, ~red~ and
1636
~tomato fried red~, etc., will not be allowed.^^";
1639
has openable container static;
1641
Object -> -> "green pepper"
1642
with name "green" "pepper",
1645
Object -> -> "red fried tomato"
1646
with name "red" "pepper",
1648
[ i w; w=NextWord();
1649
while (w=='red' or 'fried')
1650
{ w=NextWord(); i++;
1652
if (w=='tomato') return i+1;
1657
Object -> "drinks machine"
1658
with name "drinks" "machine",
1660
"Next to the fridge is a drinks machine with buttons
1661
for Cola, Coffee and Tea.",
1662
has static transparent;
1663
Object -> -> "drinks machine button"
1667
for (: flag == 0: i++)
1670
{ 'button', 'for': flag = 0;
1671
'coffee': if (type == 0) { flag = 0; type = 1; }
1672
'tea': if (type == 0) { flag = 0; type = 2; }
1673
'cola': if (type == 0) { flag = 0; type = 3; }
1676
if (type==drink.number && i==2 && type~=0 && drink in player)
1678
self.number=type; return i-1;
1683
if (self.number == 0)
1684
"You'll have to say which button to press.";
1685
if (parent(drink) ~= 0) "The machine's broken down.";
1686
drink.number = self.number; move drink to player; itobj = drink;
1687
"Whirr! The machine puts ", (a) drink, " into your
1689
Attack: "The machine shudders and squirts cola at you.";
1690
Drink: "You can't drink until you've worked the machine.";
1692
Object drink "drink"
1695
for (: flag == 0: i++)
1698
{ 'drink', 'cup', 'of': flag = 0;
1699
'coffee': if (type == 0) { flag = 0; type = 1; }
1700
'tea': if (type == 0) { flag = 0; type = 2; }
1701
'cola': if (type == 0) { flag = 0; type = 3; }
1704
if (type ~= 0 && type ~= self.number) return 0;
1709
switch (self.number)
1710
{ 1: print "coffee"; 2: print "tea"; 3: print "cola"; }
1715
[; Drink: remove self;
1716
"Ugh, that was awful. You crumple the cup and responsibly
1720
! --------------------------------------------------------------------------
1724
[; print "This is one end of a long east/west room. ";
1725
if (self==window_w) "An exit leads back @00.";
1726
"There appears to be no way in or out at this end.";
1729
[; Examine, Search: ;
1731
if (inp1~=1 && noun~=0 && noun in self.far_side)
1732
print_ret (The) noun, " is on the far side of
1734
if (inp2~=1 && second~=0 && second in self.far_side)
1735
print_ret (The) second, " is on the far side of
1740
if (ggw has general) rfalse;
1741
print "^The room is divided by a great glass window";
1742
if (location.far_side hasnt light) " onto darkness.";
1743
print ", stretching from floor to ceiling.^";
1744
if (Locale(location.far_side,
1745
"Beyond the glass you can see",
1746
"Beyond the glass you can also see")~=0) ".";
1750
WindowRoom window_w "Room 28: @01 of Window"
1751
with e_to Third_Floor, w_to "The window is in your way.",
1754
Object -> "plastic cup"
1755
with name "plastic" "cup";
1757
WindowRoom window_e "Room 28: @00 of Window"
1758
with far_side window_w;
1763
Object -> "golden chalice"
1764
with name "golden" "chalice" "cup" "grail" "holy";
1766
Object ggw "great glass window"
1767
with name "great" "glass" "window",
1769
[ place; Examine, Search: place=location;
1770
if (place.far_side hasnt light)
1771
"The other side is dark.";
1772
print "The view through the window:^";
1774
PlayerTo(place.far_side,1); <Look>; PlayerTo(place,1);
1776
give place.far_side ~visited; rtrue;
1778
found_in window_w window_e,
1781
! ==========================================================================
1783
Object roof "Museum Roof: area 33"
1784
with name "trapdoor",
1786
"A small trapdoor leads down from this tiled roof into the
1787
museum. The view is indescribable, which saves me some typing
1788
and you some reading, right? Yes -- this is one of those
1789
post-modern room descriptions, the kind that makes you aware
1790
you're only playing a game.",
1794
Global status_style = 3;
1799
"A dial here has four settings, which control the appearance
1800
of the status line drawn by the computer to indicate the
1801
state of play. Settings are: 1 - invisible; 2 - centred
1802
place name only; 3 -�standard Score/Turns display;
1803
4 - a compass rose of possible directions to go in.",
1806
if (second<1 || second>4) "There are only four settings.";
1807
status_style = second; "Set.";
1811
! --------------------------------------------------------------------------
1814
location = Foyer; move samples_bag to player;
1815
thedark.short_name = "An odd-smelling darkness";
1816
thedark.initial = GoMothGo;
1817
NormalWorld(); lookmode=2;
1818
SetTime(SUNRISE-10,1);
1820
"^^^^^Welcome indeed to the...^";
1825
if (actor==martha) PlaceInScope(player);
1826
if (actor==player && scope_reason==TALKING_REASON && player in booth)
1827
PlaceInScope(martha);
1829
if (location==window_w && window_e has light)
1830
ScopeWithin(window_e);
1831
if (location==window_e && window_w has light)
1832
ScopeWithin(window_w);
1836
[ BeforeParsing i j;
1837
for (i=parse->1,j=2:j<i:j++)
1839
if (NextWord()=='fly' && NextWord()=='in' && NextWord()=='amber')
1840
parse-->(j*2-1) = 'fly';
1842
if (genies_lamp hasnt general) return;
1844
{ switch(NextWordStopped())
1845
{ 'white': parse-->(wn*2-3) = 'black';
1846
'black': parse-->(wn*2-3) = 'white';
1852
! --------------------------------------------------------------------------
1854
Constant U_POS 28; Constant W_POS 30; Constant C_POS 31;
1855
Constant E_POS 32; Constant IN_POS 34;
1857
Array printed_text table 64;
1859
[ DrawStatusLine j posa posb width;
1860
if (location==0) rfalse;
1861
width = 0->33; if (width==0) width=80;
1862
switch(status_style)
1863
{ 1: @split_window 0;
1865
@split_window 1; @buffer_mode 0; @set_window 1;
1866
style reverse; @set_cursor 1 1; spaces width;
1867
printed_text-->0 = 64;
1868
@output_stream 3 printed_text;
1869
print (name) location;
1871
j=(width-(printed_text-->0))/2;
1872
@set_cursor 1 j; print (name) location; spaces(j-1);
1874
@buffer_mode 1; @set_window 0; font on;
1875
3: @split_window 1; @set_window 1; @set_cursor 1 1; style reverse;
1876
posa = width-26; posb = width-13;
1878
@set_cursor 1 2; print (name) location;
1880
{ @set_cursor 1 posa; print "Score: ", sline1;
1881
@set_cursor 1 posb; print "Moves: ", sline2;
1883
if (width > 63 && width <= 76)
1884
{ @set_cursor 1 posb; print sline1, "/", sline2;
1886
@set_cursor 1 1; style roman; @set_window 0;
1887
4: if (e_obj.door_dir~=e_to)
1888
{ @split_window 1; @set_window 1; style reverse; font off;
1889
@set_cursor; spaces width;
1890
print "You're very disoriented in this reflected world";
1891
@set_cursor 1 1; style roman; @set_window 0; font on;
1894
@split_window 3; @set_window 1; style reverse; font off;
1895
@set_cursor 1 1; spaces width;
1896
@set_cursor 2 1; spaces width;
1897
@set_cursor 3 1; spaces width;
1898
@set_cursor 1 2; print (name) location;
1899
@set_cursor 1 51; print "Score: ", sline1;
1900
@set_cursor 1 64; print "Moves: ", sline2;
1901
if (location ~= thedark)
1903
if (location.u_to ~= 0) { @set_cursor 1 U_POS; print "U"; }
1904
if (location.nw_to ~= 0) { @set_cursor 1 W_POS; print "@@92"; }
1905
if (location.n_to ~= 0) { @set_cursor 1 C_POS; print "@@124"; }
1906
if (location.ne_to ~= 0) { @set_cursor 1 E_POS; print "/"; }
1907
if (location.in_to ~= 0) { @set_cursor 1 IN_POS; print "I"; }
1909
if (location.w_to ~= 0) { @set_cursor 2 W_POS; print "-"; }
1910
@set_cursor 2 C_POS; print "o";
1911
if (location.e_to ~= 0) { @set_cursor 2 E_POS; print "-"; }
1913
if (location.d_to ~= 0) { @set_cursor 3 U_POS; print "D"; }
1914
if (location.sw_to ~= 0) { @set_cursor 3 W_POS; print "/"; }
1915
if (location.s_to ~= 0) { @set_cursor 3 C_POS; print "@@124"; }
1916
if (location.se_to ~= 0) { @set_cursor 3 E_POS; print "@@92"; }
1917
if (location.out_to ~= 0){ @set_cursor 3 IN_POS; print "O"; }
1919
@set_cursor 1 1; style roman; @set_window 0; font on;
1923
! --------------------------------------------------------------------------
1927
! --------------------------------------------------------------------------
1930
"You typed the floating point number ", noun/100, ".",
1931
(noun%100)/10, noun%10, " (rounded off to 2 decimal places.)";
1934
[ DigitNumber n type x;
1935
x = NextWordStopped(); if (x==-1) return -1; wn--;
1937
{ x = WordAddress(wn);
1938
if (x->n>='0' && x->n<='9') return (x->n) - '0';
1941
if (x=='nought' or 'oh') { wn++; return 0; }
1942
x = TryNumber(wn++); if (x==-1000 || x>=10) x=-1; return x;
1944
[ FloatingPoint a x b w d1 d2 d3 type;
1945
a = TryNumber(wn++);
1946
if (a==-1000) return -1;
1947
w = NextWordStopped(wn); if (w==-1) return a*100;
1948
x = NextWordStopped(wn); if (x==-1) return -1; wn--;
1949
if (w=='point') type=1;
1951
{ if (WordAddress(wn-1)->0~='.' || WordLength(wn-1)~=1)
1954
d1 = DigitNumber(0,type);
1955
if (d1==-1) return -1;
1956
d2 = DigitNumber(1,type); d3 = DigitNumber(2,type);
1957
b=d1*10; if (d2>=0) b=b+d2; else d3=0;
1959
{ x=1; while (DigitNumber(x,type)>=0) x++; wn--;
1962
parsed_number = a*100 + b;
1963
if (d3>=5) parsed_number++;
1967
Verb "fp" * FloatingPoint -> FPX;
1969
! --------------------------------------------------------------------------
1971
Constant MAX_PHONE_LENGTH 30;
1972
Array dialled_number string MAX_PHONE_LENGTH;
1973
[ PhoneNumber f a l ch pp i;
1974
pp=1; if (NextWordStopped()==-1) return 0;
1976
{ a=WordAddress(wn-1); l=WordLength(wn-1);
1979
if (ch<'0' || ch>'9')
1980
{ if (ch~='-') { f=1; if (i~=0) return -1; } }
1982
{ if (pp<MAX_PHONE_LENGTH)
1983
dialled_number->(pp++)=ch-'0';
1986
} until (f==1 || NextWordStopped()==-1);
1987
if (pp==1) return -1;
1988
dialled_number->0 = pp-1;
1993
print "You dialled <";
1994
for (i=1:i<=dialled_number->0:i++) print dialled_number->i;
1997
Verb "dial" * PhoneNumber -> DialPhone;
1999
! --------------------------------------------------------------------------
2003
print "(with ", (the) assumed_key, ")^"; <<Lock noun assumed_key>>;
2006
print "(with ", (the) assumed_key, ")^"; <<Unlock noun assumed_key>>;
2009
[ DefaultKeyTest i count;
2010
if (noun hasnt lockable) rfalse;
2012
objectloop (i in player && i ofclass Key)
2013
{ count++; assumed_key = i; }
2015
if (count==1) rtrue; rfalse;
2018
Extend "lock" first * noun = DefaultKeyTest -> DefaultLock;
2019
Extend "unlock" first * noun = DefaultKeyTest -> DefaultUnlock;
2021
! --------------------------------------------------------------------------
2023
Constant TWELVE_HOURS 720;
2024
[ NumericTime hr mn word x;
2025
if (hr>=24) return -1;
2026
if (mn>=60) return -1;
2027
x=hr*60+mn; if (hr>=13) return x;
2028
x=x%TWELVE_HOURS; if (word=='pm') x=x+TWELVE_HOURS;
2029
if (word~='am' or 'pm' && hr==12) x=x+TWELVE_HOURS;
2032
[ MyTryNumber wordnum i j;
2033
i=wn; wn=wordnum; j=NextWordStopped(); wn=i;
2035
{ 'twenty-five': return 25;
2036
'thirty': return 30;
2037
default: return TryNumber(wordnum);
2040
[ TimeOfDay i j k x flag loop ch hr mn;
2042
if (i=='midnight') { parsed_number=0; return 1; }
2043
if (i=='midday' or 'noon') { parsed_number=TWELVE_HOURS; return 1; }
2044
! Next try the format 12:02
2045
j=WordAddress(wn-1); k=WordLength(wn-1);
2047
for (loop=0:loop<k:loop++)
2049
if (ch==':' && flag==0 && loop~=0 && loop~=k-1) flag=1;
2050
else { if (ch<'0' || ch>'9') flag=-1; }
2052
if (k<3 || k>5) flag=0;
2054
{ for (loop=0:j->loop~=':':loop++, hr=hr*10)
2057
for (loop++:loop<k:loop++, mn=mn*10)
2060
j=NextWordStopped();
2061
parsed_number=NumericTime(hr, mn, j);
2062
if (parsed_number<0) return -1;
2063
if (j~='pm' or 'am') wn--;
2066
! Next the format "half past 12"
2067
j=-1; if (i=='half') j=30; if (i=='quarter') j=15;
2068
if (j<0) j=MyTryNumber(wn-1); if (j<0) return -1;
2069
if (j>=60) return -1;
2070
k=NextWordStopped();
2071
if ((k=='o^clock' or 'am' or 'pm')||(k==-1))
2072
{ hr=j; if (hr>12) return -1; jump TimeFound; }
2073
if (k=='to' or 'past')
2074
{ mn=j; hr=MyTryNumber(wn);
2076
{ x=NextWordStopped();
2077
if (x=='noon' or 'midday') hr=12;
2078
if (x=='midnight') hr=0;
2079
if (hr<0) return -1;
2081
if (hr>=13) return -1;
2082
if (k=='to') { mn=60-mn; hr=hr-1; if (hr==-1) hr=23; }
2083
wn++; k=NextWordStopped();
2086
hr=j; mn=MyTryNumber(--wn);
2087
if (mn<0 || mn>=60) return -1;
2088
wn++; k=NextWordStopped();
2090
parsed_number = NumericTime(hr, mn, k);
2091
if (parsed_number<0) return -1;
2092
if (k~='pm' or 'am' or 'o^clock') wn--;
2098
"The time is set to ", (PrintTime) noun, ".";
2100
Verb "time" * TimeOfDay -> SetTheTime;
2102
! --------------------------------------------------------------------------
2105
[ ThreefoldSub; "You do something involving ", (the) noun, ", ",
2106
(the) second, " and ", (the) third, ".";
2109
x=NounDomain(player,location,0);
2110
if (x==REPARSE_CODE) return x;
2111
if (x==0 or 1) return -1;
2115
Verb "threefold" * noun noun GhostObject -> Threefold;
2117
! --------------------------------------------------------------------------
2119
[ MegaExam obj; print (a) obj, ": "; <Examine obj>; ];
2120
[ MegaLookSub; <Look>; LoopOverScope(MegaExam); ];
2121
Verb meta "megalook" * -> MegaLook;
2123
! --------------------------------------------------------------------------
2125
[ ClapSub; "You clap."; ];
2126
Verb "clap" * -> Clap;
2128
! --------------------------------------------------------------------------
2130
Verb "magnify" * noun -> Magnify;
2132
! --------------------------------------------------------------------------
2134
Verb "alarm," * "on" -> SwitchOn
2135
* "off" -> SwitchOff
2136
* TimeOfDay -> SetTo
2139
Verb "tc," * noun -> Examine
2145
2: objectloop (i has crewmember) PlaceInScope(i); rtrue;
2149
Verb "stc," * "where" "is" scope=Crew -> Examine
2150
* "locate" scope=Crew -> Examine;
2152
Verb "rc," * held -> Give
2157
{ 'centauro', 'earth': return 1;
2162
Verb "zen," * "scan" number "orbital" -> Show
2163
* "set" "course" "for" Planet -> Go
2164
* "speed" "standard" "by" number -> SetTo
2165
* "raise" held -> Take
2166
* "clear" held "for" "firing" -> Drop;
2168
! ----------------------------------------------------------------------------