Pyrolisk stops gazing if it sees you resist
This commit is contained in:
19
src/mhitu.c
19
src/mhitu.c
@@ -1476,6 +1476,11 @@ gazemu(struct monst *mtmp, struct attack *mattk)
|
|||||||
};
|
};
|
||||||
int react = -1;
|
int react = -1;
|
||||||
boolean cancelled = (mtmp->mcan != 0), already = FALSE;
|
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
|
/* assumes that hero has to see monster's gaze in order to be
|
||||||
affected, rather than monster just having to look at hero;
|
affected, rather than monster just having to look at hero;
|
||||||
@@ -1540,8 +1545,7 @@ gazemu(struct monst *mtmp, struct attack *mattk)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AD_CONF:
|
case AD_CONF:
|
||||||
if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
|
if (mcanseeu && !mtmp->mspec_used && rn2(5)) {
|
||||||
&& !mtmp->mspec_used && rn2(5)) {
|
|
||||||
if (cancelled) {
|
if (cancelled) {
|
||||||
react = 0; /* "confused" */
|
react = 0; /* "confused" */
|
||||||
already = (mtmp->mconf != 0);
|
already = (mtmp->mconf != 0);
|
||||||
@@ -1559,8 +1563,7 @@ gazemu(struct monst *mtmp, struct attack *mattk)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AD_STUN:
|
case AD_STUN:
|
||||||
if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
|
if (mcanseeu && !mtmp->mspec_used && rn2(5)) {
|
||||||
&& !mtmp->mspec_used && rn2(5)) {
|
|
||||||
if (cancelled) {
|
if (cancelled) {
|
||||||
react = 1; /* "stunned" */
|
react = 1; /* "stunned" */
|
||||||
already = (mtmp->mstun != 0);
|
already = (mtmp->mstun != 0);
|
||||||
@@ -1606,8 +1609,7 @@ gazemu(struct monst *mtmp, struct attack *mattk)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AD_FIRE:
|
case AD_FIRE:
|
||||||
if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
|
if (mcanseeu && !mtmp->mspec_used && rn2(5)) {
|
||||||
&& !mtmp->mspec_used && rn2(5)) {
|
|
||||||
if (cancelled) {
|
if (cancelled) {
|
||||||
react = rn1(2, 4); /* "irritated" || "inflamed" */
|
react = rn1(2, 4); /* "irritated" || "inflamed" */
|
||||||
} else {
|
} else {
|
||||||
@@ -1636,8 +1638,7 @@ gazemu(struct monst *mtmp, struct attack *mattk)
|
|||||||
break;
|
break;
|
||||||
#ifdef PM_BEHOLDER /* work in progress */
|
#ifdef PM_BEHOLDER /* work in progress */
|
||||||
case AD_SLEE:
|
case AD_SLEE:
|
||||||
if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
|
if (mcanseeu && g.multi >= 0 && !rn2(5) && !Sleep_resistance) {
|
||||||
&& g.multi >= 0 && !rn2(5) && !Sleep_resistance) {
|
|
||||||
if (cancelled) {
|
if (cancelled) {
|
||||||
react = 6; /* "tired" */
|
react = 6; /* "tired" */
|
||||||
already = (mtmp->mfrozen != 0); /* can't happen... */
|
already = (mtmp->mfrozen != 0); /* can't happen... */
|
||||||
@@ -1649,7 +1650,7 @@ gazemu(struct monst *mtmp, struct attack *mattk)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AD_SLOW:
|
case AD_SLOW:
|
||||||
if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my) && mtmp->mcansee
|
if (mcanseeu
|
||||||
&& (HFast & (INTRINSIC | TIMEOUT)) && !defended(mtmp, AD_SLOW)
|
&& (HFast & (INTRINSIC | TIMEOUT)) && !defended(mtmp, AD_SLOW)
|
||||||
&& !rn2(4)) {
|
&& !rn2(4)) {
|
||||||
if (cancelled) {
|
if (cancelled) {
|
||||||
|
|||||||
@@ -1359,7 +1359,7 @@ monstseesu(unsigned long seenres)
|
|||||||
{
|
{
|
||||||
struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
|
|
||||||
if (seenres == M_SEEN_NOTHING)
|
if (seenres == M_SEEN_NOTHING || u.uswallow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
|
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
|
||||||
|
|||||||
Reference in New Issue
Block a user