diff --git a/Zennysoft.Game.Ma.Implementation/Components/ISigil.cs b/Zennysoft.Game.Ma.Implementation/Components/ISigil.cs index 010365f2..b1438692 100644 --- a/Zennysoft.Game.Ma.Implementation/Components/ISigil.cs +++ b/Zennysoft.Game.Ma.Implementation/Components/ISigil.cs @@ -8,9 +8,18 @@ public interface ISigil [Export] public double DamageModifier { get; } + [Export] + public double DefenseModifier { get; } + [Export] public double MoveSpeedModifier { get; } + [Export] + public double HealAmountModifier { get; } + + [Export] + public double VTDrainSpeedModifier { get; } + [Export] public ElementType ElementType { get; } diff --git a/Zennysoft.Game.Ma/src/game/Game.cs b/Zennysoft.Game.Ma/src/game/Game.cs index 5acdb51e..d23641b5 100644 --- a/Zennysoft.Game.Ma/src/game/Game.cs +++ b/Zennysoft.Game.Ma/src/game/Game.cs @@ -607,8 +607,9 @@ public partial class Game : Node3D, IGame private void EnactConsumableItemEffects(ConsumableItem consumableItem) { - - if (consumableItem.HealHPAmount > 0 && consumableItem.HealVTAmount > 0) + var healHPAmount = Mathf.RoundToInt(consumableItem.HealHPAmount * (1 + _player.SigilComponent.Sigil.HealAmountModifier)); + var healVTAmount = Mathf.RoundToInt(consumableItem.HealVTAmount * (1 + _player.SigilComponent.Sigil.HealAmountModifier)); + if (healHPAmount > 0 && healVTAmount > 0) { SfxDatabase.Instance.Play(SoundEffect.Eucharistia); @@ -620,8 +621,8 @@ public partial class Game : Node3D, IGame } else { - _player.HealthComponent.Heal(consumableItem.HealHPAmount); - _player.VTComponent.Restore(consumableItem.HealVTAmount); + _player.HealthComponent.Heal(healHPAmount); + _player.VTComponent.Restore(healVTAmount); InventoryEventNotification.Invoke($"Restored {consumableItem.RaiseHPAmount}HP." + System.Environment.NewLine + $"Restored {consumableItem.RaiseVTAmount}VT."); } if (_player.StatusEffectComponent.Rust.Value) @@ -644,18 +645,18 @@ public partial class Game : Node3D, IGame SfxDatabase.Instance.Play(SoundEffect.IncreaseStat); InventoryEventNotification.Invoke($"Raised maximum VT by {consumableItem.RaiseVTAmount}."); } - else if (consumableItem.HealHPAmount > 0) + else if (healHPAmount > 0) { var currentHP = _player.HealthComponent.CurrentHP; - _player.HealthComponent.Heal(consumableItem.HealHPAmount); + _player.HealthComponent.Heal(healHPAmount); SfxDatabase.Instance.Play(SoundEffect.HealHP); - InventoryEventNotification.Invoke($"Restored {consumableItem.HealHPAmount}HP."); + InventoryEventNotification.Invoke($"Restored {healHPAmount}HP."); } - else if (consumableItem.HealVTAmount > 0) + else if (healVTAmount > 0) { - _player.VTComponent.Restore(consumableItem.HealVTAmount); + _player.VTComponent.Restore(healVTAmount); SfxDatabase.Instance.Play(SoundEffect.HealVT); - InventoryEventNotification.Invoke($"Restored {consumableItem.HealVTAmount}VT."); + InventoryEventNotification.Invoke($"Restored {healVTAmount}VT."); } if (consumableItem.Stats.HealsStatusAilments) diff --git a/Zennysoft.Game.Ma/src/player/Player.cs b/Zennysoft.Game.Ma/src/player/Player.cs index b3905c7b..c3fe036d 100644 --- a/Zennysoft.Game.Ma/src/player/Player.cs +++ b/Zennysoft.Game.Ma/src/player/Player.cs @@ -219,7 +219,6 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide ExperiencePointsComponent.PlayerLevelUp += OnLevelUp; ExperiencePointsComponent.PlayerLevelDown += OnLevelDown; PlayerFXAnimations.AnimationFinished += PlayerFXAnimations_AnimationFinished; - HealthTimer.WaitTime = _healthTimerWaitTime; HealthTimer.Timeout += OnHealthTimerTimeout; _projectileCooldownTimer = new Timer(); @@ -248,6 +247,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide { SetProcessInput(true); SetPhysicsProcess(true); + HealthTimer.WaitTime = _healthTimerWaitTime * (1 + SigilComponent.Sigil.VTDrainSpeedModifier); SetHealthTimerStatus(HealthTimerIsActive); ShowCamera(true); Hitbox.SetDeferred(Area3D.PropertyName.Monitoring, true); @@ -276,7 +276,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide { HealthTimerSpeedModifier = newSpeed; HealthTimer.Stop(); - HealthTimer.WaitTime = _healthTimerWaitTime * newSpeed; + HealthTimer.WaitTime = (_healthTimerWaitTime * newSpeed) * (1 + SigilComponent.Sigil.VTDrainSpeedModifier); HealthTimer.Start(); } @@ -304,7 +304,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide var defense = TotalDefense; var elementalResistance = EquipmentComponent.ElementalResistance + SigilComponent.Sigil.ElementalResistanceSet; var damageReceived = DamageCalculator.CalculateDamage(damage, defense, elementalResistance); - damageReceived *= Mathf.RoundToInt(1 + SigilComponent.Sigil.DamageModifier); + damageReceived = Mathf.RoundToInt(damageReceived * (1 - SigilComponent.Sigil.DefenseModifier)); GD.Print($"Damage dealt: {damageReceived}"); HealthComponent.Damage(damageReceived, damage.ElementType); SfxDatabase.Instance.Play(SoundEffect.TakeDamage); diff --git a/Zennysoft.Game.Ma/src/sigil/SigilComponent.cs b/Zennysoft.Game.Ma/src/sigil/SigilComponent.cs index 7d21402d..0d6486ce 100644 --- a/Zennysoft.Game.Ma/src/sigil/SigilComponent.cs +++ b/Zennysoft.Game.Ma/src/sigil/SigilComponent.cs @@ -16,8 +16,14 @@ public partial class NoneSigil : ISigil { public double DamageModifier { get; } = 0; + public double DefenseModifier { get; } = 0; + public double MoveSpeedModifier { get; } = 0; + public double HealAmountModifier { get; } = 0; + + public double VTDrainSpeedModifier { get; } = 0; + public bool AutoRevive { get; } = false; public ElementType ElementType { get; } = ElementType.None; @@ -29,10 +35,16 @@ public partial class NoneSigil : ISigil public partial class AeolicSigil : ISigil { - public double DamageModifier { get; } = 0; + public double DamageModifier { get; } = -0.25; + + public double DefenseModifier { get; } = 0; public double MoveSpeedModifier { get; } = 0.25; + public double HealAmountModifier { get; } = 0; + + public double VTDrainSpeedModifier { get; } = 0; + public bool AutoRevive { get; } = false; public ElementType ElementType { get; } = ElementType.Aeolic; @@ -44,10 +56,16 @@ public partial class AeolicSigil : ISigil public partial class IgneousSigil : ISigil { - public double DamageModifier { get; } = 0.5; + public double DamageModifier { get; } = 0.25; + + public double DefenseModifier { get; } = -0.25; public double MoveSpeedModifier { get; } = 0; + public double HealAmountModifier { get; } = 0; + + public double VTDrainSpeedModifier { get; } = 0; + public bool AutoRevive { get; } = false; public ElementType ElementType { get; } = ElementType.Igneous; @@ -60,7 +78,13 @@ public partial class TelluricSigil : ISigil { public double DamageModifier { get; } = 0; - public double MoveSpeedModifier { get; } = 0; + public double DefenseModifier { get; } = 0.25; + + public double MoveSpeedModifier { get; } = -0.25; + + public double HealAmountModifier { get; } = 0; + + public double VTDrainSpeedModifier { get; } = 0; public bool AutoRevive { get; } = false; @@ -75,8 +99,14 @@ public partial class HydricSigil : ISigil { public double DamageModifier { get; } = 0; + public double DefenseModifier { get; } = 0; + public double MoveSpeedModifier { get; } = 0; + public double HealAmountModifier { get; } = 0.25; + + public double VTDrainSpeedModifier { get; } = -0.25; + public bool AutoRevive { get; } = false; public ElementType ElementType { get; } = ElementType.Hydric; @@ -90,8 +120,14 @@ public partial class FerrumSigil : ISigil { public double DamageModifier { get; } + public double DefenseModifier { get; } = 0; + public double MoveSpeedModifier { get; } = 0; + public double HealAmountModifier { get; } = 0; + + public double VTDrainSpeedModifier { get; } = 0; + public bool AutoRevive { get; } = false; public ElementType ElementType { get; } = ElementType.Ferrum; @@ -105,8 +141,14 @@ public partial class SanktaSigil : ISigil { public double DamageModifier { get; } + public double DefenseModifier { get; } = 0; + public double MoveSpeedModifier { get; } = 0; + public double HealAmountModifier { get; } = 0; + + public double VTDrainSpeedModifier { get; } = 0; + public bool AutoRevive { get; } = true; public ElementType ElementType { get; } = ElementType.Sankta; @@ -120,8 +162,14 @@ public partial class ShuraSigil : ISigil { public double DamageModifier { get; } + public double DefenseModifier { get; } = 0; + public double MoveSpeedModifier { get; } = 0; + public double HealAmountModifier { get; } = 0; + + public double VTDrainSpeedModifier { get; } = 0; + public bool AutoRevive { get; } = false; public ElementType ElementType { get; } = ElementType.Shura;