Unify ad_ssex

This commit is contained in:
Pasi Kallinen
2020-12-01 16:05:25 +02:00
parent 1696019361
commit 88e333a3a8
4 changed files with 47 additions and 7 deletions

View File

@@ -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_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_ssex, (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));

View File

@@ -1020,6 +1020,10 @@ int dieroll;
return mhm.hitflags;
break;
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_SEDU:
mhitm_ad_sedu(magr, mattk, mdef, &mhm);

View File

@@ -1105,13 +1105,10 @@ register struct attack *mattk;
break;
case AD_SSEX:
if (SYSOPT_SEDUCE) {
if (could_seduce(mtmp, &g.youmonst, mattk) == 1 && !mtmp->mcan)
if (doseduce(mtmp))
return 3;
break;
}
/*FALLTHRU*/
mhitm_ad_ssex(mtmp, mattk, &g.youmonst, &mhm);
if (mhm.done)
return mhm.hitflags;
break;
case AD_SITM: /* for now these are the same */
case AD_SEDU:
mhitm_ad_sedu(mtmp, mattk, &g.youmonst, &mhm);

View File

@@ -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.
- replace "break" with return
@@ -4262,6 +4296,10 @@ int specialdmg; /* blessed and/or silver bonus against various things */
return mhm.hitflags;
break;
case AD_SSEX:
mhitm_ad_ssex(&g.youmonst, mattk, mdef, &mhm);
if (mhm.done)
return mhm.hitflags;
break;
case AD_SITM:
case AD_SEDU:
mhitm_ad_sedu(&g.youmonst, mattk, mdef, &mhm);