Monsters can see player resistances
If monsters see you resist something, generally elemental or magical attack, or if they see you reflect an attack, they learn that and will adjust their attack accordingly. Originally from SporkHack, but this version comes via EvilHack with some minor changes.
This commit is contained in:
14
src/uhitm.c
14
src/uhitm.c
@@ -2004,6 +2004,7 @@ mhitm_ad_fire(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
return;
|
||||
} else if (Fire_resistance) {
|
||||
pline_The("fire doesn't feel hot!");
|
||||
monstseesu(M_SEEN_FIRE);
|
||||
mhm->damage = 0;
|
||||
}
|
||||
if ((int) magr->m_lev > rn2(20))
|
||||
@@ -2094,6 +2095,7 @@ mhitm_ad_cold(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
pline("You're covered in frost!");
|
||||
if (Cold_resistance) {
|
||||
pline_The("frost doesn't seem cold!");
|
||||
monstseesu(M_SEEN_COLD);
|
||||
mhm->damage = 0;
|
||||
}
|
||||
if ((int) magr->m_lev > rn2(20))
|
||||
@@ -2158,6 +2160,7 @@ mhitm_ad_elec(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
You("get zapped!");
|
||||
if (Shock_resistance) {
|
||||
pline_The("zap doesn't shock you!");
|
||||
monstseesu(M_SEEN_ELEC);
|
||||
mhm->damage = 0;
|
||||
}
|
||||
if ((int) magr->m_lev > rn2(20))
|
||||
@@ -2205,6 +2208,7 @@ mhitm_ad_acid(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
if (Acid_resistance) {
|
||||
pline("You're covered in %s, but it seems harmless.",
|
||||
hliquid("acid"));
|
||||
monstseesu(M_SEEN_ACID);
|
||||
mhm->damage = 0;
|
||||
} else {
|
||||
pline("You're covered in %s! It burns!", hliquid("acid"));
|
||||
@@ -2881,8 +2885,10 @@ mhitm_ad_slee(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
|
||||
hitmsg(magr, mattk);
|
||||
if (uncancelled && g.multi >= 0 && !rn2(5)) {
|
||||
if (Sleep_resistance)
|
||||
if (Sleep_resistance) {
|
||||
monstseesu(M_SEEN_SLEEP);
|
||||
return;
|
||||
}
|
||||
fall_asleep(-rnd(10), TRUE);
|
||||
if (Blind)
|
||||
You("are put to sleep!");
|
||||
@@ -4881,6 +4887,8 @@ passive(struct monst *mon,
|
||||
|
||||
if (!Acid_resistance)
|
||||
mdamageu(mon, tmp);
|
||||
else
|
||||
monstseesu(M_SEEN_ACID);
|
||||
if (!rn2(30))
|
||||
erode_armor(&g.youmonst, ERODE_CORRODE);
|
||||
}
|
||||
@@ -4945,6 +4953,7 @@ passive(struct monst *mon,
|
||||
/* wrath of gods for attacking Oracle */
|
||||
if (Antimagic) {
|
||||
shieldeff(u.ux, u.uy);
|
||||
monstseesu(M_SEEN_MAGR);
|
||||
pline("A hail of magic missiles narrowly misses you!");
|
||||
} else {
|
||||
You("are hit by magic missiles appearing from thin air!");
|
||||
@@ -5021,6 +5030,7 @@ passive(struct monst *mon,
|
||||
if (Cold_resistance) {
|
||||
shieldeff(u.ux, u.uy);
|
||||
You_feel("a mild chill.");
|
||||
monstseesu(M_SEEN_COLD);
|
||||
ugolemeffects(AD_COLD, tmp);
|
||||
break;
|
||||
}
|
||||
@@ -5044,6 +5054,7 @@ passive(struct monst *mon,
|
||||
if (Fire_resistance) {
|
||||
shieldeff(u.ux, u.uy);
|
||||
You_feel("mildly warm.");
|
||||
monstseesu(M_SEEN_FIRE);
|
||||
ugolemeffects(AD_FIRE, tmp);
|
||||
break;
|
||||
}
|
||||
@@ -5055,6 +5066,7 @@ passive(struct monst *mon,
|
||||
if (Shock_resistance) {
|
||||
shieldeff(u.ux, u.uy);
|
||||
You_feel("a mild tingle.");
|
||||
monstseesu(M_SEEN_ELEC);
|
||||
ugolemeffects(AD_ELEC, tmp);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user