Dragon attack code no longer edits the command struct.

This also fixes a minor bug where refusing to attack the dragon
costs the player two turns instead of one.
This commit is contained in:
Jason S. Ninneman 2017-07-12 13:49:28 -07:00
parent ff6a816e5f
commit 596a15457d
2 changed files with 6 additions and 9 deletions

View file

@ -101,13 +101,10 @@ static int attack(struct command_t *command)
* fixed), move rug there (not fixed), and move him there, * fixed), move rug there (not fixed), and move him there,
* too. Then do a null motion to get new description. */ * too. Then do a null motion to get new description. */
rspeak(BARE_HANDS_QUERY); rspeak(BARE_HANDS_QUERY);
if (silent_yes()) { if (!silent_yes())
// FIXME: setting wd1 is a workaround for broken logic {
command->wd1 = token_to_packed("Y"); speak(arbitrary_messages[NASTY_DRAGON]);
} else { return GO_MOVE;
// FIXME: setting wd1 is a workaround for broken logic
command->wd1 = token_to_packed("N");
return GO_CHECKFOO;
} }
state_change(DRAGON, DRAGON_DEAD); state_change(DRAGON, DRAGON_DEAD);
game.prop[RUG] = RUG_FLOOR; game.prop[RUG] = RUG_FLOOR;

View file

@ -307,7 +307,7 @@ The blood-specked body of a huge green dead dragon lies to one side.
For crying out loud, the poor thing is already dead! For crying out loud, the poor thing is already dead!
You scored 77 out of a possible 430, using 50 turns. You scored 77 out of a possible 430, using 49 turns.
Your score qualifies you as a novice class adventurer. Your score qualifies you as a novice class adventurer.