1 ! Copyright (C) 2021 Jason Self <j@jxself.org>
3 ! This file is free software: you may copy, redistribute and/or
4 ! modify it under the terms of the GNU Affero General Public License
5 ! as published by the Free Software Foundation, either version 3 of
6 ! the License, or (at your option) any later version.
8 ! This file is distributed in the hope that it will be useful, but
9 ! WITHOUT ANY WARRANTY; without even the implied warranty of
10 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ! Affero General Public License for more details.
13 ! You should have received a copy of the GNU Affero General Public
14 ! License along with this file. If not, see https://gnu.org/licenses/
15 Global lantern_fuel_left = 20;
16 Constant DEATH_MENTION_UNDO;
17 Constant Story "Snowed In";
19 "^A work of interactive fiction.
20 ^If you get stuck try typing HELP.
21 ^Ongoing development: https://jxself.org/git/?p=snowed-in.git
22 ^Send bugs and feedback by email to j@@64jxself.org.
23 ^IFID DE9FA2E5-4EC7-4166-9218-E56EFA1DF40F
24 ^Copyright (C) 2021 Jason Self
25 ^You can change and share this game under the terms of the GNU
26 Affero General Public License as published by the Free Software
27 Foundation (FSF), either version 3 of the License, or (at your
28 option) any later version published by the FSF. See the GNU Affero
29 General Public License for more details.^^You should have received
30 a copy of this game's source code along with a copy of the GNU
31 Affero General Public License so that you can know your rights.
32 If not, contact the place you got it from.^^";
38 Object mainroom "Main Room"
40 "This room is a total wreck - it looks like a major fight
41 happened in here. There's a ripped up sofa and a broken
42 old coffee table in the middle of the room. A flat-screen
43 TV is mounted against the wall, with the screen dangling
44 out. This cabin has three other rooms. There's an office
45 area to the east, and a bedroom to the north. A
46 kitchenette can be found to the west. There's a doorway
47 in the south wall leading outside.",
53 Object sofa "sofa" mainroom
54 with name 'sofa' 'couch',
56 "The sofa is in poor shape. The upholstery is ripped and
57 there are several holes in it.",
59 Take, Pull, Push, PushDir, Turn:
60 print_ret (The) self, " is too heavy for that.";
62 has scenery supporter enterable;
64 Object coffeetable "coffee table" mainroom
65 with name 'coffee' 'table',
67 "The old coffee table looks as if it's had quite a bit
68 of use. There are burn marks covering it and the paint is
69 worn off in most places.",
71 Take, Pull, Push, PushDir, Turn:
72 print_ret (The) self, " is too heavy for that.";
74 has scenery supporter enterable;
76 Object lantern "copper lantern" coffeetable
77 with name 'lantern' 'copper' 'lamp',
79 "This is an exceptionally beautiful lamp. About eleven
80 inches high, with a base of about 5 inches or so in
81 diameter and a large, brass-closed hook at the top. The
82 glass in the lamp has a fresnel type of design, which is
83 used to distribute light widely.",
87 lantern_fuel_left = 0;
92 "The lantern has run out of fuel and is now
98 if (lantern_fuel_left > 0) {
100 StartTimer(lantern, lantern_fuel_left);
104 "The lantern is out of fuel and cannot be turned
113 lantern_fuel_left = lantern.time_left;
114 if (lantern has on && lantern_fuel_left <= 5)
115 print_ret "The lantern's fuel runs low.";
119 Object television "flat-screen TV" mainroom
120 with name 'TV' 'television' 'flat' 'screen' 'flat-screen',
122 "The flat-screen TV looks fairly modern but it's
123 been broken in a fight and the screen is dangling out.",
125 Take, Pull, Push, PushDir, Turn:
126 print_ret (The) self, " is firmly mounted to the wall.";
128 if (television hasnt visited) {
130 "Despite the significant damage, the television
131 comes to life in one last valiant attempt to be
132 useful. Your favorite news program is on: U.S.
133 News And Grue Report. The news anchor is giving a
134 warning of Grue sightings in the area of the
135 forest before the television finally dies.^";
136 give television visited;
140 "The flat-screen TV is broken and can't be
145 has scenery switchable;
147 Object lightsocket "light socket" mainroom
148 with name 'socket' 'lightsocket',
150 Take, Pull, Push, PushDir, Turn:
152 "You don't have the tools to remove a light
155 if (noun ~= lightbulb) {
159 " into the light socket? Maybe you should come with a
160 warning label because you contain more than a trace
163 if (noun == lightbulb && light has on) {
166 give kitchenette light;
168 give eastofcabin light;
171 has scenery container transparent open;
173 Object lightbulb "light bulb" lightsocket
174 with name 'light' 'bulb' 'lightbulb',
177 if (lightbulb in lightsocket) {
180 give kitchenette light;
182 give eastofcabin light;
186 "Turn on a lightbulb when it's not in the
187 socket? What a strange idea.";
191 Take, Pull, Push, PushDir, Turn, SwitchOff:
193 give mainroom ~light;
195 give kitchenette ~light;
197 give eastofcabin ~light;
201 Object office "Office"
203 "There seems to have been quite a fight in here. The room
204 is a wreck. Holes are in the walls and the windows are
205 broken, letting in the cold air from outside. Chunks of
206 drywall and insulation cover the floor. The desk has a
207 bullet hole through the middle.",
212 Object desk "solid oak desk" office
213 with name 'solid' 'oak' 'desk',
215 "The desk is old and made of solid oak. The right side of
216 it has been smashed and all of the drawers have been
217 removed. A bullet hole goes straight through the middle of
220 Take, Pull, Push, PushDir, Turn:
221 print_ret (The) self, " is too heavy for that.";
223 has scenery supporter enterable;
225 Object businesscard "business card" desk
226 with name 'business' 'card',
228 "The business card is white and has blacked edges. It
229 bears the name ~Lasting Solutions~, a local data recovery
230 company, in bold letters on the top. The company's
231 website URL is printed in blue at the bottom.";
233 Object salesreceipt "sales receipt" desk
234 with name 'sales' 'receipt',
236 "The sales receipt is for $200, dated three years ago.
237 It's printed on old tractor feed printer paper and bears
238 the name ~Lasting Solutions~, a local data recovery
239 company. A handwritten note is scrawled on the bottom:
240 ~Start working on these hard drives soon.~";
242 Object computer "computer" desk
243 with name 'computer' 'PC',
245 "It's a heavy older model that appears to have been
246 seriously damaged in a fight. It's clearly on its last
247 legs but is perhaps still useful.",
249 Take, Pull, Push, PushDir, Turn:
250 print_ret (The) self, " is too heavy for that.";
252 if (computer hasnt visited) {
254 "The computer makes some concerning noises while
255 lights on the front also illuminate. The last
256 file is quickly displayed. ~If anyone else reads
257 this, you're in serious danger. I've been fighting
258 a ferocious grue for the last three days. I'm
259 almost out of supplies and can't last much
260 longer. I'm going to take the last of the supplies
261 and escape through the office window in a
262 last-ditch effort to get away and get back into
263 town. I hope I can make it.~ The computer then
264 makes a sickly sound and finally dies as some
265 smoke comes out of it.^";
266 give computer visited;
270 "The display briefly flickers but nothing
277 Object drywall "drywall" office
278 with name 'drywall' 'dry' 'wall',
280 Take, Pull, Push, PushDir, Turn:
281 print_ret "Taking that would achieve little.";
285 Object insulation "insulation" office
286 with name 'insulation',
288 Take, Pull, Push, PushDir, Turn:
289 print_ret "Taking that would achieve little.";
293 Object bullethole "bullet hole" desk
294 with name 'bullet' 'hole' 'holes',
296 "Looks to have come from something that's capable of
297 doing a lot of damage.",
298 found_in desk bedroom,
301 Object window "window" office
302 with name 'window' 'windows',
304 "The window faces the east side of the cabin. It's broken,
305 letting in the cold air from outside.",
307 if (location == office)
310 print "window into the cabin";
313 found_in office eastofcabin,
315 if (location == office)
321 if (location == office)
328 print_ret "The window faces the east side of the cabin.";
331 "The window's broken so it's not clear how
334 has scenery door openable open;
336 Object kitchenette "Kitchenette"
338 "The kitchenette is empty. A sink, you think, though it's
339 hard to tell what's a pipe and what's a faucet. A
340 refrigerator, standing open and empty. The door has been
341 ripped off. There's no indication as to where it
342 went. There's no food anywhere in here.",
346 Object refrigerator "refrigerator" kitchenette
347 with name 'fridge' 'refrigerator',
349 "An old rusty refrigerator, standing open and empty. The
350 door has been ripped off. There's no indication as to
353 Take, Pull, Push, PushDir, Turn:
354 print_ret (The) self, " is too heavy for that.";
356 print_ret (The) self, " door is missing.";
358 has scenery enterable container openable open;
360 Object sink "sink" kitchenette
361 with name 'sink' 'pipe' 'faucet',
363 "A sink, you think, though it's hard to tell what's a
364 pipe and what's a faucet.",
368 "Pipes from in the walls make a groaning sound,
369 almost like pain and despair. No water comes out.";
371 has scenery container switchable;
373 Object bedroom "Bedroom"
375 "This bedroom is small and cramped, and looks like a
376 major fight happened as the exterior wall has bullet
377 holes. The bed is lying on the floor, torn to shreds. It
378 has no sheets, just a bare mattress.",
382 Object bed "bed" bedroom
383 with name 'bed' 'mattress',
384 with description "The mattress is bare and empty.",
386 Take, Pull, Push, PushDir, Turn:
387 print_ret (The) self, " is too heavy for that.";
389 has scenery supporter;
391 Object suitcase "suitcase" bedroom
392 with name 'suitcase',
394 "The suitcase is made of a light metallic material that
395 you can't quite make out. The color of it is somewhere
396 between silver and grey.",
397 has container open openable;
399 Object snowsuit "snowsuit" suitcase
400 with name 'snowsuit' 'snow' 'suit',
402 "The snowsuit is blue, decorated with white and purple
403 designs. On the chest is a large emblem with the letters
407 if (snowshoes in player && snowshoes has worn) {
408 print_ret "The snowsuit can't fit over the snowshoes.";
411 if (snowshoes in player && snowshoes has worn) {
412 print_ret "The snowsuit can't be taken off over the snowshoes.";
417 Object snowshoes "snowshoes" bedroom
418 with name 'snowshoe' 'snowshoes' 'snow' 'boot' 'boots' 'shoe' 'shoes' 'metal' 'frame',
420 "They're light blue in color and have a thick, hard
421 rubber bottom that's attached to a metal frame that keeps
422 you from sinking into the snow. They look to be warm and
426 print_ret (The) self,
427 " fit perfectly and go up to your
431 if (location ~= mainroom && location ~= office && location ~= kitchenette
432 && location ~= bedroom && snowshoes hasnt worn) {
436 has pluralname clothing;
438 Object eastofcabin "East Of Cabin"
440 print "It's dark outside. ";
441 if (lightbulb has on) {
443 "The light from inside the cabin only penetrates
444 a few feet from the building. ";
447 if (lantern in player && lantern has on) {
449 "The lantern provides the only source of
452 if (snowshoes in player && snowshoes has worn) {
454 "The snowshoes are doing their job by making sure
455 you don't sink into the snow.";
463 thedark.description =
464 "It is pitch black. You are likely to be eaten
467 "You're trapped in a snowstorm while visiting the forest
468 during your vacation to a small rural town. This is the worst
469 snowstorm in more than 40 years. If only you has listened to
470 the news. Well, it's too late for that. The snow has been
471 falling for the past seven hours and shows no signs of
472 stopping anytime soon. You need to get back to your hotel in
473 the town. You finally manage to find an old cabin in the
474 woods and get inside but have no idea where you are. You're
475 not dressed for this weather.^";
476 StartDaemon(lantern);
477 StartDaemon(snowshoes);
483 "You sink into the deep snow and are unable to move.
484 It's only a matter of time until your light source dies and the grue
485 comes. Or until you freeze to death. Or both. I wonder if the grue
490 if (location == thedark && real_location == mainroom) {
491 PlaceInScope(lightsocket);
492 PlaceInScope(lightbulb);
497 Object grue "grue" thedark
499 name 'grue' 'monster',
505 if (location ~= thedark) {
506 self.turns_active = 0;
510 switch (++(self.turns_active)) {
512 "^You hear horrible gurgling sounds in the dark.";
514 "^You hear the clink of razor-sharp claws nearby.";
517 "^Your last memory is of the slavering fangs of the
518 horrible Grue as it claims you for a meal.";
525 "Oh, no! You have walked into the slavering fangs of a lurking
531 "^If you need help try some of the commands from:
532 ^http://pr-if.org/doc/play-if-card/^";
536 print "Nothing obvious happens.^";
566 * 'through' / 'out' / 'via' noun -> Go;
569 * 'through' / 'out' / 'via' noun -> Go;
572 * 'through' / 'out' / 'via' noun -> Go;
575 * 'through' / 'out' / 'via' noun -> Go;
578 * 'through' / 'out' / 'via' noun -> Go;