4 Calculate what the player's score would be if he quit now.
5 This may be the end of the game, or he may just be wondering
8 The present scoring algorithm is as follows:
9 (treasure points are explained in a following comment)
10 objective: points: present total possible:
11 getting well into cave 25 25
12 total possible for treasures (+mag) 426
13 reaching "closing" 20 20
14 "closed": quit/killed 10
19 (points can also be deducted for using hints or deaths.)
30 int cur_score
, max_score
, qk
[3];
31 int obj
, num_treas
, k
, i
;
39 /** First tally up the treasures. Must be in building and not broken.
40 give the poor guy partial score just for finding each treasure.
41 Gets full score, qk[3], for obj if:
42 obj is at loc qk[1], and
43 obj has prop value of qk[2]
46 magazine 1 (absolute) 1
48 all the following are multiplied by 5 (range 5-25):
50 cask 3 (with wine only)
51 chain 4 (must enter via styx)
79 total: 85 * 5 = 425 + 1 ==> 426
82 for (obj
= 1; obj
< MAXOBJ
; obj
++) {
83 if (g
.points
[obj
] == 0)
86 qk
[0] = (int) (t
< 0L ? -((t
= -t
) % 1000) : (t
% 1000));
88 qk
[1] = (int) (t
% 1000);
89 qk
[2] = (int) (t
/ 1000);
98 if ((g
.place
[obj
] == qk
[0]) && (g
.prop
[obj
] == qk
[1])
99 && ((g
.place
[obj
] != -CHEST
) || (g
.place
[CHEST
] == 3))
100 && ((g
.place
[obj
] != -SHIELD
) || (g
.place
[SHIELD
] == -SAFE
))
102 cur_score
+= qk
[2] - k
;
108 Now look at how he finished and how far he got. Maxdie and numdie tell us
109 how well he survived. Gaveup says whether he exited via quit. Dflag will
110 tell us if he ever got suitably deep into the cave. Closing still indicates
111 whether he reached the endgame. And if he got as far as "cave closed"
112 (indicated by "closed"), then bonus is zero for mundane exits or 133, 134,
113 135 if he blew it (so to speak).
125 else if (g
.bonus
== 135)
127 else if (g
.bonus
== 134)
129 else if (g
.bonus
== 133)
134 /* Deduct points for hints, deaths and quiting.
135 hints < hntmin are special; see database description
137 for (i
= 1; i
<= HNTMAX
; i
++)
139 cur_score
-= g
.hints
[i
][2];
140 cur_score
-= g
.numdie
* 10;
144 fprintf(stdout
, "You have found %3d out of %3d Treasures,",
145 num_treas
- g
.tally
, num_treas
);
146 fprintf(stdout
, " using %4d turns\n", g
.turns
);
147 fprintf(stdout
, "For a score of: %4d", cur_score
);
148 fprintf(stdout
, " out of a possible %4d\n", max_score
);
150 if (cur_score
< 110) {
151 fprintf(stdout
, "You are obviously a rank amateur.");
153 fprintf(stdout
, " Better luck next time.");
156 } else if (cur_score
< 152) {
158 "Your score qualifies you as a Novice Class Adventurer.\n");
160 } else if (cur_score
< 200) {
162 "You have achieved the rating: \"Experienced Adventurer\".\n");
164 } else if (cur_score
< 277) {
166 "You may now consider yourself a \"Seasoned Adventurer\".\n");
168 } else if (cur_score
< 345) {
170 "You have reached \"Junior Master\" status.\n");
172 } else if (cur_score
< 451) {
174 "Your score puts you in Master Adventurer Class C.\n");
176 } else if (cur_score
< 471) {
178 "Your score puts you in Master Adventurer Class B.\n");
180 } else if (cur_score
< 501) {
182 "Your score puts you in Master Adventurer Class A.\n");
186 "All of Adventuredom gives tribute to you, Adventurer Grandmaster!\n");
191 kk2c
= (k
== 1) ? "." : "s.";
192 printf("\nTo acheive the next higher rating,");
193 if (cur_score
== 501)
194 printf(" would be a neat trick!\n\n CONGRATULATIONS!!\n");
196 printf(" you need %3d more point%s\n", k
, kk2c
);