diff --git a/core/src/main/assets/items.png b/core/src/main/assets/items.png index 6fa0cb8cb..f740fe2e9 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/ShatteredPixelDungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index 7d59a8692..dc6fc1bf5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -132,6 +132,10 @@ public class ShatteredPixelDungeon extends Game { com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfAugmentation.class, "com.shatteredpixel.shatteredpixeldungeon.items.Weightstone" ); + //v0.7.0 + com.watabou.utils.Bundle.addAlias( + com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb.class, + "com.shatteredpixel.shatteredpixeldungeon.items.Bomb" ); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java index 79fdaa2de..51db7268f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java @@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; +import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat; import com.shatteredpixel.shatteredpixeldungeon.items.food.FrozenCarpaccio; import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/ItemStatusHandler.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/ItemStatusHandler.java index 412ea92ad..33666152e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/ItemStatusHandler.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/ItemStatusHandler.java @@ -145,18 +145,39 @@ public class ItemStatusHandler { return false; } + public boolean contains( Class itemCls ){ + for (Class i : items){ + if (itemCls.equals(i)){ + return true; + } + } + return false; + } + public int image( T item ) { return labelImages.get(label(item)); } + public int image( Class itemCls ) { + return labelImages.get(label(itemCls)); + } + public String label( T item ) { return itemLabels.get(item.getClass()); } + public String label( Class itemCls ){ + return itemLabels.get( itemCls ); + } + public boolean isKnown( T item ) { return known.contains( item.getClass() ); } + public boolean isKnown( Class itemCls ){ + return known.contains( itemCls ); + } + public void know( T item ) { known.add( (Class)item.getClass() ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Recipe.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Recipe.java index e68f04ea8..5ca386d33 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Recipe.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Recipe.java @@ -22,9 +22,12 @@ package com.shatteredpixel.shatteredpixeldungeon.items; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; +import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit; 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.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.TippedDart; @@ -123,7 +126,10 @@ public abstract class Recipe { }; private static Recipe[] threeIngredientRecipes = new Recipe[]{ - new Potion.SeedToPotion() + new Potion.SeedToPotion(), + new ExoticPotion.PotionToExotic(), + new ExoticScroll.ScrollToExotic(), + new Bomb.EnhanceBomb() }; public static Recipe findRecipe(ArrayList ingredients){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java similarity index 75% rename from core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java rename to core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java index 8d1e8f2e4..125388680 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java @@ -19,17 +19,24 @@ * along with this program. If not, see */ -package com.shatteredpixel.shatteredpixeldungeon.items; +package com.shatteredpixel.shatteredpixeldungeon.items.bombs; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle; +import com.shatteredpixel.shatteredpixeldungeon.items.Heap; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.Recipe; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; +import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; @@ -41,6 +48,7 @@ import com.watabou.utils.PathFinder; import com.watabou.utils.Random; import java.util.ArrayList; +import java.util.HashMap; public class Bomb extends Item { @@ -62,7 +70,7 @@ public class Bomb extends Item { @Override public boolean isSimilar(Item item) { - return item instanceof Bomb && this.fuse == ((Bomb) item).fuse; + return item.getClass() == getClass() && this.fuse == ((Bomb) item).fuse; } @Override @@ -277,4 +285,68 @@ public class Bomb extends Item { return false; } } + + public static class EnhanceBomb extends Recipe { + + private static final HashMap, Class> validIngredients = new HashMap<>(); + static { + validIngredients.put(PotionOfHealing.class, HealingBomb.class); + } + + @Override + public boolean testIngredients(ArrayList ingredients) { + boolean seedOrStone = false; + boolean bomb = false; + boolean ingredient = false; + + for (Item i : ingredients){ + if (i instanceof Plant.Seed || i instanceof Runestone){ + seedOrStone = true; + } else if (i.getClass().equals(Bomb.class)){ + bomb = true; + } else if (validIngredients.containsKey(i.getClass())){ + ingredient = true; + } + } + + return seedOrStone && bomb && ingredient; + } + + @Override + public int cost(ArrayList ingredients) { + return 0; + } + + @Override + public Item brew(ArrayList ingredients) { + Item result = null; + + for (Item i : ingredients){ + i.quantity(i.quantity()-1); + if (validIngredients.containsKey(i.getClass())){ + try { + result = validIngredients.get(i.getClass()).newInstance(); + } catch (Exception e) { + ShatteredPixelDungeon.reportException(e); + } + } + } + + return result; + } + + @Override + public Item sampleOutput(ArrayList ingredients) { + for (Item i : ingredients){ + if (validIngredients.containsKey(i.getClass())){ + try { + return validIngredients.get(i.getClass()).newInstance(); + } catch (Exception e) { + ShatteredPixelDungeon.reportException(e); + } + } + } + return null; + } + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/HealingBomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/HealingBomb.java new file mode 100644 index 000000000..996730e29 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/HealingBomb.java @@ -0,0 +1,32 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2018 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.items.bombs; + +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; + +public class HealingBomb extends Bomb { + + { + image = ItemSpriteSheet.HEAL_BOMB; + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java index 9b73e7e74..91b1d397b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java @@ -127,7 +127,7 @@ public class Potion extends Item { canThrowPots.add(PotionOfLevitation.class); } - private static ItemStatusHandler handler; + protected static ItemStatusHandler handler; private String color; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java new file mode 100644 index 000000000..12aef8069 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/ExoticPotion.java @@ -0,0 +1,115 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2018 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic; + +import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.Recipe; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; +import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; + +import java.util.ArrayList; +import java.util.HashMap; + +public class ExoticPotion extends Potion { + + { + //sprite = equivalent potion sprite but one row down + } + + public static final HashMap, Class> regToExo = new HashMap<>(); + public static final HashMap, Class> exoToReg = new HashMap<>(); + static{ + regToExo.put(PotionOfHealing.class, PotionOfSheilding.class); + exoToReg.put(PotionOfSheilding.class, PotionOfHealing.class); + } + + @Override + public boolean isKnown() { + //assume it is IDed as ided potions are needed for alchemy + return true; + } + + @Override + public void reset() { + if (handler != null && handler.contains(exoToReg.get(this.getClass()))) { + image = handler.image(exoToReg.get(this.getClass())) + 16; + } + } + + public static class PotionToExotic extends Recipe{ + + @Override + public boolean testIngredients(ArrayList ingredients) { + int s = 0; + Potion p = null; + + for (Item i : ingredients){ + if (i instanceof Plant.Seed){ + s++; + } else if (regToExo.containsKey(i.getClass())) { + p = (Potion)i; + } + } + + return p != null && s == 2; + } + + @Override + public int cost(ArrayList ingredients) { + return 0; + } + + @Override + public Item brew(ArrayList ingredients) { + Item result = null; + + for (Item i : ingredients){ + i.quantity(i.quantity()-1); + if (regToExo.containsKey(i.getClass())) { + try { + result = regToExo.get(i.getClass()).newInstance(); + } catch (Exception e) { + ShatteredPixelDungeon.reportException(e); + } + } + } + return result; + } + + @Override + public Item sampleOutput(ArrayList ingredients) { + for (Item i : ingredients){ + if (regToExo.containsKey(i.getClass())) { + try { + return regToExo.get(i.getClass()).newInstance(); + } catch (Exception e) { + ShatteredPixelDungeon.reportException(e); + } + } + } + return null; + + } + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfSheilding.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfSheilding.java new file mode 100644 index 000000000..626956943 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfSheilding.java @@ -0,0 +1,25 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2018 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic; + +public class PotionOfSheilding extends ExoticPotion { +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java index c5bc78274..7494f6b8f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java @@ -22,11 +22,11 @@ package com.shatteredpixel.shatteredpixeldungeon.items.rings; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; -import com.shatteredpixel.shatteredpixeldungeon.items.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; import com.watabou.utils.Random; import java.util.ArrayList; 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 87d0e0663..bd8363663 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 @@ -93,7 +93,7 @@ public abstract class Scroll extends Item { } }; - private static ItemStatusHandler handler; + protected static ItemStatusHandler handler; private String rune; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ExoticScroll.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ExoticScroll.java new file mode 100644 index 000000000..ca41b2fd4 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ExoticScroll.java @@ -0,0 +1,117 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2018 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic; + +import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.Recipe; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify; +import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone; + +import java.util.ArrayList; +import java.util.HashMap; + +public abstract class ExoticScroll extends Scroll { + + + public static final HashMap, Class> regToExo = new HashMap<>(); + public static final HashMap, Class> exoToReg = new HashMap<>(); + static{ + regToExo.put(ScrollOfIdentify.class, ScrollOfForesight.class); + exoToReg.put(ScrollOfForesight.class, ScrollOfIdentify.class); + } + + @Override + public boolean isKnown() { + //assume it is IDed as ided scrolls are needed for alchemy + return true; + } + + @Override + public void reset() { + if (handler != null && handler.contains(exoToReg.get(this.getClass()))) { + image = handler.image(exoToReg.get(this.getClass())) + 16; + } + } + + @Override + public void empoweredRead() { + + } + + public static class ScrollToExotic extends Recipe { + + @Override + public boolean testIngredients(ArrayList ingredients) { + int r = 0; + Scroll s = null; + + for (Item i : ingredients){ + if (i instanceof Runestone){ + r++; + } else if (regToExo.containsKey(i.getClass())) { + s = (Scroll)i; + } + } + + return s != null && r == 2; + } + + @Override + public int cost(ArrayList ingredients) { + return 0; + } + + @Override + public Item brew(ArrayList ingredients) { + Item result = null; + + for (Item i : ingredients){ + i.quantity(i.quantity()-1); + if (regToExo.containsKey(i.getClass())) { + try { + result = regToExo.get(i.getClass()).newInstance(); + } catch (Exception e) { + ShatteredPixelDungeon.reportException(e); + } + } + } + return result; + } + + @Override + public Item sampleOutput(ArrayList ingredients) { + for (Item i : ingredients){ + if (regToExo.containsKey(i.getClass())) { + try { + return regToExo.get(i.getClass()).newInstance(); + } catch (Exception e) { + ShatteredPixelDungeon.reportException(e); + } + } + } + return null; + + } + } +} 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 new file mode 100644 index 000000000..862dea172 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfForesight.java @@ -0,0 +1,29 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2018 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic; + +public class ScrollOfForesight extends ExoticScroll { + @Override + public void doRead() { + + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfBlast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfBlast.java index cb220675d..906f71911 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfBlast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfBlast.java @@ -21,7 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.stones; -import com.shatteredpixel.shatteredpixeldungeon.items.Bomb; +import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class StoneOfBlast extends Runestone { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java index 0dfa6ad27..b4bc5b2dd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java @@ -46,10 +46,10 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; -import com.shatteredpixel.shatteredpixeldungeon.items.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; +import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretArtilleryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretArtilleryRoom.java index 9cd81d8bc..4145d4e63 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretArtilleryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretArtilleryRoom.java @@ -21,8 +21,8 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret; -import com.shatteredpixel.shatteredpixeldungeon.items.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; +import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretHoneypotRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretHoneypotRoom.java index 4c8a1828a..4d5aed046 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretHoneypotRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretHoneypotRoom.java @@ -23,9 +23,9 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bee; -import com.shatteredpixel.shatteredpixeldungeon.items.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ArmoryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ArmoryRoom.java index cc5ba4d09..33e4be5eb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ArmoryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ArmoryRoom.java @@ -22,9 +22,9 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.items.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java index 18d608bdc..1208523b9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java @@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Shopkeeper; import com.shatteredpixel.shatteredpixeldungeon.items.Ankh; -import com.shatteredpixel.shatteredpixeldungeon.items.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot; @@ -44,6 +43,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster; import com.shatteredpixel.shatteredpixeldungeon.items.bags.PotionBandolier; import com.shatteredpixel.shatteredpixeldungeon.items.bags.ScrollHolder; import com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch; +import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.food.SmallRation; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/ExplosiveTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/ExplosiveTrap.java index 5e5d91d5d..3a3426a4c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/ExplosiveTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/ExplosiveTrap.java @@ -21,7 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.traps; -import com.shatteredpixel.shatteredpixeldungeon.items.Bomb; +import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; public class ExplosiveTrap extends Trap { 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 0f9cbc9be..48e4f44c6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -63,14 +63,13 @@ public class ItemSpriteSheet { public static final int DEWDROP = UNCOLLECTIBLE+1; public static final int PETAL = UNCOLLECTIBLE+2; public static final int SANDBAG = UNCOLLECTIBLE+3; - public static final int DBL_BOMB = UNCOLLECTIBLE+4; + public static final int GUIDE_PAGE = UNCOLLECTIBLE+5; static{ assignItemRect(GOLD, 15, 13); assignItemRect(DEWDROP, 10, 10); assignItemRect(PETAL, 8, 8); assignItemRect(SANDBAG, 10, 10); - assignItemRect(DBL_BOMB, 14, 13); assignItemRect(GUIDE_PAGE, 10, 11); } @@ -101,7 +100,7 @@ public class ItemSpriteSheet { public static final int SEAL = SINGLE_USE+3; public static final int TORCH = SINGLE_USE+4; public static final int BEACON = SINGLE_USE+5; - public static final int BOMB = SINGLE_USE+6; + public static final int HONEYPOT = SINGLE_USE+7; public static final int SHATTPOT = SINGLE_USE+8; public static final int IRON_KEY = SINGLE_USE+9; @@ -118,7 +117,7 @@ public class ItemSpriteSheet { assignItemRect(SEAL, 9, 15); assignItemRect(TORCH, 12, 15); assignItemRect(BEACON, 16, 15); - assignItemRect(BOMB, 10, 13); + assignItemRect(HONEYPOT, 14, 12); assignItemRect(SHATTPOT, 14, 12); assignItemRect(IRON_KEY, 8, 14); @@ -129,8 +128,20 @@ public class ItemSpriteSheet { assignItemRect(KIT, 16, 15); assignItemRect(AMULET, 16, 16); } + + private static final int BOMBS = xy(1, 5); //16 slots + public static final int BOMB = BOMBS+0; + public static final int DBL_BOMB = BOMBS+1; + public static final int HEAL_BOMB = BOMBS+2; + + static{ + assignItemRect(BOMB, 10, 13); + assignItemRect(DBL_BOMB, 14, 13); + assignItemRect(HEAL_BOMB, 10, 13); + } - //32 free slots + + //16 free slots private static final int WEP_TIER1 = xy(1, 7); //8 slots public static final int WORN_SHORTSWORD = WEP_TIER1+0; @@ -378,9 +389,9 @@ public class ItemSpriteSheet { assignItemRect(ARTIFACT_ROSE3, 14, 14); } - //32 free slots + //16 free slots - private static final int SCROLLS = xy(1, 20); //16 slots + private static final int SCROLLS = xy(1, 19); //16 slots public static final int SCROLL_KAUNAN = SCROLLS+0; public static final int SCROLL_SOWILO = SCROLLS+1; public static final int SCROLL_LAGUZ = SCROLLS+2; @@ -398,6 +409,24 @@ public class ItemSpriteSheet { assignItemRect(i, 15, 14); } + private static final int EXOTIC_SCROLLS = xy(1, 20); //16 slots + public static final int EXOTIC_KAUNAN = EXOTIC_SCROLLS+0; + public static final int EXOTIC_SOWILO = EXOTIC_SCROLLS+1; + public static final int EXOTIC_LAGUZ = EXOTIC_SCROLLS+2; + public static final int EXOTIC_YNGVI = EXOTIC_SCROLLS+3; + public static final int EXOTIC_GYFU = EXOTIC_SCROLLS+4; + public static final int EXOTIC_RAIDO = EXOTIC_SCROLLS+5; + public static final int EXOTIC_ISAZ = EXOTIC_SCROLLS+6; + public static final int EXOTIC_MANNAZ = EXOTIC_SCROLLS+7; + public static final int EXOTIC_NAUDIZ = EXOTIC_SCROLLS+8; + public static final int EXOTIC_BERKANAN = EXOTIC_SCROLLS+9; + public static final int EXOTIC_ODAL = EXOTIC_SCROLLS+10; + public static final int EXOTIC_TIWAZ = EXOTIC_SCROLLS+11; + static { + for (int i = EXOTIC_SCROLLS; i < EXOTIC_SCROLLS+16; i++) + assignItemRect(i, 15, 14); + } + private static final int STONES = xy(1, 21); //16 slots public static final int STONE_KAUNAN = STONES+0; public static final int STONE_SOWILO = STONES+1; @@ -431,10 +460,28 @@ public class ItemSpriteSheet { public static final int POTION_IVORY = POTIONS+11; static { for (int i = POTIONS; i < POTIONS+16; i++) - assignItemRect(i, 10, 14); + assignItemRect(i, 12, 14); + } + + private static final int EXOTIC_POTIONS = xy(1, 23); //16 slots + public static final int EXOTIC_CRIMSON = EXOTIC_POTIONS+0; + public static final int EXOTIC_AMBER = EXOTIC_POTIONS+1; + public static final int EXOTIC_GOLDEN = EXOTIC_POTIONS+2; + public static final int EXOTIC_JADE = EXOTIC_POTIONS+3; + public static final int EXOTIC_TURQUOISE= EXOTIC_POTIONS+4; + public static final int EXOTIC_AZURE = EXOTIC_POTIONS+5; + public static final int EXOTIC_INDIGO = EXOTIC_POTIONS+6; + public static final int EXOTIC_MAGENTA = EXOTIC_POTIONS+7; + public static final int EXOTIC_BISTRE = EXOTIC_POTIONS+8; + public static final int EXOTIC_CHARCOAL = EXOTIC_POTIONS+9; + public static final int EXOTIC_SILVER = EXOTIC_POTIONS+10; + public static final int EXOTIC_IVORY = EXOTIC_POTIONS+11; + static { + for (int i = EXOTIC_POTIONS; i < EXOTIC_POTIONS+16; i++) + assignItemRect(i, 12, 13); } - private static final int SEEDS = xy(1, 23); //16 slots + private static final int SEEDS = xy(1, 24); //16 slots public static final int SEED_ROTBERRY = SEEDS+0; public static final int SEED_FIREBLOOM = SEEDS+1; public static final int SEED_SWIFTTHISTLE = SEEDS+2; @@ -452,8 +499,6 @@ public class ItemSpriteSheet { assignItemRect(i, 10, 10); } - //16 free slots - private static final int FOOD = xy(1, 25); //16 slots public static final int MEAT = FOOD+0; public static final int STEAK = FOOD+1; 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 577e4b7c0..f62875ed2 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 @@ -343,6 +343,19 @@ items.bags.magicalholster.desc=This slim holster is made from some exotic animal +###bombs +items.bombs.bomb.name=bomb +items.bombs.bomb.ac_lightthrow=LIGHT & THROW +items.bombs.bomb.snuff_fuse=You quickly snuff the bomb's fuse. +items.bombs.bomb.ondeath=Killed by an explosion +items.bombs.bomb.rankings_desc=Killed by an explosion +items.bombs.bomb.desc=A fairly hefty black powder bomb. An explosion from this would certainly do damage to anything nearby.\n\nIt looks like the fuse will take a couple rounds to burn down once it is lit. +items.bombs.bomb.desc_burning=A fairly hefty black powder bomb. An explosion from this would certainly do damage to anything nearby.\n\nThe bomb's fuse is burning away, keep your distance or put it out! +items.bombs.bomb$doublebomb.name=two bombs +items.bombs.bomb$doublebomb.desc=A stack of two hefty black powder bombs, looks like you get one free! + + + ###food items.food.blandfruit.name=blandfruit items.food.blandfruit.sunfruit=sunfruit @@ -1129,16 +1142,6 @@ items.armorkit.prompt=Select an armor items.armorkit.upgraded=You applied the armor kit to upgrade your %s items.armorkit.desc=Using this kit of small tools and materials anybody can transform any armor into an "epic armor", which will keep all properties of the original armor, but will also provide its wearer a special ability depending on his class. No skills in tailoring, leatherworking or blacksmithing are required. -items.bomb.name=bomb -items.bomb.ac_lightthrow=LIGHT & THROW -items.bomb.snuff_fuse=You quickly snuff the bomb's fuse. -items.bomb.ondeath=Killed by an explosion -items.bomb.rankings_desc=Killed by an explosion -items.bomb.desc=A fairly hefty black powder bomb. An explosion from this would certainly do damage to anything nearby.\n\nIt looks like the fuse will take a couple rounds to burn down once it is lit. -items.bomb.desc_burning=A fairly hefty black powder bomb. An explosion from this would certainly do damage to anything nearby.\n\nThe bomb's fuse is burning away, keep your distance or put it out! -items.bomb$doublebomb.name=two bombs -items.bomb$doublebomb.desc=A stack of two hefty black powder bombs, looks like you get one free! - items.brokenseal.name=broken seal items.brokenseal.ac_affix=AFFIX items.brokenseal.prompt=Select an armor