From c345e08336b071c515541af52dbf4af86238b5b5 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 20 Sep 2022 14:31:43 -0400 Subject: [PATCH] v1.4.0: Switched back to ring of wealth upgrade cap, but smarter --- .../items/rings/RingOfWealth.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java index 4a087d93c..ae04177d5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java @@ -122,9 +122,22 @@ public class RingOfWealth extends Ring { triesToDrop -= tries; while ( triesToDrop <= 0 ){ if (dropsToEquip <= 0){ + int equipBonus = 0; + + //A second ring of wealth can be at most +1 when calculating wealth bonus for equips + //This is to prevent using an upgraded wealth to farm another upgraded wealth and + //using the two to get substantially more upgrade value than intended + for (Wealth w : target.buffs(Wealth.class)){ + if (w.buffedLvl() > equipBonus){ + equipBonus = w.buffedLvl() + Math.min(equipBonus, 2); + } else { + equipBonus += Math.min(w.buffedLvl(), 2); + } + } + Item i; do { - i = genEquipmentDrop(bonus - 1); + i = genEquipmentDrop(equipBonus - 1); } while (Challenges.isItemBlocked(i)); drops.add(i); dropsToEquip = Random.NormalIntRange(5, 10); @@ -261,16 +274,10 @@ public class RingOfWealth extends Ring { result = a; break; case 3: - do { - result = Generator.random(Generator.Category.RING); - //wealth cannot generate more rings of wealth - } while (result instanceof RingOfWealth); + result = Generator.random(Generator.Category.RING); break; case 4: - do { - result = Generator.random(Generator.Category.ARTIFACT); - //wealth cannot generate more rings of wealth - } while (result instanceof RingOfWealth); + result = Generator.random(Generator.Category.ARTIFACT); break; } //minimum level is 1/2/3/4/5/6 when ring level is 1/3/5/7/9/11