From df56fa1a2511f59eaa4959d625a17760e8c276c8 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 25 Aug 2025 11:36:39 -0400 Subject: [PATCH] v3.2.2: fixed stone glyph occasionally resulting in dodges --- .../shatteredpixeldungeon/actors/hero/Hero.java | 6 ++++++ .../shatteredpixeldungeon/effects/FloatingText.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index ad7d851a1..aaacde2b9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -95,6 +95,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor; import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Stone; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.AlchemistsToolkit; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns; @@ -591,6 +592,11 @@ public class Hero extends Char { if (belongings.armor() != null) { evasion = belongings.armor().evasionFactor(this, evasion); + + //stone specifically overrides to 0 always, guaranteed hit + if (belongings.armor().hasGlyph(Stone.class, this) && !Stone.testingEvasion()){ + return 0; + } } return Math.max(1, Math.round(evasion)); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/FloatingText.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/FloatingText.java index 74a1a0ff0..f2daedc2d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/FloatingText.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/FloatingText.java @@ -40,6 +40,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.PrismaticImage; import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Stone; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion; @@ -343,6 +344,11 @@ public class FloatingText extends RenderedTextBlock { if (defender instanceof ArmoredStatue) arm = ((ArmoredStatue)defender).armor(); if (defender instanceof DriedRose.GhostHero) arm = ((DriedRose.GhostHero)defender).armor(); + //one last check + if (defRoll == 0 && arm != null && arm.hasGlyph(Stone.class, defender)){ + return HIT_ARM; + } + //accuracy boosts (always > 1) if (wep != null && wep.accuracyFactor(attacker, defender) > 1){ hitReasons.put( HIT_WEP, wep.accuracyFactor(attacker, defender));