SAVWDS(ABBNUM,BLKLIN,BONUS,CLOCK1,CLOCK2,CLOSED,CLOSNG);
SAVWDS(DETAIL,DFLAG,DKILL,DTOTAL,FOOBAR,HOLDNG,IWEST);
SAVWDS(KNFLOC,LIMIT,LL,LMWARN,LOC,NEWLOC,NUMDIE);
- SAVWDS(OBJ,OLDLC2,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(VERB,WD1,WD1X,WD2,WZDARK,ZZWORD,OBJSND[BIRD]);
+ SAVWDS(VERB,WD1,WD1X,WD2,WZDARK,game.zzword,OBJSND[BIRD]);
SAVWDS(OBJTXT[SIGN],CLSHNT,NOVICE,K,K,K,K);
SAVARR(ABB,LOCSIZ);
SAVARR(ATLOC,LOCSIZ);
SAVWRD(KK,K);
if(K != 0) goto L8318;
K=NUL;
- ZZWORD=RNDVOC(3,ZZWORD);
+ game.zzword=RNDVOC(3,game.zzword);
if(KK > 0) return(8);
RSPEAK(266);
exit(0);
L9320: if(OBJ != RUG) return(2011);
SPK=223;
if(PROP[RUG] != 2) return(2011);
- OLDLC2=OLDLOC;
- OLDLOC=LOC;
+ game.oldlc2=game.oldloc;
+ game.oldloc=LOC;
NEWLOC=PLACE[RUG]+FIXED[RUG]-LOC;
SPK=226;
if(PROP[SAPPH] >= 0)SPK=227;
RSPEAK(labs(K));
if(K < 0) return(2012);
SPK=0;
-L8332: SETPRM(1,ZZWORD,0);
+L8332: SETPRM(1,game.zzword,0);
/* 8335 */ for (I=1; I<=NOBJECTS; I++) {
if(!HERE(I) || OBJSND[I] == 0 || PROP[I] < 0) goto L8335;
PSPEAK(I,OBJSND[I]+PROP[I]);
PSPEAK(RESER,PROP[RESER]+1);
PROP[RESER]=1-PROP[RESER];
if(AT(RESER)) return(2012);
- OLDLC2=LOC;
+ game.oldlc2=LOC;
NEWLOC=0;
RSPEAK(241);
return(2);
typedef long vocab_t; /* index into a vocabulary array */
struct game_t {
+ long oldloc;
+ long oldlc2;
+ long zzword;
long dseen[NDWARVES+1];
long dloc[NDWARVES+1];
long odloc[NDWARVES+1];
BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST, CHLOC, CHLOC2,
CLAM, CLOCK1, CLOCK2, CLOSED, CLOSNG, CLSHNT,
COINS, CONDS, DALTLC, DETAIL,
- DKILL, DOOR, DPRSSN, DRAGON, DTOTAL, DWARF, EGGS,
+ DKILL, DOOR, DPRSSN, DRAGON, DTOTAL, DWARF, EGGS,
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOBAR, FOOD,
GRATE, HINT, HINTED[], HINTLC[],
I, INVENT, IGO, IWEST, J, JADE, K, K2, KEYS, KK,
LMWARN, LOC, LOCK, LOOK,
MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR,
NEWLOC, NOVICE, NUGGET, NUL, NUMDIE, OBJ,
- OGRE, OIL, OLDLC2, OLDLOC, OLDOBJ, OYSTER,
+ OGRE, OIL, OLDOBJ, OYSTER,
PANIC, PEARL, PILLOW, PLANT, PLANT2, PROP[], PYRAM,
RESER, ROD, ROD2, RUBY, RUG, SAPPH, SAVED, SAY,
SCORE, SECT, SETUP, SIGN, SNAKE, SPK, STEPS, STICK,
TRNDEX, TRNLUZ, TROLL, TROLL2,
TURNS, URN, V1, V2, VASE, VEND, VERB,
VOLCAN, VRSION, WATER, WD1, WD1X, WD2, WD2X,
- WZDARK, ZZWORD;
+ WZDARK;
MAGZIN, MAXDIE, MAXTRS,
MESSAG, MIRROR, MXSCOR,
NEWLOC, NOVICE, NUGGET, NUL, NUMDIE, OBJ,
- OGRE, OIL, OLDLC2, OLDLOC, OLDOBJ, OYSTER,
+ OGRE, OIL, OLDOBJ, OYSTER,
PANIC, PEARL, PILLOW, PLANT, PLANT2, PROP[NOBJECTS+1], PYRAM,
RESER, ROD, ROD2, RUBY, RUG, SAPPH, SAVED, SAY,
SCORE, SECT, SIGN, SNAKE, SPK, STEPS, STICK,
STREAM, TALLY, THRESH, THROW, TK[21], TRIDNT,
TRNDEX, TRNLUZ, TROLL, TROLL2,
- TURNS, URN, V1, V2, VASE, VEND, VERB,
+ TURNS, URN, V1, V2, VASE, VEND, VERB,
VOLCAN, VRSION = 25, WATER, WD1, WD1X, WD2, WD2X,
- WZDARK = false, ZZWORD;
+ WZDARK = false;
FILE *logfp;
bool oldstyle = false;
lcg_state lcgstate;
L1: SETUP= -1;
I=0;
- ZZWORD=RNDVOC(3,0);
+ game.zzword=RNDVOC(3,0);
NOVICE=YES(stdin, 65,1,0);
NEWLOC=1;
LOC=1;
// autogenerated, so don't charge user time for it.
--TURNS;
// here we reconfigure any global game state that uses random numbers
- ZZWORD=RNDVOC(3,0);
+ game.zzword=RNDVOC(3,0);
return true;
}
return false;
SETPRM(1,STICK,0);
RSPEAK(K+1+2/(1+STICK));
if(STICK == 0) goto L2000;
- OLDLC2=LOC;
+ game.oldlc2=LOC;
goto L99;
*
* Given the current location in "LOC", and a motion verb number in "K", put
* the new location in "NEWLOC". The current loc is saved in "OLgame.dloc" in case
- * he wants to retreat. The current OLgame.dloc is saved in OLDLC2, in case he
+ * he wants to retreat. The current OLgame.dloc is saved in game.oldlc2, in case he
* dies. (if he does, NEWLOC will be limbo, and OLgame.dloc will be what killed
- * him, so we need OLDLC2, which is the last place he was safe.) */
+ * him, so we need game.oldlc2, which is the last place he was safe.) */
L8: KK=KEY[LOC];
NEWLOC=LOC;
if(K == BACK) goto L20;
if(K == LOOK) goto L30;
if(K == CAVE) goto L40;
- OLDLC2=OLDLOC;
- OLDLOC=LOC;
+ game.oldlc2=game.oldloc;
+ game.oldloc=LOC;
L9: LL=labs(TRAVEL[KK]);
if(MOD(LL,1000) == 1 || MOD(LL,1000) == K) goto L10;
DROP(BEAR,NEWLOC);
FIXED[BEAR]= -1;
PROP[BEAR]=3;
- OLDLC2=NEWLOC;
+ game.oldlc2=NEWLOC;
goto L99;
/* End of specials. */
-/* Handle "go back". Look for verb which goes from LOC to OLDLOC, or to OLDLC2
- * If OLDLOC has forced-motion. K2 saves entry -> forced loc -> previous loc. */
+/* Handle "go back". Look for verb which goes from LOC to game.oldloc, or to game.oldlc2
+ * If game.oldloc has forced-motion. K2 saves entry -> forced loc -> previous loc. */
-L20: K=OLDLOC;
- if(FORCED(K))K=OLDLC2;
- OLDLC2=OLDLOC;
- OLDLOC=LOC;
+L20: K=game.oldloc;
+ if(FORCED(K))K=game.oldlc2;
+ game.oldlc2=game.oldloc;
+ game.oldloc=LOC;
K2=0;
if(K == LOC)K2=91;
if(CNDBIT(LOC,4))K2=274;
* 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 another chance, he gets a snide remark as
- * we exit. When reincarnated, all objects being carried get dropped at OLDLC2
+ * we exit. When reincarnated, all objects being carried get dropped at game.oldlc2
* (presumably the last place prior to being killed) without change of props.
* the loop runs backwards to assure that the bird is dropped before the cage.
* (this kluge could be changed once we're sure all references to bird and cage
* it in the cave). It is turned off and left outside the building (only if he
* was carrying it, of course). He himself is left inside the building (and
* heaven help him if he tries to xyzzy back into the cave without the lamp!).
- * OLDLOC is zapped so he can't just "retreat". */
+ * game.oldloc is zapped so he can't just "retreat". */
/* The easiest way to get killed is to fall into a pit in pitch darkness. */
L90: RSPEAK(23);
- OLDLC2=LOC;
+ game.oldlc2=LOC;
/* Okay, he's dead. Let's get on with it. */
/* 98 */ for (J=1; J<=NOBJECTS; J++) {
I=NOBJECTS + 1 - J;
if(!TOTING(I)) goto L98;
- K=OLDLC2;
+ K=game.oldlc2;
if(I == LAMP)K=1;
DROP(I,K);
L98: /*etc*/ ;
} /* end loop */
LOC=3;
- OLDLOC=LOC;
+ game.oldloc=LOC;
goto L2000;
/* He died during closing time. No resurrection. Tally up a death and exit. */
L40300: if(HERE(SNAKE) && !HERE(BIRD)) goto L40010;
goto L40020;
-L40400: if(ATLOC[LOC] == 0 && ATLOC[OLDLOC] == 0 && ATLOC[OLDLC2] == 0 && HOLDNG >
+L40400: if(ATLOC[LOC] == 0 && ATLOC[game.oldloc] == 0 && ATLOC[game.oldlc2] == 0 && HOLDNG >
1) goto L40010;
goto L40020;
L40700: if(DFLAG == 0) goto L40010;
goto L40020;
-L40800: if(ATLOC[LOC] == 0 && ATLOC[OLDLOC] == 0 && ATLOC[OLDLC2] == 0) goto
+L40800: if(ATLOC[LOC] == 0 && ATLOC[game.oldloc] == 0 && ATLOC[game.oldlc2] == 0) goto
L40010;
goto L40030;
PROP[ROD]=PUT(ROD,115,0);
PROP[DWARF]=PUT(DWARF,115,0);
LOC=115;
- OLDLOC=115;
+ game.oldloc=115;
NEWLOC=115;
/* Leave the grate with normal (non-negative) property. Reuse sign. */