E void FDECL(mhitm_ad_famn, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
E void FDECL(mhitm_ad_pest, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
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 int FDECL(damageum, (struct monst *, struct attack *, int));
E void FDECL(missum, (struct monst *, struct attack *, BOOLEAN_P));
E int FDECL(passive, (struct monst *, struct obj *, BOOLEAN_P, int,
return mhm.hitflags;
break;
case AD_HALU:
- if (!magr->mcan && haseyes(pd) && mdef->mcansee) {
- if (g.vis && canseemon(mdef))
- pline("%s looks %sconfused.", Monnam(mdef),
- mdef->mconf ? "more " : "");
- mdef->mconf = 1;
- mdef->mstrategy &= ~STRAT_WAITFORU;
- }
- mhm.damage = 0;
+ mhitm_ad_halu(magr, mattk, mdef, &mhm);
+ if (mhm.done)
+ return mhm.hitflags;
break;
case AD_CURS:
mhitm_ad_curs(magr, mattk, mdef, &mhm);
}
}
+void
+mhitm_ad_halu(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 */
+ mhm->damage = 0;
+ } else if (mdef == &g.youmonst) {
+ /* mhitu */
+ mhm->damage = 0;
+ } else {
+ /* mhitm */
+ int armpro = magic_negation(mdef);
+ boolean cancelled = magr->mcan || !(rn2(10) >= 3 * armpro);
+
+ if (!magr->mcan && haseyes(pd) && mdef->mcansee) {
+ if (g.vis && canseemon(mdef))
+ pline("%s looks %sconfused.", Monnam(mdef),
+ mdef->mconf ? "more " : "");
+ mdef->mconf = 1;
+ mdef->mstrategy &= ~STRAT_WAITFORU;
+ }
+ mhm->damage = 0;
+ }
+}
/* Template for monster hits monster for AD_FOO.
- replace "break" with return