Correct buggy behavior of sign in endgame. Add a test for this.

This commit is contained in:
Eric S. Raymond 2017-06-24 09:30:15 -04:00
parent 2c9c9076b1
commit 0c2803638f
5 changed files with 31 additions and 21 deletions

View file

@ -1742,7 +1742,8 @@ object_descriptions: !!omap
- OBJ_49:
inventory: '*sign'
longs:
- ''
- [INGAME_SIGN, '']
- [ENDGAME_SIGN, '']
texts:
- 'Cave under construction beyond this point.\n Proceed at own risk.\n [Witt Construction Company]'
- '"Treasure Vault. Keys in main office."'

2
main.c
View file

@ -812,7 +812,7 @@ static bool closecheck(void)
* Reuse sign. */
PUT(GRATE, LOC_SW, 0);
PUT(SIGN, LOC_SW, 0);
++OBJTXT[SIGN];
game.prop[SIGN] = ENDGAME_SIGN;
game.prop[SNAKE] = PUT(SNAKE, LOC_SW, 1);
game.prop[BIRD] = PUT(BIRD, LOC_SW, 1);
game.prop[CAGE] = PUT(CAGE, LOC_SW, 0);

View file

@ -89,6 +89,10 @@ with coverage tools (we now have over 90% coverage, with the remaining
confined to exception cases that are very difficult to reach). This is
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.
The move to modern C entailed some structural changes. The most
important was the refactoring of over 350 gotos into if/loop/break
structures. We also abolished almost all shared globals; the main one

View file

@ -2422,6 +2422,12 @@ Proceed at own risk. [Witt Construction Company]"
There are a few recent issues of "Spelunker Today" magazine here.
> read sign
Cave under construction beyond this point.
Proceed at own risk.
[Witt Construction Company]
> take magazine
OK
@ -2575,15 +2581,15 @@ You're in anteroom.
> u
A sepulchral voice reverberating through the cave, says, "Cave closing
soon. All adventurers exit immediately through main office."
You are at a complex junction. A low hands and knees passage from the
north joins a higher crawl from the east to make a walking passage
going west. There is also a large room above. The air is damp here.
> u
A sepulchral voice reverberating through the cave, says, "Cave closing
soon. All adventurers exit immediately through main office."
You're in dusty rock room.
> e
@ -2631,12 +2637,6 @@ You're in Plover Room.
> e
There is no way to go that direction.
You're in Plover Room.
> e
Your lamp has run out of power.
There is no way to go that direction.
@ -2647,6 +2647,12 @@ You're in Plover Room.
There is no way to go that direction.
You're in Plover Room.
> e
There is no way to go that direction.
You're in a small chamber lit by an eerie green light. An extremely
narrow tunnel exits to the west. A dark corridor leads ne.
@ -2881,12 +2887,6 @@ You're in Plover Room.
> e
There is no way to go that direction.
You're in Plover Room.
> e
The sepulchral voice intones, "The cave is now closed." As the echoes
fade, there is a blinding flash of light (and a small puff of orange
smoke). . . . As your eyes refocus, you look around and find...
@ -2903,6 +2903,12 @@ not disturb the dwarves!" An immense mirror is hanging against one
wall, and stretches to the other end of the room, where various other
sundry objects can be glimpsed dimly in the distance.
> e
There is no way to go that direction.
You're at ne end.
> sw
You are at the southwest end of the repository. To one side is a pit
@ -2918,9 +2924,7 @@ The grate is locked.
> read sign
Cave under construction beyond this point.
Proceed at own risk.
[Witt Construction Company]
"Treasure Vault. Keys in main office."
> take rod
@ -2940,7 +2944,7 @@ There is a loud explosion, and a twenty-foot hole appears in the far
wall, burying the snakes in the rubble. A river of molten lava pours
in through the hole, destroying everything in its path, including you!
You scored 413 out of a possible 430, using 467 turns.
You scored 413 out of a possible 430, using 468 turns.
Your score puts you in Master Adventurer Class A.

View file

@ -394,6 +394,7 @@ d
west
d
e
read sign
take magazine
e
drop magazine