RiftMayhem/Assets/Scripts/AbilitySystem/Effects/DamageIncomeModifierEffect.cs
Pedro Gomes 888171a4a9 New spell & status & instant effect updates
- burst of hope (second priest ability) added
- instant value effect with modifiers based on targets
- damage income modifier effect added
- status effect option to apply to targets hit
- status effect option to apply to self
2024-07-07 11:44:12 +01:00

33 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "DamageIncomeModifierEffect", menuName = "RiftMayhem/AbilitySystem/Effects/DamageIncomeModifier Effect", order = 1)]
public class DamageIncomeModifierEffect : StatusEffect
{
public float damageIncomeModifierPercentage;
DamageIncomeModifierEffectInstance targetDamageIncomeModifierEffect;
public override void ApplyEffect(Taggable user, List<Taggable> targets)
{
base.ApplyEffect(user, targets);
if (applyToTargetsHit)
{
foreach (Taggable target in targets)
{
targetDamageIncomeModifierEffect = target.GetComponent<DamageIncomeModifierEffectInstance>();
targetDamageIncomeModifierEffect.owner.RPC(nameof(targetDamageIncomeModifierEffect.RPC_ApplyDamageIncomeModifierEffect), targetDamageIncomeModifierEffect.owner.Owner, StatusEffectIndexer.Instance.StatusEffects.IndexOf(this));
}
}
if(applyToSelf)
{
targetDamageIncomeModifierEffect = user.GetComponent<DamageIncomeModifierEffectInstance>();
targetDamageIncomeModifierEffect.ApplyEffect(this);
}
}
}