From 30eb015a57fdb1e032404e6d8bcd10cbd320e895 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 28 Oct 2021 20:01:39 -0400 Subject: [PATCH] v1.1.0: fixed spirit bow having negative damage values in rare cases --- .../shatteredpixeldungeon/items/weapon/SpiritBow.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/SpiritBow.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/SpiritBow.java index 7afc4258a..73410a2ab 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/SpiritBow.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/SpiritBow.java @@ -184,16 +184,18 @@ public class SpiritBow extends Weapon { @Override public int min(int lvl) { - return 1 + Dungeon.hero.lvl/5 + int dmg = 1 + Dungeon.hero.lvl/5 + RingOfSharpshooting.levelDamageBonus(Dungeon.hero) + (curseInfusionBonus ? 1 : 0); + return Math.max(0, dmg); } @Override public int max(int lvl) { - return 6 + (int)(Dungeon.hero.lvl/2.5f) + int dmg = 6 + (int)(Dungeon.hero.lvl/2.5f) + 2*RingOfSharpshooting.levelDamageBonus(Dungeon.hero) + (curseInfusionBonus ? 2 : 0); + return Math.max(0, dmg); } @Override