diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java index 434eda000..556f3c197 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java @@ -43,6 +43,7 @@ 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.GameMath; import com.watabou.utils.PathFinder; import java.util.ArrayList; @@ -171,8 +172,8 @@ public class WandOfFireblast extends DamageWand { @Override protected int chargesPerCast() { - //consumes 30% of current charges, rounded up, with a minimum of one. - return Math.max(1, (int)Math.ceil(curCharges*0.3f)); + //consumes 30% of current charges, rounded up, with a min of 1 and a max of 3. + return (int) GameMath.gate(1, (int)Math.ceil(curCharges*0.3f), 3); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java index f74ad2476..c4ed1f962 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java @@ -49,6 +49,7 @@ import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; import com.watabou.utils.Callback; import com.watabou.utils.ColorMath; +import com.watabou.utils.GameMath; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; @@ -262,8 +263,8 @@ public class WandOfRegrowth extends Wand { @Override protected int chargesPerCast() { - //consumes 30% of current charges, rounded up, with a minimum of one. - return Math.max(1, (int)Math.ceil(curCharges*0.3f)); + //consumes 30% of current charges, rounded up, with a min of 1 and a max of 3. + return (int)GameMath.gate(1, (int)Math.ceil(curCharges*0.3f), 3); } @Override