9 void score(long MODE) {
10 /* <0 if scoring, >0 if quitting, =0 if died or won */
12 /* The present scoring algorithm is as follows:
13 * Objective: Points: Present total possible:
14 * Getting well into cave 25 25
15 * Each treasure < chest 12 60
16 * Treasure chest itself 14 14
17 * Each treasure > chest 16 224
18 * Surviving (MAX-NUM)*10 30
20 * Reaching "CLOSNG" 25 25
21 * "Closed": Quit/Killed 10
25 * Came to Witt's End 1 1
26 * Round out the total 2 2
28 * Points can also be deducted for using hints or too many turns, or for
29 * saving intermediate positions. */
34 /* First tally up the treasures. Must be in building and not broken.
35 * Give the poor guy 2 points just for finding each treasure. */
37 /* 20010 */ for (I=50; I<=MAXTRS; I++) {
38 if(PTEXT[I] == 0) goto L20010;
42 if(PROP[I] >= 0)SCORE=SCORE+2;
43 if(PLACE[I] == 3 && PROP[I] == 0)SCORE=SCORE+K-2;
48 /* Now look at how he finished and how far he got. MAXDIE and NUMDIE tell us
49 * how well he survived. DFLAG will
50 * tell us if he ever got suitably deep into the cave. CLOSNG still indicates
51 * whether he reached the endgame. And if he got as far as "cave closed"
52 * (indicated by "CLOSED"), then bonus is zero for mundane exits or 133, 134,
53 * 135 if he blew it (so to speak). */
55 SCORE=SCORE+(MAXDIE-NUMDIE)*10;
56 MXSCOR=MXSCOR+MAXDIE*10;
57 if(MODE == 0)SCORE=SCORE+4;
59 if(DFLAG != 0)SCORE=SCORE+25;
61 if(CLOSNG)SCORE=SCORE+25;
63 if(!CLOSED) goto L20020;
64 if(BONUS == 0)SCORE=SCORE+10;
65 if(BONUS == 135)SCORE=SCORE+25;
66 if(BONUS == 134)SCORE=SCORE+30;
67 if(BONUS == 133)SCORE=SCORE+45;
68 L20020: MXSCOR=MXSCOR+45;
70 /* Did he come to Witt's End as he should? */
72 if(PLACE[MAGZIN] == 108)SCORE=SCORE+1;
80 /* Deduct for hints/turns/saves. Hints < 4 are special; see database desc. */
82 for (I=1; I<=HNTMAX; I++) {
83 if(HINTED[I])SCORE=SCORE-HINTS[I][2];
85 if(NOVICE)SCORE=SCORE-5;
86 if(CLSHNT)SCORE=SCORE-10;
87 SCORE=SCORE-TRNLUZ-SAVED;
89 /* Return to score command if that's where we came from. */
93 /* that should be good enough. Let's tell him all about it. */
95 if(SCORE+TRNLUZ+1 >= MXSCOR && TRNLUZ != 0)RSPEAK(242);
96 if(SCORE+SAVED+1 >= MXSCOR && SAVED != 0)RSPEAK(143);
97 SETPRM(1,SCORE,MXSCOR);
98 SETPRM(3,TURNS,TURNS);
100 for (I=1; I<=CLSSES; I++) {
101 if(CVAL[I] >= SCORE) goto L20210;
107 L20210: SPEAK(CTEXT[I]);
109 if(I >= CLSSES) goto L25000;