!game.closed)
rspeak(REQUIRES_DYNAMITE);
else {
- if (HERE(ROD2))
- game.bonus = SPLATTER_MESSAGE;
- else if (game.loc == LOC_NE)
- game.bonus = DEFEAT_MESSAGE;
- else
- game.bonus = VICTORY_MESSAGE;
- rspeak(game.bonus);
+ if (HERE(ROD2)) {
+ game.bonus = splatter;
+ rspeak(SPLATTER_MESSAGE);
+ } else if (game.loc == LOC_NE) {
+ game.bonus = defeat;
+ rspeak(DEFEAT_MESSAGE);
+ } else {
+ game.bonus = victory;
+ rspeak(VICTORY_MESSAGE);
+ }
terminate(endgame);
}
}
enum wordtype {NO_WORD_TYPE, MOTION, OBJECT, ACTION, SPECIAL};
+typedef enum scorebonus {none, splatter, defeat, victory} score_t;
+
/* Phase codes for action returns.
* These were at one time FORTRAN line numbers.
* The values don't matter, but perturb their order at your peril.
struct game_t {
unsigned long lcg_a, lcg_c, lcg_m, lcg_x;
long abbnum; // How often to print non-abbreviated descriptions
- long bonus;
+ score_t bonus; // What kind of bonus we are getting for finishing the game
long chloc;
long chloc2;
long clock1; // # turns from finding last treasure till closing
score += 25;
mxscor += 25;
if (game.closed) {
- if (game.bonus == 0)
+ if (game.bonus == none)
score += 10;
- if (game.bonus == SPLATTER_MESSAGE)
+ if (game.bonus == splatter)
score += 25;
- if (game.bonus == DEFEAT_MESSAGE)
+ if (game.bonus == defeat)
score += 30;
- if (game.bonus == VICTORY_MESSAGE)
+ if (game.bonus == victory)
score += 45;
}
mxscor += 45;