-static int finish_init(void);
-
-void initialise(void) {
- if (oldstyle)
- printf("Initialising...\n");
- finish_init();
-}
-
-static int finish_init(void) {
- int i;
- for (i=1; i<=NOBJECTS; i++) {
- game.place[i]=0;
- game.prop[i]=0;
- game.link[i]=0;
- {long x = i+NOBJECTS; game.link[x]=0;}
- } /* end loop */
-
- for (i=1; i<=LOCSIZ; i++) {
- game.abbrev[i]=0;
- if (!(LTEXT[i] == 0 || KEY[i] == 0)) {
- K=KEY[i];
- if(MOD(labs(TRAVEL[K]),1000) == 1)COND[i]=2;
- }
- game.atloc[i]=0;
- } /* end loop */
-
-/* Set up the game.atloc and game.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 "game.place" and "fixed" as copies of "PLAC" and
- * "FIXD". Also, since two-placed objects are typically best
- * described last, we'll drop them first. */
-
- for (i=1; i<=NOBJECTS; i++) {
- K=NOBJECTS + 1 - i;
- if(FIXD[K] > 0) {
- DROP(K+NOBJECTS,FIXD[K]);
- DROP(K,PLAC[K]);
- }
- } /* end loop */
-
- 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 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. */
-
- game.tally=0;
- 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. 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++) {
- game.hinted[i]=false;
- game.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);