ranged_attk() - there can be only one
Relocate the newer code for the function to mdlib.c where makedefs can still use it.
This commit is contained in:
@@ -1308,6 +1308,7 @@ extern int buzzmu(struct monst *, struct attack *);
|
||||
|
||||
extern void runtime_info_init(void);
|
||||
extern const char *do_runtime_info(int *);
|
||||
extern boolean ranged_attk(struct permonst *);
|
||||
extern void release_runtime_info(void);
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
extern void dump_glyphids(void);
|
||||
@@ -1620,7 +1621,6 @@ extern boolean resists_drli(struct monst *);
|
||||
extern boolean resists_magm(struct monst *);
|
||||
extern boolean resists_blnd(struct monst *);
|
||||
extern boolean can_blnd(struct monst *, struct monst *, uchar, struct obj *);
|
||||
extern boolean ranged_attk(struct permonst *);
|
||||
extern boolean mon_hates_silver(struct monst *);
|
||||
extern boolean hates_silver(struct permonst *);
|
||||
extern boolean mon_hates_blessings(struct monst *);
|
||||
|
||||
17
src/mdlib.c
17
src/mdlib.c
@@ -62,6 +62,7 @@ int case_insensitive_comp(const char *, const char *);
|
||||
static void make_version(void);
|
||||
static char *eos(char *);
|
||||
int mstrength(struct permonst *);
|
||||
boolean ranged_attk(struct permonst *);
|
||||
|
||||
#if 0
|
||||
static char *mdlib_strsubst(char *, const char *, const char *);
|
||||
@@ -313,7 +314,6 @@ RESTORE_WARNING_FORMAT_NONLITERAL
|
||||
* transfer relevant generated monstr values to include/monsters.h;
|
||||
* delete src/monstr.c.
|
||||
*/
|
||||
static boolean mdlib_ranged_attk(struct permonst *);
|
||||
|
||||
/*
|
||||
* This routine is designed to return an integer value which represents
|
||||
@@ -333,7 +333,7 @@ mstrength(struct permonst* ptr)
|
||||
n += (!!(ptr->geno & G_LGROUP)) << 1;
|
||||
|
||||
/* for ranged attacks */
|
||||
if (mdlib_ranged_attk(ptr))
|
||||
if (ranged_attk(ptr))
|
||||
n++;
|
||||
|
||||
/* for higher ac values */
|
||||
@@ -379,17 +379,14 @@ mstrength(struct permonst* ptr)
|
||||
}
|
||||
|
||||
/* returns True if monster can attack at range */
|
||||
static boolean
|
||||
mdlib_ranged_attk(register struct permonst* ptr)
|
||||
boolean
|
||||
ranged_attk(struct permonst* ptr)
|
||||
{
|
||||
register int i, j;
|
||||
register int atk_mask = (1 << AT_BREA) | (1 << AT_SPIT) | (1 << AT_GAZE);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NATTK; i++) {
|
||||
if ((j = ptr->mattk[i].aatyp) >= AT_WEAP
|
||||
|| (j < 32 && (atk_mask & (1 << j)) != 0))
|
||||
for (i = 0; i < NATTK; i++)
|
||||
if (DISTANCE_ATTK_TYPE(ptr->mattk[i].aatyp))
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif /* (NH_DEVEL_STATUS != NH_STATUS_RELEASED) || DEBUG || MAKEDEFS_C */
|
||||
|
||||
@@ -302,18 +302,6 @@ can_blnd(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* returns True if monster can attack at range */
|
||||
boolean
|
||||
ranged_attk(struct permonst* ptr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NATTK; i++)
|
||||
if (DISTANCE_ATTK_TYPE(ptr->mattk[i].aatyp))
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* True if specific monster is especially affected by silver weapons */
|
||||
boolean
|
||||
mon_hates_silver(struct monst *mon)
|
||||
|
||||
Reference in New Issue
Block a user