projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
object_descriptions[] is now objects[].
[open-adventure.git]
/
main.c
diff --git
a/main.c
b/main.c
index 00a138f1160156223c6685b609d825b86d7e0575..92f4206f89981493c89904188fe26b7b90da898f 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-303,11
+303,11
@@
static bool spotted_by_pirate(int i)
int snarfed = 0;
bool movechest = false, robplayer = false;
for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
int snarfed = 0;
bool movechest = false, robplayer = false;
for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
- if (!object
_description
s[treasure].is_treasure)
+ if (!objects[treasure].is_treasure)
continue;
/* Pirate won't take pyramid from plover room or dark
* room (too easy!). */
continue;
/* Pirate won't take pyramid from plover room or dark
* room (too easy!). */
- if (treasure == PYRAMID && (game.loc == object
_descriptions[PYRAMID].plac || game.loc == object_description
s[EMERALD].plac)) {
+ if (treasure == PYRAMID && (game.loc == object
s[PYRAMID].plac || game.loc == object
s[EMERALD].plac)) {
continue;
}
if (TOTING(treasure) || HERE(treasure))
continue;
}
if (TOTING(treasure) || HERE(treasure))
@@
-339,9
+339,9
@@
static bool spotted_by_pirate(int i)
if (robplayer) {
rspeak(PIRATE_POUNCES);
for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
if (robplayer) {
rspeak(PIRATE_POUNCES);
for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
- if (!object
_description
s[treasure].is_treasure)
+ if (!objects[treasure].is_treasure)
continue;
continue;
- if (!(treasure == PYRAMID && (game.loc == object
_descriptions[PYRAMID].plac || game.loc == object_description
s[EMERALD].plac))) {
+ if (!(treasure == PYRAMID && (game.loc == object
s[PYRAMID].plac || game.loc == object
s[EMERALD].plac))) {
if (AT(treasure) && game.fixed[treasure] == 0)
carry(treasure, game.loc);
if (TOTING(treasure))
if (AT(treasure) && game.fixed[treasure] == 0)
carry(treasure, game.loc);
if (TOTING(treasure))
@@
-417,8
+417,8
@@
static bool dwarfmove(void)
if (game.dloc[i] == 0)
continue;
/* Fill tk array with all the places this dwarf might go. */
if (game.dloc[i] == 0)
continue;
/* Fill tk array with all the places this dwarf might go. */
- int j = 1;
- kk = KEY[game.dloc[i]];
+
unsigned
int j = 1;
+ kk =
T
KEY[game.dloc[i]];
if (kk != 0)
do {
game.newloc = T_DESTINATION(TRAVEL[kk]);
if (kk != 0)
do {
game.newloc = T_DESTINATION(TRAVEL[kk]);
@@
-541,7
+541,7
@@
static void croak(void)
static bool playermove(token_t verb, int motion)
{
static bool playermove(token_t verb, int motion)
{
- int scratchloc, k2, kk = KEY[game.loc];
+ int scratchloc, k2, kk =
T
KEY[game.loc];
game.newloc = game.loc;
if (kk == 0)
BUG(LOCATION_HAS_NO_TRAVEL_ENTRIES);
game.newloc = game.loc;
if (kk == 0)
BUG(LOCATION_HAS_NO_TRAVEL_ENTRIES);
@@
-564,7
+564,7
@@
static bool playermove(token_t verb, int motion)
scratchloc = T_DESTINATION(TRAVEL[kk]);
if (scratchloc != motion) {
if (!SPECIAL(scratchloc)) {
scratchloc = T_DESTINATION(TRAVEL[kk]);
if (scratchloc != motion) {
if (!SPECIAL(scratchloc)) {
- if (FORCED(scratchloc) && T_DESTINATION(TRAVEL[KEY[scratchloc]]) == motion)
+ if (FORCED(scratchloc) && T_DESTINATION(TRAVEL[
T
KEY[scratchloc]]) == motion)
k2 = kk;
}
if (TRAVEL[kk] >= 0) {
k2 = kk;
}
if (TRAVEL[kk] >= 0) {
@@
-580,7
+580,7
@@
static bool playermove(token_t verb, int motion)
}
motion = T_MOTION(TRAVEL[kk]);
}
motion = T_MOTION(TRAVEL[kk]);
- kk = KEY[game.loc];
+ kk =
T
KEY[game.loc];
break; /* fall through to ordinary travel */
}
} else {
break; /* fall through to ordinary travel */
}
} else {
@@
-709,13
+709,13
@@
static bool playermove(token_t verb, int motion)
game.prop[TROLL] = 0;
move(TROLL2, 0);
move(TROLL2 + NOBJECTS, 0);
game.prop[TROLL] = 0;
move(TROLL2, 0);
move(TROLL2 + NOBJECTS, 0);
- move(TROLL, object
_description
s[TROLL].plac);
- move(TROLL + NOBJECTS, object
_description
s[TROLL].fixd);
+ move(TROLL, objects[TROLL].plac);
+ move(TROLL + NOBJECTS, objects[TROLL].fixd);
juggle(CHASM);
game.newloc = game.loc;
return true;
} else {
juggle(CHASM);
game.newloc = game.loc;
return true;
} else {
- game.newloc = object
_descriptions[TROLL].plac + object_description
s[TROLL].fixd - game.loc;
+ game.newloc = object
s[TROLL].plac + object
s[TROLL].fixd - game.loc;
if (game.prop[TROLL] == 0)game.prop[TROLL] = 1;
if (!TOTING(BEAR)) return true;
rspeak(BRIDGE_COLLAPSE);
if (game.prop[TROLL] == 0)game.prop[TROLL] = 1;
if (!TOTING(BEAR)) return true;
rspeak(BRIDGE_COLLAPSE);
@@
-788,8
+788,8
@@
static bool closecheck(void)
}
move(TROLL, 0);
move(TROLL + NOBJECTS, 0);
}
move(TROLL, 0);
move(TROLL + NOBJECTS, 0);
- move(TROLL2, object
_description
s[TROLL].plac);
- move(TROLL2 + NOBJECTS, object
_description
s[TROLL].fixd);
+ move(TROLL2, objects[TROLL].plac);
+ move(TROLL2 + NOBJECTS, objects[TROLL].fixd);
juggle(CHASM);
if (game.prop[BEAR] != 3)DESTROY(BEAR);
game.prop[CHAIN] = 0;
juggle(CHASM);
if (game.prop[BEAR] != 3)DESTROY(BEAR);
game.prop[CHAIN] = 0;