From 9887c9da7aea7f1e75e04676c0e95a985bab6f53 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 25 Nov 2021 22:18:13 -0500 Subject: [PATCH] v1.1.0: redesigned potion of adrenaline surge into potion of mastery Also added a confirmation windows for un-IDed potion of dragon's breath --- .../assets/messages/items/items.properties | 9 +- core/src/main/assets/sprites/item_icons.png | Bin 1593 -> 1193 bytes .../ShatteredPixelDungeon.java | 3 + .../actors/buffs/AdrenalineSurge.java | 2 +- .../items/armor/Armor.java | 10 +- .../items/armor/ClassArmor.java | 1 + .../items/potions/exotic/ExoticPotion.java | 5 +- .../exotic/PotionOfAdrenalineSurge.java | 43 ------- .../potions/exotic/PotionOfDragonsBreath.java | 32 ++++- .../items/potions/exotic/PotionOfMastery.java | 114 ++++++++++++++++++ .../items/scrolls/ScrollOfTransmutation.java | 1 + .../items/weapon/Weapon.java | 10 +- .../plants/Rotberry.java | 2 +- .../sprites/ItemSpriteSheet.java | 4 +- 14 files changed, 179 insertions(+), 57 deletions(-) delete mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfAdrenalineSurge.java create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfMastery.java diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 7abd31659..dd3751daf 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -719,9 +719,9 @@ items.potions.exotic.exoticpotion.bistre=exotic bistre potion items.potions.exotic.exoticpotion.indigo=exotic indigo potion items.potions.exotic.exoticpotion.silver=exotic silver potion items.potions.exotic.exoticpotion.unknown_desc=This round flask contains a grainy colorful liquid. It seems to be foreign to this land, who knows what it might do when drunk or thrown? - -items.potions.exotic.potionofadrenalinesurge.name=potion of adrenaline surge -items.potions.exotic.potionofadrenalinesurge.desc=This powerful liquid will give you a greater boost of strength that withers after an extended period of time. +items.potions.exotic.exoticpotion.warning=Do you really want to cancel this potion usage? It will be consumed anyway. +items.potions.exotic.exoticpotion.yes=Yes, I'm positive +items.potions.exotic.exoticpotion.no=No, I changed my mind items.potions.exotic.potionofcleansing.name=potion of cleansing items.potions.exotic.potionofcleansing.desc=This powerful reagent will render the drinker immune to all harmful effects for a few turns when quaffed. It can be thrown at a target to cleanse them as well. @@ -747,6 +747,9 @@ items.potions.exotic.potionofdivineinspiration.desc=The power of holy energy red items.potions.exotic.potionofmagicalsight.name=potion of magical sight items.potions.exotic.potionofmagicalsight.desc=After drinking this, your senses will be briefly heightened to incredible levels, increasing your vision range and allowing you to see through walls! +items.potions.exotic.potionofmastery.name=potion of mastery +items.potions.exotic.potionofmastery.desc=Rather than granting raw strength, this potion will instead attune the muscles of the user to a particular item. This will make that item easier to use, as if the drinker had practised with it and built muscle memory.\n\nThe chosen weapon or armor will require 2 less strength to use. This potion can only be used once on each item. + items.potions.exotic.potionofshielding.name=potion of shielding items.potions.exotic.potionofshielding.desc=Rather than heal, this potion will instead project a durable shield around the user's body, blocking a considerable amount of damage. diff --git a/core/src/main/assets/sprites/item_icons.png b/core/src/main/assets/sprites/item_icons.png index 2f0bfa437f0f1291539fb1034f2926270457ceb8..c5f2bae2998f4145460712552844936315e85e63 100644 GIT binary patch delta 1149 zcmV-@1cLjy45{~8+q&ocj-00930i2(lq0Fh4| zf0^$8w155p{{N%@=zxHL|NsALBjHN3HUPin|1(utG9b(;ZK2Z7rT`p=KmT|r|Nj60 z|HS40sxyD7(sQc-|NmxC|6l-ArvLw7|J!B%)lIbKyqS+&0OkMxhyaS%*#At@|Nogy zJuV9V^*aCn00DGTPE!Ct=GbNc00Xs2e?&o4cmeF!VNW747{u{EZUu`4R^ea)?^M43 zhrH?2WD;|pX?$n0ztY`=7tZidMRl41q9_eGZ2iXi|G71kjyGO~`v-Qy!f zgFIv)6|Il?_wBx1E@@UPT;QRhUyd#7^%@uO`=xTeD8A)agpCWpHuAT0TP)C8f7E<& z0b-oGq!bf~U>fJ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HDV82@d-76bZd{S45i%6~&u%fP+qF|Db-L6(m_4x25Hm!54!3I0vNN{ZKQ-FMo^1Cme{ beIW*lubsCpkJ!K1_(%HtF5y@D2qgajLT>%% diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index 304d39c67..2ba7cee7c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -58,6 +58,9 @@ public class ShatteredPixelDungeon extends Game { com.watabou.utils.Bundle.addAlias( com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfDivineInspiration.class, "com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfHolyFuror" ); + com.watabou.utils.Bundle.addAlias( + com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfMastery.class, + "com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfAdrenalineSurge" ); //v1.0.0 com.watabou.utils.Bundle.addAlias( diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AdrenalineSurge.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AdrenalineSurge.java index 4c2ba90b5..eec9e5b96 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AdrenalineSurge.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AdrenalineSurge.java @@ -27,7 +27,7 @@ import com.watabou.utils.Bundle; public class AdrenalineSurge extends Buff { - public static float DURATION = 800f; + public static float DURATION = 200f; { type = buffType.POSITIVE; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java index e3c8a63cc..74c223785 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java @@ -103,6 +103,7 @@ public class Armor extends EquipableItem { public Glyph glyph; public boolean curseInfusionBonus = false; + public boolean masteryPotionBonus = false; private BrokenSeal seal; @@ -120,6 +121,7 @@ public class Armor extends EquipableItem { private static final String AVAILABLE_USES = "available_uses"; private static final String GLYPH = "glyph"; private static final String CURSE_INFUSION_BONUS = "curse_infusion_bonus"; + private static final String MASTERY_POTION_BONUS = "mastery_potion_bonus"; private static final String SEAL = "seal"; private static final String AUGMENT = "augment"; @@ -130,6 +132,7 @@ public class Armor extends EquipableItem { bundle.put( AVAILABLE_USES, availableUsesToID ); bundle.put( GLYPH, glyph ); bundle.put( CURSE_INFUSION_BONUS, curseInfusionBonus ); + bundle.put( MASTERY_POTION_BONUS, masteryPotionBonus ); bundle.put( SEAL, seal); bundle.put( AUGMENT, augment); } @@ -141,6 +144,7 @@ public class Armor extends EquipableItem { availableUsesToID = bundle.getInt( AVAILABLE_USES ); inscribe((Glyph) bundle.get(GLYPH)); curseInfusionBonus = bundle.getBoolean( CURSE_INFUSION_BONUS ); + masteryPotionBonus = bundle.getBoolean( MASTERY_POTION_BONUS ); seal = (BrokenSeal)bundle.get(SEAL); augment = bundle.getEnum(AUGMENT, Augment.class); @@ -533,7 +537,11 @@ public class Armor extends EquipableItem { } public int STRReq(){ - return STRReq(level()); + int req = STRReq(level()); + if (masteryPotionBonus){ + req -= 2; + } + return req; } public int STRReq(int lvl){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java index 361b67dfe..1292870de 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java @@ -110,6 +110,7 @@ abstract public class ClassArmor extends Armor { classArmor.inscribe( armor.glyph ); classArmor.cursed = armor.cursed; classArmor.curseInfusionBonus = armor.curseInfusionBonus; + classArmor.masteryPotionBonus = armor.masteryPotionBonus; classArmor.identify(); classArmor.charge = 50; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java index 0667abd4a..2202d268f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java @@ -37,7 +37,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfParalyticG import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfPurity; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas; -import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; import com.watabou.utils.Reflection; import java.util.ArrayList; @@ -58,8 +57,8 @@ public class ExoticPotion extends Potion { regToExo.put(PotionOfToxicGas.class, PotionOfCorrosiveGas.class); exoToReg.put(PotionOfCorrosiveGas.class, PotionOfToxicGas.class); - regToExo.put(PotionOfStrength.class, PotionOfAdrenalineSurge.class); - exoToReg.put(PotionOfAdrenalineSurge.class, PotionOfStrength.class); + regToExo.put(PotionOfStrength.class, PotionOfMastery.class); + exoToReg.put(PotionOfMastery.class, PotionOfStrength.class); regToExo.put(PotionOfFrost.class, PotionOfSnapFreeze.class); exoToReg.put(PotionOfSnapFreeze.class, PotionOfFrost.class); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfAdrenalineSurge.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfAdrenalineSurge.java deleted file mode 100644 index 437d11a18..000000000 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfAdrenalineSurge.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2021 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic; - -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AdrenalineSurge; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; - -public class PotionOfAdrenalineSurge extends ExoticPotion { - - { - icon = ItemSpriteSheet.Icons.POTION_ARENSURGE; - - unique = true; - } - - @Override - public void apply(Hero hero) { - identify(); - Buff.affect(hero, AdrenalineSurge.class).reset(2, 800f); - } - -} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfDragonsBreath.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfDragonsBreath.java index a1743f25e..ea5aa69ff 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfDragonsBreath.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfDragonsBreath.java @@ -39,7 +39,9 @@ import com.shatteredpixel.shatteredpixeldungeon.mechanics.ConeAOE; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Callback; import com.watabou.utils.PathFinder; @@ -62,12 +64,38 @@ public class PotionOfDragonsBreath extends ExoticPotion { } private CellSelector.Listener targeter = new CellSelector.Listener() { + + private boolean showingWindow = false; + @Override public void onSelect(final Integer cell) { + if (showingWindow){ + return; + } + if (cell == null && !isKnown()){ - identify(); - detach(curUser.belongings.backpack); + showingWindow = true; + GameScene.show( new WndOptions(new ItemSprite(PotionOfDragonsBreath.this), + Messages.titleCase(name()), + Messages.get(ExoticPotion.class, "warning"), + Messages.get(ExoticPotion.class, "yes"), + Messages.get(ExoticPotion.class, "no") ) { + @Override + protected void onSelect( int index ) { + showingWindow = false; + switch (index) { + case 0: + curUser.spendAndNext(1f); + detach(curUser.belongings.backpack); + break; + case 1: + GameScene.selectCell( targeter ); + break; + } + } + public void onBackPressed() {} + } ); } else if (cell != null) { identify(); curUser.busy(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfMastery.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfMastery.java new file mode 100644 index 000000000..234dc71ee --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfMastery.java @@ -0,0 +1,114 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2021 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic; + +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; +import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; +import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; +import com.watabou.noosa.audio.Sample; + +public class PotionOfMastery extends ExoticPotion { + + { + icon = ItemSpriteSheet.Icons.POTION_MASTERY; + + unique = true; + } + + @Override + //need to override drink so that time isn't spent right away + protected void drink(final Hero hero) { + curUser = hero; + curItem = this; + + GameScene.selectItem(itemSelector); + } + + protected WndBag.ItemSelector itemSelector = new WndBag.ItemSelector() { + + @Override + public String textPrompt() { + return "Master an Item"; + } + + @Override + public boolean itemSelectable(Item item) { + return + (item instanceof MeleeWeapon && !((MeleeWeapon) item).masteryPotionBonus) + || (item instanceof Armor && !((Armor) item).masteryPotionBonus); + } + + @Override + public void onSelect(Item item) { + + if (item == null && !isKnown()){ + GameScene.show( new WndOptions(new ItemSprite(PotionOfMastery.this), + Messages.titleCase(name()), + Messages.get(ExoticPotion.class, "warning"), + Messages.get(ExoticPotion.class, "yes"), + Messages.get(ExoticPotion.class, "no") ) { + @Override + protected void onSelect( int index ) { + switch (index) { + case 0: + curUser.spendAndNext(1f); + detach(curUser.belongings.backpack); + break; + case 1: + GameScene.selectItem(itemSelector); + break; + } + } + public void onBackPressed() {} + } ); + } else if (item != null) { + + if (item instanceof Weapon) { + ((Weapon) item).masteryPotionBonus = true; + GLog.p( "Your weapon becomes easier to wield!" ); + } else if (item instanceof Armor) { + ((Armor) item).masteryPotionBonus = true; + GLog.p( "Your weapon becomes easier to wear!" ); + } + updateQuickslot(); + + identify(); + Sample.INSTANCE.play( Assets.Sounds.DRINK ); + curUser.sprite.operate(curUser.pos); + curItem.detach(curUser.belongings.backpack); + + } + + } + }; + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTransmutation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTransmutation.java index 99ef154b9..a7666d6eb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTransmutation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTransmutation.java @@ -180,6 +180,7 @@ public class ScrollOfTransmutation extends InventoryScroll { n.enchantment = w.enchantment; n.curseInfusionBonus = w.curseInfusionBonus; + n.masteryPotionBonus = w.masteryPotionBonus; n.levelKnown = w.levelKnown; n.cursedKnown = w.cursedKnown; n.cursed = w.cursed; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java index 3cf2c3450..c3304c38d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java @@ -99,6 +99,7 @@ abstract public class Weapon extends KindOfWeapon { public Enchantment enchantment; public boolean curseInfusionBonus = false; + public boolean masteryPotionBonus = false; @Override public int proc( Char attacker, Char defender, int damage ) { @@ -133,6 +134,7 @@ abstract public class Weapon extends KindOfWeapon { private static final String AVAILABLE_USES = "available_uses"; private static final String ENCHANTMENT = "enchantment"; private static final String CURSE_INFUSION_BONUS = "curse_infusion_bonus"; + private static final String MASTERY_POTION_BONUS = "mastery_potion_bonus"; private static final String AUGMENT = "augment"; @Override @@ -142,6 +144,7 @@ abstract public class Weapon extends KindOfWeapon { bundle.put( AVAILABLE_USES, availableUsesToID ); bundle.put( ENCHANTMENT, enchantment ); bundle.put( CURSE_INFUSION_BONUS, curseInfusionBonus ); + bundle.put( MASTERY_POTION_BONUS, masteryPotionBonus ); bundle.put( AUGMENT, augment ); } @@ -152,6 +155,7 @@ abstract public class Weapon extends KindOfWeapon { availableUsesToID = bundle.getFloat( AVAILABLE_USES ); enchantment = (Enchantment)bundle.get( ENCHANTMENT ); curseInfusionBonus = bundle.getBoolean( CURSE_INFUSION_BONUS ); + masteryPotionBonus = bundle.getBoolean( MASTERY_POTION_BONUS ); augment = bundle.getEnum(AUGMENT, Augment.class); } @@ -207,7 +211,11 @@ abstract public class Weapon extends KindOfWeapon { } public int STRReq(){ - return STRReq(level()); + int req = STRReq(level()); + if (masteryPotionBonus){ + req -= 2; + } + return req; } public abstract int STRReq(int lvl); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Rotberry.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Rotberry.java index 1543b520b..1184f9d0d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Rotberry.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Rotberry.java @@ -41,7 +41,7 @@ public class Rotberry extends Plant { @Override public void activate( Char ch ) { if (ch instanceof Hero && ((Hero) ch).subClass == HeroSubClass.WARDEN){ - Buff.affect(ch, AdrenalineSurge.class).reset(1, 200f); + Buff.affect(ch, AdrenalineSurge.class).reset(1, AdrenalineSurge.DURATION); } Dungeon.level.drop( new Seed(), pos ).sprite.drop(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java index 177b340ce..2ae8bb040 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -834,7 +834,7 @@ public class ItemSpriteSheet { } private static final int EXOTIC_POTIONS = xy(1, 7); //16 slots - public static final int POTION_ARENSURGE= EXOTIC_POTIONS+0; + public static final int POTION_MASTERY = EXOTIC_POTIONS+0; public static final int POTION_SHIELDING= EXOTIC_POTIONS+1; public static final int POTION_MAGISIGHT= EXOTIC_POTIONS+2; public static final int POTION_SNAPFREEZ= EXOTIC_POTIONS+3; @@ -847,7 +847,7 @@ public class ItemSpriteSheet { public static final int POTION_CLEANSE = EXOTIC_POTIONS+10; public static final int POTION_DIVINE = EXOTIC_POTIONS+11; static { - assignIconRect( POTION_ARENSURGE, 7, 7 ); + assignIconRect( POTION_MASTERY, 7, 7 ); assignIconRect( POTION_SHIELDING, 6, 6 ); assignIconRect( POTION_MAGISIGHT, 7, 5 ); assignIconRect( POTION_SNAPFREEZ, 7, 7 );