Fixed logic, documented it in notes and tests 188/head
authorNHOrus <jy6x2b32pie9@yahoo.com>
Sun, 2 Jul 2017 14:50:42 +0000 (17:50 +0300)
committerNHOrus <jy6x2b32pie9@yahoo.com>
Sun, 2 Jul 2017 14:50:42 +0000 (17:50 +0300)
actions.c
notes.adoc
tests/urntest.chk
tests/urntest.log

index 51a3f599a6cddde9b9d7d590e7b5bfb70826b6b0..f2ec65adac01a042d5b8b7283d4e89f9bee2ca4f 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -528,7 +528,9 @@ static int extinguish(token_t verb, int obj)
             obj = LAMP;
         if (HERE(URN) && game.prop[URN] == URN_LIT)
             obj = URN;
             obj = LAMP;
         if (HERE(URN) && game.prop[URN] == URN_LIT)
             obj = URN;
-        if (obj == INTRANSITIVE)
+        if (obj == INTRANSITIVE ||
+            HERE(LAMP) && game.prop[LAMP] == LAMP_BRIGHT &&
+            HERE(URN) && game.prop[URN] == URN_LIT)
             return GO_UNKNOWN;
     }
 
             return GO_UNKNOWN;
     }
 
@@ -739,7 +741,9 @@ static int light(token_t verb, token_t obj)
             obj = LAMP;
         if (HERE(URN) && game.prop[URN] == URN_DARK)
             obj =  URN;
             obj = LAMP;
         if (HERE(URN) && game.prop[URN] == URN_DARK)
             obj =  URN;
-        if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS)
+        if (obj == INTRANSITIVE ||
+            HERE(LAMP) && game.prop[LAMP] == LAMP_DARK && game.limit >= 0 &&
+            HERE(URN) && game.prop[URN] == URN_DARK)
             return GO_UNKNOWN;
     }
 
             return GO_UNKNOWN;
     }
 
index 884d1ce7f7d5ff970e2ca331687afe5e17cffe67..4f4e1c41552c132702a066473aa0821cc39cf42f 100644 (file)
@@ -93,6 +93,7 @@ what you are running when you do "make check".
 In the process we found and fixed a few minor bugs. Most notably, reading
 the relocated Witt's End sign in the endgame didn't work. Behavior when
 saying the giant's magic words outside his room wasn't quite right either.
 In the process we found and fixed a few minor bugs. Most notably, reading
 the relocated Witt's End sign in the endgame didn't work. Behavior when
 saying the giant's magic words outside his room wasn't quite right either.
+Attempt to extinguish dark urn would have cause it do lose oil.
 
 The move to modern C entailed some structural changes.  The most
 important was the refactoring of over 350 gotos into if/loop/break
 
 The move to modern C entailed some structural changes.  The most
 important was the refactoring of over 350 gotos into if/loop/break
index 8beba1bcaebb621b7e9860d62269987a0da7b1b2..8dec2a7b0836a37b3d75e568c74212f82fa24c0b 100644 (file)
@@ -1989,6 +1989,10 @@ There's no way to get the oil out of the urn.
 
 Don't be ridiculous!
 
 
 Don't be ridiculous!
 
+> light
+
+Light what?
+
 > light urn
 
 The urn is now lit.
 > light urn
 
 The urn is now lit.
@@ -2015,6 +2019,10 @@ A small oil flame extrudes from an urn embedded in the rock.
 
 The urn is now dark.
 
 
 The urn is now dark.
 
+> extinguish
+
+Extin what?
+
 > look
 
 Sorry, but I am not allowed to give more detail.  I will repeat the
 > look
 
 Sorry, but I am not allowed to give more detail.  I will repeat the
@@ -2025,10 +2033,14 @@ down, but a small ledge can be seen to the west across the chasm.
 
 A small urn full of oil is embedded in the rock.
 
 
 A small urn full of oil is embedded in the rock.
 
-> light
+> light urn
 
 The urn is now lit.
 
 
 The urn is now lit.
 
+> light
+
+Your lamp is now on.
+
 > look
 
 Sorry, but I am not allowed to give more detail.  I will repeat the
 > look
 
 Sorry, but I am not allowed to give more detail.  I will repeat the
@@ -2043,6 +2055,10 @@ A small oil flame extrudes from an urn embedded in the rock.
 
 The urn is now dark.
 
 
 The urn is now dark.
 
+> extinguish
+
+Your lamp is now off.
+
 > look
 
 The forest thins out here to reveal a steep cliff.  There is no way
 > look
 
 The forest thins out here to reveal a steep cliff.  There is no way
@@ -2056,7 +2072,7 @@ If you mean to use the persian rug, it does not appear inclined to
 cooperate.
 
 
 cooperate.
 
 
-You scored 267 out of a possible 430, using 345 turns.
+You scored 267 out of a possible 430, using 349 turns.
 
 You have reached "Junior Master" status.
 
 
 You have reached "Junior Master" status.
 
index 4cd8c31061cd85fefad5c273c87ad5ce1f8ae09f..88acaa18084135139c5fafb5eaae45d4359d23ab 100644 (file)
@@ -338,14 +338,18 @@ light urn
 pour bottle
 fill bottle
 drink oil
 pour bottle
 fill bottle
 drink oil
+light
 light urn
 fill urn
 read urn
 look
 extinguish
 light urn
 fill urn
 read urn
 look
 extinguish
+extinguish
 look
 look
+light urn
 light
 look
 extinguish urn
 light
 look
 extinguish urn
+extinguish
 look
 fly
 look
 fly