From 6b7ffd9fe81c790c2a3663c95cdfde33540fa898 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 21 Nov 2025 11:24:15 -0500 Subject: [PATCH] v3.3.0: fixed various item buffs persisting in new quest area --- .../items/quest/EscapeCrystal.java | 15 +++++++++++++++ .../shatteredpixeldungeon/levels/CityLevel.java | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/EscapeCrystal.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/EscapeCrystal.java index fb820952d..37c3032c9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/EscapeCrystal.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/EscapeCrystal.java @@ -23,8 +23,13 @@ package com.shatteredpixel.shatteredpixeldungeon.items.quest; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; +import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.VaultLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition; @@ -67,6 +72,16 @@ public class EscapeCrystal extends Item { Sample.INSTANCE.play(Assets.Sounds.TELEPORT); + //for full release this will remove any non revive persists buff, but for now just do item buffs + for (Buff b : hero.buffs()){ + if (b instanceof Wand.Charger + || b instanceof Artifact.ArtifactBuff + || b instanceof MeleeWeapon.Charger + || b instanceof ClassArmor.Charger){ + b.detach(); + } + } + restoreHeroBelongings(hero); Level.beforeTransition(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java index c4cb2f131..0b0f85de2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityLevel.java @@ -24,11 +24,16 @@ package com.shatteredpixel.shatteredpixeldungeon.levels; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor; import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.quest.EscapeCrystal; +import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition; import com.shatteredpixel.shatteredpixeldungeon.levels.painters.CityPainter; import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; @@ -150,6 +155,17 @@ public class CityLevel extends RegularLevel { @Override protected void onSelect(int index) { if (index == 0){ + + //for full release this will remove any non revive persists buff, but for now just do item buffs + for (Buff b : hero.buffs()){ + if (b instanceof Wand.Charger + || b instanceof Artifact.ArtifactBuff + || b instanceof MeleeWeapon.Charger + || b instanceof ClassArmor.Charger){ + b.detach(); + } + } + EscapeCrystal crystal = new EscapeCrystal(); crystal.storeHeroBelongings(Dungeon.hero); crystal.collect();