From 0c2803638f4d7b63360ff35726c37db75862218c Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 24 Jun 2017 09:30:15 -0400 Subject: [PATCH] Correct buggy behavior of sign in endgame. Add a test for this. --- adventure.yaml | 3 ++- main.c | 2 +- notes.adoc | 4 ++++ tests/defeat.chk | 34 +++++++++++++++++++--------------- tests/defeat.log | 1 + 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/adventure.yaml b/adventure.yaml index 6ba2797..44c71fd 100644 --- a/adventure.yaml +++ b/adventure.yaml @@ -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."' diff --git a/main.c b/main.c index c2e28b5..f59f600 100644 --- a/main.c +++ b/main.c @@ -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); diff --git a/notes.adoc b/notes.adoc index 1baf354..aea93d0 100644 --- a/notes.adoc +++ b/notes.adoc @@ -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 diff --git a/tests/defeat.chk b/tests/defeat.chk index d7af962..7e51c2d 100644 --- a/tests/defeat.chk +++ b/tests/defeat.chk @@ -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,14 +2637,14 @@ You're in Plover Room. > e +Your lamp has run out of power. + 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. You're in Plover Room. @@ -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. diff --git a/tests/defeat.log b/tests/defeat.log index cc04a49..ab2c267 100644 --- a/tests/defeat.log +++ b/tests/defeat.log @@ -394,6 +394,7 @@ d west d e +read sign take magazine e drop magazine -- 2.31.1