projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Encapsulate object-state state tests and setttings in macros.
[open-adventure.git]
/
score.c
diff --git
a/score.c
b/score.c
index 8e37374591b165bd7787be8245aecdd58f2255f3..ed9cdeda34263281610372603e9da659ff906979 100644
(file)
--- a/
score.c
+++ b/
score.c
@@
-48,9
+48,9
@@
int score(enum termination mode)
k = 14;
if (i > CHEST)
k = 16;
k = 14;
if (i > CHEST)
k = 16;
- if (game.
prop[i]
> STATE_NOTFOUND)
+ if (game.
objects[i].prop
> STATE_NOTFOUND)
score += 2;
score += 2;
- if (game.
place[i] == LOC_BUILDING && game.prop[i] == STATE_FOUND
)
+ if (game.
objects[i].place == LOC_BUILDING && PROP_IS_FOUND(i)
)
score += k - 2;
mxscor += k;
}
score += k - 2;
mxscor += k;
}
@@
-86,7
+86,7
@@
int score(enum termination 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[MAGAZINE]
== LOC_WITTSEND)
+ if (game.
objects[MAGAZINE].place
== LOC_WITTSEND)
score += 1;
mxscor += 1;
score += 1;
mxscor += 1;
@@
-96,7
+96,7
@@
int score(enum termination mode)
/* Deduct for hints/turns/saves. Hints < 4 are special; see database desc. */
for (int i = 0; i < NHINTS; i++) {
/* Deduct for hints/turns/saves. Hints < 4 are special; see database desc. */
for (int i = 0; i < NHINTS; i++) {
- if (game.hint
ed[i]
)
+ if (game.hint
s[i].used
)
score = score - hints[i].penalty;
}
if (game.novice)
score = score - hints[i].penalty;
}
if (game.novice)