From 6173b6ead005f7110d13e4ff2760394f90559f75 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 13 Nov 2024 19:45:10 -0500 Subject: [PATCH] v3.0.0: added better vfx to T1 Cleric spells --- .../actors/hero/spells/DetectCurse.java | 4 +++- .../actors/hero/spells/GuidingLight.java | 3 ++- .../actors/hero/spells/HolyWard.java | 2 ++ .../actors/hero/spells/HolyWeapon.java | 2 ++ .../actors/hero/spells/ShieldOfLight.java | 2 ++ .../effects/MagicMissile.java | 22 +++++++++++++++++++ 6 files changed, 33 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DetectCurse.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DetectCurse.java index 03a79ef2e..64e7a22cd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DetectCurse.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/DetectCurse.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; +import com.shatteredpixel.shatteredpixeldungeon.effects.Identification; import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; @@ -68,8 +69,9 @@ public class DetectCurse extends InventoryClericSpell { hero.spend( 1f ); hero.busy(); hero.sprite.operate(hero.pos); + hero.sprite.parent.add( new Identification( hero.sprite.center().offset( 0, -16 ) ) ); - Sample.INSTANCE.play( Assets.Sounds.SCAN ); + Sample.INSTANCE.play( Assets.Sounds.READ ); onSpellCast(tome, hero); } 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 fb534f346..8972b2a32 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 @@ -63,7 +63,7 @@ public class GuidingLight extends TargetedClericSpell { hero.busy(); Sample.INSTANCE.play( Assets.Sounds.ZAP ); hero.sprite.zap(target); - MagicMissile.boltFromChar(hero.sprite.parent, MagicMissile.MAGIC_MISSILE, hero.sprite, aim.collisionPos, new Callback() { + MagicMissile.boltFromChar(hero.sprite.parent, MagicMissile.LIGHT_MISSILE, hero.sprite, aim.collisionPos, new Callback() { @Override public void call() { @@ -71,6 +71,7 @@ public class GuidingLight extends TargetedClericSpell { if (ch != null) { ch.damage(Random.NormalIntRange(2, 6), GuidingLight.this); Sample.INSTANCE.play(Assets.Sounds.HIT_MAGIC, 1, Random.Float(0.87f, 1.15f)); + ch.sprite.burst(0xFFFFFF44, 3); if (ch.isAlive()){ Buff.affect(ch, GuidingLightDebuff.class); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWard.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWard.java index 1f35da911..ee50f1172 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWard.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWard.java @@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.effects.Enchanting; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; @@ -51,6 +52,7 @@ public class HolyWard extends ClericSpell { hero.spend( 1f ); hero.busy(); hero.sprite.operate(hero.pos); + if (hero.belongings.armor() != null) Enchanting.show(hero, hero.belongings.armor()); onSpellCast(tome, hero); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWeapon.java index f48ae6d67..9f08f9ba9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/HolyWeapon.java @@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.effects.Enchanting; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; @@ -56,6 +57,7 @@ public class HolyWeapon extends ClericSpell { hero.spend( 1f ); hero.busy(); hero.sprite.operate(hero.pos); + if (hero.belongings.weapon() != null) Enchanting.show(hero, hero.belongings.weapon()); onSpellCast(tome, hero); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ShieldOfLight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ShieldOfLight.java index ebabb5426..478906bee 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ShieldOfLight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ShieldOfLight.java @@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; 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.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; @@ -67,6 +68,7 @@ public class ShieldOfLight extends TargetedClericSpell { hero.busy(); hero.sprite.operate(hero.pos); + hero.sprite.emitter().start(Speck.factory(Speck.LIGHT), 0.15f, 6); onSpellCast(tome, hero); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/MagicMissile.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/MagicMissile.java index 9d405e05e..0dcb151cc 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/MagicMissile.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/MagicMissile.java @@ -72,6 +72,7 @@ public class MagicMissile extends Emitter { public static final int SHAMAN_PURPLE = 13; public static final int ELMO = 14; public static final int POISON = 15; + public static final int LIGHT_MISSILE = 16; public static final int MAGIC_MISS_CONE = 100; public static final int FROST_CONE = 101; @@ -197,6 +198,10 @@ public class MagicMissile extends Emitter { size( 3 ); pour( PoisonParticle.MISSILE, 0.01f ); break; + case LIGHT_MISSILE: + size( 4 ); + pour( WhiteParticle.YELLOW, 0.01f ); + break; case MAGIC_MISS_CONE: size( 10 ); @@ -493,6 +498,17 @@ public class MagicMissile extends Emitter { return true; } }; + + public static final Emitter.Factory YELLOW = new Factory() { + @Override + public void emit( Emitter emitter, int index, float x, float y ) { + ((WhiteParticle)emitter.recycle( WhiteParticle.class )).reset( x, y, 1f, 1f, 0.25f ); + } + @Override + public boolean lightMode() { + return true; + } + }; public WhiteParticle() { super(); @@ -509,6 +525,12 @@ public class MagicMissile extends Emitter { this.y = y; left = lifespan; + hardlight(1, 1, 1); + } + + public void reset( float x, float y, float r, float g, float b ) { + reset(x, y); + hardlight(r, g, b); } @Override