projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Little cleanup of variable names
[open-adventure.git]
/
init.c
diff --git
a/init.c
b/init.c
index aae770424558e6f21c1ada2f4099bb4f1df5d97b..ca9d1940ae9f121fb48c104f5ceaff3a1f21cd59 100644
(file)
--- a/
init.c
+++ b/
init.c
@@
-5,6
+5,7
@@
#include "advent.h"
#include "database.h"
#include "advent.h"
#include "database.h"
+#include "newdb.h"
/*
* Initialisation
/*
* Initialisation
@@
-171,20
+172,19
@@
void initialise(void)
{
void initialise(void)
{
- int i, k;
if (oldstyle)
printf("Initialising...\n");
if (oldstyle)
printf("Initialising...\n");
- for (i=1; i<=NOBJECTS; i++) {
- game.place[i]
=0
;
- game.prop[i]
=
0;
+ for (i
nt i
=1; i<=NOBJECTS; i++) {
+ game.place[i]
= NOWHERE
;
+ game.prop[i]
=
0;
game.link[i+NOBJECTS]=game.link[i]=0;
}
game.link[i+NOBJECTS]=game.link[i]=0;
}
- for (i=1; i<=LOCSIZ; i++) {
+ for (i
nt i
=1; i<=LOCSIZ; i++) {
game.abbrev[i]=0;
game.abbrev[i]=0;
- if (!(
LTEXT[i]
== 0 || KEY[i] == 0)) {
- k=KEY[i];
+ if (!(
locations[i].description.big
== 0 || KEY[i] == 0)) {
+
int
k=KEY[i];
if(MOD(labs(TRAVEL[k]),1000) == 1)COND[i]=2;
}
game.atloc[i]=0;
if(MOD(labs(TRAVEL[k]),1000) == 1)COND[i]=2;
}
game.atloc[i]=0;
@@
-197,16
+197,16
@@
void initialise(void)
* 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. */
* 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;
+ for (i
nt i
=1; i<=NOBJECTS; i++) {
+
int
k=NOBJECTS + 1 - i;
if(FIXD[k] > 0) {
DROP(k+NOBJECTS,FIXD[k]);
DROP(k,PLAC[k]);
}
}
if(FIXD[k] > 0) {
DROP(k+NOBJECTS,FIXD[k]);
DROP(k,PLAC[k]);
}
}
- for (i=1; i<=NOBJECTS; i++) {
- k=NOBJECTS + 1 - i;
+ for (i
nt i
=1; i<=NOBJECTS; i++) {
+
int
k=NOBJECTS + 1 - i;
game.fixed[k]=FIXD[k];
if(PLAC[k] != 0 && FIXD[k] <= 0)
DROP(k,PLAC[k]);
game.fixed[k]=FIXD[k];
if(PLAC[k] != 0 && FIXD[k] <= 0)
DROP(k,PLAC[k]);
@@
-217,16
+217,16
@@
void initialise(void)
* 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;
* 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
];
+ for (i
nt treasure=MINTRS; treasure<=MAXTRS; treasure
++) {
+ if(
object_descriptions[treasure].inventory
!= 0)
+ game.prop[
treasure
]= -1;
+ game.tally=game.tally-game.prop[
treasure
];
}
/* 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. */
}
/* 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++) {
+ for (i
nt i
=1; i<=HNTMAX; i++) {
game.hinted[i]=false;
game.hintlc[i]=0;
}
game.hinted[i]=false;
game.hintlc[i]=0;
}
@@
-323,17
+323,17
@@
void initialise(void)
* chest's eventual location inside the maze. This loc is saved
* in game.chloc for ref. the dead end in the other maze has its
* loc stored in game.chloc2. */
* chest's eventual location inside the maze. This loc is saved
* in game.chloc for ref. the dead end in the other maze has its
* loc stored in game.chloc2. */
- game.chloc
=114
;
- game.chloc2
=140
;
- for (i=1; i<=NDWARVES; i++) {
+ game.chloc
= LOC_DEADEND12
;
+ game.chloc2
= LOC_DEADEND13
;
+ for (i
nt i
=1; i<=NDWARVES; i++) {
game.dseen[i]=false;
}
game.dflag=0;
game.dseen[i]=false;
}
game.dflag=0;
- game.dloc[1]
=19
;
- game.dloc[2]
=27
;
- game.dloc[3]
=33
;
- game.dloc[4]
=44
;
- game.dloc[5]
=64
;
+ game.dloc[1]
= LOC_KINGHALL
;
+ game.dloc[2]
= LOC_WESTBANK
;
+ game.dloc[3]
= LOC_Y2
;
+ game.dloc[4]
= LOC_ALIKE3
;
+ game.dloc[5]
= LOC_COMPLEX
;
game.dloc[6]=game.chloc;
/* Other random flags and counters, as follows:
game.dloc[6]=game.chloc;
/* Other random flags and counters, as follows:
@@
-382,6
+382,5
@@
void initialise(void)
game.closed=false;
game.clshnt=false;
game.novice=false;
game.closed=false;
game.clshnt=false;
game.novice=false;
- game.setup=1;
game.blklin=true;
}
game.blklin=true;
}