RiftMayhem/Assets/Scripts/AbilitySystem/Effects/OverTimeValueEffect.cs
Pedro Gomes a966809f20 Update with class & attack
- melee attack first iteration (WIP)
- priest playable class
- priest "holy ball" ability
2024-05-21 20:37:07 +01:00

25 lines
783 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "OverTimeEffect", menuName = "RiftMayhem/AbilitySystem/Effects/OverTime Effect", order = 1)]
public class OverTimeValueEffect : BaseEffect
{
public float value;
public float duration;
public float tickRate;
public override void ApplyEffect(Taggable user, List<Taggable> targets)
{
foreach (Taggable target in targets)
{
Debug.Log($"Applied overtime effect of {GetCorrectValueSign(user, target)} every {tickRate}s over {duration}s to target {target.name}");
}
}
private float GetCorrectValueSign(Taggable user, Taggable target)
{
return target.targetTag != user.targetTag ? -value : value;
}
}