From 43f3582e1e03897772122fb8ee101077f5dd09ee Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 20 Jul 2016 18:38:32 -0400 Subject: [PATCH] v0.4.1: fixed some items being burned/frozen when held by thieves --- .../shatteredpixeldungeon/actors/buffs/Burning.java | 11 +++++++++-- .../shatteredpixeldungeon/actors/buffs/Chill.java | 10 +++++++--- .../shatteredpixeldungeon/actors/buffs/Frost.java | 11 +++++++---- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java index 1f6e9e7ac..f3dac280e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java @@ -125,9 +125,16 @@ public class Burning extends Buff implements Hero.Doom { target.damage( damage, this ); } - if (target instanceof Thief && ((Thief)target).item instanceof Scroll) { - ((Thief)target).item = null; + if (target instanceof Thief) { + + Item item = ((Thief) target).item; + + if (item instanceof Scroll && + !(item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion)) { target.sprite.emitter().burst( ElmoParticle.FACTORY, 6 ); + ((Thief)target).item = null; + } + } } else { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java index abaa600d1..883af7bbb 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java @@ -74,10 +74,14 @@ public class Chill extends FlavourBuff { GLog.w( Messages.get(this, "freezes", item.toString()) ); } - } else if (target instanceof Thief && ((Thief)target).item instanceof Potion) { + } else if (target instanceof Thief) { - ((Potion) ((Thief)target).item).shatter( target.pos ); - ((Thief) target).item = null; + Item item = ((Thief) target).item; + + if (item instanceof Potion && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) { + ((Potion) ((Thief) target).item).shatter(target.pos); + ((Thief) target).item = null; + } } return true; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java index b369ac7c5..3198b30cb 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java @@ -74,14 +74,17 @@ public class Frost extends FlavourBuff { GLog.w( Messages.get(this, "freezes", item.toString()) ); } - } else if (target instanceof Thief && ((Thief)target).item instanceof Potion) { + } else if (target instanceof Thief) { - ((Potion) ((Thief)target).item).shatter( target.pos ); - ((Thief) target).item = null; + Item item = ((Thief) target).item; + + if (item instanceof Potion && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) { + ((Potion) ((Thief) target).item).shatter(target.pos); + ((Thief) target).item = null; + } } - return true; } else { return false;