Attribute darksee; Class UnlitRoom with initial [; if (~~(torch has light && IndirectlyContains(self, torch))) { if (self == ConfusingEnd && cisterndoor has open) return; print "[BUG] Where is light source?^"; } ], before [; Smell: if (noun == nothing && (location ~= CavePit1 or CavePit2 or CavePit3)) "Ancient stone, ancient earth, pure water: the scent of the underworld."; ]; [ GoDark dest msg; if (torch hasnt light) { "[BUG] In dark room with torch unlit."; } if (~~(IndirectlyContains(player, torch))) { print "You really don't want to"; if (location == CavePit1 or CavePit2 or CavePit3) print " move away"; else print " walk away"; " from your only light source."; } if (metaclass(dest) == String) { print (string) dest, "^"; rtrue; } if (msg) { switch (metaclass(msg)) { String: print (string) msg, "^"; Routine: msg(); default: print "[BUG] GoDark with strange msg^"; } } return dest; ]; [ ToDarkness rm dest addlight; if (rm == nothing) rm = location; if (rm == CavePit3 or CavePit2) { deadflag = 1; GuideEnqueue(GuideFellInPitMessage); "^The vertical stone around you seems to twist in the blackness. You flail, suddenly unsure which way is up... You quickly discover which way is down."; } addlight = true; switch (rm) { FarShore: dest = FarShoreDarkness; RiverCrawl: addlight = false; dest = CrawlDarkness; CavePit1: addlight = false; dest = PitDarkness; CavePit2: print "[BUG] ToDark in deep pit.^"; addlight = false; dest = PitDarkness; default: dest = Darkness; Darkness.baseroom = rm; give Darkness ~general; if (rm == CentralCave) Darkness.number = 1; else Darkness.number = 2; } if (addlight) { safemove(darklight, dest); darklight.count = 2; } else { safemove(darklight, nothing); } PlayerTo(dest); ]; [ ToLight; PlayerTo(location.baseroom()); ]; [ RoomIsDark rm; if (rm ofclass UnlitRoom) { if (rm == ConfusingEnd && cisterndoor has open) rfalse; rtrue; } rfalse; ]; [ UnreachableInDark obj par; par = ultimate_parent(obj); if (par == obj or nothing) rfalse; if (IndirectlyContains(player, obj)) rfalse; if (par ofclass UnlitRoom) rtrue; if (par == GreyChamber or CisternRising) rtrue; if (par ofclass CisternRoom) rtrue; rfalse; ]; Object HintoDarkness with hint_name "finding your way out of the dark", count 0, description [; if (torch in player && warmberries in player) { if (torch has light) { print "[BUG] Your torch is lit in the dark."; return; } if (self.count & $1 == 0) { self.count = self.count | $1; print "You are carrying a torch, and the means to light it."; return 2; } print "You can simply say ", (helpcmd) "light torch", ", or ", (helpcmd) "light torch with orange berry", ", or ", (helpcmd) "put orange berry on torch", "."; rtrue; } if (self.count & $2 == 0) { self.count = self.count | $2; print "You are lost in the dark, and you have no sense of direction."; return 2; } if (self.count & $4 == 0) { self.count = self.count | $4; print "Even though you can't see, try ", (helpcmd) "look", " or ", (helpcmd) "examine darkness", ". Re-examining your surroundings is never a bad idea."; return 2; } if (darklight in location) { if (self.count & $8 == 0) { self.count = self.count | $8; print "Notice that glimmer of light? It could provide a reference point for getting out of here."; return 2; } if (self.count & $10 == 0) { print "Try ", (helpcmd) "follow light", " or ", (helpcmd) "walk towards light", "."; if (CentralCave has visited || ConfusingPassage has visited) { rtrue; } self.count = self.count | $10; return 3; } } else { switch (location) { CrawlDarkness: print "It seems your only choice is to crawl down, and hope you can find your way out."; PitDarkness: print "Dropping off this ledge in the dark would be suicidal. You'd better climb up and hope you can find your way out."; } rtrue; } return HintoOutsideDark.description(1); ]; ! ---- Class DarknessRoom with short_name "Darkness", initial [; self.name_str = random( "It is utterly dark... the darkness of the spaces within the world.", "You are somewhere within utter darkness, somewhere within the earth.", "You are in the unchanging, unleavened darkness of the world below ground.", "Darkness is all around you... infinitely far away, and an inch from your groping hands.", "It is dark, as dark as you could imagine -- a lightless dream beneath stone." ); ], description [; if (torch has light && IndirectlyContains(self, torch)) { print "[BUG] Light source in dark?^"; } print (string) self.name_str, "^"; if (darklight in self && darklight.count == 0) { print "^But you can make out the faintest glimmer of light, somewhere.^"; } GuideDarknessMessage.invoke(); ], name_str 0, baseroom CentralCave, before [; Examine, Search, LookBehind, LookUnder: if (noun has darksee) rfalse; "It is too dark too see."; Smell: if (noun == nothing) "A nightinghound might smell his way home in the dark; you cannot."; Drop: if ((noun == player) || (noun in parent(player)) || (noun notin player)) rfalse; if (noun has worn) { L__M(##Drop,3,noun); ; if (noun has worn && noun in player) rtrue; } if (noun == dagger && self == Subterrane) { move noun to SittingRoom; "You toss the dagger away. It merges with the darkness... or with the void within the circle... and flickers away into nothing."; } move noun to (self.baseroom()); print "You toss ", (the) noun, " away"; if (location == Subterrane) ". It merges with the darkness, and fades from your unsight."; else ". It falls somewhere in the dark."; ], invoke "[BUG] Darkness.invoke unimplemented.", evoke "[BUG] Darkness.evoke unimplemented.", d_to "If there is a pit nearby, the last thing you want is to find it.", u_to "Climbing in the dark is insanely foolhardy, if it is possible at all.", out_to [; GuideDarknessMessage.invoke(); "You are unsure which way is out."; ], cant_go [; GuideDarknessMessage.invoke(); "You have no sense of direction in the dark."; ], hinto HintoDarkness, coredir "somewhere lost in the echoing dark"; Object plaindark "darkness" with name 'dark' 'darkness' 'black' 'blackness' 'night', found_in [; if (location ofclass DarknessRoom && location ~= Subterrane) rtrue; ], description [; if (darklight in location) "The darkness is imperfect."; else "The darkness is perfect."; ], before [; Examine: rfalse; Search: <>; Smell: <>; Listen: "Silence."; Enter: "You are already in the dark."; Exit: <>; default: "The dark is intangible."; ], has scenery darksee; Object GuideDarknessMessage with invoke [; if (Subterrane has visited || self has general) return; self.count++; if (self.count < 5) return; if (~~self.number) GuideEnqueue(self); else OfferHint(HintoDarkness); ], number false, count 0, description [; self.number = true; print "You are lost in the dark.^^"; print "It's a frightening situation, but one you will inevitably fall into, from time to time. The best defense is to carry a light source -- but it's too late for that now."; if (torch in player && warmberries in player) print " (Unless you can put one together from the items you're carrying.)"; print " You'll have to find a way back to the lit world."; print "^^In some games, wandering around in the dark is very dangerous. There can be monsters, or bottomless pits. However, this game's darkness is safe... relatively safe."; ], has ~general; DarknessRoom Darkness with number 0, invoke [; self.number--; if (self.number <= 0) { print "You stumble slowly ahead, feeling blindly for a wall... and then you can see the outline of your hand against the light.^"; give GuideDarknessMessage general; GuideDarknessMessage.count = 0; PlayerTo(CavePassage); rtrue; } if (self hasnt general) { print "You"; } else { print "You turn, and"; } print " move towards the light, slowly; feeling each step in the dark, as if an unseen slope or pit were waiting. Which may be."; print "^^After a time, the light seems stronger.^"; give self ~general; self.baseroom = CentralCave; self.initial(); PlayerTo(Darkness); ], evoke [ str; self.number++; if (self.number >= 6) { print "Something moves against the face of the darkness.^^"; print (emph) "But it is not light.", "^"; TransportEffect(); PlayerTo(Subterrane); rtrue; } if (self hasnt general) { print "You set your back to the light, as best you can. And you move, slowly -- reaching ahead with every step -- into the empty and utter dark."; } else { str = random( "Shapes and unshapes seem to slide past you through the black world. You can feel nothing around you as you move.", "You stumble on an unseen unevenness in the stone. And you steady, trying to catch your balance, and continue onward.", "A faint drip of water echoes in the black. Perhaps you move along the verge of a river.", "You move unsteadily through the abyss.", "You step cautiously amid unseen pillars of stone.", "The black world moves invisibly past, as you advance into nowhere.", "Every step you take is invisibly, indistinguishably identical to the last." ); print (string) str; } print "^^The trace of light dims behind you.^"; give self general; self.baseroom = ConfusingPassage; self.initial(); PlayerTo(Darkness); ], has ~general; Object darklight "light" with name 'dim' 'faint' 'glimmer' 'gleam' 'glow' 'of' 'light', description [; if (self.count > 0) "You strive to find light in the impenetrable dark."; print "A faint light blooms, somewhere in the distance, in the dark"; if (self hasnt general) { give self general; print ". Your sense of direction is hopelessly muddled, but it could be a reflection of a reflection of light on stone -- the passage by which you entered this place"; } "."; ], before [; Examine: rfalse; Search: <>; Enter: if (~~(location ofclass DarknessRoom)) "[BUG] Into light, but not in darkness."; self.count = 0; SuppressHintNext(6); location.invoke(); rtrue; Exit: if (~~(location ofclass DarknessRoom)) "[BUG] Out of light, but not in darkness."; self.count = 0; SuppressHintNext(6); location.evoke(); rtrue; default: "The light, if it is real, is far away."; ], count 0, each_turn [; if (self.count > 0) { self.count--; if (self.count == 0) print "^You strain, hopelessly, to see anything. But perhaps your eyes are adjusting somewhat... there is a dim glimmer of light in the distance.^"; } ], has darksee scenery ~general; DarknessRoom FarShoreDarkness with baseroom FarShore, invoke [; print "You stumble towards the light, but your foot slips"; if (caveriver.number == 0) print " into rushing water"; else print " abruptly on wet ice, into rushing water"; print ". You follow the water's edge, blindly searching for safe passage. The passage you find slopes sharply downward...^"; PlayerTo(CrawlDarkness); ], evoke [; print "You feel along a stone wall, blindly searching for safe passage. The passage you find slopes sharply downward...^"; PlayerTo(CrawlDarkness); ], before [; Listen: if (noun == nothing) "A waterfall echoes somewhere in the distance."; ]; DarknessRoom CrawlDarkness with baseroom RiverCrawl, description "You are crouched in a low passageway, in utter darkness. The roof presses down over your head; the floor slants sharply downwards.", before [; Listen: if (noun == nothing) "Water is rushing by, somewhere above you."; ], u_to "You just crawled down from up there. No use going back.", d_to [; SuppressHintNext(6); print "You continue crawling down the steepening slope. You soon find it difficult to maintain your grip...^^ Then, with a horrible lurch of your stomach, you slip. The stone floor drops away entirely; you flail, falling through darkness, for a hold that is not there.^^ After a long second, you slam into a rocky ledge. Somehow, blindly, you manage to cling there.^"; PlayerTo(PitDarkness); rtrue; ]; DarknessRoom PitDarkness with baseroom CavePit1, description "You are in darkness, standing on a narrow ledge, leaning against an unseen wall. It seems to be an uneven wall; you might be able to climb up it.", d_to "You can't tell how far the drop is, off the ledge on which you balance. You don't want to find out.", u_to [; SuppressHintNext(6); give Darkness ~general; Darkness.baseroom = CentralCave; Darkness.number = 1; safemove(darklight, Darkness); darklight.count = 2; print "This may be the most foolhardy thing you've ever done"; if (self has general) print " more than once"; give self general; print ", but you reach upward for a hold in the blackness...^^ After an indeterminate age, you pull yourself up onto level ground.^"; PlayerTo(Darkness); rtrue; ], has ~general; ! ---- DarknessRoom Subterrane with short_name "Subterrane World", initial 0, baseroom ConfusingPassage, description "The world is picked out, not in shades or tints or degrees of black; but in qualities of darkness. Each has a name; each whispers to you. ^^In utter night, you sense the cavernous space around you -- vaulted roof as clear in the darkness as the rough-hewn floor. Without sight, you perceive behemoth columns of stone, shaped to perfect smoothness and standing in perfect circular array. Eyeless, you are aware of the vast carved form high above.", u_to [; <>; ], d_to "There is no way down.", before [; ExamineUp: <>; ExamineDown: <>; Listen: if (noun == nothing) <>; Smell: if (noun == nothing) <>; ], hinto HintoArtifactArea, coredir "far, far away in the echoing dark"; CeilingObject -> subterraneroof with name 'vaulted' 'vault' 'vaulting' 'space', description "The cross-vaulted roof arches high, high overhead; but with these dark senses, every edge and chiseled mark of stone is as perceptible as a pebble in your hand.^^ Beneath the peak of the vault, a stone form of complex geometry hangs unsupported.", before [; LookUnder: <>; ], has darksee; FloorObject -> subterranefloor with description "The floor might have been hacked from the roots of the world before light was imagined.", before [; Touch, Rub: "You feel the marks of carving."; ], has darksee; Object -> subterranecolumns "stone columns" with name 'stone' 'pillar' 'pillars' 'column' 'columns' 'behemoth', description "Heavy and immovable columns of stone stand in a circle around you. They do not reach as high as the vault overhead; their purpose must be ritual.", before [; Touch, Rub: "The columns are icy-smooth."; Climb: "The columns are much too wide and smooth to climb."; Enter: "You are already standing amid the pillars."; ], has pluralname scenery darksee; Object -> subterraneform "geometric stone form" with name 'carven' 'carved' 'geometric' 'geometry' 'form' 'stone' 'shape' 'vast' 'immense' 'complex', description [; print "Suspended high in the vaulting space, you perceive -- lightlessly -- an immense geometric form. What thought shaped it from rough stone, you cannot imagine. Its complexities are beyond you.^"; ReminisceDarkRoom.invoke(); rtrue; ], before [; Touch, Push: print_ret (The) self, " hangs high above you."; ], has scenery darksee ~general; Object -> subterranedark "darkness" with name 'dark' 'darkness' 'black' 'blackness' 'night', description "The darkness has currents -- or structure -- or harmonies -- you cannot describe it to your waking mind. But you can perceive this world as eyes and sight never could.", before [; Examine: rfalse; Search: <>; Smell: "Though the air is still, individual currents of darkness are as distinct as breaths."; Listen: "Each element of this night-world has its own inaudible note."; Enter: "You are already in the dark."; Exit: <>; default: "The dark is intangible."; ], has scenery darksee; Artifact -> dagger "obsidian dagger" with name 'obsidian' 'dagger' 'acute' 'angle' 'point' 'blade' 'hilt', article "an", initial "In the center of the stone circle is an acute angle of darkness: a dagger, balanced on its point.", description [; print "The dagger is of simple, unbeautiful angles -- broad triangular blade, squared hilt, no guard or pommel"; if (location ofclass DarknessRoom) print ". Its surface is an aching reflection of the blackness around you"; else print ". It is made of black, dully gleaming obsidian"; if (self in player) print ". But the edge is oblique, the point blunt. This blade could never have been used for mundane cleaving"; "."; ], before [; Touch: if (self hasnt moved) "You are not holding the dagger."; "You run your fingers along the unsharp edge of the blade. The obsidian is perfectly made, unworn; it must be meant to be this way."; Rub: <>; Take: if (self hasnt moved) { give self moved; move self to player; move subterranerent to Subterrane; "You reach out (your hand, you suddenly notice, is the only indistinct form in this sightlessness) and seize the dagger's hilt.^^ It is surprisingly heavy; and the hilt is obsidian, glassy-smooth against your fingers. But your attention is gripped by the rent which the blade leaves behind -- a narrow crack of emptiness against darkness."; } ], has darksee; Object subterranerent "narrow rent" with name 'acute' 'angle' 'crack' 'rent' 'narrow' 'emptiness' 'empty' 'void', initial "In the center of the stone circle is an acute angle of emptiness -- a rent in the darkness, letting the utter void shine through. If you could look upon it, it would hurt your eyes.", description "The rent stretches from the floor to higher than you can reach, but it is narrow as... how narrow is it? It seems, perhaps, like an infinite plane turned edge-on to your odd perception.", before [; Examine: rfalse; Search: "Nothing is within the rent. Nothing."; Touch, Push, Pull, Rub, Take: "The rent has no substance that you can feel."; Enter, Climb: print "You move towards the rent.^^ The darkness parts around you. What remains is not light; but a flickering motion, and a sound as of the voice of fluting wind...^"; TransportEffect(); print "...and then the flickering ", (emph) "is", " light; ordinary, flickering flames, which illuminate a comfortably familiar room.^"; give hall3door open; give hall3door ~locked; PlayerTo(settee); rtrue; ], has static darksee;