Unify ad_ssex
This commit is contained in:
@@ -2795,6 +2795,7 @@ E void FDECL(mhitm_ad_dgst, (struct monst *, struct attack *, struct monst *, st
|
|||||||
E void FDECL(mhitm_ad_samu, (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 void FDECL(mhitm_ad_dise, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
E void FDECL(mhitm_ad_dise, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||||
E void FDECL(mhitm_ad_sedu, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
E void FDECL(mhitm_ad_sedu, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
|
||||||
|
E void FDECL(mhitm_ad_ssex, (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));
|
||||||
|
|||||||
@@ -1020,6 +1020,10 @@ int dieroll;
|
|||||||
return mhm.hitflags;
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
case AD_SSEX:
|
case AD_SSEX:
|
||||||
|
mhitm_ad_ssex(magr, mattk, mdef, &mhm);
|
||||||
|
if (mhm.done)
|
||||||
|
return mhm.hitflags;
|
||||||
|
break;
|
||||||
case AD_SITM: /* for now these are the same */
|
case AD_SITM: /* for now these are the same */
|
||||||
case AD_SEDU:
|
case AD_SEDU:
|
||||||
mhitm_ad_sedu(magr, mattk, mdef, &mhm);
|
mhitm_ad_sedu(magr, mattk, mdef, &mhm);
|
||||||
|
|||||||
+4
-7
@@ -1105,13 +1105,10 @@ register struct attack *mattk;
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case AD_SSEX:
|
case AD_SSEX:
|
||||||
if (SYSOPT_SEDUCE) {
|
mhitm_ad_ssex(mtmp, mattk, &g.youmonst, &mhm);
|
||||||
if (could_seduce(mtmp, &g.youmonst, mattk) == 1 && !mtmp->mcan)
|
if (mhm.done)
|
||||||
if (doseduce(mtmp))
|
return mhm.hitflags;
|
||||||
return 3;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
/*FALLTHRU*/
|
|
||||||
case AD_SITM: /* for now these are the same */
|
case AD_SITM: /* for now these are the same */
|
||||||
case AD_SEDU:
|
case AD_SEDU:
|
||||||
mhitm_ad_sedu(mtmp, mattk, &g.youmonst, &mhm);
|
mhitm_ad_sedu(mtmp, mattk, &g.youmonst, &mhm);
|
||||||
|
|||||||
+38
@@ -4149,6 +4149,40 @@ struct mhitm_data *mhm;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
mhitm_ad_ssex(magr, mattk, mdef, mhm)
|
||||||
|
struct monst *magr;
|
||||||
|
struct attack *mattk;
|
||||||
|
struct monst *mdef;
|
||||||
|
struct mhitm_data *mhm;
|
||||||
|
{
|
||||||
|
if (magr == &g.youmonst) {
|
||||||
|
/* uhitm */
|
||||||
|
mhitm_ad_sedu(magr, mattk, mdef, mhm);
|
||||||
|
if (mhm->done)
|
||||||
|
return;
|
||||||
|
} else if (mdef == &g.youmonst) {
|
||||||
|
/* mhitu */
|
||||||
|
if (SYSOPT_SEDUCE) {
|
||||||
|
if (could_seduce(magr, mdef, mattk) == 1 && !magr->mcan)
|
||||||
|
if (doseduce(magr)) {
|
||||||
|
mhm->hitflags = MM_HIT | MM_DEF_DIED; /* return 3??? */
|
||||||
|
mhm->done = TRUE;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mhitm_ad_sedu(magr, mattk, mdef, mhm);
|
||||||
|
if (mhm->done)
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
/* mhitm */
|
||||||
|
mhitm_ad_sedu(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
|
||||||
@@ -4262,6 +4296,10 @@ int specialdmg; /* blessed and/or silver bonus against various things */
|
|||||||
return mhm.hitflags;
|
return mhm.hitflags;
|
||||||
break;
|
break;
|
||||||
case AD_SSEX:
|
case AD_SSEX:
|
||||||
|
mhitm_ad_ssex(&g.youmonst, mattk, mdef, &mhm);
|
||||||
|
if (mhm.done)
|
||||||
|
return mhm.hitflags;
|
||||||
|
break;
|
||||||
case AD_SITM:
|
case AD_SITM:
|
||||||
case AD_SEDU:
|
case AD_SEDU:
|
||||||
mhitm_ad_sedu(&g.youmonst, mattk, mdef, &mhm);
|
mhitm_ad_sedu(&g.youmonst, mattk, mdef, &mhm);
|
||||||
|
|||||||
Reference in New Issue
Block a user