Place In_Cave "Inside Cave" with description "A wide but shallow cave not far inside the hill. There is no obvious exit, except for the way you came in.", out_to [; if (CoinsIn(left_pan)+CoinsIn(right_pan) < 6) "Something bars your way, and you hear the scales jangling militantly. You were trying to steal its coins!"; if (scales.number~=0) "Something bars your way, and you hear the scales jangle slightly with energy."; return Iron_Door; ], e_to [; return self.out_to(); ], cant_go "The only way is back ~out~ through the iron door.", after [; Take: if (parent(noun)==left_pan or right_pan) print_ret "Taken from ", (the) parent(noun), "."; ], has ~light; FeaturelessCube -> cave_cube "cube" with initial "Balanced on a rock formation is a featureless white cube."; Object -> scales "pair of scales" with name "pair" "of" "scales" "pans", number 0, describe [; print "^A fair-sized pair of scales hangs from a bracket in the cave wall. "; if (self.number==0) "The scales are balanced."; if (self.number==1) "The left-hand side is higher."; "The right-hand side is higher."; ], before [; "There are left and right hand pans, which you should refer to individually."; ], has static supporter; Class ScalePan with name "pan" "side" "tray", before [; Receive: if (noun ofclass Scroll or Coin) rfalse; if (noun==feather) rfalse; "The pans gleam with what almost seems greed, and somehow they contrive to nudge your hand past them with your worthless and boring item."; ], after [ i j d w1 w2; Receive, LetGo: i=scales.number; objectloop (j in left_pan) w1=w1 + WeightOf(j); objectloop (j in right_pan) w2=w2 + WeightOf(j); if (w1==w2) scales.number=0; if (w1 > w2) scales.number=-1; if (w1 < w2) scales.number=1; j=scales.number; d=(w2-w1)*(scales.number); if (j==i) rfalse; if (j==0) "The scales come into balance."; if (j==1) print "The left pan "; else print "The right pan "; if (d==1) "very slowly rises up."; "rises up."; ], has supporter scenery; [ WeightOf obj; if (obj==bronze_coin) return 2; if (obj ofclass Scroll || obj==feather) return 1; return 3; ]; [ CoinsIn obj i c; objectloop (i in obj) if (i ofclass Coin) c++; return c; ]; ScalePan -> right_pan "right pan" with name "right"; GoldCoin -> ->; GoldCoin -> ->; GoldCoin -> ->; ScalePan -> left_pan "left pan" with name "left"; BronzeCoin -> -> bronze_coin; GoldCoin -> ->; GoldCoin -> ->; Scroll -> -> crumpled_scroll "crumpled scroll" with name "crumpled"; Spell -> -> -> urbzig_spell with name "urbzig", purpose "turn a dangerous object into a harmless one", magic [; if (second==0) "The spell fizzles away."; if (second==player) "It's a matter of opinion, isn't it?"; if (second==helistars_book or mace || second ofclass FeaturelessCube) { CDefArt(second); remove second; if (second==mace && cyclops in location) { remove cyclops; move eye_cube to location; " turns into a featureless white cube just as the cyclops was about to hit you with it. Mightily embarrassed by this, he drops the cube and runs off!"; } print " turns into a moth and flutters away.^"; rtrue; } print_ret "Nothing obvious happens. Perhaps ", (the) second, " isn't so very dangerous after all."; ], unmagic [; if (second==0) "The spell fizzles away."; if (second==player) "It's a matter of opinion, isn't it?"; if (second has static || second has scenery) { print_ret "Your spell is too weak for something quite as monumentally harmless as ", (the) second, "."; } if (second==helistars_book or snake or cyclops or mace || second ofclass FeaturelessCube) "Nothing obvious happens."; if (second in player) { remove second; deadflag = true; "Suddenly, a tarantula races up your arm to your throat! Perhaps it was unwise to gizbru something you were actually holding."; } if (cyclops has general) "Nothing happens. Perhaps that's just as well, after the last time."; move cyclops to location; remove second; give cyclops general; StartTimer(cyclops, 5); print_ret (The) second, " is replaced by a buck-toothed cyclops wielding a mace!"; ]; Object cyclops "buck-toothed cyclops" with name "buck" "toothed" "buck-toothed" "cyclops", initial "A huge buck-toothed cyclops menaces you, armed with a heavy mace!", before [; Cast: if (the_spell_was == bozbar_spell) "Does the term ~death wish~ mean anything to you?"; if (the_spell_was == urbzig_spell) "The cyclops bellows with glee as your spell has no effect. (After all, he wouldn't be ~dangerous~ if an urbzig spell worked on him, would he?)"; ], life [; "He roars incoherently, swinging the mace!"; ], time_left 0, time_out [; if (self notin location) { remove self; rtrue; } deadflag = true; remove mace; remove cyclops; "Feeling that he's given you quite long enough to explain why you made such a mess of his life, he swings the great mace maniacally down on you!"; ], each_turn [ i; i=random(4); if (i==1) "^The cyclops leaps and bellows!"; if (i==2) "^Whirling the mace, the cyclops jabbers at you incoherently."; if (i==3) "^The cyclops is losing patience (the appropriate cyclops word is untranslatable into English, but approximately means ~forbearance in not smashing all nearby skulls~)."; "^The cyclops jabs you with the mace, almost breaking your rib."; ], has animate transparent; Object -> mace "mace" with name "heavy" "mace" "axe", description "It looks much too heavy for you to even lift."; FeaturelessCube -> eye_cube "cube" with initial "A featureless white cube lies where the cyclops dropped it.";