]> granicus.if.org Git - nethack/commitdiff
engulfer tuning
authorPatR <rankin@nethack.org>
Wed, 15 Jun 2016 00:37:44 +0000 (17:37 -0700)
committerPatR <rankin@nethack.org>
Wed, 15 Jun 2016 00:37:44 +0000 (17:37 -0700)
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.

doc/fixes36.1
src/mhitu.c
src/mon.c

index ef4ec400c3034e89b875d7e74ab8b48e0ea5e39c..6cfc02584b5ff073d16c5b0ee12e36568bbc8011 100644 (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
index e4dc534845270d7bcf0d7f27993acb65e33eca3f..0be49f42ed32588365f14059e58147ff15b922c8 100644 (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 {
index 3094425eb12f01003452d853cb1afdb7bccb5e18..26a75b31b0c607a01155b291c4d1ae543f2336d4 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -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);
                 }
             }
+        }
     }
 
 }