long fixed[NOBJECTS + 1];
long link[NOBJECTS * 2 + 1];
long place[NOBJECTS + 1];
- long hinted[HINT_COUNT];
- long hintlc[HINT_COUNT];
+ long hinted[NHINTS];
+ long hintlc[NHINTS];
long prop[NOBJECTS + 1];
};
/* Clear the hint stuff. game.hintlc[i] is how long he's been at LOC
* with cond bit i. game.hinted[i] is true iff hint i has been
* used. */
- for (int i = 0; i < HINT_COUNT; i++) {
+ for (int i = 0; i < NHINTS; i++) {
game.hinted[i] = false;
game.hintlc[i] = 0;
}
* game.iwest How many times he's said "west" instead of "w"
* game.knfloc 0 if no knife here, loc if knife here, -1 after caveat
* game.limit Lifetime of lamp (not set here)
- * maximum_deaths Number of reincarnation messages available (up to 5)
+ * NDEATHS Number of reincarnation messages available (up to 5)
* game.numdie Number of times killed so far
* game.trnluz # points lost so far due to number of turns used
* game.turns Tallies how many commands he's given (ignores yes/no)
static void checkhints(void)
{
if (conditions[game.loc] >= game.conds) {
- for (int hint = 0; hint < HINT_COUNT; hint++) {
+ for (int hint = 0; hint < NHINTS; hint++) {
if (game.hinted[hint])
continue;
if (!CNDBIT(game.loc, hint + 1 + COND_HBASE))
/* "You're dead, Jim."
*
* If the current loc is zero, it means the clown got himself killed.
- * We'll allow this maxdie times. maximum_deaths is automatically set based
+ * We'll allow this maxdie times. NDEATHS is automatically set based
* on the number of snide messages available. Each death results in
* a message (81, 83, etc.) which offers reincarnation; if accepted,
* this results in message 82, 84, etc. The last time, if he wants
* death and exit. */
rspeak(DEATH_CLOSING);
terminate(endgame);
- } else if (game.numdie == maximum_deaths || !YES(query, yes_response, arbitrary_messages[OK_MAN]))
+ } else if (game.numdie == NDEATHS || !YES(query, yes_response, arbitrary_messages[OK_MAN]))
terminate(endgame);
else {
game.place[WATER] = game.place[OIL] = LOC_NOWHERE;
/* If a turn threshold has been met, apply penalties and tell
* the player about it. */
- for (int i = 0; i < turn_threshold_count; ++i)
+ for (int i = 0; i < NTHRESHOLDS; ++i)
{
if (game.turns == turn_thresholds[i].threshold + 1)
{
extern obituary_t obituaries[];
extern hint_t hints[];
extern long conditions[];
-extern const size_t CLSSES;
-extern const int maximum_deaths;
-extern const int turn_threshold_count;
-#define HINT_COUNT {}
+
+#define NHINTS {}
+#define NCLASSES {}
+#define NDEATHS {}
+#define NTHRESHOLDS {}
enum arbitrary_messages_refs {{
{}
{}
}};
-const size_t CLSSES = {};
-const int maximum_deaths = {};
-const int turn_threshold_count = {};
-
/* end */
"""
get_obituaries(db["obituaries"]),
get_hints(db["hints"], db["arbitrary_messages"]),
get_condbits(db["locations"]),
- len(db["classes"]),
- len(db["obituaries"]),
- len(db["turn_thresholds"]),
)
h = h_template.format(
len(db["hints"]),
+ len(db["classes"]),
+ len(db["obituaries"]),
+ len(db["turn_thresholds"]),
get_refs(db["arbitrary_messages"]),
get_refs(db["locations"]),
get_refs(db["object_descriptions"]),
}
}
- /* Now look at how he finished and how far he got. maximum_deaths and
+ /* Now look at how he finished and how far he got. NDEATHS and
* game.numdie tell us how well he survived. game.dflag will tell us
* if he ever got suitably deep into the cave. game.closng still
* indicates whether he reached the endgame. And if he got as far as
* "cave closed" (indicated by "game.closed"), then bonus is zero for
* mundane exits or 133, 134, 135 if he blew it (so to speak). */
- score += (maximum_deaths - game.numdie) * 10;
- mxscor += maximum_deaths * 10;
+ score += (NDEATHS - game.numdie) * 10;
+ mxscor += NDEATHS * 10;
if (mode == endgame)
score += 4;
mxscor += 4;
mxscor += 2;
/* Deduct for hints/turns/saves. Hints < 4 are special; see database desc. */
- for (long i = 0; i < HINT_COUNT; i++) {
+ for (long i = 0; i < NHINTS; i++) {
if (game.hinted[i])
score = score - hints[i].penalty;
}
if (points + game.saved + 1 >= mxscor && game.saved != 0)
rspeak(WITHOUT_SUSPENDS);
rspeak(TOTAL_SCORE, points, mxscor, game.turns, game.turns);
- for (long i = 1; i <= (long)CLSSES; i++) {
+ for (long i = 1; i <= (long)NCLASSES; i++) {
if (classes[i].threshold >= points) {
speak(classes[i].message);
i = classes[i].threshold + 1 - points;