Add some on-screen FX for some items

This commit is contained in:
2026-02-26 02:56:16 -08:00
parent fadb1652d4
commit bf168a2577
9 changed files with 1049 additions and 1487 deletions

View File

@@ -0,0 +1,11 @@
namespace Zennysoft.Ma.Adapter;
public enum SpellFXEnum
{
AnBradan,
DivinityRecall,
ItemBreak,
Kyuuketsuki,
Persiko,
Radial
}

View File

@@ -50,6 +50,8 @@ public interface IPlayer : IKillable, ICharacterBody3D
public void ModifyHealthTimerSpeed(float newModifier);
public void PlaySpellFX(SpellFXEnum spellEnum);
public bool AutoRevive { get; set; }
public int TotalAttack { get; }

View File

@@ -538,6 +538,7 @@ public partial class Game : Node3D, IGame
case UsableItemTag.TeleportAllEnemiesToRoom:
_effectService.TeleportEnemiesToCurrentRoom();
GameRepo.CloseInventory();
_player.PlaySpellFX(SpellFXEnum.DivinityRecall);
SfxDatabase.Instance.Play(SoundEffect.RecallEnemies);
break;
case UsableItemTag.KillHalfEnemiesInRoom:
@@ -585,6 +586,7 @@ public partial class Game : Node3D, IGame
case UsableItemTag.DoubleExp:
_effectService.DoubleExp();
GameRepo.CloseInventory();
_player.PlaySpellFX(SpellFXEnum.AnBradan);
break;
case UsableItemTag.TeleportToRandomLocation:
_effectService.TeleportToRandomRoom(_player);

View File

@@ -115,6 +115,7 @@ public class EffectService
enemy.OnAbsorb();
}
_player.HealthComponent.Heal((int)hpToAbsorb);
_player.PlaySpellFX(SpellFXEnum.Kyuuketsuki);
GD.Print("HP to absorb: " + hpToAbsorb);
}

View File

@@ -34,6 +34,7 @@ public partial class DummyPlayer : CharacterBody3D, IPlayer
public void LevelUp() => throw new NotImplementedException();
public void ModifyHealthTimerSpeed(float newModifier) => throw new NotImplementedException();
public void PlayJumpScareAnimation() => throw new NotImplementedException();
public void PlaySpellFX(SpellFXEnum spellEnum) => throw new NotImplementedException();
public void ResetPlayerData() => throw new NotImplementedException();
public void SetHealthTimerStatus(bool isActive) => throw new NotImplementedException();
public void TakeDamage(AttackData damage) => throw new NotImplementedException();

View File

@@ -75,6 +75,8 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
#endregion
#region Node Dependencies
[Node] public IAnimationPlayer SpellFXAnimations { get; set; } = default!;
[Node] private IAnimationPlayer WeaponAnimations { get; set; } = default!;
[Node] private IAnimationPlayer PlayerFXAnimations { get; set; } = default!;
@@ -596,6 +598,12 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
}
}
public void PlaySpellFX(SpellFXEnum spellEnum)
{
SpellFXAnimations.Stop();
SpellFXAnimations.Play(spellEnum.ToString());
}
private void OnLevelUp()
{
BoostPlayerHPFromLevelUp();

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
uid://dpq4n4gtxktx3

View File

@@ -0,0 +1 @@
uid://oiarptexw1nh