- 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
90 lines
2.5 KiB
C#
90 lines
2.5 KiB
C#
using Photon.Pun;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class DamageOutputModifierEffectInstance : StatusEffectInstance
|
|
{
|
|
|
|
public float startingOutputModifierPercent;
|
|
|
|
public float currentOutputModifierPercent;
|
|
|
|
|
|
public float ModifyDamageOutput(float output)
|
|
{
|
|
return output = output * (1 + currentOutputModifierPercent);
|
|
}
|
|
|
|
public float GetHighestAmount()
|
|
{
|
|
float highestAmount = 0;
|
|
for (int i = 0; i < activeStacks.Count; i++)
|
|
{
|
|
if (((DamageOutputModifierEffect)activeStacks[i]).damageOutputModifierPercentage > highestAmount)
|
|
highestAmount = ((DamageOutputModifierEffect)activeStacks[i]).damageOutputModifierPercentage;
|
|
}
|
|
|
|
return highestAmount;
|
|
}
|
|
|
|
[PunRPC]
|
|
public void RPC_ApplyDamageOutputModifierEffect(int effectIndex, float value)
|
|
{
|
|
ApplyEffect(StatusEffectIndexer.Instance.StatusEffects[effectIndex], value);
|
|
}
|
|
|
|
public override void ApplyEffect(StatusEffect effect, float value)
|
|
{
|
|
base.ApplyEffect(effect, value);
|
|
}
|
|
|
|
protected override void AddStack(StatusEffect addedEffect, float value)
|
|
{
|
|
if (activeStacks.Count <= 0)
|
|
{
|
|
startingOutputModifierPercent = ((DamageOutputModifierEffect)addedEffect).damageOutputModifierPercentage;
|
|
currentOutputModifierPercent = startingOutputModifierPercent;
|
|
}
|
|
else if (canStack && (!activeStacks.Contains(addedEffect) || addedEffect.canApplyMultipleInstances))
|
|
{
|
|
currentOutputModifierPercent += ((DamageOutputModifierEffect)addedEffect).damageOutputModifierPercentage;
|
|
}
|
|
else
|
|
{
|
|
OnEffectStackAdded();
|
|
return;
|
|
}
|
|
|
|
base.AddStack(addedEffect, value);
|
|
}
|
|
|
|
protected override void RefreshEffect(StatusEffect effect, float value)
|
|
{
|
|
base.RefreshEffect(effect, value);
|
|
|
|
startingOutputModifierPercent = GetHighestAmount();
|
|
currentOutputModifierPercent = startingOutputModifierPercent;
|
|
|
|
OnEffectStackAdded();
|
|
}
|
|
|
|
protected override IEnumerator EffectStateCoroutine()
|
|
{
|
|
return base.EffectStateCoroutine();
|
|
}
|
|
|
|
protected override void EffectStateStarted()
|
|
{
|
|
base.EffectStateStarted();
|
|
}
|
|
|
|
protected override void EffectStateEnded()
|
|
{
|
|
startingOutputModifierPercent = 0;
|
|
currentOutputModifierPercent = startingOutputModifierPercent;
|
|
|
|
base.EffectStateEnded();
|
|
}
|
|
}
|