X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=init.c;h=5d64098ecd4d12f5743f9818be425d245dd33bdc;hb=78f606c879bc5cdd778d26ff9f8a571f3cf0b790;hp=5425b7a0a15a4d615f1a08be86fec4b498e9b74d;hpb=7f4cff11889363b959a9987e92c9f62244397574;p=open-adventure.git diff --git a/init.c b/init.c index 5425b7a..5d64098 100644 --- a/init.c +++ b/init.c @@ -15,13 +15,13 @@ * 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, game.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 (game.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, @@ -32,7 +32,8 @@ /* Note: * - the object count limit has been abstracted as NOBJECTS - * - the random message limit has been abstracted as RTXSIZE + * - the random message limit has been abstracted as RTXSIZ + * - maximum locations limit has been abstracted as LOCSIZ */ /* Description of the database format @@ -61,9 +62,9 @@ * If M=100 unconditional, but forbidden to dwarves. * If 100 0) { + DROP(K+NOBJECTS,FIXD[K]); + DROP(K,PLAC[K]); + } } /* end loop */ - for (I=1; I<=NOBJECTS; I++) { - K=NOBJECTS + 1 - I; - FIXED[K]=FIXD[K]; - if(PLAC[K] != 0 && FIXD[K] <= 0)DROP(K,PLAC[K]); + for (i=1; i<=NOBJECTS; i++) { + K=NOBJECTS + 1 - i; + game.fixed[K]=FIXD[K]; + if(PLAC[K] != 0 && FIXD[K] <= 0) + DROP(K,PLAC[K]); } /* end loop */ -/* Treasures, as noted earlier, are objects 50 through MAXTRS (CURRENTLY 79). +/* Treasures, as noted earlier, are objects MINTRS through MAXTRS * Their props are initially -1, and are set to 0 the first time they are * described. game.tally keeps track of how many are not yet found, so we know * when to close the cave. */ - MAXTRS=79; game.tally=0; - for (I=50; I<=MAXTRS; I++) { - if(PTEXT[I] != 0)PROP[I]= -1; - game.tally=game.tally-PROP[I]; + for (i=MINTRS; i<=MAXTRS; i++) { + if(PTEXT[i] != 0) + game.prop[i]= -1; + game.tally=game.tally-game.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. 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. */ - for (I=1; I<=HNTMAX; I++) { - HINTED[I]=false; - HINTLC[I]=0; + for (i=1; i<=HNTMAX; i++) { + game.hinted[i]=false; + game.hintlc[i]=0; } /* end loop */ /* Define some handy mnemonics. These correspond to object numbers. */ @@ -330,8 +336,8 @@ L1106: /*etc*/ ; game.chloc=114; game.chloc2=140; - for (I=1; I<=NDWARVES; I++) { - game.dseen[I]=false; + for (i=1; i<=NDWARVES; i++) { + game.dseen[i]=false; } /* end loop */ game.dflag=0; game.dloc[1]=19; @@ -340,7 +346,6 @@ L1106: /*etc*/ ; game.dloc[4]=44; game.dloc[5]=64; game.dloc[6]=game.chloc; - DALTLC=18; /* Other random flags and counters, as follows: * game.abbnum How often we should print non-abbreviated descriptions @@ -352,11 +357,11 @@ L1106: /*etc*/ ; * game.dkill # of dwarves killed (unused in scoring, needed for msg) * 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" + * igo How many times he's said "go XXX" instead of "XXX" * 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) + * MAXDIE Number of reincarnation messages available (up to 5) * game.numdie Number of times killed so far * game.thresh Next #turns threshhold (-1 if none) * game.trndex Index in TRNVAL of next threshhold (section 14 of database) @@ -370,13 +375,12 @@ L1106: /*etc*/ ; if(TRNVLS > 0)game.thresh=MOD(TRNVAL[1],100000)+1; game.trnluz=0; game.lmwarn=false; - IGO=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;} + for (i=0; i<=4; i++) { + {long x = 2*i+81; if(RTEXT[x] != 0)MAXDIE=i+1;} } /* end loop */ game.numdie=0; game.holdng=0;