From 2e215359d062982bdc93892427371aa884a75426 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 18 Jun 2016 16:30:38 -0400 Subject: [PATCH] v0.4.0: high value potions/scrolls no longer burn/freeze --- .../shatteredpixeldungeon/actors/buffs/Burning.java | 5 ++++- .../shatteredpixeldungeon/actors/buffs/Chill.java | 5 ++++- .../shatteredpixeldungeon/actors/buffs/Frost.java | 5 ++++- .../shatteredpixeldungeon/items/Heap.java | 10 ++++++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java index bf6b61129..597d0607e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java @@ -36,6 +36,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat; import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -95,7 +97,8 @@ public class Burning extends Buff implements Hero.Doom { hero.damage( damage, this ); Item item = hero.belongings.randomUnequipped(); - if (item instanceof Scroll) { + if (item instanceof Scroll + && !(item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion)) { item = item.detach( hero.belongings.backpack ); GLog.w( Messages.get(this, "burnsup", Messages.capitalize(item.toString())) ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java index 885a4e9c3..abaa600d1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java @@ -28,6 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.food.FrozenCarpaccio; import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMight; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; @@ -55,7 +57,8 @@ public class Chill extends FlavourBuff { Hero hero = (Hero)target; Item item = hero.belongings.randomUnequipped(); - if (item instanceof Potion) { + if (item instanceof Potion + && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) { item = item.detach( hero.belongings.backpack ); GLog.w( Messages.get(this, "freezes", item.toString()) ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java index 1ac8ead24..b369ac7c5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java @@ -28,6 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.food.FrozenCarpaccio; import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMight; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -55,7 +57,8 @@ public class Frost extends FlavourBuff { Hero hero = (Hero)target; Item item = hero.belongings.randomUnequipped(); - if (item instanceof Potion) { + if (item instanceof Potion + && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) { item = item.detach( hero.belongings.backpack ); GLog.w( Messages.get(this, "freezes", item.toString()) ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java index 48db8eae9..c324385a0 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java @@ -45,7 +45,11 @@ import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfExperience; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMight; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.plants.Plant.Seed; @@ -223,7 +227,8 @@ public class Heap implements Bundlable { boolean evaporated = false; for (Item item : items.toArray( new Item[0] )) { - if (item instanceof Scroll) { + if (item instanceof Scroll + && !(item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion)) { items.remove( item ); burnt = true; } else if (item instanceof Dewdrop) { @@ -321,7 +326,8 @@ public class Heap implements Bundlable { if (item instanceof MysteryMeat) { replace( item, FrozenCarpaccio.cook( (MysteryMeat)item ) ); frozen = true; - } else if (item instanceof Potion) { + } else if (item instanceof Potion + && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) { items.remove(item); ((Potion) item).shatter(pos); frozen = true;