From 9a5748ebe1c951b604b7f3663b8d63cfd9af64c5 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 18 Apr 2025 16:18:07 -0400 Subject: [PATCH] v3.1.0: fixed metamorphed cleanse clearing lost inventory debuff --- .../shatteredpixeldungeon/actors/hero/Talent.java | 4 +++- .../shatteredpixeldungeon/items/wands/Wand.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java index 9b56c7070..a2a5b1958 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java @@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.EnhancedRings; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LostInventory; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PhysicalEmpower; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.RevealedArea; @@ -799,7 +800,8 @@ public enum Talent { && Random.Int(10) < Dungeon.hero.pointsInTalent(Talent.CLEANSE)){ boolean removed = false; for (Buff b : Dungeon.hero.buffs()) { - if (b.type == Buff.buffType.NEGATIVE) { + if (b.type == Buff.buffType.NEGATIVE + && !(b instanceof LostInventory)) { b.detach(); removed = true; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index 67da7638b..6fd77a80f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Degrade; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LostInventory; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration; @@ -526,7 +527,8 @@ public abstract class Wand extends Item { && Random.Int(10) < Dungeon.hero.pointsInTalent(Talent.CLEANSE)){ boolean removed = false; for (Buff b : Dungeon.hero.buffs()) { - if (b.type == Buff.buffType.NEGATIVE) { + if (b.type == Buff.buffType.NEGATIVE + && !(b instanceof LostInventory)) { b.detach(); removed = true; }