From 630c158db305e2fc45fe246eed30045d50c1ec4d Mon Sep 17 00:00:00 2001 From: dholland Date: Tue, 25 Aug 2009 06:56:52 +0000 Subject: Whn ths cd ws wrttn, thr ws bt shrtg nd vwls wr xtrml xpnsv. Nowadays, however, we have an ample vowel budget, and bit shortages are a thing of the past (even in a down economy) so spend a bit to improve readability. --- adventure/done.c | 73 +++++++++++++++++++++++++++--------------------------- adventure/extern.h | 4 +-- adventure/hdr.h | 54 ++++++++++++++++++++-------------------- adventure/init.c | 72 ++++++++++++++++++++++++++--------------------------- adventure/io.c | 30 +++++++++++----------- adventure/main.c | 48 +++++++++++++++++------------------ adventure/save.c | 20 +++++++-------- adventure/subr.c | 70 +++++++++++++++++++++++++-------------------------- adventure/vocab.c | 10 ++++---- adventure/wizard.c | 10 ++++---- 10 files changed, 196 insertions(+), 195 deletions(-) diff --git a/adventure/done.c b/adventure/done.c index 61daab02..8693937d 100644 --- a/adventure/done.c +++ b/adventure/done.c @@ -1,4 +1,4 @@ -/* $NetBSD: done.c,v 1.9 2005/07/01 00:03:36 jmc Exp $ */ +/* $NetBSD: done.c,v 1.10 2009/08/25 06:56:52 dholland Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)done.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: done.c,v 1.9 2005/07/01 00:03:36 jmc Exp $"); +__RCSID("$NetBSD: done.c,v 1.10 2009/08/25 06:56:52 dholland Exp $"); #endif #endif /* not lint */ @@ -53,8 +53,9 @@ __RCSID("$NetBSD: done.c,v 1.9 2005/07/01 00:03:36 jmc Exp $"); int score(void) { /* sort of like 20000 */ - int scor, i; - mxscor = scor = 0; + int myscore, i; + + maxscore = myscore = 0; for (i = 50; i <= maxtrs; i++) { if (ptext[i].txtlen == 0) continue; @@ -64,42 +65,42 @@ score(void) if (i > chest) k = 16; if (prop[i] >= 0) - scor += 2; + myscore += 2; if (place[i] == 3 && prop[i] == 0) - scor += k - 2; - mxscor += k; + myscore += k - 2; + maxscore += k; } - scor += (maxdie - numdie) * 10; - mxscor += maxdie * 10; - if (!(scorng || gaveup)) - scor += 4; - mxscor += 4; + myscore += (maxdie - numdie) * 10; + maxscore += maxdie * 10; + if (!(scoring || gaveup)) + myscore += 4; + maxscore += 4; if (dflag != 0) - scor += 25; - mxscor += 25; - if (closng) - scor += 25; - mxscor += 25; + myscore += 25; + maxscore += 25; + if (isclosing) + myscore += 25; + maxscore += 25; if (closed) { if (bonus == 0) - scor += 10; + myscore += 10; if (bonus == 135) - scor += 25; + myscore += 25; if (bonus == 134) - scor += 30; + myscore += 30; if (bonus == 133) - scor += 45; + myscore += 45; } - mxscor += 45; - if (place[magzin] == 108) - scor++; - mxscor++; - scor += 2; - mxscor += 2; - for (i = 1; i <= hntmax; i++) + maxscore += 45; + if (place[magazine] == 108) + myscore++; + maxscore++; + myscore += 2; + maxscore += 2; + for (i = 1; i <= hintmax; i++) if (hinted[i]) - scor -= hints[i][2]; - return (scor); + myscore -= hints[i][2]; + return myscore; } /* entry=1 means goto 13000 */ /* game is over */ @@ -113,11 +114,11 @@ done(int entry) if (entry == 3) rspeak(136); printf("\n\n\nYou scored %d out of a ", (sc = score())); - printf("possible %d using %d turns.\n", mxscor, turns); - for (i = 1; i <= clsses; i++) + printf("possible %d using %d turns.\n", maxscore, turns); + for (i = 1; i <= classes; i++) if (cval[i] >= sc) { speak(&ctext[i]); - if (i == clsses - 1) { + if (i == classes - 1) { printf("To achieve the next higher rating"); printf(" would be a neat trick!\n\n"); printf("Congratulations!!\n"); @@ -143,9 +144,9 @@ die(int entry) int i; if (entry != 99) { rspeak(23); - oldlc2 = loc; + oldloc2 = loc; } - if (closng) { /* 99 */ + if (isclosing) { /* 99 */ rspeak(131); numdie++; done(2); @@ -161,7 +162,7 @@ die(int entry) for (i = 100; i >= 1; i--) { if (!toting(i)) continue; - k = oldlc2; + k = oldloc2; if (i == lamp) k = 1; drop(i, k); diff --git a/adventure/extern.h b/adventure/extern.h index 178017b9..fbc7cf51 100644 --- a/adventure/extern.h +++ b/adventure/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.11 2009/08/12 04:28:27 dholland Exp $ */ +/* $NetBSD: extern.h,v 1.12 2009/08/25 06:56:52 dholland Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -89,7 +89,7 @@ void closing(void); void caveclose(void); /* vocab.c */ -void dstroy(int); +void destroy(int); void juggle(int); void move(int, int); int put(int, int, int); diff --git a/adventure/hdr.h b/adventure/hdr.h index ee6af9f1..8a2359f3 100644 --- a/adventure/hdr.h +++ b/adventure/hdr.h @@ -1,4 +1,4 @@ -/* $NetBSD: hdr.h,v 1.12 2009/08/12 04:28:27 dholland Exp $ */ +/* $NetBSD: hdr.h,v 1.13 2009/08/25 06:56:52 dholland Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -65,11 +65,11 @@ extern char data_file[]; /* Virtual data file */ #define FLUSHLINE do { int flushline_ch; while ((flushline_ch = getchar()) != EOF && flushline_ch != '\n'); } while (0) #define FLUSHLF while (next()!=LF) -extern int loc, newloc, oldloc, oldlc2, wzdark, gaveup, kq, k, k2; +extern int loc, newloc, oldloc, oldloc2, wasdark, gaveup, kq, k, k2; extern char *wd1, *wd2; /* the complete words */ extern int verb, obj, spk; extern int blklin; -extern int saveday, savet, mxscor, latncy; +extern int saveday, savet, maxscore, latency; #define SHORT 50 /* How short is a demo game? */ @@ -87,47 +87,47 @@ struct text { int txtlen; /* length of msg starting here */ }; -#define RTXSIZ 205 -extern struct text rtext[RTXSIZ]; /* random text messages */ +#define RTXSIZE 205 +extern struct text rtext[RTXSIZE]; /* random text messages */ -#define MAGSIZ 35 -extern struct text mtext[MAGSIZ]; /* magic messages */ +#define MAGSIZE 35 +extern struct text mtext[MAGSIZE]; /* magic messages */ -extern int clsses; +extern int classes; #define CLSMAX 12 extern struct text ctext[CLSMAX]; /* classes of adventurer */ extern int cval[CLSMAX]; extern struct text ptext[101]; /* object descriptions */ -#define LOCSIZ 141 /* number of locations */ -extern struct text ltext[LOCSIZ]; /* long loc description */ -extern struct text stext[LOCSIZ]; /* short loc descriptions */ +#define LOCSIZE 141 /* number of locations */ +extern struct text ltext[LOCSIZE]; /* long loc description */ +extern struct text stext[LOCSIZE]; /* short loc descriptions */ extern struct travlist { /* direcs & conditions of travel */ struct travlist *next; /* ptr to next list entry */ int conditions; /* m in writeup (newloc / 1000) */ int tloc; /* n in writeup (newloc % 1000) */ int tverb; /* the verb that takes you there */ -} *travel[LOCSIZ], *tkk; /* travel is closer to keys(...) */ +} *travel[LOCSIZE], *tkk; /* travel is closer to keys(...) */ -extern int atloc[LOCSIZ]; +extern int atloc[LOCSIZE]; extern int plac[101]; /* initial object placement */ extern int fixd[101], fixed[101]; /* location fixed? */ -extern int actspk[35]; /* rtext msg for verb */ +extern int actspeak[35]; /* rtext msg for verb */ -extern int cond[LOCSIZ]; /* various condition bits */ +extern int cond[LOCSIZE]; /* various condition bits */ extern int setbit[16]; /* bit defn masks 1,2,4,... */ -extern int hntmax; +extern int hintmax; extern int hints[20][5]; /* info on hints */ extern int hinted[20], hintlc[20]; extern int place[101], prop[101], links[201]; -extern int abb[LOCSIZ]; +extern int abb[LOCSIZE]; extern int maxtrs, tally, tally2; /* treasure values */ @@ -135,22 +135,22 @@ extern int maxtrs, tally, tally2; /* treasure values */ #define TRUE 1 extern int keys, lamp, grate, cage, rod, rod2, steps, /* mnemonics */ - bird, door, pillow, snake, fissur, tablet, clam, oyster, - magzin, dwarf, knife, food, bottle, water, oil, plant, plant2, - axe, mirror, dragon, chasm, troll, troll2, bear, messag, - vend, batter, nugget, coins, chest, eggs, tridnt, vase, - emrald, pyram, pearl, rug, chain, spices, back, look, cave, - null, entrnc, dprssn, /*enter, stream, pour,*/ say, lock, throw, - find, invent; + bird, door, pillow, snake, fissure, tablet, clam, oyster, + magazine, dwarf, knife, food, bottle, water, oil, plant, plant2, + axe, mirror, dragon, chasm, troll, troll2, bear, message, + vend, batter, nugget, coins, chest, eggs, trident, vase, + emerald, pyramid, pearl, rug, chain, spices, back, look, cave, + null, entrance, depression, /*enter, stream, pour,*/ say, lock, + throw, find, invent; extern int chloc, chloc2, dseen[7], dloc[7], /* dwarf stuff */ - odloc[7], dflag, daltlc; + odloc[7], dflag, daltloc; extern int tk[21], stick, dtotal, attack; extern int turns, lmwarn, iwest, knfloc, detail, /* various flags and * counters */ - abbnum, maxdie, numdie, holdng, dkill, foobar, bonus, clock1, - clock2, saved, closng, panic, closed, scorng; + abbnum, maxdie, numdie, holding, dkill, foobar, bonus, clock1, + clock2, saved, isclosing, panic, closed, scoring; extern int demo, limit; diff --git a/adventure/init.c b/adventure/init.c index 5a4ca15f..4d289e64 100644 --- a/adventure/init.c +++ b/adventure/init.c @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.18 2009/08/12 04:28:27 dholland Exp $ */ +/* $NetBSD: init.c,v 1.19 2009/08/25 06:56:52 dholland Exp $ */ /*- * Copyright (c) 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/2/93"; #else -__RCSID("$NetBSD: init.c,v 1.18 2009/08/12 04:28:27 dholland Exp $"); +__RCSID("$NetBSD: init.c,v 1.19 2009/08/25 06:56:52 dholland Exp $"); #endif #endif /* not lint */ @@ -65,66 +65,66 @@ int setbit[16] = {1, 2, 4, 010, 020, 040, 0100, 0200, 0400, 01000, 02000, volatile sig_atomic_t delhit; int yea; -int loc, newloc, oldloc, oldlc2, wzdark, gaveup, kq, k, k2; +int loc, newloc, oldloc, oldloc2, wasdark, gaveup, kq, k, k2; char *wd1, *wd2; /* the complete words */ int verb, obj, spk; -int saveday, savet, mxscor, latncy; +int saveday, savet, maxscore, latency; struct hashtab voc[HTSIZE]; -struct text rtext[RTXSIZ]; /* random text messages */ +struct text rtext[RTXSIZE]; /* random text messages */ -struct text mtext[MAGSIZ]; /* magic messages */ +struct text mtext[MAGSIZE]; /* magic messages */ -int clsses; +int classes; struct text ctext[CLSMAX]; /* classes of adventurer */ int cval[CLSMAX]; struct text ptext[101]; /* object descriptions */ -struct text ltext[LOCSIZ]; /* long loc description */ -struct text stext[LOCSIZ]; /* short loc descriptions */ +struct text ltext[LOCSIZE]; /* long loc description */ +struct text stext[LOCSIZE]; /* short loc descriptions */ -struct travlist *travel[LOCSIZ], *tkk; /* travel is closer to keys(...) */ +struct travlist *travel[LOCSIZE], *tkk; /* travel is closer to keys(...) */ -int atloc[LOCSIZ]; +int atloc[LOCSIZE]; int plac[101]; /* initial object placement */ int fixd[101], fixed[101]; /* location fixed? */ -int actspk[35]; /* rtext msg for verb */ +int actspeak[35]; /* rtext msg for verb */ -int cond[LOCSIZ]; /* various condition bits */ +int cond[LOCSIZE]; /* various condition bits */ -int hntmax; +int hintmax; int hints[20][5]; /* info on hints */ int hinted[20], hintlc[20]; int place[101], prop[101], links[201]; -int abb[LOCSIZ]; +int abb[LOCSIZE]; int maxtrs, tally, tally2; /* treasure values */ int keys, lamp, grate, cage, rod, rod2, steps, /* mnemonics */ - bird, door, pillow, snake, fissur, tablet, clam, oyster, - magzin, dwarf, knife, food, bottle, water, oil, plant, plant2, - axe, mirror, dragon, chasm, troll, troll2, bear, messag, - vend, batter, nugget, coins, chest, eggs, tridnt, vase, - emrald, pyram, pearl, rug, chain, spices, back, look, cave, - null, entrnc, dprssn, say, lock, throw, + bird, door, pillow, snake, fissure, tablet, clam, oyster, + magazine, dwarf, knife, food, bottle, water, oil, plant, plant2, + axe, mirror, dragon, chasm, troll, troll2, bear, message, + vend, batter, nugget, coins, chest, eggs, trident, vase, + emerald, pyramid, pearl, rug, chain, spices, back, look, cave, + null, entrance, depression, say, lock, throw, find, invent; static int enter, /*stream,*/ pour; int chloc, chloc2, dseen[7], dloc[7], /* dwarf stuff */ - odloc[7], dflag, daltlc; + odloc[7], dflag, daltloc; int tk[21], stick, dtotal, attack; int turns, lmwarn, iwest, knfloc, detail, /* various flags and * counters */ - abbnum, maxdie, numdie, holdng, dkill, foobar, bonus, clock1, - clock2, saved, closng, panic, closed, scorng; + abbnum, maxdie, numdie, holding, dkill, foobar, bonus, clock1, + clock2, saved, isclosing, panic, closed, scoring; int demo, limit; @@ -157,7 +157,7 @@ linkdata(void) int i, j; /* array linkages */ - for (i = 1; i < LOCSIZ; i++) + for (i = 1; i < LOCSIZE; i++) if (ltext[i].seekadr != 0 && travel[i] != 0) if ((travel[i]->tverb) == 1) cond[i] = 2; @@ -194,11 +194,11 @@ linkdata(void) door = vocab(DECR('d', 'o', 'o', 'r', '\0'), 1, 0); pillow = vocab(DECR('p', 'i', 'l', 'l', 'o'), 1, 0); snake = vocab(DECR('s', 'n', 'a', 'k', 'e'), 1, 0); - fissur = vocab(DECR('f', 'i', 's', 's', 'u'), 1, 0); + fissure = vocab(DECR('f', 'i', 's', 's', 'u'), 1, 0); tablet = vocab(DECR('t', 'a', 'b', 'l', 'e'), 1, 0); clam = vocab(DECR('c', 'l', 'a', 'm', '\0'), 1, 0); oyster = vocab(DECR('o', 'y', 's', 't', 'e'), 1, 0); - magzin = vocab(DECR('m', 'a', 'g', 'a', 'z'), 1, 0); + magazine = vocab(DECR('m', 'a', 'g', 'a', 'z'), 1, 0); dwarf = vocab(DECR('d', 'w', 'a', 'r', 'f'), 1, 0); knife = vocab(DECR('k', 'n', 'i', 'f', 'e'), 1, 0); food = vocab(DECR('f', 'o', 'o', 'd', '\0'), 1, 0); @@ -214,7 +214,7 @@ linkdata(void) troll = vocab(DECR('t', 'r', 'o', 'l', 'l'), 1, 0); troll2 = troll + 1; bear = vocab(DECR('b', 'e', 'a', 'r', '\0'), 1, 0); - messag = vocab(DECR('m', 'e', 's', 's', 'a'), 1, 0); + message = vocab(DECR('m', 'e', 's', 's', 'a'), 1, 0); vend = vocab(DECR('v', 'e', 'n', 'd', 'i'), 1, 0); batter = vocab(DECR('b', 'a', 't', 't', 'e'), 1, 0); @@ -222,10 +222,10 @@ linkdata(void) coins = vocab(DECR('c', 'o', 'i', 'n', 's'), 1, 0); chest = vocab(DECR('c', 'h', 'e', 's', 't'), 1, 0); eggs = vocab(DECR('e', 'g', 'g', 's', '\0'), 1, 0); - tridnt = vocab(DECR('t', 'r', 'i', 'd', 'e'), 1, 0); + trident = vocab(DECR('t', 'r', 'i', 'd', 'e'), 1, 0); vase = vocab(DECR('v', 'a', 's', 'e', '\0'), 1, 0); - emrald = vocab(DECR('e', 'm', 'e', 'r', 'a'), 1, 0); - pyram = vocab(DECR('p', 'y', 'r', 'a', 'm'), 1, 0); + emerald = vocab(DECR('e', 'm', 'e', 'r', 'a'), 1, 0); + pyramid = vocab(DECR('p', 'y', 'r', 'a', 'm'), 1, 0); pearl = vocab(DECR('p', 'e', 'a', 'r', 'l'), 1, 0); rug = vocab(DECR('r', 'u', 'g', '\0', '\0'), 1, 0); chain = vocab(DECR('c', 'h', 'a', 'i', 'n'), 1, 0); @@ -234,8 +234,8 @@ linkdata(void) look = vocab(DECR('l', 'o', 'o', 'k', '\0'), 0, 0); cave = vocab(DECR('c', 'a', 'v', 'e', '\0'), 0, 0); null = vocab(DECR('n', 'u', 'l', 'l', '\0'), 0, 0); - entrnc = vocab(DECR('e', 'n', 't', 'r', 'a'), 0, 0); - dprssn = vocab(DECR('d', 'e', 'p', 'r', 'e'), 0, 0); + entrance = vocab(DECR('e', 'n', 't', 'r', 'a'), 0, 0); + depression = vocab(DECR('d', 'e', 'p', 'r', 'e'), 0, 0); enter = vocab(DECR('e', 'n', 't', 'e', 'r'), 0, 0); pour = vocab(DECR('p', 'o', 'u', 'r', '\0'), 2, 0); @@ -257,7 +257,7 @@ linkdata(void) dloc[4] = 44; dloc[5] = 64; dloc[6] = chloc; - daltlc = 18; + daltloc = 18; /* random flags & ctrs */ turns = 0; @@ -269,11 +269,11 @@ linkdata(void) for (i = 0; i <= 4; i++) if (rtext[2 * i + 81].seekadr != 0) maxdie = i + 1; - numdie = holdng = dkill = foobar = bonus = 0; + numdie = holding = dkill = foobar = bonus = 0; clock1 = 30; clock2 = 50; saved = 0; - closng = panic = closed = scorng = FALSE; + isclosing = panic = closed = scoring = FALSE; } /* come here if he hits a del */ diff --git a/adventure/io.c b/adventure/io.c index 7382f5a9..eae7695c 100644 --- a/adventure/io.c +++ b/adventure/io.c @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.21 2009/08/12 04:28:27 dholland Exp $ */ +/* $NetBSD: io.c,v 1.22 2009/08/25 06:56:52 dholland Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: io.c,v 1.21 2009/08/12 04:28:27 dholland Exp $"); +__RCSID("$NetBSD: io.c,v 1.22 2009/08/25 06:56:52 dholland Exp $"); #endif #endif /* not lint */ @@ -54,7 +54,7 @@ __RCSID("$NetBSD: io.c,v 1.21 2009/08/12 04:28:27 dholland Exp $"); static int next(void); static void rdesc(int); -static void rdflt(void); +static void rdefault(void); static void rhints(void); static void rliq(void); static void rlocs(void); @@ -203,7 +203,7 @@ rdata(void) inptr = data_file; /* Pointer to virtual data file */ srandom(SEED); /* which is lightly encrypted. */ - clsses = 1; + classes = 1; for (;;) { /* read data sections */ sect = next() - '0'; /* 1st digit of section number */ #ifdef VERBOSE @@ -244,7 +244,7 @@ rdata(void) rlocs(); break; case 8: /* action defaults */ - rdflt(); + rdefault(); break; case 9: /* liquid assets */ rliq(); @@ -316,18 +316,18 @@ rdesc(int sect) ptext[oldloc].txtlen = maystart - seekstart; break; case 6:/* random messages */ - if (oldloc >= RTXSIZ) + if (oldloc >= RTXSIZE) errx(1,"Too many random msgs"); rtext[oldloc].seekadr = seekhere; rtext[oldloc].txtlen = maystart - seekstart; break; case 10: /* class messages */ - ctext[clsses].seekadr = seekhere; - ctext[clsses].txtlen = maystart - seekstart; - cval[clsses++] = oldloc; + ctext[classes].seekadr = seekhere; + ctext[classes].txtlen = maystart - seekstart; + cval[classes++] = oldloc; break; case 12: /* magic messages */ - if (oldloc >= MAGSIZ) + if (oldloc >= MAGSIZE) errx(1,"Too many magic msgs"); mtext[oldloc].seekadr = seekhere; mtext[oldloc].txtlen = maystart - seekstart; @@ -474,12 +474,12 @@ rlocs(void) /* default verb messages */ static void -rdflt(void) +rdefault(void) { for (;;) { if ((verb = rnum()) < 0) break; - actspk[verb] = rnum(); + actspeak[verb] = rnum(); } } @@ -506,14 +506,14 @@ static void rhints(void) { int hintnum, i; - hntmax = 0; + hintmax = 0; for (;;) { if ((hintnum = rnum()) < 0) break; for (i = 1; i < 5; i++) hints[hintnum][i] = rnum(); - if (hintnum > hntmax) - hntmax = hintnum; + if (hintnum > hintmax) + hintmax = hintnum; } } diff --git a/adventure/main.c b/adventure/main.c index 1975db01..ee30e14e 100644 --- a/adventure/main.c +++ b/adventure/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.20 2008/07/20 01:03:20 lukem Exp $ */ +/* $NetBSD: main.c,v 1.21 2009/08/25 06:56:52 dholland Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -44,7 +44,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\ #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/2/93"; #else -__RCSID("$NetBSD: main.c,v 1.20 2008/07/20 01:03:20 lukem Exp $"); +__RCSID("$NetBSD: main.c,v 1.21 2009/08/25 06:56:52 dholland Exp $"); #endif #endif /* not lint */ @@ -91,7 +91,7 @@ main(int argc, char **argv) startup(); /* prepare for a user */ for (;;) { /* main command loop (label 2) */ - if (newloc < 9 && newloc != 0 && closng) { + if (newloc < 9 && newloc != 0 && isclosing) { rspeak(130); /* if closing leave only by */ newloc = loc; /* main office */ if (!panic) @@ -108,7 +108,7 @@ l2000: if (loc == 0) if ((abb[loc] % abbnum) == 0 || kk->seekadr == 0) kk = <ext[loc]; if (!forced(loc) && dark()) { - if (wzdark && pct(35)) { + if (wasdark && pct(35)) { die(90); goto l2000; } @@ -123,7 +123,7 @@ l2001: k = 1; if (forced(loc)) goto l8; - if (loc == 33 && pct(25) && !closng) + if (loc == 33 && pct(25) && !isclosing) rspeak(8); if (!dark()) { abb[loc]++; @@ -164,7 +164,7 @@ l2600: checkhints(); /* to 2600-2602 */ if (toting(i) && prop[i] < 0) /* 2604 */ prop[i] = -1 - prop[i]; } - wzdark = dark(); /* 2605 */ + wasdark = dark(); /* 2605 */ if (knfloc > 0 && knfloc != loc) knfloc = 1; getin(&wd1, &wd2); @@ -288,7 +288,7 @@ l2800: copystr(wd2, wd1); goto l2610; l4000: verb = k; - spk = actspk[verb]; + spk = actspeak[verb]; if (*wd2 != 0 && verb != say) goto l2800; if (verb == say) @@ -353,7 +353,7 @@ l4080: case 14: /* eat: 8140 */ if (!here(food)) goto l8000; - l8142: dstroy(food); + l8142: destroy(food); spk = 72; goto l2011; case 15: @@ -383,11 +383,11 @@ l4080: case 23: goto l9230; /* blast */ case 24: /* score: 8240 */ - scorng = TRUE; + scoring = TRUE; printf("If you were to quit now, you would score"); printf(" %d out of a possible ", score()); - printf("%d.", mxscor); - scorng = FALSE; + printf("%d.", maxscore); + scoring = FALSE; gaveup = yes(143, 54, 54); if (gaveup) done(2); @@ -424,12 +424,12 @@ l4080: detail = 3; goto l2011; case 27: /* read=8270 */ - if (here(magzin)) - obj = magzin; + if (here(magazine)) + obj = magazine; if (here(tablet)) obj = obj * 100 + tablet; - if (here(messag)) - obj = obj * 100 + messag; + if (here(message)) + obj = obj * 100 + message; if (closed && toting(oyster)) obj = oyster; if (obj > 100 || obj == 0 || dark()) @@ -442,7 +442,7 @@ l4080: printf("I can suspend your adventure for you so"); printf(" you can resume later, but\n"); printf("you will have to wait at least"); - printf(" %d minutes before continuing.", latncy); + printf(" %d minutes before continuing.", latency); if (!yes(200, 54, 54)) goto l2012; datime(&saveday, &savet); @@ -514,7 +514,7 @@ l4090: goto l2011; prop[lamp] = 1; rspeak(39); - if (wzdark) + if (wasdark) goto l2000; goto l2012; @@ -530,10 +530,10 @@ l4090: case 9: /* wave */ if ((!toting(obj)) && (obj != rod || !toting(rod2))) spk = 29; - if (obj != rod || !at(fissur) || !toting(obj) || closng) + if (obj != rod || !at(fissure) || !toting(obj) || isclosing) goto l2011; - prop[fissur] = 1 - prop[fissur]; - pspeak(fissur, 2 - prop[fissur]); + prop[fissure] = 1 - prop[fissure]; + pspeak(fissure, 2 - prop[fissure]); goto l2012; case 10: case 11: @@ -673,11 +673,11 @@ l4090: l9270: case 27:/* read */ if (dark()) goto l5190; - if (obj == magzin) + if (obj == magazine) spk = 190; if (obj == tablet) spk = 196; - if (obj == messag) + if (obj == message) spk = 191; if (obj == oyster && hinted[2] && toting(oyster)) spk = 194; @@ -730,9 +730,9 @@ l5010: if (*wd2 != 0) l5100: if (k != grate) goto l5110; if (loc == 1 || loc == 4 || loc == 7) - k = dprssn; + k = depression; if (loc > 9 && loc < 15) - k = entrnc; + k = entrance; if (k != grate) goto l8; l5110: if (k != dwarf) diff --git a/adventure/save.c b/adventure/save.c index 4557ab35..5df84982 100644 --- a/adventure/save.c +++ b/adventure/save.c @@ -1,4 +1,4 @@ -/* $NetBSD: save.c,v 1.10 2009/08/12 04:28:27 dholland Exp $ */ +/* $NetBSD: save.c,v 1.11 2009/08/25 06:56:52 dholland Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: save.c,v 1.10 2009/08/12 04:28:27 dholland Exp $"); +__RCSID("$NetBSD: save.c,v 1.11 2009/08/25 06:56:52 dholland Exp $"); #endif #endif /* not lint */ @@ -65,8 +65,8 @@ static const struct savestruct save_array[] = {&clock1, sizeof(clock1)}, {&clock2, sizeof(clock2)}, {&closed, sizeof(closed)}, - {&closng, sizeof(closng)}, - {&daltlc, sizeof(daltlc)}, + {&isclosing, sizeof(isclosing)}, + {&daltloc, sizeof(daltloc)}, {&demo, sizeof(demo)}, {&detail, sizeof(detail)}, {&dflag, sizeof(dflag)}, @@ -74,27 +74,27 @@ static const struct savestruct save_array[] = {&dtotal, sizeof(dtotal)}, {&foobar, sizeof(foobar)}, {&gaveup, sizeof(gaveup)}, - {&holdng, sizeof(holdng)}, + {&holding, sizeof(holding)}, {&iwest, sizeof(iwest)}, {&k, sizeof(k)}, {&k2, sizeof(k2)}, {&knfloc, sizeof(knfloc)}, {&kq, sizeof(kq)}, - {&latncy, sizeof(latncy)}, + {&latency, sizeof(latency)}, {&limit, sizeof(limit)}, {&lmwarn, sizeof(lmwarn)}, {&loc, sizeof(loc)}, {&maxdie, sizeof(maxdie)}, - {&mxscor, sizeof(mxscor)}, + {&maxscore, sizeof(maxscore)}, {&newloc, sizeof(newloc)}, {&numdie, sizeof(numdie)}, {&obj, sizeof(obj)}, - {&oldlc2, sizeof(oldlc2)}, + {&oldloc2, sizeof(oldloc2)}, {&oldloc, sizeof(oldloc)}, {&panic, sizeof(panic)}, {&saveday, sizeof(saveday)}, {&savet, sizeof(savet)}, - {&scorng, sizeof(scorng)}, + {&scoring, sizeof(scoring)}, {&spk, sizeof(spk)}, {&stick, sizeof(stick)}, {&tally, sizeof(tally)}, @@ -104,7 +104,7 @@ static const struct savestruct save_array[] = {&verb, sizeof(verb)}, {&wd1, sizeof(wd1)}, {&wd2, sizeof(wd2)}, - {&wzdark, sizeof(wzdark)}, + {&wasdark, sizeof(wasdark)}, {&yea, sizeof(yea)}, {atloc, sizeof(atloc)}, {dloc, sizeof(dloc)}, diff --git a/adventure/subr.c b/adventure/subr.c index bd4dea78..0fd6c27c 100644 --- a/adventure/subr.c +++ b/adventure/subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr.c,v 1.12 2009/08/12 04:28:27 dholland Exp $ */ +/* $NetBSD: subr.c,v 1.13 2009/08/25 06:56:52 dholland Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)subr.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: subr.c,v 1.12 2009/08/12 04:28:27 dholland Exp $"); +__RCSID("$NetBSD: subr.c,v 1.13 2009/08/25 06:56:52 dholland Exp $"); #endif #endif /* not lint */ @@ -182,7 +182,7 @@ fdwarf(void) } for (i = 1; i <= 5; i++) { if (dloc[i] == loc) - dloc[i] = daltlc; + dloc[i] = daltloc; odloc[i] = dloc[i]; /* 6002 */ } rspeak(3); @@ -220,8 +220,8 @@ fdwarf(void) continue; k = 0; for (j = 50; j <= maxtrs; j++) { /* loop to 6020 */ - if (j == pyram && (loc == plac[pyram] - || loc == plac[emrald])) + if (j == pyramid && (loc == plac[pyramid] + || loc == plac[emerald])) goto l6020; if (toting(j)) goto l6022; @@ -235,12 +235,12 @@ fdwarf(void) rspeak(127); continue; /* to 6030 */ l6022: rspeak(128); - if (place[messag] == 0) + if (place[message] == 0) move(chest, chloc); - move(messag, chloc2); + move(message, chloc2); for (j = 50; j <= maxtrs; j++) { /* loop to 6023 */ - if (j == pyram && (loc == plac[pyram] - || loc == plac[emrald])) + if (j == pyramid && (loc == plac[pyramid] + || loc == plac[emerald])) continue; if (at(j) && fixed[j] == 0) carry(j, loc); @@ -252,7 +252,7 @@ fdwarf(void) continue; l6025: rspeak(186); move(chest, chloc); - move(messag, chloc2); + move(message, chloc2); goto l6024; } dtotal++; /* 6027 */ @@ -286,7 +286,7 @@ l82: if (stick <= 1) { /* 82 */ return (2000); } else printf("%d of them get you!\n", stick); /* 83 */ - oldlc2 = loc; + oldloc2 = loc; return (99); } rspeak(5); @@ -315,7 +315,7 @@ march(void) if (k == look) { /* 30 */ if (detail++ < 3) rspeak(15); - wzdark = FALSE; + wasdark = FALSE; abb[loc] = 0; return (2); } @@ -329,7 +329,7 @@ march(void) bug(100); } } - oldlc2 = oldloc; + oldloc2 = oldloc; oldloc = loc; l9: for (; tkk != 0; tkk = tkk->next) @@ -387,8 +387,8 @@ mback(void) struct travlist *tk2, *j; int ll; if (forced(k = oldloc)) - k = oldlc2; /* k=location */ - oldlc2 = oldloc; + k = oldloc2; /* k=location */ + oldloc2 = oldloc; oldloc = loc; tk2 = 0; if (k == loc) { @@ -425,13 +425,13 @@ specials(void) switch (newloc -= 300) { case 1: /* 30100 */ newloc = 99 + 100 - loc; - if (holdng == 0 || (holdng == 1 && toting(emrald))) + if (holding == 0 || (holding == 1 && toting(emerald))) return (2); newloc = loc; rspeak(117); return (2); case 2: /* 30200 */ - drop(emrald, loc); + drop(emerald, loc); return (12); case 3: /* to 30300 */ return (trbridge()); @@ -468,7 +468,7 @@ trbridge(void) prop[bear] = 3; if (prop[spices] < 0) tally2++; - oldlc2 = newloc; + oldloc2 = newloc; return (99); } @@ -506,7 +506,7 @@ void checkhints(void) { int hint; - for (hint = 4; hint <= hntmax; hint++) { + for (hint = 4; hint <= hintmax; hint++) { if (hinted[hint]) continue; if (!bitset(loc, hint)) @@ -529,11 +529,11 @@ checkhints(void) goto l40020; case 7: /* 40700 */ if (atloc[loc] == 0 && atloc[oldloc] == 0 - && atloc[oldlc2] == 0 && holdng > 1) + && atloc[oldloc2] == 0 && holding > 1) goto l40010; goto l40020; case 8: /* 40800 */ - if (prop[emrald] != -1 && prop[pyram] == -1) + if (prop[emerald] != -1 && prop[pyramid] == -1) goto l40010; goto l40020; case 9: @@ -597,7 +597,7 @@ trtake(void) spk = 104; return (2011); } -l9017: if (holdng >= 7) { +l9017: if (holding >= 7) { rspeak(92); return (2012); } @@ -652,19 +652,19 @@ trdrop(void) rspeak(30); if (closed) return (19000); - dstroy(snake); + destroy(snake); prop[snake] = 1; return (dropper()); } if (obj == coins && here(vend)) { /* 9024 */ - dstroy(coins); + destroy(coins); drop(batter, loc); pspeak(batter, 0); return (2012); } if (obj == bird && at(dragon) && prop[dragon] == 0) { /* 9025 */ rspeak(154); - dstroy(bird); + destroy(bird); prop[bird] = 0; if (place[snake] == plac[snake]) tally2--; @@ -704,13 +704,13 @@ tropen(void) spk = 124 + k; if (toting(obj)) spk = 120 + k; - if (!toting(tridnt)) + if (!toting(trident)) spk = 122 + k; if (verb == lock) spk = 61; if (spk != 124) return (2011); - dstroy(clam); + destroy(clam); drop(oyster, loc); drop(pearl, 105); return (2011); @@ -756,7 +756,7 @@ tropen(void) fixed[bear] = 2 - prop[bear]; return (2011); } - if (closng) { + if (isclosing) { k = 130; if (!panic) clock2 = 15; @@ -807,7 +807,7 @@ trkill(void) spk = 137; if (closed) return (2011); - dstroy(bird); + destroy(bird); prop[bird] = 0; if (place[snake] == plac[snake]) tally2++; @@ -932,7 +932,7 @@ trfeed(void) if (obj != snake || closed || !here(bird)) return (2011); spk = 101; - dstroy(bird); + destroy(bird); prop[bird] = 0; tally2++; return (2011); @@ -951,7 +951,7 @@ trfeed(void) spk = 110; if (!here(food)) return (2011); - dstroy(food); + destroy(food); prop[bear] = 1; fixed[axe] = 0; prop[axe] = 0; @@ -1003,7 +1003,7 @@ closing(void) { int i; - prop[grate] = prop[fissur] = 0; + prop[grate] = prop[fissure] = 0; for (i = 1; i <= 6; i++) { dseen[i] = FALSE; dloc[i] = 0; @@ -1014,14 +1014,14 @@ closing(void) move(troll2 + 100, fixd[troll]); juggle(chasm); if (prop[bear] != 3) - dstroy(bear); + destroy(bear); prop[chain] = 0; fixed[chain] = 0; prop[axe] = 0; fixed[axe] = 0; rspeak(129); clock1 = -1; - closng = TRUE; + isclosing = TRUE; } /* 11000 */ @@ -1051,7 +1051,7 @@ caveclose(void) for (i = 1; i <= 100; i++) if (toting(i)) - dstroy(i); + destroy(i); rspeak(132); closed = TRUE; } diff --git a/adventure/vocab.c b/adventure/vocab.c index 01beeeeb..1a1b7006 100644 --- a/adventure/vocab.c +++ b/adventure/vocab.c @@ -1,4 +1,4 @@ -/* $NetBSD: vocab.c,v 1.14 2009/08/12 04:28:27 dholland Exp $ */ +/* $NetBSD: vocab.c,v 1.15 2009/08/25 06:56:52 dholland Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)vocab.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: vocab.c,v 1.14 2009/08/12 04:28:27 dholland Exp $"); +__RCSID("$NetBSD: vocab.c,v 1.15 2009/08/25 06:56:52 dholland Exp $"); #endif #endif /* not lint */ @@ -52,7 +52,7 @@ __RCSID("$NetBSD: vocab.c,v 1.14 2009/08/12 04:28:27 dholland Exp $"); #include "extern.h" void -dstroy(int object) +destroy(int object) { move(object, 0); } @@ -98,7 +98,7 @@ carry(int object, int where) if (place[object] == -1) return; place[object] = -1; - holdng++; + holding++; } if (atloc[where] == object) { atloc[where] = links[object]; @@ -116,7 +116,7 @@ drop(int object, int where) fixed[object - 100] = where; else { if (place[object] == -1) - holdng--; + holding--; place[object] = where; } if (where <= 0) diff --git a/adventure/wizard.c b/adventure/wizard.c index c0819ffa..c35827f7 100644 --- a/adventure/wizard.c +++ b/adventure/wizard.c @@ -1,4 +1,4 @@ -/* $NetBSD: wizard.c,v 1.13 2009/08/12 04:28:27 dholland Exp $ */ +/* $NetBSD: wizard.c,v 1.14 2009/08/25 06:56:52 dholland Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)wizard.c 8.1 (Berkeley) 6/2/93"; #else -__RCSID("$NetBSD: wizard.c,v 1.13 2009/08/12 04:28:27 dholland Exp $"); +__RCSID("$NetBSD: wizard.c,v 1.14 2009/08/25 06:56:52 dholland Exp $"); #endif #endif /* not lint */ @@ -79,7 +79,7 @@ void poof(void) { strcpy(magic, DECR('d', 'w', 'a', 'r', 'f')); - latncy = 45; + latency = 45; } int @@ -91,13 +91,13 @@ Start(void) delay = (d - saveday) * 1440 + (t - savet); /* good for about a * month */ - if (delay >= latncy) { + if (delay >= latency) { saved = -1; return (FALSE); } printf("This adventure was suspended a mere %d minute%s ago.", delay, delay == 1 ? "" : "s"); - if (delay <= latncy / 3) { + if (delay <= latency / 3) { mspeak(2); exit(0); } -- cgit v1.2.3-56-ge451