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