L5120: if(OBJ != PLANT || !AT(PLANT2) || PROP[PLANT2] == 0) goto L5130;
OBJ=PLANT2;
goto L5010;
-L5130: if(OBJ != KNIFE || KNFLOC != LOC) goto L5140;
- KNFLOC= -1;
+L5130: if(OBJ != KNIFE || game.knfloc != LOC) goto L5140;
+ game.knfloc= -1;
SPK=116;
return(2011);
L5140: if(OBJ != ROD || !HERE(ROD2)) goto L5190;
/* 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(OBJ == 0 || OBJ > NOBJECTS) return(8000);
L9070: if(OBJ == URN) goto L9073;
if(OBJ != LAMP) return(2011);
SPK=184;
- if(LIMIT < 0) return(2011);
+ if(game.limit < 0) return(2011);
PROP[LAMP]=1;
RSPEAK(39);
if(game.wzdark) return(2000);
L8250: K=VOCAB(WD1,3);
SPK=42;
- if(FOOBAR == 1-K) goto L8252;
- if(FOOBAR != 0)SPK=151;
+ if(game.foobar == 1-K) goto L8252;
+ if(game.foobar != 0)SPK=151;
return(2011);
-L8252: FOOBAR=K;
+L8252: game.foobar=K;
if(K != 4) return(2009);
- FOOBAR=0;
+ game.foobar=0;
if(PLACE[EGGS] == PLAC[EGGS] || (TOTING(EGGS) && LOC == PLAC[EGGS]))
return(2011);
/* Bring back troll if we steal the eggs back from him before crossing. */
* needs to be saved, include it. Overkill can't hurt. Pad the last savwds
* 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.detail,DFLAG,game.dkill,game.dtotal,FOOBAR,HOLDNG,IWEST);
- SAVWDS(KNFLOC,LIMIT,LL,LMWARN,LOC,NEWLOC,NUMDIE);
+ SAVWDS(game.detail,game.dflag,game.dkill,game.dtotal,game.foobar,game.holdng,game.iwest);
+ SAVWDS(game.knfloc,game.limit,LL,game.lmwarn,LOC,NEWLOC,NUMDIE);
SAVWDS(OBJ,game.oldlc2,game.oldloc,OLDOBJ,PANIC,SAVED,SETUP);
SAVWDS(SPK,TALLY,THRESH,TRNDEX,TRNLUZ,TURNS,OBJTXT[OYSTER]);
SAVWDS(VERB,WD1,WD1X,WD2,game.wzdark,game.zzword,OBJSND[BIRD]);
if(!TOTING(BOTTLE))SPK=104;
return(2011);
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(PROP[BIRD] == 2) goto L9015;
if(!TOTING(CAGE))SPK=27;
return(attack(cmdin));
L9172: SPK=48;
- if(randrange(NDWARVES+1) < DFLAG) goto L9175;
+ if(randrange(NDWARVES+1) < game.dflag) goto L9175;
game.dseen[I]=false;
game.dloc[I]=0;
SPK=47;
L9213: if(OBJ != DWARF) goto L9214;
if(!HERE(FOOD)) return(2011);
SPK=103;
- DFLAG=DFLAG+2;
+ game.dflag=game.dflag+2;
return(2011);
L9214: if(OBJ != BEAR) goto L9215;
long closng;
long conds;
long detail;
+ long dflag;
long dkill;
long dtotal;
+ long foobar;
+ long holdng;
+ long iwest;
+ long knfloc;
+ long limit;
+ long lmwarn;
long oldloc;
long oldlc2;
long wzdark;
extern struct game_t game;
-extern long ABB[], ATLOC[], BLKLIN, DFLAG, FIXED[], HOLDNG,
+extern long ABB[], ATLOC[], FIXED[],
LINK[], LNLENG, LNPOSN,
PARMS[], PLACE[];
extern char rawbuf[LINESIZE], INLINE[LINESIZE+1], MAP1[], MAP2[];
extern long AMBER, ATTACK, AXE, BACK, BATTER, BEAR,
BIRD, BLOOD, BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST,
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[],
- I, INVENT, IGO, IWEST, J, JADE, K, K2, KEYS, KK,
- KNFLOC, KNIFE, KQ, L, LAMP, LIMIT, LL,
- LMWARN, LOC, LOCK, LOOK,
+ I, INVENT, IGO, J, JADE, K, K2, KEYS, KK,
+ KNIFE, KQ, L, LAMP, LL, LOC, LOCK, LOOK,
MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR,
NEWLOC, NOVICE, NUGGET, NUL, NUMDIE, OBJ,
OGRE, OIL, OLDOBJ, OYSTER,
* 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
* 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)
* 1 Reached Hall Of Mists, but hasn't met first dwarf
* 2 Met first dwarf, others start moving, no knives thrown yet
for (I=1; I<=NDWARVES; I++) {
game.dseen[I]=false;
} /* end loop */
- DFLAG=0;
+ game.dflag=0;
game.dloc[1]=19;
game.dloc[2]=27;
game.dloc[3]=33;
* 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.dkill # of dwarves killed (unused in scoring, needed for msg)
- * FOOBAR Current progress in saying "FEE FIE FOE FOO".
- * HOLDNG Number of objects being carried
+ * game.foobar Current progress in saying "FEE FIE FOE FOO".
+ * game.holdng Number of objects being carried
* IGO How many times he's said "go XXX" instead of "XXX"
- * IWEST How many times he's said "west" instead of "w"
- * KNFLOC 0 if no knife here, loc if knife here, -1 after caveat
- * LIMIT Lifetime of lamp (not set here)
+ * 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)
* MAXDIE Number of reincarnation messages available (up to 5)
* NUMDIE Number of times killed so far
* THRESH Next #turns threshhold (-1 if none)
THRESH= -1;
if(TRNVLS > 0)THRESH=MOD(TRNVAL[1],100000)+1;
TRNLUZ=0;
- LMWARN=false;
+ game.lmwarn=false;
IGO=0;
- IWEST=0;
- KNFLOC=0;
+ game.iwest=0;
+ game.knfloc=0;
game.detail=0;
game.abbnum=5;
for (I=0; I<=4; I++) {
{long x = 2*I+81; if(RTEXT[x] != 0)MAXDIE=I+1;}
} /* end loop */
NUMDIE=0;
- HOLDNG=0;
+ game.holdng=0;
game.dkill=0;
- FOOBAR=0;
+ game.foobar=0;
game.bonus=0;
game.clock1=30;
game.clock2=50;
struct game_t game;
-long ABB[186], ATLOC[186], DFLAG,
- FIXED[NOBJECTS+1], HOLDNG,
+long ABB[186], ATLOC[186],
+ FIXED[NOBJECTS+1],
LINK[NOBJECTS*2 + 1], LNLENG, LNPOSN,
PARMS[26], PLACE[NOBJECTS+1],
SETUP = 0;
BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST,
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[21], HINTLC[21],
- I, INVENT, IGO, IWEST, J, JADE, K, K2, KEYS, KK,
- KNFLOC, KNIFE, KQ, L, LAMP, LIMIT, LL,
- LMWARN, LOC, LOCK, LOOK,
- MAGZIN, MAXDIE, MAXTRS,
- MESSAG, MIRROR, MXSCOR,
+ I, INVENT, IGO, J, JADE, K, K2, KEYS, KK,
+ KNIFE, KQ, L, LAMP, LL, LOC, LOCK, LOOK,
+ MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR,
NEWLOC, NOVICE, NUGGET, NUL, NUMDIE, OBJ,
OGRE, OIL, OLDOBJ, OYSTER,
PANIC, PEARL, PILLOW, PLANT, PLANT2, PROP[NOBJECTS+1], PYRAM,
* game.closed says whether we're all the way closed
* game.closng says whether it's closing time yet
* 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
* PANIC says whether he's found out he's trapped in the cave
* game.wzdark says whether the loc he's leaving was dark */
NOVICE=YES(stdin, 65,1,0);
NEWLOC=1;
LOC=1;
- LIMIT=330;
- if(NOVICE)LIMIT=1000;
+ game.limit=330;
+ if(NOVICE)game.limit=1000;
if (logfp)
fprintf(logfp, "seed %ld\n", seedval);
* 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(DFLAG != 0) goto L6000;
- if(INDEEP(LOC))DFLAG=1;
+ if(game.dflag != 0) goto L6000;
+ if(INDEEP(LOC))game.dflag=1;
goto L2000;
/* 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. */
-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;
- DFLAG=2;
+ game.dflag=2;
for (I=1; I<=2; I++) {
J=1+randrange(NDWARVES-1);
if(PCT(50))game.dloc[J]=0;
L6027: game.dtotal=game.dtotal+1;
if(game.odloc[I] != game.dloc[I]) goto L6030;
ATTACK=ATTACK+1;
- if(KNFLOC >= 0)KNFLOC=LOC;
- if(randrange(1000) < 95*(DFLAG-2))STICK=STICK+1;
+ if(game.knfloc >= 0)game.knfloc=LOC;
+ if(randrange(1000) < 95*(game.dflag-2))STICK=STICK+1;
L6030: /*etc*/ ;
} /* end loop */
SETPRM(1,game.dtotal,0);
RSPEAK(4+1/game.dtotal);
if(ATTACK == 0) goto L2000;
- if(DFLAG == 2)DFLAG=3;
+ if(game.dflag == 2)game.dflag=3;
SETPRM(1,ATTACK,0);
K=6;
if(ATTACK > 1)K=250;
if(TOTING(I) && PROP[I] < 0)PROP[I]= -1-PROP[I];
} /* end loop */
L2605: game.wzdark=DARK(0);
- if(KNFLOC > 0 && KNFLOC != LOC)KNFLOC=0;
+ if(game.knfloc > 0 && game.knfloc != LOC)game.knfloc=0;
I=0;
if (!GETIN(cmdin, WD1,WD1X,WD2,WD2X))
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. */
-L2607: FOOBAR=(FOOBAR>0 ? -FOOBAR : 0);
+L2607: game.foobar=(game.foobar>0 ? -game.foobar : 0);
TURNS=TURNS+1;
if(TURNS == THRESH) {
SPEAK(TTEXT[TRNDEX]);
if(game.clock1 == 0) goto L10000;
if(game.clock1 < 0)game.clock2=game.clock2-1;
if(game.clock2 == 0) goto L11000;
- if(PROP[LAMP] == 1)LIMIT=LIMIT-1;
- if(LIMIT <= 30 && HERE(BATTER) && PROP[BATTER] == 0 && HERE(LAMP)) goto
+ if(PROP[LAMP] == 1)game.limit=game.limit-1;
+ if(game.limit <= 30 && HERE(BATTER) && PROP[BATTER] == 0 && HERE(LAMP)) goto
L12000;
- if(LIMIT == 0) goto L12400;
- if(LIMIT <= 30) goto L12200;
+ if(game.limit == 0) goto L12400;
+ if(game.limit <= 30) goto L12200;
L19999: K=43;
if(LIQLOC(LOC) == WATER)K=70;
V1=VOCAB(WD1,-1);
L2610: if(V1 == 1000+CAGE && V2 == 1000+BIRD && HERE(CAGE) && HERE(BIRD))
WD1=MAKEWD(301200308);
L2620: if(WD1 == MAKEWD(23051920)) {
- IWEST=IWEST+1;
- if(IWEST == 10)RSPEAK(17);
+ game.iwest=game.iwest+1;
+ if(game.iwest == 10)RSPEAK(17);
}
if(WD1 != MAKEWD( 715) || WD2 == 0) goto L2630;
IGO=IGO+1;
* be used for actual motion, but can be spotted by "go back". */
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;
RSPEAK(117);
return true;
SETPRM(1,HINTS[HINT][2],HINTS[HINT][2]);
RSPEAK(261);
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;
L40030: goto L2602;
L40300: if(HERE(SNAKE) && !HERE(BIRD)) goto L40010;
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;
goto L40020;
L40600: goto L40010;
-L40700: if(DFLAG == 0) goto L40010;
+L40700: if(game.dflag == 0) goto L40010;
goto L40020;
L40800: if(ATLOC[LOC] == 0 && ATLOC[game.oldloc] == 0 && ATLOC[game.oldlc2] == 0) goto
L12000: RSPEAK(188);
PROP[BATTER]=1;
if(TOTING(BATTER))DROP(BATTER,LOC);
- LIMIT=LIMIT+2500;
- LMWARN=false;
+ game.limit=game.limit+2500;
+ game.lmwarn=false;
goto L19999;
-L12200: if(LMWARN || !HERE(LAMP)) goto L19999;
- LMWARN=true;
+L12200: if(game.lmwarn || !HERE(LAMP)) goto L19999;
+ game.lmwarn=true;
SPK=187;
if(PLACE[BATTER] == 0)SPK=183;
if(PROP[BATTER] == 1)SPK=189;
RSPEAK(SPK);
goto L19999;
-L12400: LIMIT= -1;
+L12400: game.limit= -1;
PROP[LAMP]=0;
if(HERE(LAMP))RSPEAK(184);
goto L19999;
/* 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
- * (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(PLACE[OBJECT] == -1)return;
PLACE[OBJECT]= -1;
- HOLDNG=HOLDNG+1;
+ game.holdng=game.holdng+1;
L5: if(ATLOC[WHERE] != OBJECT) goto L6;
ATLOC[WHERE]=LINK[OBJECT];
return;
void DROP(long OBJECT, long WHERE) {
/* 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(PLACE[OBJECT] == -1)HOLDNG=HOLDNG-1;
+ if(PLACE[OBJECT] == -1)game.holdng=game.holdng-1;
PLACE[OBJECT]=WHERE;
goto L2;
L1: {long x = OBJECT-NOBJECTS; FIXED[x]=WHERE;}
AT=0;
- if(DFLAG < 2)return(AT);
+ if(game.dflag < 2)return(AT);
AT= -1;
for (I=1; I<=NDWARVES-1; I++) {
if(game.dloc[I] == WHERE) goto L2;
} /* end loop */
/* 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
* 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,
MXSCOR=MXSCOR+MAXDIE*10;
if(MODE == 0)SCORE=SCORE+4;
MXSCOR=MXSCOR+4;
- if(DFLAG != 0)SCORE=SCORE+25;
+ if(game.dflag != 0)SCORE=SCORE+25;
MXSCOR=MXSCOR+25;
if(game.closng)SCORE=SCORE+25;
MXSCOR=MXSCOR+25;