From: Eric S. Raymond Date: Wed, 24 May 2017 00:34:53 +0000 (-0400) Subject: More globals to the game structure. X-Git-Tag: seed~74 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=f68f3a12056d7cfbe6cc65abe9f5c5975375ba00;p=open-adventure.git More globals to the game structure. --- diff --git a/actions1.c b/actions1.c index 280a4f7..0bbe90e 100644 --- a/actions1.c +++ b/actions1.c @@ -499,7 +499,7 @@ L8305: DATIME(I,K); SAVWDS(game.knfloc,game.limit,LL,game.lmwarn,LOC,game.newloc,game.numdie); SAVWDS(OBJ,game.oldlc2,game.oldloc,game.oldobj,game.panic,game.saved,game.setup); SAVWDS(game.spk,game.tally,game.thresh,game.trndex,game.trnluz,game.turns,OBJTXT[OYSTER]); - SAVWDS(VERB,WD1,WD1X,WD2,game.wzdark,ZZWORD,OBJSND[BIRD]); + SAVWDS(VERB,WD1,WD1X,WD2,game.wzdark,game.zzword,OBJSND[BIRD]); SAVWDS(OBJTXT[SIGN],CLSHNT,game.novice,K,K,K,K); SAVARR(ABB,LOCSIZ); SAVARR(ATLOC,LOCSIZ); @@ -515,7 +515,7 @@ L8305: DATIME(I,K); SAVWRD(KK,K); if(K != 0) goto L8318; K=NUL; - ZZWORD=RNDVOC(3,ZZWORD-MESH*2)+MESH*2; + game.zzword=RNDVOC(3,game.zzword-MESH*2)+MESH*2; if(KK > 0) return(8); RSPEAK(266); exit(0); @@ -562,7 +562,7 @@ L8330: game.spk=228; RSPEAK(IABS(K)); if(K < 0) return(2012); game.spk=0; -L8332: SETPRM(1,ZZWORD-MESH*2,0); +L8332: SETPRM(1,game.zzword-MESH*2,0); /* 8335 */ for (I=1; I<=100; I++) { if(!HERE(I) || OBJSND[I] == 0 || PROP[I] < 0) goto L8335; PSPEAK(I,OBJSND[I]+PROP[I]); diff --git a/main.c b/main.c index 0ccfcce..8cce7c5 100644 --- a/main.c +++ b/main.c @@ -37,8 +37,7 @@ long ACTVERB[36], AMBER, ATTACK, AXE, BACK, BATTER, BEAR, BIRD, BLOOD, STREAM, TABNDX, THROW, TK[21], TRAVEL[886], TRIDNT, TRNSIZ = 5, TRNVAL[6], TRNVLS, TROLL, TROLL2, TRVS, TRVSIZ = 885, TTEXT[6], URN, V1, V2, VASE, VEND, VERB, - VOLCAN, VRBSIZ = 35, VRSION = 25, WATER, WD1, WD1X, WD2, WD2X, - ZZWORD; + VOLCAN, VRBSIZ = 35, VRSION = 25, WATER, WD1, WD1X, WD2, WD2X; struct game_t game = {.blklin = true}; FILE *logfp; bool oldstyle = false; @@ -117,7 +116,7 @@ int main(int argc, char *argv[]) { L1: game.setup= -1; I=RAN(-1); - ZZWORD=RNDVOC(3,0)+MESH*2; + game.zzword=RNDVOC(3,0)+MESH*2; game.novice=YES(stdin, 65,1,0); game.newloc=1; LOC=1; diff --git a/main.h b/main.h index c7b40b5..5af50f3 100644 --- a/main.h +++ b/main.h @@ -48,6 +48,7 @@ struct game_t { long turns; /* more state will go here */ long wzdark; + long zzword; /* more state will go here */ long novice; }; diff --git a/share.h b/share.h index 4f5b5ba..a307191 100644 --- a/share.h +++ b/share.h @@ -19,5 +19,4 @@ extern long ACTVERB[], AMBER, ATTACK, AXE, BACK, BATTER, BEAR, STREAM, TABNDX, THROW, TK[], TRAVEL[], TRIDNT, TRNSIZ, TRNVAL[], TRNVLS, TROLL, TROLL2, TRVS, TRVSIZ, TTEXT[], URN, V1, V2, VASE, VEND, VERB, - VOLCAN, VRBSIZ, VRSION, WATER, WD1, WD1X, WD2, WD2X, - ZZWORD; + VOLCAN, VRBSIZ, VRSION, WATER, WD1, WD1X, WD2, WD2X;