From c2c797fa357bef663fa3d962850196350a9cdb3b Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Thu, 12 Dec 2024 03:37:02 +0000 Subject: [PATCH] Artifact and #offer rebalance, part 2: luck from sacrificing Luck from sacrificing is now limited by the value of the sacrifice. This fixes two exploits, both of which rely on getting luck up to maximum as soon as you have an altar, a luckstone, and a few rations, via altar-camping until you accumulate enough luck. One of them is to use the resulting luck to throw off the balance of combat via using it to make hit chance calculations irrelevant. The other is to use it to get crowned early in the game; in particular, getting crowned pre-Sokoban is often viable and, especially for chaotic characters, solves most of the game's difficulty at that point (because the intrinisics and weapon are enough to carry a character to the Castle given even mediocre luck with finding armor). After this commit, becoming crowned very early in the game is more difficult (likely requiring unicorns and identified gems), and the hit chance gain from luck becomes a more gradual gain over the course of the game rather than all happening immediately upon finding the altar and luckstone. In addition to making the game more balanced, this also discourages grinding by reducing the incentive for altar-camping, so it will hopefully make it more fun as well. --- doc/fixes3-7-0.txt | 1 + src/pray.c | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 3ff0cb864..13c61a938 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1490,6 +1490,7 @@ artifact gifts are rebalanced (easier to obtain; higher-value sacrifices are needed for higher-value artifacts; lower-value artifacts are usually gifted enchanted; unaligned artifacts are possible but rare even on the first gift; artifacts you can't use well are less likely) +luck gains from sacrificing are limited by the value of the sacrifice Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/src/pray.c b/src/pray.c index 2fde3727f..f9312daf2 100644 --- a/src/pray.c +++ b/src/pray.c @@ -2084,13 +2084,27 @@ offer_corpse(struct obj *otmp, boolean highaltar, aligntyp altaralign) } } } else { - int saved_luck = u.uluck; + int orig_luck, luck_increase; + if (bestow_artifact(value)) return; - change_luck((value * LUCKMAX) / (MAXVALUE * 2)); + + orig_luck = u.uluck; + luck_increase = (value * LUCKMAX) / (MAXVALUE * 2); + + /* sacrificing can't increase non-bonus Luck to above the value of the + sacrifice; this prevents players immediately maxing their Luck as + soon as they find an altar and a few rations via sacrificing lots + of low-valued corpses, which can unbalance the early game */ + if (orig_luck > value) + luck_increase = 0; + else if (orig_luck + luck_increase > value) + luck_increase = value - orig_luck; + + change_luck(luck_increase); if ((int) u.uluck < 0) u.uluck = 0; - if (u.uluck != saved_luck) { + if (u.uluck != orig_luck) { if (Blind) You("think %s brushed your %s.", something, body_part(FOOT));