Add some on-screen FX for some items
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -115,6 +115,7 @@ public class EffectService
|
||||
enemy.OnAbsorb();
|
||||
}
|
||||
_player.HealthComponent.Heal((int)hpToAbsorb);
|
||||
_player.PlaySpellFX(SpellFXEnum.Kyuuketsuki);
|
||||
GD.Print("HP to absorb: " + hpToAbsorb);
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
1
Zennysoft.Game.Ma/src/player/SpellFXEnum.cs.uid
Normal file
1
Zennysoft.Game.Ma/src/player/SpellFXEnum.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dpq4n4gtxktx3
|
||||
1
Zennysoft.Game.Ma/src/vfx/PlayerFXEnum.cs.uid
Normal file
1
Zennysoft.Game.Ma/src/vfx/PlayerFXEnum.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://oiarptexw1nh
|
||||
Reference in New Issue
Block a user