Fix scoring problem
[snowed-in.git] / src / snowed-in.inf
index 3bdf7102f3e4ca6dccf4ec40769c2f687babec95..b92c9200299e77861f58e750f42e6450b5dbf248 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/
+!
+! SPDX-License-Identifier: AGPL-3.0-or-later
+Array UUID_ARRAY string "UUID://DE9FA2E5-4EC7-4166-9218-E56EFA1DF40F//";
+#Ifdef UUID_ARRAY;
+#Endif;
 Global lantern_fuel_left = 20;
 Global body_temperature = 20;
 Global cabin_has_electricity = 1;
@@ -37,8 +42,8 @@ Constant Headline
     If not, contact the place you got it from.^^";
 Include "parser";
 Include "verblib";
-Release 1;
-Serial "220531";
+Release 3;
+Serial "220612";
 
 Object  mainroom "Main Room"
   with  description 
@@ -51,7 +56,9 @@ Object  mainroom "Main Room"
             kitchenette can be found to the west. There's a doorway 
             in the south wall leading outside.",
         n_to bedroom,
-        s_to frontdoor,
+        s_to 
+            "The weight of the snow against the door is such that it 
+            won't budge.",
         e_to office,
         w_to kitchenette,
   has   light;
@@ -81,6 +88,12 @@ Object  frontdoor "front door" mainroom
             else
                 return mainroom;
         ],
+        before [;
+          Open:
+            print_ret 
+                "The weight of the snow against the door is such that 
+                it won't budge.";
+        ],
   has   scenery door openable;
 
 Object  bearclaw "bear claw" mainroom
@@ -95,9 +108,17 @@ Object  sofa "sofa" mainroom
   with  description 
             "The sofa is in poor shape. The upholstery is ripped and 
             there are several holes in it.",
+        before_implicit [;
+          Take:
+            if (action_to_be == ##Eat)
+                return 2;
+        ],
         before [;
           Take, Pull, Push, PushDir, Turn:
             print_ret (The) self, " is too heavy for that.";
+          Open:
+            TearSub();
+            return true;
         ],
   has   scenery supporter enterable;
 
@@ -107,6 +128,11 @@ Object  coffeetable "coffee table" mainroom
             "The old coffee table looks as if it's had quite a bit of 
             use. There are burn marks covering it and the paint is 
             worn off in most places.",
+        before_implicit [;
+          Take:
+            if (action_to_be == ##Eat)
+                return 2;
+        ],
         before [;
           Take, Pull, Push, PushDir, Turn:
             print_ret (The) self, " is too heavy for that.";
@@ -165,8 +191,11 @@ Object  television "flat-screen TV" mainroom
             "The flat-screen TV looks fairly modern but it's been 
             broken in a fight and the screen is dangling out.",
         before [;
-          Take, Pull, Push, PushDir, Turn:
-            print_ret (The) self, " is firmly mounted to the wall.";
+          Take, Pull, Push, PushDir, Turn, Remove:
+            print_ret 
+                "The damaged electronics throw some sparks, 
+                and you get a mild shock. Perhaps it's best left 
+                where it is.";
           SwitchOn:
             if (television hasnt visited) {
                 score = score + 1;
@@ -258,7 +287,8 @@ Object  office "Office"
             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.",
+            bullet hole through the middle. The main room is to the 
+            west.",
         before [;
           Go:
             if (noun == e_obj) {
@@ -266,10 +296,10 @@ Object  office "Office"
                     print_ret 
                         "You can't fit through the window while 
                         wearing the snow shoes.";
-            }
-            if (eastofcabin hasnt visited) {
-                score = score + 1;
-                give office visited;
+                if (eastofcabin hasnt visited) {
+                    score = score + 1;
+                    give office visited;
+                }
             }
         ],
         w_to mainroom,
@@ -407,7 +437,8 @@ Object  kitchenette "Kitchenette"
             hard to tell what's a pipe and what's a faucet. A 
             refrigerator, standing open and empty. The door has been 
             ripped off. There's no indication as to where it 
-            went. There's no food anywhere in here.",
+            went. There's no food anywhere in here. The main room is 
+            to the east.",
         e_to mainroom,
   has   light;
 
@@ -442,8 +473,8 @@ Object  bedroom "Bedroom"
   with  description 
             "This bedroom is small and cramped, and looks like a 
             major fight happened as the exterior wall has bullet 
-            holes. The bed is lying on the floor, torn to shreds. It 
-            has no sheets, just a bare mattress.",
+            holes. There's a bare mattress, torn to shreds. The main 
+            room is to the south.",
         s_to mainroom,
   has   light;
 
@@ -477,11 +508,15 @@ Object  snowsuit "snowsuit" suitcase
             }
           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 [;
@@ -508,13 +543,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:
@@ -524,26 +561,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.";
                 }
             }
         ],
@@ -709,14 +747,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 
@@ -763,11 +801,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 
@@ -823,6 +861,12 @@ Object  flashlight "flashlight" backpack
                 keep wandering through endless whiteness. You won't 
                 give up.";
           14:
+            print_ret 
+                "You're so cold that you begin to hallucinate, first 
+                seeing the words ~Ventilation Control Room~ and then 
+                yourself at a console. The hallucination quickly 
+                fades.";
+          15:
             deadflag = 2;
             print_ret 
                 "You see something in the distance but can't make it 
@@ -880,8 +924,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 
@@ -931,12 +975,21 @@ Object  roof "Roof"
         cant_go "Walking off the edge of a roof seems unwise.";
 
 Object  northofcabin "North Of Cabin"
-  with  description 
-            "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. The snow buildup here is so great that it's 
-            almost level with the cabin's roof, which is to the 
-            south.",
+  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,
@@ -946,16 +999,23 @@ Object  northofcabin "North Of Cabin"
             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. The snow buildup gets taller to the north.",
+  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,
         n_to northofcabin,
         cant_go 
@@ -976,7 +1036,8 @@ Object  westofcabin "West Of Cabin"
         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);
@@ -1014,10 +1075,22 @@ Object  westofcabin "West Of Cabin"
     return false;
 ];
 
+Object  cabin "cabin" mainroom
+  with  name 'cabin',
+        found_in mainroom bedroom office kitchenette southofcabin eastofcabin
+        northofcabin westofcabin,
+        before [;
+          Enter, Exit:
+            print_ret 
+                "You'll have to say which compass direction to go 
+                in.";
+        ],
+  has   scenery;
+
 Object  snowmobile "snowmobile" thedark
   with  name 'snowmobile',
         daemon [;
-            snowmobile_location = random(13);
+            snowmobile_location = random(14);
             if (location == forest && forest_location == snowmobile_location)
             {
                 deadflag = 2;
@@ -1038,20 +1111,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:
@@ -1061,21 +1137,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 ==
@@ -1137,6 +1224,10 @@ Object  grue "grue" thedark
     return true;
 ];
 
+[ TearSub;
+    print_ret "Doing that would achieve little.";
+];
+
 Include "grammar";
 
 Verb 'About'
@@ -1157,17 +1248,47 @@ Verb 'Hint'
 Verb 'xyzzy'
     * -> Xyzzy;
 
+Verb 'tear'
+    * noun -> Tear;
+
+Extend 'tear'
+    * 'up' / 'open' noun -> Tear;
+
+Verb 'rip'
+    * noun -> Tear;
+
+Extend 'rip'
+    * 'up' / 'open' noun -> Tear;
+
 Verb 'crawl'
-    * 'through' / 'out' / 'via' noun -> Go;
+    * 'through' / 'out' / 'via' noun -> Enter;
 
 Verb 'escape'
-    * 'through' / 'out' / 'via' noun -> Go;
+    * 'through' / 'out' / 'via' noun -> Enter;
 
 Extend 'jump'
-    * 'through' / 'out' / 'via' noun -> Go;
+    * 'through' / 'out' / 'via' noun -> Enter;
 
 Extend 'climb'
-    * 'through' / 'out' / 'via' noun -> Go;
+    * 'through' / 'out' / 'via' noun -> Climb;
 
 Extend 'go'
-    * 'through' / 'out' / 'via' noun -> Go;
+    * 'through' / 'out' / 'via' noun -> Enter;
+
+Extend 'go' first
+    * 'out' / 'outside' -> VagueGo;
+
+Extend 'go' first
+    * 'out' / 'outside' / 'outside' 'of' noun -> VagueGo;
+
+Extend 'go' first
+    * 'in' / 'into' / 'inside' -> VagueGo;
+
+Extend 'go' first
+    * 'in' / 'into' / 'inside' / 'inside' 'of' noun -> VagueGo;
+
+Extend 'exit' first
+    * noun -> VagueGo;
+
+Extend 'leave' first
+    * noun -> VagueGo;
\ No newline at end of file