Magic-number and state-arithmetic removal.

This commit is contained in:
Eric S. Raymond 2017-07-01 09:21:04 -04:00
parent 36a6cbca34
commit ab94051da1
2 changed files with 6 additions and 3 deletions

View file

@ -93,8 +93,12 @@ static int attack(struct command_t *command)
}
spk = (dwarves > 1) ? OGRE_PANIC1 : OGRE_PANIC2;
} else if (obj == BEAR) {
/* FIXME: Arithmetic on message numbers */
spk = BEAR_HANDS + (game.prop[BEAR] + 1) / 2;
switch (game.prop[BEAR]) {
case UNTAMED_BEAR: spk = BEAR_HANDS; break;
case SITTING_BEAR: spk = BEAR_CONFUSED; break;
case CONTENTED_BEAR: spk = BEAR_CONFUSED; break;
case BEAR_DEAD: spk = ALREADY_DEAD; break;
}
} else if (obj == DRAGON && game.prop[DRAGON] == 0) {
/* Fun stuff for dragon. If he insists on attacking it, win!
* Set game.prop to dead, move dragon to central loc (still