! You should have received a copy of the GNU Affero General Public
! License along with this file. If not, see https://gnu.org/licenses/
Global lantern_fuel_left = 20;
+Global body_temperature = 20;
+Global cabin_has_electricity = 1;
Constant DEATH_MENTION_UNDO;
Constant Story "Snowed In";
Constant Headline
Include "parser";
Include "verblib";
Release 0;
-Serial "210405";
+Serial "210501";
Object mainroom "Main Room"
with description
kitchenette can be found to the west. There's a doorway
in the south wall leading outside.",
n_to bedroom,
+ s_to frontdoor,
e_to office,
w_to kitchenette,
has light;
+Object frontdoor "front door" mainroom
+ with name 'door' 'front',
+ description
+ "The wooden door is made of thick oak wood with the shape
+ of a bear claw engraved in it.",
+ short_name [;
+ if (location == mainroom)
+ print "door to the outside";
+ else
+ print "door to the cabin";
+ return true;
+ ],
+ found_in mainroom southofcabin,
+ door_dir [;
+ if (location == mainroom)
+ return s_to;
+ else
+ return n_to;
+ ],
+ door_to [;
+ if (location == mainroom)
+ return southofcabin;
+ else
+ return mainroom;
+ ],
+ has scenery door openable;
+
+Object bearclaw "bear claw" mainroom
+ with name 'bear' 'claw',
+ with description
+ "It's in the shape of a thin, sharp claw with three jagged
+ points at the top of it.",
+ has scenery;
+
Object sofa "sofa" mainroom
with name 'sofa' 'couch',
with description
Object coffeetable "coffee table" mainroom
with name 'coffee' 'table',
with description
- "The old coffee table looks as if it's had quite a bit
- of use. There are burn marks covering it and the paint is
+ "The old coffee table looks as if it's had quite a bit of
+ use. There are burn marks covering it and the paint is
worn off in most places.",
before [;
Take, Pull, Push, PushDir, Turn:
Object lantern "copper lantern" coffeetable
with name 'lantern' 'copper' 'lamp',
description
- "This is an exceptionally beautiful lamp. About eleven
+ "This is an exceptionally beautiful lantern. About eleven
inches high, with a base of about 5 inches or so in
- diameter and a large, brass-closed hook at the top. The
+ diameter and a large, brass-closed hook at the top. A
+ rainbow of unique colors run through the copper. The
glass in the lamp has a fresnel type of design, which is
used to distribute light widely.",
time_left,
give lantern ~light;
StopDaemon(lantern);
print_ret
- "The lantern has run out of fuel and is now
- off.";
+ "Suddenly, the lantern's flame begins to flicker
+ violently within its glass prison and then
+ extinguishes itself.";
}
],
before [;
}
else {
print_ret
- "The lantern is out of fuel and cannot be turned
- on.";
+ "You snap the switch a few times, but nothing
+ happens.";
}
SwitchOff:
StopTimer(lantern);
Object television "flat-screen TV" mainroom
with name 'TV' 'television' 'flat' 'screen' 'flat-screen',
with description
- "The flat-screen TV looks fairly modern but it's
- been broken in a fight and the screen is dangling out.",
+ "The flat-screen TV looks fairly modern but it's been
+ broken in a fight and the screen is dangling out.",
before [;
Take, Pull, Push, PushDir, Turn:
print_ret (The) self, " is firmly mounted to the wall.";
print "Put ";
print (a) noun;
print_ret
- " into the light socket? Maybe you should come with a
- warning label because you contain more than a trace
- amount of nut.";
+ " into the light socket? Maybe you should come
+ with a warning label because you contain more than
+ a trace amount of nut.";
}
if (noun == lightbulb && light has on) {
give mainroom light;
before [;
SwitchOn:
if (lightbulb in lightsocket) {
- give mainroom light;
- give office light;
- give kitchenette light;
- give bedroom light;
- give eastofcabin light;
+ if (cabin_has_electricity == 1) {
+ give mainroom light;
+ give office light;
+ give kitchenette light;
+ give bedroom light;
+ give eastofcabin light;
+ }
+ else {
+ print_ret
+ "You flip the switch a few times, but nothing
+ happens.";
+ }
}
else {
print_ret
if (snowshoes in player && snowshoes has worn) {
print_ret "The snowsuit can't fit over the snowshoes.";
}
- Remove:
+ Disrobe, Remove:
if (snowshoes in player && snowshoes has worn) {
print_ret "The snowsuit can't be taken off over the snowshoes.";
}
],
+ daemon [;
+ if (location ~= mainroom && location ~= office && location ~=
+ kitchenette && location ~= bedroom && location ~= thedark &&
+ snowsuit hasnt worn) {
+ body_temperature = --body_temperature;
+ print body_temperature;
+ }
+ if (location == mainroom || location == office || location ==
+ kitchenette || location == bedroom || location ~= thedark ||
+ snowsuit has worn && body_temperature < 20) {
+ body_temperature = ++body_temperature;
+ }
+ if (body_temperature == 0) {
+ deadflag = 4;
+ }
+ if (body_temperature <= 5)
+ print_ret
+ "You're shivering uncontrollably, and it's hard
+ to move. You feel very exhausted and drowsy. It's
+ all you can do to keep from falling over.";
+ if (body_temperature > 5 && location ~= mainroom && location
+ ~= office && location ~= kitchenette && location ~= bedroom
+ && location ~= thedark && snowsuit hasnt worn) {
+ switch (body_temperature) {
+ 19:
+ "The feeling of cold overwhelms you. Surely the cold will get to
+ you before anything else does. Right?";
+ 18:
+ "You can feel yourself getting colder and colder.";
+ 17:
+ "You can see your own breath freezing in the air, forming little
+ clouds.";
+ 16:
+ "You shiver in the cold.";
+ 15:
+ "You continue to shiver in the cold.";
+ 14:
+ "Your hands grow numb from the cold.";
+ 13:
+ "You continue shivering in order to keep warm.";
+ 12:
+ "Your shivering grows worse as your body becomes colder by the
+ minute.";
+ 11:
+ "Your teeth begin to chatter as you desperately try to warm
+ yourself up.";
+ 10:
+ "Your shivering intensifies as your body begins to freeze over
+ from the cold.";
+ 9:
+ "Your fingers become stiff and you feel sharp pains all over your
+ body.";
+ 8:
+ "The cold has gotten to a point where it is too much for you. You
+ begin to shiver uncontrollably.";
+ 7:
+ "Your eyesight begins to fade and you can't even feel yourself
+ shivering anymore.";
+ 6:
+ "You can feel your body shutting down from the cold as you slowly
+ begin to lose consciousness.";
+ }
+ }
+ ],
has clothing;
Object snowshoes "snowshoes" bedroom
- with name 'snowshoe' 'snowshoes' 'snow' 'boot' 'boots' 'shoe' 'shoes' 'metal' 'frame',
+ with name 'snowshoe' 'snowshoes' 'snow' 'boot' 'boots' 'shoe' 'shoes'
+ 'metal' 'frame',
with description
"They're light blue in color and have a thick, hard
rubber bottom that's attached to a metal frame that keeps
knees.";
],
daemon [;
- if (location ~= mainroom && location ~= office && location ~= kitchenette
- && location ~= bedroom && snowshoes hasnt worn) {
+ if (location ~= mainroom && location ~= office && location ~=
+ kitchenette && location ~= bedroom && location ~= thedark &&
+ snowshoes hasnt worn) {
deadflag = 3;
}
],
has pluralname clothing;
+Object southofcabin "South Of Cabin"
+ with description [;
+ print "The wind is howling, and there's snow flying everywhere.";
+ if (snowsuit hasnt worn)
+ print
+ " It's really cold and
+ you're not dressed for this weather.";
+ print
+ " The snow stings your face and you
+ can barely see three feet in front of you.^";
+ ],
+ n_to frontdoor,
+ e_to eastofcabin,
+ has light;
+
Object eastofcabin "East Of Cabin"
with description [;
print "It's dark outside. ";
if (snowshoes in player && snowshoes has worn) {
print
"The snowshoes are doing their job by making sure
- you don't sink into the snow.";
+ you don't sink into the snow.^";
}
],
w_to window,
+ s_to southofcabin,
has light;
[ Initialise;
not dressed for this weather.^";
StartDaemon(lantern);
StartDaemon(snowshoes);
+ StartDaemon(snowsuit);
+ StartDaemon(grue);
];
[ DeathMessage;
if (deadflag == 3)
+ print "You sink into the deep snow and are unable to move.";
+ if (deadflag == 4)
print
- "You sink into the deep snow and are unable to move.
- It's only a matter of time until your light source dies and the grue
- comes. Or until you freeze to death. Or both. I wonder if the grue
- likes a popsicle.";
+ "Finally, you succumb to the cold. Your mind goes blank as
+ you slip away into the endless darkness and the deep sleep
+ of death.";
+];
+
+! Don't have 'take all' take the lightbulb in the mainroom of the
+! cabin
+
+[ ChooseObjects obj code;
+ if (code < 2) {
+ if (obj has scenery)
+ return 2;
+ rfalse;
+ }
+ if (obj == lightbulb)
+ return 0;
];
[ InScope;
Object grue "grue" thedark
with article "the",
name 'grue' 'monster',
- each_turn [;
- StartDaemon(self);
- ],
- turns_active,
+ grue_active_around_cabin,
+ grue_active_in_the_dark,
daemon [;
- if (location ~= thedark) {
- self.turns_active = 0;
- StopDaemon(self);
- return true;
+ if (location == thedark) {
+ switch (++(self.grue_active_in_the_dark)) {
+ 1:
+ "^You hear horrible gurgling sounds in the dark.";
+ 2:
+ "^You hear the clink of razor-sharp claws nearby.";
+ 3:
+ deadflag = 1;
+ "^Your last memory is of the slavering fangs of the
+ horrible Grue as it claims you for a meal.";
+ }
}
- switch (++(self.turns_active)) {
- 1:
- "^You hear horrible gurgling sounds in the dark.";
- 2:
- "^You hear the clink of razor-sharp claws nearby.";
- 3:
- deadflag = 1;
- "^Your last memory is of the slavering fangs of the
- horrible Grue as it claims you for a meal.";
+ if (location == mainroom || location == office || location ==
+ kitchenette || location == bedroom) {
+ switch (++(self.grue_active_around_cabin)) {
+ 1:
+ "^You hear the wind howling outside, if it is the wind.";
+ 2:
+ "^You hear horrible gurgling sounds outside.";
+ 3:
+ "^The noise outside gets louder.";
+ 4:
+ "^You hear the sound of shuffling feet outside.";
+ 5:
+ "^You hear a deep guttural sound from outside that sends a chill down your spine.";
+ 6:
+ "^You hear something sniffing around the cabin.";
+ 7:
+ "^You hear something scratching on the cabin walls from outside.";
+ 8:
+ "^You hear something howl outside. It's a chilling, mournful wail that sends a chill down your spine.";
+ 9:
+ "^A thunderous CRACK can be heard coming from outside.";
+ 10:
+ "^There's a sudden crashing sound as something is thrown against the cabin walls.";
+ 11:
+ "^Something begins to beat against the walls of the cabin, as if trying to to break in. It makes a loud, thunderous noise.";
+ 12:
+ "^The wind is howling and the walls are being beaten so hard it feels like the cabin is shaking.";
+ 13:
+ "^Suddenly, there's ominous silence from outside the cabin.";
+ }
}
+ if (location == mainroom || location == office || location ==
+ kitchenette || location == bedroom && self.grue_active_around_cabin
+ == 15) {
+ print "^The lights flicker and suddenly go out.";
+ cabin_has_electricity = 0;
+ give lightbulb ~on;
+ give mainroom ~light;
+ give office ~light;
+ give kitchenette ~light;
+ give bedroom ~light;
+ give eastofcabin ~light;
+ }
+ return true;
],
has scenery;