From 6615624d847fc69dc31b8c366fb7bd6c18adde61 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 17 May 2025 14:11:50 -0400 Subject: [PATCH] v3.1.0: fixed seal transfer showing glyph xfer prompt without talent --- .../shatteredpixeldungeon/items/BrokenSeal.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java index 9b5cc1a40..c3e1d2747 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java @@ -127,6 +127,7 @@ public class BrokenSeal extends Item { GLog.w(Messages.get(BrokenSeal.class, "unknown_armor")); } else if (armor.glyph != null && getGlyph() != null + && canTransferGlyph() && armor.glyph.getClass() != getGlyph().getClass()) { //cannot apply the seal's non-curse glyph to a curse glyph armor @@ -327,8 +328,11 @@ public class BrokenSeal extends Item { if (Dungeon.hero.visibleEnemies() == 0){ turnsSinceEnemies++; if (turnsSinceEnemies >= 5){ - float percentLeft = shielding() / (float)maxShield(); - cooldown -= COOLDOWN_START*(percentLeft/2f); //max of 50% cooldown refund + if (cooldown > 0) { + float percentLeft = shielding() / (float)maxShield(); + //max of 50% cooldown refund + cooldown = Math.max(0, (int)(cooldown - COOLDOWN_START * (percentLeft / 2f))); + } decShield(shielding()); } } else { @@ -346,7 +350,7 @@ public class BrokenSeal extends Item { public synchronized void activate() { incShield(maxShield()); - cooldown += COOLDOWN_START; + cooldown = Math.max(0, cooldown+COOLDOWN_START); turnsSinceEnemies = 0; }