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 void FDECL(mhitm_ad_were, (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));
}
goto physical;
case AD_WERE:
+ mhitm_ad_were(magr, mattk, mdef, &mhm);
+ if (mhm.done)
+ return mhm.hitflags;
+ break;
case AD_HEAL:
case AD_PHYS:
physical:
return mhm.hitflags;
break;
case AD_WERE:
- hitmsg(mtmp, mattk);
- if (uncancelled && !rn2(4) && u.ulycn == NON_PM
- && !Protection_from_shape_changers && !defends(AD_WERE, uwep)) {
- You_feel("feverish.");
- exercise(A_CON, FALSE);
- set_ulycn(monsndx(mdat));
- retouch_equipment(2);
- }
+ mhitm_ad_were(mtmp, mattk, &g.youmonst, &mhm);
+ if (mhm.done)
+ return mhm.hitflags;
break;
case AD_SGLD:
mhitm_ad_sgld(mtmp, mattk, &g.youmonst, &mhm);
}
}
+void
+mhitm_ad_were(magr, mattk, mdef, mhm)
+struct monst *magr;
+struct attack *mattk;
+struct monst *mdef;
+struct mhitm_data *mhm;
+{
+ struct permonst *pa = magr->data;
+ struct permonst *pd = mdef->data;
+
+ if (magr == &g.youmonst) {
+ /* uhitm */
+ mhitm_ad_phys(&g.youmonst, mattk, mdef, mhm);
+ if (mhm->done)
+ return;
+ } else if (mdef == &g.youmonst) {
+ /* mhitu */
+ int armpro = magic_negation(mdef);
+ boolean uncancelled = !magr->mcan && (rn2(10) >= 3 * armpro);
+
+ hitmsg(magr, mattk);
+ if (uncancelled && !rn2(4) && u.ulycn == NON_PM
+ && !Protection_from_shape_changers && !defends(AD_WERE, uwep)) {
+ You_feel("feverish.");
+ exercise(A_CON, FALSE);
+ set_ulycn(monsndx(pa));
+ retouch_equipment(2);
+ }
+ } else {
+ /* mhitm */
+ mhitm_ad_phys(&g.youmonst, 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
}
#endif
goto physical;
- case AD_WERE: /* no special effect on monsters */
+ case AD_WERE:
+ mhitm_ad_were(&g.youmonst, mattk, mdef, &mhm);
+ if (mhm.done)
+ return mhm.hitflags;
+ break;
case AD_HEAL: /* likewise */
case AD_PHYS:
physical: