From 59b6065a9a0850d6903248e21854c9464d2df035 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 11 Oct 2023 15:36:15 -0400 Subject: [PATCH] v2.2.0: reduced the forbidden runes challenge's impact on levelgen --- .../shatteredpixeldungeon/Dungeon.java | 16 ++++++++++------ .../shatteredpixeldungeon/levels/Level.java | 12 +++++++++--- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index e4b482f47..a2dea3589 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -167,6 +167,14 @@ public class Dungeon { } } + + //pre-v2.2.0 saves + if (Dungeon.version < 750 + && Dungeon.isChallenged(Challenges.NO_SCROLLS) + && UPGRADE_SCROLLS.count > 0){ + //we now count SOU fully, and just don't drop every 2nd one + UPGRADE_SCROLLS.count += UPGRADE_SCROLLS.count-1; + } } } @@ -519,12 +527,8 @@ public class Dungeon { public static boolean souNeeded() { int souLeftThisSet; - //3 SOU each floor set, 1.5 (rounded) on forbidden runes challenge - if (isChallenged(Challenges.NO_SCROLLS)){ - souLeftThisSet = Math.round(1.5f - (LimitedDrops.UPGRADE_SCROLLS.count - (depth / 5) * 1.5f)); - } else { - souLeftThisSet = 3 - (LimitedDrops.UPGRADE_SCROLLS.count - (depth / 5) * 3); - } + //3 SOU each floor set + souLeftThisSet = 3 - (LimitedDrops.UPGRADE_SCROLLS.count - (depth / 5) * 3); if (souLeftThisSet <= 0) return false; int floorThisSet = (depth % 5); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 3e48fd361..d4d10a2c0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -196,16 +196,22 @@ public abstract class Level implements Bundlable { addItemToSpawn(Generator.random(Generator.Category.FOOD)); if (Dungeon.posNeeded()) { - addItemToSpawn( new PotionOfStrength() ); Dungeon.LimitedDrops.STRENGTH_POTIONS.count++; + addItemToSpawn( new PotionOfStrength() ); } if (Dungeon.souNeeded()) { - addItemToSpawn( new ScrollOfUpgrade() ); Dungeon.LimitedDrops.UPGRADE_SCROLLS.count++; + //every 2nd scroll of upgrade is removed with forbidden runes challenge on + //TODO while this does significantly reduce this challenge's levelgen impact, it doesn't quite remove it + //for 0 levelgen impact, we need to do something like give the player all SOU, but nerf them + //or give a random scroll (from a separate RNG) instead of every 2nd SOU + if (!Dungeon.isChallenged(Challenges.NO_SCROLLS) || Dungeon.LimitedDrops.UPGRADE_SCROLLS.count%2 != 0){ + addItemToSpawn(new ScrollOfUpgrade()); + } } if (Dungeon.asNeeded()) { - addItemToSpawn( new Stylus() ); Dungeon.LimitedDrops.ARCANE_STYLI.count++; + addItemToSpawn( new Stylus() ); } //one scroll of transmutation is guaranteed to spawn somewhere on chapter 2-4 int enchChapter = (int)((Dungeon.seed / 10) % 3) + 1;