Finish moving state arrays into game structure block.
This commit is contained in:
parent
3ba084480a
commit
2d95c3f4f5
9 changed files with 200 additions and 202 deletions
118
actions1.c
118
actions1.c
|
@ -127,10 +127,10 @@ L5100: if(K != GRATE) goto L5110;
|
||||||
if(K != GRATE) return(8);
|
if(K != GRATE) return(8);
|
||||||
L5110: if(K == DWARF && ATDWRF(LOC) > 0) goto L5010;
|
L5110: if(K == DWARF && ATDWRF(LOC) > 0) goto L5010;
|
||||||
if((LIQ(0) == K && HERE(BOTTLE)) || K == LIQLOC(LOC)) goto L5010;
|
if((LIQ(0) == K && HERE(BOTTLE)) || K == LIQLOC(LOC)) goto L5010;
|
||||||
if(OBJ != OIL || !HERE(URN) || PROP[URN] == 0) goto L5120;
|
if(OBJ != OIL || !HERE(URN) || game.prop[URN] == 0) goto L5120;
|
||||||
OBJ=URN;
|
OBJ=URN;
|
||||||
goto L5010;
|
goto L5010;
|
||||||
L5120: if(OBJ != PLANT || !AT(PLANT2) || PROP[PLANT2] == 0) goto L5130;
|
L5120: if(OBJ != PLANT || !AT(PLANT2) || game.prop[PLANT2] == 0) goto L5130;
|
||||||
OBJ=PLANT2;
|
OBJ=PLANT2;
|
||||||
goto L5010;
|
goto L5010;
|
||||||
L5130: if(OBJ != KNIFE || game.knfloc != LOC) goto L5140;
|
L5130: if(OBJ != KNIFE || game.knfloc != LOC) goto L5140;
|
||||||
|
@ -193,7 +193,7 @@ L8040: SPK=28;
|
||||||
|
|
||||||
L9040: if(OBJ == CLAM || OBJ == OYSTER) goto L9046;
|
L9040: if(OBJ == CLAM || OBJ == OYSTER) goto L9046;
|
||||||
if(OBJ == DOOR)SPK=111;
|
if(OBJ == DOOR)SPK=111;
|
||||||
if(OBJ == DOOR && PROP[DOOR] == 1)SPK=54;
|
if(OBJ == DOOR && game.prop[DOOR] == 1)SPK=54;
|
||||||
if(OBJ == CAGE)SPK=32;
|
if(OBJ == CAGE)SPK=32;
|
||||||
if(OBJ == KEYS)SPK=55;
|
if(OBJ == KEYS)SPK=55;
|
||||||
if(OBJ == GRATE || OBJ == CHAIN)SPK=31;
|
if(OBJ == GRATE || OBJ == CHAIN)SPK=31;
|
||||||
|
@ -205,10 +205,10 @@ L9040: if(OBJ == CLAM || OBJ == OYSTER) goto L9046;
|
||||||
game.panic=true;
|
game.panic=true;
|
||||||
return(2010);
|
return(2010);
|
||||||
|
|
||||||
L9043: K=34+PROP[GRATE];
|
L9043: K=34+game.prop[GRATE];
|
||||||
PROP[GRATE]=1;
|
game.prop[GRATE]=1;
|
||||||
if(VERB == LOCK)PROP[GRATE]=0;
|
if(VERB == LOCK)game.prop[GRATE]=0;
|
||||||
K=K+2*PROP[GRATE];
|
K=K+2*game.prop[GRATE];
|
||||||
return(2010);
|
return(2010);
|
||||||
|
|
||||||
/* Clam/Oyster. */
|
/* Clam/Oyster. */
|
||||||
|
@ -227,49 +227,49 @@ L9046: K=0;
|
||||||
/* Chain. */
|
/* Chain. */
|
||||||
L9048: if(VERB == LOCK) goto L9049;
|
L9048: if(VERB == LOCK) goto L9049;
|
||||||
SPK=171;
|
SPK=171;
|
||||||
if(PROP[BEAR] == 0)SPK=41;
|
if(game.prop[BEAR] == 0)SPK=41;
|
||||||
if(PROP[CHAIN] == 0)SPK=37;
|
if(game.prop[CHAIN] == 0)SPK=37;
|
||||||
if(SPK != 171) return(2011);
|
if(SPK != 171) return(2011);
|
||||||
PROP[CHAIN]=0;
|
game.prop[CHAIN]=0;
|
||||||
game.fixed[CHAIN]=0;
|
game.fixed[CHAIN]=0;
|
||||||
if(PROP[BEAR] != 3)PROP[BEAR]=2;
|
if(game.prop[BEAR] != 3)game.prop[BEAR]=2;
|
||||||
game.fixed[BEAR]=2-PROP[BEAR];
|
game.fixed[BEAR]=2-game.prop[BEAR];
|
||||||
return(2011);
|
return(2011);
|
||||||
|
|
||||||
L9049: SPK=172;
|
L9049: SPK=172;
|
||||||
if(PROP[CHAIN] != 0)SPK=34;
|
if(game.prop[CHAIN] != 0)SPK=34;
|
||||||
if(LOC != PLAC[CHAIN])SPK=173;
|
if(LOC != PLAC[CHAIN])SPK=173;
|
||||||
if(SPK != 172) return(2011);
|
if(SPK != 172) return(2011);
|
||||||
PROP[CHAIN]=2;
|
game.prop[CHAIN]=2;
|
||||||
if(TOTING(CHAIN))DROP(CHAIN,LOC);
|
if(TOTING(CHAIN))DROP(CHAIN,LOC);
|
||||||
game.fixed[CHAIN]= -1;
|
game.fixed[CHAIN]= -1;
|
||||||
return(2011);
|
return(2011);
|
||||||
|
|
||||||
/* Light. Applicable only to lamp and urn. */
|
/* Light. Applicable only to lamp and urn. */
|
||||||
|
|
||||||
L8070: if(HERE(LAMP) && PROP[LAMP] == 0 && game.limit >= 0)OBJ=LAMP;
|
L8070: if(HERE(LAMP) && game.prop[LAMP] == 0 && game.limit >= 0)OBJ=LAMP;
|
||||||
if(HERE(URN) && PROP[URN] == 1)OBJ=OBJ*NOBJECTS+URN;
|
if(HERE(URN) && game.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(game.limit < 0) return(2011);
|
if(game.limit < 0) return(2011);
|
||||||
PROP[LAMP]=1;
|
game.prop[LAMP]=1;
|
||||||
RSPEAK(39);
|
RSPEAK(39);
|
||||||
if(game.wzdark) return(2000);
|
if(game.wzdark) return(2000);
|
||||||
return(2012);
|
return(2012);
|
||||||
|
|
||||||
L9073: SPK=38;
|
L9073: SPK=38;
|
||||||
if(PROP[URN] == 0) return(2011);
|
if(game.prop[URN] == 0) return(2011);
|
||||||
SPK=209;
|
SPK=209;
|
||||||
PROP[URN]=2;
|
game.prop[URN]=2;
|
||||||
return(2011);
|
return(2011);
|
||||||
|
|
||||||
/* Extinguish. Lamp, urn, dragon/volcano (nice try). */
|
/* Extinguish. Lamp, urn, dragon/volcano (nice try). */
|
||||||
|
|
||||||
L8080: if(HERE(LAMP) && PROP[LAMP] == 1)OBJ=LAMP;
|
L8080: if(HERE(LAMP) && game.prop[LAMP] == 1)OBJ=LAMP;
|
||||||
if(HERE(URN) && PROP[URN] == 2)OBJ=OBJ*NOBJECTS+URN;
|
if(HERE(URN) && game.prop[URN] == 2)OBJ=OBJ*NOBJECTS+URN;
|
||||||
if(OBJ == 0 || OBJ > NOBJECTS) return(8000);
|
if(OBJ == 0 || OBJ > NOBJECTS) return(8000);
|
||||||
|
|
||||||
L9080: if(OBJ == URN) goto L9083;
|
L9080: if(OBJ == URN) goto L9083;
|
||||||
|
@ -277,11 +277,11 @@ L9080: if(OBJ == URN) goto L9083;
|
||||||
if(OBJ == DRAGON || OBJ == VOLCAN)SPK=146;
|
if(OBJ == DRAGON || OBJ == VOLCAN)SPK=146;
|
||||||
return(2011);
|
return(2011);
|
||||||
|
|
||||||
L9083: PROP[URN]=PROP[URN]/2;
|
L9083: game.prop[URN]=game.prop[URN]/2;
|
||||||
SPK=210;
|
SPK=210;
|
||||||
return(2011);
|
return(2011);
|
||||||
|
|
||||||
L9086: PROP[LAMP]=0;
|
L9086: game.prop[LAMP]=0;
|
||||||
RSPEAK(40);
|
RSPEAK(40);
|
||||||
if(DARK(0))RSPEAK(16);
|
if(DARK(0))RSPEAK(16);
|
||||||
return(2012);
|
return(2012);
|
||||||
|
@ -291,17 +291,17 @@ L9086: PROP[LAMP]=0;
|
||||||
L9090: if((!TOTING(OBJ)) && (OBJ != ROD || !TOTING(ROD2)))SPK=29;
|
L9090: if((!TOTING(OBJ)) && (OBJ != ROD || !TOTING(ROD2)))SPK=29;
|
||||||
if(OBJ != ROD || !TOTING(OBJ) || (!HERE(BIRD) && (game.closng || !AT(FISSUR))))
|
if(OBJ != ROD || !TOTING(OBJ) || (!HERE(BIRD) && (game.closng || !AT(FISSUR))))
|
||||||
return(2011);
|
return(2011);
|
||||||
if(HERE(BIRD))SPK=206+MOD(PROP[BIRD],2);
|
if(HERE(BIRD))SPK=206+MOD(game.prop[BIRD],2);
|
||||||
if(SPK == 206 && LOC == game.place[STEPS] && PROP[JADE] < 0) goto L9094;
|
if(SPK == 206 && LOC == game.place[STEPS] && game.prop[JADE] < 0) goto L9094;
|
||||||
if(game.closed) return(18999);
|
if(game.closed) return(18999);
|
||||||
if(game.closng || !AT(FISSUR)) return(2011);
|
if(game.closng || !AT(FISSUR)) return(2011);
|
||||||
if(HERE(BIRD))RSPEAK(SPK);
|
if(HERE(BIRD))RSPEAK(SPK);
|
||||||
PROP[FISSUR]=1-PROP[FISSUR];
|
game.prop[FISSUR]=1-game.prop[FISSUR];
|
||||||
PSPEAK(FISSUR,2-PROP[FISSUR]);
|
PSPEAK(FISSUR,2-game.prop[FISSUR]);
|
||||||
return(2012);
|
return(2012);
|
||||||
|
|
||||||
L9094: DROP(JADE,LOC);
|
L9094: DROP(JADE,LOC);
|
||||||
PROP[JADE]=0;
|
game.prop[JADE]=0;
|
||||||
game.tally=game.tally-1;
|
game.tally=game.tally-1;
|
||||||
SPK=208;
|
SPK=208;
|
||||||
return(2011);
|
return(2011);
|
||||||
|
@ -318,8 +318,8 @@ L9130: if(OBJ == BOTTLE || OBJ == 0)OBJ=LIQ(0);
|
||||||
if(!TOTING(OBJ)) return(2011);
|
if(!TOTING(OBJ)) return(2011);
|
||||||
SPK=78;
|
SPK=78;
|
||||||
if(OBJ != OIL && OBJ != WATER) return(2011);
|
if(OBJ != OIL && OBJ != WATER) return(2011);
|
||||||
if(HERE(URN) && PROP[URN] == 0) goto L9134;
|
if(HERE(URN) && game.prop[URN] == 0) goto L9134;
|
||||||
PROP[BOTTLE]=1;
|
game.prop[BOTTLE]=1;
|
||||||
game.place[OBJ]=0;
|
game.place[OBJ]=0;
|
||||||
SPK=77;
|
SPK=77;
|
||||||
if(!(AT(PLANT) || AT(DOOR))) return(2011);
|
if(!(AT(PLANT) || AT(DOOR))) return(2011);
|
||||||
|
@ -327,15 +327,15 @@ L9130: if(OBJ == BOTTLE || OBJ == 0)OBJ=LIQ(0);
|
||||||
if(AT(DOOR)) goto L9132;
|
if(AT(DOOR)) goto L9132;
|
||||||
SPK=112;
|
SPK=112;
|
||||||
if(OBJ != WATER) return(2011);
|
if(OBJ != WATER) return(2011);
|
||||||
PSPEAK(PLANT,PROP[PLANT]+3);
|
PSPEAK(PLANT,game.prop[PLANT]+3);
|
||||||
PROP[PLANT]=MOD(PROP[PLANT]+1,3);
|
game.prop[PLANT]=MOD(game.prop[PLANT]+1,3);
|
||||||
PROP[PLANT2]=PROP[PLANT];
|
game.prop[PLANT2]=game.prop[PLANT];
|
||||||
K=NUL;
|
K=NUL;
|
||||||
return(8);
|
return(8);
|
||||||
|
|
||||||
L9132: PROP[DOOR]=0;
|
L9132: game.prop[DOOR]=0;
|
||||||
if(OBJ == OIL)PROP[DOOR]=1;
|
if(OBJ == OIL)game.prop[DOOR]=1;
|
||||||
SPK=113+PROP[DOOR];
|
SPK=113+game.prop[DOOR];
|
||||||
return(2011);
|
return(2011);
|
||||||
|
|
||||||
L9134: OBJ=URN;
|
L9134: OBJ=URN;
|
||||||
|
@ -363,13 +363,13 @@ L9150: if(OBJ == 0 && LIQLOC(LOC) != WATER && (LIQ(0) != WATER || !HERE(BOTTLE))
|
||||||
if(OBJ == BLOOD) goto L9153;
|
if(OBJ == BLOOD) goto L9153;
|
||||||
if(OBJ != 0 && OBJ != WATER)SPK=110;
|
if(OBJ != 0 && OBJ != WATER)SPK=110;
|
||||||
if(SPK == 110 || LIQ(0) != WATER || !HERE(BOTTLE)) return(2011);
|
if(SPK == 110 || LIQ(0) != WATER || !HERE(BOTTLE)) return(2011);
|
||||||
PROP[BOTTLE]=1;
|
game.prop[BOTTLE]=1;
|
||||||
game.place[WATER]=0;
|
game.place[WATER]=0;
|
||||||
SPK=74;
|
SPK=74;
|
||||||
return(2011);
|
return(2011);
|
||||||
|
|
||||||
L9153: DSTROY(BLOOD);
|
L9153: DSTROY(BLOOD);
|
||||||
PROP[DRAGON]=2;
|
game.prop[DRAGON]=2;
|
||||||
OBJSND[BIRD]=OBJSND[BIRD]+3;
|
OBJSND[BIRD]=OBJSND[BIRD]+3;
|
||||||
SPK=240;
|
SPK=240;
|
||||||
return(2011);
|
return(2011);
|
||||||
|
@ -377,10 +377,10 @@ L9153: DSTROY(BLOOD);
|
||||||
/* Rub. Yields various snide remarks except for lit urn. */
|
/* Rub. Yields various snide remarks except for lit urn. */
|
||||||
|
|
||||||
L9160: if(OBJ != LAMP)SPK=76;
|
L9160: if(OBJ != LAMP)SPK=76;
|
||||||
if(OBJ != URN || PROP[URN] != 2) return(2011);
|
if(OBJ != URN || game.prop[URN] != 2) return(2011);
|
||||||
DSTROY(URN);
|
DSTROY(URN);
|
||||||
DROP(AMBER,LOC);
|
DROP(AMBER,LOC);
|
||||||
PROP[AMBER]=1;
|
game.prop[AMBER]=1;
|
||||||
game.tally=game.tally-1;
|
game.tally=game.tally-1;
|
||||||
DROP(CAVITY,LOC);
|
DROP(CAVITY,LOC);
|
||||||
SPK=216;
|
SPK=216;
|
||||||
|
@ -425,7 +425,7 @@ L9220: return(fill());
|
||||||
|
|
||||||
/* Blast. No effect unless you've got dynamite, which is a neat trick! */
|
/* Blast. No effect unless you've got dynamite, which is a neat trick! */
|
||||||
|
|
||||||
L9230: if(PROP[ROD2] < 0 || !game.closed) return(2011);
|
L9230: if(game.prop[ROD2] < 0 || !game.closed) return(2011);
|
||||||
game.bonus=133;
|
game.bonus=133;
|
||||||
if(LOC == 115)game.bonus=134;
|
if(LOC == 115)game.bonus=134;
|
||||||
if(HERE(ROD2))game.bonus=135;
|
if(HERE(ROD2))game.bonus=135;
|
||||||
|
@ -440,7 +440,7 @@ L8240: score(-1);
|
||||||
RSPEAK(259);
|
RSPEAK(259);
|
||||||
return(2012);
|
return(2012);
|
||||||
|
|
||||||
/* FEE FIE FOE FOO (AND FUM). ADVANCE TO NEXT STATE IF GIVEN IN PROPER ORDER.
|
/* FEE FIE FOE FOO (AND FUM). ADVANCE TO NEXT STATE IF GIVEN IN game.propER ORDER.
|
||||||
* LOOK UP WD1 IN SECTION 3 OF VOCAB TO DETERMINE WHICH WORD WE'VE GOT. LAST
|
* LOOK UP WD1 IN SECTION 3 OF VOCAB TO DETERMINE WHICH WORD WE'VE GOT. LAST
|
||||||
* WORD ZIPS THE EGGS BACK TO THE GIANT ROOM (UNLESS ALREADY THERE). */
|
* WORD ZIPS THE EGGS BACK TO THE GIANT ROOM (UNLESS ALREADY THERE). */
|
||||||
|
|
||||||
|
@ -456,8 +456,8 @@ L8252: game.foobar=K;
|
||||||
if(game.place[EGGS] == PLAC[EGGS] || (TOTING(EGGS) && LOC == PLAC[EGGS]))
|
if(game.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. */
|
||||||
if(game.place[EGGS] == 0 && game.place[TROLL] == 0 && PROP[TROLL] ==
|
if(game.place[EGGS] == 0 && game.place[TROLL] == 0 && game.prop[TROLL] ==
|
||||||
0)PROP[TROLL]=1;
|
0)game.prop[TROLL]=1;
|
||||||
K=2;
|
K=2;
|
||||||
if(HERE(EGGS))K=1;
|
if(HERE(EGGS))K=1;
|
||||||
if(LOC == PLAC[EGGS])K=0;
|
if(LOC == PLAC[EGGS])K=0;
|
||||||
|
@ -475,14 +475,14 @@ L8260: SPK=156;
|
||||||
/* Read. Print stuff based on objtxt. Oyster (?) is special case. */
|
/* Read. Print stuff based on objtxt. Oyster (?) is special case. */
|
||||||
|
|
||||||
L8270: for (I=1; I<=NOBJECTS; I++) {
|
L8270: for (I=1; I<=NOBJECTS; I++) {
|
||||||
if(HERE(I) && OBJTXT[I] != 0 && PROP[I] >= 0)OBJ=OBJ*NOBJECTS+I;
|
if(HERE(I) && OBJTXT[I] != 0 && game.prop[I] >= 0)OBJ=OBJ*NOBJECTS+I;
|
||||||
} /* end loop */
|
} /* end loop */
|
||||||
if(OBJ > NOBJECTS || OBJ == 0 || DARK(0)) return(8000);
|
if(OBJ > NOBJECTS || OBJ == 0 || DARK(0)) return(8000);
|
||||||
|
|
||||||
L9270: if(DARK(0)) goto L5190;
|
L9270: if(DARK(0)) goto L5190;
|
||||||
if(OBJTXT[OBJ] == 0 || PROP[OBJ] < 0) return(2011);
|
if(OBJTXT[OBJ] == 0 || game.prop[OBJ] < 0) return(2011);
|
||||||
if(OBJ == OYSTER && !game.clshnt) goto L9275;
|
if(OBJ == OYSTER && !game.clshnt) goto L9275;
|
||||||
PSPEAK(OBJ,OBJTXT[OBJ]+PROP[OBJ]);
|
PSPEAK(OBJ,OBJTXT[OBJ]+game.prop[OBJ]);
|
||||||
return(2012);
|
return(2012);
|
||||||
|
|
||||||
L9275: game.clshnt=YES(input,192,193,54);
|
L9275: game.clshnt=YES(input,192,193,54);
|
||||||
|
@ -491,14 +491,14 @@ L9275: game.clshnt=YES(input,192,193,54);
|
||||||
/* Break. Only works for mirror in repository and, of course, the vase. */
|
/* Break. Only works for mirror in repository and, of course, the vase. */
|
||||||
|
|
||||||
L9280: if(OBJ == MIRROR)SPK=148;
|
L9280: if(OBJ == MIRROR)SPK=148;
|
||||||
if(OBJ == VASE && PROP[VASE] == 0) goto L9282;
|
if(OBJ == VASE && game.prop[VASE] == 0) goto L9282;
|
||||||
if(OBJ != MIRROR || !game.closed) return(2011);
|
if(OBJ != MIRROR || !game.closed) return(2011);
|
||||||
SPK=197;
|
SPK=197;
|
||||||
return(18999);
|
return(18999);
|
||||||
|
|
||||||
L9282: SPK=198;
|
L9282: SPK=198;
|
||||||
if(TOTING(VASE))DROP(VASE,LOC);
|
if(TOTING(VASE))DROP(VASE,LOC);
|
||||||
PROP[VASE]=2;
|
game.prop[VASE]=2;
|
||||||
game.fixed[VASE]= -1;
|
game.fixed[VASE]= -1;
|
||||||
return(2011);
|
return(2011);
|
||||||
|
|
||||||
|
@ -546,11 +546,11 @@ L8305: DATIME(&I,&K);
|
||||||
SAVARR(game.dseen,NDWARVES);
|
SAVARR(game.dseen,NDWARVES);
|
||||||
SAVARR(game.fixed,NOBJECTS);
|
SAVARR(game.fixed,NOBJECTS);
|
||||||
SAVARR(game.hinted,HNTSIZ);
|
SAVARR(game.hinted,HNTSIZ);
|
||||||
SAVARR(HINTLC,HNTSIZ);
|
SAVARR(game.hintlc,HNTSIZ);
|
||||||
SAVARR(game.link,NOBJECTS*2);
|
SAVARR(game.link,NOBJECTS*2);
|
||||||
SAVARR(game.odloc,NDWARVES);
|
SAVARR(game.odloc,NDWARVES);
|
||||||
SAVARR(game.place,NOBJECTS);
|
SAVARR(game.place,NOBJECTS);
|
||||||
SAVARR(PROP,NOBJECTS);
|
SAVARR(game.prop,NOBJECTS);
|
||||||
SAVWRD(KK,K);
|
SAVWRD(KK,K);
|
||||||
if(K != 0) goto L8318;
|
if(K != 0) goto L8318;
|
||||||
K=NUL;
|
K=NUL;
|
||||||
|
@ -577,19 +577,19 @@ L8318: RSPEAK(270);
|
||||||
|
|
||||||
/* Fly. Snide remarks unless hovering rug is here. */
|
/* Fly. Snide remarks unless hovering rug is here. */
|
||||||
|
|
||||||
L8320: if(PROP[RUG] != 2)SPK=224;
|
L8320: if(game.prop[RUG] != 2)SPK=224;
|
||||||
if(!HERE(RUG))SPK=225;
|
if(!HERE(RUG))SPK=225;
|
||||||
if(SPK/2 == 112) return(2011);
|
if(SPK/2 == 112) return(2011);
|
||||||
OBJ=RUG;
|
OBJ=RUG;
|
||||||
|
|
||||||
L9320: if(OBJ != RUG) return(2011);
|
L9320: if(OBJ != RUG) return(2011);
|
||||||
SPK=223;
|
SPK=223;
|
||||||
if(PROP[RUG] != 2) return(2011);
|
if(game.prop[RUG] != 2) return(2011);
|
||||||
game.oldlc2=game.oldloc;
|
game.oldlc2=game.oldloc;
|
||||||
game.oldloc=LOC;
|
game.oldloc=LOC;
|
||||||
game.newloc=game.place[RUG]+game.fixed[RUG]-LOC;
|
game.newloc=game.place[RUG]+game.fixed[RUG]-LOC;
|
||||||
SPK=226;
|
SPK=226;
|
||||||
if(PROP[SAPPH] >= 0)SPK=227;
|
if(game.prop[SAPPH] >= 0)SPK=227;
|
||||||
RSPEAK(SPK);
|
RSPEAK(SPK);
|
||||||
return(2);
|
return(2);
|
||||||
|
|
||||||
|
@ -603,10 +603,10 @@ L8330: SPK=228;
|
||||||
SPK=0;
|
SPK=0;
|
||||||
L8332: SETPRM(1,game.zzword,0);
|
L8332: SETPRM(1,game.zzword,0);
|
||||||
/* 8335 */ for (I=1; I<=NOBJECTS; I++) {
|
/* 8335 */ for (I=1; I<=NOBJECTS; I++) {
|
||||||
if(!HERE(I) || OBJSND[I] == 0 || PROP[I] < 0) goto L8335;
|
if(!HERE(I) || OBJSND[I] == 0 || game.prop[I] < 0) goto L8335;
|
||||||
PSPEAK(I,OBJSND[I]+PROP[I]);
|
PSPEAK(I,OBJSND[I]+game.prop[I]);
|
||||||
SPK=0;
|
SPK=0;
|
||||||
if(I == BIRD && OBJSND[I]+PROP[I] == 8)DSTROY(BIRD);
|
if(I == BIRD && OBJSND[I]+game.prop[I] == 8)DSTROY(BIRD);
|
||||||
L8335: /*etc*/ ;
|
L8335: /*etc*/ ;
|
||||||
} /* end loop */
|
} /* end loop */
|
||||||
return(2011);
|
return(2011);
|
||||||
|
@ -614,8 +614,8 @@ L8335: /*etc*/ ;
|
||||||
/* Z'ZZZ (word gets recomputed at startup; different each game). */
|
/* Z'ZZZ (word gets recomputed at startup; different each game). */
|
||||||
|
|
||||||
L8340: if(!AT(RESER) && LOC != game.fixed[RESER]-1) return(2011);
|
L8340: if(!AT(RESER) && LOC != game.fixed[RESER]-1) return(2011);
|
||||||
PSPEAK(RESER,PROP[RESER]+1);
|
PSPEAK(RESER,game.prop[RESER]+1);
|
||||||
PROP[RESER]=1-PROP[RESER];
|
game.prop[RESER]=1-game.prop[RESER];
|
||||||
if(AT(RESER)) return(2012);
|
if(AT(RESER)) return(2012);
|
||||||
game.oldlc2=LOC;
|
game.oldlc2=LOC;
|
||||||
game.newloc=0;
|
game.newloc=0;
|
||||||
|
|
116
actions2.c
116
actions2.c
|
@ -8,13 +8,13 @@
|
||||||
int carry(void) {
|
int carry(void) {
|
||||||
if(TOTING(OBJ)) return(2011);
|
if(TOTING(OBJ)) return(2011);
|
||||||
SPK=25;
|
SPK=25;
|
||||||
if(OBJ == PLANT && PROP[PLANT] <= 0)SPK=115;
|
if(OBJ == PLANT && game.prop[PLANT] <= 0)SPK=115;
|
||||||
if(OBJ == BEAR && PROP[BEAR] == 1)SPK=169;
|
if(OBJ == BEAR && game.prop[BEAR] == 1)SPK=169;
|
||||||
if(OBJ == CHAIN && PROP[BEAR] != 0)SPK=170;
|
if(OBJ == CHAIN && game.prop[BEAR] != 0)SPK=170;
|
||||||
if(OBJ == URN)SPK=215;
|
if(OBJ == URN)SPK=215;
|
||||||
if(OBJ == CAVITY)SPK=217;
|
if(OBJ == CAVITY)SPK=217;
|
||||||
if(OBJ == BLOOD)SPK=239;
|
if(OBJ == BLOOD)SPK=239;
|
||||||
if(OBJ == RUG && PROP[RUG] == 2)SPK=222;
|
if(OBJ == RUG && game.prop[RUG] == 2)SPK=222;
|
||||||
if(OBJ == SIGN)SPK=196;
|
if(OBJ == SIGN)SPK=196;
|
||||||
if(OBJ != MESSAG) goto L9011;
|
if(OBJ != MESSAG) goto L9011;
|
||||||
SPK=190;
|
SPK=190;
|
||||||
|
@ -24,26 +24,26 @@ L9011: if(game.fixed[OBJ] != 0) return(2011);
|
||||||
K=OBJ;
|
K=OBJ;
|
||||||
OBJ=BOTTLE;
|
OBJ=BOTTLE;
|
||||||
if(HERE(BOTTLE) && LIQ(0) == K) goto L9017;
|
if(HERE(BOTTLE) && LIQ(0) == K) goto L9017;
|
||||||
if(TOTING(BOTTLE) && PROP[BOTTLE] == 1) return(fill());
|
if(TOTING(BOTTLE) && game.prop[BOTTLE] == 1) return(fill());
|
||||||
if(PROP[BOTTLE] != 1)SPK=105;
|
if(game.prop[BOTTLE] != 1)SPK=105;
|
||||||
if(!TOTING(BOTTLE))SPK=104;
|
if(!TOTING(BOTTLE))SPK=104;
|
||||||
return(2011);
|
return(2011);
|
||||||
L9017: SPK=92;
|
L9017: SPK=92;
|
||||||
if(game.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 || game.prop[BIRD] == 1 || -1-game.prop[BIRD] == 1) goto L9014;
|
||||||
if(PROP[BIRD] == 2) goto L9015;
|
if(game.prop[BIRD] == 2) goto L9015;
|
||||||
if(!TOTING(CAGE))SPK=27;
|
if(!TOTING(CAGE))SPK=27;
|
||||||
if(TOTING(ROD))SPK=26;
|
if(TOTING(ROD))SPK=26;
|
||||||
if(SPK/2 == 13) return(2011);
|
if(SPK/2 == 13) return(2011);
|
||||||
PROP[BIRD]=1;
|
game.prop[BIRD]=1;
|
||||||
L9014: if((OBJ == BIRD || OBJ == CAGE) && (PROP[BIRD] == 1 || -1-PROP[BIRD] ==
|
L9014: if((OBJ == BIRD || OBJ == CAGE) && (game.prop[BIRD] == 1 || -1-game.prop[BIRD] ==
|
||||||
1))CARRY(BIRD+CAGE-OBJ,LOC);
|
1))CARRY(BIRD+CAGE-OBJ,LOC);
|
||||||
CARRY(OBJ,LOC);
|
CARRY(OBJ,LOC);
|
||||||
K=LIQ(0);
|
K=LIQ(0);
|
||||||
if(OBJ == BOTTLE && K != 0)game.place[K]= -1;
|
if(OBJ == BOTTLE && K != 0)game.place[K]= -1;
|
||||||
if(!GSTONE(OBJ) || PROP[OBJ] == 0) return(2009);
|
if(!GSTONE(OBJ) || game.prop[OBJ] == 0) return(2009);
|
||||||
PROP[OBJ]=0;
|
game.prop[OBJ]=0;
|
||||||
PROP[CAVITY]=1;
|
game.prop[CAVITY]=1;
|
||||||
return(2009);
|
return(2009);
|
||||||
|
|
||||||
L9015: SPK=238;
|
L9015: SPK=238;
|
||||||
|
@ -63,31 +63,31 @@ int discard(bool just_do_it) {
|
||||||
RSPEAK(30);
|
RSPEAK(30);
|
||||||
if(game.closed) return(19000);
|
if(game.closed) return(19000);
|
||||||
DSTROY(SNAKE);
|
DSTROY(SNAKE);
|
||||||
/* SET PROP FOR USE BY TRAVEL OPTIONS */
|
/* SET game.prop FOR USE BY TRAVEL OPTIONS */
|
||||||
PROP[SNAKE]=1;
|
game.prop[SNAKE]=1;
|
||||||
L9021: K=LIQ(0);
|
L9021: K=LIQ(0);
|
||||||
if(K == OBJ)OBJ=BOTTLE;
|
if(K == OBJ)OBJ=BOTTLE;
|
||||||
if(OBJ == BOTTLE && K != 0)game.place[K]=0;
|
if(OBJ == BOTTLE && K != 0)game.place[K]=0;
|
||||||
if(OBJ == CAGE && PROP[BIRD] == 1)DROP(BIRD,LOC);
|
if(OBJ == CAGE && game.prop[BIRD] == 1)DROP(BIRD,LOC);
|
||||||
DROP(OBJ,LOC);
|
DROP(OBJ,LOC);
|
||||||
if(OBJ != BIRD) return(2012);
|
if(OBJ != BIRD) return(2012);
|
||||||
PROP[BIRD]=0;
|
game.prop[BIRD]=0;
|
||||||
if(FOREST(LOC))PROP[BIRD]=2;
|
if(FOREST(LOC))game.prop[BIRD]=2;
|
||||||
return(2012);
|
return(2012);
|
||||||
|
|
||||||
L9023: if(!(GSTONE(OBJ) && AT(CAVITY) && PROP[CAVITY] != 0)) goto L9024;
|
L9023: if(!(GSTONE(OBJ) && AT(CAVITY) && game.prop[CAVITY] != 0)) goto L9024;
|
||||||
RSPEAK(218);
|
RSPEAK(218);
|
||||||
PROP[OBJ]=1;
|
game.prop[OBJ]=1;
|
||||||
PROP[CAVITY]=0;
|
game.prop[CAVITY]=0;
|
||||||
if(!HERE(RUG) || !((OBJ == EMRALD && PROP[RUG] != 2) || (OBJ == RUBY &&
|
if(!HERE(RUG) || !((OBJ == EMRALD && game.prop[RUG] != 2) || (OBJ == RUBY &&
|
||||||
PROP[RUG] == 2))) goto L9021;
|
game.prop[RUG] == 2))) goto L9021;
|
||||||
SPK=219;
|
SPK=219;
|
||||||
if(TOTING(RUG))SPK=220;
|
if(TOTING(RUG))SPK=220;
|
||||||
if(OBJ == RUBY)SPK=221;
|
if(OBJ == RUBY)SPK=221;
|
||||||
RSPEAK(SPK);
|
RSPEAK(SPK);
|
||||||
if(SPK == 220) goto L9021;
|
if(SPK == 220) goto L9021;
|
||||||
K=2-PROP[RUG];
|
K=2-game.prop[RUG];
|
||||||
PROP[RUG]=K;
|
game.prop[RUG]=K;
|
||||||
if(K == 2)K=PLAC[SAPPH];
|
if(K == 2)K=PLAC[SAPPH];
|
||||||
MOVE(RUG+NOBJECTS,K);
|
MOVE(RUG+NOBJECTS,K);
|
||||||
goto L9021;
|
goto L9021;
|
||||||
|
@ -98,10 +98,10 @@ L9024: if(OBJ != COINS || !HERE(VEND)) goto L9025;
|
||||||
PSPEAK(BATTER,0);
|
PSPEAK(BATTER,0);
|
||||||
return(2012);
|
return(2012);
|
||||||
|
|
||||||
L9025: if(OBJ != BIRD || !AT(DRAGON) || PROP[DRAGON] != 0) goto L9026;
|
L9025: if(OBJ != BIRD || !AT(DRAGON) || game.prop[DRAGON] != 0) goto L9026;
|
||||||
RSPEAK(154);
|
RSPEAK(154);
|
||||||
DSTROY(BIRD);
|
DSTROY(BIRD);
|
||||||
PROP[BIRD]=0;
|
game.prop[BIRD]=0;
|
||||||
return(2012);
|
return(2012);
|
||||||
|
|
||||||
L9026: if(OBJ != BEAR || !AT(TROLL)) goto L9027;
|
L9026: if(OBJ != BEAR || !AT(TROLL)) goto L9027;
|
||||||
|
@ -111,17 +111,17 @@ L9026: if(OBJ != BEAR || !AT(TROLL)) goto L9027;
|
||||||
MOVE(TROLL2,PLAC[TROLL]);
|
MOVE(TROLL2,PLAC[TROLL]);
|
||||||
MOVE(TROLL2+NOBJECTS,FIXD[TROLL]);
|
MOVE(TROLL2+NOBJECTS,FIXD[TROLL]);
|
||||||
JUGGLE(CHASM);
|
JUGGLE(CHASM);
|
||||||
PROP[TROLL]=2;
|
game.prop[TROLL]=2;
|
||||||
goto L9021;
|
goto L9021;
|
||||||
|
|
||||||
L9027: if(OBJ == VASE && LOC != PLAC[PILLOW]) goto L9028;
|
L9027: if(OBJ == VASE && LOC != PLAC[PILLOW]) goto L9028;
|
||||||
RSPEAK(54);
|
RSPEAK(54);
|
||||||
goto L9021;
|
goto L9021;
|
||||||
|
|
||||||
L9028: PROP[VASE]=2;
|
L9028: game.prop[VASE]=2;
|
||||||
if(AT(PILLOW))PROP[VASE]=0;
|
if(AT(PILLOW))game.prop[VASE]=0;
|
||||||
PSPEAK(VASE,PROP[VASE]+1);
|
PSPEAK(VASE,game.prop[VASE]+1);
|
||||||
if(PROP[VASE] != 0)game.fixed[VASE]= -1;
|
if(game.prop[VASE] != 0)game.fixed[VASE]= -1;
|
||||||
goto L9021;
|
goto L9021;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,10 +134,10 @@ int attack(FILE *input) {
|
||||||
if(OBJ != 0) goto L9124;
|
if(OBJ != 0) goto L9124;
|
||||||
if(I > 0)OBJ=DWARF;
|
if(I > 0)OBJ=DWARF;
|
||||||
if(HERE(SNAKE))OBJ=OBJ*NOBJECTS+SNAKE;
|
if(HERE(SNAKE))OBJ=OBJ*NOBJECTS+SNAKE;
|
||||||
if(AT(DRAGON) && PROP[DRAGON] == 0)OBJ=OBJ*NOBJECTS+DRAGON;
|
if(AT(DRAGON) && game.prop[DRAGON] == 0)OBJ=OBJ*NOBJECTS+DRAGON;
|
||||||
if(AT(TROLL))OBJ=OBJ*NOBJECTS+TROLL;
|
if(AT(TROLL))OBJ=OBJ*NOBJECTS+TROLL;
|
||||||
if(AT(OGRE))OBJ=OBJ*NOBJECTS+OGRE;
|
if(AT(OGRE))OBJ=OBJ*NOBJECTS+OGRE;
|
||||||
if(HERE(BEAR) && PROP[BEAR] == 0)OBJ=OBJ*NOBJECTS+BEAR;
|
if(HERE(BEAR) && game.prop[BEAR] == 0)OBJ=OBJ*NOBJECTS+BEAR;
|
||||||
if(OBJ > NOBJECTS) return(8000);
|
if(OBJ > NOBJECTS) return(8000);
|
||||||
if(OBJ != 0) goto L9124;
|
if(OBJ != 0) goto L9124;
|
||||||
/* CAN'T ATTACK BIRD OR MACHINE BY THROWING AXE. */
|
/* CAN'T ATTACK BIRD OR MACHINE BY THROWING AXE. */
|
||||||
|
@ -150,12 +150,12 @@ L9124: if(OBJ == BIRD) {
|
||||||
SPK=137;
|
SPK=137;
|
||||||
if(game.closed) return(2011);
|
if(game.closed) return(2011);
|
||||||
DSTROY(BIRD);
|
DSTROY(BIRD);
|
||||||
PROP[BIRD]=0;
|
game.prop[BIRD]=0;
|
||||||
SPK=45;
|
SPK=45;
|
||||||
}
|
}
|
||||||
L9125: if(OBJ != VEND) goto L9126;
|
L9125: if(OBJ != VEND) goto L9126;
|
||||||
PSPEAK(VEND,PROP[VEND]+2);
|
PSPEAK(VEND,game.prop[VEND]+2);
|
||||||
PROP[VEND]=3-PROP[VEND];
|
game.prop[VEND]=3-game.prop[VEND];
|
||||||
return(2012);
|
return(2012);
|
||||||
|
|
||||||
L9126: if(OBJ == 0)SPK=44;
|
L9126: if(OBJ == 0)SPK=44;
|
||||||
|
@ -167,9 +167,9 @@ L9126: if(OBJ == 0)SPK=44;
|
||||||
if(OBJ == TROLL)SPK=157;
|
if(OBJ == TROLL)SPK=157;
|
||||||
if(OBJ == OGRE)SPK=203;
|
if(OBJ == OGRE)SPK=203;
|
||||||
if(OBJ == OGRE && I > 0) goto L9128;
|
if(OBJ == OGRE && I > 0) goto L9128;
|
||||||
if(OBJ == BEAR)SPK=165+(PROP[BEAR]+1)/2;
|
if(OBJ == BEAR)SPK=165+(game.prop[BEAR]+1)/2;
|
||||||
if(OBJ != DRAGON || PROP[DRAGON] != 0) return(2011);
|
if(OBJ != DRAGON || game.prop[DRAGON] != 0) return(2011);
|
||||||
/* Fun stuff for dragon. If he insists on attacking it, win! Set PROP to dead,
|
/* Fun stuff for dragon. If he insists on attacking it, win! Set game.prop to dead,
|
||||||
* move dragon to central loc (still fixed), move rug there (not fixed), and
|
* move dragon to central loc (still fixed), move rug there (not fixed), and
|
||||||
* move him there, too. Then do a null motion to get new description. */
|
* move him there, too. Then do a null motion to get new description. */
|
||||||
RSPEAK(49);
|
RSPEAK(49);
|
||||||
|
@ -178,8 +178,8 @@ L9126: if(OBJ == 0)SPK=44;
|
||||||
GETIN(input,WD1,WD1X,WD2,WD2X);
|
GETIN(input,WD1,WD1X,WD2,WD2X);
|
||||||
if(WD1 != MAKEWD(25) && WD1 != MAKEWD(250519)) return(2607);
|
if(WD1 != MAKEWD(25) && WD1 != MAKEWD(250519)) return(2607);
|
||||||
PSPEAK(DRAGON,3);
|
PSPEAK(DRAGON,3);
|
||||||
PROP[DRAGON]=1;
|
game.prop[DRAGON]=1;
|
||||||
PROP[RUG]=0;
|
game.prop[RUG]=0;
|
||||||
K=(PLAC[DRAGON]+FIXD[DRAGON])/2;
|
K=(PLAC[DRAGON]+FIXD[DRAGON])/2;
|
||||||
MOVE(DRAGON+NOBJECTS,-1);
|
MOVE(DRAGON+NOBJECTS,-1);
|
||||||
MOVE(RUG+NOBJECTS,0);
|
MOVE(RUG+NOBJECTS,0);
|
||||||
|
@ -222,12 +222,12 @@ int throw(FILE *cmdin) {
|
||||||
I=ATDWRF(LOC);
|
I=ATDWRF(LOC);
|
||||||
if(I > 0) goto L9172;
|
if(I > 0) goto L9172;
|
||||||
SPK=152;
|
SPK=152;
|
||||||
if(AT(DRAGON) && PROP[DRAGON] == 0) goto L9175;
|
if(AT(DRAGON) && game.prop[DRAGON] == 0) goto L9175;
|
||||||
SPK=158;
|
SPK=158;
|
||||||
if(AT(TROLL)) goto L9175;
|
if(AT(TROLL)) goto L9175;
|
||||||
SPK=203;
|
SPK=203;
|
||||||
if(AT(OGRE)) goto L9175;
|
if(AT(OGRE)) goto L9175;
|
||||||
if(HERE(BEAR) && PROP[BEAR] == 0) goto L9176;
|
if(HERE(BEAR) && game.prop[BEAR] == 0) goto L9176;
|
||||||
OBJ=0;
|
OBJ=0;
|
||||||
return(attack(cmdin));
|
return(attack(cmdin));
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ L9175: RSPEAK(SPK);
|
||||||
L9176: SPK=164;
|
L9176: SPK=164;
|
||||||
DROP(AXE,LOC);
|
DROP(AXE,LOC);
|
||||||
game.fixed[AXE]= -1;
|
game.fixed[AXE]= -1;
|
||||||
PROP[AXE]=1;
|
game.prop[AXE]=1;
|
||||||
JUGGLE(BEAR);
|
JUGGLE(BEAR);
|
||||||
return(2011);
|
return(2011);
|
||||||
|
|
||||||
|
@ -276,12 +276,12 @@ int feed() {
|
||||||
|
|
||||||
L9212: if(OBJ != SNAKE && OBJ != DRAGON && OBJ != TROLL) goto L9213;
|
L9212: if(OBJ != SNAKE && OBJ != DRAGON && OBJ != TROLL) goto L9213;
|
||||||
SPK=102;
|
SPK=102;
|
||||||
if(OBJ == DRAGON && PROP[DRAGON] != 0)SPK=110;
|
if(OBJ == DRAGON && game.prop[DRAGON] != 0)SPK=110;
|
||||||
if(OBJ == TROLL)SPK=182;
|
if(OBJ == TROLL)SPK=182;
|
||||||
if(OBJ != SNAKE || game.closed || !HERE(BIRD)) return(2011);
|
if(OBJ != SNAKE || game.closed || !HERE(BIRD)) return(2011);
|
||||||
SPK=101;
|
SPK=101;
|
||||||
DSTROY(BIRD);
|
DSTROY(BIRD);
|
||||||
PROP[BIRD]=0;
|
game.prop[BIRD]=0;
|
||||||
return(2011);
|
return(2011);
|
||||||
|
|
||||||
L9213: if(OBJ != DWARF) goto L9214;
|
L9213: if(OBJ != DWARF) goto L9214;
|
||||||
|
@ -291,13 +291,13 @@ L9213: if(OBJ != DWARF) goto L9214;
|
||||||
return(2011);
|
return(2011);
|
||||||
|
|
||||||
L9214: if(OBJ != BEAR) goto L9215;
|
L9214: if(OBJ != BEAR) goto L9215;
|
||||||
if(PROP[BEAR] == 0)SPK=102;
|
if(game.prop[BEAR] == 0)SPK=102;
|
||||||
if(PROP[BEAR] == 3)SPK=110;
|
if(game.prop[BEAR] == 3)SPK=110;
|
||||||
if(!HERE(FOOD)) return(2011);
|
if(!HERE(FOOD)) return(2011);
|
||||||
DSTROY(FOOD);
|
DSTROY(FOOD);
|
||||||
PROP[BEAR]=1;
|
game.prop[BEAR]=1;
|
||||||
game.fixed[AXE]=0;
|
game.fixed[AXE]=0;
|
||||||
PROP[AXE]=0;
|
game.prop[AXE]=0;
|
||||||
SPK=168;
|
SPK=168;
|
||||||
return(2011);
|
return(2011);
|
||||||
|
|
||||||
|
@ -318,10 +318,10 @@ int fill() {
|
||||||
if(OBJ == 0 && !HERE(BOTTLE)) return(8000);
|
if(OBJ == 0 && !HERE(BOTTLE)) return(8000);
|
||||||
SPK=107;
|
SPK=107;
|
||||||
if(LIQLOC(LOC) == 0)SPK=106;
|
if(LIQLOC(LOC) == 0)SPK=106;
|
||||||
if(HERE(URN) && PROP[URN] != 0)SPK=214;
|
if(HERE(URN) && game.prop[URN] != 0)SPK=214;
|
||||||
if(LIQ(0) != 0)SPK=105;
|
if(LIQ(0) != 0)SPK=105;
|
||||||
if(SPK != 107) return(2011);
|
if(SPK != 107) return(2011);
|
||||||
PROP[BOTTLE]=MOD(COND[LOC],4)/2*2;
|
game.prop[BOTTLE]=MOD(COND[LOC],4)/2*2;
|
||||||
K=LIQ(0);
|
K=LIQ(0);
|
||||||
if(TOTING(BOTTLE))game.place[K]= -1;
|
if(TOTING(BOTTLE))game.place[K]= -1;
|
||||||
if(K == OIL)SPK=108;
|
if(K == OIL)SPK=108;
|
||||||
|
@ -331,18 +331,18 @@ L9222: SPK=29;
|
||||||
if(LIQLOC(LOC) == 0)SPK=144;
|
if(LIQLOC(LOC) == 0)SPK=144;
|
||||||
if(LIQLOC(LOC) == 0 || !TOTING(VASE)) return(2011);
|
if(LIQLOC(LOC) == 0 || !TOTING(VASE)) return(2011);
|
||||||
RSPEAK(145);
|
RSPEAK(145);
|
||||||
PROP[VASE]=2;
|
game.prop[VASE]=2;
|
||||||
game.fixed[VASE]= -1;
|
game.fixed[VASE]= -1;
|
||||||
return(discard(true));
|
return(discard(true));
|
||||||
|
|
||||||
L9224: SPK=213;
|
L9224: SPK=213;
|
||||||
if(PROP[URN] != 0) return(2011);
|
if(game.prop[URN] != 0) return(2011);
|
||||||
SPK=144;
|
SPK=144;
|
||||||
K=LIQ(0);
|
K=LIQ(0);
|
||||||
if(K == 0 || !HERE(BOTTLE)) return(2011);
|
if(K == 0 || !HERE(BOTTLE)) return(2011);
|
||||||
game.place[K]=0;
|
game.place[K]=0;
|
||||||
PROP[BOTTLE]=1;
|
game.prop[BOTTLE]=1;
|
||||||
if(K == OIL)PROP[URN]=1;
|
if(K == OIL)game.prop[URN]=1;
|
||||||
SPK=211+PROP[URN];
|
SPK=211+game.prop[URN];
|
||||||
return(2011);
|
return(2011);
|
||||||
}
|
}
|
||||||
|
|
8
advent.h
8
advent.h
|
@ -62,6 +62,8 @@ struct game_t {
|
||||||
long link[NOBJECTS*2 + 1];
|
long link[NOBJECTS*2 + 1];
|
||||||
long place[NOBJECTS+1];
|
long place[NOBJECTS+1];
|
||||||
long hinted[HNTSIZ+1];
|
long hinted[HNTSIZ+1];
|
||||||
|
long hintlc[HNTSIZ+1];
|
||||||
|
long prop[NOBJECTS+1];
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct game_t game;
|
extern struct game_t game;
|
||||||
|
@ -132,12 +134,10 @@ 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, COINS, DALTLC, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
|
CLAM, COINS, DALTLC, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
|
||||||
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
|
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
|
||||||
GRATE, HINT, HINTLC[],
|
GRATE, HINT, I, INVENT, IGO, J, JADE, K, K2, KEYS, KK,
|
||||||
I, INVENT, IGO, J, JADE, K, K2, KEYS, KK,
|
|
||||||
KNIFE, KQ, L, LAMP, LL, LOC, LOCK, LOOK,
|
KNIFE, KQ, L, LAMP, LL, LOC, LOCK, LOOK,
|
||||||
MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR, NUGGET, NUL, OBJ,
|
MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR, NUGGET, NUL, OBJ,
|
||||||
OGRE, OIL, OLDOBJ, OYSTER,
|
OGRE, OIL, OLDOBJ, OYSTER, PANIC, PEARL, PILLOW, PLANT, PLANT2, PYRAM,
|
||||||
PANIC, PEARL, PILLOW, PLANT, PLANT2, PROP[], PYRAM,
|
|
||||||
RESER, ROD, ROD2, RUBY, RUG, SAPPH, SAY,
|
RESER, ROD, ROD2, RUBY, RUG, SAPPH, SAY,
|
||||||
SCORE, SECT, SIGN, SNAKE, SPK, STEPS, STICK,
|
SCORE, SECT, SIGN, SNAKE, SPK, STEPS, STICK,
|
||||||
STREAM, THROW, TK[], TRIDNT, TROLL, TROLL2,
|
STREAM, THROW, TK[], TRIDNT, TROLL, TROLL2,
|
||||||
|
|
|
@ -262,7 +262,7 @@ int read_database(FILE* database) {
|
||||||
* the word following the end of the line). The pointer is negative if this is
|
* the word following the end of the line). The pointer is negative if this is
|
||||||
* first line of a message. The text-pointer arrays contain indices of
|
* first line of a message. The text-pointer arrays contain indices of
|
||||||
* pointer-words in lines. STEXT(N) is short description of location N.
|
* pointer-words in lines. STEXT(N) is short description of location N.
|
||||||
* LTEXT(N) is long description. PTEXT(N) points to message for PROP(N)=0.
|
* LTEXT(N) is long description. PTEXT(N) points to message for game.prop(N)=0.
|
||||||
* Successive prop messages are found by chasing pointers. RTEXT contains
|
* Successive prop messages are found by chasing pointers. RTEXT contains
|
||||||
* section 6's stuff. CTEXT(N) points to a player-class message. TTEXT is for
|
* section 6's stuff. CTEXT(N) points to a player-class message. TTEXT is for
|
||||||
* section 14. We also clear COND (see description of section 9 for details). */
|
* section 14. We also clear COND (see description of section 9 for details). */
|
||||||
|
@ -507,7 +507,7 @@ void read_sound_text(FILE* database)
|
||||||
/* Finish constructing internal data format */
|
/* Finish constructing internal data format */
|
||||||
|
|
||||||
/* Having read in the database, certain things are now constructed.
|
/* Having read in the database, certain things are now constructed.
|
||||||
* PROPS are set to zero. We finish setting up COND by checking for
|
* game.propS are set to zero. We finish setting up COND by checking for
|
||||||
* forced-motion travel entries. The PLAC and FIXD arrays are used
|
* forced-motion travel entries. The PLAC and FIXD arrays are used
|
||||||
* to set up game.atloc(N) as the first object at location N, and
|
* 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.
|
* game.link(OBJ) as the next object at the same location as OBJ.
|
||||||
|
|
4
funcs.h
4
funcs.h
|
@ -19,11 +19,11 @@
|
||||||
#define AT(OBJ) (game.place[OBJ] == LOC || game.fixed[OBJ] == LOC)
|
#define AT(OBJ) (game.place[OBJ] == LOC || game.fixed[OBJ] == LOC)
|
||||||
#define HERE(OBJ) (AT(OBJ) || TOTING(OBJ))
|
#define HERE(OBJ) (AT(OBJ) || TOTING(OBJ))
|
||||||
#define LIQ2(PBOTL) ((1-(PBOTL))*WATER+((PBOTL)/2)*(WATER+OIL))
|
#define LIQ2(PBOTL) ((1-(PBOTL))*WATER+((PBOTL)/2)*(WATER+OIL))
|
||||||
#define LIQ(DUMMY) (LIQ2(PROP[BOTTLE]<0 ? -1-PROP[BOTTLE] : PROP[BOTTLE]))
|
#define LIQ(DUMMY) (LIQ2(game.prop[BOTTLE]<0 ? -1-game.prop[BOTTLE] : game.prop[BOTTLE]))
|
||||||
#define LIQLOC(LOC) (LIQ2((MOD(COND[LOC]/2*2,8)-5)*MOD(COND[LOC]/4,2)+1))
|
#define LIQLOC(LOC) (LIQ2((MOD(COND[LOC]/2*2,8)-5)*MOD(COND[LOC]/4,2)+1))
|
||||||
#define CNDBIT(L,N) (TSTBIT(COND[L],N))
|
#define CNDBIT(L,N) (TSTBIT(COND[L],N))
|
||||||
#define FORCED(LOC) (COND[LOC] == 2)
|
#define FORCED(LOC) (COND[LOC] == 2)
|
||||||
#define DARK(DUMMY) ((!CNDBIT(LOC,0)) && (PROP[LAMP] == 0 || !HERE(LAMP)))
|
#define DARK(DUMMY) ((!CNDBIT(LOC,0)) && (game.prop[LAMP] == 0 || !HERE(LAMP)))
|
||||||
#define PCT(N) (randrange(100) < (N))
|
#define PCT(N) (randrange(100) < (N))
|
||||||
#define GSTONE(OBJ) ((OBJ) == EMRALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH)
|
#define GSTONE(OBJ) ((OBJ) == EMRALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH)
|
||||||
#define FOREST(LOC) ((LOC) >= 145 && (LOC) <= 166)
|
#define FOREST(LOC) ((LOC) >= 145 && (LOC) <= 166)
|
||||||
|
|
28
init.c
28
init.c
|
@ -16,12 +16,12 @@
|
||||||
* 885 travel options (TRAVEL, TRVSIZ).
|
* 885 travel options (TRAVEL, TRVSIZ).
|
||||||
* 330 vocabulary words (KTAB, ATAB, TABSIZ).
|
* 330 vocabulary words (KTAB, ATAB, TABSIZ).
|
||||||
* 185 locations (LTEXT, STEXT, KEY, COND, abbrev, game.atloc, LOCSND, LOCSIZ).
|
* 185 locations (LTEXT, STEXT, KEY, COND, abbrev, game.atloc, LOCSND, LOCSIZ).
|
||||||
* 100 objects (PLAC, game.place, FIXD, game.fixed, game.link (TWICE), PTEXT, PROP,
|
* 100 objects (PLAC, game.place, FIXD, game.fixed, game.link (TWICE), PTEXT, game.prop,
|
||||||
* OBJSND, OBJTXT).
|
* OBJSND, OBJTXT).
|
||||||
* 35 "action" verbs (ACTSPK, VRBSIZ).
|
* 35 "action" verbs (ACTSPK, VRBSIZ).
|
||||||
* 277 random messages (RTEXT, RTXSIZ).
|
* 277 random messages (RTEXT, RTXSIZ).
|
||||||
* 12 different player classifications (CTEXT, CVAL, CLSMAX).
|
* 12 different player classifications (CTEXT, CVAL, CLSMAX).
|
||||||
* 20 hints (HINTLC, game.hinted, HINTS, HNTSIZ).
|
* 20 hints (game.hintlc, game.hinted, HINTS, HNTSIZ).
|
||||||
* 5 "# of turns" threshholds (TTEXT, TRNVAL, TRNSIZ).
|
* 5 "# of turns" threshholds (TTEXT, TRNVAL, TRNSIZ).
|
||||||
* There are also limits which cannot be exceeded due to the structure of
|
* 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,
|
* the database. (E.G., The vocabulary uses n/1000 to determine word type,
|
||||||
|
@ -62,9 +62,9 @@
|
||||||
* If M=100 unconditional, but forbidden to dwarves.
|
* If M=100 unconditional, but forbidden to dwarves.
|
||||||
* If 100<M<=200 he must be carrying object M-100.
|
* If 100<M<=200 he must be carrying object M-100.
|
||||||
* If 200<M<=300 must be carrying or in same room as M-200.
|
* If 200<M<=300 must be carrying or in same room as M-200.
|
||||||
* If 300<M<=400 PROP(M % 100) must *not* be 0.
|
* If 300<M<=400 game.prop(M % 100) must *not* be 0.
|
||||||
* If 400<M<=500 PROP(M % 100) must *not* be 1.
|
* If 400<M<=500 game.prop(M % 100) must *not* be 1.
|
||||||
* If 500<M<=600 PROP(M % 100) must *not* be 2, etc.
|
* If 500<M<=600 game.prop(M % 100) must *not* be 2, etc.
|
||||||
* If the condition (if any) is not met, then the next *different*
|
* If the condition (if any) is not met, then the next *different*
|
||||||
* "destination" value is used (unless it fails to meet *its* conditions,
|
* "destination" value is used (unless it fails to meet *its* conditions,
|
||||||
* in which case the next is found, etc.). Typically, the next dest will
|
* in which case the next is found, etc.). Typically, the next dest will
|
||||||
|
@ -76,8 +76,8 @@
|
||||||
* him to 22 if he's carrying object 10, and otherwise will go to 14.
|
* him to 22 if he's carrying object 10, and otherwise will go to 14.
|
||||||
* 11 303008 49
|
* 11 303008 49
|
||||||
* 11 9 50
|
* 11 9 50
|
||||||
* This says that, from 11, 49 takes him to 8 unless PROP(3)=0, in which
|
* This says that, from 11, 49 takes him to 8 unless game.prop(3)=0, in which
|
||||||
* case he goes to 9. Verb 50 takes him to 9 regardless of PROP(3).
|
* case he goes to 9. Verb 50 takes him to 9 regardless of game.prop(3).
|
||||||
* Section 4: Vocabulary. Each line contains a number (n), a tab, and a
|
* Section 4: Vocabulary. Each line contains a number (n), a tab, and a
|
||||||
* five-letter word. Call M=N/1000. If M=0, then the word is a motion
|
* five-letter word. Call M=N/1000. If M=0, then the word is a motion
|
||||||
* verb for use in travelling (see section 3). Else, if M=1, the word is
|
* verb for use in travelling (see section 3). Else, if M=1, the word is
|
||||||
|
@ -142,8 +142,8 @@
|
||||||
* 2 (call them N and S), N is a location and message ABS(S) from section
|
* 2 (call them N and S), N is a location and message ABS(S) from section
|
||||||
* 6 is the sound heard there. If S<0, the sound there drowns out all
|
* 6 is the sound heard there. If S<0, the sound there drowns out all
|
||||||
* other noises. If 3 numbers (call them N, S, and T), N is an object
|
* other noises. If 3 numbers (call them N, S, and T), N is an object
|
||||||
* number and S+PROP(N) is the property message (from section 5) if he
|
* number and S+game.prop(N) is the property message (from section 5) if he
|
||||||
* listens to the object, and T+PROP(N) is the text if he reads it. If
|
* listens to the object, and T+game.prop(N) is the text if he reads it. If
|
||||||
* S or T is -1, the object has no sound or text, respectively. Neither
|
* S or T is -1, the object has no sound or text, respectively. Neither
|
||||||
* S nor T is allowed to be 0.
|
* S nor T is allowed to be 0.
|
||||||
* Section 14: Turn threshholds. Each line contains a number (N), a tab, and
|
* Section 14: Turn threshholds. Each line contains a number (N), a tab, and
|
||||||
|
@ -181,7 +181,7 @@ void initialise(void) {
|
||||||
static int finish_init(void) {
|
static int finish_init(void) {
|
||||||
for (I=1; I<=100; I++) {
|
for (I=1; I<=100; I++) {
|
||||||
game.place[I]=0;
|
game.place[I]=0;
|
||||||
PROP[I]=0;
|
game.prop[I]=0;
|
||||||
game.link[I]=0;
|
game.link[I]=0;
|
||||||
{long x = I+NOBJECTS; game.link[x]=0;}
|
{long x = I+NOBJECTS; game.link[x]=0;}
|
||||||
} /* end loop */
|
} /* end loop */
|
||||||
|
@ -223,16 +223,16 @@ L1106: /*etc*/ ;
|
||||||
MAXTRS=79;
|
MAXTRS=79;
|
||||||
game.tally=0;
|
game.tally=0;
|
||||||
for (I=50; I<=MAXTRS; I++) {
|
for (I=50; I<=MAXTRS; I++) {
|
||||||
if(PTEXT[I] != 0)PROP[I]= -1;
|
if(PTEXT[I] != 0)game.prop[I]= -1;
|
||||||
game.tally=game.tally-PROP[I];
|
game.tally=game.tally-game.prop[I];
|
||||||
} /* end loop */
|
} /* end loop */
|
||||||
|
|
||||||
/* Clear the hint stuff. HINTLC[I] is how long he's been at LOC with cond bit
|
/* Clear the hint stuff. game.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. */
|
* I. game.hinted[I] is true iff hint I has been used. */
|
||||||
|
|
||||||
for (I=1; I<=HNTMAX; I++) {
|
for (I=1; I<=HNTMAX; I++) {
|
||||||
game.hinted[I]=false;
|
game.hinted[I]=false;
|
||||||
HINTLC[I]=0;
|
game.hintlc[I]=0;
|
||||||
} /* end loop */
|
} /* end loop */
|
||||||
|
|
||||||
/* Define some handy mnemonics. These correspond to object numbers. */
|
/* Define some handy mnemonics. These correspond to object numbers. */
|
||||||
|
|
116
main.c
116
main.c
|
@ -21,13 +21,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, COINS, DALTLC, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
|
CLAM, COINS, DALTLC, DOOR, DPRSSN, DRAGON, DWARF, EGGS,
|
||||||
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
|
EMRALD, ENTER, ENTRNC, FIND, FISSUR, FOOD,
|
||||||
GRATE, HINT, HINTLC[21],
|
GRATE, HINT, I, INVENT, IGO, J, JADE, K, K2, KEYS, KK,
|
||||||
I, INVENT, IGO, J, JADE, K, K2, KEYS, KK,
|
|
||||||
KNIFE, KQ, L, LAMP, LL, LOC, LOCK, LOOK,
|
KNIFE, KQ, L, LAMP, LL, LOC, LOCK, LOOK,
|
||||||
MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR,
|
MAGZIN, MAXDIE, MAXTRS, MESSAG, MIRROR, MXSCOR,
|
||||||
NUGGET, NUL, OBJ, OGRE, OIL, OYSTER, PEARL, PILLOW,
|
NUGGET, NUL, OBJ, OGRE, OIL, OYSTER, PEARL, PILLOW,
|
||||||
PLANT, PLANT2, PROP[NOBJECTS+1], PYRAM,
|
PLANT, PLANT2, PYRAM, RESER, ROD, ROD2, RUBY, RUG, SAPPH, SAY,
|
||||||
RESER, ROD, ROD2, RUBY, RUG, SAPPH, SAY,
|
|
||||||
SCORE, SECT, SIGN, SNAKE, SPK, STEPS, STICK,
|
SCORE, SECT, SIGN, SNAKE, SPK, STEPS, STICK,
|
||||||
STREAM, THROW, TK[21], TRIDNT, TROLL, TROLL2,
|
STREAM, THROW, TK[21], TRIDNT, TROLL, TROLL2,
|
||||||
URN, V1, V2, VASE, VEND, VERB,
|
URN, V1, V2, VASE, VEND, VERB,
|
||||||
|
@ -250,9 +248,9 @@ L6016: TK[J]=game.odloc[I];
|
||||||
/* The pirate's spotted him. He leaves him alone once we've found chest. K
|
/* 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
|
* counts if a treasure is here. If not, and tally=1 for an unseen chest, let
|
||||||
* the pirate be spotted. Note that game.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). */
|
* thrown it to the troll, but in that case he's seen the chest (game.prop=0). */
|
||||||
|
|
||||||
if(LOC == game.chloc || PROP[CHEST] >= 0) goto L6030;
|
if(LOC == game.chloc || game.prop[CHEST] >= 0) goto L6030;
|
||||||
K=0;
|
K=0;
|
||||||
/* 6020 */ for (J=50; J<=MAXTRS; J++) {
|
/* 6020 */ for (J=50; J<=MAXTRS; J++) {
|
||||||
/* Pirate won't take pyramid from plover room or dark room (too easy!). */
|
/* Pirate won't take pyramid from plover room or dark room (too easy!). */
|
||||||
|
@ -260,7 +258,7 @@ L6016: TK[J]=game.odloc[I];
|
||||||
if(TOTING(J)) goto L6021;
|
if(TOTING(J)) goto L6021;
|
||||||
L6020: if(HERE(J))K=1;
|
L6020: if(HERE(J))K=1;
|
||||||
} /* end loop */
|
} /* end loop */
|
||||||
if(game.tally == 1 && K == 0 && game.place[CHEST] == 0 && HERE(LAMP) && PROP[LAMP]
|
if(game.tally == 1 && K == 0 && game.place[CHEST] == 0 && HERE(LAMP) && game.prop[LAMP]
|
||||||
== 1) goto L6025;
|
== 1) goto L6025;
|
||||||
if(game.odloc[6] != game.dloc[6] && PCT(20))RSPEAK(127);
|
if(game.odloc[6] != game.dloc[6] && PCT(20))RSPEAK(127);
|
||||||
goto L6030;
|
goto L6030;
|
||||||
|
@ -338,9 +336,9 @@ L2001: if(TOTING(BEAR))RSPEAK(141);
|
||||||
|
|
||||||
/* Print out descriptions of objects at this location. If not closing and
|
/* Print out descriptions of objects at this location. If not closing and
|
||||||
* property value is negative, tally off another treasure. Rug is special
|
* property value is negative, tally off another treasure. Rug is special
|
||||||
* case; once seen, its PROP is 1 (dragon on it) till dragon is killed.
|
* case; once seen, its game.prop is 1 (dragon on it) till dragon is killed.
|
||||||
* Similarly for chain; PROP is initially 1 (locked to bear). These hacks
|
* Similarly for chain; game.prop is initially 1 (locked to bear). These hacks
|
||||||
* are because PROP=0 is needed to get full score. */
|
* are because game.prop=0 is needed to get full score. */
|
||||||
|
|
||||||
if(DARK(0)) goto L2012;
|
if(DARK(0)) goto L2012;
|
||||||
game.abbrev[LOC]=game.abbrev[LOC]+1;
|
game.abbrev[LOC]=game.abbrev[LOC]+1;
|
||||||
|
@ -349,10 +347,10 @@ L2004: if(I == 0) goto L2012;
|
||||||
OBJ=I;
|
OBJ=I;
|
||||||
if(OBJ > NOBJECTS)OBJ=OBJ-NOBJECTS;
|
if(OBJ > NOBJECTS)OBJ=OBJ-NOBJECTS;
|
||||||
if(OBJ == STEPS && TOTING(NUGGET)) goto L2008;
|
if(OBJ == STEPS && TOTING(NUGGET)) goto L2008;
|
||||||
if(PROP[OBJ] >= 0) goto L2006;
|
if(game.prop[OBJ] >= 0) goto L2006;
|
||||||
if(game.closed) goto L2008;
|
if(game.closed) goto L2008;
|
||||||
PROP[OBJ]=0;
|
game.prop[OBJ]=0;
|
||||||
if(OBJ == RUG || OBJ == CHAIN)PROP[OBJ]=1;
|
if(OBJ == RUG || OBJ == CHAIN)game.prop[OBJ]=1;
|
||||||
game.tally=game.tally-1;
|
game.tally=game.tally-1;
|
||||||
/* Note: There used to be a test here to see whether the player had blown it
|
/* Note: There used to be a test here to see whether the player had blown it
|
||||||
* so badly that he could never ever see the remaining treasures, and if so
|
* so badly that he could never ever see the remaining treasures, and if so
|
||||||
|
@ -365,7 +363,7 @@ L2004: if(I == 0) goto L2012;
|
||||||
* or trident, and the effects propagate. So the whole thing was flushed.
|
* or trident, and the effects propagate. So the whole thing was flushed.
|
||||||
* anyone who makes such a gross blunder isn't likely to find everything
|
* anyone who makes such a gross blunder isn't likely to find everything
|
||||||
* else anyway (so goes the rationalisation). */
|
* else anyway (so goes the rationalisation). */
|
||||||
L2006: KK=PROP[OBJ];
|
L2006: KK=game.prop[OBJ];
|
||||||
if(OBJ == STEPS && LOC == game.fixed[STEPS])KK=1;
|
if(OBJ == STEPS && LOC == game.fixed[STEPS])KK=1;
|
||||||
PSPEAK(OBJ,KK);
|
PSPEAK(OBJ,KK);
|
||||||
L2008: I=game.link[I];
|
L2008: I=game.link[I];
|
||||||
|
@ -387,21 +385,21 @@ L2012: VERB=0;
|
||||||
L2600: if(COND[LOC] < game.conds) goto L2603;
|
L2600: if(COND[LOC] < game.conds) goto L2603;
|
||||||
/* 2602 */ for (HINT=1; HINT<=HNTMAX; HINT++) {
|
/* 2602 */ for (HINT=1; HINT<=HNTMAX; HINT++) {
|
||||||
if(game.hinted[HINT]) goto L2602;
|
if(game.hinted[HINT]) goto L2602;
|
||||||
if(!CNDBIT(LOC,HINT+10))HINTLC[HINT]= -1;
|
if(!CNDBIT(LOC,HINT+10))game.hintlc[HINT]= -1;
|
||||||
HINTLC[HINT]=HINTLC[HINT]+1;
|
game.hintlc[HINT]=game.hintlc[HINT]+1;
|
||||||
if(HINTLC[HINT] >= HINTS[HINT][1]) goto L40000;
|
if(game.hintlc[HINT] >= HINTS[HINT][1]) goto L40000;
|
||||||
L2602: /*etc*/ ;
|
L2602: /*etc*/ ;
|
||||||
} /* end loop */
|
} /* end loop */
|
||||||
|
|
||||||
/* If closing time, check for any objects being toted with PROP < 0 and set
|
/* If closing time, check for any objects being toted with game.prop < 0 and set
|
||||||
* the prop to -1-PROP. This way objects won't be described until they've
|
* the prop to -1-game.prop. This way objects won't be described until they've
|
||||||
* been picked up and put down separate from their respective piles. Don't
|
* been picked up and put down separate from their respective piles. Don't
|
||||||
* tick game.clock1 unless well into cave (and not at Y2). */
|
* tick game.clock1 unless well into cave (and not at Y2). */
|
||||||
|
|
||||||
L2603: if(!game.closed) goto L2605;
|
L2603: if(!game.closed) goto L2605;
|
||||||
if(PROP[OYSTER] < 0 && TOTING(OYSTER))PSPEAK(OYSTER,1);
|
if(game.prop[OYSTER] < 0 && TOTING(OYSTER))PSPEAK(OYSTER,1);
|
||||||
for (I=1; I<=NOBJECTS; I++) {
|
for (I=1; I<=NOBJECTS; I++) {
|
||||||
if(TOTING(I) && PROP[I] < 0)PROP[I]= -1-PROP[I];
|
if(TOTING(I) && game.prop[I] < 0)game.prop[I]= -1-game.prop[I];
|
||||||
} /* end loop */
|
} /* end loop */
|
||||||
L2605: game.wzdark=DARK(0);
|
L2605: game.wzdark=DARK(0);
|
||||||
if(game.knfloc > 0 && game.knfloc != LOC)game.knfloc=0;
|
if(game.knfloc > 0 && game.knfloc != LOC)game.knfloc=0;
|
||||||
|
@ -428,8 +426,8 @@ L2607: game.foobar=(game.foobar>0 ? -game.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)game.limit=game.limit-1;
|
if(game.prop[LAMP] == 1)game.limit=game.limit-1;
|
||||||
if(game.limit <= 30 && HERE(BATTER) && PROP[BATTER] == 0 && HERE(LAMP)) goto
|
if(game.limit <= 30 && HERE(BATTER) && game.prop[BATTER] == 0 && HERE(LAMP)) goto
|
||||||
L12000;
|
L12000;
|
||||||
if(game.limit == 0) goto L12400;
|
if(game.limit == 0) goto L12400;
|
||||||
if(game.limit <= 30) goto L12200;
|
if(game.limit <= 30) goto L12200;
|
||||||
|
@ -536,7 +534,7 @@ L10: LL=LL/1000;
|
||||||
L11: game.newloc=LL/1000;
|
L11: game.newloc=LL/1000;
|
||||||
K=MOD(game.newloc,100); /* ESR: an instance of NOBJECTS? */
|
K=MOD(game.newloc,100); /* ESR: an instance of NOBJECTS? */
|
||||||
if(game.newloc <= 300) goto L13;
|
if(game.newloc <= 300) goto L13;
|
||||||
if(PROP[K] != game.newloc/100-3) goto L16;
|
if(game.prop[K] != game.newloc/100-3) goto L16;
|
||||||
L12: if(TRAVEL[KK] < 0)BUG(25);
|
L12: if(TRAVEL[KK] < 0)BUG(25);
|
||||||
KK=KK+1;
|
KK=KK+1;
|
||||||
game.newloc=labs(TRAVEL[KK])/1000;
|
game.newloc=labs(TRAVEL[KK])/1000;
|
||||||
|
@ -584,12 +582,12 @@ L30200: DROP(EMRALD,LOC);
|
||||||
/* Travel 303. Troll bridge. Must be done only as special motion so that
|
/* Travel 303. Troll bridge. Must be done only as special motion so that
|
||||||
* dwarves won't wander across and encounter the bear. (They won't follow the
|
* dwarves won't wander across and encounter the bear. (They won't follow the
|
||||||
* player there because that region is forbidden to the pirate.) If
|
* player there because that region is forbidden to the pirate.) If
|
||||||
* PROP(TROLL)=1, he's crossed since paying, so step out and block him.
|
* game.prop(TROLL)=1, he's crossed since paying, so step out and block him.
|
||||||
* (standard travel entries check for PROP(TROLL)=0.) Special stuff for bear. */
|
* (standard travel entries check for game.prop(TROLL)=0.) Special stuff for bear. */
|
||||||
|
|
||||||
L30300: if(PROP[TROLL] != 1) goto L30310;
|
L30300: if(game.prop[TROLL] != 1) goto L30310;
|
||||||
PSPEAK(TROLL,1);
|
PSPEAK(TROLL,1);
|
||||||
PROP[TROLL]=0;
|
game.prop[TROLL]=0;
|
||||||
MOVE(TROLL2,0);
|
MOVE(TROLL2,0);
|
||||||
MOVE(TROLL2+NOBJECTS,0);
|
MOVE(TROLL2+NOBJECTS,0);
|
||||||
MOVE(TROLL,PLAC[TROLL]);
|
MOVE(TROLL,PLAC[TROLL]);
|
||||||
|
@ -599,14 +597,14 @@ L30300: if(PROP[TROLL] != 1) goto L30310;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
L30310: game.newloc=PLAC[TROLL]+FIXD[TROLL]-LOC;
|
L30310: game.newloc=PLAC[TROLL]+FIXD[TROLL]-LOC;
|
||||||
if(PROP[TROLL] == 0)PROP[TROLL]=1;
|
if(game.prop[TROLL] == 0)game.prop[TROLL]=1;
|
||||||
if(!TOTING(BEAR)) return true;
|
if(!TOTING(BEAR)) return true;
|
||||||
RSPEAK(162);
|
RSPEAK(162);
|
||||||
PROP[CHASM]=1;
|
game.prop[CHASM]=1;
|
||||||
PROP[TROLL]=2;
|
game.prop[TROLL]=2;
|
||||||
DROP(BEAR,game.newloc);
|
DROP(BEAR,game.newloc);
|
||||||
game.fixed[BEAR]= -1;
|
game.fixed[BEAR]= -1;
|
||||||
PROP[BEAR]=3;
|
game.prop[BEAR]=3;
|
||||||
game.oldlc2=game.newloc;
|
game.oldlc2=game.newloc;
|
||||||
goto L99;
|
goto L99;
|
||||||
|
|
||||||
|
@ -707,7 +705,7 @@ L99: if(game.closng) goto L95;
|
||||||
if(game.numdie == MAXDIE) score(0);
|
if(game.numdie == MAXDIE) score(0);
|
||||||
game.place[WATER]=0;
|
game.place[WATER]=0;
|
||||||
game.place[OIL]=0;
|
game.place[OIL]=0;
|
||||||
if(TOTING(LAMP))PROP[LAMP]=0;
|
if(TOTING(LAMP))game.prop[LAMP]=0;
|
||||||
/* 98 */ for (J=1; J<=NOBJECTS; J++) {
|
/* 98 */ for (J=1; J<=NOBJECTS; J++) {
|
||||||
I=NOBJECTS + 1 - J;
|
I=NOBJECTS + 1 - J;
|
||||||
if(!TOTING(I)) goto L98;
|
if(!TOTING(I)) goto L98;
|
||||||
|
@ -734,7 +732,7 @@ L95: RSPEAK(131);
|
||||||
/* Come here if he's been long enough at required loc(s) for some unused hint.
|
/* Come here if he's been long enough at required loc(s) for some unused hint.
|
||||||
* hint number is in variable "hint". Branch to quick test for additional
|
* hint number is in variable "hint". Branch to quick test for additional
|
||||||
* conditions, then come back to do neat stuff. Goto 40010 if conditions are
|
* conditions, then come back to do neat stuff. Goto 40010 if conditions are
|
||||||
* met and we want to offer the hint. Goto 40020 to clear HINTLC back to zero,
|
* met and we want to offer the hint. Goto 40020 to clear game.hintlc back to zero,
|
||||||
* 40030 to take no action yet. */
|
* 40030 to take no action yet. */
|
||||||
|
|
||||||
L40000: switch (HINT-1) { case 0: goto L40100; case 1: goto L40200; case 2: goto
|
L40000: switch (HINT-1) { case 0: goto L40100; case 1: goto L40200; case 2: goto
|
||||||
|
@ -745,18 +743,18 @@ L40000: switch (HINT-1) { case 0: goto L40100; case 1: goto L40200; case 2: g
|
||||||
* JADE */
|
* JADE */
|
||||||
BUG(27);
|
BUG(27);
|
||||||
|
|
||||||
L40010: HINTLC[HINT]=0;
|
L40010: game.hintlc[HINT]=0;
|
||||||
if(!YES(cmdin,HINTS[HINT][3],0,54)) goto L2602;
|
if(!YES(cmdin,HINTS[HINT][3],0,54)) goto L2602;
|
||||||
SETPRM(1,HINTS[HINT][2],HINTS[HINT][2]);
|
SETPRM(1,HINTS[HINT][2],HINTS[HINT][2]);
|
||||||
RSPEAK(261);
|
RSPEAK(261);
|
||||||
game.hinted[HINT]=YES(cmdin,175,HINTS[HINT][4],54);
|
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];
|
if(game.hinted[HINT] && game.limit > 30)game.limit=game.limit+30*HINTS[HINT][2];
|
||||||
L40020: HINTLC[HINT]=0;
|
L40020: game.hintlc[HINT]=0;
|
||||||
L40030: goto L2602;
|
L40030: goto L2602;
|
||||||
|
|
||||||
/* Now for the quick tests. See database description for one-line notes. */
|
/* Now for the quick tests. See database description for one-line notes. */
|
||||||
|
|
||||||
L40100: if(PROP[GRATE] == 0 && !HERE(KEYS)) goto L40010;
|
L40100: if(game.prop[GRATE] == 0 && !HERE(KEYS)) goto L40010;
|
||||||
goto L40020;
|
goto L40020;
|
||||||
|
|
||||||
L40200: if(game.place[BIRD] == LOC && TOTING(ROD) && game.oldobj == BIRD) goto L40010;
|
L40200: if(game.place[BIRD] == LOC && TOTING(ROD) && game.oldobj == BIRD) goto L40010;
|
||||||
|
@ -769,7 +767,7 @@ L40400: if(game.atloc[LOC] == 0 && game.atloc[game.oldloc] == 0 && game.atloc[ga
|
||||||
1) goto L40010;
|
1) goto L40010;
|
||||||
goto L40020;
|
goto L40020;
|
||||||
|
|
||||||
L40500: if(PROP[EMRALD] != -1 && PROP[PYRAM] == -1) goto L40010;
|
L40500: if(game.prop[EMRALD] != -1 && game.prop[PYRAM] == -1) goto L40010;
|
||||||
goto L40020;
|
goto L40020;
|
||||||
|
|
||||||
L40600: goto L40010;
|
L40600: goto L40010;
|
||||||
|
@ -786,7 +784,7 @@ L40900: I=ATDWRF(LOC);
|
||||||
if(HERE(OGRE) && I == 0) goto L40010;
|
if(HERE(OGRE) && I == 0) goto L40010;
|
||||||
goto L40030;
|
goto L40030;
|
||||||
|
|
||||||
L41000: if(game.tally == 1 && PROP[JADE] < 0) goto L40010;
|
L41000: if(game.tally == 1 && game.prop[JADE] < 0) goto L40010;
|
||||||
goto L40020;
|
goto L40020;
|
||||||
|
|
||||||
|
|
||||||
|
@ -825,8 +823,8 @@ L41000: if(game.tally == 1 && PROP[JADE] < 0) goto L40010;
|
||||||
* gotten the pearl, so we know the bivalve is an oyster. *And*, the dwarves
|
* gotten the pearl, so we know the bivalve is an oyster. *And*, the dwarves
|
||||||
* must have been activated, since we've found chest. */
|
* must have been activated, since we've found chest. */
|
||||||
|
|
||||||
L10000: PROP[GRATE]=0;
|
L10000: game.prop[GRATE]=0;
|
||||||
PROP[FISSUR]=0;
|
game.prop[FISSUR]=0;
|
||||||
for (I=1; I<=NDWARVES; I++) {
|
for (I=1; I<=NDWARVES; I++) {
|
||||||
game.dseen[I]=false;
|
game.dseen[I]=false;
|
||||||
game.dloc[I]=0;
|
game.dloc[I]=0;
|
||||||
|
@ -836,10 +834,10 @@ L10000: PROP[GRATE]=0;
|
||||||
MOVE(TROLL2,PLAC[TROLL]);
|
MOVE(TROLL2,PLAC[TROLL]);
|
||||||
MOVE(TROLL2+NOBJECTS,FIXD[TROLL]);
|
MOVE(TROLL2+NOBJECTS,FIXD[TROLL]);
|
||||||
JUGGLE(CHASM);
|
JUGGLE(CHASM);
|
||||||
if(PROP[BEAR] != 3)DSTROY(BEAR);
|
if(game.prop[BEAR] != 3)DSTROY(BEAR);
|
||||||
PROP[CHAIN]=0;
|
game.prop[CHAIN]=0;
|
||||||
game.fixed[CHAIN]=0;
|
game.fixed[CHAIN]=0;
|
||||||
PROP[AXE]=0;
|
game.prop[AXE]=0;
|
||||||
game.fixed[AXE]=0;
|
game.fixed[AXE]=0;
|
||||||
RSPEAK(129);
|
RSPEAK(129);
|
||||||
game.clock1= -1;
|
game.clock1= -1;
|
||||||
|
@ -858,13 +856,13 @@ L10000: PROP[GRATE]=0;
|
||||||
* objects he might be carrying (lest he have some which could cause trouble,
|
* objects he might be carrying (lest he have some which could cause trouble,
|
||||||
* such as the keys). We describe the flash of light and trundle back. */
|
* such as the keys). We describe the flash of light and trundle back. */
|
||||||
|
|
||||||
L11000: PROP[BOTTLE]=PUT(BOTTLE,115,1);
|
L11000: game.prop[BOTTLE]=PUT(BOTTLE,115,1);
|
||||||
PROP[PLANT]=PUT(PLANT,115,0);
|
game.prop[PLANT]=PUT(PLANT,115,0);
|
||||||
PROP[OYSTER]=PUT(OYSTER,115,0);
|
game.prop[OYSTER]=PUT(OYSTER,115,0);
|
||||||
OBJTXT[OYSTER]=3;
|
OBJTXT[OYSTER]=3;
|
||||||
PROP[LAMP]=PUT(LAMP,115,0);
|
game.prop[LAMP]=PUT(LAMP,115,0);
|
||||||
PROP[ROD]=PUT(ROD,115,0);
|
game.prop[ROD]=PUT(ROD,115,0);
|
||||||
PROP[DWARF]=PUT(DWARF,115,0);
|
game.prop[DWARF]=PUT(DWARF,115,0);
|
||||||
LOC=115;
|
LOC=115;
|
||||||
game.oldloc=115;
|
game.oldloc=115;
|
||||||
game.newloc=115;
|
game.newloc=115;
|
||||||
|
@ -874,13 +872,13 @@ L11000: PROP[BOTTLE]=PUT(BOTTLE,115,1);
|
||||||
I=PUT(GRATE,116,0);
|
I=PUT(GRATE,116,0);
|
||||||
I=PUT(SIGN,116,0);
|
I=PUT(SIGN,116,0);
|
||||||
OBJTXT[SIGN]=OBJTXT[SIGN]+1;
|
OBJTXT[SIGN]=OBJTXT[SIGN]+1;
|
||||||
PROP[SNAKE]=PUT(SNAKE,116,1);
|
game.prop[SNAKE]=PUT(SNAKE,116,1);
|
||||||
PROP[BIRD]=PUT(BIRD,116,1);
|
game.prop[BIRD]=PUT(BIRD,116,1);
|
||||||
PROP[CAGE]=PUT(CAGE,116,0);
|
game.prop[CAGE]=PUT(CAGE,116,0);
|
||||||
PROP[ROD2]=PUT(ROD2,116,0);
|
game.prop[ROD2]=PUT(ROD2,116,0);
|
||||||
PROP[PILLOW]=PUT(PILLOW,116,0);
|
game.prop[PILLOW]=PUT(PILLOW,116,0);
|
||||||
|
|
||||||
PROP[MIRROR]=PUT(MIRROR,115,0);
|
game.prop[MIRROR]=PUT(MIRROR,115,0);
|
||||||
game.fixed[MIRROR]=116;
|
game.fixed[MIRROR]=116;
|
||||||
|
|
||||||
for (I=1; I<=NOBJECTS; I++) {
|
for (I=1; I<=NOBJECTS; I++) {
|
||||||
|
@ -899,7 +897,7 @@ L11000: PROP[BOTTLE]=PUT(BOTTLE,115,1);
|
||||||
* out. Even then, he can explore outside for a while if desired. */
|
* out. Even then, he can explore outside for a while if desired. */
|
||||||
|
|
||||||
L12000: RSPEAK(188);
|
L12000: RSPEAK(188);
|
||||||
PROP[BATTER]=1;
|
game.prop[BATTER]=1;
|
||||||
if(TOTING(BATTER))DROP(BATTER,LOC);
|
if(TOTING(BATTER))DROP(BATTER,LOC);
|
||||||
game.limit=game.limit+2500;
|
game.limit=game.limit+2500;
|
||||||
game.lmwarn=false;
|
game.lmwarn=false;
|
||||||
|
@ -909,12 +907,12 @@ L12200: if(game.lmwarn || !HERE(LAMP)) goto L19999;
|
||||||
game.lmwarn=true;
|
game.lmwarn=true;
|
||||||
SPK=187;
|
SPK=187;
|
||||||
if(game.place[BATTER] == 0)SPK=183;
|
if(game.place[BATTER] == 0)SPK=183;
|
||||||
if(PROP[BATTER] == 1)SPK=189;
|
if(game.prop[BATTER] == 1)SPK=189;
|
||||||
RSPEAK(SPK);
|
RSPEAK(SPK);
|
||||||
goto L19999;
|
goto L19999;
|
||||||
|
|
||||||
L12400: game.limit= -1;
|
L12400: game.limit= -1;
|
||||||
PROP[LAMP]=0;
|
game.prop[LAMP]=0;
|
||||||
if(HERE(LAMP))RSPEAK(184);
|
if(HERE(LAMP))RSPEAK(184);
|
||||||
goto L19999;
|
goto L19999;
|
||||||
|
|
||||||
|
|
4
misc.c
4
misc.c
|
@ -115,7 +115,7 @@ void PSPEAK(vocab_t MSG,int SKIP) {
|
||||||
long I, M;
|
long I, M;
|
||||||
|
|
||||||
/* Find the skip+1st message from msg and print it. MSG should be the index of
|
/* Find the skip+1st message from msg and print it. MSG should be the index of
|
||||||
* the inventory message for object. (INVEN+N+1 message is PROP=N message). */
|
* the inventory message for object. (INVEN+N+1 message is game.prop=N message). */
|
||||||
|
|
||||||
|
|
||||||
M=PTEXT[MSG];
|
M=PTEXT[MSG];
|
||||||
|
@ -537,7 +537,7 @@ long PUT(long OBJECT, long WHERE, long PVAL) {
|
||||||
long X;
|
long X;
|
||||||
|
|
||||||
/* PUT is the same as MOVE, except it returns a value used to set up the
|
/* PUT is the same as MOVE, except it returns a value used to set up the
|
||||||
* negated PROP values for the repository objects. */
|
* negated game.prop values for the repository objects. */
|
||||||
|
|
||||||
MOVE(OBJECT,WHERE);
|
MOVE(OBJECT,WHERE);
|
||||||
X=(-1)-PVAL;
|
X=(-1)-PVAL;
|
||||||
|
|
4
score.c
4
score.c
|
@ -39,8 +39,8 @@ void score(long MODE) {
|
||||||
K=12;
|
K=12;
|
||||||
if(I == CHEST)K=14;
|
if(I == CHEST)K=14;
|
||||||
if(I > CHEST)K=16;
|
if(I > CHEST)K=16;
|
||||||
if(PROP[I] >= 0)SCORE=SCORE+2;
|
if(game.prop[I] >= 0)SCORE=SCORE+2;
|
||||||
if(game.place[I] == 3 && PROP[I] == 0)SCORE=SCORE+K-2;
|
if(game.place[I] == 3 && game.prop[I] == 0)SCORE=SCORE+K-2;
|
||||||
MXSCOR=MXSCOR+K;
|
MXSCOR=MXSCOR+K;
|
||||||
L20010: /*etc*/ ;
|
L20010: /*etc*/ ;
|
||||||
} /* end loop */
|
} /* end loop */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue