From 6b721f8e8807241a3638f9178ad4435a1ac5221f Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 18 Nov 2024 15:22:35 -0500 Subject: [PATCH] v3.0.0: added some simple vfx to the recally glyph spell --- .../actors/hero/spells/RecallGlyph.java | 4 ++++ .../shatteredpixeldungeon/effects/Enchanting.java | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/RecallGlyph.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/RecallGlyph.java index 4e00b6b25..7eecb0377 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/RecallGlyph.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/RecallGlyph.java @@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; +import com.shatteredpixel.shatteredpixeldungeon.effects.Enchanting; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; @@ -67,6 +68,9 @@ public class RecallGlyph extends ClericSpell { item.setCurrent(hero); + hero.sprite.operate(hero.pos); + Enchanting.show(hero, item); + if (item instanceof Scroll){ ((Scroll) item).anonymize(); ((Scroll) item).doRead(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Enchanting.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Enchanting.java index 600c7ee76..c38ab2b2a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Enchanting.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Enchanting.java @@ -50,7 +50,11 @@ public class Enchanting extends ItemSprite { super( item.image(), null ); originToCenter(); - color = item.glowing().color; + if (item.glowing() != null) { + color = item.glowing().color; + } else { + color = -1; + } phase = Phase.FADE_IN; duration = FADE_IN_TIME; @@ -72,7 +76,9 @@ public class Enchanting extends ItemSprite { scale.set( passed / duration ); break; case STATIC: - tint( color, passed / duration * 0.8f ); + if (color != -1) { + tint(color, passed / duration * 0.8f); + } break; case FADE_OUT: alpha( (1 - passed / duration) * ALPHA );