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