From: nethack.rankin Date: Tue, 17 Aug 2004 01:29:47 +0000 (+0000) Subject: killing pets by displacing them into traps X-Git-Tag: MOVE2GIT~1427 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10eea7710d9c14fb7133144b76c9807186679709;p=nethack killing pets by displacing them into traps A user pointed out that you lose pacifism conduct if you kill your pet by displacing it into a trap but you don't gain any experience in the process. Make this consistent with killing monsters in other ways: if you get blamed for it then you should also get credit for it. Probably minliquid() and mintrap() should take another argument so they can call killed() instead of mondead() when necessary, but I didn't go to that much effort.... --- diff --git a/doc/fixes34.4 b/doc/fixes34.4 index f03f13122..f503f22c1 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -48,6 +48,7 @@ fractured boulders or statues produced inconsistent object settings on the resulting rocks really fix rolling boulder bug C340-18, the previous "fix" reversed the test monster throwing greased weapon has same chance for slip/misfire as player +killing a pet by displacing it into a trap now yields experience Platform- and/or Interface-Specific Fixes diff --git a/src/hack.c b/src/hack.c index bc504494a..4ce1db40e 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)hack.c 3.4 2004/01/03 */ +/* SCCS Id: @(#)hack.c 3.4 2004/08/16 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1392,19 +1392,33 @@ domove() adjalign(-3); break; case 2: - /* it may have drowned or died. that's no way to - * treat a pet! your god gets angry. + /* drowned or died... + * you killed your pet by direct action, so get experience + * and possibly penalties; + * we want the level gain message, if it happens, to occur + * before the guilt message below + */ + { + /* minliquid() and mintrap() call mondead() rather than + killed() so we duplicate some of the latter here */ + int tmp, mndx; + + u.uconduct.killer++; + mndx = monsndx(mtmp->data); + tmp = experience(mtmp, (int)mvitals[mndx].died + 1); + more_experienced(tmp, 0); + newexplevel(); /* will decide if you go up */ + } + /* That's no way to treat a pet! Your god gets angry. + * + * [This has always been pretty iffy. Why does your + * patron deity care at all, let alone enough to get mad?] */ if (rn2(4)) { You_feel("guilty about losing your pet like this."); u.ugangr++; adjalign(-15); } - - /* you killed your pet by direct action. - * minliquid and mintrap don't know to do this - */ - u.uconduct.killer++; break; default: pline("that's strange, unknown mintrap result!");