15 printf("Initialising...\n");
17 for (int i = 1; i <= NOBJECTS; i++) {
18 game.place[i] = LOC_NOWHERE;
21 for (int i = 1; i <= NLOCATIONS; i++) {
22 if (!(locations[i].description.big == 0 || tkey[i] == 0)) {
24 if (T_TERMINATE(travel[k]))
25 conditions[i] |= (1 << COND_FORCED);
29 /* Set up the game.atloc and game.link arrays.
30 * We'll use the DROP subroutine, which prefaces new objects on the
31 * lists. Since we want things in the other order, we'll run the
32 * loop backwards. If the object is in two locs, we drop it twice.
33 * Also, since two-placed objects are typically best described
34 * last, we'll drop them first. */
35 for (int i = NOBJECTS; i >= 1; i--) {
36 if (objects[i].fixd > 0) {
37 drop(i + NOBJECTS, objects[i].fixd);
38 drop(i, objects[i].plac);
42 for (int i = 1; i <= NOBJECTS; i++) {
43 int k = NOBJECTS + 1 - i;
44 game.fixed[k] = objects[k].fixd;
45 if (objects[k].plac != 0 && objects[k].fixd <= 0)
46 drop(k, objects[k].plac);
49 /* Treasure props are initially -1, and are set to 0 the first time
50 * they are described. game.tally keeps track of how many are
51 * not yet found, so we know when to close the cave. */
52 for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
53 if (objects[treasure].is_treasure) {
54 if (objects[treasure].inventory != 0)
55 game.prop[treasure] = -1;
56 game.tally = game.tally - game.prop[treasure];
59 game.conds = setbit(11);