From 0a3d02b9d4e3f005149d4a5ff93bbda4d37958da Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 6 Aug 2022 10:45:11 +0300 Subject: [PATCH] Pyrolisk stops gazing if it sees you resist --- src/mhitu.c | 19 ++++++++++--------- src/mondata.c | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/mhitu.c b/src/mhitu.c index cd9183506..1997ace06 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1476,6 +1476,11 @@ gazemu(struct monst *mtmp, struct attack *mattk) }; int react = -1; boolean cancelled = (mtmp->mcan != 0), already = FALSE; + boolean mcanseeu = canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) + && mtmp->mcansee; + + if (m_seenres(mtmp, cvt_adtyp_to_mseenres(mattk->adtyp))) + return MM_MISS; /* assumes that hero has to see monster's gaze in order to be affected, rather than monster just having to look at hero; @@ -1540,8 +1545,7 @@ gazemu(struct monst *mtmp, struct attack *mattk) } break; case AD_CONF: - if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee - && !mtmp->mspec_used && rn2(5)) { + if (mcanseeu && !mtmp->mspec_used && rn2(5)) { if (cancelled) { react = 0; /* "confused" */ already = (mtmp->mconf != 0); @@ -1559,8 +1563,7 @@ gazemu(struct monst *mtmp, struct attack *mattk) } break; case AD_STUN: - if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee - && !mtmp->mspec_used && rn2(5)) { + if (mcanseeu && !mtmp->mspec_used && rn2(5)) { if (cancelled) { react = 1; /* "stunned" */ already = (mtmp->mstun != 0); @@ -1606,8 +1609,7 @@ gazemu(struct monst *mtmp, struct attack *mattk) } break; case AD_FIRE: - if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee - && !mtmp->mspec_used && rn2(5)) { + if (mcanseeu && !mtmp->mspec_used && rn2(5)) { if (cancelled) { react = rn1(2, 4); /* "irritated" || "inflamed" */ } else { @@ -1636,8 +1638,7 @@ gazemu(struct monst *mtmp, struct attack *mattk) break; #ifdef PM_BEHOLDER /* work in progress */ case AD_SLEE: - if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee - && g.multi >= 0 && !rn2(5) && !Sleep_resistance) { + if (mcanseeu && g.multi >= 0 && !rn2(5) && !Sleep_resistance) { if (cancelled) { react = 6; /* "tired" */ already = (mtmp->mfrozen != 0); /* can't happen... */ @@ -1649,7 +1650,7 @@ gazemu(struct monst *mtmp, struct attack *mattk) } break; case AD_SLOW: - if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee + if (mcanseeu && (HFast & (INTRINSIC | TIMEOUT)) && !defended(mtmp, AD_SLOW) && !rn2(4)) { if (cancelled) { diff --git a/src/mondata.c b/src/mondata.c index 59fc319e2..e3dcd10a2 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -1359,7 +1359,7 @@ monstseesu(unsigned long seenres) { struct monst *mtmp; - if (seenres == M_SEEN_NOTHING) + if (seenres == M_SEEN_NOTHING || u.uswallow) return; for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)