Unify ad_ston
This commit is contained in:
@@ -2786,6 +2786,7 @@ E void FDECL(mhitm_ad_pest, (struct monst *, struct attack *, struct monst *, st
|
|||||||
E void FDECL(mhitm_ad_deth, (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 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_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 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));
|
||||||
|
|||||||
@@ -1007,9 +1007,7 @@ int dieroll;
|
|||||||
return mhm.hitflags;
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
case AD_STON:
|
case AD_STON:
|
||||||
if (magr->mcan)
|
mhitm_ad_ston(magr, mattk, mdef, &mhm);
|
||||||
break;
|
|
||||||
do_stone_mon(magr, mattk, mdef, &mhm);
|
|
||||||
if (mhm.done)
|
if (mhm.done)
|
||||||
return mhm.hitflags;
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
|
|||||||
20
src/mhitu.c
20
src/mhitu.c
@@ -1113,22 +1113,10 @@ register struct attack *mattk;
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AD_STON: /* cockatrice */
|
case AD_STON:
|
||||||
hitmsg(mtmp, mattk);
|
mhitm_ad_ston(mtmp, mattk, &g.youmonst, &mhm);
|
||||||
if (!rn2(3)) {
|
if (mhm.done)
|
||||||
if (mtmp->mcan) {
|
return mhm.hitflags;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case AD_STCK:
|
case AD_STCK:
|
||||||
mhitm_ad_stck(mtmp, mattk, &g.youmonst, &mhm);
|
mhitm_ad_stck(mtmp, mattk, &g.youmonst, &mhm);
|
||||||
|
|||||||
50
src/uhitm.c
50
src/uhitm.c
@@ -3600,6 +3600,50 @@ struct mhitm_data *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.
|
/* 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
|
||||||
@@ -3704,9 +3748,9 @@ int specialdmg; /* blessed and/or silver bonus against various things */
|
|||||||
return mhm.hitflags;
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
case AD_STON:
|
case AD_STON:
|
||||||
if (!munstone(mdef, TRUE))
|
mhitm_ad_ston(&g.youmonst, mattk, mdef, &mhm);
|
||||||
minstapetrify(mdef, TRUE);
|
if (mhm.done)
|
||||||
mhm.damage = 0;
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
case AD_SSEX:
|
case AD_SSEX:
|
||||||
case AD_SEDU:
|
case AD_SEDU:
|
||||||
|
|||||||
Reference in New Issue
Block a user