Make hostile monsters with launcher and ammo keep away
If a hostile monster is wielding a ranged weapon, and is carrying appropriate ammo for it, make the monster try to stay away, outside the melee range.
This commit is contained in:
@@ -26,6 +26,22 @@ static NEARDATA const char *breathwep[] = {
|
||||
"strange breath #9"
|
||||
};
|
||||
|
||||
boolean
|
||||
m_has_launcher_and_ammo(mtmp)
|
||||
struct monst *mtmp;
|
||||
{
|
||||
struct obj *mwep = MON_WEP(mtmp);
|
||||
|
||||
if (mwep && is_launcher(mwep)) {
|
||||
struct obj *otmp;
|
||||
|
||||
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
|
||||
if (ammo_and_launcher(otmp, mwep))
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* hero is hit by something other than a monster */
|
||||
int
|
||||
thitu(tlev, dam, objp, name)
|
||||
|
||||
Reference in New Issue
Block a user