Implement additional description for North and West of cabin. Fix some overly long...
[snowed-in.git] / src / snowed-in.inf
index af4c4c9936ef671bb9c9a0549f9c55b7da973a55..20d62252760a95a4dc95cbb4df854080dfc216fd 100644 (file)
 !
 ! You should have received a copy of the GNU Affero General Public
 ! License along with this file. If not, see https://gnu.org/licenses/
-Global lantern_fuel_left = 10;
+Global lantern_fuel_left = 20;
 Global body_temperature = 20;
 Global cabin_has_electricity = 1;
 Global forest_location = 1;
-Constant NO_SCORE;
+Global snowmobile_location = 0;
+Constant MAX_SCORE = 7;
 Constant DEATH_MENTION_UNDO;
 Constant Story "Snowed In";
 Constant Headline 
@@ -37,7 +38,7 @@ Constant Headline
 Include "parser";
 Include "verblib";
 Release 1;
-Serial "220529";
+Serial "220531";
 
 Object  mainroom "Main Room"
   with  description 
@@ -168,6 +169,7 @@ Object  television "flat-screen TV" mainroom
             print_ret (The) self, " is firmly mounted to the wall.";
           SwitchOn:
             if (television hasnt visited) {
+                score = score + 1;
                 print 
                     "Despite the significant damage, the television 
                     comes to life in one last valiant attempt to be 
@@ -253,7 +255,7 @@ Object  lightbulb "light bulb" lightsocket
 Object  office "Office"
   with  description 
             "There seems to have been quite a fight in here. The room 
-            is a wreck. Holes are in the walls and the windows are 
+            is a wreck. Holes are in the walls and the window is 
             broken, letting in the cold air from outside. Chunks of 
             drywall and insulation cover the floor. The desk has a 
             bullet hole through the middle.",
@@ -265,6 +267,10 @@ Object  office "Office"
                         "You can't fit through the window while 
                         wearing the snow shoes.";
             }
+            if (eastofcabin hasnt visited) {
+                score = score + 1;
+                give office visited;
+            }
         ],
         w_to mainroom,
         e_to window,
@@ -311,6 +317,7 @@ Object  computer "computer" desk
             print_ret (The) self, " is too heavy for that.";
           SwitchOn:
             if (computer hasnt visited) {
+                score = score + 1;
                 print 
                     "The computer makes some concerning noises while 
                     lights on the front also illuminate. The last 
@@ -463,13 +470,22 @@ Object  snowsuit "snowsuit" suitcase
             "The snowsuit is blue, decorated with white and purple 
             designs. On the chest are the letters ~CE~ in purple.",
         before [;
+          Examine:
+            if (snowsuit hasnt visited) {
+                score = score + 1;
+                give snowsuit visited;
+            }
           Wear:
             if (snowshoes in player && snowshoes has worn) {
-                print_ret "The snowsuit can't fit over the snowshoes.";
+                print_ret 
+                    "The snowsuit can't fit over the 
+                    snowshoes.";
             }
           Disrobe, Remove:
             if (snowshoes in player && snowshoes has worn) {
-                print_ret "The snowsuit can't be taken off over the snowshoes.";
+                print_ret 
+                    "The snowsuit can't be taken off over the 
+                    snowshoes.";
             }
         ],
         daemon [;
@@ -496,13 +512,15 @@ Object  snowsuit "snowsuit" suitcase
             && location ~= thedark && snowsuit hasnt worn) {
                 switch (body_temperature) {
                   19:
-                    "The feeling of cold overwhelms you. Surely the cold will get to 
-                    you before anything else does. Right?";
+                    "The feeling of cold overwhelms you. Surely the 
+                    cold will get to you before anything else does. 
+                    Right?";
                   18:
-                    "You can feel yourself getting colder and colder.";
+                    "You can feel yourself getting colder and 
+                    colder.";
                   17:
-                    "You can see your own breath freezing in the air, forming little 
-                    clouds.";
+                    "You can see your own breath freezing in the air, 
+                    forming little clouds.";
                   16:
                     "You shiver in the cold.";
                   15:
@@ -512,26 +530,27 @@ Object  snowsuit "snowsuit" suitcase
                   13:
                     "You continue shivering in order to keep warm.";
                   12:
-                    "Your shivering grows worse as your body becomes colder by the
-                    minute.";
+                    "Your shivering grows worse as your body becomes 
+                    colder by the minute.";
                   11:
-                    "Your teeth begin to chatter as you desperately try to warm 
-                    yourself up.";
+                    "Your teeth begin to chatter as you desperately 
+                    try to warm yourself up.";
                   10:
-                    "Your shivering intensifies as your body begins to freeze over 
-                    from the cold.";
+                    "Your shivering intensifies as your body begins 
+                    to freeze over from the cold.";
                   9:
-                    "Your fingers become stiff and you feel sharp pains all over your
-                    body.";
+                    "Your fingers become stiff and you feel sharp 
+                    pains all over your body.";
                   8:
-                    "The cold has gotten to a point where it is too much for you. You 
-                    begin to shiver uncontrollably.";
+                    "The cold has gotten to a point where it is too 
+                    much for you. You begin to shiver 
+                    uncontrollably.";
                   7:
-                    "Your eyesight begins to fade and you can't even feel yourself 
-                    shivering anymore.";
+                    "Your eyesight begins to fade and you can't even 
+                    feel yourself shivering anymore.";
                   6:
-                    "You can feel your body shutting down from the cold as you slowly 
-                    begin to lose consciousness.";
+                    "You can feel your body shutting down from the 
+                    cold as you slowly begin to lose consciousness.";
                 }
             }
         ],
@@ -564,7 +583,8 @@ Object  southofcabin "South Of Cabin"
   with  description [;
             print 
                 "The wind is howling, and there's snow flying 
-                everywhere. ";
+                everywhere. The snow buildup seems to get higher to 
+                the west. ";
             if (snowsuit hasnt worn)
                 print 
                     "It's really cold and you're not dressed for 
@@ -587,7 +607,7 @@ Object  southofcabin "South Of Cabin"
 Object  truckspot "Forest"
   with  description 
             "The blizzard is still going on. You don't think it's 
-            letting up anytime soon. There is a blue and white 
+            letting up any time soon. There is a blue and white 
             pickup truck here. It looks like it got stuck in the snow 
             and is slowly being covered by it. The windows are iced 
             up and you can't see inside.",
@@ -642,6 +662,13 @@ Object  backpack "backpack" backpacklocation
             toward the bottom of the backpack. On the side are the 
             letters ~CE~ in purple. The backpack is covered in blood, 
             as if the owner met with an untimely demise.",
+        before [;
+          Examine:
+            if (backpack hasnt visited) {
+                score = score + 1;
+                give backpack visited;
+            }
+        ],
   has   clothing container openable;
 
 Object  flashlight "flashlight" backpack
@@ -651,6 +678,10 @@ Object  flashlight "flashlight" backpack
             inches long.",
         before [;
           SwitchOn:
+            if (flashlight hasnt visited) {
+                score = score + 1;
+                give flashlight visited;
+            }
             give flashlight light;
           SwitchOff:
             give lantern ~light;
@@ -685,14 +716,14 @@ Object  flashlight "flashlight" backpack
           4:
             print_ret 
                 "You trudge through the snow. The wind is really 
-                strong and howling like a banshee. You hear a horrible 
-                howl in the distance or is it the wind? Looking 
-                around you see nothing in this barren landscape but 
-                snow. You're not sure what to make of it, but you 
-                don't want to stick around to find out. The whole 
-                world is white. You can barely see five feet ahead of 
-                you. You hope you're going the right way. This place 
-                is so desolate and barren.";
+                strong and howling like a banshee. You hear a 
+                horrible howl in the distance or is it the wind? 
+                Looking around you see nothing in this barren 
+                landscape but snow. You're not sure what to make of 
+                it, but you don't want to stick around to find out. 
+                The whole world is white. You can barely see five 
+                feet ahead of you. You hope you're going the right 
+                way. This place is so desolate and barren.";
           5:
             print_ret 
                 "You think you might can see a large figure stepping 
@@ -739,11 +770,11 @@ Object  flashlight "flashlight" backpack
                 fierce wind howling through this frozen landscape. 
                 This isn't just a place of cold and ice - it's 
                 other-worldly. You trudge on and try to keep your 
-                spirits up and not let the snowstorm get to you. Every 
-                step is an effort. You wish you had the powers of a 
-                superhero right now. You can barely see where you are 
-                going. The wind knocks you down on your hands and 
-                knees. You get back up, but you're slipping and 
+                spirits up and not let the snowstorm get to you. 
+                Every step is an effort. You wish you had the powers 
+                of a superhero right now. You can barely see where 
+                you are going. The wind knocks you down on your hands 
+                and knees. You get back up, but you're slipping and 
                 sliding all over the place.";
           10:
             print_ret 
@@ -839,6 +870,7 @@ Object  forest "Forest"
     give lantern ~light;
     lantern_fuel_left = 0;
     StopDaemon(lantern);
+    score = score - 1;
 ];
 
 [ check_for_cabin_lighting;
@@ -855,8 +887,8 @@ Object  forest "Forest"
         }
     if (location has light)
         print 
-            "The snow stings your face and you can barely see three feet in 
-            front of you. ";
+            "The snow stings your face and you can barely see three 
+            feet in front of you. ";
     if (snowshoes in player && snowshoes has worn) {
         print 
             "The snowshoes are doing their job by making sure 
@@ -876,15 +908,83 @@ Object  eastofcabin "East Of Cabin"
         ],
         w_to window,
         s_to southofcabin,
+        cant_go 
+            "The snow buildup is is too great to continue in that 
+            direction.",
   has   light;
 
+Object  roof "Roof"
+  with  description [;
+            print 
+                "You're on the roof of the cabin, although it's hard 
+                to tell where the snow buildup ends and the roof 
+                begins. You can make out the trees around the cabin, 
+                but you can't see very far out into the snowfield 
+                beyond them.";
+            if (roof hasnt visited)
+                print 
+                    " You hear a snowmobile approaching in the 
+                    distance. Is it your salvation? The snowmobile 
+                    quickly zooms by in front of the cabin and 
+                    disappears into the forest.";
+            StartDaemon(snowmobile);
+            if (roof has visited)
+                print 
+                    " There seems to be no movement, no sound, no 
+                    sign of anything.";
+            new_line;
+        ],
+        n_to northofcabin,
+        cant_go "Walking off the edge of a roof seems unwise.";
+
+Object  northofcabin "North Of Cabin"
+  with  description [;
+            print 
+                "You're on the north side of the cabin. The wind is 
+                howling and the snow is coming down; falling too fast 
+                to see well.";
+            if (northofcabin hasnt visited)
+                print 
+                    " That might be a tree in the distance or a 
+                    shadowy figure - It's hard to tell in this 
+                    storm.";
+            print_ret 
+                " The snow buildup here is so great that it's 
+                almost level with the cabin's roof, which is to the 
+                south.";
+        ],
+        n_to westofcabin,
+        s_to roof,
+        w_to westofcabin,
+        cant_go "It's too steep to go in that direction safely.",
+        before [;
+          Go:
+            if (noun == s_obj) {
+                if (roof hasnt visited) {
+                    score = score + 1;
+                    give roof visited;
+                }
+            }
+        ];
+
 Object  westofcabin "West Of Cabin"
-  with  description 
-            "The snow is falling so fast that you can barely see 
-            anything. You can't even be sure you're going in the right 
-            direction.",
+  with  description [;
+            print 
+                "The snow is falling so fast that you can barely see 
+                anything. You can't even be sure you're going in the 
+                right direction.";
+            if (westofcabin hasnt visited)
+                print 
+                    " Then you hear a shuffling noise in the snow. 
+                    There was something there and now it's gone. Or 
+                    was it always there and you just never saw it?";
+            print_ret " The snow buildup gets taller to the north.";
+        ],
         s_to southofcabin,
-  has   light;
+        n_to northofcabin,
+        cant_go 
+            "The snow buildup is is too great to continue in that 
+            direction.";
 
 [ Initialise;
     Location = mainroom;
@@ -897,10 +997,11 @@ Object  westofcabin "West Of Cabin"
         snowstorm in more than 40 years. If only you had listened to 
         the news. Well, it's too late for that. The snow has been 
         falling for the past seven hours and shows no signs of 
-        stopping anytime soon. You need to get back to your hotel in 
+        stopping any time soon. You need to get back to your hotel in 
         the town. You finally manage to find an old cabin in the 
         woods and get inside but have no idea where you are. You're 
-        not dressed for this weather, and it's getting dark outside.^";
+        not dressed for this weather, and it's getting dark 
+        outside.^";
     StartDaemon(lantern);
     StartDaemon(snowshoes);
     StartDaemon(snowsuit);
@@ -938,6 +1039,21 @@ Object  westofcabin "West Of Cabin"
     return false;
 ];
 
+Object  snowmobile "snowmobile" thedark
+  with  name 'snowmobile',
+        daemon [;
+            snowmobile_location = random(13);
+            if (location == forest && forest_location == snowmobile_location)
+            {
+                deadflag = 2;
+                print_ret 
+                    "A snowmobile approaches. The person says they 
+                    saw your light and came to rescue you.";
+            }
+            return true;
+        ],
+  has   scenery;
+
 Object  grue "grue" thedark
   with  article "the",
         name 'grue' 'monster',
@@ -947,20 +1063,23 @@ Object  grue "grue" thedark
             if (location == thedark) {
                 switch (++(self.grue_active_in_the_dark)) {
                   1:
-                    "^You hear horrible gurgling sounds in the dark.";
+                    "^You hear horrible gurgling sounds in the 
+                    dark.";
                   2:
-                    "^You hear the clink of razor-sharp claws nearby.";
+                    "^You hear the clink of razor-sharp claws 
+                    nearby.";
                   3:
                     deadflag = 1;
-                    "^Your last memory is of the slavering fangs of the 
-                    horrible Grue as it claims you for a meal.";
+                    "^Your last memory is of the slavering fangs of 
+                    the horrible Grue as it claims you for a meal.";
                 }
             }
             if (location == mainroom || location == office || location ==
             kitchenette || location == bedroom) {
                 switch (++(self.grue_active_around_cabin)) {
                   1:
-                    "^You hear the wind howling outside, if it is the wind.";
+                    "^You hear the wind howling outside, if it is the 
+                    wind.";
                   2:
                     "^You hear horrible gurgling sounds outside.";
                   3:
@@ -970,21 +1089,32 @@ Object  grue "grue" thedark
                   5:
                     "^You hear something sniffing around the cabin.";
                   6:
-                    "^You hear a deep guttural sound from outside that sends a chill down your spine.";
+                    "^You hear a deep guttural sound from outside 
+                    that sends a chill down your spine.";
                   7:
-                    "^You hear something scratching on the cabin walls from outside.";
+                    "^You hear something scratching on the cabin 
+                    walls from outside.";
                   8:
-                    "^You hear something howl outside. It's a chilling, mournful wail that sends a chill down your spine.";
+                    "^You hear something howl outside. It's a 
+                    chilling, mournful wail that sends a chill down 
+                    your spine.";
                   9:
-                    "^A thunderous CRACK can be heard coming from outside.";
+                    "^A thunderous CRACK can be heard coming from 
+                    outside.";
                   10:
-                    "^There's a sudden crashing sound as something is thrown against the cabin walls.";
+                    "^There's a sudden crashing sound as something is 
+                    thrown against the cabin walls.";
                   11:
-                    "^Something begins to beat against the walls of the cabin, as if trying to to break in. It makes a loud, thunderous noise.";
+                    "^Something begins to beat against the walls of 
+                    the cabin, as if trying to to break in. It makes a 
+                    loud, thunderous noise.";
                   12:
-                    "^The wind is howling and the walls are being beaten so hard it feels like the cabin is shaking.";
+                    "^The wind is howling and the walls are being 
+                    beaten so hard it feels like the cabin is 
+                    shaking.";
                   13:
-                    "^Suddenly, there's ominous silence from outside the cabin.";
+                    "^Suddenly, there's ominous silence from outside 
+                    the cabin.";
                 }
             }
             if (location == mainroom || location == office || location ==
@@ -1010,10 +1140,30 @@ Object  grue "grue" thedark
     grue!";
 ];
 
+[ PrintRank;
+    print ", earning you the rank of ";
+    if (score == 0)
+        "Novice.";
+    if (score == 1)
+        "Trained.";
+    if (score == 2)
+        "Skilled.";
+    if (score == 3)
+        "Talented.";
+    if (score == 4)
+        "Capable.";
+    if (score == 5)
+        "Adept.";
+    if (score == 6)
+        "Proficient.";
+    if (score >= 7)
+        print "Versed.";
+];
+
 [ URL;
     print 
         "^If you need help try some of the commands from: 
-        ^http://pr-if.org/doc/play-if-card/^";
+        ^https://pr-if.org/doc/play-if-card/^";
 ];
 
 [ XyzzySub;