Monsters trapped in pits cannot kick
This commit is contained in:
@@ -1519,6 +1519,7 @@ the engraving pristine text field was not being appropriately populated during
|
|||||||
level creation
|
level creation
|
||||||
worn alchemy smock reduces chances of dipped potions exploding
|
worn alchemy smock reduces chances of dipped potions exploding
|
||||||
dwarves can sense buried items under their feet
|
dwarves can sense buried items under their feet
|
||||||
|
monsters trapped in pits cannot kick
|
||||||
|
|
||||||
|
|
||||||
Fixes to 3.7.0-x General Problems Exposed Via git Repository
|
Fixes to 3.7.0-x General Problems Exposed Via git Repository
|
||||||
|
|||||||
@@ -1507,6 +1507,7 @@ extern struct monst *cloneu(void);
|
|||||||
extern void expels(struct monst *, struct permonst *, boolean) NONNULLARG12;
|
extern void expels(struct monst *, struct permonst *, boolean) NONNULLARG12;
|
||||||
extern struct attack *getmattk(struct monst *, struct monst *, int, int *,
|
extern struct attack *getmattk(struct monst *, struct monst *, int, int *,
|
||||||
struct attack *) NONNULLARG12;
|
struct attack *) NONNULLARG12;
|
||||||
|
extern boolean mtrapped_in_pit(struct monst *) NONNULLARG1;
|
||||||
extern int mattacku(struct monst *) NONNULLARG1;
|
extern int mattacku(struct monst *) NONNULLARG1;
|
||||||
boolean diseasemu(struct permonst *) NONNULLARG1;
|
boolean diseasemu(struct permonst *) NONNULLARG1;
|
||||||
boolean u_slip_free(struct monst *, struct attack *) NONNULLARG12;
|
boolean u_slip_free(struct monst *, struct attack *) NONNULLARG12;
|
||||||
|
|||||||
@@ -423,6 +423,8 @@ mattackm(
|
|||||||
case AT_TUCH:
|
case AT_TUCH:
|
||||||
case AT_BUTT:
|
case AT_BUTT:
|
||||||
case AT_TENT:
|
case AT_TENT:
|
||||||
|
if (mattk->aatyp == AT_KICK && mtrapped_in_pit(magr))
|
||||||
|
continue;
|
||||||
/* Nymph that teleported away on first attack? */
|
/* Nymph that teleported away on first attack? */
|
||||||
if (distmin(magr->mx, magr->my, mdef->mx, mdef->my) > 1)
|
if (distmin(magr->mx, magr->my, mdef->mx, mdef->my) > 1)
|
||||||
/* Continue because the monster may have a ranged attack. */
|
/* Continue because the monster may have a ranged attack. */
|
||||||
|
|||||||
18
src/mhitu.c
18
src/mhitu.c
@@ -453,6 +453,22 @@ calc_mattacku_vars(
|
|||||||
gn.notonhead = FALSE;
|
gn.notonhead = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* return TRUE iff monster or hero is trapped in a (spiked) pit */
|
||||||
|
boolean
|
||||||
|
mtrapped_in_pit(struct monst *mtmp)
|
||||||
|
{
|
||||||
|
struct trap *ttmp = 0;
|
||||||
|
|
||||||
|
if (mtmp == &gy.youmonst)
|
||||||
|
ttmp = (u.utrap && u.utraptype == TT_PIT) ? t_at(u.ux, u.uy) : 0;
|
||||||
|
else
|
||||||
|
ttmp = mtmp->mtrapped ? t_at(mtmp->mx, mtmp->my) : 0;
|
||||||
|
|
||||||
|
if (ttmp && is_pit(ttmp->ttyp))
|
||||||
|
return TRUE;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* mattacku: monster attacks you
|
* mattacku: monster attacks you
|
||||||
* returns 1 if monster dies (e.g. "yellow light"), 0 otherwise
|
* returns 1 if monster dies (e.g. "yellow light"), 0 otherwise
|
||||||
@@ -773,6 +789,8 @@ mattacku(struct monst *mtmp)
|
|||||||
case AT_TUCH:
|
case AT_TUCH:
|
||||||
case AT_BUTT:
|
case AT_BUTT:
|
||||||
case AT_TENT:
|
case AT_TENT:
|
||||||
|
if (mattk->aatyp == AT_KICK && mtrapped_in_pit(mtmp))
|
||||||
|
continue;
|
||||||
if (!range2 && (!MON_WEP(mtmp) || mtmp->mconf || Conflict
|
if (!range2 && (!MON_WEP(mtmp) || mtmp->mconf || Conflict
|
||||||
|| !touch_petrifies(gy.youmonst.data))) {
|
|| !touch_petrifies(gy.youmonst.data))) {
|
||||||
if (foundyou) {
|
if (foundyou) {
|
||||||
|
|||||||
@@ -5498,6 +5498,9 @@ hmonas(struct monst *mon)
|
|||||||
FALLTHROUGH;
|
FALLTHROUGH;
|
||||||
/*FALLTHRU*/
|
/*FALLTHRU*/
|
||||||
case AT_KICK:
|
case AT_KICK:
|
||||||
|
if (mattk->aatyp == AT_KICK && mtrapped_in_pit(&gy.youmonst))
|
||||||
|
continue;
|
||||||
|
/*FALLTHRU*/
|
||||||
case AT_BITE:
|
case AT_BITE:
|
||||||
case AT_STNG:
|
case AT_STNG:
|
||||||
case AT_BUTT:
|
case AT_BUTT:
|
||||||
|
|||||||
Reference in New Issue
Block a user