- Implemented Damage output modifier effects to all characters, allowing to temporarily increase/decrease the target's output - Added a complete set of priest abilities, when they want to join the dark side: - New Corrupted slash priest melee ability - New Shadow Orb priest projectile ability - New Burst of Corruption AoE ability - New Corrupted Grounds AoEOverTime ability - New Tainted Star AoEOverTime ability (future signature spell) - Added stackable damage income modifier to enemies hit by all corrupted priest abilities, making him insane in cursing and group utility. - Updated damage income/output modifiers to allow optional stacking of the same effects
61 lines
2.3 KiB
C#
61 lines
2.3 KiB
C#
using Kryz.CharacterStats;
|
|
using Kryz.CharacterStats.Examples;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
|
|
[CreateAssetMenu(fileName = "DamageOutputModifierEffect", menuName = "RiftMayhem/AbilitySystem/Effects/DamageOutputModifier Effect", order = 1)]
|
|
public class DamageOutputModifierEffect : StatusEffect
|
|
{
|
|
public float damageOutputModifierPercentage;
|
|
|
|
public bool avoidEnemies = false;
|
|
|
|
DamageOutputModifierEffectInstance targetDamageOutputModifierEffect;
|
|
|
|
public override void ApplyEffect(Taggable user, List<Taggable> targets)
|
|
{
|
|
base.ApplyEffect(user, targets);
|
|
|
|
if (applyToTargetsHit)
|
|
{
|
|
foreach (Taggable target in targets)
|
|
{
|
|
if(avoidEnemies)
|
|
{
|
|
if (!user.AlliedTagsContains(target.targetTag)) continue;
|
|
}
|
|
targetDamageOutputModifierEffect = target.GetComponent<DamageOutputModifierEffectInstance>();
|
|
targetDamageOutputModifierEffect.owner.RPC(nameof(targetDamageOutputModifierEffect.RPC_ApplyDamageOutputModifierEffect), targetDamageOutputModifierEffect.owner.Owner, StatusEffectIndexer.Instance.StatusEffects.IndexOf(this), CalculateFinalAmount(user));
|
|
}
|
|
}
|
|
if(applyToSelf)
|
|
{
|
|
targetDamageOutputModifierEffect = user.GetComponent<DamageOutputModifierEffectInstance>();
|
|
targetDamageOutputModifierEffect.ApplyEffect(this, CalculateFinalAmount(user));
|
|
}
|
|
}
|
|
|
|
|
|
private float CalculateFinalAmount(Taggable user)
|
|
{
|
|
float finalAmount = damageOutputModifierPercentage;
|
|
CharacterStats stats = user.GetComponent<CharacterStats>();
|
|
|
|
foreach (var statInfluence in influencingStats)
|
|
{
|
|
if (stats.primaryStatsDictionary.TryGetValue(statInfluence.statTag.name.ToLower(), out CharacterStat stat))
|
|
{
|
|
finalAmount += stat.Value * statInfluence.percentInfluence;
|
|
}
|
|
else if (stats.secondaryStatsDictionary.TryGetValue(statInfluence.statTag.name.ToLower(), out CharacterStat secondaryStat))
|
|
{
|
|
finalAmount += secondaryStat.Value * statInfluence.percentInfluence;
|
|
}
|
|
}
|
|
|
|
return finalAmount;
|
|
}
|
|
}
|