Unify ad_conf
This commit is contained in:
@@ -2778,6 +2778,7 @@ E void FDECL(mhitm_ad_slee, (struct monst *, struct attack *, struct monst *, st
|
|||||||
E void FDECL(mhitm_ad_slim, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
E void FDECL(mhitm_ad_slim, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||||
E void FDECL(mhitm_ad_ench, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
E void FDECL(mhitm_ad_ench, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||||
E void FDECL(mhitm_ad_slow, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
E void FDECL(mhitm_ad_slow, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||||
|
E void FDECL(mhitm_ad_conf, (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
-10
@@ -1096,16 +1096,9 @@ int dieroll;
|
|||||||
return mhm.hitflags;
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
case AD_CONF:
|
case AD_CONF:
|
||||||
/* Since confusing another monster doesn't have a real time
|
mhitm_ad_conf(magr, mattk, mdef, &mhm);
|
||||||
* limit, setting spec_used would not really be right (though
|
if (mhm.done)
|
||||||
* we still should check for it).
|
return mhm.hitflags;
|
||||||
*/
|
|
||||||
if (!magr->mcan && !mdef->mconf && !magr->mspec_used) {
|
|
||||||
if (g.vis && canseemon(mdef))
|
|
||||||
pline("%s looks confused.", Monnam(mdef));
|
|
||||||
mdef->mconf = 1;
|
|
||||||
mdef->mstrategy &= ~STRAT_WAITFORU;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case AD_BLND:
|
case AD_BLND:
|
||||||
mhitm_ad_blnd(magr, mattk, mdef, &mhm);
|
mhitm_ad_blnd(magr, mattk, mdef, &mhm);
|
||||||
|
|||||||
+3
-10
@@ -1419,16 +1419,9 @@ register struct attack *mattk;
|
|||||||
return mhm.hitflags;
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
case AD_CONF:
|
case AD_CONF:
|
||||||
hitmsg(mtmp, mattk);
|
mhitm_ad_conf(mtmp, mattk, &g.youmonst, &mhm);
|
||||||
if (!mtmp->mcan && !rn2(4) && !mtmp->mspec_used) {
|
if (mhm.done)
|
||||||
mtmp->mspec_used = mtmp->mspec_used + (mhm.damage + rn2(6));
|
return mhm.hitflags;
|
||||||
if (Confusion)
|
|
||||||
You("are getting even more confused.");
|
|
||||||
else
|
|
||||||
You("are getting confused.");
|
|
||||||
make_confused(HConfusion + mhm.damage, FALSE);
|
|
||||||
}
|
|
||||||
mhm.damage = 0;
|
|
||||||
break;
|
break;
|
||||||
case AD_DETH:
|
case AD_DETH:
|
||||||
pline("%s reaches out with its deadly touch.", Monnam(mtmp));
|
pline("%s reaches out with its deadly touch.", Monnam(mtmp));
|
||||||
|
|||||||
+45
-5
@@ -3139,6 +3139,48 @@ struct mhitm_data *mhm;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
mhitm_ad_conf(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 (!mdef->mconf) {
|
||||||
|
if (canseemon(mdef))
|
||||||
|
pline("%s looks confused.", Monnam(mdef));
|
||||||
|
mdef->mconf = 1;
|
||||||
|
}
|
||||||
|
} else if (mdef == &g.youmonst) {
|
||||||
|
/* mhitu */
|
||||||
|
hitmsg(magr, mattk);
|
||||||
|
if (!magr->mcan && !rn2(4) && !magr->mspec_used) {
|
||||||
|
magr->mspec_used = magr->mspec_used + (mhm->damage + rn2(6));
|
||||||
|
if (Confusion)
|
||||||
|
You("are getting even more confused.");
|
||||||
|
else
|
||||||
|
You("are getting confused.");
|
||||||
|
make_confused(HConfusion + mhm->damage, FALSE);
|
||||||
|
}
|
||||||
|
mhm->damage = 0;
|
||||||
|
} else {
|
||||||
|
/* mhitm */
|
||||||
|
/* Since confusing another monster doesn't have a real time
|
||||||
|
* limit, setting spec_used would not really be right (though
|
||||||
|
* we still should check for it).
|
||||||
|
*/
|
||||||
|
if (!magr->mcan && !mdef->mconf && !magr->mspec_used) {
|
||||||
|
if (g.vis && canseemon(mdef))
|
||||||
|
pline("%s looks confused.", Monnam(mdef));
|
||||||
|
mdef->mconf = 1;
|
||||||
|
mdef->mstrategy &= ~STRAT_WAITFORU;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Template for monster hits monster for AD_FOO.
|
/* Template for monster hits monster for AD_FOO.
|
||||||
- replace "break" with return
|
- replace "break" with return
|
||||||
@@ -3372,11 +3414,9 @@ int specialdmg; /* blessed and/or silver bonus against various things */
|
|||||||
return mhm.hitflags;
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
case AD_CONF:
|
case AD_CONF:
|
||||||
if (!mdef->mconf) {
|
mhitm_ad_conf(&g.youmonst, mattk, mdef, &mhm);
|
||||||
if (canseemon(mdef))
|
if (mhm.done)
|
||||||
pline("%s looks confused.", Monnam(mdef));
|
return mhm.hitflags;
|
||||||
mdef->mconf = 1;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case AD_POLY:
|
case AD_POLY:
|
||||||
if (!negated && mhm.damage < mdef->mhp)
|
if (!negated && mhm.damage < mdef->mhp)
|
||||||
|
|||||||
Reference in New Issue
Block a user