Unify ad_samu
This commit is contained in:
@@ -2792,6 +2792,7 @@ E void FDECL(mhitm_ad_heal, (struct monst *, struct attack *, struct monst *, st
|
||||
E void FDECL(mhitm_ad_stun, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||
E void FDECL(mhitm_ad_legs, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||
E void FDECL(mhitm_ad_dgst, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||
E void FDECL(mhitm_ad_samu, (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));
|
||||
|
||||
10
src/mhitu.c
10
src/mhitu.c
@@ -1165,14 +1165,10 @@ register struct attack *mattk;
|
||||
break;
|
||||
|
||||
case AD_SAMU:
|
||||
hitmsg(mtmp, mattk);
|
||||
/* when the Wizard or quest nemesis hits, there's a 1/20 chance
|
||||
to steal a quest artifact (any, not just the one for the hero's
|
||||
own role) or the Amulet or one of the invocation tools */
|
||||
if (!rn2(20))
|
||||
stealamulet(mtmp);
|
||||
mhitm_ad_samu(mtmp, mattk, &g.youmonst, &mhm);
|
||||
if (mhm.done)
|
||||
return mhm.hitflags;
|
||||
break;
|
||||
|
||||
case AD_TLPT:
|
||||
mhitm_ad_tlpt(mtmp, mattk, &g.youmonst, &mhm);
|
||||
if (mhm.done)
|
||||
|
||||
27
src/uhitm.c
27
src/uhitm.c
@@ -3959,6 +3959,33 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_samu(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 */
|
||||
hitmsg(magr, mattk);
|
||||
/* when the Wizard or quest nemesis hits, there's a 1/20 chance
|
||||
to steal a quest artifact (any, not just the one for the hero's
|
||||
own role) or the Amulet or one of the invocation tools */
|
||||
if (!rn2(20))
|
||||
stealamulet(magr);
|
||||
} else {
|
||||
/* mhitm */
|
||||
mhm->damage = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Template for monster hits monster for AD_FOO.
|
||||
- replace "break" with return
|
||||
- replace "return" with mhm->done = TRUE
|
||||
|
||||
Reference in New Issue
Block a user