From 2dfa01e1ad96d1b6c850d2e738eb3c6d86794e07 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 11 May 2020 21:43:43 -0400 Subject: [PATCH] v0.8.1: refactored consumable icons into generic item icons (2/2) --- core/src/main/assets/sprites/item_icons.png | Bin 1256 -> 1301 bytes .../shatteredpixeldungeon/Assets.java | 3 +- .../shatteredpixeldungeon/items/Item.java | 1 + .../items/potions/Potion.java | 6 - .../items/potions/PotionOfExperience.java | 3 +- .../items/potions/PotionOfFrost.java | 3 +- .../items/potions/PotionOfHaste.java | 3 +- .../items/potions/PotionOfHealing.java | 3 +- .../items/potions/PotionOfInvisibility.java | 3 +- .../items/potions/PotionOfLevitation.java | 3 +- .../items/potions/PotionOfLiquidFlame.java | 3 +- .../items/potions/PotionOfMindVision.java | 3 +- .../items/potions/PotionOfParalyticGas.java | 3 +- .../items/potions/PotionOfPurity.java | 3 +- .../items/potions/PotionOfStrength.java | 3 +- .../items/potions/PotionOfToxicGas.java | 3 +- .../exotic/PotionOfAdrenalineSurge.java | 3 +- .../potions/exotic/PotionOfCleansing.java | 3 +- .../potions/exotic/PotionOfCorrosiveGas.java | 3 +- .../potions/exotic/PotionOfDragonsBreath.java | 3 +- .../potions/exotic/PotionOfEarthenArmor.java | 3 +- .../potions/exotic/PotionOfHolyFuror.java | 3 +- .../potions/exotic/PotionOfMagicalSight.java | 3 +- .../potions/exotic/PotionOfShielding.java | 3 +- .../potions/exotic/PotionOfShroudingFog.java | 3 +- .../potions/exotic/PotionOfSnapFreeze.java | 3 +- .../items/potions/exotic/PotionOfStamina.java | 3 +- .../potions/exotic/PotionOfStormClouds.java | 3 +- .../items/scrolls/Scroll.java | 6 - .../items/scrolls/ScrollOfIdentify.java | 3 +- .../items/scrolls/ScrollOfLullaby.java | 3 +- .../items/scrolls/ScrollOfMagicMapping.java | 3 +- .../items/scrolls/ScrollOfMirrorImage.java | 3 +- .../items/scrolls/ScrollOfRage.java | 3 +- .../items/scrolls/ScrollOfRecharging.java | 3 +- .../items/scrolls/ScrollOfRemoveCurse.java | 5 +- .../items/scrolls/ScrollOfRetribution.java | 3 +- .../items/scrolls/ScrollOfTeleportation.java | 3 +- .../items/scrolls/ScrollOfTerror.java | 3 +- .../items/scrolls/ScrollOfTransmutation.java | 3 +- .../items/scrolls/ScrollOfUpgrade.java | 3 +- .../scrolls/exotic/ScrollOfAffection.java | 3 +- .../scrolls/exotic/ScrollOfAntiMagic.java | 3 +- .../scrolls/exotic/ScrollOfConfusion.java | 3 +- .../scrolls/exotic/ScrollOfDivination.java | 3 +- .../scrolls/exotic/ScrollOfEnchantment.java | 3 +- .../scrolls/exotic/ScrollOfForesight.java | 3 +- .../exotic/ScrollOfMysticalEnergy.java | 3 +- .../items/scrolls/exotic/ScrollOfPassage.java | 3 +- .../scrolls/exotic/ScrollOfPetrification.java | 3 +- .../scrolls/exotic/ScrollOfPolymorph.java | 3 +- .../exotic/ScrollOfPrismaticImage.java | 3 +- .../scrolls/exotic/ScrollOfPsionicBlast.java | 3 +- .../items/stones/StoneOfIntuition.java | 85 ++----- .../sprites/ItemSpriteSheet.java | 151 +++++++++++- .../shatteredpixeldungeon/ui/ItemSlot.java | 218 +++++++----------- .../ui/LootIndicator.java | 6 +- .../shatteredpixeldungeon/ui/QuickRecipe.java | 8 +- .../ui/QuickSlotButton.java | 8 +- 59 files changed, 358 insertions(+), 280 deletions(-) diff --git a/core/src/main/assets/sprites/item_icons.png b/core/src/main/assets/sprites/item_icons.png index 531d54807f054ba3a8e59c35f06b003a4ef184f8..bbeee1ea3b1f6c0a529111de9a968e633202c4fe 100644 GIT binary patch literal 1301 zcmX|AeN@s{7`}YThhSLt1!`GYYHWTnvqTSh@T)?}v}xI-ESj7xNj;^@1WJ#6El``8 zS)rI#t8~$h*qY$98fjUvP0@~uNZL|Kn~ItIcCB-I?t7o-eV=pR_uTu(J;{rXppa-J z001Q_k`oJ60ymq0fovwoxKIXoTjIi?UO@bT0)bHWLjrfjHWkA_!5{Yo7ag!<>h>6!q`*JgwxtQzpr@F z-lkKl>MC-x1xOiy6D`G0krs2$5Q5zB=OO$#v)xa8{RM*XS(?Z;y(5AM=6u~!5LXRN z^)65ioRPn|DwS%k>jXITJpb;i`|xh3Iyf z_a>N#f(;MaSdm3eZaCc?vZ-ABU|{M8FGa+wy#W>4ZhFFTU1$HJYrs#1DPyKC{xdzu zqdRraIL>5GF5RDT#Gj*g;!RrX(f;%zY|$aqe!M6@BjDilzQoY@_{i1E)+rXAS@Rwv z%t0XzV;hX#TB7ewP`%?>kM`LW5&q$VFQoSlkgP7N9{Di?YaeDEB>QP-Y(49J9hU8E9CJ-+|YCoqp)#Vf}yE5RF#Vwc35%oN7qi$ zDm&dfXT!+UjEhLF{$P$Z*tCVkTn|ym&p1=7*)M!L{nroOBLYfUt5o0;ULRpB=}q!DWOqiS6VeY+ii)+sI$(PsOOWNaB$|t1hMb286mAZ5BE*WhtM0T%ql-whpR{Mv-cV^)uCijOF4ON436)533M(Y9 zkbdL+W}<5}xwgaYZMpW_U#xn5LlUjoX~0ptj(2nWTAV;}6fH!37clYu$-@kMk#pRYeY9dGeVwsXKKbov_{Z z`+cp9GJJ>8Ee-Bm4e)0lr4akDf$uId52}Q{(pM2X2*Z9shNqX^j@bKD-f&<~|2BWt zc39MqWGq=dS~3!Y@;*tGr@A&D4K5>y0-cMbDcOw8<)c$J;@~4wx`R}`s~&Nvns~jL zY4!CzfgLVrHoDrM5na3S7_~_h(_smcwVL~lB@)K-5Y%62IoYlfQwVm-=Lg1}^+a29 z|Lu)AdV8?dlv7APfvv>c!WA{KsV@B8oD^O~Rh941%B4wp>`X=Q1Rd-V2V$>b74y`D f7SACF>*6tdaB(jFJ>{F%)NLGyiBY&=>) zt%8UIQUyf?O>7-hNCZVG3gPIe$SEQ%Af*92Od;FN*!SMP9v2hNVsID$ z09Ir~NIZ%-T3i|h`N?_Q9)*#(&4SQ9mwfuiAOt{htrK4NhENDEf;i-RMQvTysDVn@ z?ga!_;r}9@I{N}Pze7y_#t1X>nd7}Aa1}Vgo@g`*sL(KQ;^j*-T?w)b1=`UE2>Ape zT%*xM2dqM^Yr~pPV9Du3Actx=rd61bl|b(cE)bZYdKls?7UXbn9RIZ_Txwed^HvDDms>2-any`UuRGSw(CqTe~4cgpERwE5G)haY_0B*+WcwLQ79p6 zRg*zohMtOi#>3>=a;o&GUWGLoXes=Xm?~Sb25WPZ_?B+x?Ns%dnpM4#^bXiryW|`> zY&!7CZ1zBNW~aoblE~R$`CPfJW-&|aW^(KMP~96%pOG&##0TGe5VYyAzZJISv9DND zax5prA1*B1yt|#J9iAIA%IRa8#AC+aL`AqeUqHLjO8t)dXpdDs*hJn z7g0`7TdkCs_a15_m&02|oUX=?yeZb(NToKjxk<-MsE_P*WOf4%UDKEQS_qjF^Q?dQ z9he_*%@Rfz+aP z`(Fi=S2?G|HJ(bO9{t8i-el-V-Y_il%aatEDC1FA?u-^YYueW)&S+AcW*1w;C@cok4 zP0LdcxzMC*lC6Cxvc%wo!P54jT}t0%ORCFo>FKz+peu*nA4+F@rf4ryw4NAGnwj)j zI`>h8$Lo3rQ%{XJ6(KSd%zX%VA}EQ)RjWD zZ-yxW6YVfrbMtyL(&;}pXOSdE&-|crU}2b_&VEy9kj&KULR^KdhE|=elIJl9so8+6 zqH!r~1|A2dyvpKr?LeS>HflV05MyUr7M{#7hTn*_h*FMwDm|`br!pPzrwp(&|28#D zy}BOj)|3Ruw3L`HaPQP2Hu+Xs|K-|?v%ESV6K&+u#xnsmF2WyJOLyPz>lC&?y>s2# zOj4d5!Q@@|zKOufNCSRH$t`Y@H7&WCCvPl{=yDb7%VMh*O6_s?9tLh?aw2s59c@xF zNg0;0c;i5>BJk_oQ}((Q`CsdeZ@Hd+@0JQ}&{E-Mh_! qcJ4j!bJE`P)[] potions = { PotionOfHealing.class, PotionOfExperience.class, @@ -382,10 +380,6 @@ public class Potion extends Item { public String info() { return isKnown() ? desc() : Messages.get(this, "unknown_desc"); } - - public Integer initials(){ - return isKnown() ? initials : null; - } @Override public boolean isIdentified() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java index a5dc6f9ed..7477c4f1a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java @@ -22,11 +22,12 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class PotionOfExperience extends Potion { { - initials = 0; + icon = ItemSpriteSheet.Icons.POTION_EXP; bones = true; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfFrost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfFrost.java index 36f38acd3..51f4e9d89 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfFrost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfFrost.java @@ -26,13 +26,14 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Freezing; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; import com.watabou.utils.PathFinder; public class PotionOfFrost extends Potion { { - initials = 1; + icon = ItemSpriteSheet.Icons.POTION_FROST; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHaste.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHaste.java index 63bfe93d8..5cc84feff 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHaste.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHaste.java @@ -25,12 +25,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class PotionOfHaste extends Potion { { - initials = 2; + icon = ItemSpriteSheet.Icons.POTION_HASTE; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java index 655cc83df..3e3aaf340 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java @@ -35,12 +35,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vulnerable; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class PotionOfHealing extends Potion { { - initials = 3; + icon = ItemSpriteSheet.Icons.POTION_HEALING; bones = true; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java index c1fbaa610..6069e67a9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java @@ -26,13 +26,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; public class PotionOfInvisibility extends Potion { { - initials = 4; + icon = ItemSpriteSheet.Icons.POTION_INVIS; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLevitation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLevitation.java index 91c052145..f48154b3d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLevitation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLevitation.java @@ -30,13 +30,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Levitation; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; public class PotionOfLevitation extends Potion { { - initials = 5; + icon = ItemSpriteSheet.Icons.POTION_LEVITATE; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLiquidFlame.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLiquidFlame.java index 73f5449d1..db1209eff 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLiquidFlame.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLiquidFlame.java @@ -26,13 +26,14 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; import com.watabou.utils.PathFinder; public class PotionOfLiquidFlame extends Potion { { - initials = 6; + icon = ItemSpriteSheet.Icons.POTION_LIQFLAME; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java index 7b6e68174..e910ef60d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java @@ -26,12 +26,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MindVision; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class PotionOfMindVision extends Potion { { - initials = 7; + icon = ItemSpriteSheet.Icons.POTION_MINDVIS; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfParalyticGas.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfParalyticGas.java index f1ecbf151..bc3a3b0c1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfParalyticGas.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfParalyticGas.java @@ -26,12 +26,13 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ParalyticGas; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class PotionOfParalyticGas extends Potion { { - initials = 8; + icon = ItemSpriteSheet.Icons.POTION_PARAGAS; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java index 0d6749e3d..9dcd4df09 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java @@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; @@ -44,7 +45,7 @@ public class PotionOfPurity extends Potion { private static ArrayList affectedBlobs; { - initials = 9; + icon = ItemSpriteSheet.Icons.POTION_PURITY; affectedBlobs = new ArrayList<>(new BlobImmunity().immunities()); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java index c9250844d..75a07e40a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java @@ -25,12 +25,13 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class PotionOfStrength extends Potion { { - initials = 10; + icon = ItemSpriteSheet.Icons.POTION_STRENGTH; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfToxicGas.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfToxicGas.java index 7ef6c3e47..3eb597379 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfToxicGas.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfToxicGas.java @@ -26,12 +26,13 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class PotionOfToxicGas extends Potion { { - initials = 11; + icon = ItemSpriteSheet.Icons.POTION_TOXICGAS; } @Override 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 index d29aa1e76..c0c134eae 100644 --- 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 @@ -24,11 +24,12 @@ 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 { { - initials = 10; + icon = ItemSpriteSheet.Icons.POTION_ARENSURGE; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCleansing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCleansing.java index 8592cc59c..d78b56040 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCleansing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCleansing.java @@ -29,12 +29,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class PotionOfCleansing extends ExoticPotion { { - initials = 9; + icon = ItemSpriteSheet.Icons.POTION_CLEANSE; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCorrosiveGas.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCorrosiveGas.java index d616de336..2e8d6c6d9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCorrosiveGas.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCorrosiveGas.java @@ -26,12 +26,13 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.CorrosiveGas; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class PotionOfCorrosiveGas extends ExoticPotion { { - initials = 11; + icon = ItemSpriteSheet.Icons.POTION_CORROGAS; } @Override 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 c88ecbb95..d5a197acf 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 @@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Callback; import com.watabou.utils.PathFinder; @@ -45,7 +46,7 @@ import java.util.HashSet; public class PotionOfDragonsBreath extends ExoticPotion { { - initials = 6; + icon = ItemSpriteSheet.Icons.POTION_DRGBREATH; } //a lot of this is copy-paste from wand of fireblast diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfEarthenArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfEarthenArmor.java index dfe72c5d0..36ae55d5e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfEarthenArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfEarthenArmor.java @@ -24,11 +24,12 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class PotionOfEarthenArmor extends ExoticPotion { { - initials = 8; + icon = ItemSpriteSheet.Icons.POTION_EARTHARMR; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfHolyFuror.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfHolyFuror.java index fde37a23d..7b645df75 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfHolyFuror.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfHolyFuror.java @@ -24,11 +24,12 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bless; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class PotionOfHolyFuror extends ExoticPotion { { - initials = 0; + icon = ItemSpriteSheet.Icons.POTION_HOLYFUROR; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfMagicalSight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfMagicalSight.java index 493092d55..01d377a3f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfMagicalSight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfMagicalSight.java @@ -25,11 +25,12 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicalSight; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class PotionOfMagicalSight extends ExoticPotion { { - initials = 7; + icon = ItemSpriteSheet.Icons.POTION_MAGISIGHT; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfShielding.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfShielding.java index 84487a18b..44322fa1b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfShielding.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfShielding.java @@ -24,11 +24,12 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class PotionOfShielding extends ExoticPotion { { - initials = 3; + icon = ItemSpriteSheet.Icons.POTION_SHIELDING; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfShroudingFog.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfShroudingFog.java index 2aad49cf4..b26d4ff98 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfShroudingFog.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfShroudingFog.java @@ -26,12 +26,13 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.SmokeScreen; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class PotionOfShroudingFog extends ExoticPotion { { - initials = 4; + icon = ItemSpriteSheet.Icons.POTION_SHROUDFOG; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfSnapFreeze.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfSnapFreeze.java index 04819f172..1e22d1acd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfSnapFreeze.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfSnapFreeze.java @@ -29,13 +29,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Freezing; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; import com.watabou.utils.PathFinder; public class PotionOfSnapFreeze extends ExoticPotion { { - initials = 1; + icon = ItemSpriteSheet.Icons.POTION_SNAPFREEZ; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfStamina.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfStamina.java index 8e80d08e4..f4bdbbe30 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfStamina.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfStamina.java @@ -24,11 +24,12 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Stamina; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class PotionOfStamina extends ExoticPotion { { - initials = 2; + icon = ItemSpriteSheet.Icons.POTION_STAMINA; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfStormClouds.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfStormClouds.java index 3fa38c33c..5fcbbf6b5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfStormClouds.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfStormClouds.java @@ -26,12 +26,13 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StormCloud; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class PotionOfStormClouds extends ExoticPotion { { - initials = 5; + icon = ItemSpriteSheet.Icons.POTION_STRMCLOUD; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java index 84e60e735..ad4d6ca04 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java @@ -62,8 +62,6 @@ public abstract class Scroll extends Item { protected static final float TIME_TO_READ = 1f; - protected Integer initials; - private static final Class[] scrolls = { ScrollOfIdentify.class, ScrollOfMagicMapping.class, @@ -235,10 +233,6 @@ public abstract class Scroll extends Item { desc() : Messages.get(this, "unknown_desc"); } - - public Integer initials(){ - return isKnown() ? initials : null; - } @Override public boolean isUpgradable() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfIdentify.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfIdentify.java index e53c3f6cc..8ea29b8ad 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfIdentify.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfIdentify.java @@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.effects.Identification; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; import com.watabou.noosa.audio.Sample; @@ -36,7 +37,7 @@ import java.util.ArrayList; public class ScrollOfIdentify extends InventoryScroll { { - initials = 0; + icon = ItemSpriteSheet.Icons.SCROLL_IDENTIFY; mode = WndBag.Mode.UNIDENTIFED; bones = true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfLullaby.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfLullaby.java index 078f770a6..cc91defa4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfLullaby.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfLullaby.java @@ -29,13 +29,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; public class ScrollOfLullaby extends Scroll { { - initials = 1; + icon = ItemSpriteSheet.Icons.SCROLL_LULLABY; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java index ee6ef75da..e70d30abb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java @@ -33,13 +33,14 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; public class ScrollOfMagicMapping extends Scroll { { - initials = 2; + icon = ItemSpriteSheet.Icons.SCROLL_MAGICMAP; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java index 88d7fa294..352638b8d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java @@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; import com.watabou.utils.PathFinder; @@ -40,7 +41,7 @@ import java.util.ArrayList; public class ScrollOfMirrorImage extends Scroll { { - initials = 3; + icon = ItemSpriteSheet.Icons.SCROLL_MIRRORIMG; } private static final int NIMAGES = 2; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRage.java index 6741f406c..8c1c71c5c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRage.java @@ -32,13 +32,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; public class ScrollOfRage extends Scroll { { - initials = 5; + icon = ItemSpriteSheet.Icons.SCROLL_RAGE; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRecharging.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRecharging.java index a839f5df7..d8cd99f10 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRecharging.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRecharging.java @@ -30,13 +30,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.EnergyParticle; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; public class ScrollOfRecharging extends Scroll { { - initials = 6; + icon = ItemSpriteSheet.Icons.SCROLL_RECHARGE; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java index 300a8580a..9e3120fce 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRemoveCurse.java @@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; import com.watabou.noosa.audio.Sample; @@ -40,7 +41,7 @@ import com.watabou.noosa.audio.Sample; public class ScrollOfRemoveCurse extends InventoryScroll { { - initials = 7; + icon = ItemSpriteSheet.Icons.SCROLL_REMCURSE; mode = WndBag.Mode.UNCURSABLE; } @@ -117,6 +118,8 @@ public class ScrollOfRemoveCurse extends InventoryScroll { return ((Weapon)item).hasCurseEnchant(); } else if (item instanceof Armor){ return ((Armor)item).hasCurseGlyph(); + } else if (item.level() != item.buffedLvl()) { + return true; } else { return false; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRetribution.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRetribution.java index 7e3c038f4..d8717a884 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRetribution.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfRetribution.java @@ -29,12 +29,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class ScrollOfRetribution extends Scroll { { - initials = 4; + icon = ItemSpriteSheet.Icons.SCROLL_RETRIB; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java index 277358122..c00b8eef5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java @@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; @@ -50,7 +51,7 @@ import java.util.ArrayList; public class ScrollOfTeleportation extends Scroll { { - initials = 8; + icon = ItemSpriteSheet.Icons.SCROLL_TELEPORT; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTerror.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTerror.java index a09f34793..f0343483e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTerror.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTerror.java @@ -31,13 +31,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; public class ScrollOfTerror extends Scroll { { - initials = 9; + icon = ItemSpriteSheet.Icons.SCROLL_TERROR; } @Override 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 31b23d1de..de6733cf4 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 @@ -44,6 +44,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; import com.watabou.utils.Random; @@ -52,7 +53,7 @@ import com.watabou.utils.Reflection; public class ScrollOfTransmutation extends InventoryScroll { { - initials = 10; + icon = ItemSpriteSheet.Icons.SCROLL_TRANSMUTE; mode = WndBag.Mode.TRANMSUTABLE; bones = true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java index 607c8e578..4214130bd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java @@ -34,13 +34,14 @@ import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; public class ScrollOfUpgrade extends InventoryScroll { { - initials = 11; + icon = ItemSpriteSheet.Icons.SCROLL_UPGRADE; mode = WndBag.Mode.UPGRADEABLE; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAffection.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAffection.java index f6c385694..f3e93221d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAffection.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAffection.java @@ -28,12 +28,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class ScrollOfAffection extends ExoticScroll { { - initials = 1; + icon = ItemSpriteSheet.Icons.SCROLL_AFFECTION; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAntiMagic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAntiMagic.java index f0cfa08de..4a75f1b03 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAntiMagic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfAntiMagic.java @@ -25,11 +25,12 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune; import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class ScrollOfAntiMagic extends ExoticScroll { { - initials = 7; + icon = ItemSpriteSheet.Icons.SCROLL_ANTIMAGIC; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfConfusion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfConfusion.java index e37672a73..9553b14ea 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfConfusion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfConfusion.java @@ -30,12 +30,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class ScrollOfConfusion extends ExoticScroll { { - initials = 5; + icon = ItemSpriteSheet.Icons.SCROLL_CONFUSION; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfDivination.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfDivination.java index 64d854a8d..8b72157b1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfDivination.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfDivination.java @@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock; import com.shatteredpixel.shatteredpixeldungeon.ui.Window; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -46,7 +47,7 @@ import java.util.HashSet; public class ScrollOfDivination extends ExoticScroll { { - initials = 0; + icon = ItemSpriteSheet.Icons.SCROLL_DIVINATE; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfEnchantment.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfEnchantment.java index f16223cca..bf94e67cd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfEnchantment.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfEnchantment.java @@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfEnchantment; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; @@ -38,7 +39,7 @@ import com.watabou.noosa.audio.Sample; public class ScrollOfEnchantment extends ExoticScroll { { - initials = 11; + icon = ItemSpriteSheet.Icons.SCROLL_ENCHANT; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfForesight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfForesight.java index 1db1627d6..49fec4b8e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfForesight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfForesight.java @@ -26,12 +26,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Foresight; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class ScrollOfForesight extends ExoticScroll { { - initials = 2; + icon = ItemSpriteSheet.Icons.SCROLL_FORESIGHT; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMysticalEnergy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMysticalEnergy.java index 60da46c83..19c548a14 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMysticalEnergy.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMysticalEnergy.java @@ -27,12 +27,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class ScrollOfMysticalEnergy extends ExoticScroll { { - initials = 6; + icon = ItemSpriteSheet.Icons.SCROLL_MYSTENRG; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPassage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPassage.java index bfe2228aa..4c7a8f59a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPassage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPassage.java @@ -28,13 +28,14 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportat import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.plants.Swiftthistle; import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.Game; public class ScrollOfPassage extends ExoticScroll { { - initials = 8; + icon = ItemSpriteSheet.Icons.SCROLL_ENCHANT; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPetrification.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPetrification.java index e1167813d..bb74d313b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPetrification.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPetrification.java @@ -29,12 +29,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class ScrollOfPetrification extends ExoticScroll { { - initials = 9; + icon = ItemSpriteSheet.Icons.SCROLL_PETRIF; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPolymorph.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPolymorph.java index 174ce7d8e..d8e92eae7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPolymorph.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPolymorph.java @@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.ui.TargetHealthIndicator; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Random; @@ -38,7 +39,7 @@ import com.watabou.utils.Random; public class ScrollOfPolymorph extends ExoticScroll { { - initials = 10; + icon = ItemSpriteSheet.Icons.SCROLL_POLYMORPH; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPrismaticImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPrismaticImage.java index 5283e16a2..1bac4c9b3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPrismaticImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPrismaticImage.java @@ -29,12 +29,13 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PrismaticGuard; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.PrismaticImage; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; public class ScrollOfPrismaticImage extends ExoticScroll { { - initials = 3; + icon = ItemSpriteSheet.Icons.SCROLL_PRISIMG; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPsionicBlast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPsionicBlast.java index a18c7be2e..88de80a25 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPsionicBlast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPsionicBlast.java @@ -30,13 +30,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; public class ScrollOfPsionicBlast extends ExoticScroll { { - initials = 4; + icon = ItemSpriteSheet.Icons.SCROLL_PSIBLAST; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfIntuition.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfIntuition.java index 5f4081511..b8a250016 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfIntuition.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfIntuition.java @@ -23,34 +23,11 @@ package com.shatteredpixel.shatteredpixeldungeon.items.stones; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.effects.Identification; +import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfExperience; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfFrost; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHaste; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLevitation; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMindVision; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfParalyticGas; -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.items.potions.exotic.ExoticPotion; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfLullaby; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMirrorImage; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRage; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetribution; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTerror; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -65,6 +42,7 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.windows.IconTitle; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; import com.watabou.noosa.Image; +import com.watabou.utils.Reflection; import java.util.HashSet; @@ -83,38 +61,7 @@ public class StoneOfIntuition extends InventoryStone { } - //in order of their consumable icon - public static Class[] potions = new Class[]{ - PotionOfExperience.class, - PotionOfFrost.class, - PotionOfHaste.class, - PotionOfHealing.class, - PotionOfInvisibility.class, - PotionOfLevitation.class, - PotionOfLiquidFlame.class, - PotionOfMindVision.class, - PotionOfParalyticGas.class, - PotionOfPurity.class, - PotionOfStrength.class, - PotionOfToxicGas.class - }; - - public static Class[] scrolls = new Class[]{ - ScrollOfIdentify.class, - ScrollOfLullaby.class, - ScrollOfMagicMapping.class, - ScrollOfMirrorImage.class, - ScrollOfRetribution.class, - ScrollOfRage.class, - ScrollOfRecharging.class, - ScrollOfRemoveCurse.class, - ScrollOfTeleportation.class, - ScrollOfTerror.class, - ScrollOfTransmutation.class, - ScrollOfUpgrade.class - }; - - static Class curGuess = null; + private static Class curGuess = null; public class WndGuess extends Window { @@ -163,17 +110,15 @@ public class StoneOfIntuition extends InventoryStone { int placed = 0; HashSet> unIDed = new HashSet<>(); - final Class[] all; - - final int row; + final Class[] all; + if (item.isIdentified()){ hide(); return; } else if (item instanceof Potion){ unIDed.addAll(Potion.getUnknown()); - all = potions.clone(); + all = (Class[]) Generator.Category.POTION.classes.clone(); if (item instanceof ExoticPotion){ - row = 8; for (int i = 0; i < all.length; i++){ all[i] = ExoticPotion.regToExo.get(all[i]); } @@ -182,24 +127,19 @@ public class StoneOfIntuition extends InventoryStone { exoUID.add(ExoticPotion.regToExo.get(i)); } unIDed = exoUID; - } else { - row = 0; } } else if (item instanceof Scroll){ unIDed.addAll(Scroll.getUnknown()); - all = scrolls.clone(); - if (item instanceof ExoticScroll){ - row = 24; - for (int i = 0; i < all.length; i++){ + all = (Class[]) Generator.Category.SCROLL.classes.clone(); + if (item instanceof ExoticScroll) { + for (int i = 0; i < all.length; i++) { all[i] = ExoticScroll.regToExo.get(all[i]); } - HashSet> exoUID = new HashSet<>(); - for (Class i : unIDed){ + HashSet> exoUID = new HashSet<>(); + for (Class i : unIDed) { exoUID.add(ExoticScroll.regToExo.get(i)); } unIDed = exoUID; - } else { - row = 16; } } else { hide(); @@ -231,7 +171,8 @@ public class StoneOfIntuition extends InventoryStone { super.onClick(); } }; - Image im = new Image(Assets.Interfaces.CONS_ICONS, 7*i, row, 7, 8); + Image im = new Image(Assets.Sprites.ITEM_ICONS); + im.frame(ItemSpriteSheet.Icons.film.get(Reflection.newInstance(all[i]).icon)); im.scale.set(2f); btn.icon(im); btn.setRect(left + placed*BTN_SIZE, top, BTN_SIZE, BTN_SIZE); 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 9c121880f..b777ece8d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -27,14 +27,21 @@ import com.watabou.noosa.TextureFilm; public class ItemSpriteSheet { private static final int WIDTH = 16; + public static final int SIZE = 16; - public static TextureFilm film = new TextureFilm( Assets.Sprites.ITEMS, 16, 16 ); + public static TextureFilm film = new TextureFilm( Assets.Sprites.ITEMS, SIZE, SIZE ); private static int xy(int x, int y){ x -= 1; y -= 1; return x + WIDTH*y; } + private static void assignItemRect( int item, int width, int height ){ + int x = (item % WIDTH) * SIZE; + int y = (item / WIDTH) * SIZE; + film.add( item, x, y, x+width, y+height); + } + private static final int PLACEHOLDERS = xy(1, 1); //16 slots //SOMETHING is the default item sprite at position 0. May show up ingame if there are bugs. public static final int SOMETHING = PLACEHOLDERS+0; @@ -672,11 +679,145 @@ public class ItemSpriteSheet { //16 free slots + //for smaller 8x8 icons that often accompany an item sprite + public static class Icons { + + private static final int WIDTH = 16; + public static final int SIZE = 8; + + public static TextureFilm film = new TextureFilm( Assets.Sprites.ITEM_ICONS, SIZE, SIZE ); + + private static int xy(int x, int y){ + x -= 1; y -= 1; + return x + WIDTH*y; + } + + private static void assignIconRect( int item, int width, int height ){ + int x = (item % WIDTH) * SIZE; + int y = (item / WIDTH) * SIZE; + film.add( item, x, y, x+width, y+height); + } + + private static final int RINGS = xy(1, 1); //16 slots + + //16 free slots + + private static final int SCROLLS = xy(1, 3); //16 slots + public static final int SCROLL_UPGRADE = SCROLLS+0; + public static final int SCROLL_IDENTIFY = SCROLLS+1; + public static final int SCROLL_REMCURSE = SCROLLS+2; + public static final int SCROLL_MIRRORIMG= SCROLLS+3; + public static final int SCROLL_RECHARGE = SCROLLS+4; + public static final int SCROLL_TELEPORT = SCROLLS+5; + public static final int SCROLL_LULLABY = SCROLLS+6; + public static final int SCROLL_MAGICMAP = SCROLLS+7; + public static final int SCROLL_RAGE = SCROLLS+8; + public static final int SCROLL_RETRIB = SCROLLS+9; + public static final int SCROLL_TERROR = SCROLLS+10; + public static final int SCROLL_TRANSMUTE= SCROLLS+11; + static { + assignIconRect( SCROLL_UPGRADE, 7, 7 ); + assignIconRect( SCROLL_IDENTIFY, 4, 7 ); + assignIconRect( SCROLL_REMCURSE, 7, 7 ); + assignIconRect( SCROLL_MIRRORIMG, 7, 5 ); + assignIconRect( SCROLL_RECHARGE, 7, 5 ); + assignIconRect( SCROLL_TELEPORT, 7, 7 ); + assignIconRect( SCROLL_LULLABY, 4, 5 ); + assignIconRect( SCROLL_MAGICMAP, 7, 7 ); + assignIconRect( SCROLL_RAGE, 5, 5 ); + assignIconRect( SCROLL_RETRIB, 5, 6 ); + assignIconRect( SCROLL_TERROR, 5, 7 ); + assignIconRect( SCROLL_TRANSMUTE, 7, 7 ); + } + + private static final int EXOTIC_SCROLLS = xy(1, 4); //16 slots + public static final int SCROLL_ENCHANT = EXOTIC_SCROLLS+0; + public static final int SCROLL_DIVINATE = EXOTIC_SCROLLS+1; + public static final int SCROLL_ANTIMAGIC= EXOTIC_SCROLLS+2; + public static final int SCROLL_PRISIMG = EXOTIC_SCROLLS+3; + public static final int SCROLL_MYSTENRG = EXOTIC_SCROLLS+4; + public static final int SCROLL_PASSAGE = EXOTIC_SCROLLS+5; + public static final int SCROLL_AFFECTION= EXOTIC_SCROLLS+6; + public static final int SCROLL_FORESIGHT= EXOTIC_SCROLLS+7; + public static final int SCROLL_CONFUSION= EXOTIC_SCROLLS+8; + public static final int SCROLL_PSIBLAST = EXOTIC_SCROLLS+9; + public static final int SCROLL_PETRIF = EXOTIC_SCROLLS+10; + public static final int SCROLL_POLYMORPH= EXOTIC_SCROLLS+11; + static { + assignIconRect( SCROLL_ENCHANT, 7, 7 ); + assignIconRect( SCROLL_DIVINATE, 7, 7 ); + assignIconRect( SCROLL_ANTIMAGIC, 7, 7 ); + assignIconRect( SCROLL_PRISIMG, 5, 7 ); + assignIconRect( SCROLL_MYSTENRG, 7, 5 ); + assignIconRect( SCROLL_PASSAGE, 5, 7 ); + assignIconRect( SCROLL_AFFECTION, 7, 6 ); + assignIconRect( SCROLL_FORESIGHT, 7, 5 ); + assignIconRect( SCROLL_CONFUSION, 4, 7 ); + assignIconRect( SCROLL_PSIBLAST, 5, 6 ); + assignIconRect( SCROLL_PETRIF, 7, 5 ); + assignIconRect( SCROLL_POLYMORPH, 7, 6 ); + } + + //16 free slots + + private static final int POTIONS = xy(1, 6); //16 slots + public static final int POTION_STRENGTH = POTIONS+0; + public static final int POTION_HEALING = POTIONS+1; + public static final int POTION_MINDVIS = POTIONS+2; + public static final int POTION_FROST = POTIONS+3; + public static final int POTION_LIQFLAME = POTIONS+4; + public static final int POTION_TOXICGAS = POTIONS+5; + public static final int POTION_HASTE = POTIONS+6; + public static final int POTION_INVIS = POTIONS+7; + public static final int POTION_LEVITATE = POTIONS+8; + public static final int POTION_PARAGAS = POTIONS+9; + public static final int POTION_PURITY = POTIONS+10; + public static final int POTION_EXP = POTIONS+11; + static { + assignIconRect( POTION_STRENGTH, 7, 7 ); + assignIconRect( POTION_HEALING, 6, 7 ); + assignIconRect( POTION_MINDVIS, 7, 5 ); + assignIconRect( POTION_FROST, 5, 7 ); + assignIconRect( POTION_LIQFLAME, 5, 7 ); + assignIconRect( POTION_TOXICGAS, 7, 7 ); + assignIconRect( POTION_HASTE, 6, 6 ); + assignIconRect( POTION_INVIS, 5, 7 ); + assignIconRect( POTION_LEVITATE, 5, 5 ); + assignIconRect( POTION_PARAGAS, 7, 7 ); + assignIconRect( POTION_PURITY, 5, 5 ); + assignIconRect( POTION_EXP, 5, 5 ); + } + + 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_SHIELDING= EXOTIC_POTIONS+1; + public static final int POTION_MAGISIGHT= EXOTIC_POTIONS+2; + public static final int POTION_SNAPFREEZ= EXOTIC_POTIONS+3; + public static final int POTION_DRGBREATH= EXOTIC_POTIONS+4; + public static final int POTION_CORROGAS = EXOTIC_POTIONS+5; + public static final int POTION_STAMINA = EXOTIC_POTIONS+6; + public static final int POTION_SHROUDFOG= EXOTIC_POTIONS+7; + public static final int POTION_STRMCLOUD= EXOTIC_POTIONS+8; + public static final int POTION_EARTHARMR= EXOTIC_POTIONS+9; + public static final int POTION_CLEANSE = EXOTIC_POTIONS+10; + public static final int POTION_HOLYFUROR= EXOTIC_POTIONS+11; + static { + assignIconRect( POTION_ARENSURGE, 7, 7); + assignIconRect( POTION_SHIELDING, 6, 7); + assignIconRect( POTION_MAGISIGHT, 7, 5); + assignIconRect( POTION_SNAPFREEZ, 5, 7); + assignIconRect( POTION_DRGBREATH, 5, 7); + assignIconRect( POTION_CORROGAS, 7, 7); + assignIconRect( POTION_STAMINA, 6, 6); + assignIconRect( POTION_SHROUDFOG, 5, 7); + assignIconRect( POTION_STRMCLOUD, 5, 5); + assignIconRect( POTION_EARTHARMR, 7, 7); + assignIconRect( POTION_CLEANSE, 5, 5); + assignIconRect( POTION_HOLYFUROR, 5, 5); + } + + //16 free slots - private static void assignItemRect( int item, int width, int height){ - int x = (item % WIDTH) * WIDTH; - int y = (item / WIDTH) * WIDTH; - film.add( item, x, y, x+width, y+height); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java index c2030ef75..877a1cb70 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java @@ -25,14 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; -import com.shatteredpixel.shatteredpixeldungeon.items.keys.Key; -import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll; 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.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; @@ -52,20 +45,17 @@ public class ItemSlot extends Button { private static final float ENABLED = 1.0f; private static final float DISABLED = 0.3f; - protected ItemSprite icon; + protected ItemSprite sprite; protected Item item; - protected BitmapText topLeft; - protected BitmapText topRight; - protected BitmapText bottomRight; - protected Image bottomRightIcon; - protected boolean iconVisible = true; + protected BitmapText status; + protected BitmapText extra; + protected Image itemIcon; + protected BitmapText level; private static final String TXT_STRENGTH = ":%d"; private static final String TXT_TYPICAL_STR = "%d?"; - private static final String TXT_KEY_DEPTH = "\u007F%d"; private static final String TXT_LEVEL = "%+d"; - private static final String TXT_CURSED = "";//"-"; // Special "virtual items" public static final Item CHEST = new Item() { @@ -89,7 +79,7 @@ public class ItemSlot extends Button { public ItemSlot() { super(); - icon.visible(false); + sprite.visible(false); enable(false); } @@ -103,63 +93,64 @@ public class ItemSlot extends Button { super.createChildren(); - icon = new ItemSprite(); - add( icon ); + sprite = new ItemSprite(); + add(sprite); - topLeft = new BitmapText( PixelScene.pixelFont); - add( topLeft ); + status = new BitmapText( PixelScene.pixelFont); + add(status); - topRight = new BitmapText( PixelScene.pixelFont); - add( topRight ); + extra = new BitmapText( PixelScene.pixelFont); + add(extra); - bottomRight = new BitmapText( PixelScene.pixelFont); - add( bottomRight ); + level = new BitmapText( PixelScene.pixelFont); + add(level); } @Override protected void layout() { super.layout(); - icon.x = x + (width - icon.width) / 2f; - icon.y = y + (height - icon.height) / 2f; - PixelScene.align(icon); + sprite.x = x + (width - sprite.width) / 2f; + sprite.y = y + (height - sprite.height) / 2f; + PixelScene.align(sprite); - if (topLeft != null) { - topLeft.measure(); - if (topLeft.width > width){ - topLeft.scale.set(PixelScene.align(0.8f)); + if (status != null) { + status.measure(); + if (status.width > width){ + status.scale.set(PixelScene.align(0.8f)); } else { - topLeft.scale.set(1f); + status.scale.set(1f); } - topLeft.x = x; - topLeft.y = y; - PixelScene.align(topLeft); + status.x = x; + status.y = y; + PixelScene.align(status); } - if (topRight != null) { - topRight.x = x + (width - topRight.width()); - topRight.y = y; - PixelScene.align(topRight); - } - - if (bottomRight != null) { - bottomRight.x = x + (width - bottomRight.width()); - bottomRight.y = y + (height - bottomRight.height()); - PixelScene.align(bottomRight); + if (extra != null) { + extra.x = x + (width - extra.width()); + extra.y = y; + PixelScene.align(extra); } - if (bottomRightIcon != null) { - bottomRightIcon.x = x + (width - bottomRightIcon.width()) -1; - bottomRightIcon.y = y + (height - bottomRightIcon.height()); - PixelScene.align(bottomRightIcon); + if (itemIcon != null){ + itemIcon.x = x + width - (ItemSpriteSheet.Icons.SIZE + itemIcon.width())/2f; + itemIcon.y = y + (ItemSpriteSheet.Icons.SIZE - itemIcon.height)/2f; + PixelScene.align(itemIcon); } + + if (level != null) { + level.x = x + (width - level.width()); + level.y = y + (height - level.baseLine() - 1); + PixelScene.align(level); + } + } public void item( Item item ) { if (this.item == item) { if (item != null) { - icon.frame(item.image()); - icon.glow(item.glowing()); + sprite.frame(item.image()); + sprite.glow(item.glowing()); } updateText(); return; @@ -170,112 +161,79 @@ public class ItemSlot extends Button { if (item == null) { enable(false); - icon.visible(false); + sprite.visible(false); updateText(); } else { enable(true); - icon.visible(true); + sprite.visible(true); - icon.view( item ); + sprite.view( item ); updateText(); } } private void updateText(){ - if (bottomRightIcon != null){ - remove(bottomRightIcon); - bottomRightIcon = null; + if (itemIcon != null){ + remove(itemIcon); + itemIcon = null; } if (item == null){ - topLeft.visible = topRight.visible = bottomRight.visible = false; + status.visible = extra.visible = level.visible = false; return; } else { - topLeft.visible = topRight.visible = bottomRight.visible = true; + status.visible = extra.visible = level.visible = true; } - topLeft.text( item.status() ); + status.text( item.status() ); - boolean isArmor = item instanceof Armor; - boolean isWeapon = item instanceof Weapon; - if (isArmor || isWeapon) { + if (item.icon != -1 && item.isIdentified()){ + extra.text( null ); - if (item.levelKnown || (isWeapon && !(item instanceof MeleeWeapon))) { + itemIcon = new Image(Assets.Sprites.ITEM_ICONS); + itemIcon.frame(ItemSpriteSheet.Icons.film.get(item.icon)); + add(itemIcon); - int str = isArmor ? ((Armor)item).STRReq() : ((Weapon)item).STRReq(); - topRight.text( Messages.format( TXT_STRENGTH, str ) ); + } else if (item instanceof Weapon || item instanceof Armor) { + + if (item.levelKnown){ + int str = item instanceof Weapon ? ((Weapon)item).STRReq() : ((Armor)item).STRReq(); + extra.text( Messages.format( TXT_STRENGTH, str ) ); if (str > Dungeon.hero.STR()) { - topRight.hardlight( DEGRADED ); + extra.hardlight( DEGRADED ); } else { - topRight.resetColor(); + extra.resetColor(); } - } else { - - topRight.text( Messages.format( TXT_TYPICAL_STR, isArmor ? - ((Armor)item).STRReq(0) : - ((Weapon)item).STRReq(0) ) ); - topRight.hardlight( WARNING ); - + int str = item instanceof Weapon ? ((Weapon)item).STRReq(0) : ((Armor)item).STRReq(0); + extra.text( Messages.format( TXT_TYPICAL_STR, str ) ); + extra.hardlight( WARNING ); } - topRight.measure(); + extra.measure(); - } else if (item instanceof Key && !(item instanceof SkeletonKey)) { - topRight.text(Messages.format(TXT_KEY_DEPTH, ((Key) item).depth)); - topRight.measure(); } else { - topRight.text( null ); + extra.text( null ); } - int level = item.visiblyUpgraded(); + int trueLvl = item.visiblyUpgraded(); int buffedLvl = item.buffedVisiblyUpgraded(); - if (buffedLvl != 0) { - bottomRight.text( Messages.format( TXT_LEVEL, buffedLvl ) ); - bottomRight.measure(); - if (level == buffedLvl || buffedLvl <= 0) { - bottomRight.hardlight(buffedLvl > 0 ? UPGRADED : DEGRADED); + if (trueLvl != 0 && buffedLvl != 0) { + level.text( Messages.format( TXT_LEVEL, buffedLvl ) ); + level.measure(); + if (trueLvl == buffedLvl || buffedLvl <= 0) { + level.hardlight(buffedLvl > 0 ? UPGRADED : DEGRADED); } else { - bottomRight.hardlight(buffedLvl > level ? ENHANCED : WARNING); + level.hardlight(buffedLvl > trueLvl ? ENHANCED : WARNING); } - } else if (item instanceof Scroll || item instanceof Potion) { - bottomRight.text( null ); - - Integer iconInt; - if (item instanceof Scroll){ - iconInt = ((Scroll) item).initials(); - } else { - iconInt = ((Potion) item).initials(); - } - if (iconInt != null && iconVisible) { - bottomRightIcon = new Image(Assets.Interfaces.CONS_ICONS); - int left = iconInt*7; - int top; - if (item instanceof Potion){ - if (item instanceof ExoticPotion){ - top = 8; - } else { - top = 0; - } - } else { - if (item instanceof ExoticScroll){ - top = 24; - } else { - top = 16; - } - } - bottomRightIcon.frame(left, top, 7, 8); - add(bottomRightIcon); - } - } else { - bottomRight.text( null ); + level.text( null ); } layout(); @@ -286,22 +244,20 @@ public class ItemSlot extends Button { active = value; float alpha = value ? ENABLED : DISABLED; - icon.alpha( alpha ); - topLeft.alpha( alpha ); - topRight.alpha( alpha ); - bottomRight.alpha( alpha ); - if (bottomRightIcon != null) bottomRightIcon.alpha( alpha ); + sprite.alpha( alpha ); + status.alpha( alpha ); + extra.alpha( alpha ); + level.alpha( alpha ); + if (itemIcon != null) itemIcon.alpha( alpha ); } - public void showParams( boolean TL, boolean TR, boolean BR ) { - if (TL) add( topLeft ); - else remove( topLeft ); + public void showExtraInfo( boolean show ){ - if (TR) add( topRight ); - else remove( topRight ); + if (show){ + add(extra); + } else { + remove(extra); + } - if (BR) add( bottomRight ); - else remove( bottomRight ); - iconVisible = BR; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/LootIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/LootIndicator.java index 10ddfc2e8..01989dc59 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/LootIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/LootIndicator.java @@ -45,7 +45,7 @@ public class LootIndicator extends Tag { @Override protected void createChildren() { super.createChildren(); - + slot = new ItemSlot() { protected void onClick() { if (Dungeon.hero.handle(Dungeon.hero.pos)){ @@ -59,7 +59,7 @@ public class LootIndicator extends Tag { return SPDAction.TAG_LOOT; } }; - slot.showParams( true, false, false ); + slot.showExtraInfo( false ); add( slot ); } @@ -67,7 +67,7 @@ public class LootIndicator extends Tag { protected void layout() { super.layout(); - slot.setRect( x + 2, y + 3, width - 2, height - 6 ); + slot.setRect( x + 2, y + 3, width - 3, height - 6 ); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickRecipe.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickRecipe.java index 7a74bdca4..8e0bedf62 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickRecipe.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickRecipe.java @@ -114,10 +114,10 @@ public class QuickRecipe extends Component { } if (quantity < in.quantity()) { - curr.icon.alpha(0.3f); + curr.sprite.alpha(0.3f); hasInputs = false; } - curr.showParams(true, false, true); + curr.showExtraInfo(false); add(curr); this.inputs.add(curr); } @@ -147,9 +147,9 @@ public class QuickRecipe extends Component { } }; if (!hasInputs){ - this.output.icon.alpha(0.3f); + this.output.sprite.alpha(0.3f); } - this.output.showParams(true, false, true); + this.output.showExtraInfo(false); add(this.output); layout(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java index 94299a62e..e80c12ae0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java @@ -105,14 +105,14 @@ public class QuickSlotButton extends Button implements WndBag.Listener { } @Override protected void onPointerDown() { - icon.lightness( 0.7f ); + sprite.lightness( 0.7f ); } @Override protected void onPointerUp() { - icon.resetColor(); + sprite.resetColor(); } }; - slot.showParams( true, false, true ); + slot.showExtraInfo( false ); add( slot ); crossB = Icons.TARGET.get(); @@ -212,7 +212,7 @@ public class QuickSlotButton extends Button implements WndBag.Listener { sprite.parent.addToFront( crossM ); crossM.point(sprite.center(crossM)); - crossB.point(slot.icon.center(crossB)); + crossB.point(slot.sprite.center(crossB)); crossB.visible = true; } else {