Move more globals into the game state block.

This commit is contained in:
Eric S. Raymond 2017-06-07 01:12:49 -04:00
parent 62ee15c892
commit 91ad0185ff
7 changed files with 77 additions and 73 deletions

View file

@ -133,8 +133,8 @@ L5110: if(K == DWARF && ATDWRF(LOC) > 0) goto L5010;
L5120: if(OBJ != PLANT || !AT(PLANT2) || PROP[PLANT2] == 0) goto L5130; L5120: if(OBJ != PLANT || !AT(PLANT2) || PROP[PLANT2] == 0) goto L5130;
OBJ=PLANT2; OBJ=PLANT2;
goto L5010; goto L5010;
L5130: if(OBJ != KNIFE || KNFLOC != LOC) goto L5140; L5130: if(OBJ != KNIFE || game.knfloc != LOC) goto L5140;
KNFLOC= -1; game.knfloc= -1;
SPK=116; SPK=116;
return(2011); return(2011);
L5140: if(OBJ != ROD || !HERE(ROD2)) goto L5190; L5140: if(OBJ != ROD || !HERE(ROD2)) goto L5190;
@ -247,14 +247,14 @@ L9049: SPK=172;
/* Light. Applicable only to lamp and urn. */ /* Light. Applicable only to lamp and urn. */
L8070: if(HERE(LAMP) && PROP[LAMP] == 0 && LIMIT >= 0)OBJ=LAMP; L8070: if(HERE(LAMP) && PROP[LAMP] == 0 && game.limit >= 0)OBJ=LAMP;
if(HERE(URN) && PROP[URN] == 1)OBJ=OBJ*NOBJECTS+URN; if(HERE(URN) && PROP[URN] == 1)OBJ=OBJ*NOBJECTS+URN;
if(OBJ == 0 || OBJ > NOBJECTS) return(8000); if(OBJ == 0 || OBJ > NOBJECTS) return(8000);
L9070: if(OBJ == URN) goto L9073; L9070: if(OBJ == URN) goto L9073;
if(OBJ != LAMP) return(2011); if(OBJ != LAMP) return(2011);
SPK=184; SPK=184;
if(LIMIT < 0) return(2011); if(game.limit < 0) return(2011);
PROP[LAMP]=1; PROP[LAMP]=1;
RSPEAK(39); RSPEAK(39);
if(game.wzdark) return(2000); if(game.wzdark) return(2000);
@ -446,13 +446,13 @@ L8240: score(-1);
L8250: K=VOCAB(WD1,3); L8250: K=VOCAB(WD1,3);
SPK=42; SPK=42;
if(FOOBAR == 1-K) goto L8252; if(game.foobar == 1-K) goto L8252;
if(FOOBAR != 0)SPK=151; if(game.foobar != 0)SPK=151;
return(2011); return(2011);
L8252: FOOBAR=K; L8252: game.foobar=K;
if(K != 4) return(2009); if(K != 4) return(2009);
FOOBAR=0; game.foobar=0;
if(PLACE[EGGS] == PLAC[EGGS] || (TOTING(EGGS) && LOC == PLAC[EGGS])) if(PLACE[EGGS] == PLAC[EGGS] || (TOTING(EGGS) && LOC == PLAC[EGGS]))
return(2011); return(2011);
/* Bring back troll if we steal the eggs back from him before crossing. */ /* Bring back troll if we steal the eggs back from him before crossing. */
@ -534,8 +534,8 @@ L8305: DATIME(&I,&K);
* needs to be saved, include it. Overkill can't hurt. Pad the last savwds * needs to be saved, include it. Overkill can't hurt. Pad the last savwds
* with junk variables to bring it up to 7 values. */ * with junk variables to bring it up to 7 values. */
SAVWDS(game.abbnum,game.blklin,game.bonus,game.clock1,game.clock2,game.closed,game.closng); SAVWDS(game.abbnum,game.blklin,game.bonus,game.clock1,game.clock2,game.closed,game.closng);
SAVWDS(game.detail,DFLAG,game.dkill,game.dtotal,FOOBAR,HOLDNG,IWEST); SAVWDS(game.detail,game.dflag,game.dkill,game.dtotal,game.foobar,game.holdng,game.iwest);
SAVWDS(KNFLOC,LIMIT,LL,LMWARN,LOC,NEWLOC,NUMDIE); SAVWDS(game.knfloc,game.limit,LL,game.lmwarn,LOC,NEWLOC,NUMDIE);
SAVWDS(OBJ,game.oldlc2,game.oldloc,OLDOBJ,PANIC,SAVED,SETUP); SAVWDS(OBJ,game.oldlc2,game.oldloc,OLDOBJ,PANIC,SAVED,SETUP);
SAVWDS(SPK,TALLY,THRESH,TRNDEX,TRNLUZ,TURNS,OBJTXT[OYSTER]); SAVWDS(SPK,TALLY,THRESH,TRNDEX,TRNLUZ,TURNS,OBJTXT[OYSTER]);
SAVWDS(VERB,WD1,WD1X,WD2,game.wzdark,game.zzword,OBJSND[BIRD]); SAVWDS(VERB,WD1,WD1X,WD2,game.wzdark,game.zzword,OBJSND[BIRD]);

View file

@ -29,7 +29,7 @@ L9011: if(FIXED[OBJ] != 0) return(2011);
if(!TOTING(BOTTLE))SPK=104; if(!TOTING(BOTTLE))SPK=104;
return(2011); return(2011);
L9017: SPK=92; L9017: SPK=92;
if(HOLDNG >= 7) return(2011); if(game.holdng >= 7) return(2011);
if(OBJ != BIRD || PROP[BIRD] == 1 || -1-PROP[BIRD] == 1) goto L9014; if(OBJ != BIRD || PROP[BIRD] == 1 || -1-PROP[BIRD] == 1) goto L9014;
if(PROP[BIRD] == 2) goto L9015; if(PROP[BIRD] == 2) goto L9015;
if(!TOTING(CAGE))SPK=27; if(!TOTING(CAGE))SPK=27;
@ -232,7 +232,7 @@ int throw(FILE *cmdin) {
return(attack(cmdin)); return(attack(cmdin));
L9172: SPK=48; L9172: SPK=48;
if(randrange(NDWARVES+1) < DFLAG) goto L9175; if(randrange(NDWARVES+1) < game.dflag) goto L9175;
game.dseen[I]=false; game.dseen[I]=false;
game.dloc[I]=0; game.dloc[I]=0;
SPK=47; SPK=47;
@ -287,7 +287,7 @@ L9212: if(OBJ != SNAKE && OBJ != DRAGON && OBJ != TROLL) goto L9213;
L9213: if(OBJ != DWARF) goto L9214; L9213: if(OBJ != DWARF) goto L9214;
if(!HERE(FOOD)) return(2011); if(!HERE(FOOD)) return(2011);
SPK=103; SPK=103;
DFLAG=DFLAG+2; game.dflag=game.dflag+2;
return(2011); return(2011);
L9214: if(OBJ != BEAR) goto L9215; L9214: if(OBJ != BEAR) goto L9215;

View file

@ -25,8 +25,15 @@ struct game_t {
long closng; long closng;
long conds; long conds;
long detail; long detail;
long dflag;
long dkill; long dkill;
long dtotal; long dtotal;
long foobar;
long holdng;
long iwest;
long knfloc;
long limit;
long lmwarn;
long oldloc; long oldloc;
long oldlc2; long oldlc2;
long wzdark; long wzdark;
@ -38,7 +45,7 @@ struct game_t {
extern struct game_t game; extern struct game_t game;
extern long ABB[], ATLOC[], BLKLIN, DFLAG, FIXED[], HOLDNG, extern long ABB[], ATLOC[], FIXED[],
LINK[], LNLENG, LNPOSN, LINK[], LNLENG, LNPOSN,
PARMS[], PLACE[]; PARMS[], PLACE[];
extern char rawbuf[LINESIZE], INLINE[LINESIZE+1], MAP1[], MAP2[]; extern char rawbuf[LINESIZE], INLINE[LINESIZE+1], MAP1[], MAP2[];
@ -105,11 +112,10 @@ extern void score(long);
extern long AMBER, ATTACK, AXE, BACK, BATTER, BEAR, extern long AMBER, ATTACK, AXE, BACK, BATTER, BEAR,
BIRD, BLOOD, BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST, BIRD, BLOOD, BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST,
CLAM, CLSHNT, COINS, DALTLC, DOOR, DPRSSN, DRAGON, DWARF, EGGS, CLAM, CLSHNT, COINS, DALTLC, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOBAR, FOOD, EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
GRATE, HINT, HINTED[], HINTLC[], GRATE, HINT, HINTED[], HINTLC[],
I, INVENT, IGO, IWEST, J, JADE, K, K2, KEYS, KK, I, INVENT, IGO, J, JADE, K, K2, KEYS, KK,
KNFLOC, KNIFE, KQ, L, LAMP, LIMIT, LL, KNIFE, KQ, L, LAMP, LL, LOC, LOCK, LOOK,
LMWARN, LOC, LOCK, LOOK,
MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR, MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR,
NEWLOC, NOVICE, NUGGET, NUL, NUMDIE, OBJ, NEWLOC, NOVICE, NUGGET, NUL, NUMDIE, OBJ,
OGRE, OIL, OLDOBJ, OYSTER, OGRE, OIL, OLDOBJ, OYSTER,

24
init.c
View file

@ -318,7 +318,7 @@ L1106: /*etc*/ ;
* prior loc of each dwarf, initially garbage. DALTLC is alternate initial loc * prior loc of each dwarf, initially garbage. DALTLC is alternate initial loc
* for dwarf, in case one of them starts out on top of the adventurer. (No 2 * for dwarf, in case one of them starts out on top of the adventurer. (No 2
* of the 5 initial locs are adjacent.) game.dseen is true if dwarf has seen him. * of the 5 initial locs are adjacent.) game.dseen is true if dwarf has seen him.
* DFLAG controls the level of activation of all this: * game.dflag controls the level of activation of all this:
* 0 No dwarf stuff yet (wait until reaches Hall Of Mists) * 0 No dwarf stuff yet (wait until reaches Hall Of Mists)
* 1 Reached Hall Of Mists, but hasn't met first dwarf * 1 Reached Hall Of Mists, but hasn't met first dwarf
* 2 Met first dwarf, others start moving, no knives thrown yet * 2 Met first dwarf, others start moving, no knives thrown yet
@ -333,7 +333,7 @@ L1106: /*etc*/ ;
for (I=1; I<=NDWARVES; I++) { for (I=1; I<=NDWARVES; I++) {
game.dseen[I]=false; game.dseen[I]=false;
} /* end loop */ } /* end loop */
DFLAG=0; game.dflag=0;
game.dloc[1]=19; game.dloc[1]=19;
game.dloc[2]=27; game.dloc[2]=27;
game.dloc[3]=33; game.dloc[3]=33;
@ -350,12 +350,12 @@ L1106: /*etc*/ ;
* game.conds Min value for cond(loc) if loc has any hints * game.conds Min value for cond(loc) if loc has any hints
* game.detail How often we've said "not allowed to give more detail" * game.detail How often we've said "not allowed to give more detail"
* game.dkill # of dwarves killed (unused in scoring, needed for msg) * game.dkill # of dwarves killed (unused in scoring, needed for msg)
* FOOBAR Current progress in saying "FEE FIE FOE FOO". * game.foobar Current progress in saying "FEE FIE FOE FOO".
* HOLDNG Number of objects being carried * game.holdng Number of objects being carried
* IGO How many times he's said "go XXX" instead of "XXX" * IGO How many times he's said "go XXX" instead of "XXX"
* IWEST How many times he's said "west" instead of "w" * game.iwest How many times he's said "west" instead of "w"
* KNFLOC 0 if no knife here, loc if knife here, -1 after caveat * game.knfloc 0 if no knife here, loc if knife here, -1 after caveat
* LIMIT Lifetime of lamp (not set here) * game.limit Lifetime of lamp (not set here)
* MAXDIE Number of reincarnation messages available (up to 5) * MAXDIE Number of reincarnation messages available (up to 5)
* NUMDIE Number of times killed so far * NUMDIE Number of times killed so far
* THRESH Next #turns threshhold (-1 if none) * THRESH Next #turns threshhold (-1 if none)
@ -369,19 +369,19 @@ L1106: /*etc*/ ;
THRESH= -1; THRESH= -1;
if(TRNVLS > 0)THRESH=MOD(TRNVAL[1],100000)+1; if(TRNVLS > 0)THRESH=MOD(TRNVAL[1],100000)+1;
TRNLUZ=0; TRNLUZ=0;
LMWARN=false; game.lmwarn=false;
IGO=0; IGO=0;
IWEST=0; game.iwest=0;
KNFLOC=0; game.knfloc=0;
game.detail=0; game.detail=0;
game.abbnum=5; game.abbnum=5;
for (I=0; I<=4; I++) { for (I=0; I<=4; I++) {
{long x = 2*I+81; if(RTEXT[x] != 0)MAXDIE=I+1;} {long x = 2*I+81; if(RTEXT[x] != 0)MAXDIE=I+1;}
} /* end loop */ } /* end loop */
NUMDIE=0; NUMDIE=0;
HOLDNG=0; game.holdng=0;
game.dkill=0; game.dkill=0;
FOOBAR=0; game.foobar=0;
game.bonus=0; game.bonus=0;
game.clock1=30; game.clock1=30;
game.clock2=50; game.clock2=50;

70
main.c
View file

@ -14,8 +14,8 @@
struct game_t game; struct game_t game;
long ABB[186], ATLOC[186], DFLAG, long ABB[186], ATLOC[186],
FIXED[NOBJECTS+1], HOLDNG, FIXED[NOBJECTS+1],
LINK[NOBJECTS*2 + 1], LNLENG, LNPOSN, LINK[NOBJECTS*2 + 1], LNLENG, LNPOSN,
PARMS[26], PLACE[NOBJECTS+1], PARMS[26], PLACE[NOBJECTS+1],
SETUP = 0; SETUP = 0;
@ -25,13 +25,11 @@ long AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD,
BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST, BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST,
CLAM, CLSHNT, COINS, DALTLC, CLAM, CLSHNT, COINS, DALTLC,
DOOR, DPRSSN, DRAGON, DWARF, EGGS, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOBAR, FOOD, EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
GRATE, HINT, HINTED[21], HINTLC[21], GRATE, HINT, HINTED[21], HINTLC[21],
I, INVENT, IGO, IWEST, J, JADE, K, K2, KEYS, KK, I, INVENT, IGO, J, JADE, K, K2, KEYS, KK,
KNFLOC, KNIFE, KQ, L, LAMP, LIMIT, LL, KNIFE, KQ, L, LAMP, LL, LOC, LOCK, LOOK,
LMWARN, LOC, LOCK, LOOK, MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR,
MAGZIN, MAXDIE, MAXTRS,
MESSAG, MIRROR, MXSCOR,
NEWLOC, NOVICE, NUGGET, NUL, NUMDIE, OBJ, NEWLOC, NOVICE, NUGGET, NUL, NUMDIE, OBJ,
OGRE, OIL, OLDOBJ, OYSTER, OGRE, OIL, OLDOBJ, OYSTER,
PANIC, PEARL, PILLOW, PLANT, PLANT2, PROP[NOBJECTS+1], PYRAM, PANIC, PEARL, PILLOW, PLANT, PLANT2, PROP[NOBJECTS+1], PYRAM,
@ -97,7 +95,7 @@ int main(int argc, char *argv[]) {
* game.closed says whether we're all the way closed * game.closed says whether we're all the way closed
* game.closng says whether it's closing time yet * game.closng says whether it's closing time yet
* CLSHNT says whether he's read the clue in the endgame * CLSHNT says whether he's read the clue in the endgame
* LMWARN says whether he's been warned about lamp going dim * game.lmwarn says whether he's been warned about lamp going dim
* NOVICE says whether he asked for instructions at start-up * NOVICE says whether he asked for instructions at start-up
* PANIC says whether he's found out he's trapped in the cave * PANIC says whether he's found out he's trapped in the cave
* game.wzdark says whether the loc he's leaving was dark */ * game.wzdark says whether the loc he's leaving was dark */
@ -135,8 +133,8 @@ L1: SETUP= -1;
NOVICE=YES(stdin, 65,1,0); NOVICE=YES(stdin, 65,1,0);
NEWLOC=1; NEWLOC=1;
LOC=1; LOC=1;
LIMIT=330; game.limit=330;
if(NOVICE)LIMIT=1000; if(NOVICE)game.limit=1000;
if (logfp) if (logfp)
fprintf(logfp, "seed %ld\n", seedval); fprintf(logfp, "seed %ld\n", seedval);
@ -199,16 +197,16 @@ L74: LOC=NEWLOC;
* end in maze, but c'est la vie. They'll wait for him outside the dead end. */ * end in maze, but c'est la vie. They'll wait for him outside the dead end. */
if(LOC == 0 || FORCED(LOC) || CNDBIT(NEWLOC,3)) goto L2000; if(LOC == 0 || FORCED(LOC) || CNDBIT(NEWLOC,3)) goto L2000;
if(DFLAG != 0) goto L6000; if(game.dflag != 0) goto L6000;
if(INDEEP(LOC))DFLAG=1; if(INDEEP(LOC))game.dflag=1;
goto L2000; goto L2000;
/* When we encounter the first dwarf, we kill 0, 1, or 2 of the 5 dwarves. If /* When we encounter the first dwarf, we kill 0, 1, or 2 of the 5 dwarves. If
* any of the survivors is at loc, replace him with the alternate. */ * any of the survivors is at loc, replace him with the alternate. */
L6000: if(DFLAG != 1) goto L6010; L6000: if(game.dflag != 1) goto L6010;
if(!INDEEP(LOC) || (PCT(95) && (!CNDBIT(LOC,4) || PCT(85)))) goto L2000; if(!INDEEP(LOC) || (PCT(95) && (!CNDBIT(LOC,4) || PCT(85)))) goto L2000;
DFLAG=2; game.dflag=2;
for (I=1; I<=2; I++) { for (I=1; I<=2; I++) {
J=1+randrange(NDWARVES-1); J=1+randrange(NDWARVES-1);
if(PCT(50))game.dloc[J]=0; if(PCT(50))game.dloc[J]=0;
@ -300,8 +298,8 @@ L6025: RSPEAK(186);
L6027: game.dtotal=game.dtotal+1; L6027: game.dtotal=game.dtotal+1;
if(game.odloc[I] != game.dloc[I]) goto L6030; if(game.odloc[I] != game.dloc[I]) goto L6030;
ATTACK=ATTACK+1; ATTACK=ATTACK+1;
if(KNFLOC >= 0)KNFLOC=LOC; if(game.knfloc >= 0)game.knfloc=LOC;
if(randrange(1000) < 95*(DFLAG-2))STICK=STICK+1; if(randrange(1000) < 95*(game.dflag-2))STICK=STICK+1;
L6030: /*etc*/ ; L6030: /*etc*/ ;
} /* end loop */ } /* end loop */
@ -313,7 +311,7 @@ L6030: /*etc*/ ;
SETPRM(1,game.dtotal,0); SETPRM(1,game.dtotal,0);
RSPEAK(4+1/game.dtotal); RSPEAK(4+1/game.dtotal);
if(ATTACK == 0) goto L2000; if(ATTACK == 0) goto L2000;
if(DFLAG == 2)DFLAG=3; if(game.dflag == 2)game.dflag=3;
SETPRM(1,ATTACK,0); SETPRM(1,ATTACK,0);
K=6; K=6;
if(ATTACK > 1)K=250; if(ATTACK > 1)K=250;
@ -413,15 +411,15 @@ L2603: if(!game.closed) goto L2605;
if(TOTING(I) && PROP[I] < 0)PROP[I]= -1-PROP[I]; if(TOTING(I) && PROP[I] < 0)PROP[I]= -1-PROP[I];
} /* end loop */ } /* end loop */
L2605: game.wzdark=DARK(0); L2605: game.wzdark=DARK(0);
if(KNFLOC > 0 && KNFLOC != LOC)KNFLOC=0; if(game.knfloc > 0 && game.knfloc != LOC)game.knfloc=0;
I=0; I=0;
if (!GETIN(cmdin, WD1,WD1X,WD2,WD2X)) if (!GETIN(cmdin, WD1,WD1X,WD2,WD2X))
return false; return false;
/* Every input, check "FOOBAR" flag. If zero, nothing's going on. If pos, /* Every input, check "game.foobar" flag. If zero, nothing's going on. If pos,
* make neg. If neg, he skipped a word, so make it zero. */ * make neg. If neg, he skipped a word, so make it zero. */
L2607: FOOBAR=(FOOBAR>0 ? -FOOBAR : 0); L2607: game.foobar=(game.foobar>0 ? -game.foobar : 0);
TURNS=TURNS+1; TURNS=TURNS+1;
if(TURNS == THRESH) { if(TURNS == THRESH) {
SPEAK(TTEXT[TRNDEX]); SPEAK(TTEXT[TRNDEX]);
@ -437,11 +435,11 @@ L2607: FOOBAR=(FOOBAR>0 ? -FOOBAR : 0);
if(game.clock1 == 0) goto L10000; if(game.clock1 == 0) goto L10000;
if(game.clock1 < 0)game.clock2=game.clock2-1; if(game.clock1 < 0)game.clock2=game.clock2-1;
if(game.clock2 == 0) goto L11000; if(game.clock2 == 0) goto L11000;
if(PROP[LAMP] == 1)LIMIT=LIMIT-1; if(PROP[LAMP] == 1)game.limit=game.limit-1;
if(LIMIT <= 30 && HERE(BATTER) && PROP[BATTER] == 0 && HERE(LAMP)) goto if(game.limit <= 30 && HERE(BATTER) && PROP[BATTER] == 0 && HERE(LAMP)) goto
L12000; L12000;
if(LIMIT == 0) goto L12400; if(game.limit == 0) goto L12400;
if(LIMIT <= 30) goto L12200; if(game.limit <= 30) goto L12200;
L19999: K=43; L19999: K=43;
if(LIQLOC(LOC) == WATER)K=70; if(LIQLOC(LOC) == WATER)K=70;
V1=VOCAB(WD1,-1); V1=VOCAB(WD1,-1);
@ -454,8 +452,8 @@ L19999: K=43;
L2610: if(V1 == 1000+CAGE && V2 == 1000+BIRD && HERE(CAGE) && HERE(BIRD)) L2610: if(V1 == 1000+CAGE && V2 == 1000+BIRD && HERE(CAGE) && HERE(BIRD))
WD1=MAKEWD(301200308); WD1=MAKEWD(301200308);
L2620: if(WD1 == MAKEWD(23051920)) { L2620: if(WD1 == MAKEWD(23051920)) {
IWEST=IWEST+1; game.iwest=game.iwest+1;
if(IWEST == 10)RSPEAK(17); if(game.iwest == 10)RSPEAK(17);
} }
if(WD1 != MAKEWD( 715) || WD2 == 0) goto L2630; if(WD1 != MAKEWD( 715) || WD2 == 0) goto L2630;
IGO=IGO+1; IGO=IGO+1;
@ -578,7 +576,7 @@ L30000: NEWLOC=NEWLOC-300;
* be used for actual motion, but can be spotted by "go back". */ * be used for actual motion, but can be spotted by "go back". */
L30100: NEWLOC=99+100-LOC; /* ESR: an instance of NOBJECTS? */ L30100: NEWLOC=99+100-LOC; /* ESR: an instance of NOBJECTS? */
if(HOLDNG == 0 || (HOLDNG == 1 && TOTING(EMRALD))) return true; if(game.holdng == 0 || (game.holdng == 1 && TOTING(EMRALD))) return true;
NEWLOC=LOC; NEWLOC=LOC;
RSPEAK(117); RSPEAK(117);
return true; return true;
@ -759,7 +757,7 @@ L40010: HINTLC[HINT]=0;
SETPRM(1,HINTS[HINT][2],HINTS[HINT][2]); SETPRM(1,HINTS[HINT][2],HINTS[HINT][2]);
RSPEAK(261); RSPEAK(261);
HINTED[HINT]=YES(cmdin,175,HINTS[HINT][4],54); HINTED[HINT]=YES(cmdin,175,HINTS[HINT][4],54);
if(HINTED[HINT] && LIMIT > 30)LIMIT=LIMIT+30*HINTS[HINT][2]; if(HINTED[HINT] && game.limit > 30)game.limit=game.limit+30*HINTS[HINT][2];
L40020: HINTLC[HINT]=0; L40020: HINTLC[HINT]=0;
L40030: goto L2602; L40030: goto L2602;
@ -774,7 +772,7 @@ L40200: if(PLACE[BIRD] == LOC && TOTING(ROD) && OLDOBJ == BIRD) goto L40010;
L40300: if(HERE(SNAKE) && !HERE(BIRD)) goto L40010; L40300: if(HERE(SNAKE) && !HERE(BIRD)) goto L40010;
goto L40020; goto L40020;
L40400: if(ATLOC[LOC] == 0 && ATLOC[game.oldloc] == 0 && ATLOC[game.oldlc2] == 0 && HOLDNG > L40400: if(ATLOC[LOC] == 0 && ATLOC[game.oldloc] == 0 && ATLOC[game.oldlc2] == 0 && game.holdng >
1) goto L40010; 1) goto L40010;
goto L40020; goto L40020;
@ -783,7 +781,7 @@ L40500: if(PROP[EMRALD] != -1 && PROP[PYRAM] == -1) goto L40010;
L40600: goto L40010; L40600: goto L40010;
L40700: if(DFLAG == 0) goto L40010; L40700: if(game.dflag == 0) goto L40010;
goto L40020; goto L40020;
L40800: if(ATLOC[LOC] == 0 && ATLOC[game.oldloc] == 0 && ATLOC[game.oldlc2] == 0) goto L40800: if(ATLOC[LOC] == 0 && ATLOC[game.oldloc] == 0 && ATLOC[game.oldlc2] == 0) goto
@ -910,19 +908,19 @@ L11000: PROP[BOTTLE]=PUT(BOTTLE,115,1);
L12000: RSPEAK(188); L12000: RSPEAK(188);
PROP[BATTER]=1; PROP[BATTER]=1;
if(TOTING(BATTER))DROP(BATTER,LOC); if(TOTING(BATTER))DROP(BATTER,LOC);
LIMIT=LIMIT+2500; game.limit=game.limit+2500;
LMWARN=false; game.lmwarn=false;
goto L19999; goto L19999;
L12200: if(LMWARN || !HERE(LAMP)) goto L19999; L12200: if(game.lmwarn || !HERE(LAMP)) goto L19999;
LMWARN=true; game.lmwarn=true;
SPK=187; SPK=187;
if(PLACE[BATTER] == 0)SPK=183; if(PLACE[BATTER] == 0)SPK=183;
if(PROP[BATTER] == 1)SPK=189; if(PROP[BATTER] == 1)SPK=189;
RSPEAK(SPK); RSPEAK(SPK);
goto L19999; goto L19999;
L12400: LIMIT= -1; L12400: game.limit= -1;
PROP[LAMP]=0; PROP[LAMP]=0;
if(HERE(LAMP))RSPEAK(184); if(HERE(LAMP))RSPEAK(184);
goto L19999; goto L19999;

10
misc.c
View file

@ -549,12 +549,12 @@ long TEMP;
/* Start toting an object, removing it from the list of things at its former /* Start toting an object, removing it from the list of things at its former
* location. Incr holdng unless it was already being toted. If OBJECT>NOBJECTS * location. Incr holdng unless it was already being toted. If OBJECT>NOBJECTS
* (moving "fixed" second loc), don't change PLACE or HOLDNG. */ * (moving "fixed" second loc), don't change PLACE or game.holdng. */
if(OBJECT > NOBJECTS) goto L5; if(OBJECT > NOBJECTS) goto L5;
if(PLACE[OBJECT] == -1)return; if(PLACE[OBJECT] == -1)return;
PLACE[OBJECT]= -1; PLACE[OBJECT]= -1;
HOLDNG=HOLDNG+1; game.holdng=game.holdng+1;
L5: if(ATLOC[WHERE] != OBJECT) goto L6; L5: if(ATLOC[WHERE] != OBJECT) goto L6;
ATLOC[WHERE]=LINK[OBJECT]; ATLOC[WHERE]=LINK[OBJECT];
return; return;
@ -568,10 +568,10 @@ L8: LINK[TEMP]=LINK[OBJECT];
void DROP(long OBJECT, long WHERE) { void DROP(long OBJECT, long WHERE) {
/* Place an object at a given loc, prefixing it onto the ATLOC list. Decr /* Place an object at a given loc, prefixing it onto the ATLOC list. Decr
* HOLDNG if the object was being toted. */ * game.holdng if the object was being toted. */
if(OBJECT > NOBJECTS) goto L1; if(OBJECT > NOBJECTS) goto L1;
if(PLACE[OBJECT] == -1)HOLDNG=HOLDNG-1; if(PLACE[OBJECT] == -1)game.holdng=game.holdng-1;
PLACE[OBJECT]=WHERE; PLACE[OBJECT]=WHERE;
goto L2; goto L2;
L1: {long x = OBJECT-NOBJECTS; FIXED[x]=WHERE;} L1: {long x = OBJECT-NOBJECTS; FIXED[x]=WHERE;}
@ -592,7 +592,7 @@ long AT, I;
AT=0; AT=0;
if(DFLAG < 2)return(AT); if(game.dflag < 2)return(AT);
AT= -1; AT= -1;
for (I=1; I<=NDWARVES-1; I++) { for (I=1; I<=NDWARVES-1; I++) {
if(game.dloc[I] == WHERE) goto L2; if(game.dloc[I] == WHERE) goto L2;

View file

@ -46,7 +46,7 @@ L20010: /*etc*/ ;
} /* end loop */ } /* end loop */
/* Now look at how he finished and how far he got. MAXDIE and NUMDIE tell us /* Now look at how he finished and how far he got. MAXDIE and NUMDIE tell us
* how well he survived. DFLAG will * how well he survived. game.dflag will
* tell us if he ever got suitably deep into the cave. game.closng still indicates * 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" * 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, * (indicated by "game.closed"), then bonus is zero for mundane exits or 133, 134,
@ -56,7 +56,7 @@ L20010: /*etc*/ ;
MXSCOR=MXSCOR+MAXDIE*10; MXSCOR=MXSCOR+MAXDIE*10;
if(MODE == 0)SCORE=SCORE+4; if(MODE == 0)SCORE=SCORE+4;
MXSCOR=MXSCOR+4; MXSCOR=MXSCOR+4;
if(DFLAG != 0)SCORE=SCORE+25; if(game.dflag != 0)SCORE=SCORE+25;
MXSCOR=MXSCOR+25; MXSCOR=MXSCOR+25;
if(game.closng)SCORE=SCORE+25; if(game.closng)SCORE=SCORE+25;
MXSCOR=MXSCOR+25; MXSCOR=MXSCOR+25;