From: Eric S. Raymond Date: Wed, 5 Apr 2023 23:49:38 +0000 (-0400) Subject: Improved behavior when magic words are said before they're seen. X-Git-Tag: 1.16~38 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=fe378b9e136bfe93b5166ef36f03cad976d643b2;p=open-adventure.git Improved behavior when magic words are said before they're seen. Note: there is a tiny risk that this could break savefile compatibility, as I swiped an unused int member in the game structure and turned it into a bool. int and bool *should* be the same sixe... --- diff --git a/actions.c b/actions.c index 05377ff..658d95d 100644 --- a/actions.c +++ b/actions.c @@ -231,7 +231,10 @@ static phase_codes_t bigwords(vocab_t id) } } else { /* Magic-word sequebce was started but is incorrect */ - rspeak(START_OVER); + if (settings.oldstyle || game.seenbigwords) + rspeak(START_OVER); + else + rspeak(WELL_POINTLESS); game.foobar = WORD_EMPTY; return GO_CLEAROBJ; } diff --git a/advent.h b/advent.h index 3afeb8e..5ff1146 100644 --- a/advent.h +++ b/advent.h @@ -178,7 +178,7 @@ struct game_t { int saved; // point penalty for saves int tally; // count of treasures gained int thresh; // current threshold for endgame scoring tier - turn_t trndex; // FIXME: not used, remove on next format bump + bool seenbigwords; // have we red the grafitti in the Giant's Room? turn_t trnluz; // # points lost so far due to turns used turn_t turns; // counts commands given (ignores yes/no) char zzword[TOKLEN + 1]; // randomly generated magic word from bird diff --git a/adventure.yaml b/adventure.yaml index c9827df..a48ee7d 100644 --- a/adventure.yaml +++ b/adventure.yaml @@ -3016,6 +3016,7 @@ arbitrary_messages: !!omap black smoke. - SHELL_IMPERVIOUS: 'The shell is very strong and is impervious to attack.' - START_OVER: 'What''s the matter, can''t you read? Now you''d best start over.' +- WELL_POINTLESS: 'Well, that was remarkably pointless!' - DRAGON_SCALES: 'The axe bounces harmlessly off the dragon''s thick scales.' - NASTY_DRAGON: 'The dragon looks rather nasty. You''d best not try to get by.' - BIRD_BURNT: |- diff --git a/main.c b/main.c index ef7d392..124ba44 100644 --- a/main.c +++ b/main.c @@ -935,6 +935,8 @@ static void listobjects(void) game.prop[RUG] = RUG_DRAGON; if (obj == CHAIN) game.prop[CHAIN] = CHAINING_BEAR; + if (obj == EGGS) + game.seenbigwords = true; --game.tally; /* Note: There used to be a test here to see whether the * player had blown it so badly that he could never ever see diff --git a/notes.adoc b/notes.adoc index 8358565..d8d8292 100644 --- a/notes.adoc +++ b/notes.adoc @@ -53,6 +53,11 @@ Bug fixes: * Response to an attempt to unlock the oyster while carrying it was incorrect. +* Behavior when saying the giant's magic words before having seen them wasn't + quite correct - the game responded as though the player had already + read them ("...can't you read?"). The new message is "Nothing happens." + The -o option reverts this change. + * Attempting to extinguish an unlit urn caused it to lose its oil. * "A crystal bridge now spans the fissure." (progressive present) was diff --git a/tests/magicwords.chk b/tests/magicwords.chk index 24df443..4db287a 100644 --- a/tests/magicwords.chk +++ b/tests/magicwords.chk @@ -67,7 +67,7 @@ OK > say fum -What's the matter, can't you read? Now you'd best start over. +Well, that was remarkably pointless! > z diff --git a/tests/newfilter b/tests/newfilter index 9ae3da7..c5bad71 100755 --- a/tests/newfilter +++ b/tests/newfilter @@ -6,5 +6,6 @@ sed \ -e '/bridge now spans the fissure/s//bridge spans the fissure/' \ -e '/ground/s//surface/' \ -e '/floor/s//surface/' \ + -e "/Well, that was remarkably pointless!/s//What's the matter, can't you read? Now you'd best start over./" \ # end