]> granicus.if.org Git - nethack/commitdiff
fix U206 - cursed leash/pacifist conduct
authornethack.rankin <nethack.rankin>
Thu, 13 Feb 2003 23:32:48 +0000 (23:32 +0000)
committernethack.rankin <nethack.rankin>
Thu, 13 Feb 2003 23:32:48 +0000 (23:32 +0000)
      Treat strangling a pet with a cursed leash like a regular monster
kill; you'll get experience, lose pacifism conduct, and suffer various
pet-killer effects.  Also do some minor damage and reduce tameness for
the case where the pet is described as being choked but isn't killed.

doc/fixes34.1
src/apply.c

index 5450ab08f67bb0645ca14ab7f4eb830972f3e2a9..2c5f8e78f3e046b3907ffcf58b22200731de95c1 100644 (file)
@@ -385,6 +385,7 @@ while waiting, don't try to change into were form when already in were form
 steed should remember traps encountered while mounted
 killing shopkeeper by throwing unpaid things would result in
        "item not on bill" impossible error
+choking pet to death with cursed leash incurs various pet-killing penalties
 
 
 Platform- and/or Interface-Specific Fixes
index 57f0493667f0f151ebb682a7484cb0d7bbf97eb5..64b462c5df2480d52015dfbcad218d4655dc99e9 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)apply.c    3.4     2003/01/29      */
+/*     SCCS Id: @(#)apply.c    3.4     2003/02/13      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -542,18 +542,31 @@ register xchar x, y;
            }
            if (dist2(u.ux,u.uy,mtmp->mx,mtmp->my) >
                    dist2(x,y,mtmp->mx,mtmp->my)) {
-               if (otmp->cursed && !breathless(mtmp->data)) {
-                   if (um_dist(mtmp->mx, mtmp->my, 5)) {
-                       pline("%s chokes to death!", Monnam(mtmp));
-                       mondied(mtmp);
-                   } else if (um_dist(mtmp->mx, mtmp->my, 3)) {
+               if (!um_dist(mtmp->mx, mtmp->my, 3)) {
+                   ;   /* still close enough */
+               } else if (otmp->cursed && !breathless(mtmp->data)) {
+                   if (um_dist(mtmp->mx, mtmp->my, 5) ||
+                           (mtmp->mhp -= rnd(2)) <= 0) {
+                       long save_pacifism = u.uconduct.killer;
+
+                       Your("leash chokes %s to death!", mon_nam(mtmp));
+                       /* hero might not have intended to kill pet, but
+                          that's the result of his actions; gain experience,
+                          lose pacifism, take alignment and luck hit, make
+                          corpse less likely to remain tame after revival */
+                       xkilled(mtmp, 0);       /* no "you kill it" message */
+                       /* life-saving doesn't ordinarily reset this */
+                       if (mtmp->mhp > 0) u.uconduct.killer = save_pacifism;
+                   } else {
                        pline("%s chokes on the leash!", Monnam(mtmp));
+                       /* tameness eventually drops to 1 here (never 0) */
+                       if (mtmp->mtame && rn2(mtmp->mtame)) mtmp->mtame--;
                    }
                } else {
                    if (um_dist(mtmp->mx, mtmp->my, 5)) {
                        pline("%s leash snaps loose!", s_suffix(Monnam(mtmp)));
                        m_unleash(mtmp, FALSE);
-                   } else if (um_dist(mtmp->mx, mtmp->my, 3)) {
+                   } else {
                        You("pull on the leash.");
                        if (mtmp->data->msound != MS_SILENT)
                            switch (rn2(3)) {