Update to serial 210823
[snowed-in.git] / src / snowed-in.inf
1 ! Copyright (C) 2021 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 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 0;
40 Serial "210823";
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 wearing the snow 
266                         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 is a large emblem with the letters 
465             ~CE~ in purple.",
466         before [;
467           Wear:
468             if (snowshoes in player && snowshoes has worn) {
469                 print_ret "The snowsuit can't fit over the snowshoes.";
470             }
471           Disrobe, Remove:
472             if (snowshoes in player && snowshoes has worn) {
473                 print_ret "The snowsuit can't be taken off over the snowshoes.";
474             }
475         ],
476         daemon [;
477             if (location ~= mainroom && location ~= office && location ~=
478             kitchenette && location ~= bedroom && location ~= thedark &&
479             snowsuit hasnt worn) {
480                 body_temperature = --body_temperature;
481             }
482             if (location == mainroom || location == office || location ==
483             kitchenette || location == bedroom || snowsuit has worn && body_temperature
484             < 20) {
485                 body_temperature = ++body_temperature;
486             }
487             if (body_temperature == 0) {
488                 deadflag = 4;
489             }
490             if (body_temperature <= 5)
491                 print_ret 
492                     "You're shivering uncontrollably, and it's hard 
493                     to move. You feel very exhausted and drowsy. It's 
494                     all you can do to keep from falling over.";
495             if (body_temperature > 5 && location ~= mainroom && location
496             ~= office && location ~= kitchenette && location ~= bedroom
497             && location ~= thedark && snowsuit hasnt worn) {
498                 switch (body_temperature) {
499                   19:
500                     "The feeling of cold overwhelms you. Surely the cold will get to 
501                     you before anything else does. Right?";
502                   18:
503                     "You can feel yourself getting colder and colder.";
504                   17:
505                     "You can see your own breath freezing in the air, forming little 
506                     clouds.";
507                   16:
508                     "You shiver in the cold.";
509                   15:
510                     "You continue to shiver in the cold.";
511                   14:
512                     "Your hands grow numb from the cold.";
513                   13:
514                     "You continue shivering in order to keep warm.";
515                   12:
516                     "Your shivering grows worse as your body becomes colder by the
517                     minute.";
518                   11:
519                     "Your teeth begin to chatter as you desperately try to warm 
520                     yourself up.";
521                   10:
522                     "Your shivering intensifies as your body begins to freeze over 
523                     from the cold.";
524                   9:
525                     "Your fingers become stiff and you feel sharp pains all over your
526                     body.";
527                   8:
528                     "The cold has gotten to a point where it is too much for you. You 
529                     begin to shiver uncontrollably.";
530                   7:
531                     "Your eyesight begins to fade and you can't even feel yourself 
532                     shivering anymore.";
533                   6:
534                     "You can feel your body shutting down from the cold as you slowly 
535                     begin to lose consciousness.";
536                 }
537             }
538         ],
539   has   clothing;
540
541 Object  snowshoes "snowshoes" bedroom
542   with  name 'snowshoe' 'snowshoes' 'snow' 'boot' 'boots' 'shoe' 'shoes'
543         'metal' 'frame',
544   with  description 
545             "They're light blue in color and have a thick, hard 
546             rubber bottom that's attached to a metal frame that keeps 
547             you from sinking into the snow. They look to be warm and 
548             comfortable.",
549         after [;
550           Wear:
551             print_ret (The) self, 
552                 " fit perfectly and go up to your 
553                 knees.";
554         ],
555         daemon [;
556             if (location ~= mainroom && location ~= office && location ~=
557             kitchenette && location ~= bedroom && location ~= thedark &&
558             location ~= eastofcabin && snowshoes hasnt worn) {
559                 deadflag = 3;
560             }
561         ],
562   has   pluralname clothing;
563
564 Object  southofcabin "South Of Cabin"
565   with  description [;
566             print 
567                 "The wind is howling, and there's snow flying 
568                 everywhere.^";
569             if (snowsuit hasnt worn)
570                 print 
571                     "^It's really cold and you're not dressed for 
572                     this weather.^";
573             if (frontdoor has open) {
574                 check_for_cabin_lighting();
575             }
576         ],
577         n_to frontdoor,
578         s_to forest,
579         e_to eastofcabin,
580         w_to westofcabin,
581   has   light;
582
583 Object  truckspot "Forest"
584   with  description 
585             "The blizzard is still going on. You don't think it's 
586             letting up anytime soon. There is a blue and white 
587             pickup truck here. It looks like it got stuck in the snow 
588             and is slowly being covered by it. The windows are iced 
589             up and you can't see inside.",
590         before [;
591           Go:
592             PlayerTo(forest);
593         ];
594
595 Object  truck "blue and white pickup truck" truckspot
596   with  name 'pickup' 'truck' 'door',
597   with  description 
598             "The blue and white pickup truck looks old and battered. 
599             The paint has chipped and faded. The windows are iced up 
600             and you can't see inside.",
601         before [;
602           Take, Pull, Push, PushDir, Turn:
603             print_ret (The) self, " is too heavy for that.";
604           Search:
605             print_ret 
606                 "The windows are iced up and you can't see 
607                 inside.";
608           Enter, Open, GoIn:
609             print_ret (The) self, " is frozen shut.";
610         ],
611   has   scenery supporter enterable openable;
612
613 [ print_forest_description;
614     if (location ~= thedark) {
615         switch (forest_location) {
616           1:
617             print_ret 
618                 "It's not getting any easier to move in this 
619                 blizzard. You can barely see five feet ahead of you. 
620                 The wind is really strong. You try to remember the 
621                 survival tips you've read on the internet, but 
622                 frankly, you don't remember most of them right now. 
623                 You just want this awful nightmare to end.";
624           2:
625             print_ret 
626                 "You can't see anything through the blizzard. The 
627                 snow is drifting and piling up around you, making 
628                 movement almost impossible. You can't see your hand 
629                 in front of your face. The wind is bitterly cold. The 
630                 situation is looking very grim. Your life feels as if 
631                 it is slowly ebbing away in the relentless grip of 
632                 the snowstorm.";
633           3:
634             print_ret 
635                 "You plow through the heavy snowfall. You're cold, 
636                 tired, miserable, and desperate to get out of this 
637                 mess. The wind is howling like a banshee. You can 
638                 barely keep moving. You wish you had the powers of a 
639                 superhero right now. You try to persevere. You push 
640                 on despite the bitter cold and the heavy snowfall as 
641                 you come to a fork. There are two ways to go here, 
642                 one is going up a hill to the south. The other way is 
643                 continuing through the woods to the north.";
644           4:
645             print_ret 
646                 "You trudge through the snow. The wind is howling 
647                 louder than ever. It's almost as if you're lost in a 
648                 white, endless void.";
649           5:
650             print_ret 
651                 "You continue your way through the snowy white void, 
652                 what with the snow piling up around you. This is 
653                 getting really old, really fast. It's hard to tell 
654                 which direction is which. You wonder if you might be 
655                 going in circles and end up wandering around forever, 
656                 never finding your way out of this white void.";
657           6:
658             print_ret 
659                 "You wander around in the impenetrable white void. 
660                 The snowfall is still as heavy as ever. You're unsure 
661                 of which way to go. There's no left, right, backward 
662                 or forward. There's nothing but endless, unchanging 
663                 whiteness. You could be wandering aimlessly in any 
664                 direction right now and you wouldn't know the 
665                 difference.";
666           7:
667             PlayerTo(truckspot);
668           8:
669             print_ret 
670                 "You keep wandering through endless whiteness. It 
671                 feels like you've been wandering for hours, but 
672                 that's probably just your perception of time slipping 
673                 away. You keep trudging through the heavy snowfall, 
674                 not knowing if you're even going in any particular 
675                 direction anymore. You hope that, as long as you keep 
676                 moving, you'll eventually find a way out of this 
677                 frozen wasteland.";
678           9:
679             print_ret 
680                 "You wander around through the white void. There's 
681                 nothing here but you, the snowfall, and the fierce 
682                 wind howling through this frozen landscape. You start 
683                 to get disoriented. You don't know if you're going in 
684                 circles or what, but you start to feel that this 
685                 frozen, lifeless landscape is sucking away your very 
686                 life force.";
687           10:
688             print_ret 
689                 "This isn't just a place of cold and ice - it's 
690                 other-worldly. You're in danger here. You have to 
691                 keep moving. Sleep is not an option when you're in a 
692                 place like this. You have to escape. Somehow, you 
693                 know that staying here is a death sentence.";
694           11:
695             print_ret 
696                 "The wind starts starts to pick up as it begins 
697                 howling louder than ever. You look around the barren 
698                 landscape, but there's nothing nearby except snow. 
699                 You don't even see any trees to break the force of 
700                 this terrible wind. The snowfall is still as heavy as 
701                 ever. You can barely see where you are going.";
702           12:
703             print_ret 
704                 "The snowfall is still as heavy as ever. The wind is 
705                 howling louder than ever. You can barely see where 
706                 you are going. This place is so desolate and barren. 
707                 As you continue trudging through the snow, you wonder 
708                 if you're actually moving in the right direction.";
709           13:
710             print_ret 
711                 "The endless snowfall makes it difficult to see where 
712                 you're going. It feels like you're lost in a maze of 
713                 snow without a map. Out of the corner of your eye, 
714                 you spot a tall, shadowy figure lingering at the edge 
715                 of your vision. When you turn to look at it directly, 
716                 however, it disappears. You think you're going mad.";
717           14:
718             print_ret 
719                 "You continue walking. You're not sure that you're 
720                 going in the right direction but you can't stop now. 
721                 You must find a way out of this frozen wasteland. 
722                 There has to be something here besides endless snow. 
723                 You won't give up. You can't give up.";
724           15:
725             print_ret 
726                 "You hear a horrible howl in the distance or is it 
727                 the wind? Looking around you see nothing in this 
728                 barren landscape but snow. You're not sure what to 
729                 make of it, but you don't want to stick around to 
730                 find out. You keep walking. The wind is really 
731                 picking up now and the snowfall is getting heavier.";
732           16:
733             print_ret 
734                 "The wind is now a shrieking banshee, freezing and 
735                 relentless, as it throws the snow into your face, 
736                 blinding you. Every step you take is hard-fought. The 
737                 whole world is white. You can't see anything, but you 
738                 must keep going. There is no choice. You have no idea 
739                 where you are.";
740           17:
741             print_ret 
742                 "The blizzard rages, but you continue to press on. 
743                 It's hard to walk against the brutal winds. Every 
744                 step is an effort. You can barely see anything, and 
745                 you stumble forward. You're determined to live but 
746                 the blizzard doesn't seem to care whether you live or 
747                 die. It just keeps howling and shrieking.";
748           18:
749             print_ret 
750                 "The wind screams in your ears and you can't see 
751                 anything. It's as if you're in a sea of white. You 
752                 trudge on and try to keep your spirits up and not let 
753                 the snowstorm get to you. The wind knocks you down on 
754                 your hands and knees. You get back up, but you're 
755                 slipping and sliding all over the place.";
756           19:
757             print_ret 
758                 "Can't go back. Can't go forward. You can't even see 
759                 where you are. The snowstorm has made it impossible 
760                 to see anything more than a few feet in front of you. 
761                 Nothing makes any sense and you feel like you're 
762                 starting to go in circles.";
763           20:
764             print_ret 
765                 "You hope you're going the right way. You can't let 
766                 the snowstorm get the best of you. You have to keep 
767                 going. As you walk you try to keep your mind occupied 
768                 with anything other than the storm. You really have 
769                 no idea how far you've come or in what direction.";
770           21:
771             print_ret 
772                 "You keep walking and walking. You can't tell where 
773                 the white sky and white ground begin and end. You 
774                 don't even know if you're walking in a circle or not. 
775                 The snowfall is so thick that you can barely see your 
776                 hand if you hold it right in front of your face.";
777           22:
778             deadflag = 2;
779             print_ret 
780                 "You see something in the distance but can't make it 
781                 out. You walk toward it to find out that it's the 
782                 hotel. You collapse in the lobby as the hotel staff 
783                 rush over to you.";
784         }
785     }
786 ];
787
788 Object  forest "Forest"
789   with  description [;
790             print_forest_description();
791         ],
792         before [;
793           Go:
794             if (location == thedark) {
795                 DarkToDark();
796             }
797             if (noun == d_obj || noun == u_obj) {
798                 print_ret "You can't go that way.";
799             }
800             forest_location = forest_location++;
801         ],
802         cant_go print_forest_description;
803
804 [ check_for_cabin_lighting;
805     if (lightbulb has on) {
806         print 
807             "The light from inside the cabin only penetrates a few 
808             feet from the building. ";
809     }
810     else
811         if (lantern in player && lantern has on) {
812             print 
813                 "The lantern provides the only source of 
814                 light. ";
815         }
816     if (location has light)
817         print 
818             "The snow stings your face and you can barely see three feet in 
819             front of you. ";
820     if (snowshoes in player && snowshoes has worn) {
821         print 
822             "The snowshoes are doing their job by making sure 
823             you don't sink into the snow.^";
824     }
825 ];
826
827 Object  eastofcabin "East Of Cabin"
828   with  description [;
829             print "It's dark outside. ";
830             check_for_cabin_lighting();
831         ],
832         w_to window,
833         s_to southofcabin,
834   has   light;
835
836 Object  westofcabin "West Of Cabin"
837   with  description 
838             "The snow is falling so fast that you can barely see 
839             anything. You can't even be sure you're going in the right 
840             direction.",
841         s_to southofcabin,
842   has   light;
843
844 [ Initialise;
845     Location = mainroom;
846     thedark.description = 
847         "It is pitch black. You are likely to be eaten 
848         by a grue.";
849     print 
850         "You're trapped in a snowstorm while visiting the forest 
851         during your vacation to a small rural town. This is the worst 
852         snowstorm in more than 40 years. If only you has listened to 
853         the news. Well, it's too late for that. The snow has been 
854         falling for the past seven hours and shows no signs of 
855         stopping anytime soon. You need to get back to your hotel in 
856         the town. You finally manage to find an old cabin in the 
857         woods and get inside but have no idea where you are. You're 
858         not dressed for this weather.^";
859     StartDaemon(lantern);
860     StartDaemon(snowshoes);
861     StartDaemon(snowsuit);
862     StartDaemon(grue);
863 ];
864
865 [ DeathMessage;
866     if (deadflag == 3)
867         print "You sink into the deep snow and are unable to move.";
868     if (deadflag == 4)
869         print 
870             "Finally, you succumb to the cold. Your mind goes blank as 
871             you slip away into the endless darkness and the deep sleep 
872             of death.";
873 ];
874
875 ! Don't have 'take all' take the lightbulb in the mainroom of the 
876 ! cabin
877
878 [ ChooseObjects obj code;
879     if (code < 2) {
880         if (obj has scenery)
881             return 2;
882         rfalse;
883     }
884     if (obj == lightbulb)
885         return 0;
886 ];
887
888 [ InScope;
889     if (location == thedark && real_location == mainroom) {
890         PlaceInScope(lightsocket);
891         PlaceInScope(lightbulb);
892     }
893     return false;
894 ];
895
896 Object  grue "grue" thedark
897   with  article "the",
898         name 'grue' 'monster',
899         grue_active_around_cabin,
900         grue_active_in_the_dark,
901         daemon [;
902             if (location == thedark) {
903                 switch (++(self.grue_active_in_the_dark)) {
904                   1:
905                     "^You hear horrible gurgling sounds in the dark.";
906                   2:
907                     "^You hear the clink of razor-sharp claws nearby.";
908                   3:
909                     deadflag = 1;
910                     "^Your last memory is of the slavering fangs of the 
911                     horrible Grue as it claims you for a meal.";
912                 }
913             }
914             if (location == mainroom || location == office || location ==
915             kitchenette || location == bedroom) {
916                 switch (++(self.grue_active_around_cabin)) {
917                   1:
918                     "^You hear the wind howling outside, if it is the wind.";
919                   2:
920                     "^You hear horrible gurgling sounds outside.";
921                   3:
922                     "^The noise outside gets louder.";
923                   4:
924                     "^You hear the sound of shuffling feet outside.";
925                   5:
926                     "^You hear something sniffing around the cabin.";
927                   6:
928                     "^You hear a deep guttural sound from outside that sends a chill down your spine.";
929                   7:
930                     "^You hear something scratching on the cabin walls from outside.";
931                   8:
932                     "^You hear something howl outside. It's a chilling, mournful wail that sends a chill down your spine.";
933                   9:
934                     "^A thunderous CRACK can be heard coming from outside.";
935                   10:
936                     "^There's a sudden crashing sound as something is thrown against the cabin walls.";
937                   11:
938                     "^Something begins to beat against the walls of the cabin, as if trying to to break in. It makes a loud, thunderous noise.";
939                   12:
940                     "^The wind is howling and the walls are being beaten so hard it feels like the cabin is shaking.";
941                   13:
942                     "^Suddenly, there's ominous silence from outside the cabin.";
943                 }
944             }
945             if (location == mainroom || location == office || location ==
946             kitchenette || location == bedroom && self.grue_active_around_cabin
947             == 15) {
948                 print "^The lights flicker and suddenly go out.^";
949                 cabin_has_electricity = 0;
950                 give lightbulb ~on;
951                 give mainroom ~light;
952                 give office ~light;
953                 give kitchenette ~light;
954                 give bedroom ~light;
955                 give eastofcabin ~light;
956                 give southofcabin ~light;
957             }
958             return true;
959         ],
960   has   scenery;
961
962 [ DarkToDark;
963     deadflag = 1;
964     "Oh, no! You have walked into the slavering fangs of a lurking 
965     grue!";
966 ];
967
968 [ URL;
969     print 
970         "^If you need help try some of the commands from: 
971         ^http://pr-if.org/doc/play-if-card/^";
972 ];
973
974 [ XyzzySub;
975     print "Nothing obvious happens.^";
976     return true;
977 ];
978
979 [ HelpSub;
980     URL();
981     return true;
982 ];
983
984 Include "grammar";
985
986 Verb 'About'
987     * -> Version;
988
989 Verb 'Info'
990     * -> Version;
991
992 Verb 'Help'
993     * -> Help;
994
995 Verb 'Clue'
996     * -> Help;
997
998 Verb 'Hint'
999     * -> Help;
1000
1001 Verb 'xyzzy'
1002     * -> Xyzzy;
1003
1004 Verb 'crawl'
1005     * 'through' / 'out' / 'via' noun -> Go;
1006
1007 Verb 'escape'
1008     * 'through' / 'out' / 'via' noun -> Go;
1009
1010 Extend 'jump'
1011     * 'through' / 'out' / 'via' noun -> Go;
1012
1013 Extend 'climb'
1014     * 'through' / 'out' / 'via' noun -> Go;
1015
1016 Extend 'go'
1017     * 'through' / 'out' / 'via' noun -> Go;