{*** FUNNY OBJECT ROUTINES ***} paper(ACTION) = (IF ($eq ($verb) sign) THEN (IF ($prop paper signed) THEN ($say "You already signed it.\n") ($exit 1) ) (IF ($ne ($loc pen) .ME) THEN ($say "You don't have anything to write with.\n") ($exit 1) ) (IF ($ne ($loc paper) .ME) THEN ($say "You don't have the release with you.\n") ($exit 1) ) ($setp paper signed 1) ($move grate .ALL) (IF ($eq ($loc .ME) mrm3) THEN ($say "In a blinding flash of light, a stone archway appears in the east wall!\n" ) ELSEIF ($eq ($loc .ME) mrm5) THEN ($say "The grate magically disappears into thin air.\n") ($exit 1) ELSE ($say "You hear strange noises in the nearby rooms.\n") ) ($exit 1) ELSEIF ($eq ($verb) read) THEN (IF ($ne ($loc paper) .ME) THEN ($say "You don't have the paper with you.\n") ELSE ($say " THIS CONTRACT LIMITS OUR LIABILITY READ IT I, the undersigned, will not hold the AARDVARK, the UCLA Computer Sciences Department, the UCLA Computer Club, Bell Labs, or the Digital Equipment Corporation responsible for any injuries or deaths due to my executing this program.\n" ) ($setp paper readl 1) ) ($exit 1) ) ; spices(ACTION) = (IF ($and ($eq ($verb) throw) ($eq ($loc .ME) irm8)) THEN ($say "The bag of spices lands on the other side of the river.\n") ($move spices irm9) ($exit 1) ELSEIF ($eq ($verb) eat) THEN ($say "Munch, Munch Munch. It needed a little more salt.\n") ($move spices .ALL) ($exit 1) ELSEIF ($and ($eq ($verb) throw) ($eq ($loc .ME) irm9)) THEN ($say "The bag of spices gets intercepted by one of the crocodiles, who promptly swallows it.\n" ) ($move spices .ALL) ($exit 1) ) ; rupees(ACTION) = (IF ($and ($eq ($verb) throw) ($or ($eq ($loc .ME) irm8) ($eq ($loc .ME) irm9))) THEN ($say "The bag is too heavy to throw across the river. It lands in the middle of the river and sinks to the bottom.\n" ) ($move rupees .ALL) ($exit 1) ) ; coconut(ACTION) = (IF ($and ($eq ($loc .ME) irm19) ($eq ($verb) drop)) THEN (IF ($not ($prop rupees wellbt)) THEN ($say "The water in the well rises.\n") ELSE ($say "The water level in the well slowly rises. Magically floating on the water is a bag of rupees.\n" ) ($setp rupees wellbt 0) ($move rupees irm19) ) ELSEIF ($and ($eq ($verb) eat) ($eq ($loc coconut) .ME)) THEN ($say "The coconut is too large for you to consume.\n") ($exit 1) ) ; clarinet(ACTION) = (IF ($and ($eq ($verb) play) ($eq ($loc clarinet) .ME)) THEN (IF ($and ($eq ($loc .ME) irm22) ($eq ($loc cobra) irm22)) THEN ($say "Your clarinet playing sounds so poor that the cobra slithers off in terror.\n" ) ($move cobra .ALL) ($exit 1) ELSEIF ($and ($eq ($loc .ME) irm16) ($eq ($loc rope) irm16)) THEN (IF ($eq ($prop rope ropstf) 0) THEN ($say "The rope magically extends itself up into the air.\n") ($setp rope ropstf 1) ($exit 1) ) ) ($say "Benny Goodman you ain't.\n") ($exit 1) ) ; rope(ACTION) = (IF ($and ($prop rope ropstf) ($eq ($verb) take)) THEN ($setp rope ropstf 0) ($return 0) ELSEIF ($or ($eq ($loc .ME) prm2) ($eq ($loc .ME) prm3)) THEN (IF ($prop rope rtied) THEN (IF ($eq ($verb) take) THEN ($say "You have to untie the rope first.\n") ($setg Skip TRUE) ELSEIF ($eq ($verb) tie) THEN ($say "It's already tied, turkey.\n") ($exit 1) ELSEIF ($eq ($verb) untie) THEN (IF ($eq ($loc .ME) prm2) THEN ($move rope .ME) ($setp rope rtied 0) ($setp rope LDESC rldesc) ($setp rope SDESC rsdesc) ($say "You untie the rope and coil it up.\n") ELSEIF ($eq ($loc .ME) prm3) THEN ($say "It's tied down at the other end.\n") ) ($exit 1) ) ELSE (IF ($eq ($verb) tie) THEN (IF ($eq ($loc .ME) prm2) THEN ($say "You tie one end of the rope around the pole; the other end dangles down into the canyon.\n" ) ($move rope prm2) ($setp rope rtied 1) ($setp rope LDESC 0) ($setp rope SDESC 0) ($exit 1) ) ($say "I see nothing to which to tie it.\n") ($exit 1) ELSEIF ($eq ($verb) untie) THEN ($say "It's already untied.\n") ) ) ) ; river(ACTION) = (IF ($and ($ne ($loc .ME) irm8) ($ne ($loc .ME) irm9)) THEN ($say "You see no river here.\n") ($exit 1) ELSEIF ($eq ($verb) take) THEN ($say "You can't do that to the river!\n") ($setg Skip TRUE) ) ; cobra(ACTION) = (IF ($and ($eq ($verb) take) ($eq ($loc .ME) ($loc cobra))) THEN ($say "Taking the cobra would be a poor idea.\n") ($setg Skip TRUE) ) ; crocodile(ACTION) = (IF ($eq ($verb) take) THEN ($say "I can't get to any crocodiles from here.\n") ($setg Skip TRUE) ) ; cmara = (IF ($eq ($verb) take) THEN ($say "The statue is too heavy for you to carry.\n") ($setg Skip TRUE) ($return TRUE) ) ($return FALSE) ; claks = (IF ($and ($or ($eq ($verb) take) ($eq ($verb) touch)) ($eq ($prop statue tlakst) 0)) THEN ($say "The statue slides away very easily, revealing a secret passage.\n" ) ($setp statue tlakst 1) ($setg Skip TRUE) ($return TRUE) ) ($return FALSE) ; mara(ACTION) = (IF ($eq ($loc .ME) irm10) THEN (cmara) ) ; vishnu(ACTION) = (IF ($eq ($loc .ME) irm11) THEN (cmara) ) ; lakshmi(ACTION) = (IF ($eq ($loc .ME) irm12) THEN (claks) ) ; statue(ACTION) = (IF ($or ($eq ($loc .ME) irm10) ($eq ($loc .ME) irm11)) THEN (IF ($not (cmara)) THEN ($say "That won't accomplish anything.\n") ($exit 1) ) ELSEIF ($eq ($loc .ME) irm12) THEN (IF ($not (claks)) THEN ($say "I don't see how you can do that to a statue.\n") ($exit 1) ) ) ; banana(ACTION) = (IF ($eq ($loc banana) .ME) THEN (IF ($eq ($verb) eat) THEN ($say "You eat the banana, peel and all.\n") ($move banana .ALL) ($exit 1) ) ) (IF ($eq ($loc .ME) irm20) THEN (IF ($eq ($verb) drop) THEN ($say "The monkey picks up the banana, eats it, and discards the banana-peel. As soon as the monkey finishes eating the banana, a bolt of lighting hits the stone slab and cracks it open.\n" ) ($setp monkey fedmky 1) ($move banana .ALL) ($move peel irm20) ($setg Skip TRUE) ) ) ; horn(ACTION) = (IF ($prop rhino cutflg) THEN ($return 0) ELSEIF ($eq ($loc .ME) irm13) THEN (IF ($eq ($verb) take) THEN ($say "The horn is still attached to the rhino!\n") ($setg Skip TRUE) ELSEIF ($eq ($verb) cut) THEN (IF ($ne ($loc saw) .ME) THEN ($say "You don't have something to cut the horn with.\n") ($exit 1) ELSEIF ($prop rhino earplg) THEN ($say "You cut the horn off without waking up the rhino.\n") ($setp rhino cutflg 1) ($setp horn NOTAKE FALSE) ($exit 1) ELSE ($say "The noise of the sawing wakes up the rhinoceros who tramples you to death because you disturbed his beauty sleep.\n" ) (exitg) ) ) ) ; lattice(ACTION) = (IF ($eq ($loc .ME) irm13) THEN (IF ($eq ($verb) take) THEN (IF ($prop rhino earplg) THEN ($say "You successfully take the lattice without waking the rhino. Unfortunately, the lattice was the structure which supported the roof of the room, and the ceiling comes crashing down upon you and breaks every bone in your body.\n" ) ELSE ($say "As you take the lattice, a large part of the bamboo falls down. The noise caused by the falling bamboo scares the sleeping rhinoceros who tramples you in his panicked exit from the room.\n" ) ) ) (exitg) ) ; monkey(ACTION) = (IF ($eq ($loc .ME) irm20) THEN (IF ($eq ($verb) feed) THEN (IF ($eq ($loc banana) .ME) THEN ($say "The monkey takes your banana, peels it, eats it, and throws away the banana peel. As soon as he finishes eating the banana, there is a rumble from the depths of the earth and a crack appears in the stone slab.\n" ) ($setp monkey fedmky 1) ($move banana .ALL) ($move peel irm20) ($exit 1) ) ) ) ; cotton(ACTION) = (IF ($eq ($loc .ME) irm13) THEN (IF ($and ($eq ($verb) drop) ($eq ($iobj) ears)) THEN ($say "You stick the wads of cotton into the rhino's ears.\n") ($move cotton .ALL) ($setp rhino earplg 1) ($setg Skip TRUE) ($return 0) ) (IF ($eq ($loc cotton) .ALL) THEN (IF ($eq ($loc .ME) irm13) THEN (IF ($eq ($verb) take) THEN ($setp rhino earplg 0) ) ) ) ) ; pole(ACTION) = (IF ($and ($eq ($loc .ME) prm2) ($eq ($verb) take)) THEN ($say "The pole is firmly cemented into the ground.\n") ($setg Skip TRUE) ) ; lamp(ACTION) = (IF ($eq ($verb) light) THEN (onlmp) ($exit 1) ELSEIF ($eq ($verb) douse) THEN (IF ($not ($prop lamp LIGHT)) THEN ($say "The lamp is already off!\n") ELSE ($setp lamp LIGHT 0) ($say "The lamp is now off.\n") ) ($exit 1) ) ; oven(ACTION) = (IF ($and ($eq ($loc .ME) irm4) ($eq ($verb) open)) THEN ($say "The door of the oven doesn't budge.\n") ($exit 1) ) ; grate(ACTION) = (IF ($and ($eq ($prop paper signed) 0) ($eq ($loc .ME) mrm5)) THEN (IF ($or ($eq ($verb) open) ($eq ($verb) take)) THEN ($say "The grate appears to be firmly cemented into the wall.\n") (IF ($eq ($verb) open) THEN ($exit 1) ELSE ($setg Skip TRUE) ) ELSEIF ($eq ($verb) shut) THEN ($say "The grate is already shut.\n") ($exit 1) ) ) ; weapo = (IF ($eq ($verb) throw) THEN (IF ($and ($not ($prop bear hitbr)) ($eq ($loc .ME) prm19)) THEN ($say "The axe bounces harmlessly off of the bear.\n") ($move axe prm19) ($exit 1) ELSEIF ($eq ($loc .ME) prm14) THEN ($say "The weapon that you just threw imbeds itself deep into the skull of the mammoth and is covered by the mammoth's long fur so that it can't be seen. The mammoth just stares back at you blankly.\n" ) ($move ($dobj) .ALL) ($exit 1) ELSEIF ($or ($eq ($loc .ME) irm8) ($eq ($loc .ME) irm9)) THEN ($say "You miss the crocodile and your weapon sinks into the river.\n" ) ($move ($dobj) .ALL) ($exit 1) ELSEIF ($eq ($loc .ME) irm13) THEN ($say "Your weapon bounces harmlessly off of the rhino.\n") ($move ($dobj) irm13) ($exit 1) ELSEIF ($and ($eq ($loc .ME) prm6) ($not ($prop smilo stond))) THEN ($say "The sabre-tooth catches your weapon in its mouth and promptly swallows it.\n" ) ($move ($dobj) .ALL) ($exit 1) ELSEIF ($and ($eq ($loc .ME) prm8) ($not ($prop trogl killd))) THEN ($say "You hit the troglodyte, who, screaming in pain, drops the gold nugget and falls over the cliff.\n" ) ($setp trogl killd 1) ($move ($dobj) .ALL) ($move nugget prm8) ($exit 1) ) ) ; spear(ACTION) = (IF ($eq ($loc spear) .ME) THEN (IF ($ne ($loc .ME) prm19) THEN (weapo) ) (IF ($eq ($verb) throw) THEN ($say "You repeatedly throw your spear at the bear. Eventually, he gets bored and wanders off.\n" ) ($move bear .ALL) ($move spear prm19) ($setp bear hitbr 1) ($exit 1) ) ELSEIF ($eq ($loc .ME) prm17) THEN (IF ($eq ($verb) take) THEN (IF ($not ($prop spear tooky)) THEN ($say "You hear a loud roar as an avalanche blocks the path to your north.\n" ) ($setp spear tooky 1) ) ) ELSEIF ($eq ($verb) shake) THEN ($say "I don't see any playwrights here.\n") ELSEIF ($and ($eq ($loc .ME) prm23) ($eq ($verb) take)) THEN ($say "As soon as you take the spear, the Tyranosaurus Rex closes his mouth and swallows you.\n" ) (exitg) ) ; axe(ACTION) = (IF ($eq ($loc axe) .ME) THEN (weapo) ) ; smilo(ACTION) = (IF ($and ($eq ($loc .ME) prm6) ($eq ($verb) take)) THEN ($say "You must be dumber than you look.\n") ($setg Skip TRUE) ) ; troglodyte(ACTION) = (IF ($and ($eq ($loc .ME) prm8) ($eq ($verb) take)) THEN ($say "The troglodyte does not look like he wants to be carried.\n" ) ($setg Skip 1) ) ; plant(ACTION) = (IF ($eq ($loc .ME) prm6) THEN (IF ($or ($eq ($verb) throw) ($eq ($verb) drop)) THEN (IF ($not ($prop smilo stond)) THEN ($say "The plant you were holding turns out to be primo grade catnip. The sabre-tooth cat grabs the plant and runs off purring loudly.\n") ($move plant .ALL) ($setp smilo stond 1) (IF ($eq ($verb) throw) THEN ($exit 1) ELSE ($setg Skip TRUE) ) ) ) ) (IF ($eq ($verb) eat) THEN ($say "You completely eat the plant and now feel quite nauseous.\n") ($move plant .ALL) ($exit 1) ) ; nugget(ACTION) = (IF ($and ($eq ($verb) take) ($not ($prop trogl killd))) THEN ($say "He ain't gonna let you take it.\n") ($setg Skip TRUE) ) ; cheese(ACTION) = (IF ($eq ($verb) eat) THEN ($say "You eat the cheese, but nothing peculiar happens.\n") ($move cheese .ALL) ($exit 1) ELSEIF ($and ($eq ($verb) drop) ($eq ($loc .ME) prm14)) THEN ($say "As soon as you drop the cheese, a mouse runs out of the hole in the east wall and takes it. This scares the mammoth who runs off in terror.\n" ) ($setp mammoth blokd 1) ($move mammoth .ALL) ($move cheese .ALL) ($setg Skip TRUE) ) ; mammoth(ACTION) = (IF ($eq ($loc mammoth) ($loc .ME)) THEN (IF ($eq ($verb) feed) THEN ($say "He doesn't look hungry.\n") ($exit 1) ELSEIF ($eq ($verb) take) THEN ($say "He doesn't look too easy to carry.\n") ($setg Skip TRUE) ) ) ; feet(ACTION) = (IF ($eq ($verb) wipe) THEN (IF ($ne ($loc towel) .ME) THEN ($say "You don't have something to wipe them with.\n") ($exit 1) ELSE ($say "You just cleaned off your feet.\n") ($setp feet wiped 0) ($exit 1) ) ELSEIF ($eq ($verb) touch) THEN ($say "You can't without bending your knees.\n") ) ; cairn(ACTION) = (IF ($eq ($loc .ME) prm18) THEN ($say "How dare you do such a thing. Any idiot with just the slightest knowledge of prehistoric etiquette knows that you aren't supposed to do anything to a cairn.\n" ) ($exit 1) ) ; bear(ACTION) = (IF ($eq ($loc .ME) prm19) THEN (IF ($eq ($verb) take) THEN (IF ($not ($prop bear hitbr)) THEN ($say "The bear is a little too bulky to carry.\n") ($setg Skip TRUE) ) ) ) ; tyranosaur(ACTION) = (IF ($and ($ne ($loc .ME) prm22) ($ne ($loc .ME) prm23)) THEN ($say "What? One of those things hasn't existed in several million years.\n" ) ) ; hole(ACTION) = (IF ($eq ($loc .ME) prm14) THEN ($say "That hole is too small to do anything with.\n") ($exit 1) ELSEIF ($eq ($loc .ME) irm19) THEN (IF ($and ($eq ($verb) drop) ($eq ($iobj) hole)) THEN ($say "It falls back out of the hole.\n") ($setg Skip TRUE) ) ELSEIF ($eq ($loc .ME) irm6) THEN (IF ($and ($eq ($verb) drop) ($eq ($iobj) hole)) THEN (IF ($eq ($dobj) spices) THEN ($say "The bag of spices rips against the jagged sides of the shaft and almost all of the spices get blown away in the wind.\n" ) ($move spices .ALL) ELSEIF ($eq ($dobj) rupees) THEN ($say "The rupees fall down the shaft into the darkness below. You eventually hear a barely audible splash.\n" ) ($setp rupees wellbt 1) ($move rupees .ALL) ELSE ($say "That doesn't fit in the hole.\n") ) ($setg Skip TRUE) ($return 0) ) ELSE ($say "I do not see any holes here.\n") ($exit 1) ) ; newspaper(ACTION) = (IF ($eq ($verb) read) THEN ($say " DAILY GNUS\n Vol 2. 25 AUGUST\n \n " ) ($say "Spies in the far reaches of the Museum have reported that new construction is now taking place.\n\n" ) ($say "Dungeon consultant Mr. Mctesq has recently waved his magic wand over the aardvark museum. The following things should be brought to light:\n \tThe commands SAVE, RESTORE, and SHELL exist and work.\n" ) ($say "\tENTER is a verb, but IN is a preposition.\n\n") ($say "Again, Adventurers are reminded that restocking of the museum sections will be greatly rewarded.\n\n" ) ($exit 1) ) ; crack(ACTION) = (IF ($eq ($verb) jamb) THEN ($say "The only climbable cracks in this place are A4.\n") ($exit 1) ) ($say "I can't figure that out. I'm not as smart as I am cracked up to be.\n" ) ($exit 1) ; shaft(ACTION) = (IF ($eq ($verb) jamb) THEN ($say "Try jamb crack (How do you jamb a shaft?)\n") ($exit 1) ELSEIF ($and ($eq @Verb drop) ($eq @Iobj shaft)) THEN ($setg Iobj hole) (($prop hole ACTION)) ) ;