Minor ranged attack tweak

Make monsters with magic and gaze attacks avoid hero,
just like spitters and breathers already did.
Some small code cleanup related to the ranged attacks.
This commit is contained in:
Pasi Kallinen
2022-08-07 22:33:47 +03:00
parent 2b51a22c6c
commit b635160297
3 changed files with 15 additions and 20 deletions
+3 -14
View File
@@ -306,22 +306,11 @@ can_blnd(
boolean
ranged_attk(struct permonst* ptr)
{
register int i, atyp;
long atk_mask = (1L << AT_BREA) | (1L << AT_SPIT) | (1L << AT_GAZE);
int i;
/* was: (attacktype(ptr, AT_BREA) || attacktype(ptr, AT_WEAP)
* || attacktype(ptr, AT_SPIT) || attacktype(ptr, AT_GAZE)
* || attacktype(ptr, AT_MAGC));
* but that's too slow -dlc
*/
for (i = 0; i < NATTK; i++) {
atyp = ptr->mattk[i].aatyp;
if (atyp >= AT_WEAP)
for (i = 0; i < NATTK; i++)
if (DISTANCE_ATTK_TYPE(ptr->mattk[i].aatyp))
return TRUE;
/* assert(atyp < 32); */
if ((atk_mask & (1L << atyp)) != 0L)
return TRUE;
}
return FALSE;
}