Unify ad_stun
This commit is contained in:
@@ -2789,6 +2789,7 @@ E void FDECL(mhitm_ad_phys, (struct monst *, struct attack *, struct monst *, st
|
|||||||
E void FDECL(mhitm_ad_ston, (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 void FDECL(mhitm_ad_were, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||||
E void FDECL(mhitm_ad_heal, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
E void FDECL(mhitm_ad_heal, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||||
|
E void FDECL(mhitm_ad_stun, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||||
E boolean FDECL(do_stone_u, (struct monst *));
|
E boolean FDECL(do_stone_u, (struct monst *));
|
||||||
E void FDECL(do_stone_mon, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
E void FDECL(do_stone_mon, (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));
|
||||||
|
|||||||
11
src/mhitm.c
11
src/mhitm.c
@@ -950,13 +950,10 @@ int dieroll;
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AD_STUN:
|
case AD_STUN:
|
||||||
if (magr->mcan)
|
mhitm_ad_stun(magr, mattk, mdef, &mhm);
|
||||||
break;
|
if (mhm.done)
|
||||||
if (canseemon(mdef))
|
return mhm.hitflags;
|
||||||
pline("%s %s for a moment.", Monnam(mdef),
|
break;
|
||||||
makeplural(stagger(pd, "stagger")));
|
|
||||||
mdef->mstun = 1;
|
|
||||||
goto physical;
|
|
||||||
case AD_LEGS:
|
case AD_LEGS:
|
||||||
if (magr->mcan) {
|
if (magr->mcan) {
|
||||||
mhm.damage = 0;
|
mhm.damage = 0;
|
||||||
|
|||||||
@@ -1239,11 +1239,9 @@ register struct attack *mattk;
|
|||||||
return mhm.hitflags;
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
case AD_STUN:
|
case AD_STUN:
|
||||||
hitmsg(mtmp, mattk);
|
mhitm_ad_stun(mtmp, mattk, &g.youmonst, &mhm);
|
||||||
if (!mtmp->mcan && !rn2(4)) {
|
if (mhm.done)
|
||||||
make_stunned((HStun & TIMEOUT) + (long) mhm.damage, TRUE);
|
return mhm.hitflags;
|
||||||
mhm.damage /= 2;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case AD_ACID:
|
case AD_ACID:
|
||||||
mhitm_ad_acid(mtmp, mattk, &g.youmonst, &mhm);
|
mhitm_ad_acid(mtmp, mattk, &g.youmonst, &mhm);
|
||||||
|
|||||||
48
src/uhitm.c
48
src/uhitm.c
@@ -3771,6 +3771,45 @@ struct mhitm_data *mhm;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
mhitm_ad_stun(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 (!Blind)
|
||||||
|
pline("%s %s for a moment.", Monnam(mdef),
|
||||||
|
makeplural(stagger(pd, "stagger")));
|
||||||
|
mdef->mstun = 1;
|
||||||
|
mhitm_ad_phys(magr, mattk, mdef, mhm);
|
||||||
|
if (mhm->done)
|
||||||
|
return;
|
||||||
|
} else if (mdef == &g.youmonst) {
|
||||||
|
/* mhitu */
|
||||||
|
hitmsg(magr, mattk);
|
||||||
|
if (!magr->mcan && !rn2(4)) {
|
||||||
|
make_stunned((HStun & TIMEOUT) + (long) mhm->damage, TRUE);
|
||||||
|
mhm->damage /= 2;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* mhitm */
|
||||||
|
if (magr->mcan)
|
||||||
|
return;
|
||||||
|
if (canseemon(mdef))
|
||||||
|
pline("%s %s for a moment.", Monnam(mdef),
|
||||||
|
makeplural(stagger(pd, "stagger")));
|
||||||
|
mdef->mstun = 1;
|
||||||
|
mhitm_ad_phys(magr, mattk, mdef, mhm);
|
||||||
|
if (mhm->done)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Template for monster hits monster for AD_FOO.
|
/* Template for monster hits monster for AD_FOO.
|
||||||
- replace "break" with return
|
- replace "break" with return
|
||||||
- replace "return" with mhm->done = TRUE
|
- replace "return" with mhm->done = TRUE
|
||||||
@@ -3833,11 +3872,10 @@ int specialdmg; /* blessed and/or silver bonus against various things */
|
|||||||
}
|
}
|
||||||
switch (mattk->adtyp) {
|
switch (mattk->adtyp) {
|
||||||
case AD_STUN:
|
case AD_STUN:
|
||||||
if (!Blind)
|
mhitm_ad_stun(&g.youmonst, mattk, mdef, &mhm);
|
||||||
pline("%s %s for a moment.", Monnam(mdef),
|
if (mhm.done)
|
||||||
makeplural(stagger(pd, "stagger")));
|
return mhm.hitflags;
|
||||||
mdef->mstun = 1;
|
break;
|
||||||
goto physical;
|
|
||||||
case AD_LEGS:
|
case AD_LEGS:
|
||||||
#if 0
|
#if 0
|
||||||
if (u.ucancelled) {
|
if (u.ucancelled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user