From d7a00440566e36a122bc714533eb841976b4b6f6 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sun, 17 Jul 2005 05:00:25 +0000 Subject: [PATCH] farmed pudding (trunk only) I've gotten tired of seeing newsgroup claims along the lines of "since devteam is aware of this and has chosen not to eliminate it, they must endorse it", so weaken the tactic of "pudding farming". It is still possible to gain unlimited experience (past level 15 or so there's not much point), but will be less effective for gaining items and for providing sacrifice fodder. Keep track of which monsters have been created via cloning (mostly puddings; gremlins and blue jellies are affected too but nobody's likely to care much about them) so that they can receive special handling. Make cloned monsters progressively less likely to leave corpses as the number killed for a particular type goes up, and also much less likely to drop random items at death. This is sure to need some tuning once hard core farmers point out how they can still abuse it. For the absurdly extreme case, see http://scavenger.homeip.net/farmbot/HomePage FYI, farmbot/PuddingFarmingHOWTO includes an impressive screen shot of a dungeon level where rampant farming is taking place. --- doc/fixes35.0 | 1 + include/monst.h | 5 +++-- include/patchlevel.h | 4 ++-- src/makemon.c | 3 ++- src/mhitu.c | 3 ++- src/mon.c | 19 +++++++++---------- src/worm.c | 3 ++- 7 files changed, 21 insertions(+), 17 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index f2a1c41b1..41c949c29 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -135,6 +135,7 @@ plname is stored in the save file on all platforms now introduce support for negation of role, race, align, gender values to eliminate them from random selection and the pick list of startup choices some intelligent pets will avoid cannibalism +keep track of which monsters were cloned from other monsters Platform- and/or Interface-Specific New Features diff --git a/include/monst.h b/include/monst.h index dcc9b21f0..b575d7e50 100644 --- a/include/monst.h +++ b/include/monst.h @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)monst.h 3.5 2004/06/12 */ +/* SCCS Id: @(#)monst.h 3.5 2005/07/13 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -76,13 +76,14 @@ struct monst { * but not mimic (that is, snake, spider, * trapper, piercer, eel) */ + Bitfield(mcansee,1); /* cansee 1, temp.blinded 0, blind 0 */ Bitfield(mspeed,2); /* current speed */ Bitfield(permspeed,2); /* intrinsic mspeed value */ Bitfield(mrevived,1); /* has been revived from the dead */ + Bitfield(mcloned,1); /* has been cloned from another */ Bitfield(mavenge,1); /* did something to deserve retaliation */ Bitfield(mflee,1); /* fleeing */ - Bitfield(mcansee,1); /* cansee 1, temp.blinded 0, blind 0 */ Bitfield(mfleetim,7); /* timeout for mflee */ Bitfield(msleeping,1); /* asleep until woken */ diff --git a/include/patchlevel.h b/include/patchlevel.h index af645b65e..28349708b 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)patchlevel.h 3.5 2005/03/12 */ +/* SCCS Id: @(#)patchlevel.h 3.5 2005/07/13 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -13,7 +13,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 21 +#define EDITLEVEL 22 #define COPYRIGHT_BANNER_A \ "NetHack, Copyright 1985-2005" diff --git a/src/makemon.c b/src/makemon.c index 01471a241..23177d7e0 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)makemon.c 3.5 2005/06/13 */ +/* SCCS Id: @(#)makemon.c 3.5 2005/07/13 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -692,6 +692,7 @@ xchar x, y; /* clone's preferred location or 0 (near mon) */ m2->mx = mm.x; m2->my = mm.y; + m2->mcloned = 1; m2->minvent = (struct obj *) 0; /* objects don't clone */ m2->mleashed = FALSE; #ifndef GOLDOBJ diff --git a/src/mhitu.c b/src/mhitu.c index 2409935d2..df1cc4fa1 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mhitu.c 3.5 2005/06/21 */ +/* SCCS Id: @(#)mhitu.c 3.5 2005/07/13 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2605,6 +2605,7 @@ cloneu() if (u.mh <= 1) return(struct monst *)0; if (mvitals[mndx].mvflags & G_EXTINCT) return(struct monst *)0; mon = makemon(youmonst.data, u.ux, u.uy, NO_MINVENT|MM_EDOG); + mon->mcloned = 1; mon = christen_monst(mon, plname); initedog(mon); mon->m_lev = youmonst.data->mlevel; diff --git a/src/mon.c b/src/mon.c index fca5a0d0a..bcdc8be06 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mon.c 3.5 2005/06/22 */ +/* SCCS Id: @(#)mon.c 3.5 2005/07/13 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1614,13 +1614,12 @@ boolean was_swallowed; /* digestion */ if (LEVEL_SPECIFIC_NOCORPSE(mdat)) return FALSE; - if (bigmonst(mdat) || mdat == &mons[PM_LIZARD] - || is_golem(mdat) - || is_mplayer(mdat) - || is_rider(mdat)) + if (((bigmonst(mdat) || mdat == &mons[PM_LIZARD]) && !mon->mcloned) || + is_golem(mdat) || is_mplayer(mdat) || is_rider(mdat)) return TRUE; - return (boolean) (!rn2((int) - (2 + ((int)(mdat->geno & G_FREQ)<2) + verysmall(mdat)))); + tmp = 2 + ((mdat->geno & G_FREQ) < 2) + verysmall(mdat); + if (mon->mcloned) tmp += mvitals[monsndx(mdat)].died / 25; + return (boolean) !rn2(tmp); } /* drop (perhaps) a cadaver and remove monster */ @@ -1892,11 +1891,11 @@ xkilled(mtmp, dest) if(wasinside) spoteffects(TRUE); } else if(x != u.ux || y != u.uy) { /* might be here after swallowed */ - if (!rn2(6) && !(mvitals[mndx].mvflags & G_NOCORPSE) + if (!rn2(6) && !(mvitals[mndx].mvflags & G_NOCORPSE) && #ifdef KOPS - && mdat->mlet != S_KOP + mdat->mlet != S_KOP && #endif - ) { + (!mtmp->mcloned || !rn2(mvitals[mndx].died / 5 + 1))) { int typ; otmp = mkobj_at(RANDOM_CLASS, x, y, TRUE); diff --git a/src/worm.c b/src/worm.c index 7e05acb75..d896165ee 100644 --- a/src/worm.c +++ b/src/worm.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)worm.c 3.5 1995/01/28 */ +/* SCCS Id: @(#)worm.c 3.5 2005/07/13 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -380,6 +380,7 @@ cutworm(worm, x, y, weap) remove_monster(x, y); /* clone_mon puts new head here */ new_worm = clone_mon(worm, x, y); new_worm->wormno = new_wnum; /* affix new worm number */ + new_worm->mcloned = 0; /* treat second worm as a normal monster */ /* Devalue the monster level of both halves of the worm. */ worm->m_lev = ((unsigned)worm->m_lev <= 3) ?