diff --git a/core/src/main/assets/items.png b/core/src/main/assets/items.png index 44cc1786e..44015b8c3 100644 Binary files a/core/src/main/assets/items.png and b/core/src/main/assets/items.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java index 7628805f0..c93d73f35 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java @@ -40,6 +40,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.watabou.utils.Bundle; import com.watabou.utils.Random; +import java.util.ArrayList; import java.util.Iterator; public class Belongings implements Iterable { @@ -152,7 +153,7 @@ public class Belongings implements Iterable { public Item getSimilar( Item similar ){ for (Item item : this) { - if (item.isSimilar(similar)) { + if (similar.isSimilar(item)) { return item; } } @@ -160,6 +161,18 @@ public class Belongings implements Iterable { return null; } + public ArrayList getAllSimilar( Item similar ){ + ArrayList result = new ArrayList<>(); + + for (Item item : this) { + if (similar.isSimilar(item)) { + result.add(item); + } + } + + return result; + } + public void identify() { for (Item item : this) { item.identify(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java index e24400294..51957b4dd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java @@ -79,7 +79,7 @@ public class Bomb extends Item { @Override public boolean isSimilar(Item item) { - return item.getClass() == getClass() && this.fuse == ((Bomb) item).fuse; + return super.isSimilar(item) && this.fuse == ((Bomb) item).fuse; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/Blandfruit.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/Blandfruit.java index 96d8ef5e7..e0d16ce78 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/Blandfruit.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/Blandfruit.java @@ -69,12 +69,12 @@ public class Blandfruit extends Food { @Override public boolean isSimilar( Item item ) { - if (item instanceof Blandfruit){ - if (potionAttrib == null){ - if (((Blandfruit)item).potionAttrib == null) + if ( super.isSimilar(item) ){ + Blandfruit other = (Blandfruit) item; + if (potionAttrib == null && other.potionAttrib == null) { return true; - } else if (((Blandfruit)item).potionAttrib != null){ - if (((Blandfruit)item).potionAttrib.getClass() == potionAttrib.getClass()) + } else if (potionAttrib != null && other.potionAttrib != null + && potionAttrib.isSimilar(other.potionAttrib)){ return true; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/MysteryMeat.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/MysteryMeat.java index b4e6b6e2b..25404c103 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/MysteryMeat.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/MysteryMeat.java @@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Slow; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -71,4 +72,22 @@ public class MysteryMeat extends Food { break; } } + + public static class PlaceHolder extends MysteryMeat { + + { + image = ItemSpriteSheet.MEAT_HOLDER; + } + + @Override + public boolean isSimilar(Item item) { + return item instanceof MysteryMeat || item instanceof StewedMeat + || item instanceof ChargrilledMeat || item instanceof FrozenCarpaccio; + } + + @Override + public String info() { + return ""; + } + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java index 2200cce73..d66a447d2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java @@ -43,7 +43,7 @@ public abstract class Key extends Item { @Override public boolean isSimilar( Item item ) { - return item.getClass() == getClass() && ((Key)item).depth == depth; + return super.isSimilar(item) && ((Key)item).depth == depth; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/Runestone.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/Runestone.java index 55f4c9a4d..6a47d8354 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/Runestone.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/Runestone.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.stones; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public abstract class Runestone extends Item { @@ -56,4 +57,26 @@ public abstract class Runestone extends Item { public int price() { return 10 * quantity; } + + public static class PlaceHolder extends Runestone { + + { + image = ItemSpriteSheet.STONE_HOLDER; + } + + @Override + protected void activate(int cell) { + //does nothing + } + + @Override + public boolean isSimilar(Item item) { + return item instanceof Runestone; + } + + @Override + public String info() { + return ""; + } + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java index 2c0e6bdb0..b3184f984 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java @@ -40,6 +40,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundlable; import com.watabou.utils.Bundle; @@ -205,5 +206,22 @@ public abstract class Plant implements Bundlable { public String info() { return Messages.get( Seed.class, "info", desc() ); } + + public static class PlaceHolder extends Seed { + + { + image = ItemSpriteSheet.SEED_HOLDER; + } + + @Override + public boolean isSimilar(Item item) { + return item instanceof Plant.Seed; + } + + @Override + public String info() { + return ""; + } + } } } 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 548334d84..6936d3b9c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -45,7 +45,10 @@ public class ItemSpriteSheet { public static final int ARTIFACT_HOLDER = PLACEHOLDERS+5; public static final int POTION_HOLDER = PLACEHOLDERS+6; public static final int SCROLL_HOLDER = PLACEHOLDERS+7; - public static final int SOMETHING = PLACEHOLDERS+8; + public static final int SEED_HOLDER = PLACEHOLDERS+8; + public static final int STONE_HOLDER = PLACEHOLDERS+9; + public static final int MEAT_HOLDER = PLACEHOLDERS+10; + public static final int SOMETHING = PLACEHOLDERS+11; static{ assignItemRect(NULLWARN, 16, 7); assignItemRect(WEAPON_HOLDER, 14, 14); @@ -53,8 +56,11 @@ public class ItemSpriteSheet { assignItemRect(WAND_HOLDER, 14, 14); assignItemRect(RING_HOLDER, 8, 10); assignItemRect(ARTIFACT_HOLDER, 15, 15); - assignItemRect(POTION_HOLDER, 10, 14); + assignItemRect(POTION_HOLDER, 12, 14); assignItemRect(SCROLL_HOLDER, 15, 14); + assignItemRect(SEED_HOLDER, 10, 10); + assignItemRect(STONE_HOLDER, 14, 12); + assignItemRect(MEAT_HOLDER, 15, 11); assignItemRect(SOMETHING, 8, 13); } diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index cdc9b675b..a2e2a9e8a 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -447,6 +447,7 @@ items.food.mysterymeat.legs=You can't feel your legs! items.food.mysterymeat.not_well=You are not feeling well. items.food.mysterymeat.stuffed=You are stuffed. items.food.mysterymeat.desc=Eat at your own risk! +items.food.mysterymeat$placeholder.name=meat items.food.pasty.pasty=pasty items.food.pasty.pie=pumpkin pie @@ -934,6 +935,7 @@ items.spells.featherfall.light=You feel light as a feather! items.spells.featherfall.desc=This spell manipulates gravity's effect on the caster, allowing them to fall great distances without harm for a short time. Each use of the spell will only provide enough protection for one chasm. items.spells.spell.ac_cast=CAST +items.spells.spell.no_magic=You can't cast spells while magic immune. items.spells.magicalinfusion.name=magical infusion items.spells.magicalinfusion.inv_title=Infuse an item @@ -943,7 +945,7 @@ items.spells.magicalinfusion.desc=This spell will infuse a weapon or armor with items.spells.magicalporter.name=magical porter items.spells.magicalporter.inv_title=Port an item items.spells.magicalporter.nowhere=There is nowhere for you to port an item to. -items.spells.magicalporter.desc=This spell will magical transport any item it is cast on. Unlike a merchant's beacon however, the items will be transported to the entrance of the next boss floor. +items.spells.magicalporter.desc=This spell will magically transport any item it is cast on. Unlike a merchant's beacon however, the items will be transported to the entrance of the next boss floor. items.spells.phaseshift.name=phase shift items.spells.phaseshift.tele_fail=The teleportation magic fails. @@ -965,6 +967,8 @@ items.spells.targetedspell.inv_title=Infuse an item ###runestones items.stones.inventorystone.ac_use=USE +items.stones.runestone$placeholder.name=runestone + items.stones.stoneofaggression.name=stone of aggression items.stones.stoneofaggression.desc=When this stone is thrown near an enemy, it will afflict them with aggression magic.\n\nAn enemy under the influence of aggression will be forced to attack you instead of any allies, if any allies are nearby. items.stones.stoneofaggression$aggression.name=Aggression diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/journal/journal.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/journal/journal.properties index 6fe3aa913..d05b190e3 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/journal/journal.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/journal/journal.properties @@ -48,7 +48,7 @@ journal.document.alchemy_guide.tele_spells.body=Combining certain ingredients in journal.document.alchemy_guide.item_spells.title=Item Manipulation Spells journal.document.alchemy_guide.item_spells.body=Item manipulation spells affect the items in your inventory in a variety of different ways.\n\n\nMagical infusion is created by mixing a scroll of upgrade with a stone of enchantment.\n\nCurse infusion is created by mixing a scroll of remove curse with a cursed metal shard.\n\nAlchemize is created by mixing a scroll of recharging with a potion of liquid flame.\n\nRecycle is created by mixing a scroll of transmutation with a scroll of mirror image. journal.document.alchemy_guide.enviro_spells.title=Environmental Spells -journal.document.alchemy_guide.enviro_spells.body=Environmental spells give you new ways to change or interact with the terrain of the dungeon.\n\n\nReclaim trap is created by mixing a scroll of recharging with a cursed metal shard.\n\nAqua blast is created by mixing a scroll of identify with a potion of storm clouds.\n\nFeatherfall is created by mixing a scroll of lullaby, a potion of levitation, and a good amount of alchemical energy. +journal.document.alchemy_guide.enviro_spells.body=Environmental spells give you new ways to change or interact with the terrain of the dungeon.\n\n\nReclaim trap is created by mixing a scroll of recharging with a cursed metal shard.\n\nAqua blast is created by mixing a scroll of identify with a potion of storm clouds.\n\nFeather fall is created by mixing a scroll of lullaby, a potion of levitation, and a good amount of alchemical energy. journal.notes$landmark.well_of_health=well of health journal.notes$landmark.well_of_awareness=well of awareness diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/plants/plants.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/plants/plants.properties index 91a2c5d8c..2933062ee 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/plants/plants.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/plants/plants.properties @@ -32,6 +32,7 @@ plants.icecap$seed.name=seed of icecap plants.plant$seed.seed_of=seed of %s plants.plant$seed.ac_plant=PLANT plants.plant$seed.info=Throw this seed to the place where you want to grow a plant.\n\n%s +plants.plant$seed$placeholder.name=seed plants.rotberry.name=Rotberry plants.rotberry.desc=The berries of a young rotberry shrub taste like sweet, sweet death.\n\nGiven several days, this rotberry shrub will grow into another rot heart.