37 lines
945 B
C#
37 lines
945 B
C#
using UnityEngine;
|
|
|
|
[System.Serializable]
|
|
public class DamageOutputModifierRuntimeEffectInstance : RuntimeEffectInstance
|
|
{
|
|
public float damageOutputModifierPercentage;
|
|
|
|
|
|
public override void OnEffectFirstApplied(int numberOfStacksApplied)
|
|
{
|
|
base.OnEffectFirstApplied(numberOfStacksApplied);
|
|
|
|
//apply damage amp buff
|
|
user.Broker.OnOutgoingDamage.Subscribe(ModifyOutgoingDamage, GameConstants.BrokerEventPriority.TemporaryAmplificationMods);
|
|
}
|
|
|
|
public override void OnEffectRemoved()
|
|
{
|
|
base.OnEffectRemoved();
|
|
|
|
//remove damage amp buff
|
|
user.Broker.OnOutgoingDamage.Unsubscribe(ModifyOutgoingDamage);
|
|
}
|
|
|
|
private void ModifyOutgoingDamage(DamageArgs args)
|
|
{
|
|
args.currentValue = args.currentValue * (1 + damageOutputModifierPercentage);
|
|
}
|
|
|
|
|
|
public new void Reset()
|
|
{
|
|
base.Reset();
|
|
damageOutputModifierPercentage = 0f;
|
|
}
|
|
}
|