fix #4206 - feedback for pet's weapon
The report that a tame Archon got two "<pet>'s long sword is not affected" messages thought there was some duplication error when a flaming sphere exploded, which was incorrect. Since an Archon has two weapon attacks, getting that message twice just meant that both attacks hit. However, the player has only 1/6 chance to suffering passive fire damage to weapon, where monster-on-monster or monster- on-polyd-hero was inflicting that for every successful hit, so there was a bug here after all. Give monsters the same 1/6 chance. Also, add even more verbosity to that message--now that it won't be delivered so often--to mention what didn't affect the item. While investigating this, I noticed that hitting a steam vortex with a flammable weapon was doing fire damage to that weapon. Fire damage in the steam vortex definition makes some sense in that it allows fire resistance to give protection, but dishing out actual fire damage makes no sense and is now prevented for passive counter- effects.
This commit is contained in:
20
src/mhitm.c
20
src/mhitm.c
@@ -1382,20 +1382,24 @@ rustm(mdef, obj)
|
||||
struct monst *mdef;
|
||||
struct obj *obj;
|
||||
{
|
||||
int dmgtyp;
|
||||
int dmgtyp = -1, chance = 1;
|
||||
|
||||
if (!mdef || !obj)
|
||||
return; /* just in case */
|
||||
/* AD_ACID is handled in passivemm */
|
||||
if (dmgtype(mdef->data, AD_CORR))
|
||||
/* AD_ACID and AD_ENCH are handled in passivemm() and passiveum() */
|
||||
if (dmgtype(mdef->data, AD_CORR)) {
|
||||
dmgtyp = ERODE_CORRODE;
|
||||
else if (dmgtype(mdef->data, AD_RUST))
|
||||
} else if (dmgtype(mdef->data, AD_RUST)) {
|
||||
dmgtyp = ERODE_RUST;
|
||||
else if (dmgtype(mdef->data, AD_FIRE))
|
||||
} else if (dmgtype(mdef->data, AD_FIRE)
|
||||
/* steam vortex: fire resist applies, fire damage doesn't */
|
||||
&& mdef->data != &mons[PM_STEAM_VORTEX]) {
|
||||
dmgtyp = ERODE_BURN;
|
||||
else
|
||||
return;
|
||||
(void) erode_obj(obj, NULL, dmgtyp, EF_GREASE | EF_VERBOSE);
|
||||
chance = 6;
|
||||
}
|
||||
|
||||
if (dmgtyp >= 0 && !rn2(chance))
|
||||
(void) erode_obj(obj, (char *) 0, dmgtyp, EF_GREASE | EF_VERBOSE);
|
||||
}
|
||||
|
||||
STATIC_OVL void
|
||||
|
||||
Reference in New Issue
Block a user