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