* scoring and wrap-up
*/
-void score(long mode)
-/* mode is <0 if scoring, >0 if quitting, =0 if died or won */
+void score(enum termination mode)
+/* mode is 'scoregame' if scoring, 'quitgame' if quitting, 'endgame' if died
+ * or won */
{
long score = 0, mxscor = 0;
if(i > CHEST)k=16;
if(game.prop[i] >= 0)
score += 2;
- if(game.place[i] == 3 && game.prop[i] == 0)
+ if(game.place[i] == LOC_BUILDING && game.prop[i] == 0)
score += k-2;
mxscor += k;
}
* mundane exits or 133, 134, 135 if he blew it (so to speak). */
score += (MAXDIE-game.numdie)*10;
mxscor += MAXDIE*10;
- if(mode == 0)score += 4;
+ if(mode == endgame)
+ score += 4;
mxscor += 4;
if(game.dflag != 0)score += 25;
mxscor += 25;
mxscor += 45;
/* Did he come to Witt's End as he should? */
- if(game.place[MAGZIN] == 108)
+ if(game.place[MAGZIN] == LOC_WITTSEND)
score += 1;
mxscor += 1;
score=score-game.trnluz-game.saved;
/* Return to score command if that's where we came from. */
- if(mode < 0) {
+ if(mode == scoregame) {
SETPRM(1,score,mxscor);
SETPRM(3,game.turns,game.turns);
RSPEAK(GARNERED_POINTS);
SETPRM(1,score,mxscor);
SETPRM(3,game.turns,game.turns);
RSPEAK(TOTAL_SCORE);
- for (long i=1; i<=CLSSES; i++) {
+ for (long i=1; i<=(long)CLSSES; i++) {
if(CVAL[i] >= score) {
newspeak(class_messages[i]);
i=CVAL[i]+1-score;