From 26c5a4d12a056198c9c79654143af3d8529b8976 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 4 Dec 2024 13:54:00 -0500 Subject: [PATCH] v3.0.0: fixed exploits where players could go past floor 20 with cleric --- .../shatteredpixeldungeon/levels/features/Chasm.java | 7 +++++++ .../shatteredpixeldungeon/scenes/GameScene.java | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java index 1d5b7e6a2..069d1fe63 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Chasm.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfFeatherFall; @@ -41,6 +42,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.MobSprite; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; +import com.shatteredpixel.shatteredpixeldungeon.windows.WndMessage; import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; import com.watabou.noosa.Game; import com.watabou.noosa.Image; @@ -58,6 +60,11 @@ public class Chasm implements Hero.Doom { Game.runOnRenderThread(new Callback() { @Override public void call() { + if (Dungeon.depth >= 20 && Dungeon.hero.heroClass == HeroClass.CLERIC){ + GameScene.show(new WndMessage("Thanks for playing the Alpha!\n\nRuns with the Cleric cap out at floor 20 for the moment, but you'll be able to finish your run closer to the beta releases.")); + return; + } + GameScene.show( new WndOptions( new Image(Dungeon.level.tilesTex(), 176, 16, 16, 16), Messages.get(Chasm.class, "chasm"), diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 8a8fed9ea..587b1818a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DemonSpawner; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Ghoul; @@ -215,6 +216,11 @@ public class GameScene extends PixelScene { return; } + if (Dungeon.depth > 20 && Dungeon.hero.heroClass == HeroClass.CLERIC){ + ShatteredPixelDungeon.switchNoFade(TitleScene.class); + return; + } + Dungeon.level.playLevelMusic(); SPDSettings.lastClass(Dungeon.hero.heroClass.ordinal());