Give the FORCED property a real cond bit. Delete some unused code.
This commit is contained in:
parent
7f7f49b739
commit
51494657fd
4 changed files with 4 additions and 10 deletions
2
advent.h
2
advent.h
|
@ -151,7 +151,7 @@ extern int restore(FILE *);
|
||||||
#define LIQUID() (LIQ2(game.prop[BOTTLE]<0 ? -1-game.prop[BOTTLE] : game.prop[BOTTLE]))
|
#define LIQUID() (LIQ2(game.prop[BOTTLE]<0 ? -1-game.prop[BOTTLE] : game.prop[BOTTLE]))
|
||||||
#define LIQLOC(LOC) (LIQ2((MOD(conditions[LOC]/2*2,8)-5)*MOD(conditions[LOC]/4,2)+1))
|
#define LIQLOC(LOC) (LIQ2((MOD(conditions[LOC]/2*2,8)-5)*MOD(conditions[LOC]/4,2)+1))
|
||||||
#define CNDBIT(L,N) (TSTBIT(conditions[L],N))
|
#define CNDBIT(L,N) (TSTBIT(conditions[L],N))
|
||||||
#define FORCED(LOC) (conditions[LOC] == 2)
|
#define FORCED(LOC) CNDBIT(LOC, COND_FORCED)
|
||||||
#define DARK(DUMMY) ((!TSTBIT(conditions[game.loc],COND_LIT)) && (game.prop[LAMP] == 0 || !HERE(LAMP)))
|
#define DARK(DUMMY) ((!TSTBIT(conditions[game.loc],COND_LIT)) && (game.prop[LAMP] == 0 || !HERE(LAMP)))
|
||||||
#define PCT(N) (randrange(100) < (N))
|
#define PCT(N) (randrange(100) < (N))
|
||||||
#define GSTONE(OBJ) ((OBJ) == EMERALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH)
|
#define GSTONE(OBJ) ((OBJ) == EMERALD || (OBJ) == RUBY || (OBJ) == AMBER || (OBJ) == SAPPH)
|
||||||
|
|
3
common.h
3
common.h
|
@ -16,7 +16,8 @@ extern const char ascii_to_advent[128];
|
||||||
#define COND_NOBACK 4 /* Cannot use "back" to move away */
|
#define COND_NOBACK 4 /* Cannot use "back" to move away */
|
||||||
#define COND_ABOVE 5
|
#define COND_ABOVE 5
|
||||||
#define COND_DEEP 6 /* Deep - e.g where dwarves are active */
|
#define COND_DEEP 6 /* Deep - e.g where dwarves are active */
|
||||||
#define COND_FOREST 7 /* in the forest */
|
#define COND_FOREST 7 /* In the forest */
|
||||||
|
#define COND_FORCED 8 /* Only one way in or out of here */
|
||||||
/* Bits past 10 indicate areas of interest to "hint" routines */
|
/* Bits past 10 indicate areas of interest to "hint" routines */
|
||||||
#define COND_HBASE 10 /* Base for location hint bits */
|
#define COND_HBASE 10 /* Base for location hint bits */
|
||||||
#define COND_HCAVE 11 /* Trying to get into cave */
|
#define COND_HCAVE 11 /* Trying to get into cave */
|
||||||
|
|
|
@ -52,13 +52,6 @@ long PLAC[NOBJECTS + 1];
|
||||||
long FIXD[NOBJECTS + 1];
|
long FIXD[NOBJECTS + 1];
|
||||||
long ACTSPK[VRBSIZ + 1];
|
long ACTSPK[VRBSIZ + 1];
|
||||||
|
|
||||||
static bool is_set(long var, long position)
|
|
||||||
{
|
|
||||||
long mask = 1L << position;
|
|
||||||
bool result = (var & mask) == mask;
|
|
||||||
return (result);
|
|
||||||
}
|
|
||||||
|
|
||||||
static long GETTXT(long SKIP, long ONEWRD, long UPPER)
|
static long GETTXT(long SKIP, long ONEWRD, long UPPER)
|
||||||
{
|
{
|
||||||
/* Take characters from an input line and pack them into 30-bit words.
|
/* Take characters from an input line and pack them into 30-bit words.
|
||||||
|
|
2
init.c
2
init.c
|
@ -185,7 +185,7 @@ void initialise(void)
|
||||||
if (!(locations[i].description.big == 0 || KEY[i] == 0)) {
|
if (!(locations[i].description.big == 0 || KEY[i] == 0)) {
|
||||||
int k = KEY[i];
|
int k = KEY[i];
|
||||||
if (MOD(labs(TRAVEL[k]), 1000) == 1)
|
if (MOD(labs(TRAVEL[k]), 1000) == 1)
|
||||||
conditions[i] = 2;
|
conditions[i] |= (1 << COND_FORCED);
|
||||||
}
|
}
|
||||||
game.atloc[i] = 0;
|
game.atloc[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue