Constant Story "Hedge Maze"; Constant Headline "^by Stuart Bryson^^Well its finally time to do it. For ages you wanted to prove to everyone that you were capable. Not just because you wanted to show them that you were smart enough to navigate a hedgemaze, but maybe now they will realise you don't sit at home all day playing computer games. ~See, I do things outside too!~ Now to conquer the maze!^^"; Constant MAX_SCORE = 100; Constant DEBUG; Serial "000001"; Release "1.0"; Include "Parser"; Include "VerbLib"; [ PrintRank; print ", earning you the title "; if ( score >= 80 ) "~Green Thumb~"; if ( score >= 50 ) "~Accomplished Gardener~"; if ( score >= 20 ) "~Barely Aware of Nature~"; "~Enemy of Greenpeace~"; ]; [ AfterLife; print "^Game Over^"; ]; Include "Grammar"; [ Initialise; location = south_west; StartDaemon( statue ); StartDaemon( book ); StartDaemon( tookTooLong ); ]; [ SprayAtSub; "You can't spray that!"; ]; Verb "spray" "squirt" "shoot" "fire" * noun 'at' noun -> SprayAt; [ KillGardener; move gloves to parent(gardener); move clippers to parent(gardener); give gardener ~animate; give clippers ~concealed; give gloves ~concealed; score = score + 20; ]; [ CutAtSub; if ( parent( clippers ) == player ) { "You really shouldn't cut that up."; } "You have nothing to cut that with."; ]; Extend 'dig' replace * -> Dig; Extend 'cut' replace * noun -> CutAt; Object tookTooLong with movesTillFrozen 90, daemon [; self.movesTillFrozen--; if ( self.movesTillFrozen == 20 ) { "^^You feel a strong feeling of cold over your body. Your arms seems hard to move and your legs look very pale. There is something about this maze that makes you a little uneasy and you become more anxious about finding the exit to the maze."; } else if ( self.movesTillFrozen == 10 ) { "^^The strange cold feeling runs through your body one more time and quickly turns into a painful tingling. You wonder where the feeling is coming from. Whatever it is, you need to move quickly, your heart is racing but your legs just won't move as fast as you are asking them to. Its time to get out of here."; } else if ( self.movesTillFrozen == 0 ) { deadflag=3; "^^Suddenly you feel a strange tingle overcome your entire body. Your feet and legs become very cold, your neck is slow and stiff to move. As you look at your hands you see their colour changing into a shade of grey. You can no longer smell the air, or even taste your own breath. Quickly one last time you read your book. The very last page of the book tells of the magic of the maze.^^~If you spend much too long,^the magic will affect you.^For too much time in there,^and you'll become a statue.^^Sure enough, as you finish reading those lines, your body is frozen in position and you can no longer move. While you can still think and observe, you ponder if any others have sucomed to the magic of the maze. You decide its time to get cozy and enjoy your new life in the magical maze."; } ]; Class HedgeMazeSection with cant_go "There is a hedge in the way", before [; Dig: if ( parent(shovel) == player ) "You cannot dig here. The paved sandstone is much too hard."; else "You have nothing to dig with, and even if you did, the sandstone is much too hard!"; Go: if ( noun == d_obj ) "The sandstone prevents you from doing that."; else if ( noun == u_obj ) "You can't do that here."; ], has light; HedgeMazeSection south_west "Start - South West Section" with description "The maze reminds you of some of the old english gardens you visited as a child. The walls of the maze are made from yew hedges and are roughly 4 meters tall. The hedges are very thick, too thick to see through to the other side. The ground of the maze is made from large blocks of sandstone. This section of the maze would be approximately 4 by 4 meters. It has been well paved and clearly been here for generations. There is an overwhelming smell of lavendar and far in the distance you can hear the trickle of water, probably from a small stone fountain. Sunlight pours in from the north casting a well defined shadow on the sandstone. Just being here is relaxing.^^Hedges surround you from all aspects except east.", e_to south; HedgeMazeSection south "South Section" with description [; print "The yew hedges continue running west to east and you feel well directed. Spanning the entire width between the two hedges is a large pit in the ground. The large sandstone blocks that have been used to pave the ground have been built into the walls of the pit. The pit would be 4 meters wide by approximately 2 meters long.^^You are currently on the "; if ( self.side_of_pit == w_obj ) print "west"; else print "east"; print " side of the pit."; ], e_to south_east, w_to south_west, before [; PushDir: if ( noun == ladder && second == w_obj ) { deadflag = 1; "As you push the ladder in the direction of the pit, you slip and fall into the pit. During your descent, you cling to the ladder but it provides little comfort as you fall to your death."; } else if ( noun == ladder && second == e_obj ) { move ladder to south_east; move player to south_east; location = south_east; ladder.ladderOnHedge = false; "You move the ladder into the south east section of the maze."; } else if ( noun == ladder ) { "There is no point in moving the ladder in that way"; } Insert: if ( noun == ladder ) { if ( second == pit ) { move ladder to pit; "You slide the ladder into the pit. It stands upright with just enough height for your foot to reach it."; } "You can put the ladder in that!"; } ], side_of_pit w_obj; ! 0 means west, 1 means east HedgeMazeSection south_east "South East Section" with description "This section of the maze perfectly mirrors the south west section. The hedges are thick and extend 4 meters from the ground, except for the northern facing hedge which seems to be still in its infancy and would roughly be 3.5 meters.^^You are surrounded on all sides except west.", w_to south, n_to inner_south_east, playerInInnerMaze false, before [; Go: if ( noun == n_obj ) { if ( ladder.playerOnLadder == true ) { ladder.playerOnLadder = false; self.playerInInnerMaze = true; print "You scramble over the maturing hedge. As you transfer your weight from the ladder to the plant, the plant begins to give way and you fall forward. You land flat on your arse in the inner east section of the maze.^"; rfalse; } else { "There is a hedge in the way"; } } else if ( noun == w_obj && ladder.playerOnLadder == true ) { "You will have to climb off the ladder first"; } else if ( noun == u_obj && ladder.playerOnLadder == false ) { <>; } else if ( noun == d_obj && ladder.playerOnLadder == true ) { <>; } PushDir: if ( noun == ladder && second == n_obj ) { if ( ladder.ladderOnHedge ) "The ladder is already on the north hedge"; <>; } else if ( noun == ladder && second == w_obj ) { move ladder to south; move player to south; location = south; ladder.ladderOnHedge = false; "You move the ladder into the south section of the maze."; } else if ( noun == ladder ) { "There is no point in moving the ladder in that way"; } ]; HedgeMazeSection inner_south_west "Inner South West Section" with description "Fresh hedge clippings lie dying on the sandstone. The well defined shape continues through this section of the maze with hard lines running into the corner and out again.^^You can go either north or east.", e_to inner_south, n_to inner_north_west, Before [; Go: if ( noun == e_obj ) inner_south.side_of_pit = w_obj; Take: if ( noun == clippers && gardener has animate ) "You try to take the clippers off the gardener but he snatches them back, and even though you don't know his language, you are quite sure he was using expetives to emphasize his disgust."; if ( noun == gloves && gardener has animate ) "You try to take the gloves off the gardener but the gardener quickly pulls his hands away from you. As you step back, you catch a glimpse of his face and his large bloodshot eyes glaring at you from behind his bushy eyebrows. You get the distinct feeling that you should probably give this one a miss."; ]; HedgeMazeSection inner_south "Inner South Section" with description "The ground here is covered with countless dead autumn leaves, almost as though the entire rakings for the maze have been left here. As you tread on the leaves the sound of crumpling leaves and snapping twigs cuts into the silence. The leaves cause the ground to feel soft and unstable.^^From here you can go east and west.", e_to inner_south_east, w_to inner_south_west, ! inital value doesn't mean much, it gets set from each entry point side_of_pit e_obj; HedgeMazeSection inner_south_east "Inner South East Section" with description "On the ground lie many withered hedge clippings. The hedges here are better maintained than some earlier plants. They all have a consistent box shape, with sharp lines and edges providing a well groomed look.^^From here you can go north or west.", w_to inner_south, n_to inner_north_east, before [; Go: if ( noun == w_obj ) inner_south.side_of_pit = e_obj; ]; HedgeMazeSection inner_north_west "Inner North East Section" with description "The sun beams in from the north. You feel it roasting your skin and warming you right through. This area is very open and the sandstone appears much drier than other sections.^^From here you can go north, south or east.", n_to north_west, e_to inner_north, s_to inner_south_west; HedgeMazeSection inner_north "Inner North Section" with description "Hedges can be seen running east to west along both the northern and southern aspects. The northern hedge is clearly in need of some attention. It is overgrown and lacks the definition that has been observed elsewhere. From here you can go west or east.", e_to inner_north_east, w_to inner_north_west; HedgeMazeSection inner_north_east "North East of Inner Circle" with description [; print "The hedges here seem to be struggling to grow. The northern hedge particularly has some holes in the vegetation and the leaves lack that deep green colour of yew. With very little light seeping in, the ground is mossy and slippery. Some sandstone blocks below the north wall have been damaged leaving loose dirt and some weeds intruding on the clean look of the pavement.^^From here you can go west and south."; if ( self.hedge_cut == true ) print " You can also go north through the opening in hedge."; else if ( self.hole_dug == true ) print " You can also go north through the hole in the ground."; ], w_to inner_north, s_to inner_south_east, n_to nothing, hole_dug false, hedge_cut false, before [; Go: if ( noun == n_obj && self.n_to == north_east ) { if ( self.hedge_cut ) print "Sliding through the small openening you cut earlier, you make your way through the hedge.^"; else if ( self.hole_dug ) print "You get down on your hands and knees and crawl through the small hole you dug.^"; } Dig: if ( parent(shovel) == player ) { if ( self.hole_dug ) "There is nothing left to dig"; score = score + 20; self.n_to = north_east; self.hole_dug = true; "Using the shovel, you start digging where the loose dirt lies. After some time you manage to dig yourself a small tunnel under the northern hedge."; } else { print "Using your hands, you start to dig at the loose dirt."; if ( gloves has worn ) { print_ret " After a while you decide this is acheiving nothing other than getting your gloves dirty."; } else { score = score - 5; print_ret " After some time your hands become tired, covered with cuts and dirt.^You decide this is getting you nowhere."; } } ]; HedgeMazeSection north_west "North West section" with name "north west section", description "This section of the maze is very poorly maintained. The overgrown hedges are thick and wild. There is so little light, it feels almost night time. On the far side of the section is a stone wall. The wall has been crafted from the same stones used in the ground. In the center of the wall is a plaque made of copper with some words moulded onto it - probably one of those dedication stones. Beside it you see a small opening in the wall.^^From here you can only return south.", s_to inner_north_west, key_in_hole true, key_taken false, ! used for scoring, once key has been taken this is true before [; Take: if ( noun == key ) { if ( parent( key ) == hole_in_wall ) { if ( hole_in_wall.insecticided == true ) { if ( self.key_taken == false ) { score = score + 10; self.key_taken = true; } move key to player; give key ~concealed; "As you reach into the tiny hole in the wall, many dead bugs fall out of the hole. If you hadn't sprayed the hole with insecticide you may have been bitten."; } else if ( gloves has worn ) { if ( self.key_taken == false ) { score = score + 10; self.key_taken = true; } move key to player; give key ~concealed; "As you reach into the tiny hole in the wall, you feel many bugs attacking your hand. Without those gloves on you may have been bitten."; } else { score = score - 5; "You reach into the tiny hole in the wall feeling around for the key. As you do so, many bugs start to attack your hand. After three different bites from various insects you can no longer take it and you remove your hand leaving the key behind."; } } } ]; HedgeMazeSection north_east "North East section" with description "This section of the maze is very rich in colour. Daisy's are growing out from under the hedges on the east side, lavendar has been planted along the north wall with a nice tiered look, and the fountain you heard earlier is much more audible here.^^You can leave here either south or west.", s_to inner_north_east, w_to north, before [; Go: if ( noun == s_obj ) { if ( inner_north_east.hedge_cut ) { print "You slip back through the opening in the hedge^"; } else if ( inner_north_east.hole_dug ) { print "You crawl through the tunnel you dug earlier^"; } } else if ( noun == w_obj ) { if ( spider.appeased == false ) { "The giant spider won't let you past. ~You must tell me the answer to the riddle!~"; } } ]; HedgeMazeSection north "North section" with description "Stone walls enclose you on the western and southern walls. A large wooden door leads north. The taste of freedom overwhelms you as you ponder whats on the other side of the door.", e_to north_east, n_to [; if ( exitdoor has open ) return exit; return nothing; ], before [; Go: if ( noun == n_obj ) if ( exitdoor hasnt open ) "The door is closed!"; else deadflag = 2; ], has light; Object exitdoor "door" north, with name "door", description "The door extends the full 4 meters to the top of the maze. It is attached firmly to the stone wall with large reinforced metal hinges. It is made from tasmanian oak with a deep brown colour.", when_closed "The door is closed", when_open "The door is open", door_to exit, door_dir n_to, with_key key, has static door lockable locked openable; Object exit "exit" with description "", s_to north, has light; Object struggling "Struggling hedge" inner_north_east with name "struggling" "struggling hedge", description "This hedge is clearly struggling to survive. There are patches in the vegetation providing you with glimpses of the other side. The colour of the hedge is fading from green to a withering brown.", hole_cut false, before [; CutAt: if ( parent( clippers ) == player ) { if ( self.hole_cut == true ) "You have already cut the hedge enough."; self.hole_cut = true; score = score + 20; inner_north_east.n_to = north_east; inner_north_east.hedge_cut = true; "Using the clippers you cut through the northern hedge, giving you access to the north east section of the maze.^"; } ], has concealed static scenery; Object book "book" south_west with description " ", ! don't need a description as the examine routine covers it name "book", read_count 0, pages_timer 0, last_page "As you read this book,^be sure to keep a close eye.^As your eye does look,^words change as time goes by.", daemon [; self.pages_timer++; ], before [; Examine, Consult: ! this logic ensures that the books pages can't be read too quickly or before certain events have occurred switch ( self.read_count ) { 0: self.read_count++; print "~Garden Wisdom~^^"; print_ret (string)self.last_page; 1: self.read_count++; self.last_page = "As failure precedes improvement,^be sure not to quit.^When holes prevent movement,^then simply jump the pit."; print_ret (string)self.last_page; 2: if ( self.pages_timer > 10 && south_east.playerInInnerMaze == true ) ! we have entered the inner maze { self.read_count++; self.last_page = "^When there are many places to go,^but apparently little to do,^sitting quietly listening, and waiting,^impossible things start to come true."; } print_ret (string)self.last_page; 3: if ( self.pages_timer > 15 ) { self.read_count++; self.last_page = "^Inanimate objects might move,^be alert or this you may miss.^But true life can only come,^with loves first kiss."; } print_ret (string)self.last_page; 4: if ( self.pages_timer > 20 ) { self.read_count++; self.last_page = "^Not all statues are silent,^some hide behind masks,^some don't say a word,^and some you just have to ask."; } print_ret (string)self.last_page; 5: if ( self.pages_timer > 25 ) { self.read_count++; self.last_page = "^Foreigners or gardeners,^wasting time makes you ill,^mumblers or fumblers,^get on with it and kill!"; } print_ret (string)self.last_page; 6: if ( self.pages_timer > 30 ) { self.read_count++; self.last_page = "^Keys long hidden, bugs may stay.^Hands fast bitten, its time to spray."; } print_ret (string)self.last_page; 7: if ( self.pages_timer > 35 ) { self.read_count = 3; self.last_page = "^Withering hedges, loose stone,^shovel or clippers, its the way home."; } print_ret (string)self.last_page; } ]; ! ! Object pit "pit" south with description "The pit decends forever into the darkness.", name "pit", react_before [; Go: if ( noun == d_obj ) { <>; } else if ( noun == w_obj && south.side_of_pit == e_obj ) { print "Walking west, you realise that the pit is much longer than you thought. You try to latch on to the garden walls but it is pointless and you fall to your death."; <>; } else if ( noun == e_obj && south.side_of_pit == w_obj ) { print "Walking east, you realise that the pit is much longer than you thought. As you fall to your death, you ponder what would have happened if you tried to jump over the pit?"; <>; } Jump: <>; ! assume jump in this context means jump over pit ], before [; Enter: deadflag = 1; "You fall to your death"; JumpOver: print "You leap across the pit as far as you can. As you descend you reach out your arms and latch onto the ground on the opposite side. Slowly you pull yourself up, grateful to be alive.^^"; if ( south.side_of_pit == e_obj ) { south.side_of_pit = w_obj; "You are now on the western side of the pit."; } else { south.side_of_pit = e_obj; "You are now on the eastern side of the pit."; } ], after [; Receive: remove noun; print_ret "You throw ", (the)noun, " into the pit and it dissapears into the darkness."; Search: "The pit is too dark to see anything useful."; ], has scenery container open; Object ladder "ladder" south_east with description [; print "The ladder is made from solid beechwood. It appears to be just over 3 meters long and has splintered feet."; ], playerOnLadder false, ladderOnHedge false, name "ladder" "step ladder" "step-ladder", before [; Push,Pull: if ( parent( ladder ) == south_east ) { if ( self.ladderOnHedge == true ) { if ( self.playerOnLadder == true ) "You will have to get off it first!"; self.ladderOnHedge = false; "You put the ladder back to where you found it."; } self.ladderOnHedge = true; "You move the ladder over to the north hedge wall."; } "Not sure where to move it to."; Climb: if ( self.playerOnLadder == false ) { if ( self.ladderOnHedge == true ) { self.playerOnLadder = true; give ladder concealed; south_east.description = "From the top of the ladder you can make out some of the maze. You can see the pit to the west and an inner section of the maze to your north. It is hard to determine much beyond that though."; "You climb to the top of the ladder"; } else if ( parent( ladder ) == pit ) { deadflag = 2; "You climb down the ladder and into the pit. From here you can see a long storm water pipe, made of concrete, that leads out of the maze. You decide to take the risk and crawl through the pipe. Finally you reach a man hole and you exit the drain pipe to find freedom. You really feel like you have missed out on a lot though. You wonder what the maze had in store for you had you not taken the cowards way out."; } print "You cannot climb the ladder where it is."; if ( parent( ladder ) == south_east ) print " Currently it lies on the ground leaning against the eastern hedge. It seems to be long enough to reach the northern hedge, you wonder if you should move it."; rtrue; } self.playerOnLadder = false; give ladder ~concealed; south_east.description = "On the ground lie many withered hedge clippings. The hedges here are better maintained than some earlier plants. They all have a consistent box shape, with sharp lines and edges providing a well groomed look.^^From here you can go north or east."; "You climb back down off the ladder"; Take: "You really can't keep the ladder. Just try moving it."; ]; Object trap "trap" inner_south with description "The trap is well hidden.", name "trap" "booby", react_before [; Go: if ( children( player ) > 3 && ( ( noun == w_obj && inner_south.side_of_pit == e_obj ) || ( noun == e_obj && inner_south.side_of_pit == w_obj ) ) ) { deadflag = 1; "As you walk across the leaves, the ground underneath you collapses. It appears the floor was covered in the leaves to conceal a trap. Perhaps if you weren't carrying so much you wouldn't have fallen through."; } ], has scenery; Object wheel_barrow "wheel barrow" inner_south_east with description "This rusty old barrow has a flat tyre and a broken handle. Its tub is tappered towards the front making it easy to offload soil onto the garden.", name "barrow" "wheel_barrow" "wheelbarrow" "wheel barrow", before [; Take,Remove,Push,Pull,PushDir: "The barrow is too old and rusty to bother moving"; ], has static container open; Object insecticide "can of insecticide" wheel_barrow with description "BuggerOff Insecticide - for all your pest control needs!", name "insecticide" "can" "spray" "spraycan", spray_count 5, before [; ThrowAt: if ( second == gardener ) { move self to location; if ( gardener has animate ) { KillGardener(); "You throw the insecticide at the gardeners head. As it strikes the old man he passes out and collapses to the ground, dropping his gloves and hedge clippers."; } "You throw the insecticide at the lifeless gardener with no effect."; } SprayAt: if ( self.spray_count > 0 ) { self.spray_count--; if ( self.spray_count < 2 ) { print "The can is almost empty.^^"; } if ( second == gardener ) { if ( gardener has animate ) { KillGardener(); "You spray the insecticide at the gardener. As it stings his eyes he becomes disoriented and starts swinging his hedge clippers in your direction. He works himself into such a panic that his heart gives up and he collapses onto the ground, dropping his gloves and hedge clippers."; } "You spray the insecticide at the lifeless gardener with no effect."; } else if ( second == hole_in_wall or bugs ) { if ( hole_in_wall.insecticided == true ) "You have already sprayed the hole with enough insecticide"; score = score + 10; hole_in_wall.insecticided = true; "You spray the insecticide into the hole in the wall. That ought to kill anything living in there!"; } else if ( second == spider ) { if ( spider.been_sprayed++ >= 2 ) { deadflag = 1; "As you raise your arm to spray the spider one more time, the eight legged arachnid climbs the eastern hedge and pounces in your direction. With fangs dripping in venom, the spider jabs you in the back of your neck. Immediately you become paralyzed and you feel the venom boil your blood and it quickly spreads throughout your entire body right to your toes. You should leave pest control to the experts."; } else { "Spraying the spider seems to make it quite adjitated."; } } "You spray the insecticide at ", (the) second, " with little effect"; } "You squeeze the top but the can is empty."; ]; Object shovel "shovel" wheel_barrow with description "The shovel is about 1.2 meters long with a large square head. The shaft is made out of pine with a metal handle at the top.", before [; ThrowAt: if ( second == gardener ) { move self to location; if ( gardener has animate ) { KillGardener(); "You hurl the shovel at the gardeners head. The head of the shovel strikes him square in the head and causes a large gash accross his forehead. He passes out, dropping his gloves and hedge clippers."; } else { "You hurl the shovel at the lifeless gardener - drawing more blood from his already mutilated head."; } } ], name "shovel" "spade"; Object gardener "mad gardener" inner_south_west with description [; if ( gardener has animate ) { "The gardener appears to be about 65. He has a very bad smell and looks as if he hasn't showered in months. His long and messy grey beard and bushy eye brows make him seem more interested in trimming hedges than his own hair. He is mumbling something under his breath in a language you don't recognise.^^He carrys some gloves and hedge clippers."; } "The gardener is lying lifeless. You wish diplomacy could have worked with this guy, but it just never does."; ], name "gardener" "mad" "mad_gardener", life [; Ask: switch ( second ) { 'maze', 'hedge_maze': "~Grimple doova!~"; 'clippers', 'hedge clippers': "~Storty Fack~"; 'statue', 'stone': "~Fooob~"; } "~Grooble~"; Tell: "~Git Faaaked~"; Attack: deadflag = 1; "You sneak up behind the gardener and give him a hard fist in the back of his head. The old man joults and instinctively swings his hedge clippers in a large circle. The clippers cut you deep and cleanly across your throat.^^As you lie on the ground gasping for air and gurgling on your blood you realise that perhaps you aren't as strong as you thought"; Kiss: "He smells so bad that you decide that would be a bad idea"; Show, Give: "~Furt mi~"; ], before [; Take,Remove,Push,PushDir: "Now why would you want to do such a thing to an old man?"; ], has static animate; Object spider "giant spider" north_east with description "The giant spider measures about 2 meters long and has a long yellow stripe leading down its back. It has large eyes and fangs long enough to stab your heart through your head!", name "spider" "giant" "giant spider", appeased false, been_sprayed 0, before [; Take,Remove,Push,PushDir: "Doing so would no doubt result in your death!"; ], life [ w1 w2; Ask: switch ( second ) { 'riddle': if ( self.appeased == false ) { "~What do you call two young married spiders.~"; ! newly webs } "~I already told you the riddle and you already answered it. Quit bugging me.~"; } if ( self.appeased == false ) { "~Do not bother me with such boring questions. I just want to know the answer to the riddle!~"; } "~Do not bother me with such boring questions. We shared a riddle, now bug off.~"; Tell,Answer: wn = consult_from; w1 = NextWord(); w2 = NextWord(); if ( ( w1 == 'newly' && w2 == 'webs' ) || w1 == 'newlywebs' ) { if ( self.appeased == true ) "~You already told me. That joke is getting old~"; self.appeased = true; score = score + 10; "~Haha. That cracks me up everytime. Well done! You may pass.~"; } if ( self.appeased == true ) "~You got it right before, now bug off!~"; "~Thats not the answer to my riddle! Quit wasting my time.~"; Attack, ThrowAt: "~Don't even think about it~"; Kiss, Show, Give: "~Quit wasting my time.~"; ], has static animate; Object gloves "pair of gloves" inner_south_west with description "A tatty old pair of gardening gloves", name "gloves", before [; Wear: give gloves worn; "You slide the gloves on, they seem to fit well. Spot of gardening?"; Disrobe: give gloves ~worn; "Had enough gardening already?"; ], has clothing concealed; Object clippers "pair of hedge clippers" inner_south_west with description "A rusted pair of hedge clippers about 30cm long.", name "clipper" "clippers" "hedgeclippers" "hedge clippers", has concealed; Object hole_in_wall "hole in wall" north_west with description "The hole in the wall is quite small, just enough room for your hand.", name "hole" "gap" "opening" "wall", ! indicates the hole has been sprayed and bugs have been killed insecticided false, before [; ! check if key is in the hole - we know the hole will only ever contain the key Search: if ( children( self ) > 0 ) "At the back of the hole you can see a key."; "Nothing to see other than a few bugs!"; ! only allow the key to be put in the hole Receive: if ( noun ~= key ) print_ret (the) noun, " won't fit in the hole."; give key ~concealed; rfalse; ], has static scenery container open; Object bugs "bugs" hole_in_wall with description "Nasty, nasty bugs!", name "bugs" "bug", has concealed; Object key "key" hole_in_wall with name "key", description "The key has a round handle and a large tip. There is a small groove running round the handle towards the tip of the key. The key is made from brass but is very dull.", has concealed; Object plaque "Plaque" north_west with name "plaque", description "~If you are worthy, get the key from the opening in the wall~", has static scenery; Object hedge "Hedge" with name "hedge", description "Boy, you sure are sick of looking at hedges!", found_in south_west south south_east inner_south_west inner_south inner_south_east inner_north_west inner_north inner_north_east north_west north_east north, before [; CutAt: if ( parent(clippers) == player ) { ! don't confuse the issue of hedge vs struggling hedge, just assume they mean struggling if ( location == inner_north_east ) { <>; } else { "The hedge is far too thick to cut through."; } } else { "You don't have anything to cut it with!"; } Examine: if ( location == inner_north_east ) { <>; } ], has static scenery concealed; Object statue "statue" inner_north_east with description "The statue is a small goblin sized creature. It is made from stone with a very cheeky expression sprawled across its face.", name "statue", animated false, life [; Ask: if ( statue.animated == true ) { switch ( second ) { 'maze', 'hedge_maze': "~The maze has been here for many years.~"; 'exit', 'escape', 'leave', 'out': "~If you are asking how to free yourself from this maze, I will tell you. You must find the key and open the door in the north section to escape.~"; 'key': "~The key has long been sought but few have found it.~"; 'door': "~The door can be found in the north section of the maze. Cut or crawl your way through.~"; 'cut', 'cutting': "~You will need a tool to cut the struggling hedge with.~"; 'crawl', 'crawling', 'dig', 'shovel': "~Look for some loose dirt to know where to dig.~"; 'gardener', 'mad', 'mad gardener': "~The gardener is crazy. Don't waste time talking to him.~"; 'riddle', 'spider': "~The spider wants you to answer his riddle. The riddle is a very sad pun on newly married spiders. They are not newly weds they are newly ....~"; 'can', 'insecticide': "~The insecticide can be used to kill bugs.~"; 'book': "~The book will guide you.~"; } } Tell: if ( statue.animated == true ) { "~I am not really interested~"; } Attack, ThrowAt: "Its amazing what people try to do in some situations"; Kiss: if ( statue.animated == true ) { "~Don't you think I have had enough kisses!~"; } else { score = score + 10; statue.animated = true; "The statue quickly opens its eyes in surprise. ~I wasn't expecting that!~"; } Show, Give: if ( statue.animated == true ) { "~What do you think I am going to do with that!~"; } ], ! adapted from exercise 42 in designers manual daemon [ direction statue_location exit exit_count exit_chosen; if (random(3) ~= 1) rfalse; statue_location = parent( statue ); objectloop( direction in compass ) { exit = statue_location.(direction.door_dir); if ( exit ofclass Object && exit hasnt door) exit_count++; } if ( exit_count == 0 ) rfalse; exit_chosen = random( exit_count ); exit_count = 0; objectloop( direction in compass ) { exit = statue_location.(direction.door_dir); if ( exit ofclass Object && exit hasnt door ) exit_count++; if ( exit_count == exit_chosen ) { if ( exit == location && statue.animated == false ) { ! if the statue wanted to move to your location it won't but you will hear a noise print "You hear a noise to ", (the)statue_location; rfalse; } else if ( statue_location ~= location ) { move self to exit; rfalse; } } } ], has animate;