engulfer tuning

Reported by me ;-} during beta testing last Fall, engulfers have a
tendency to re-engulf the hero immediately after expelling him/her.
Use mspec_used (set when expelling rather than engulfing) to make
them wait a turn or two.  Initially that made the too-soon engulf
attacks always miss, so this changes too-soon engulf to a touch or
claw attack instead.  Some tuning in damage or message may be needed.
This commit is contained in:
PatR
2016-06-14 17:37:44 -07:00
parent 7e257dc7e8
commit bc8e613719
3 changed files with 30 additions and 8 deletions

View File

@@ -415,6 +415,7 @@ interrupt a multi turn action if hp or pw is restored to maximum
pressing d or D when cursor positioning targets doors and doorways
pressing x or X when cursor positioning targets possibly unexplored location
(potentially useful when using '_' [not mouse] to invoke travel)
swallowers can't re-engulf hero immediately after spitting him/her out
Platform- and/or Interface-Specific New Features

View File

@@ -300,6 +300,20 @@ struct attack *alt_attk_buf;
/* note: 3d9 is slightly higher than previous 4d6 */
}
} else if (attk->aatyp == AT_ENGL && magr->mspec_used) {
/* can't re-engulf yet; switch to simpler attack */
*alt_attk_buf = *attk;
attk = alt_attk_buf;
if (attk->adtyp == AD_ACID || attk->adtyp == AD_ELEC
|| attk->adtyp == AD_COLD || attk->adtyp == AD_FIRE) {
attk->aatyp = AT_TUCH;
} else {
attk->aatyp = AT_CLAW; /* attack message will be "<foo> hits" */
attk->adtyp = AD_PHYS;
}
attk->damn = 1; /* relatively weak: 1d6 */
attk->damd = 6;
/* barrow wight, Nazgul, erinys have weapon attack for non-physical
damage; force physical damage if attacker has been cancelled or
if weapon is sufficiently interesting; a few unique creatures
@@ -684,10 +698,10 @@ register struct monst *mtmp;
case AT_ENGL:
if (!range2) {
if (foundyou) {
if (u.uswallow || tmp > (j = rnd(20 + i))) {
/* Force swallowing monster to be
* displayed even when player is
* moving away */
if (u.uswallow
|| (!mtmp->mspec_used && tmp > (j = rnd(20 + i)))) {
/* force swallowing monster to be displayed
even when hero is moving away */
flush_screen(1);
sum[i] = gulpmu(mtmp, mattk);
} else {

View File

@@ -2147,6 +2147,10 @@ struct monst *mtmp;
placebc();
vision_full_recalc = 1;
docrt();
/* prevent swallower (mtmp might have just poly'd into something
without an engulf attack) from immediately re-engulfing */
if (attacktype(mtmp->data, AT_ENGL) && !mtmp->mspec_used)
mtmp->mspec_used = rnd(2);
}
u.ustuck = 0;
}
@@ -2615,10 +2619,11 @@ struct monst *mtmp;
/* make other peaceful monsters react */
if (!context.mon_moving) {
struct monst *mon;
int got_mad = 0;
for (mon = fmon; mon; mon = mon->nmon)
if (!DEADMONSTER(mon) && !mindless(mon->data) && mon->mpeaceful
for (mon = fmon; mon; mon = mon->nmon) {
if (DEADMONSTER(mon))
continue;
if (!mindless(mon->data) && mon->mpeaceful
&& couldsee(mon->mx, mon->my) && !mon->msleeping
&& mon->mcansee && m_canseeu(mon)) {
boolean exclaimed = FALSE;
@@ -2635,7 +2640,8 @@ struct monst *mtmp;
verbalize("%s", exclam[mon->m_id % SIZE(exclam)]);
exclaimed = TRUE;
}
if (!mon->isshk && !mon->ispriest && (mon->data->mlevel < rn2(10))) {
if (!mon->isshk && !mon->ispriest
&& (mon->data->mlevel < rn2(10))) {
monflee(mon, rn2(50)+25, TRUE, !exclaimed);
exclaimed = TRUE;
}
@@ -2655,6 +2661,7 @@ struct monst *mtmp;
monflee(mon, rn2(25)+15, TRUE, !exclaimed);
}
}
}
}
}