Object Room10 "Hall of Senses" with description "This is Room 10, north of the foyer. If you try going further north, a string will be printed instead. The exit to the @00 has a routine attached, and randomly leads either to the Directions Room or back to the foyer.", s_to Foyer, n_to "This string is the ~n_to~ value for this room.", e_to [; if (random(2)==1) return Foyer; return Room10a; ], has light; Object -> "TRAP lever" with name "trap" "lever", before [; Pull, Push: if (self has on) <>; <>; ], after [; SwitchOn: move orange_cloud to location; "Clunk! An orange cloud suddenly descends upon you."; SwitchOff: remove orange_cloud; "Click! The orange cloud vanishes."; ], has switchable static; Object -> "gold watch" with name "gold" "watch", description "The watch has no hands, oddly.", react_before [; Listen: if (noun==0 or self) "The watch ticks loudly."; ]; Object -> "sprig of lavender" with name "sprig" "of" "lavender", react_before [; Smell: if (noun==0 or self) "Lavender-perfume. Ahh!"; ]; Object orange_cloud "orange cloud" with name "orange" "cloud", react_before [; Look: "You can't see for the orange cloud surrounding you."; Go, Exit: "You wander round in circles, choking."; Smell: if (noun==0 or self) "Cinnamon? No, nutmeg."; ], has scenery; ! -------------------------------------------------------------------------- ! For east-west reflection ! -------------------------------------------------------------------------- Lowstring east_str "east"; Lowstring west_str "west"; [ NormalWorld; string 0 east_str; string 1 west_str; e_obj.door_dir = e_to; w_obj.door_dir = w_to; ]; [ ReversedWorld; string 0 west_str; string 1 east_str; w_obj.door_dir = e_to; e_obj.door_dir = w_to; ]; Object Room10a "Hall of Directions" with name "mirror", description "An annexe to Room 10: the main exit is back @01, and there's a curiously misty mirror on the north wall. Also, there's an exit in the fourth, ~hyper~ dimension (which is only visible in the weird geometry of this room).", initial [; move hyper to compass; StartDaemon(hyper); ], w_to Room10, n_to [; print "Walking through the mirror is confusing...^"; if (self has general) NormalWorld(); else ReversedWorld(); if (self has general) give self ~general; else give self general; <>; ], in_to [; print "Amazing! Your body corkscrews as you pass.^"; return Room11; ], has light; Object hyper "hyper-dimensional direction" with name "hyper" "fourth" "dimension", article "the", door_dir in_to, daemon [; if (location ~= Room10a) { remove self; StopDaemon(self); } ], has scenery; ! -------------------------------------------------------------------------- Object Room11 "Wonderful World of Containers" with description "This is Room 11, @00 of the foyer. You notice a typical piece of scenery which turns out to be a supporter: a mantelpiece.", w_to Foyer, has light; Object -> "bearded psychiatrist" with name "bearded" "doctor" "psychiatrist" "psychologist" "shrink", initial "A bearded psychiatrist has you under observation.", life [; "He is fascinated by your behaviour, but makes no attempt to interfere with it."; ], react_after [; Insert: print "~Subject puts ", (a) noun, " in ", (the) second, ". Interesting.~^"; PutOn: print "~Subject puts ", (a) noun, " in ", (the) second, ". Interesting.~^"; ], react_before [; Take, Remove: print "~Subject feels lack of ", (the) noun, ". Suppressed Oedipal complex? Mmm.~^"; ], has animate; Object -> "mantelpiece" with name "mantel" "mantle" "piece" "mantelpiece" has scenery supporter; Object -> "green ball" with name "green" "ball"; Object -> "red cone" with name "red" "cone"; Object -> "blue pyramid" with name "blue" "pyramid"; Object -> "plain shopping bag (which can only hold 2 things)" with name "plain" "shopping" "bag", capacity 2, has container open; Object -> "glass box with a lid" with name "glass" "box" "with" "lid" has container transparent openable open; Object -> "steel box with a lid" with name "steel" "box" "with" "lid" has container openable open; Key -> bolted_key "bolted key" with name "bolted"; Object -> "toothed bag" with name "toothed" "bag", description "A capacious bag with a toothed mouth.", before [; LetGo: "The bag defiantly bites itself shut on your hand until you desist."; Close: "The bag resists all attempts to close it."; ], after [; Receive: "The bag wriggles hideously as it swallows ", (the) noun, "."; ], has container open; Object -> "bolted cupboard" with name "bolted" "cupboard", describe [; if (self hasnt open) "^A pretty typical shut cupboard is bolted to one wall."; "^Bolted up on one wall is an open cupboard."; ], with_key bolted_key has locked container openable lockable static; Object -> "portable television set" with name "tv" "television" "set" "portable", initial "A portable television set has two sub-objects attached: a power button and a screen.", before [; SwitchOn: <>; SwitchOff: <>; Examine: <>; ], has transparent; Object -> -> power_button "power button" with name "power" "button" "switch", after [; SwitchOn, SwitchOff: <>; ], has switchable; Object -> -> screen "television screen" with name "screen", before [; Examine: if (power_button hasnt on) "The screen is black."; "The screen writhes with a strange Japanese cartoon."; ]; Object -> "macrame bag" with name "macrame" "bag" "string" "net" "sack", react_before [; Examine, Search, Listen, Smell: ; default: if (inp1>1 && inp1 in self) print_ret (The) inp1, " is tucked away in the bag."; if (inp2>1 && inp2 in self) print_ret (The) inp2, " is tucked away in the bag."; ], describe [; print "^A macrame bag hangs from the ceiling, shut tight"; if (child(self)==0) "."; print ". Inside you can make out "; WriteListFrom(child(self), ENGLISH_BIT); "."; ], has container transparent static; Object -> -> "music box" with name "music" "box" "musical", description "Attractively lacquered.", react_before [; Listen: if (noun==0 or self) "The musical box chimes some Tchaikovsky."; ]; ! -------------------------------------------------------------------------- Object Corridor12 "Corridor 12" with description "Runs south of the foyer. A side exit leads @01 to Room 15, the manuscripts room.", n_to Foyer, s_to Oak_Door, w_to Room15, has light; Object -> "sinister curator" with name "sinister" "curator", initial [; if (self hasnt general) "A sinister curator leans against the wall, asleep."; "The curator is here, casting menacing looks."; ], daemon [ i p j n k; if (random(3)~=1 || self hasnt general) rfalse; p=parent(self); objectloop (i in compass) { j=p.(i.door_dir); if (ZRegion(j)==1 && j hasnt door) n++; } if (n==0) rfalse; k=random(n); n=0; objectloop (i in compass) { j=p.(i.door_dir); if (ZRegion(j)==1 && j hasnt door) n++; if (n==k) { move self to j; if (p==location) "^The curator stalks away."; if (j==location) "^The curator stalks in."; rfalse; } } ], orders [; if (self hasnt general) "The curator only snores."; "He raises a skeletal finger to his lips. ~Shh!~"; ], life [; WakeOther: if (self hasnt general) { give self general; move self to Foyer; "He wakes and rouses to his feet, pushes past you and stalks away."; } default: "He rears back with disdain."; ], has animate; Object Oak_Door "oaken door" with name "oak" "door" "oaken", description "Despite appearances, there is no key to this door.", door_dir [; if (location==Corridor12) return s_to; return n_to; ], door_to [; if (location==Corridor12) return Room13; return Corridor12; ], describe [; if (self has open) "^The oaken door stands open."; if (self hasnt locked) "^The corridor ends in an oaken door."; ], found_in Corridor12 Room13 has static door openable lockable; ! -------------------------------------------------------------------------- Object Room15 "Manuscripts Room" with description "This is Room 15, adjoining a corridor to the @00.", e_to Corridor12, has light; Object -> "black Tyndale Bible" with name "bible" "black" "book", initial "A black Bible rests on a spread-eagle lectern.", description "A splendid foot-high Bible, which must have survived the burnings of 1520.", before [ w x; Consult: wn = consult_from; w = NextWord(); switch(w) { 'matthew': x="Gospel of St Matthew"; 'mark': x="Gospel of St Mark"; 'luke': x="Gospel of St Luke"; 'john': x="Gospel of St John"; default: "There are only the four Gospels."; } if (consult_words==1) "You read the ", (string) x, " right through."; w = TryNumber(wn); if (w==-1000) "I was expecting a chapter number in the ", (string) x, "."; "Chapter ", (number) w, " of the ", (string) x, " is too sacred for you to understand now."; ]; ! -------------------------------------------------------------------------- Object Room13 "Switches Hall" with description "This is Room 13, at the south end of a long corridor leading north. Progress further south is blocked by a chasm.", n_to Oak_Door, s_to PlankBridge, has light; Object -> "Gotham City searchlight" with name "gotham" "city" "search" "light" "template" "searchlight", article "the", description "It has some kind of template on it.", when_on "The old city searchlight shines out a bat against the alabaster ceiling of the Museum.", when_off "The old Gotham city searchlight has been lovingly restored and housed here." has switchable static; Object -> "basement light switch" with name "basement" "light" "switch", after [; SwitchOn: give basement light; "Click!"; SwitchOff: give basement ~light; "Click!"; ], has switchable static; Object -> PlankBridge "plank bridge" with description "Extremely fragile and precarious.", name "precarious" "fragile" "wooden" "plank" "bridge", when_open "A precarious plank bridge spans the chasm.", door_to [; if (children(player)~=0) { deadflag=1; "You step gingerly across the plank, which bows under your weight. But your meagre possessions are the straw which breaks the camel's back! There is a horrid crack..."; } print "You step gingerly across the plank, grateful that you're not burdened.^"; if (location==Room13) return FarSide; return Room13; ], door_dir [; if (location==Room13) return s_to; return n_to; ], found_in Room13 FarSide, has static door open; Object FarSide "Far Side of Chasm in Room 13" with description "This side of the chasm is dull and dusty after all.", n_to PlankBridge, has light; ! -------------------------------------------------------------------------- Object Room14 "Large Exhibits Room" with description "This is Room 14, @01 of the foyer, which gives onto the Weights Room to the north.", e_to Foyer, n_to Weights_Room, has light; Object -> "hypnotic portrait" with name "hypnotic" "portrait" "warthog" "picture" "of" "hog", initial "A somewhat hypnotic full-length portrait of a warthog hangs on the wall.", before [; Examine: ; print "^...and somehow, so do you...^"; ChangePlayer(hog); <>; ], has static; Object -> "Louis XV chair" with name "louis" "xv" "quinze" "chair", initial "A valuable Louis XV chair takes pride of place.", has enterable supporter; Object -> car "little red car" with name "little" "red" "car" "kar1", description "Large enough to sit inside. Among the controls is a prominent on/off switch. The numberplate is KAR 1.", when_on "The red car sits here, its engine still running.", when_off "A little red car is parked here.", before [; PushDir: AllowPushDir(); rtrue; Go: if (car has on) { Achieved(1); "Brmm! Brmm!"; } print "(The ignition is off at the moment.)^"; ], after [; PushDir: "The car rolls very slowly as you push it."; ], has switchable enterable static container open; Object -> -> "small note" with name "small" "note", description " !!!! FROBOZZ MAGIC CAR COMPANY !!!!^ ^Hello, Driver!^ ^Instructions for use:^ ^Switch on the ignition and off you go!^ ^Warranty:^ ^This car is guaranteed against all defects for a period of 76 milliseconds from date of purchase or until used, whichever comes first.^ ^Good Luck!"; Object -> "Giant" with name "giant", initial "A Giant is here. (And you know the old legend... push a Giant, become a Giant!)", before [; Push: ChangePlayer(self); <>; Take: rtrue; ], number 0, orders [; if (player==self) { if (actor~=self) "You only become tongue-tied and gabble."; if (action==##Push && noun==selfobj) { ChangePlayer(selfobj); <>; } rfalse; } Attack: "The Giant looks at you with doleful eyes. ~Me not be so bad!~"; default: "The Giant is unable to comprehend your instructions."; ], has animate; ! -------------------------------------------------------------------------- Object "Caldera" with description "An old volcanic crater of mud and ash, from which there is nowhere to go.", has light; Object -> hog "Warthog" with name "wart" "hog" "warthog", description "Muddy, sniffing and grunting.", number, orders [; if (player~=self || actor~=self) rfalse; ! So now we have just the case where the player ! is currently the warthog, ordering himself about: Go, Look, Examine, Eat, Smell, Taste, Touch: rfalse; default: "Warthogs can't do anything as tricky as that!"; ], has animate proper; Object -> "red berry" with name "red" "berry" "magic", initial "A magic red berry is half-uncovered in the mud.", before [; Smell, Taste, Touch: print "The blood-smell of the berry brings you back, back...^"; ChangePlayer(selfobj); <>; ]; ! -------------------------------------------------------------------------- Constant CARRYING_STRENGTH = 500; Constant HEAVINESS_THRESHOLD = 100; Object Weights_Room "Weights Room" with description "This is an annexe, south of Room 14. In here (though nowhere else) objects have given weights, and you can carry only a limited total weight. (Items from elsewhere in the museum all weigh 10 zobs, regardless of what they are.) The longer you carry heavy objects, the more tired you become, until you're forced to drop them; your strength recovers once you're carrying only a light load.", initial [; weight_monitor.activate(); ], s_to Room14, has light; Object -> "feather" with name "feather", weight 1; Object -> "iron anvil" with name "iron" "anvil", article "an", weight 300; Object -> "five-zob weight" with name "five" "zob" "weight", weight 5; Object -> "ten-zob weight" with name "ten" "zob" "weight", weight 10; Object -> "twenty-zob weight" with name "twenty" "zob" "weight", weight 20; Object -> "fifty-zob weight" with name "fifty" "zob" "weight", weight 50; Object -> "hundred-zob weight" with name "hundred" "zob" "weight", weight 100; [ WeightOf obj t i; t = obj.weight; objectloop (i in obj) t = t + WeightOf(i); return t; ]; Object weight_monitor with players_strength, warning_level 5, activate [; self.players_strength = CARRYING_STRENGTH; StartDaemon(self); ], daemon [ w s b bw; if (location ~= Weights_Room) { StopDaemon(self); return; } s = self.players_strength - WeightOf(player) + HEAVINESS_THRESHOLD; if (s<0) s=0; if (s>CARRYING_STRENGTH) s=CARRYING_STRENGTH; self.players_strength = s; if (s==0) { bw=-1; objectloop(b in player) if (WeightOf(b) > bw) { bw = WeightOf(b); w=b; } self.players_strength = self.players_strength + bw; print "^Exhausted with carrying so much, you decide to discard ", (the) w, ": "; <>; } w=s/100; if (w==self.warning_level) return; self.warning_level = w; switch(w) { 3: "^You are feeling a little tired."; 2: "^You possessions are weighing you down."; 1: "^Carrying so much weight is wearing you out."; 0: "^You're nearly exhausted enough to drop everything at an inconvenient moment."; } ]; ! -------------------------------------------------------------------------- Constant SUNRISE 360; ! i.e., 6 am Constant SUNSET 1140; ! i.e., 7 pm Global day_state = 2; Object balcony "Balcony" with description [; print "An open-air balcony on the cliffside wall of the cathedral-like Museum, hundreds of feet above "; if (day_state==1) "sunlit plains of farms and settlements."; "a darkling plain. Dim light from the walls above is the only beacon in this vast night."; ], in_to Foyer, cant_go "The only way is back inside.", each_turn [ f; if (the_time >= SUNRISE && the_time < SUNSET) f=1; if (day_state == f) return; if (day_state==2) { day_state = f; return; } day_state = f; if (f==1) "^The sun rises, illuminating the landscape!"; "^As the sun sets, the landscape is plunged into darkness."; ], has light; Object -> "giant clock" with name "giant" "clock" "face" "clockface" "clock-face", before [; Examine: "According to the giant clockface on the wall above, it is now ", the_time/60, ":", (the_time%60)/10, the_time%10, "."; default: "The giant clock-face is too high above you."; ], react_after [; Look: new_line; ; ], has static concealed; Object -> moth "moth" with name "moth", initial "A catchable moth flits about."; [ GoMothGo; if (moth in player) { remove moth; "As your eyes try to adjust, you feel a ticklish sensation and hear a tiny fluttering sound."; } ]; Object -> "Commander Data" with name "data" "commander", orders [; "~I regret that I am only here to make an example work elsewhere. Please proceed upstairs to 10 Forward to see.~"; ], has proper animate crewmember; ! ==========================================================================