E void FDECL(mhitm_ad_deth, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
E void FDECL(mhitm_ad_halu, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
E void FDECL(mhitm_ad_phys, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
+E void FDECL(mhitm_ad_ston, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
E boolean FDECL(do_stone_u, (struct monst *));
E void FDECL(do_stone_mon, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
E int FDECL(damageum, (struct monst *, struct attack *, int));
return mhm.hitflags;
break;
case AD_STON:
- if (magr->mcan)
- break;
- do_stone_mon(magr, mattk, mdef, &mhm);
+ mhitm_ad_ston(magr, mattk, mdef, &mhm);
if (mhm.done)
return mhm.hitflags;
break;
}
break;
}
- case AD_STON: /* cockatrice */
- hitmsg(mtmp, mattk);
- if (!rn2(3)) {
- if (mtmp->mcan) {
- if (!Deaf)
- You_hear("a cough from %s!", mon_nam(mtmp));
- } else {
- if (!Deaf)
- You_hear("%s hissing!", s_suffix(mon_nam(mtmp)));
- if (!rn2(10)
- || (flags.moonphase == NEW_MOON && !have_lizard())) {
- if (do_stone_u(mtmp))
- return MM_HIT;
- }
- }
- }
+ case AD_STON:
+ mhitm_ad_ston(mtmp, mattk, &g.youmonst, &mhm);
+ if (mhm.done)
+ return mhm.hitflags;
break;
case AD_STCK:
mhitm_ad_stck(mtmp, mattk, &g.youmonst, &mhm);
}
}
+void
+mhitm_ad_ston(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 (!munstone(mdef, TRUE))
+ minstapetrify(mdef, TRUE);
+ mhm->damage = 0;
+ } else if (mdef == &g.youmonst) {
+ /* mhitu */
+ hitmsg(magr, mattk);
+ if (!rn2(3)) {
+ if (magr->mcan) {
+ if (!Deaf)
+ You_hear("a cough from %s!", mon_nam(magr));
+ } else {
+ if (!Deaf)
+ You_hear("%s hissing!", s_suffix(mon_nam(magr)));
+ if (!rn2(10)
+ || (flags.moonphase == NEW_MOON && !have_lizard())) {
+ if (do_stone_u(magr)) {
+ mhm->hitflags = MM_HIT;
+ mhm->done = TRUE;
+ return;
+ }
+ }
+ }
+ }
+ } else {
+ /* mhitm */
+ if (magr->mcan)
+ return;
+ do_stone_mon(magr, mattk, mdef, mhm);
+ if (mhm->done)
+ return;
+ }
+}
+
/* Template for monster hits monster for AD_FOO.
- replace "break" with return
- replace "return" with mhm->done = TRUE
return mhm.hitflags;
break;
case AD_STON:
- if (!munstone(mdef, TRUE))
- minstapetrify(mdef, TRUE);
- mhm.damage = 0;
+ mhitm_ad_ston(&g.youmonst, mattk, mdef, &mhm);
+ if (mhm.done)
+ return mhm.hitflags;
break;
case AD_SSEX:
case AD_SEDU: