! _Hunter, in Darkness_ ! Special source-code edition ! Copyright 1999 Andrew Plotkin ! http://www.eblong.com/zarf/if.html ! This source code is provided for personal, educational use only. ! See README file for details. ! --- Object Antechamber "Base of Canyon" with initial [; if (self hasnt general) { give self general; StartDaemon(self); } ], daemon EndgameDaemonFunc, description [; if (self.phase) { self.phase = 0; print "You must be getting better at this. You're only freshly bruised. Lying still, even on cold stone, is painfully easy... but after a few minutes, you find yourself struggling to stand.^^"; } print "You are in an alcove, a side chamber at the base of a vaulting canyon. The walls spread upward around you. And the distant roof is hung with glimmering stars -- droplet-tipped stalactites in some hidden suffusion of light"; if (~~self.seen_once) { self.seen_once = true; print ". You think, against your will, that it was worth it.^"; if (~~wumpus_wounded) { rtrue; } print "^"; } else { print ". "; } print "A crevice runs along the canyon at your feet. You can cross it and continue on ahead"; if (ante_back in self) { print ", or re-enter the crawl behind you"; } "."; ], ambient_sound [; <>; ], ambient_smell [; <>; ], seen_once false, phase 0, light_level 1, each_turn [; if (~~wumpus_wounded) { "^(BUG) Endgame without wounding."; } if (ante_bats.phase >= 0 && ante_bats.phase < 4 && random(37) < 10) print (string) random("^A bat chitters angrily at its neighbor.^", "^The bats jostle each other around the pool.^", "^Another bats flutters down from above, and pushes into the mass.^"); ]; ObjExit -> ante_up "canyon slope" with name 'canyon' 'slope' 'above' 'u//' 'up' 'ascend' 'ascent', description "The wall slants up and away. Old, old stone has been water-worn, layer by layer, into a deep, V-shaped canyon. The climb might not be impossible on your best day; but as you are, tired and wounded and sore, you have no hope of it.", door_to "The climb is beyond you.", before [; Climb: <>; ]; ObjExit -> ante_back "crawl behind" with name 'low' 'behind' 'crawl' 'back' 'backward' 'backwards', description "Behind you is the crawl through which you came.", door_to [; if (ante_bats.phase < -4) "Bats are streaming from the low opening. Trying to fight through them would be foolhardy."; if (ante_bats.phase < 0) "Bats burst from the mouth of the crawl, fluttering wildly in your face, and you jump back."; MazeReenterStart(); MazeSetup(); return Maze; ]; ObjExit -> ante_leftright "canyon to either side" with name 'left' 'right', description [ lx rx; if (blood_trail) { lx = "left"; rx = "right"; } else { rx = "left"; lx = "right"; } print_ret "You are near the ", (string) lx, " end of the canyon; it narrows beyond passing in that direction. To the ", (string) rx, ", the canyon floor falls into broken stone and small chasms, no more passable than the other."; ], door_to [; return self.description(); ]; ObjExit -> ante_ahead "ahead" with name 'ahead' 'fore' 'forward' 'forwards', description "Beyond the crevice, the canyon floor runs back into a tangle of pillars and flowstone buttresses, which rise up the far canyon wall. You cannot see far in.", seen_once false, door_to [ ix; ix = false; switch (ante_bats.phase) { 4, 5: print "One of the bats flickers forwards as you move, and then drops back, unwilling to leave the swarm.^^"; 6, 7: ante_bats.phase = -1; move end_bats to WumpusRoom; remove wumpus; move wumpus to WumpusRoom; print "A cluster of bats flickers after you, chittering. You hunch your shoulders and try to ignore them.^^"; -10 to -1: ix = true; 8 to 20: print "(BUG) Bats in wrong phase.^^"; } print "You heave yourself wearily over the crevice"; if (~~ix) print ", and approach the twisted formations that make up the far canyon wall"; else print ", following the bats"; if (~~self.seen_once) { self.seen_once = true; print "...^^And you round a pillar, and stop there. ", (emph) "Here? Now?", "^"; } else { print ".^"; } return WumpusRoom; ]; ObjExit -> ante_crevice "crevice" with name 'crevice' 'd//' 'down' 'below' 'descend' 'descent', description "A canyon in the canyon. It is only a couple of feet wide, though it seems to widen beneath. At the bottom, perhaps six feet below, water rushes. It is only a remnant of the river that carved this place; but it boils the more furiously for being confined.", door_to [; deadflag = 1; "You lower yourself through the crevice, and drop.^^You have underestimated the strength of the current, and the depth. The water seizes you and batters you away."; ], before [; Enter: if (verb_word == 'cross') <>; rfalse; ThrownAt: if (noun has worn) { !### could be better print_ret "You're still wearing ", (the) noun, "."; } print (The) noun, " vanishes into the current and is gone.^"; Lose(noun); rtrue; Listen: "The cavern magnifies rushing water to an unvarying growl."; JumpInto: <>; JumpOver: <>; ]; Object -> ante_water "rushing water" with name 'rushing' 'water' 'river' 'stream' 'remnant', description "You can see water boiling furiously at the bottom of the crevice.", before [; Examine, VagueShoot: rfalse; Listen: <>; ThrownAt, Receive: <>; default: "The river is down at the bottom of the crevice, and it might not be a good idea to descend to it."; ], has scenery; Object -> ante_roof "roof" with name 'distant' 'ceiling' 'roof' 'star' 'stars' 'stalactite' 'light', description "Some passage far above must lead to the day. You can see nothing directly, but light lies along distant curves and folds of stone. And for each of thousands of stalactites, there is a droplet of water on its tip, and a glimmering star.", before [; Examine, VagueShoot: rfalse; default: "The roof of the cave is out of reach."; ], has scenery; Object -> ante_blood "pool of blood" with name 'pool' 'of' 'thick' 'dark' 'reeking' 'clotting' 'clotted' 'blood', seen_once false, describe [; if (~~wumpus_wounded) { rtrue; } new_line; if (~~self.seen_once) { print "The Wumpus certainly fled this way: a"; self.seen_once = true; } else { print "A"; } print " pool of thick, dark, reeking blood is spilled across the ground"; switch (ante_bats.phase) { 0 to 3: print ". Bats crawl all around it -- rustling, fluttering, feasting"; 4, 5: print ". Bats crawl all around it -- rustling, fluttering, feasting"; print ".^^Two bats have risen from the pool and circle suspiciously in the air above you"; 6, 7: print ". Bats crawl all around it -- rustling, fluttering, feasting"; print ".^^Several more bats circle above you, whistling"; -3 to -1: print ". Bats still crawl around it, but more are rising every moment"; -10 to -4: print ".^^Swarms of bats are swirling in from everywhere. A few circle the pool, but most disappear off across the canyon"; default: print ". (BUG) Bats in wrong phase"; } "."; ], description [; print "The pool is clotted and dark, nearly black in this dim light. It is bitter and foul; it already smells of decay."; if (ante_bats.phase >= -3) print " And bats squat all around it."; new_line; rtrue; ], before [; Examine, VagueShoot: rfalse; Listen: <>; Smell: "A violent bitter reek fills the air, overlying even the animal stink of the Wumpus's presence. The blood is cooling, but not yet dry."; default: if (ante_bats.phase < -3) "A few bats still circle the pool, and if one notices you, the whole swarm might. Besides, you've had enough of blood."; "A bat turns towards you as you approach. It ", (emph) "hisses.", " A small hiss... but you have no desire to attract the attention of the whole swarm."; ], has static; Object -> ante_bats "bats" with name 'bat' 'bats' 'swarm', description [; switch (self.phase) { 0 to 3: "Bats squat all around the spill of clotting blood. They do not seem to be paying you much heed; they are intent on their feast."; 4, 5: "Bats squat all around the spill of clotting blood. Most pay you no heed, but a couple have risen and are circling you suspiciously."; 6, 7: "Many bats squat around the spill of clotting blood; more flutter in the air around you."; -10 to -1: "Swarms of bats swirl everywhere. A few circle the pool, but most are disappearing off across the canyon."; default: "(BUG) Bats in wrong phase."; } rtrue; ], before [; Examine, VagueShoot: rfalse; Smell: <>; Listen: if (ante_bats.phase < -3) "Rattle of wing and laughing chitter. The sound nearly overwhelms the water below."; "The bats chitter mockingly to each other as they feed."; default: if (ante_bats.phase < -3) "You're not about to attract their attention now."; <>; ], phase 0, ! how interested are they in you? has pluralname scenery; ! --- Object WumpusRoom "Canyon Wall" with description [; print "Massive buttresses of stone rise all around you, climbing the canyon wall, flowing down again in cascades of pale fluorite. A path seems to climb up among them"; if (ante_bats.phase > -5) print "; but you don't think you can get to it right now"; else print ", beyond the writhing Wumpus"; "."; ], ambient_sound [; <>; ], ambient_smell [; <>; ], light_level 1; ObjExit -> wumproom_back "way back" with name 'crevice' 'back' 'behind' 'backward' 'backwards', description "Somewhere behind you is the crevice and the blood-pool beyond that, though you can see neither from here.", door_to [; print "You back up"; if (ante_bats.phase > -5) print ", trying not to take your eyes from its eyes. It works, or the Wumpus decides to allow it.^"; else print ". The Wumpus doesn't seem to notice your retreat.^"; return Antechamber; ]; ObjExit -> wumproom_up "path up" with name 'path' 'u//' 'up' 'ascend' 'ascent' 'buttress' 'buttresses' 'fore' 'ahead' 'forward' 'forwards', description [; print "A narrow path winds among the stone columns, up along the canyon wall"; if (ante_bats.phase > -5) print ". But the Wumpus crouches between you and it"; "."; ], door_to [; if (ante_bats.phase > -5) { RushCrossbow(); rtrue; } ante_bats.phase = -5; print "You take a hesitant step sideways. And another, sliding past the beast, trying to be a thin part of the canyon wall...^^ The Wumpus, lashing out at bats, doesn't seem to notice.^"; return Egress; ], before [; Climb: <>; ]; Object -> wumpus "Wumpus" with name 'beast' 'creature' 'prey' 'animal' 'monster' 'wumpus', initial [; print "The Wumpus is crouched before you"; if (ante_bats.phase <= -5) { if (end_bats notin WumpusRoom) print ". (BUG) Bats in wrong place"; print ". It sways forward and back, trying to escape the assault, and the crossbow wavers"; } else { print ". Blood trickles from the wound your bolt tore, down its hide, puddling on the floor"; if (~~self.seen_once) { self.seen_once = true; print ".^^"; } else { print ". "; } print "It holds your crossbow in its claws; gently cradled; loaded and cocked; steady on your throat"; } if (end_bats in WumpusRoom) { switch (ante_bats.phase) { -1: print ".^^The bats dive forward, then rise, emitting glass-shrill cries"; -2: print ".^^Bats circle warily overhead"; -3: print ".^^Bats rush overhead in a wheeling cloud"; default: print ".^^Bats rush overhead in a vast wheeling cloud"; } } "."; ], seen_once false, touched_once 0, description [; self.touched_once++; if (self.touched_once == 2) print (emph) "Wumpus yobgregorii,", " in the flesh...^^"; print "Later, all you will be able to remember are its eyes. They are rich mud-brown, and they hold your own without effort.^"; rtrue; ], before [; Examine, VagueShoot: rfalse; Listen: "There is no sound but its breathing and your own."; Smell: "You can smell a Wumpus."; default: if (ante_bats.phase > -5) { RushCrossbow(); rtrue; } else { deadflag = 1; "You begin moving towards the creature. It might be distracted enough...^^Perhaps not. The Wumpus lashes out with long claws, and deals a crushing blow."; } ], phase 0, ! for the running-out-of-patience thing has static animate; ! general means you've rushed the crossbow once Object -> wumpus_blood "puddle of blood" with name 'blood' 'puddle' 'puddling' 'of' 'trickle' 'wumpus^s' 'wound' 'wounds', parse_name [ wd num iswound; iswound = false; wd = NextWord(); while (WordInProperty(wd, self, name)) { if (iswound && wd == 'blood') return 0; if (wd == 'wound' or 'wounds') iswound = true; num++; wd = NextWord(); } return num; ], description "Fresh blood drips steadily down the Wumpus's side. The wound seems clean, though the crossbow bolt has been torn from it.", before [; Examine, VagueShoot: rfalse; default: <>; ], has scenery; Object -> wumpus_crossbow "crossbow" with name 'crossbow' 'bow' 'bolt', article "your", description [; print "It's yours. It's battered, but not too badly damaged to fire. It's loaded; it's cocked. The point of the bolt is still stained with the Wumpus's blood"; if (ante_bats.phase > -5) print ". You can see that very clearly, for the creature is holding it aimed very steadily at you"; else print ". Its aim wavers about as the creature tries to protect itself from the cloud that harries it"; "."; ], before [; Examine: rfalse; Cock, Uncock, VagueReload, Reload, ShootAt, VagueShoot: "You're not the one holding the crossbow now."; default: <>; ], has scenery; Object end_bats "bats" ! initially not present with name 'bat' 'bats' 'swarm', description [; switch (ante_bats.phase) { -2, -3: print "They hover above you, waiting. Their eyes are cold.^"; -4: print "They hover above you, waiting. There are many of them now, and their eyes are cold.^"; -10 to -5: print "They circle everywhere; a thick cloud of flickering wings surrounds the Wumpus.^"; default: "(BUG) Bats in wrong phase."; } rtrue; ], before [; Examine, VagueShoot: rfalse; Listen: "The bats rustle and hiss."; Smell: rfalse; default: print_ret "You want to get ", (emph) "closer", " to them?"; ], has pluralname scenery; [ RushCrossbow flag; if (flag) give wumpus general; if (wumpus hasnt general) { give wumpus general; "You take a tentative step towards the creature. And stop. The crossbow hasn't moved a fraction, but you see a claw moving restlessly on the trigger..."; } deadflag = 1; if (flag ~= 2) print "The Wumpus does not hesitate. "; print (emph) "Tunk.", "^^So this is what it's like.^"; rtrue; ]; ! --- Object Egress "Rising Path" with description "You are partway up the canyon wall, on a narrow path that climbs from ledge to ledge. The cavern is vast around you, water-hewn strata stretching upward to the stone forest of the roof; and somewhere above you, a crack of daylight sets it all glimmering...", ambient_sound [; <>; ], ambient_smell "A taste of fresh air is drifting down past the old stone.", light_level 1; ObjExit -> egress_down "path down" with name 'd//' 'down' 'descend' 'descent' 'below', description "The path winds around columns and buttresses, down to the canyon floor.", door_to [; ante_bats.phase = -8; print "You begin picking your way back down towards the canyon floor.^"; rtrue; ], before [; Climb: <>; ]; ObjExit -> egress_up "rising path" with name 'u//' 'up' 'ascend' 'ascent' 'rising' 'path' 'ledge' 'ledges', description "The path climbs up towards light.", door_to [; deadflag = 2; "You pick your way... slowly... up the canyon wall. Everything is heavy; you're glad you have nothing more to carry.^^Somewhere below, a hissing scream is cut off, abruptly. You round a pale fold of limestone, and you are blinded by daylight.^"; ], before [; Climb: <>; ]; Object -> egress_wumpus "Wumpus" with name 'beast' 'creature' 'prey' 'animal' 'monster' 'wumpus' 'bat' 'bats' 'swarm', initial "Down on the canyon floor, the Wumpus thrashes within a rustling black cloud. Dark growls rise to you.", description "The Wumpus sways, trying to shield its eyes. It is bleeding from many small bites now, not just the wound of your crossbow bolt.", before [; Examine, VagueShoot: rfalse; Listen: "Hissing growls rise above the sound of wings."; default: "The Wumpus is down below, on the floor of the canyon."; ], has static; ! --- [ EndgameDaemonFunc; if (~~wumpus_wounded) { deadflag = 1; "^And then the light is blocked, and a dark and stinking shape looms over you. You are an intruder; and the beast has claws."; } if (ante_bats.phase >= 0) { if (location == Antechamber) { if (wound.phase == 3) { ante_bats.phase++; switch (ante_bats.phase) { 2: print "^A bat suddenly pokes its stained nose up above the pool, casting about.^"; 4: print "^Two of the bats rattle up and begin circling above you.^"; 6: print "^Several of the bats are fluttering in the air around you, ignoring the drying pool of blood nearby.^"; 8: deadflag = 1; "^In a rush, together and by no visible signal, the bats are airborne. The chittering cloud rises -- and then falls towards you.^^You scramble back, covering your eyes; too late. The swarm is on you, harrying you, small teeth and shrieks like shards of glass. You cannot see. You stumble away from the storm, and the stone falls away into rushing water beneath you.^^No doubt the bats find your body eventually."; } } else { ! wound wrapped if (ante_bats.phase > 0) ante_bats.phase--; switch (ante_bats.phase) { 5: print "^The bats are returning to their clotted pool.^"; 3: print "^The last bat reluctantly ceases its restless circle around your head.^"; } } } else { ! not in Antechamber if (ante_bats.phase > 0) ante_bats.phase--; } } else { ! The bats are on the scent! Nothing stops them now. ante_bats.phase--; if (location == Antechamber) { switch (ante_bats.phase) { -3: print "^More bats are abandoning the half-dried pool.^"; -4: print "^The last of the bats flutters up from the pool. Others are dropping from above, from every direction, and streaming across the canyon.^"; -5: print "^You hear an angry hiss from across the canyon.^"; -6, -8: print "^Streams of bats continue to converge and swarm towards the Wumpus. The rattling of wings is overwhelming.^"; -7: print "^A hissing shriek echoes across the canyon. Bats scatter.^"; -9: deadflag = 1; print "^There is a roar, and something huge looms over you. The dark eyes of the Wumpus peer out of a chittering swarm. There is understanding somewhere in there, what you have done to it and why -- and rage.^^ The Wumpus lunges towards you, heedless now of what the bats might do; it only wants to reach you with its claws.^"; } } else if (location == WumpusRoom) { switch (ante_bats.phase) { -3: print "^More bats are arriving, streaming across the canyon.^"; -4: print "^The swarm grows thicker, swirling above the Wumpus, which tosses its head around angrily before returning its gaze to you.^"; -5: print "^The Wumpus grunts, and swats at an overbold bat. The tiny shape shrieks and falls broken to the ground; but the Wumpus hisses as well, and shakes blood from its forelimb.^^ And the swarm descends.^"; -6, -7, -8: print "^The Wumpus flails furiously within a swarm of biting black shadows.^"; -9: deadflag = 1; print "^The Wumpus turns towards you, shielding its face from the bats. There is understanding somewhere in there, what you have done to it and why -- and rage.^^ It lunges at you, heedless now of what the bats might do; it only wants to reach you with its claws.^"; } } else if (location == Egress) { switch (ante_bats.phase) { -8: print "^The Wumpus screams.^"; -9: deadflag = 1; print "^There is a roar, and something huge lurches up the path. The dark eyes of the Wumpus peer out of a chittering swarm. There is understanding somewhere in there, what you have done to it and why -- and rage.^^ It lunges at you, heedless now of what the bats might do; it only wants to reach you with its claws.^"; } } else { switch (ante_bats.phase) { -9: ante_bats.phase = -8; } } } if (deadflag == 0 && ante_bats.phase > -5) { if (location == WumpusRoom) { wumpus.phase++; if (wumpus.phase == 5) print "^", (emph) "Why is it waiting?", "^"; if (wumpus.phase > 6) { print "^The Wumpus raises its head for a moment. There is no other movement, but you know what is coming.^^"; RushCrossbow(2); } } else { if (wumpus.phase > 0) wumpus.phase--; } } ];