projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into actions-arithmetic
[open-adventure.git]
/
score.c
diff --git
a/score.c
b/score.c
index d49eff80338c2a816970b45b418b773ad39b8065..645a35e96a132345e6dd512496d87c9adad9d193 100644
(file)
--- a/
score.c
+++ b/
score.c
@@
-7,8
+7,9
@@
* scoring and wrap-up
*/
* 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;
{
long score = 0, mxscor = 0;
@@
-40,7
+41,7
@@
void score(long mode)
if(i > CHEST)k=16;
if(game.prop[i] >= 0)
score += 2;
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;
}
score += k-2;
mxscor += k;
}
@@
-54,7
+55,8
@@
void score(long mode)
* mundane exits or 133, 134, 135 if he blew it (so to speak). */
score += (MAXDIE-game.numdie)*10;
mxscor += MAXDIE*10;
* 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 += 4;
if(game.dflag != 0)score += 25;
mxscor += 25;
@@
-73,7
+75,7
@@
void score(long mode)
mxscor += 45;
/* Did he come to Witt's End as he should? */
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 += 1;
mxscor += 1;
@@
-93,7
+95,7
@@
void score(long mode)
score=score-game.trnluz-game.saved;
/* Return to score command if that's where we came from. */
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(GARNERED_POINTS);
@@
-108,7
+110,7
@@
void score(long mode)
SETPRM(1,score,mxscor);
SETPRM(3,game.turns,game.turns);
RSPEAK(TOTAL_SCORE);
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;
if(CVAL[i] >= score) {
newspeak(class_messages[i]);
i=CVAL[i]+1-score;