Unify ad_acid
This commit is contained in:
@@ -2763,6 +2763,7 @@ E void FDECL(mhitm_ad_drli, (struct monst *, struct attack *, struct monst *, st
|
|||||||
E void FDECL(mhitm_ad_fire, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
E void FDECL(mhitm_ad_fire, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||||
E void FDECL(mhitm_ad_cold, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
E void FDECL(mhitm_ad_cold, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||||
E void FDECL(mhitm_ad_elec, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
E void FDECL(mhitm_ad_elec, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||||
|
E void FDECL(mhitm_ad_acid, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||||
E int FDECL(damageum, (struct monst *, struct attack *, int));
|
E int FDECL(damageum, (struct monst *, struct attack *, int));
|
||||||
E void FDECL(missum, (struct monst *, struct attack *, BOOLEAN_P));
|
E void FDECL(missum, (struct monst *, struct attack *, BOOLEAN_P));
|
||||||
E int FDECL(passive, (struct monst *, struct obj *, BOOLEAN_P, int,
|
E int FDECL(passive, (struct monst *, struct obj *, BOOLEAN_P, int,
|
||||||
|
|||||||
+3
-17
@@ -1031,23 +1031,9 @@ int dieroll;
|
|||||||
return mhm.hitflags;
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
case AD_ACID:
|
case AD_ACID:
|
||||||
if (magr->mcan) {
|
mhitm_ad_acid(magr, mattk, mdef, &mhm);
|
||||||
mhm.damage = 0;
|
if (mhm.done)
|
||||||
break;
|
return mhm.hitflags;
|
||||||
}
|
|
||||||
if (resists_acid(mdef)) {
|
|
||||||
if (g.vis && canseemon(mdef))
|
|
||||||
pline("%s is covered in %s, but it seems harmless.",
|
|
||||||
Monnam(mdef), hliquid("acid"));
|
|
||||||
mhm.damage = 0;
|
|
||||||
} else if (g.vis && canseemon(mdef)) {
|
|
||||||
pline("%s is covered in %s!", Monnam(mdef), hliquid("acid"));
|
|
||||||
pline("It burns %s!", mon_nam(mdef));
|
|
||||||
}
|
|
||||||
if (!rn2(30))
|
|
||||||
erode_armor(mdef, ERODE_CORRODE);
|
|
||||||
if (!rn2(6))
|
|
||||||
acid_damage(MON_WEP(mdef));
|
|
||||||
break;
|
break;
|
||||||
case AD_RUST:
|
case AD_RUST:
|
||||||
mhitm_ad_rust(magr, mattk, mdef, &mhm);
|
mhitm_ad_rust(magr, mattk, mdef, &mhm);
|
||||||
|
|||||||
+3
-12
@@ -1550,18 +1550,9 @@ register struct attack *mattk;
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AD_ACID:
|
case AD_ACID:
|
||||||
hitmsg(mtmp, mattk);
|
mhitm_ad_acid(mtmp, mattk, &g.youmonst, &mhm);
|
||||||
if (!mtmp->mcan && !rn2(3))
|
if (mhm.done)
|
||||||
if (Acid_resistance) {
|
return mhm.hitflags;
|
||||||
pline("You're covered in %s, but it seems harmless.",
|
|
||||||
hliquid("acid"));
|
|
||||||
mhm.damage = 0;
|
|
||||||
} else {
|
|
||||||
pline("You're covered in %s! It burns!", hliquid("acid"));
|
|
||||||
exercise(A_STR, FALSE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
mhm.damage = 0;
|
|
||||||
break;
|
break;
|
||||||
case AD_SLOW:
|
case AD_SLOW:
|
||||||
hitmsg(mtmp, mattk);
|
hitmsg(mtmp, mattk);
|
||||||
|
|||||||
+52
-2
@@ -2213,6 +2213,55 @@ struct mhitm_data *mhm;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
mhitm_ad_acid(magr, mattk, mdef, mhm)
|
||||||
|
struct monst *magr;
|
||||||
|
struct attack *mattk;
|
||||||
|
struct monst *mdef;
|
||||||
|
struct mhitm_data *mhm;
|
||||||
|
{
|
||||||
|
struct permonst *pd = mdef->data;
|
||||||
|
|
||||||
|
if (magr == &g.youmonst) {
|
||||||
|
/* uhitm */
|
||||||
|
if (resists_acid(mdef))
|
||||||
|
mhm->damage = 0;
|
||||||
|
} else if (mdef == &g.youmonst) {
|
||||||
|
/* mhitu */
|
||||||
|
hitmsg(magr, mattk);
|
||||||
|
if (!magr->mcan && !rn2(3))
|
||||||
|
if (Acid_resistance) {
|
||||||
|
pline("You're covered in %s, but it seems harmless.",
|
||||||
|
hliquid("acid"));
|
||||||
|
mhm->damage = 0;
|
||||||
|
} else {
|
||||||
|
pline("You're covered in %s! It burns!", hliquid("acid"));
|
||||||
|
exercise(A_STR, FALSE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mhm->damage = 0;
|
||||||
|
} else {
|
||||||
|
/* mhitm */
|
||||||
|
if (magr->mcan) {
|
||||||
|
mhm->damage = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (resists_acid(mdef)) {
|
||||||
|
if (g.vis && canseemon(mdef))
|
||||||
|
pline("%s is covered in %s, but it seems harmless.",
|
||||||
|
Monnam(mdef), hliquid("acid"));
|
||||||
|
mhm->damage = 0;
|
||||||
|
} else if (g.vis && canseemon(mdef)) {
|
||||||
|
pline("%s is covered in %s!", Monnam(mdef), hliquid("acid"));
|
||||||
|
pline("It burns %s!", mon_nam(mdef));
|
||||||
|
}
|
||||||
|
if (!rn2(30))
|
||||||
|
erode_armor(mdef, ERODE_CORRODE);
|
||||||
|
if (!rn2(6))
|
||||||
|
acid_damage(MON_WEP(mdef));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Template for monster hits monster for AD_FOO.
|
/* Template for monster hits monster for AD_FOO.
|
||||||
- replace "break" with return
|
- replace "break" with return
|
||||||
@@ -2329,8 +2378,9 @@ int specialdmg; /* blessed and/or silver bonus against various things */
|
|||||||
return mhm.hitflags;
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
case AD_ACID:
|
case AD_ACID:
|
||||||
if (resists_acid(mdef))
|
mhitm_ad_acid(&g.youmonst, mattk, mdef, &mhm);
|
||||||
mhm.damage = 0;
|
if (mhm.done)
|
||||||
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
case AD_STON:
|
case AD_STON:
|
||||||
if (!munstone(mdef, TRUE))
|
if (!munstone(mdef, TRUE))
|
||||||
|
|||||||
Reference in New Issue
Block a user