X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=init.c;h=bde05122f16cace6c633c33c9cce7b08a11e4525;hb=f72141fbe356cd7bfe90a91cf65353e2808197a8;hp=51ab3138b15e14b3f29f13bcaeb9670223f39858;hpb=040f19adde85fdd78628eb390a685907804f85ae;p=open-adventure.git diff --git a/init.c b/init.c index 51ab313..bde0512 100644 --- a/init.c +++ b/init.c @@ -19,7 +19,7 @@ * 185 locations (LTEXT, STEXT, KEY, COND, ABB, ATLOC, LOCSND, LOCSIZ). * 100 objects (PLAC, PLACE, FIXD, FIXED, LINK (TWICE), PTEXT, PROP, * OBJSND, OBJTXT). - * 35 "action" verbs (ACTSPK, VRBSIZ). + * 35 "action" verbs (ACTVERB, VRBSIZ). * 277 random messages (RTEXT, RTXSIZ). * 12 different player classifications (CTEXT, CVAL, CLSMAX). * 20 hints (HINTLC, HINTED, HINTS, HNTSIZ). @@ -35,7 +35,7 @@ /* Description of the database format * * - * The data file contains several sections. each begins with a line containing + * The data file contains several sections. Each begins with a line containing * a number identifying the section, and ends with a line containing "-1". * * Section 1: Long form descriptions. Each line contains a location number, @@ -150,7 +150,7 @@ /* The various messages (sections 1, 2, 5, 6, etc.) may include certain * special character sequences to denote that the program must provide - * parameters to insert into a message when the message is printed. these + * parameters to insert into a message when the message is printed. These * sequences are: * %S = The letter 'S' or nothing (if a given value is exactly 1) * %W = A word (up to 10 characters) @@ -173,7 +173,8 @@ static int finish_init(void); static void quick_io(void); void initialise(void) { - printf("Initialising...\n"); + if (oldstyle) + printf("Initialising...\n"); if(!quick_init()){raw_init(); report(); quick_save();} finish_init(); } @@ -214,10 +215,10 @@ L1001: /*etc*/ ; CLSSES=0; TRNVLS=0; -/* Start new data section. sect is the section number. */ +/* Start new data section. Sect is the section number. */ L1002: SECT=GETNUM(OPENED); - OLDLOC= -1; + game.oldloc= -1; switch (SECT) { case 0: return(0); case 1: goto L1004; case 2: goto L1004; case 3: goto L1030; case 4: goto L1040; case 5: goto L1004; case 6: goto L1004; case 7: goto L1050; case 8: goto L1060; case @@ -240,8 +241,8 @@ L1006: KK=KK+1; LINES[KK]=GETTXT(false,false,false,KK); if(LINES[KK] != -1) goto L1006; LINES[LINUSE]=KK; - if(LOC == OLDLOC) goto L1005; - OLDLOC=LOC; + if(LOC == game.oldloc) goto L1005; + game.oldloc=LOC; LINES[LINUSE]= -KK; if(SECT == 14) goto L1014; if(SECT == 10) goto L1012; @@ -276,21 +277,21 @@ L1014: TRNVLS=TRNVLS+1; goto L1005; /* The stuff for section 3 is encoded here. Each "from-location" gets a - * contiguous section of the "TRAVEL" array. each entry in travel is - * NEWLOC*1000 + KEYWORD (from section 4, motion verbs), and is negated if + * contiguous section of the "TRAVEL" array. Each entry in travel is + * game.newloc*1000 + KEYWORD (from section 4, motion verbs), and is negated if * this is the last entry for this location. KEY(N) is the index in travel * of the first option at location N. */ L1030: LOC=GETNUM(OPENED); if(LOC == -1) goto L1002; - NEWLOC=GETNUM(NULL); + game.newloc=GETNUM(NULL); if(KEY[LOC] != 0) goto L1033; KEY[LOC]=TRVS; goto L1035; L1033: TRVS--; TRAVEL[TRVS]= -TRAVEL[TRVS]; TRVS++; L1035: L=GETNUM(NULL); if(L == 0) goto L1039; - TRAVEL[TRVS]=NEWLOC*1000+L; + TRAVEL[TRVS]=game.newloc*1000+L; TRVS=TRVS+1; if(TRVS == TRVSIZ)BUG(3); goto L1035; @@ -323,11 +324,11 @@ L1050: OBJ=GETNUM(OPENED); FIXD[OBJ]=GETNUM(NULL); goto L1050; -/* Read default message numbers for action verbs, store in ACTSPK. */ +/* Read default message numbers for action verbs, store in ACTVERB. */ L1060: VERB=GETNUM(OPENED); if(VERB == -1) goto L1002; - ACTSPK[VERB]=GETNUM(NULL); + ACTVERB[VERB]=GETNUM(NULL); goto L1060; /* Read info about available liquids and other conditions, store in COND. */ @@ -416,14 +417,14 @@ L1106: /*etc*/ ; /* Treasures, as noted earlier, are objects 50 through MAXTRS (CURRENTLY 79). * Their props are initially -1, and are set to 0 the first time they are - * described. TALLY keeps track of how many are not yet found, so we know + * described. game.tally keeps track of how many are not yet found, so we know * when to close the cave. */ MAXTRS=79; - TALLY=0; + game.tally=0; for (I=50; I<=MAXTRS; I++) { if(PTEXT[I] != 0)PROP[I]= -1; - TALLY=TALLY-PROP[I]; + 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 @@ -434,7 +435,7 @@ L1106: /*etc*/ ; HINTLC[I]=0; } /* end loop */ -/* Define some handy mnemonics. these correspond to object numbers. */ +/* Define some handy mnemonics. These correspond to object numbers. */ AXE=VOCWRD(12405,1); BATTER=VOCWRD(201202005,1); @@ -518,7 +519,7 @@ L1106: /*etc*/ ; * prior loc of each dwarf, initially garbage. DALTLC is alternate initial loc * for dwarf, in case one of them starts out on top of the adventurer. (No 2 * of the 5 initial locs are adjacent.) DSEEN is true if dwarf has seen him. - * DFLAG controls the level of activation of all this: + * game.dflag controls the level of activation of all this: * 0 No dwarf stuff yet (wait until reaches Hall Of Mists) * 1 Reached Hall Of Mists, but hasn't met first dwarf * 2 Met first dwarf, others start moving, no knives thrown yet @@ -531,9 +532,9 @@ L1106: /*etc*/ ; CHLOC=114; CHLOC2=140; for (I=1; I<=6; I++) { - DSEEN[I]=false; + game.dseen[I]=false; } /* end loop */ - DFLAG=0; + game.dflag=0; DLOC[1]=19; DLOC[2]=27; DLOC[3]=33; @@ -543,56 +544,56 @@ L1106: /*etc*/ ; DALTLC=18; /* Other random flags and counters, as follows: - * ABBNUM How often we should print non-abbreviated descriptions - * BONUS Used to determine amount of bonus if he reaches closing - * CLOCK1 Number of turns from finding last treasure till closing - * CLOCK2 Number of turns from first warning till blinding flash + * game.abbnum How often we should print non-abbreviated descriptions + * game.bonus Used to determine amount of bonus if he reaches closing + * game.clock1 Number of turns from finding last treasure till closing + * game.clock2 Number of turns from first warning till blinding flash * CONDS Min value for cond(loc) if loc has any hints - * DETAIL How often we've said "not allowed to give more detail" - * DKILL Number of dwarves killed (unused in scoring, needed for msg) - * FOOBAR Current progress in saying "FEE FIE FOE FOO". - * HOLDNG Number of objects being carried + * game.detail How often we've said "not allowed to give more detail" + * game.dkill Number 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" - * IWEST How many times he's said "west" instead of "w" - * KNFLOC 0 if no knife here, loc if knife here, -1 after caveat - * LIMIT Lifetime of lamp (not set here) + * 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) - * NUMDIE Number of times killed so far - * THRESH Next #turns threshhold (-1 if none) - * TRNDEX Index in TRNVAL of next threshhold (section 14 of database) - * TRNLUZ # points lost so far due to number of turns used - * TURNS Tallies how many commands he's given (ignores yes/no) + * 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) + * game.trnluz # points lost so far due to number of turns used + * game.turns Tallies how many commands he's given (ignores yes/no) * Logicals were explained earlier */ - TURNS=0; - TRNDEX=1; - THRESH= -1; - if(TRNVLS > 0)THRESH=MOD(TRNVAL[1],100000)+1; - TRNLUZ=0; - LMWARN=false; + game.turns=0; + game.trndex=1; + game.thresh= -1; + if(TRNVLS > 0)game.thresh=MOD(TRNVAL[1],100000)+1; + game.trnluz=0; + game.lmwarn=false; IGO=0; - IWEST=0; - KNFLOC=0; - DETAIL=0; - ABBNUM=5; + 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;} } /* end loop */ - NUMDIE=0; - HOLDNG=0; - DKILL=0; - FOOBAR=0; - BONUS=0; - CLOCK1=30; - CLOCK2=50; + game.numdie=0; + game.holdng=0; + game.dkill=0; + game.foobar=0; + game.bonus=0; + game.clock1=30; + game.clock2=50; CONDS=SETBIT(11); - SAVED=0; - CLOSNG=false; - PANIC=false; - CLOSED=false; - CLSHNT=false; - NOVICE=false; - SETUP=1; + game.saved=0; + game.closng=false; + game.panic=false; + game.closed=false; + game.clshint=false; + game.novice=false; + game.setup=1; /* if we can ever think of how, we should save it at this point */ @@ -696,7 +697,7 @@ static void quick_io(void) { quick_array(ATAB,TABSIZ); quick_array(PLAC,100); quick_array(FIXD,100); - quick_array(ACTSPK,VRBSIZ); + quick_array(ACTVERB,VRBSIZ); quick_array((long *)HINTS,(HNTMAX+1)*5-1); }