v3.1.0: fixed metamorphed cleanse clearing lost inventory debuff

This commit is contained in:
Evan Debenham
2025-04-18 16:18:07 -04:00
parent 46861ccef4
commit 9a5748ebe1
2 changed files with 6 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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;
}