6c262e23711d6a95b40e8aac984d5425e306ea51
[snowed-in.git] / src / snowed-in.inf
1 ! Copyright (C) 2021, 2022 Jason Self <j@jxself.org>
2 !
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.
7 !
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.
12 !
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 Global body_temperature = 20;
17 Global cabin_has_electricity = 1;
18 Global forest_location = 1;
19 Global snowmobile_location = 0;
20 Constant NO_SCORE;
21 Constant DEATH_MENTION_UNDO;
22 Constant Story "Snowed In";
23 Constant Headline 
24     "^A work of interactive fiction.
25     ^If you get stuck try typing HELP.
26     ^Ongoing development: https://jxself.org/git/?p=snowed-in.git
27     ^Send bugs and feedback by email to j@@64jxself.org.
28     ^IFID DE9FA2E5-4EC7-4166-9218-E56EFA1DF40F
29     ^Copyright (C) 2021, 2022 Jason Self <j@@64jxself.org>
30     ^You can change and share this game under the terms of the GNU 
31     Affero General Public License as published by the Free Software 
32     Foundation (FSF), either version 3 of the License, or (at your 
33     option) any later version published by the FSF. See the GNU Affero 
34     General Public License for more details.^^You should have received 
35     a copy of this game's source code along with a copy of the GNU 
36     Affero General Public License so that you can know your rights. 
37     If not, contact the place you got it from.^^";
38 Include "parser";
39 Include "verblib";
40 Release 1;
41 Serial "220530";
42
43 Object  mainroom "Main Room"
44   with  description 
45             "This room is a total wreck - it looks like a major fight 
46             happened in here. There's a ripped up sofa and a broken 
47             old coffee table in the middle of the room. A flat-screen 
48             TV is mounted against the wall, with the screen dangling 
49             out. This cabin has three other rooms. There's an office 
50             area to the east, and a bedroom to the north. A 
51             kitchenette can be found to the west. There's a doorway 
52             in the south wall leading outside.",
53         n_to bedroom,
54         s_to frontdoor,
55         e_to office,
56         w_to kitchenette,
57   has   light;
58
59 Object  frontdoor "front door" mainroom
60   with  name 'door' 'front',
61         description 
62             "The wooden door is made of thick oak wood with the shape 
63             of a bear claw engraved in it.",
64         short_name [;
65             if (location == mainroom)
66                 print "door to the outside";
67             else
68                 print "door to the cabin";
69             return true;
70         ],
71         found_in mainroom southofcabin,
72         door_dir [;
73             if (location == mainroom)
74                 return s_to;
75             else
76                 return n_to;
77         ],
78         door_to [;
79             if (location == mainroom)
80                 return southofcabin;
81             else
82                 return mainroom;
83         ],
84   has   scenery door openable;
85
86 Object  bearclaw "bear claw" mainroom
87   with  name 'bear' 'claw',
88   with  description 
89             "It's in the shape of a thin, sharp claw with three jagged 
90             points at the top of it.",
91   has   scenery;
92
93 Object  sofa "sofa" mainroom
94   with  name 'sofa' 'couch',
95   with  description 
96             "The sofa is in poor shape. The upholstery is ripped and 
97             there are several holes in it.",
98         before [;
99           Take, Pull, Push, PushDir, Turn:
100             print_ret (The) self, " is too heavy for that.";
101         ],
102   has   scenery supporter enterable;
103
104 Object  coffeetable "coffee table" mainroom
105   with  name 'coffee' 'table',
106   with  description 
107             "The old coffee table looks as if it's had quite a bit of 
108             use. There are burn marks covering it and the paint is 
109             worn off in most places.",
110         before [;
111           Take, Pull, Push, PushDir, Turn:
112             print_ret (The) self, " is too heavy for that.";
113         ],
114   has   scenery supporter enterable;
115
116 Object  lantern "copper lantern" coffeetable
117   with  name 'lantern' 'copper' 'lamp',
118         description 
119             "This is an exceptionally beautiful lantern, made of 
120             fired copper, and polished until it shines. About eleven 
121             inches high, with a base of about 5 inches or so in 
122             diameter and a large, brass-closed hook at the top. A 
123             rainbow of unique colors run through the copper. The 
124             glass in the lamp has a fresnel type of design, which is 
125             used to distribute light widely.",
126         time_left,
127         time_out [;
128             if (lantern has on) {
129                 lantern_fuel_left = 0;
130                 give lantern ~on;
131                 give lantern ~light;
132                 StopDaemon(lantern);
133                 print_ret 
134                     "Suddenly, the lantern's flame begins to flicker 
135                     violently within its glass prison and then 
136                     extinguishes itself.";
137             }
138         ],
139         before [;
140           SwitchOn:
141             if (lantern_fuel_left > 0) {
142                 give lantern light;
143                 StartTimer(lantern, lantern_fuel_left);
144             }
145             else {
146                 print_ret 
147                     "You snap the switch a few times, but nothing 
148                     happens.";
149             }
150           SwitchOff:
151             StopTimer(lantern);
152             give lantern ~light;
153         ],
154         daemon [;
155             if (lantern has on)
156                 lantern_fuel_left = lantern.time_left;
157             if (lantern has on && lantern_fuel_left <= 5)
158                 print_ret "The lantern's fuel runs low.";
159         ],
160   has   switchable;
161
162 Object  television "flat-screen TV" mainroom
163   with  name 'TV' 'television' 'flat' 'screen' 'flat-screen',
164   with  description 
165             "The flat-screen TV looks fairly modern but it's been 
166             broken in a fight and the screen is dangling out.",
167         before [;
168           Take, Pull, Push, PushDir, Turn:
169             print_ret (The) self, " is firmly mounted to the wall.";
170           SwitchOn:
171             if (television hasnt visited) {
172                 print 
173                     "Despite the significant damage, the television 
174                     comes to life in one last valiant attempt to be 
175                     useful. Your favorite news program is on: U.S. 
176                     News And Grue Report. The news anchor is giving a 
177                     warning of grue sightings in the area of the 
178                     forest before the television finally dies.^";
179                 give television visited;
180             }
181             else {
182                 print 
183                     "The flat-screen TV is broken and can't be 
184                     turned on.^";
185             }
186             return true;
187         ],
188   has   scenery switchable;
189
190 Object  lightsocket "light socket" mainroom
191   with  name 'socket' 'lightsocket',
192         before [;
193           Take, Pull, Push, PushDir, Turn:
194             print_ret 
195                 "You don't have the tools to remove a light 
196                 socket.";
197           Receive:
198             if (noun ~= lightbulb) {
199                 print "Put ";
200                 print (a) noun;
201                 print_ret 
202                     " into the light socket? Maybe you should come 
203                     with a warning label because you contain more than 
204                     a trace amount of nut.";
205             }
206             if (noun == lightbulb && lightbulb has on) {
207                 give mainroom light;
208                 give office light;
209                 give kitchenette light;
210                 give bedroom light;
211                 give eastofcabin light;
212                 give southofcabin light;
213             }
214         ],
215   has   scenery container transparent open;
216
217 Object  lightbulb "light bulb" lightsocket
218   with  name 'light' 'bulb' 'lightbulb',
219         before [;
220           SwitchOn:
221             if (lightbulb in lightsocket) {
222                 if (cabin_has_electricity == 1) {
223                     give mainroom light;
224                     give office light;
225                     give kitchenette light;
226                     give bedroom light;
227                     give eastofcabin light;
228                     give southofcabin light;
229                 }
230                 else {
231                     print_ret 
232                         "You flip the switch a few times, but nothing 
233                         happens.";
234                 }
235             }
236             else {
237                 print_ret 
238                     "Turn on a lightbulb when it's not in the 
239                     socket? What a strange idea.";
240             }
241         ],
242         after [;
243           Take, Pull, Push, PushDir, Turn, SwitchOff:
244             give lightbulb ~on;
245             give mainroom ~light;
246             give office ~light;
247             give kitchenette ~light;
248             give bedroom ~light;
249             give eastofcabin ~light;
250             give southofcabin ~light;
251         ],
252   has   switchable on;
253
254 Object  office "Office"
255   with  description 
256             "There seems to have been quite a fight in here. The room 
257             is a wreck. Holes are in the walls and the window is 
258             broken, letting in the cold air from outside. Chunks of 
259             drywall and insulation cover the floor. The desk has a 
260             bullet hole through the middle.",
261         before [;
262           Go:
263             if (noun == e_obj) {
264                 if (snowshoes has worn)
265                     print_ret 
266                         "You can't fit through the window while 
267                         wearing the snow shoes.";
268             }
269         ],
270         w_to mainroom,
271         e_to window,
272   has   light;
273
274 Object  desk "solid oak desk" office
275   with  name 'solid' 'oak' 'desk',
276   with  description 
277             "The desk is old and made of solid oak. The right side of 
278             it has been smashed and all of the drawers have been 
279             removed. A bullet hole goes straight through the middle of 
280             the desk.",
281         before [;
282           Take, Pull, Push, PushDir, Turn:
283             print_ret (The) self, " is too heavy for that.";
284         ],
285   has   scenery supporter enterable;
286
287 Object  businesscard "business card" desk
288   with  name 'business' 'card',
289   with  description 
290             "The business card is white and has blacked edges. It 
291             bears the name ~Lasting Solutions~, a local data recovery 
292             company, in bold letters on the top. The company's 
293             website URL is printed in blue at the bottom.";
294
295 Object  salesreceipt "sales receipt" desk
296   with  name 'sales' 'receipt',
297   with  description 
298             "The sales receipt is for $200, dated three years ago. 
299             It's printed on old tractor feed printer paper and bears 
300             the name ~Lasting Solutions~, a local data recovery 
301             company. A handwritten note is scrawled on the bottom: 
302             ~Start working on these hard drives soon.~";
303
304 Object  computer "computer" desk
305   with  name 'computer' 'PC',
306   with  description 
307             "It's a heavy older model that appears to have been 
308             seriously damaged in a fight. It's clearly on its last 
309             legs but is perhaps still useful.",
310         before [;
311           Take, Pull, Push, PushDir, Turn:
312             print_ret (The) self, " is too heavy for that.";
313           SwitchOn:
314             if (computer hasnt visited) {
315                 print 
316                     "The computer makes some concerning noises while 
317                     lights on the front also illuminate. The last 
318                     file is quickly displayed. ~If anyone else reads 
319                     this, you're in serious danger. I've been fighting 
320                     a ferocious grue for the last three days. I'm 
321                     almost out of supplies and can't last much 
322                     longer. I'm going to take the last of the supplies 
323                     and escape through the office window in a 
324                     last-ditch effort to get away and get back into 
325                     town. I hope I can make it.~ The computer then 
326                     makes a sickly sound and finally dies as some 
327                     smoke comes out of it.^";
328                 give computer visited;
329             }
330             else {
331                 print 
332                     "The display briefly flickers but nothing 
333                     else happens.^";
334             }
335             return true;
336         ],
337   has   switchable;
338
339 Object  drywall "drywall" office
340   with  name 'drywall' 'dry' 'wall',
341         before [;
342           Take, Pull, Push, PushDir, Turn:
343             print_ret "Taking that would achieve little.";
344         ],
345   has   scenery;
346
347 Object  insulation "insulation" office
348   with  name 'insulation',
349         before [;
350           Take, Pull, Push, PushDir, Turn:
351             print_ret "Taking that would achieve little.";
352         ],
353   has   scenery;
354
355 Object  bullethole "bullet hole" desk
356   with  name 'bullet' 'hole' 'holes',
357   with  description 
358             "Looks to have come from something that's capable of 
359             doing a lot of damage.",
360         found_in desk bedroom,
361   has   scenery;
362
363 Object  window "window" office
364   with  name 'window' 'windows',
365         description 
366             "The window faces the east side of the cabin. It's broken, 
367             letting in the cold air from outside.",
368         short_name [;
369             if (location == office)
370                 print "window";
371             else
372                 print "window into the cabin";
373             return true;
374         ],
375         found_in office eastofcabin,
376         door_dir [;
377             if (location == office)
378                 return e_to;
379             else
380                 return w_to;
381         ],
382         door_to [;
383             if (location == office)
384                 return eastofcabin;
385             else
386                 return office;
387         ],
388         before [;
389           Search:
390             print_ret "The window faces the east side of the cabin.";
391           Open, Close:
392             print_ret 
393                 "The window's broken so it's not clear how 
394                 you'd do that.";
395         ],
396   has   scenery door openable open;
397
398 Object  kitchenette "Kitchenette"
399   with  description 
400             "The kitchenette is empty. A sink, you think, though it's 
401             hard to tell what's a pipe and what's a faucet. A 
402             refrigerator, standing open and empty. The door has been 
403             ripped off. There's no indication as to where it 
404             went. There's no food anywhere in here.",
405         e_to mainroom,
406   has   light;
407
408 Object  refrigerator "refrigerator" kitchenette
409   with  name 'fridge' 'refrigerator',
410   with  description 
411             "An old rusty refrigerator, standing open and empty. The 
412             door has been ripped off. There's no indication as to 
413             where it went.",
414         before [;
415           Take, Pull, Push, PushDir, Turn:
416             print_ret (The) self, " is too heavy for that.";
417           Open, Close:
418             print_ret (The) self, " door is missing.";
419         ],
420   has   scenery enterable container openable open;
421
422 Object  sink "sink" kitchenette
423   with  name 'sink' 'pipe' 'faucet',
424   with  description 
425             "A sink, you think, though it's hard to tell what's a 
426             pipe and what's a faucet.",
427         after [;
428           SwitchOn:
429             print_ret 
430                 "Pipes from in the walls make a groaning sound, 
431                 almost like pain and despair. No water comes out.";
432         ],
433   has   scenery container switchable;
434
435 Object  bedroom "Bedroom"
436   with  description 
437             "This bedroom is small and cramped, and looks like a 
438             major fight happened as the exterior wall has bullet 
439             holes. The bed is lying on the floor, torn to shreds. It 
440             has no sheets, just a bare mattress.",
441         s_to mainroom,
442   has   light;
443
444 Object  bed "bed" bedroom
445   with  name 'bed' 'mattress',
446   with  description "The mattress is bare and empty.",
447         before [;
448           Take, Pull, Push, PushDir, Turn:
449             print_ret (The) self, " is too heavy for that.";
450         ],
451   has   scenery supporter;
452
453 Object  suitcase "suitcase" bedroom
454   with  name 'suitcase' 'case',
455   with  description 
456             "The suitcase is made of a light metallic material that 
457             you can't quite make out. The color of it is somewhere 
458             between silver and grey.",
459   has   container open openable;
460
461 Object  snowsuit "snowsuit" suitcase
462   with  name 'snowsuit' 'snow' 'suit',
463   with  description 
464             "The snowsuit is blue, decorated with white and purple 
465             designs. On the chest are the letters ~CE~ in purple.",
466         before [;
467           Wear:
468             if (snowshoes in player && snowshoes has worn) {
469                 print_ret "The snowsuit can't fit over the snowshoes.";
470             }
471           Disrobe, Remove:
472             if (snowshoes in player && snowshoes has worn) {
473                 print_ret "The snowsuit can't be taken off over the snowshoes.";
474             }
475         ],
476         daemon [;
477             if (location ~= mainroom && location ~= office && location ~=
478             kitchenette && location ~= bedroom && location ~= thedark &&
479             snowsuit hasnt worn) {
480                 body_temperature = --body_temperature;
481             }
482             if (location == mainroom || location == office || location ==
483             kitchenette || location == bedroom || snowsuit has worn && body_temperature
484             < 20) {
485                 body_temperature = ++body_temperature;
486             }
487             if (body_temperature == 0) {
488                 deadflag = 4;
489             }
490             if (body_temperature <= 5)
491                 print_ret 
492                     "You're shivering uncontrollably, and it's hard 
493                     to move. You feel very exhausted and drowsy. It's 
494                     all you can do to keep from falling over.";
495             if (body_temperature > 5 && location ~= mainroom && location
496             ~= office && location ~= kitchenette && location ~= bedroom
497             && location ~= thedark && snowsuit hasnt worn) {
498                 switch (body_temperature) {
499                   19:
500                     "The feeling of cold overwhelms you. Surely the cold will get to 
501                     you before anything else does. Right?";
502                   18:
503                     "You can feel yourself getting colder and colder.";
504                   17:
505                     "You can see your own breath freezing in the air, forming little 
506                     clouds.";
507                   16:
508                     "You shiver in the cold.";
509                   15:
510                     "You continue to shiver in the cold.";
511                   14:
512                     "Your hands grow numb from the cold.";
513                   13:
514                     "You continue shivering in order to keep warm.";
515                   12:
516                     "Your shivering grows worse as your body becomes colder by the
517                     minute.";
518                   11:
519                     "Your teeth begin to chatter as you desperately try to warm 
520                     yourself up.";
521                   10:
522                     "Your shivering intensifies as your body begins to freeze over 
523                     from the cold.";
524                   9:
525                     "Your fingers become stiff and you feel sharp pains all over your
526                     body.";
527                   8:
528                     "The cold has gotten to a point where it is too much for you. You 
529                     begin to shiver uncontrollably.";
530                   7:
531                     "Your eyesight begins to fade and you can't even feel yourself 
532                     shivering anymore.";
533                   6:
534                     "You can feel your body shutting down from the cold as you slowly 
535                     begin to lose consciousness.";
536                 }
537             }
538         ],
539   has   clothing;
540
541 Object  snowshoes "snowshoes" bedroom
542   with  name 'snowshoe' 'snowshoes' 'snow' 'boot' 'boots' 'shoe' 'shoes'
543         'metal' 'frame',
544   with  description 
545             "They're light blue in color and have a thick, hard 
546             rubber bottom that's attached to a metal frame that keeps 
547             you from sinking into the snow. They look to be warm and 
548             comfortable.",
549         after [;
550           Wear:
551             print_ret (The) self, 
552                 " fit perfectly and go up to your 
553                 knees.";
554         ],
555         daemon [;
556             if (location ~= mainroom && location ~= office && location ~=
557             kitchenette && location ~= bedroom && location ~= thedark &&
558             location ~= eastofcabin && snowshoes hasnt worn) {
559                 deadflag = 3;
560             }
561         ],
562   has   pluralname clothing;
563
564 Object  southofcabin "South Of Cabin"
565   with  description [;
566             print 
567                 "The wind is howling, and there's snow flying 
568                 everywhere. The snow buildup seems to get higher to 
569                 the west. ";
570             if (snowsuit hasnt worn)
571                 print 
572                     "It's really cold and you're not dressed for 
573                     this weather. ";
574             if (frontdoor has open) {
575                 check_for_cabin_lighting();
576             }
577             if (snowshoes has worn && lantern in player && eastofcabin hasnt
578             visited && lantern_fuel_left > 0) {
579                 throw_rock();
580             }
581             print "^";
582         ],
583         n_to frontdoor,
584         s_to forest,
585         e_to eastofcabin,
586         w_to westofcabin,
587   has   light;
588
589 Object  truckspot "Forest"
590   with  description 
591             "The blizzard is still going on. You don't think it's 
592             letting up any time soon. There is a blue and white 
593             pickup truck here. It looks like it got stuck in the snow 
594             and is slowly being covered by it. The windows are iced 
595             up and you can't see inside.",
596         before [;
597           Go:
598             forest_location = forest_location++;
599             PlayerTo(forest, 1);
600         ];
601
602 Object  truck "blue and white pickup truck" truckspot
603   with  name 'pickup' 'truck' 'door' 'doors',
604   with  description 
605             "The blue and white pickup truck looks old and battered. 
606             The paint has chipped and faded. The windows are iced up 
607             and you can't see inside.",
608         before [;
609           Take, Pull, Push, PushDir, Turn:
610             print_ret (The) self, " is too heavy for that.";
611           Search:
612             print_ret 
613                 "The windows are iced up and you can't see 
614                 inside.";
615           Enter, Open, GoIn:
616             print_ret (The) self, " is frozen shut.";
617         ],
618   has   scenery supporter enterable openable;
619
620 Object  backpacklocation "Forest"
621   with  description 
622             "You keep walking and walking. The snowfall is still as 
623             heavy as ever. As you continue trudging through the snow, 
624             you wonder if you're actually moving in the right 
625             direction. You can't see anything through the blizzard. 
626             You wonder if you might be going in circles and end up 
627             wandering around forever, never finding your way out of 
628             this white void. You're unsure of which way to go. The 
629             snowfall is so thick that you can barely see your hand if 
630             you hold it right in front of your face. You have no idea 
631             how far you've come or in what direction.",
632         before [;
633           Go:
634             forest_location = forest_location++;
635             PlayerTo(forest, 1);
636         ];
637
638 Object  backpack "backpack" backpacklocation
639   with  name 'backpack' 'back' 'pack' 'blood',
640   with  description 
641             "The backpack is of medium size, black, with three white 
642             stripes running vertically on the back. The middle stripe 
643             is broken up by a red line running down the center of it 
644             toward the bottom of the backpack. On the side are the 
645             letters ~CE~ in purple. The backpack is covered in blood, 
646             as if the owner met with an untimely demise.",
647   has   clothing container openable;
648
649 Object  flashlight "flashlight" backpack
650   with  name 'flashlight' 'flash' 'light' 'torch',
651         description 
652             "It looks like a cheap red plastic model, about eight 
653             inches long.",
654         before [;
655           SwitchOn:
656             give flashlight light;
657           SwitchOff:
658             give lantern ~light;
659         ],
660   has   switchable;
661
662 [ print_forest_description;
663     if (location ~= thedark) {
664         switch (forest_location) {
665           1:
666             print_ret 
667                 "You push on despite the bitter cold and the heavy 
668                 snowfall as you come to a fork. There are two ways to 
669                 go here, one involves a hill to the south. The 
670                 other way is continuing through the woods to the 
671                 north.";
672           2:
673             print_ret 
674                 "The wind is bitterly cold. You plow through the 
675                 snowfall, which is still as heavy as ever. You can 
676                 barely see where you are going, making it hard to 
677                 tell which direction is which. Out of the corner of 
678                 your eye, you spot a tall, shadowy figure lingering 
679                 at the edge of your vision. When you turn to look at 
680                 it directly, however, it disappears. You continue 
681                 walking. The wind is howling louder than ever. The 
682                 endless snowfall makes it difficult to see where 
683                 you're going. You can't tell where the white sky and 
684                 white ground begin and end.";
685           3:
686             PlayerTo(truckspot);
687           4:
688             print_ret 
689                 "You trudge through the snow. The wind is really 
690                 strong and howling like a banshee. You hear a horrible 
691                 howl in the distance or is it the wind? Looking 
692                 around you see nothing in this barren landscape but 
693                 snow. You're not sure what to make of it, but you 
694                 don't want to stick around to find out. The whole 
695                 world is white. You can barely see five feet ahead of 
696                 you. You hope you're going the right way. This place 
697                 is so desolate and barren.";
698           5:
699             print_ret 
700                 "You think you might can see a large figure stepping 
701                 out of the trees and moving in the distance but the 
702                 wind is blowing hard and whipping up massive amounts 
703                 of snow, making it hard to tell for sure. Your breath 
704                 billows out in huge clouds. If it keeps blowing like 
705                 this, you're not sure if you'll ever be able to get 
706                 back. Snow whirls through the air as a gust of wind 
707                 picks up speed. The howling gets louder and more 
708                 intense. There's no left, right, backward or forward. 
709                 There's nothing but endless, unchanging whiteness.";
710           6:
711             PlayerTo(backpacklocation);
712           7:
713             print_ret 
714                 "It feels like you're lost in a maze of snow without 
715                 a map. You keep trudging through the heavy snowfall, 
716                 not knowing if you're even going in any particular 
717                 direction anymore. The wind is really picking up now 
718                 and the snowfall is getting heavier. You have to keep 
719                 going. You can't let the snowstorm get the best of 
720                 you. You can't give up. You must find a way out of 
721                 this frozen wasteland. The snowstorm has made it 
722                 impossible to see anything more than a few feet in 
723                 front of you.";
724           8:
725             print_ret 
726                 "The wind is now a shrieking banshee, freezing and 
727                 relentless, as it throws the snow into your face, 
728                 blinding you. It's hard to walk against the brutal 
729                 winds. You can't see anything, but you must keep 
730                 going. There is no choice. You continue your way 
731                 through the snowy white void, what with the snow 
732                 piling up around you. The wind screams in your ears 
733                 and you can't see anything. Can't go back. Can't go 
734                 forward. You can't even see where you are. You hope 
735                 that, as long as you keep moving, you'll eventually 
736                 find a way out of this frozen wasteland.";
737           9:
738             print_ret 
739                 "The blizzard rages, but you continue to press on. 
740                 There's nothing here but you, the snowfall, and the 
741                 fierce wind howling through this frozen landscape. 
742                 This isn't just a place of cold and ice - it's 
743                 other-worldly. You trudge on and try to keep your 
744                 spirits up and not let the snowstorm get to you. Every 
745                 step is an effort. You wish you had the powers of a 
746                 superhero right now. You can barely see where you are 
747                 going. The wind knocks you down on your hands and 
748                 knees. You get back up, but you're slipping and 
749                 sliding all over the place.";
750           10:
751             print_ret 
752                 "You wander around in the impenetrable white void. 
753                 The wind is howling louder than ever. You try to 
754                 persevere. You don't know if you're going in circles 
755                 or what, but you start to feel that this frozen, 
756                 lifeless landscape is sucking away your very life 
757                 force. You can't see your hand in front of your face. 
758                 You can barely keep moving. Every step you take is 
759                 hard-fought. You just want this awful nightmare to 
760                 end. You begin to feel sleepy but you're in danger 
761                 here. You have to keep moving. Sleep is not an option 
762                 when you're in a place like this.";
763           11:
764             print_ret 
765                 "You try to remember the survival tips you've read 
766                 on the internet, but frankly, you don't remember most 
767                 of them right now. As you walk you try to keep your 
768                 mind occupied with anything other than the storm. 
769                 Nothing makes any sense and you feel like you're 
770                 starting to go in circles. The wind starts starts to 
771                 pick up as it begins howling louder than ever. You're 
772                 determined to live but the blizzard doesn't seem to 
773                 care whether you live or die. It just keeps howling 
774                 and shrieking. It's not getting any easier to move in 
775                 this blizzard.";
776           12:
777             print_ret 
778                 "You keep walking. The snow is drifting and piling 
779                 up around you, making movement almost impossible. You 
780                 look around the barren landscape, but there's nothing 
781                 nearby except snow. It's almost as if you're lost in 
782                 a white, endless void. You start to get disoriented. 
783                 You don't even know if you're walking in a circle or 
784                 not. The situation is looking very grim. Your life 
785                 feels as if it is slowly ebbing away in the 
786                 relentless grip of the snowstorm. It feels like 
787                 you've been wandering for hours, but that's probably 
788                 just your perception of time slipping away.";
789           13:
790             print_ret 
791                 "You can barely see anything, and you stumble 
792                 forward. You could be wandering aimlessly in any 
793                 direction right now and you wouldn't know the 
794                 difference. It's as if you're in a sea of white. 
795                 You're not sure that you're going in the right 
796                 direction but you can't stop now. There has to be 
797                 something here besides endless snow. You know that 
798                 staying here is a death sentence. You have to escape. 
799                 You're cold, tired, miserable, and desperate to get 
800                 out of this mess. You have no idea where you are. You 
801                 keep wandering through endless whiteness. You won't 
802                 give up.";
803           14:
804             deadflag = 2;
805             print_ret 
806                 "You see something in the distance but can't make it 
807                 out. You walk toward it to find out that it's the 
808                 hotel. You collapse in the lobby as the hotel staff 
809                 rush over to you.";
810         }
811     }
812 ];
813
814 Object  forest "Forest"
815   with  description [;
816             print_forest_description();
817         ],
818         before [;
819           Go:
820             if (location == thedark) {
821                 DarkToDark();
822             }
823             if (noun == d_obj || noun == u_obj) {
824                 print_ret "You can't go that way.";
825             }
826             forest_location = forest_location++;
827         ],
828         cant_go print_forest_description;
829
830 [ throw_rock;
831     if (television has visited || computer has visited) {
832         print 
833             "The grue is waiting behind a snowbank in
834             the distance, away from the light. ";
835     }
836     print 
837         "From somewhere off in the dark distance, far away from the 
838         light, a rock is hurled in your direction. It hits the 
839         lantern, breaking it, and putting it out of commission. ";
840     give lantern ~on;
841     give lantern ~light;
842     lantern_fuel_left = 0;
843     StopDaemon(lantern);
844 ];
845
846 [ check_for_cabin_lighting;
847     if (lightbulb has on) {
848         print 
849             "The light from inside the cabin only penetrates a few 
850             feet from the building. ";
851     }
852     else
853         if (lantern in player && lantern has on) {
854             print 
855                 "The lantern provides the only source of 
856                 light. ";
857         }
858     if (location has light)
859         print 
860             "The snow stings your face and you can barely see three feet in 
861             front of you. ";
862     if (snowshoes in player && snowshoes has worn) {
863         print 
864             "The snowshoes are doing their job by making sure 
865             you don't sink into the snow. ";
866     }
867 ];
868
869 Object  eastofcabin "East Of Cabin"
870   with  description [;
871             print "It's dark outside. ";
872             check_for_cabin_lighting();
873             if (cabin_has_electricity == 1 && lantern in player && lantern_fuel_left
874             > 0) {
875                 throw_rock();
876             }
877             print "^";
878         ],
879         w_to window,
880         s_to southofcabin,
881         cant_go 
882             "The snow buildup is is too great to continue in that 
883             direction.",
884   has   light;
885
886 Object  roof "Roof"
887   with  description [;
888             print 
889                 "You're on the roof of the cabin, although it's hard 
890                 to tell where the snow buildup ends and the roof 
891                 begins. You can make out the trees around the cabin, 
892                 but you can't see very far out into the snowfield 
893                 beyond them.";
894             if (roof hasnt visited)
895                 print 
896                     " You hear a snowmobile approaching in the 
897                     distance. Is it your salvation? The snowmobile 
898                     quickly zooms by in front of the cabin and 
899                     disappears into the forest.";
900             StartDaemon(snowmobile);
901             if (roof has visited)
902                 print 
903                     " There seems to be no movement, no sound, no 
904                     sign of anything.";
905             new_line;
906         ],
907         n_to northofcabin,
908         cant_go "Walking off the edge of a roof seems unwise.";
909
910 Object  northofcabin "North Of Cabin"
911   with  description 
912             "You're on the north side of the cabin. The wind is 
913             howling and the snow is coming down; falling too fast to 
914             see well. The snow buildup here is so great that it's 
915             almost level with the cabin's roof, which is to the 
916             south.",
917         n_to westofcabin,
918         s_to roof,
919         w_to westofcabin,
920         cant_go "It's too steep to go in that direction safely.";
921
922 Object  westofcabin "West Of Cabin"
923   with  description 
924             "The snow is falling so fast that you can barely see 
925             anything. You can't even be sure you're going in the right 
926             direction. The snow buildup gets taller to the north.",
927         s_to southofcabin,
928         n_to northofcabin,
929         cant_go 
930             "The snow buildup is is too great to continue in that 
931             direction.";
932
933 [ Initialise;
934     Location = mainroom;
935     thedark.description = 
936         "It is pitch black. You are likely to be eaten 
937         by a grue.";
938     print 
939         "You're trapped in a snowstorm while visiting the forest 
940         during your vacation to a small rural town. This is the worst 
941         snowstorm in more than 40 years. If only you had listened to 
942         the news. Well, it's too late for that. The snow has been 
943         falling for the past seven hours and shows no signs of 
944         stopping any time soon. You need to get back to your hotel in 
945         the town. You finally manage to find an old cabin in the 
946         woods and get inside but have no idea where you are. You're 
947         not dressed for this weather, and it's getting dark outside.^";
948     StartDaemon(lantern);
949     StartDaemon(snowshoes);
950     StartDaemon(snowsuit);
951     StartDaemon(grue);
952 ];
953
954 [ DeathMessage;
955     if (deadflag == 3)
956         print "You sink into the deep snow and are unable to move.";
957     if (deadflag == 4)
958         print 
959             "Finally, you succumb to the cold. Your mind goes blank as 
960             you slip away into the endless darkness and the deep sleep 
961             of death.";
962 ];
963
964 ! Don't have 'take all' take the lightbulb in the mainroom of the 
965 ! cabin
966
967 [ ChooseObjects obj code;
968     if (code < 2) {
969         if (obj has scenery)
970             return 2;
971         rfalse;
972     }
973     if (obj == lightbulb)
974         return 0;
975 ];
976
977 [ InScope;
978     if (location == thedark && real_location == mainroom) {
979         PlaceInScope(lightsocket);
980         PlaceInScope(lightbulb);
981     }
982     return false;
983 ];
984
985 Object  snowmobile "snowmobile" thedark
986   with  name 'snowmobile',
987         daemon [;
988             snowmobile_location = random(13);
989             if (location == forest && forest_location == snowmobile_location)
990             {
991                 deadflag = 2;
992                 print_ret 
993                     "You hear a snowmobile approaching in the 
994                     distance. The person says they saw your light and 
995                     came to rescue you.";
996             }
997             return true;
998         ],
999   has   scenery;
1000
1001 Object  grue "grue" thedark
1002   with  article "the",
1003         name 'grue' 'monster',
1004         grue_active_around_cabin,
1005         grue_active_in_the_dark,
1006         daemon [;
1007             if (location == thedark) {
1008                 switch (++(self.grue_active_in_the_dark)) {
1009                   1:
1010                     "^You hear horrible gurgling sounds in the dark.";
1011                   2:
1012                     "^You hear the clink of razor-sharp claws nearby.";
1013                   3:
1014                     deadflag = 1;
1015                     "^Your last memory is of the slavering fangs of the 
1016                     horrible Grue as it claims you for a meal.";
1017                 }
1018             }
1019             if (location == mainroom || location == office || location ==
1020             kitchenette || location == bedroom) {
1021                 switch (++(self.grue_active_around_cabin)) {
1022                   1:
1023                     "^You hear the wind howling outside, if it is the wind.";
1024                   2:
1025                     "^You hear horrible gurgling sounds outside.";
1026                   3:
1027                     "^The noise outside gets louder.";
1028                   4:
1029                     "^You hear the sound of shuffling feet outside.";
1030                   5:
1031                     "^You hear something sniffing around the cabin.";
1032                   6:
1033                     "^You hear a deep guttural sound from outside that sends a chill down your spine.";
1034                   7:
1035                     "^You hear something scratching on the cabin walls from outside.";
1036                   8:
1037                     "^You hear something howl outside. It's a chilling, mournful wail that sends a chill down your spine.";
1038                   9:
1039                     "^A thunderous CRACK can be heard coming from outside.";
1040                   10:
1041                     "^There's a sudden crashing sound as something is thrown against the cabin walls.";
1042                   11:
1043                     "^Something begins to beat against the walls of the cabin, as if trying to to break in. It makes a loud, thunderous noise.";
1044                   12:
1045                     "^The wind is howling and the walls are being beaten so hard it feels like the cabin is shaking.";
1046                   13:
1047                     "^Suddenly, there's ominous silence from outside the cabin.";
1048                 }
1049             }
1050             if (location == mainroom || location == office || location ==
1051             kitchenette || location == bedroom && self.grue_active_around_cabin
1052             == 15) {
1053                 print "^The lights flicker and suddenly go out.^";
1054                 cabin_has_electricity = 0;
1055                 give lightbulb ~on;
1056                 give mainroom ~light;
1057                 give office ~light;
1058                 give kitchenette ~light;
1059                 give bedroom ~light;
1060                 give eastofcabin ~light;
1061                 give southofcabin ~light;
1062             }
1063             return true;
1064         ],
1065   has   scenery;
1066
1067 [ DarkToDark;
1068     deadflag = 1;
1069     "Oh, no! You have walked into the slavering fangs of a lurking 
1070     grue!";
1071 ];
1072
1073 [ URL;
1074     print 
1075         "^If you need help try some of the commands from: 
1076         ^http://pr-if.org/doc/play-if-card/^";
1077 ];
1078
1079 [ XyzzySub;
1080     print "Nothing obvious happens.^";
1081     return true;
1082 ];
1083
1084 [ HelpSub;
1085     URL();
1086     return true;
1087 ];
1088
1089 Include "grammar";
1090
1091 Verb 'About'
1092     * -> Version;
1093
1094 Verb 'Info'
1095     * -> Version;
1096
1097 Verb 'Help'
1098     * -> Help;
1099
1100 Verb 'Clue'
1101     * -> Help;
1102
1103 Verb 'Hint'
1104     * -> Help;
1105
1106 Verb 'xyzzy'
1107     * -> Xyzzy;
1108
1109 Verb 'crawl'
1110     * 'through' / 'out' / 'via' noun -> Go;
1111
1112 Verb 'escape'
1113     * 'through' / 'out' / 'via' noun -> Go;
1114
1115 Extend 'jump'
1116     * 'through' / 'out' / 'via' noun -> Go;
1117
1118 Extend 'climb'
1119     * 'through' / 'out' / 'via' noun -> Go;
1120
1121 Extend 'go'
1122     * 'through' / 'out' / 'via' noun -> Go;