From cdaa1b8619959082b63725e5e6249c05006feee2 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 20 May 2025 13:12:58 -0400 Subject: [PATCH] v3.1.0: guiding light spell icon is now brightened when casting is free --- .../actors/hero/spells/GuidingLight.java | 7 +++++++ .../items/artifacts/HolyTome.java | 7 ++++++- .../windows/WndClericSpells.java | 13 +++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/GuidingLight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/GuidingLight.java index a76a5edf5..962a60913 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/GuidingLight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/GuidingLight.java @@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; +import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton; @@ -99,6 +100,7 @@ public class GuidingLight extends TargetedClericSpell { onSpellCast(tome, hero); if (hero.subClass == HeroSubClass.PRIEST && hero.buff(GuidingLightPriestCooldown.class) == null) { Buff.prolong(hero, GuidingLightPriestCooldown.class, 100f); + ActionIndicator.refresh(); } } @@ -137,6 +139,11 @@ public class GuidingLight extends TargetedClericSpell { public float iconFadePercent() { return Math.max(0, visualcooldown() / 100); } + @Override + public void detach() { + super.detach(); + ActionIndicator.refresh(); + } } public static class Illuminated extends Buff { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HolyTome.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HolyTome.java index c4f1a8782..71d9c4c42 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HolyTome.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HolyTome.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.ClericSpell; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.GuidingLight; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy; @@ -329,7 +330,11 @@ public class HolyTome extends Artifact { @Override public int indicatorColor() { - return 0x002157; + if (quickSpell == GuidingLight.INSTANCE && quickSpell.chargeUse(Dungeon.hero) == 0){ + return 0x0063ff; + } else { + return 0x002157; + } } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndClericSpells.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndClericSpells.java index a6a7281ae..f87d92173 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndClericSpells.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndClericSpells.java @@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.SPDSettings; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.ClericSpell; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.GuidingLight; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -145,17 +146,29 @@ public class WndClericSpells extends Window { if (!tome.canCast(Dungeon.hero, spell)){ icon.alpha( 0.3f ); + } else if (spell == GuidingLight.INSTANCE && spell.chargeUse(Dungeon.hero) == 0){ + icon.brightness(3); } bg = Chrome.get(Chrome.Type.TOAST); addToBack(bg); } + @Override + protected void onPointerDown() { + super.onPointerDown(); + if (spell == GuidingLight.INSTANCE && spell.chargeUse(Dungeon.hero) == 0){ + icon.brightness(4); + } + } + @Override protected void onPointerUp() { super.onPointerUp(); if (!tome.canCast(Dungeon.hero, spell)){ icon.alpha( 0.3f ); + } else if (spell == GuidingLight.INSTANCE && spell.chargeUse(Dungeon.hero) == 0){ + icon.brightness(3); } }