diff --git a/core/src/main/assets/items.png b/core/src/main/assets/items.png index 0d431364c..9dff9257b 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/items/Recipe.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Recipe.java index 63f312a68..58959eb44 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Recipe.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Recipe.java @@ -27,6 +27,9 @@ import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit; import com.shatteredpixel.shatteredpixeldungeon.items.food.Feast; import com.shatteredpixel.shatteredpixeldungeon.items.food.StewedMeat; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.FrigidBrew; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.FrostfireBrew; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.WickedBrew; import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfDragonsBlood; import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfEarthenPower; import com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfToxicEssence; @@ -142,6 +145,9 @@ public abstract class Recipe { new ElixirOfDragonsBlood.Recipe(), new ElixirOfEarthenPower.Recipe(), new ElixirOfToxicEssence.Recipe(), + new FrigidBrew.Recipe(), + new FrostfireBrew.Recipe(), + new WickedBrew.Recipe(), new StewedMeat.twoMeat() }; 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 352a25045..a65251263 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 @@ -132,6 +132,8 @@ public class Potion extends Item { mustThrowPots.add(PotionOfSnapFreeze.class); mustThrowPots.add(PotionOfShroudingFog.class); mustThrowPots.add(PotionOfStormClouds.class); + + //also all brews, hardcoded } private static final HashSet> canThrowPots = new HashSet<>(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/Brew.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/Brew.java new file mode 100644 index 000000000..96d4944da --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/Brew.java @@ -0,0 +1,59 @@ +/* + * 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.brews; + +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; +import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; + +import java.util.ArrayList; + +public abstract class Brew extends Potion { + + @Override + public ArrayList actions(Hero hero) { + ArrayList actions = super.actions( hero ); + actions.remove( AC_DRINK ); + return actions; + } + + @Override + public void setAction() { + defaultAction = AC_THROW; + } + + + @Override + public void doThrow(Hero hero) { + //identical to Item.doThrow + GameScene.selectCell( thrower ); + } + + @Override + public abstract void shatter( int cell ); + + @Override + public boolean isKnown() { + return true; + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/FrigidBrew.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/FrigidBrew.java new file mode 100644 index 000000000..2099ac03c --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/FrigidBrew.java @@ -0,0 +1,71 @@ +/* + * 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.brews; + +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; +import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Freezing; +import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StormCloud; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfFrost; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfStormClouds; +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 FrigidBrew extends Brew { + + { + image = ItemSpriteSheet.BREW_FRIGID; + } + + @Override + public void shatter(int cell) { + + if (Dungeon.level.heroFOV[cell]) { + splash( cell ); + Sample.INSTANCE.play( Assets.SND_SHATTER ); + } + + for (int offset : PathFinder.NEIGHBOURS9){ + if (!Dungeon.level.solid[cell+offset]) { + GameScene.add(Blob.seed(cell + offset, 10, Freezing.class)); + } + } + GameScene.add( Blob.seed( cell, 1000, StormCloud.class ) ); + } + + public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe { + + { + inputs = new Class[]{PotionOfFrost.class, PotionOfStormClouds.class}; + inQuantity = new int[]{1, 1}; + + cost = 2; + + output = FrigidBrew.class; + outQuantity = 1; + } + + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/FrostfireBrew.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/FrostfireBrew.java new file mode 100644 index 000000000..f81678c36 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/FrostfireBrew.java @@ -0,0 +1,85 @@ +/* + * 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.brews; + +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; +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.items.potions.PotionOfLiquidFlame; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfSnapFreeze; +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 FrostfireBrew extends Brew { + + { + image = ItemSpriteSheet.BREW_FROSTFIRE; + } + + @Override + public void shatter(int cell) { + if (Dungeon.level.heroFOV[cell]) { + setKnown(); + + splash( cell ); + Sample.INSTANCE.play( Assets.SND_SHATTER ); + } + + Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class ); + + for (int offset : PathFinder.NEIGHBOURS9){ + if (!Dungeon.level.solid[cell+offset]) { + + Freezing.affect( cell + offset, fire ); + + Char ch = Actor.findChar( cell + offset); + if (ch != null){ + Buff.affect(ch, Roots.class, 10f); + } + GameScene.add(Blob.seed(cell + offset, 10, Fire.class)); + + } + } + } + + public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe { + + { + inputs = new Class[]{PotionOfSnapFreeze.class, PotionOfLiquidFlame.class}; + inQuantity = new int[]{1, 1}; + + cost = 3; + + output = FrostfireBrew.class; + outQuantity = 1; + } + + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/WickedBrew.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/WickedBrew.java new file mode 100644 index 000000000..53e25f359 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/WickedBrew.java @@ -0,0 +1,64 @@ +/* + * 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.brews; + +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; +import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ParalyticGas; +import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfParalyticGas; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas; +import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.watabou.noosa.audio.Sample; + +public class WickedBrew extends Brew { + + { + image = ItemSpriteSheet.BREW_WICKED; + } + + @Override + public void shatter(int cell) { + if (Dungeon.level.heroFOV[cell]) { + splash( cell ); + Sample.INSTANCE.play( Assets.SND_SHATTER ); + } + GameScene.add( Blob.seed( cell, 1000, ToxicGas.class ) ); + GameScene.add( Blob.seed( cell, 1000, ParalyticGas.class ) ); + } + + public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe { + + { + inputs = new Class[]{PotionOfToxicGas.class, PotionOfParalyticGas.class}; + inQuantity = new int[]{1, 1}; + + cost = 1; + + output = WickedBrew.class; + outQuantity = 1; + } + + } +} 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 e92a0b7cf..940ab8b96 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -524,7 +524,18 @@ public class ItemSpriteSheet { assignItemRect(ELIXIR_TOXIC, 10, 14); assignItemRect(ELIXIR_EARTH, 10, 14); } - + + private static final int BREWS = xy(1, 26); //16 slots + public static final int BREW_WICKED = BREWS+0; + public static final int BREW_FRIGID = BREWS+1; + public static final int BREW_FROSTFIRE= BREWS+2; + static{ + assignItemRect(BREW_WICKED, 10, 14); + assignItemRect(BREW_FRIGID, 10, 14); + assignItemRect(BREW_FROSTFIRE, 10, 14); + } + //16 free slots + private static final int FOOD = xy(1, 28); //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 1fa2ac148..90dc0fe14 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 @@ -552,6 +552,18 @@ items.potions.potionoftoxicgas.desc=Uncorking or shattering this pressurized gla +###brews +items.potions.brews.frigidbrew.name=frigid brew +items.potions.brews.frigidbrew.desc=TODO + +items.potions.brews.frostfirebrew.name=frostfire brew +items.potions.brews.frostfirebrew.desc=TODO + +items.potions.brews.wickedbrew.name=wicked brew +items.potions.brews.wickedbrew.desc=TODO + + + ###elixirs items.potions.elixirs.elixirofdragonsblood.name=elixir of dragon's blood items.potions.elixirs.elixirofdragonsblood.desc=TODO