-static int finish_init(void);
-
-void initialise(void) {
- if (oldstyle)
- printf("Initialising...\n");
- finish_init();
-}
-
-static int finish_init(void) {
- for (I=1; I<=100; I++) {
- PLACE[I]=0;
- PROP[I]=0;
- LINK[I]=0;
- {long x = I+100; LINK[x]=0;}
- } /* end loop */
-
- /* 1102 */ for (I=1; I<=LOCSIZ; I++) {
- ABB[I]=0;
- 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;
- } /* end loop */
-
-/* Set up the ATLOC and 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
- * "PLAC" and "FIXD". Also, since two-placed objects are typically best
- * described last, we'll drop them first. */
-
- /* 1106 */ for (I=1; I<=100; I++) {
- K=101-I;
- if(FIXD[K] <= 0) goto L1106;
- DROP(K+100,FIXD[K]);
- DROP(K,PLAC[K]);
-L1106: /*etc*/ ;
- } /* end loop */
-
- for (I=1; I<=100; I++) {
- K=101-I;
- 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).
- * 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
- * when to close the cave. */
-
- MAXTRS=79;
- TALLY=0;
- for (I=50; I<=MAXTRS; I++) {
- if(PTEXT[I] != 0)PROP[I]= -1;
- TALLY=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. */
-
- for (I=1; I<=HNTMAX; I++) {
- HINTED[I]=false;
- HINTLC[I]=0;
- } /* end loop */
-
-/* Define some handy mnemonics. These correspond to object numbers. */
-
- AXE=VOCWRD(12405,1);
- BATTER=VOCWRD(201202005,1);
- BEAR=VOCWRD(2050118,1);
- BIRD=VOCWRD(2091804,1);
- BLOOD=VOCWRD(212151504,1);
- BOTTLE=VOCWRD(215202012,1);
- CAGE=VOCWRD(3010705,1);
- CAVITY=VOCWRD(301220920,1);
- CHASM=VOCWRD(308011913,1);
- CLAM=VOCWRD(3120113,1);
- DOOR=VOCWRD(4151518,1);
- DRAGON=VOCWRD(418010715,1);
- DWARF=VOCWRD(423011806,1);
- FISSUR=VOCWRD(609191921,1);
- FOOD=VOCWRD(6151504,1);
- GRATE=VOCWRD(718012005,1);
- KEYS=VOCWRD(11052519,1);
- KNIFE=VOCWRD(1114090605,1);
- LAMP=VOCWRD(12011316,1);
- MAGZIN=VOCWRD(1301070126,1);
- MESSAG=VOCWRD(1305191901,1);
- MIRROR=VOCWRD(1309181815,1);
- OGRE=VOCWRD(15071805,1);
- OIL=VOCWRD(150912,1);
- OYSTER=VOCWRD(1525192005,1);
- PILLOW=VOCWRD(1609121215,1);
- PLANT=VOCWRD(1612011420,1);
- PLANT2=PLANT+1;
- RESER=VOCWRD(1805190518,1);
- ROD=VOCWRD(181504,1);
- ROD2=ROD+1;
- SIGN=VOCWRD(19090714,1);
- SNAKE=VOCWRD(1914011105,1);
- STEPS=VOCWRD(1920051619,1);
- TROLL=VOCWRD(2018151212,1);
- TROLL2=TROLL+1;
- URN=VOCWRD(211814,1);
- VEND=VOCWRD(1755140409,1);
- VOLCAN=VOCWRD(1765120301,1);
- WATER=VOCWRD(1851200518,1);