From a98f85f8b6368e71b3c1ca99bc1797ea22d4df40 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 18 Aug 2018 21:53:27 -0400 Subject: [PATCH] v0.7.0: implemented 3 brews --- core/src/main/assets/items.png | Bin 17037 -> 17173 bytes .../shatteredpixeldungeon/items/Recipe.java | 6 ++ .../items/potions/Potion.java | 2 + .../items/potions/brews/Brew.java | 59 ++++++++++++ .../items/potions/brews/FrigidBrew.java | 71 +++++++++++++++ .../items/potions/brews/FrostfireBrew.java | 85 ++++++++++++++++++ .../items/potions/brews/WickedBrew.java | 64 +++++++++++++ .../sprites/ItemSpriteSheet.java | 13 ++- .../messages/items/items.properties | 12 +++ 9 files changed, 311 insertions(+), 1 deletion(-) create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/Brew.java create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/FrigidBrew.java create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/FrostfireBrew.java create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/brews/WickedBrew.java diff --git a/core/src/main/assets/items.png b/core/src/main/assets/items.png index 0d431364c56b90dfc56caece167dde794ce9b8e2..9dff9257be5ff027afcc06cc2ac2e7a670a2722e 100644 GIT binary patch delta 5163 zcmZuzdpy(o|Nm@EOf`i1b}_>m_ja{ z3|%O8!6^xm<{q2KDb`~7^r->>)k^SZrX$w{!g*I}s^ zu+Qa|SPaOyZ4qudHRNp9r!}(0F7_yl~r6-4R)Uwt(p&DsGSZGXb%ciebGN*+bD?&iEchYY=Sb!Xmk%R{6 zP$C#5u6r=+yW4C0)DcLk7@}U1FSyl6SMa{wZg<+=Bb}BspuRDQu|BM^I?0LC9i$Zt zk90bP*o(Zgl`}rs&r>q0&$4?Nlcc%lc`yDd?--{Q%64o5Rh(a5}#4_PPz7B4>m0iWs+htTR({f zM44RKeOZw{$eB{Eusa=Y-r zH^|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O6hWhEA=m6v@2Ye`$bx7mpqW?3Z=h(Ak39vN0D>W_;0C9iC^C>6$|reb5Z>A^NnB1vSl}NYS2-iyNZ_F1N4K! zjzGj?vt(~MmW%-yN}iQIH*w(VaeaW{-L`-Be1sf8jriwvKmp9KeY7xjzrZvqd<}d+ zK@pK%cck_@#v9*94$qd5VcgkUhAAd30l9wnJgubf=hy%0ra40`13w&_TY+pBZp+Sp~C{3SG3(j3yiv%OZ*#Ta== zpSA&T=CSkTC|Z9os&9)9lG>W&Cl?@0kaf!q|2j zOkyJSi+J-jgMzD4D-+V4jLTZ=8}$@$=DDVB#E8;hxjQFP#Uh@-v^PX{fnBw#u!ktK zL&f4WR@RLQ=cZ5W-dHXF=kF@xWbOp2*)OAKsu8l+#u0n0Mqto}y|1pyO-K=N$O}C8?386J_>K?$b01WjGhuQ5}LA}Vg-Yp@0|xf4ULn5 zgG%G2Sy%U_3gu-g;Ml;v$sTuVC)Vbb8Z*WgKvRPpTHt_|jr6>b;Gi{1c&P15w^_$#Um8el?tmq=zAvE?*coo%u4%NSjP zeuPDVh4%^SB{_G_h>^l{?7^7P{2drWGYUY`#?`ZL=c*_+^6aqqx)xZCM8!A&=PVrt zzpeYdk(kKZ)#kISfsFYDbIV=K2{8N5x-sEAb*=1`3b$T>=3ZYcG> 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