From a06edcca4d8d08f53cac8f552ae6c998d502e947 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 3 Jun 2020 15:42:54 -0400 Subject: [PATCH] v0.8.1: fixed stone not clamping negative accuracy or evasion --- .../shatteredpixeldungeon/items/armor/glyphs/Stone.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java index 6ceec1356..618e14315 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; +import com.watabou.utils.GameMath; public class Stone extends Armor.Glyph { @@ -45,7 +46,8 @@ public class Stone extends Armor.Glyph { } //75% of dodge chance is applied as damage reduction - hitChance = (1f + 3f*hitChance)/4f; + // we clamp in case accuracy or evasion were negative + hitChance = GameMath.gate(0.25f, (1f + 3f*hitChance)/4f, 1f); damage = (int)Math.ceil(damage * hitChance);