From a3ddcba9a7aeb414477cc79c7fafcf1757c76e84 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sun, 8 Jul 2007 23:51:17 +0000 Subject: [PATCH] crop rotation (trunk only) More tuning to throttle pudding farming (plus endgame Rider farming). Earlier changes made cloned black puddings less likely to leave corpses, to cut down on sacrifice fodder a bit, and cloned anything less likely to drop random items when killed; this one makes killing cloned or revived monsters be worth less experience as the number killed goes up, to cut down on final score inflation. [With several boulders and magic missile or a polearm, it's possible to kill any of the Riders repeatedly with virtually no risk of even getting hit, much less of getting killed. Now if you kill Pestilence 240 times it will be worth 62720 points instead of 297840 (not including doubling bonus for ascension), with an additional 19 points per kill instead of 1241 after that, requiring a couple orders more magnitude of abuse--excuse me, superhuman "patience"--to get the score to reach the overflow threshold.] While testing this, I got "The Famine's corpse glows iridescently." This fixes that too. Also, previously unused kill count for experience() had an off by one error; was including ``+ 1'' even though mvitals[].died has already been incremented by the time that that code uses it. --- doc/fixes35.0 | 1 + src/exper.c | 24 +++++++++++++++++++++--- src/hack.c | 2 +- src/mon.c | 2 +- src/wizard.c | 3 +++ src/zap.c | 4 +++- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 217b62c6d..b1fa18e7b 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -315,6 +315,7 @@ 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 +cloned and revived monsters become worth fewer points than ordinary ones number_pad:3 run-time option to use inverted phone keypad layout for movement number_pad:-1 to swap function of y and z keys; z to move NW, y to zap wands display spell retention information in the spell menu diff --git a/src/exper.c b/src/exper.c index 523a72e37..7ed11300d 100644 --- a/src/exper.c +++ b/src/exper.c @@ -66,9 +66,6 @@ int experience(mtmp, nk) /* return # of exp points for mtmp after nk killed */ register struct monst *mtmp; register int nk; -#if defined(macintosh) && (defined(__SC__) || defined(__MRC__)) -# pragma unused(nk) -#endif { register struct permonst *ptr = mtmp->data; int i, tmp, tmp2; @@ -119,6 +116,27 @@ experience(mtmp, nk) /* return # of exp points for mtmp after nk killed */ if(mtmp->data == &mons[PM_MAIL_DAEMON]) tmp = 1; #endif + if (mtmp->mrevived || mtmp->mcloned) { + /* + * Reduce experience awarded for repeated killings of + * "the same monster". Kill count includes all of this + * monster's type which have been killed--including the + * current monster--regardless of how they were created. + * 1.. 20 full experience + * 21.. 40 xp / 2 + * 41.. 80 xp / 4 + * 81..120 xp / 8 + * 121..180 xp / 16 + * 181..240 xp / 32 + * 241..255+ xp / 64 + */ + for (i = 0, tmp2 = 20; nk > tmp2 && tmp > 1; ++i) { + tmp = (tmp + 1) / 2; + nk -= tmp2; + if (i & 1) tmp2 += 20; + } + } + return(tmp); } diff --git a/src/hack.c b/src/hack.c index 3a7e2d41e..0976d536d 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1446,7 +1446,7 @@ domove() u.uconduct.killer++; mndx = monsndx(mtmp->data); - tmp = experience(mtmp, (int)mvitals[mndx].died + 1); + tmp = experience(mtmp, (int)mvitals[mndx].died); more_experienced(tmp, 0); newexplevel(); /* will decide if you go up */ } diff --git a/src/mon.c b/src/mon.c index 1e3076fd1..44f1d8713 100644 --- a/src/mon.c +++ b/src/mon.c @@ -2067,7 +2067,7 @@ cleanup: } /* give experience points */ - tmp = experience(mtmp, (int)mvitals[mndx].died + 1); + tmp = experience(mtmp, (int)mvitals[mndx].died); more_experienced(tmp, 0); newexplevel(); /* will decide if you go up */ diff --git a/src/wizard.c b/src/wizard.c index 7b1a26a11..adc199b08 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -486,6 +486,9 @@ resurrect() /* make a new Wizard */ verb = "kill"; mtmp = makemon(&mons[PM_WIZARD_OF_YENDOR], u.ux, u.uy, MM_NOWAIT); + /* affects experience; he's not coming back from a corpse + but is subject to repeated killing like a revived corpse */ + mtmp->mrevived = 1; } else { /* look for a migrating Wizard */ verb = "elude"; diff --git a/src/zap.c b/src/zap.c index 9b0d334fd..c8955864e 100644 --- a/src/zap.c +++ b/src/zap.c @@ -576,6 +576,7 @@ coord *cc; mtmp2->mlstmv = mtmp->mlstmv; mtmp2->m_ap_type = mtmp->m_ap_type; /* set these ones explicitly */ + mtmp2->mrevived = 1; mtmp2->mavenge = 0; mtmp2->meating = 0; mtmp2->mleashed = 0; @@ -755,7 +756,8 @@ boolean by_hero; shkp = shop_keeper(*in_rooms(x, y, SHOPBASE)); if (cansee(x, y)) - pline_The("%s glows iridescently.", cxname(corpse)); + pline("%s glows iridescently.", + upstart(corpse_xname(corpse, (const char *)0, CXN_PFX_THE))); else if (shkp) /* need some prior description of the corpse since stolen_value() will refer to the object as "it" */