9 void score(long MODE) {
10 /* arg is <0 if scoring, >0 if quitting, =0 if died or won */
13 /* The present scoring algorithm is as follows:
14 * Objective: Points: Present total possible:
15 * Getting well into cave 25 25
16 * Each treasure < chest 12 60
17 * Treasure chest itself 14 14
18 * Each treasure > chest 16 224
19 * Surviving (MAX-NUM)*10 30
21 * Reaching "game.closng" 25 25
22 * "Closed": Quit/Killed 10
26 * Came to Witt's End 1 1
27 * Round out the total 2 2
29 * Points can also be deducted for using hints or too many turns, or for
30 * saving intermediate positions. */
35 /* First tally up the treasures. Must be in building and not broken.
36 * Give the poor guy 2 points just for finding each treasure. */
38 /* 20010 */ for (I=50; I<=MAXTRS; I++) {
39 if(PTEXT[I] == 0) goto L20010;
43 if(game.prop[I] >= 0)SCORE=SCORE+2;
44 if(game.place[I] == 3 && game.prop[I] == 0)SCORE=SCORE+K-2;
49 /* Now look at how he finished and how far he got. MAXDIE and game.numdie tell us
50 * how well he survived. game.dflag will
51 * tell us if he ever got suitably deep into the cave. game.closng still indicates
52 * whether he reached the endgame. And if he got as far as "cave closed"
53 * (indicated by "game.closed"), then bonus is zero for mundane exits or 133, 134,
54 * 135 if he blew it (so to speak). */
56 SCORE=SCORE+(MAXDIE-game.numdie)*10;
57 MXSCOR=MXSCOR+MAXDIE*10;
58 if(MODE == 0)SCORE=SCORE+4;
60 if(game.dflag != 0)SCORE=SCORE+25;
62 if(game.closng)SCORE=SCORE+25;
64 if(!game.closed) goto L20020;
65 if(game.bonus == 0)SCORE=SCORE+10;
66 if(game.bonus == 135)SCORE=SCORE+25;
67 if(game.bonus == 134)SCORE=SCORE+30;
68 if(game.bonus == 133)SCORE=SCORE+45;
69 L20020: MXSCOR=MXSCOR+45;
71 /* Did he come to Witt's End as he should? */
73 if(game.place[MAGZIN] == 108)SCORE=SCORE+1;
81 /* Deduct for hints/turns/saves. Hints < 4 are special; see database desc. */
83 for (I=1; I<=HNTMAX; I++) {
84 if(game.hinted[I])SCORE=SCORE-HINTS[I][2];
86 if(game.novice)SCORE=SCORE-5;
87 if(game.clshnt)SCORE=SCORE-10;
88 SCORE=SCORE-game.trnluz-game.saved;
90 /* Return to score command if that's where we came from. */
93 SETPRM(1,SCORE,MXSCOR);
94 SETPRM(3,game.turns,game.turns);
99 /* that should be good enough. Let's tell him all about it. */
101 if(SCORE+game.trnluz+1 >= MXSCOR && game.trnluz != 0)RSPEAK(242);
102 if(SCORE+game.saved+1 >= MXSCOR && game.saved != 0)RSPEAK(143);
103 SETPRM(1,SCORE,MXSCOR);
104 SETPRM(3,game.turns,game.turns);
106 for (I=1; I<=CLSSES; I++) {
107 if(CVAL[I] >= SCORE) goto L20210;
113 L20210: SPEAK(CTEXT[I]);
115 if(I >= CLSSES) goto L25000;