v0.9.3: fixed wand of regrowth and fireblast using more than 3 charges in some cases
This commit is contained in:
parent
6530f0401a
commit
b2ee5f5ac1
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user