Fixed logic, documented it in notes and tests

This commit is contained in:
NHOrus 2017-07-02 17:50:42 +03:00
parent e91742e1b9
commit 29672a6447
4 changed files with 29 additions and 4 deletions

View file

@ -528,7 +528,9 @@ static int extinguish(token_t verb, int obj)
obj = LAMP; obj = LAMP;
if (HERE(URN) && game.prop[URN] == URN_LIT) if (HERE(URN) && game.prop[URN] == URN_LIT)
obj = URN; 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; obj = LAMP;
if (HERE(URN) && game.prop[URN] == URN_DARK) if (HERE(URN) && game.prop[URN] == URN_DARK)
obj = URN; 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;
} }

View 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 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 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. 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 The move to modern C entailed some structural changes. The most
important was the refactoring of over 350 gotos into if/loop/break important was the refactoring of over 350 gotos into if/loop/break

View 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 > light urn
The urn is now lit. 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 > look
Sorry, but I am not allowed to give more detail. I will repeat the 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 > look
Sorry, but I am not allowed to give more detail. I will repeat the 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 > look
The forest thins out here to reveal a steep cliff. There is no way 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.

View file

@ -338,14 +338,18 @@ light urn
pour bottle pour bottle
fill bottle fill bottle
drink oil drink oil
light
light urn light urn
fill urn fill urn
read urn read urn
look look
extinguish extinguish
extinguish
look look
light urn
light light
look look
extinguish urn extinguish urn
extinguish
look look
fly fly