/* Carry, no object given yet. OK if only one object present. */
-L8010: if(ATLOC[LOC] == 0 || LINK[ATLOC[LOC]] != 0 || ATDWRF(LOC) > 0) return(8000);
- OBJ=ATLOC[LOC];
+L8010: if(game.atloc[LOC] == 0 || game.link[game.atloc[LOC]] != 0 || ATDWRF(LOC) > 0) return(8000);
+ OBJ=game.atloc[LOC];
/* Transitive carry/drop are in separate file. */
if(PROP[CHAIN] == 0)SPK=37;
if(SPK != 171) return(2011);
PROP[CHAIN]=0;
- FIXED[CHAIN]=0;
+ game.fixed[CHAIN]=0;
if(PROP[BEAR] != 3)PROP[BEAR]=2;
- FIXED[BEAR]=2-PROP[BEAR];
+ game.fixed[BEAR]=2-PROP[BEAR];
return(2011);
L9049: SPK=172;
if(SPK != 172) return(2011);
PROP[CHAIN]=2;
if(TOTING(CHAIN))DROP(CHAIN,LOC);
- FIXED[CHAIN]= -1;
+ game.fixed[CHAIN]= -1;
return(2011);
/* Light. Applicable only to lamp and urn. */
if(OBJ != ROD || !TOTING(OBJ) || (!HERE(BIRD) && (game.closng || !AT(FISSUR))))
return(2011);
if(HERE(BIRD))SPK=206+MOD(PROP[BIRD],2);
- if(SPK == 206 && LOC == PLACE[STEPS] && PROP[JADE] < 0) goto L9094;
+ if(SPK == 206 && LOC == game.place[STEPS] && PROP[JADE] < 0) goto L9094;
if(game.closed) return(18999);
if(game.closng || !AT(FISSUR)) return(2011);
if(HERE(BIRD))RSPEAK(SPK);
if(OBJ != OIL && OBJ != WATER) return(2011);
if(HERE(URN) && PROP[URN] == 0) goto L9134;
PROP[BOTTLE]=1;
- PLACE[OBJ]=0;
+ game.place[OBJ]=0;
SPK=77;
if(!(AT(PLANT) || AT(DOOR))) return(2011);
if(OBJ != 0 && OBJ != WATER)SPK=110;
if(SPK == 110 || LIQ(0) != WATER || !HERE(BOTTLE)) return(2011);
PROP[BOTTLE]=1;
- PLACE[WATER]=0;
+ game.place[WATER]=0;
SPK=74;
return(2011);
L8252: game.foobar=K;
if(K != 4) return(2009);
game.foobar=0;
- if(PLACE[EGGS] == PLAC[EGGS] || (TOTING(EGGS) && LOC == PLAC[EGGS]))
+ if(game.place[EGGS] == PLAC[EGGS] || (TOTING(EGGS) && LOC == PLAC[EGGS]))
return(2011);
/* Bring back troll if we steal the eggs back from him before crossing. */
- if(PLACE[EGGS] == 0 && PLACE[TROLL] == 0 && PROP[TROLL] ==
+ if(game.place[EGGS] == 0 && game.place[TROLL] == 0 && PROP[TROLL] ==
0)PROP[TROLL]=1;
K=2;
if(HERE(EGGS))K=1;
L9282: SPK=198;
if(TOTING(VASE))DROP(VASE,LOC);
PROP[VASE]=2;
- FIXED[VASE]= -1;
+ game.fixed[VASE]= -1;
return(2011);
/* Wake. Only use is to disturb the dwarves. */
SAVWDS(VERB,WD1,WD1X,WD2,game.wzdark,game.zzword,OBJSND[BIRD]);
SAVWDS(OBJTXT[SIGN],game.clshnt,game.novice,K,K,K,K);
SAVARR(game.abbrev,LOCSIZ);
- SAVARR(ATLOC,LOCSIZ);
+ SAVARR(game.atloc,LOCSIZ);
SAVARR(game.dloc,NDWARVES);
SAVARR(game.dseen,NDWARVES);
- SAVARR(FIXED,NOBJECTS);
- SAVARR(HINTED,HNTSIZ);
+ SAVARR(game.fixed,NOBJECTS);
+ SAVARR(game.hinted,HNTSIZ);
SAVARR(HINTLC,HNTSIZ);
- SAVARR(LINK,NOBJECTS*2);
+ SAVARR(game.link,NOBJECTS*2);
SAVARR(game.odloc,NDWARVES);
- SAVARR(PLACE,NOBJECTS);
+ SAVARR(game.place,NOBJECTS);
SAVARR(PROP,NOBJECTS);
SAVWRD(KK,K);
if(K != 0) goto L8318;
if(PROP[RUG] != 2) return(2011);
game.oldlc2=game.oldloc;
game.oldloc=LOC;
- game.newloc=PLACE[RUG]+FIXED[RUG]-LOC;
+ game.newloc=game.place[RUG]+game.fixed[RUG]-LOC;
SPK=226;
if(PROP[SAPPH] >= 0)SPK=227;
RSPEAK(SPK);
/* Z'ZZZ (word gets recomputed at startup; different each game). */
-L8340: if(!AT(RESER) && LOC != FIXED[RESER]-1) return(2011);
+L8340: if(!AT(RESER) && LOC != game.fixed[RESER]-1) return(2011);
PSPEAK(RESER,PROP[RESER]+1);
PROP[RESER]=1-PROP[RESER];
if(AT(RESER)) return(2012);
if(OBJ != MESSAG) goto L9011;
SPK=190;
DSTROY(MESSAG);
-L9011: if(FIXED[OBJ] != 0) return(2011);
+L9011: if(game.fixed[OBJ] != 0) return(2011);
if(OBJ != WATER && OBJ != OIL) goto L9017;
K=OBJ;
OBJ=BOTTLE;
1))CARRY(BIRD+CAGE-OBJ,LOC);
CARRY(OBJ,LOC);
K=LIQ(0);
- if(OBJ == BOTTLE && K != 0)PLACE[K]= -1;
+ if(OBJ == BOTTLE && K != 0)game.place[K]= -1;
if(!GSTONE(OBJ) || PROP[OBJ] == 0) return(2009);
PROP[OBJ]=0;
PROP[CAVITY]=1;
PROP[SNAKE]=1;
L9021: K=LIQ(0);
if(K == OBJ)OBJ=BOTTLE;
- if(OBJ == BOTTLE && K != 0)PLACE[K]=0;
+ if(OBJ == BOTTLE && K != 0)game.place[K]=0;
if(OBJ == CAGE && PROP[BIRD] == 1)DROP(BIRD,LOC);
DROP(OBJ,LOC);
if(OBJ != BIRD) return(2012);
L9028: PROP[VASE]=2;
if(AT(PILLOW))PROP[VASE]=0;
PSPEAK(VASE,PROP[VASE]+1);
- if(PROP[VASE] != 0)FIXED[VASE]= -1;
+ if(PROP[VASE] != 0)game.fixed[VASE]= -1;
goto L9021;
}
MOVE(RUG,K);
DROP(BLOOD,K);
for (OBJ=1; OBJ<=NOBJECTS; OBJ++) {
- if(PLACE[OBJ] == PLAC[DRAGON] || PLACE[OBJ] == FIXD[DRAGON])MOVE(OBJ,K);
+ if(game.place[OBJ] == PLAC[DRAGON] || game.place[OBJ] == FIXD[DRAGON])MOVE(OBJ,K);
/*etc*/ ;
} /* end loop */
LOC=K;
/* This'll teach him to throw the axe at the bear! */
L9176: SPK=164;
DROP(AXE,LOC);
- FIXED[AXE]= -1;
+ game.fixed[AXE]= -1;
PROP[AXE]=1;
JUGGLE(BEAR);
return(2011);
if(!HERE(FOOD)) return(2011);
DSTROY(FOOD);
PROP[BEAR]=1;
- FIXED[AXE]=0;
+ game.fixed[AXE]=0;
PROP[AXE]=0;
SPK=168;
return(2011);
if(SPK != 107) return(2011);
PROP[BOTTLE]=MOD(COND[LOC],4)/2*2;
K=LIQ(0);
- if(TOTING(BOTTLE))PLACE[K]= -1;
+ if(TOTING(BOTTLE))game.place[K]= -1;
if(K == OIL)SPK=108;
return(2011);
if(LIQLOC(LOC) == 0 || !TOTING(VASE)) return(2011);
RSPEAK(145);
PROP[VASE]=2;
- FIXED[VASE]= -1;
+ game.fixed[VASE]= -1;
return(discard(true));
L9224: SPK=213;
SPK=144;
K=LIQ(0);
if(K == 0 || !HERE(BOTTLE)) return(2011);
- PLACE[K]=0;
+ game.place[K]=0;
PROP[BOTTLE]=1;
if(K == OIL)PROP[URN]=1;
SPK=211+PROP[URN];
long wzdark;
long zzword;
long abbrev[LOCSIZ+1];
+ long atloc[LOCSIZ+1];
long dseen[NDWARVES+1];
long dloc[NDWARVES+1];
long odloc[NDWARVES+1];
+ long fixed[NOBJECTS+1];
+ long link[NOBJECTS*2 + 1];
+ long place[NOBJECTS+1];
+ long hinted[HNTSIZ+1];
};
extern struct game_t game;
-extern long ATLOC[], FIXED[], LINK[], LNLENG, LNPOSN, PARMS[], PLACE[];
+extern long LNLENG, LNPOSN, PARMS[];
extern char rawbuf[LINESIZE], INLINE[LINESIZE+1], MAP1[], MAP2[];
extern FILE *logfp;
extern bool oldstyle;
BIRD, BLOOD, BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST,
CLAM, COINS, DALTLC, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
- GRATE, HINT, HINTED[], HINTLC[],
+ GRATE, HINT, HINTLC[],
I, INVENT, IGO, J, JADE, K, K2, KEYS, KK,
KNIFE, KQ, L, LAMP, LL, LOC, LOCK, LOOK,
MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR, NUGGET, NUL, OBJ,
#define TRNSIZ 5
#define TABSIZ 330
#define VRBSIZ 35
-#define HNTSIZ 20
#define TRVSIZ 885
#define TOKLEN 5
#define HINTLEN 5
/* Having read in the database, certain things are now constructed.
* PROPS are set to zero. We finish setting up COND by checking for
* forced-motion travel entries. The PLAC and FIXD arrays are used
- * to set up ATLOC(N) as the first object at location N, and
- * LINK(OBJ) as the next object at the same location as OBJ.
- * (OBJ>NOBJECTS indicates that FIXED(OBJ-NOBJECTS)=LOC; LINK(OBJ) is
+ * to set up game.atloc(N) as the first object at location N, and
+ * game.link(OBJ) as the next object at the same location as OBJ.
+ * (OBJ>NOBJECTS indicates that game.fixed(OBJ-NOBJECTS)=LOC; game.link(OBJ) is
* still the correct link to use.) game.abbrev is zeroed; it controls
* whether the abbreviated description is printed. Counts modulo 5
* unless "LOOK" is used. */
* PCT(N) = true N% of the time (N integer from 0 to 100)
* TOTING(OBJ) = true if the OBJ is being carried */
-#define TOTING(OBJ) (PLACE[OBJ] == -1)
-#define AT(OBJ) (PLACE[OBJ] == LOC || FIXED[OBJ] == LOC)
+#define TOTING(OBJ) (game.place[OBJ] == -1)
+#define AT(OBJ) (game.place[OBJ] == LOC || game.fixed[OBJ] == LOC)
#define HERE(OBJ) (AT(OBJ) || TOTING(OBJ))
#define LIQ2(PBOTL) ((1-(PBOTL))*WATER+((PBOTL)/2)*(WATER+OIL))
#define LIQ(DUMMY) (LIQ2(PROP[BOTTLE]<0 ? -1-PROP[BOTTLE] : PROP[BOTTLE]))
* 12600 words of message text (LINES, LINSIZ).
* 885 travel options (TRAVEL, TRVSIZ).
* 330 vocabulary words (KTAB, ATAB, TABSIZ).
- * 185 locations (LTEXT, STEXT, KEY, COND, abbrev, ATLOC, LOCSND, LOCSIZ).
- * 100 objects (PLAC, PLACE, FIXD, FIXED, LINK (TWICE), PTEXT, PROP,
+ * 185 locations (LTEXT, STEXT, KEY, COND, abbrev, game.atloc, LOCSND, LOCSIZ).
+ * 100 objects (PLAC, game.place, FIXD, game.fixed, game.link (TWICE), PTEXT, PROP,
* OBJSND, OBJTXT).
* 35 "action" verbs (ACTSPK, VRBSIZ).
* 277 random messages (RTEXT, RTXSIZ).
* 12 different player classifications (CTEXT, CVAL, CLSMAX).
- * 20 hints (HINTLC, HINTED, HINTS, HNTSIZ).
+ * 20 hints (HINTLC, game.hinted, HINTS, HNTSIZ).
* 5 "# of turns" threshholds (TTEXT, TRNVAL, TRNSIZ).
* There are also limits which cannot be exceeded due to the structure of
* the database. (E.G., The vocabulary uses n/1000 to determine word type,
static int finish_init(void) {
for (I=1; I<=100; I++) {
- PLACE[I]=0;
+ game.place[I]=0;
PROP[I]=0;
- LINK[I]=0;
- {long x = I+NOBJECTS; LINK[x]=0;}
+ game.link[I]=0;
+ {long x = I+NOBJECTS; game.link[x]=0;}
} /* end loop */
/* 1102 */ for (I=1; I<=LOCSIZ; I++) {
if(LTEXT[I] == 0 || KEY[I] == 0) goto L1102;
K=KEY[I];
if(MOD(labs(TRAVEL[K]),1000) == 1)COND[I]=2;
-L1102: ATLOC[I]=0;
+L1102: game.atloc[I]=0;
} /* end loop */
-/* Set up the ATLOC and LINK arrays as described above. We'll use the DROP
+/* Set up the game.atloc and game.link arrays as described above. We'll use the DROP
* subroutine, which prefaces new objects on the lists. Since we want things
* in the other order, we'll run the loop backwards. If the object is in two
- * locs, we drop it twice. This also sets up "PLACE" and "fixed" as copies of
+ * locs, we drop it twice. This also sets up "game.place" and "fixed" as copies of
* "PLAC" and "FIXD". Also, since two-placed objects are typically best
* described last, we'll drop them first. */
for (I=1; I<=NOBJECTS; I++) {
K=NOBJECTS + 1 - I;
- FIXED[K]=FIXD[K];
+ game.fixed[K]=FIXD[K];
if(PLAC[K] != 0 && FIXD[K] <= 0)DROP(K,PLAC[K]);
} /* end loop */
game.tally=game.tally-PROP[I];
} /* end loop */
-/* Clear the hint stuff. HINTLC(I) is how long he's been at LOC with cond bit
- * I. HINTED(I) is true iff hint I has been used. */
+/* Clear the hint stuff. 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 (I=1; I<=HNTMAX; I++) {
- HINTED[I]=false;
+ game.hinted[I]=false;
HINTLC[I]=0;
} /* end loop */
struct game_t game;
-long ATLOC[LOCSIZ+1], FIXED[NOBJECTS+1],
- LINK[NOBJECTS*2 + 1], LNLENG, LNPOSN,
- PARMS[26], PLACE[NOBJECTS+1];
+long LNLENG, LNPOSN, PARMS[26];
char rawbuf[LINESIZE], INLINE[LINESIZE+1], MAP1[129], MAP2[129];
long AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD,
BOTTLE, CAGE, CAVE, CAVITY, CHAIN, CHASM, CHEST,
CLAM, COINS, DALTLC, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
- GRATE, HINT, HINTED[21], HINTLC[21],
+ GRATE, HINT, HINTLC[21],
I, INVENT, IGO, J, JADE, K, K2, KEYS, KK,
KNIFE, KQ, L, LAMP, LL, LOC, LOCK, LOOK,
MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR,
/* The pirate's spotted him. He leaves him alone once we've found chest. K
* counts if a treasure is here. If not, and tally=1 for an unseen chest, let
- * the pirate be spotted. Note that PLACE(CHEST)=0 might mean that he's
+ * the pirate be spotted. Note that game.place(CHEST)=0 might mean that he's
* thrown it to the troll, but in that case he's seen the chest (PROP=0). */
if(LOC == game.chloc || PROP[CHEST] >= 0) goto L6030;
if(TOTING(J)) goto L6021;
L6020: if(HERE(J))K=1;
} /* end loop */
- if(game.tally == 1 && K == 0 && PLACE[CHEST] == 0 && HERE(LAMP) && PROP[LAMP]
+ if(game.tally == 1 && K == 0 && game.place[CHEST] == 0 && HERE(LAMP) && PROP[LAMP]
== 1) goto L6025;
if(game.odloc[6] != game.dloc[6] && PCT(20))RSPEAK(127);
goto L6030;
-L6021: if(PLACE[CHEST] != 0) goto L6022;
+L6021: if(game.place[CHEST] != 0) goto L6022;
/* Install chest only once, to insure it is the last treasure in the list. */
MOVE(CHEST,game.chloc);
MOVE(MESSAG,game.chloc2);
L6022: RSPEAK(128);
/* 6023 */ for (J=50; J<=MAXTRS; J++) {
if(J == PYRAM && (LOC == PLAC[PYRAM] || LOC == PLAC[EMRALD])) goto L6023;
- if(AT(J) && FIXED[J] == 0)CARRY(J,LOC);
+ if(AT(J) && game.fixed[J] == 0)CARRY(J,LOC);
if(TOTING(J))DROP(J,game.chloc);
L6023: /*etc*/ ;
} /* end loop */
if(DARK(0)) goto L2012;
game.abbrev[LOC]=game.abbrev[LOC]+1;
- I=ATLOC[LOC];
+ I=game.atloc[LOC];
L2004: if(I == 0) goto L2012;
OBJ=I;
if(OBJ > NOBJECTS)OBJ=OBJ-NOBJECTS;
* anyone who makes such a gross blunder isn't likely to find everything
* else anyway (so goes the rationalisation). */
L2006: KK=PROP[OBJ];
- if(OBJ == STEPS && LOC == FIXED[STEPS])KK=1;
+ if(OBJ == STEPS && LOC == game.fixed[STEPS])KK=1;
PSPEAK(OBJ,KK);
-L2008: I=LINK[I];
+L2008: I=game.link[I];
goto L2004;
L2009: K=54;
L2600: if(COND[LOC] < game.conds) goto L2603;
/* 2602 */ for (HINT=1; HINT<=HNTMAX; HINT++) {
- if(HINTED[HINT]) goto L2602;
+ if(game.hinted[HINT]) goto L2602;
if(!CNDBIT(LOC,HINT+10))HINTLC[HINT]= -1;
HINTLC[HINT]=HINTLC[HINT]+1;
if(HINTLC[HINT] >= HINTS[HINT][1]) goto L40000;
PROP[CHASM]=1;
PROP[TROLL]=2;
DROP(BEAR,game.newloc);
- FIXED[BEAR]= -1;
+ game.fixed[BEAR]= -1;
PROP[BEAR]=3;
game.oldlc2=game.newloc;
goto L99;
game.numdie=game.numdie+1;
if(!YES(cmdin,79+game.numdie*2,80+game.numdie*2,54)) score(0);
if(game.numdie == MAXDIE) score(0);
- PLACE[WATER]=0;
- PLACE[OIL]=0;
+ game.place[WATER]=0;
+ game.place[OIL]=0;
if(TOTING(LAMP))PROP[LAMP]=0;
/* 98 */ for (J=1; J<=NOBJECTS; J++) {
I=NOBJECTS + 1 - J;
if(!YES(cmdin,HINTS[HINT][3],0,54)) goto L2602;
SETPRM(1,HINTS[HINT][2],HINTS[HINT][2]);
RSPEAK(261);
- HINTED[HINT]=YES(cmdin,175,HINTS[HINT][4],54);
- if(HINTED[HINT] && game.limit > 30)game.limit=game.limit+30*HINTS[HINT][2];
+ game.hinted[HINT]=YES(cmdin,175,HINTS[HINT][4],54);
+ if(game.hinted[HINT] && game.limit > 30)game.limit=game.limit+30*HINTS[HINT][2];
L40020: HINTLC[HINT]=0;
L40030: goto L2602;
L40100: if(PROP[GRATE] == 0 && !HERE(KEYS)) goto L40010;
goto L40020;
-L40200: if(PLACE[BIRD] == LOC && TOTING(ROD) && game.oldobj == BIRD) goto L40010;
+L40200: if(game.place[BIRD] == LOC && TOTING(ROD) && game.oldobj == BIRD) goto L40010;
goto L40030;
L40300: if(HERE(SNAKE) && !HERE(BIRD)) goto L40010;
goto L40020;
-L40400: if(ATLOC[LOC] == 0 && ATLOC[game.oldloc] == 0 && ATLOC[game.oldlc2] == 0 && game.holdng >
+L40400: if(game.atloc[LOC] == 0 && game.atloc[game.oldloc] == 0 && game.atloc[game.oldlc2] == 0 && game.holdng >
1) goto L40010;
goto L40020;
L40700: if(game.dflag == 0) goto L40010;
goto L40020;
-L40800: if(ATLOC[LOC] == 0 && ATLOC[game.oldloc] == 0 && ATLOC[game.oldlc2] == 0) goto
+L40800: if(game.atloc[LOC] == 0 && game.atloc[game.oldloc] == 0 && game.atloc[game.oldlc2] == 0) goto
L40010;
goto L40030;
JUGGLE(CHASM);
if(PROP[BEAR] != 3)DSTROY(BEAR);
PROP[CHAIN]=0;
- FIXED[CHAIN]=0;
+ game.fixed[CHAIN]=0;
PROP[AXE]=0;
- FIXED[AXE]=0;
+ game.fixed[AXE]=0;
RSPEAK(129);
game.clock1= -1;
game.closng=true;
PROP[PILLOW]=PUT(PILLOW,116,0);
PROP[MIRROR]=PUT(MIRROR,115,0);
- FIXED[MIRROR]=116;
+ game.fixed[MIRROR]=116;
for (I=1; I<=NOBJECTS; I++) {
if(TOTING(I))
L12200: if(game.lmwarn || !HERE(LAMP)) goto L19999;
game.lmwarn=true;
SPK=187;
- if(PLACE[BATTER] == 0)SPK=183;
+ if(game.place[BATTER] == 0)SPK=183;
if(PROP[BATTER] == 1)SPK=189;
RSPEAK(SPK);
goto L19999;
/* Juggle an object by picking it up and putting it down again, the purpose
* being to get the object to the front of the chain of things at its loc. */
- I=PLACE[OBJECT];
- J=FIXED[OBJECT];
+ I=game.place[OBJECT];
+ J=game.fixed[OBJECT];
MOVE(OBJECT,I);
MOVE(OBJECT+NOBJECTS,J);
return;
/* Place any object anywhere by picking it up and dropping it. May already be
* toting, in which case the carry is a no-op. Mustn't pick up objects which
- * are not at any loc, since carry wants to remove objects from ATLOC chains. */
+ * are not at any loc, since carry wants to remove objects from game.atloc chains. */
if(OBJECT > NOBJECTS) goto L1;
- FROM=PLACE[OBJECT];
+ FROM=game.place[OBJECT];
goto L2;
-L1: {long x = OBJECT-NOBJECTS; FROM=FIXED[x];}
+L1: {long x = OBJECT-NOBJECTS; FROM=game.fixed[x];}
L2: if(FROM > 0 && FROM <= 300)CARRY(OBJECT,FROM);
DROP(OBJECT,WHERE);
return;
/* 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 game.holdng. */
+ * (moving "fixed" second loc), don't change game.place or game.holdng. */
if(OBJECT > NOBJECTS) goto L5;
- if(PLACE[OBJECT] == -1)return;
- PLACE[OBJECT]= -1;
+ if(game.place[OBJECT] == -1)return;
+ game.place[OBJECT]= -1;
game.holdng=game.holdng+1;
-L5: if(ATLOC[WHERE] != OBJECT) goto L6;
- ATLOC[WHERE]=LINK[OBJECT];
+L5: if(game.atloc[WHERE] != OBJECT) goto L6;
+ game.atloc[WHERE]=game.link[OBJECT];
return;
-L6: TEMP=ATLOC[WHERE];
-L7: if(LINK[TEMP] == OBJECT) goto L8;
- TEMP=LINK[TEMP];
+L6: TEMP=game.atloc[WHERE];
+L7: if(game.link[TEMP] == OBJECT) goto L8;
+ TEMP=game.link[TEMP];
goto L7;
-L8: LINK[TEMP]=LINK[OBJECT];
+L8: game.link[TEMP]=game.link[OBJECT];
return;
}
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 game.atloc list. Decr
* game.holdng if the object was being toted. */
if(OBJECT > NOBJECTS) goto L1;
- if(PLACE[OBJECT] == -1)game.holdng=game.holdng-1;
- PLACE[OBJECT]=WHERE;
+ if(game.place[OBJECT] == -1)game.holdng=game.holdng-1;
+ game.place[OBJECT]=WHERE;
goto L2;
-L1: {long x = OBJECT-NOBJECTS; FIXED[x]=WHERE;}
+L1: {long x = OBJECT-NOBJECTS; game.fixed[x]=WHERE;}
L2: if(WHERE <= 0)return;
- LINK[OBJECT]=ATLOC[WHERE];
- ATLOC[WHERE]=OBJECT;
+ game.link[OBJECT]=game.atloc[WHERE];
+ game.atloc[WHERE]=OBJECT;
return;
}
if(I == CHEST)K=14;
if(I > CHEST)K=16;
if(PROP[I] >= 0)SCORE=SCORE+2;
- if(PLACE[I] == 3 && PROP[I] == 0)SCORE=SCORE+K-2;
+ if(game.place[I] == 3 && PROP[I] == 0)SCORE=SCORE+K-2;
MXSCOR=MXSCOR+K;
L20010: /*etc*/ ;
} /* end loop */
/* Did he come to Witt's End as he should? */
- if(PLACE[MAGZIN] == 108)SCORE=SCORE+1;
+ if(game.place[MAGZIN] == 108)SCORE=SCORE+1;
MXSCOR=MXSCOR+1;
/* Round it off. */
/* Deduct for hints/turns/saves. Hints < 4 are special; see database desc. */
for (I=1; I<=HNTMAX; I++) {
- if(HINTED[I])SCORE=SCORE-HINTS[I][2];
+ if(game.hinted[I])SCORE=SCORE-HINTS[I][2];
} /* end loop */
if(game.novice)SCORE=SCORE-5;
if(game.clshnt)SCORE=SCORE-10;
#define LOCSIZ 185
#define NOBJECTS 100
+#define HNTSIZ 20