2025-10-01 18:45:11 +01:00

126 lines
2.8 KiB
C#

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class DamageArgs : IResettable
{
public BaseAbility sourceAbility;
public BaseEffect sourceEffect;
public Taggable user;
public Taggable target;
private float _currentValue;
public float currentValue
{
get => _currentValue;
set
{
if (_currentValue != value)
{
if (user != null && sourceAbility != null)
Debug.Log($"{user.name}'s {sourceAbility.name} DamageArgs.currentValue changed: {_currentValue} -> {value}\n{System.Environment.StackTrace}");
_currentValue = value;
}
}
}
public float outgoingAccumulator;
public float incomingAccumulator;
public DamageType damageType;
public EffectApplicationMethod applicationMethod;
public bool isCrit;
public int totalTargetsHit;
public bool targetDead;
public void Reset()
{
sourceAbility = null;
sourceEffect = null;
user = null;
target = null;
currentValue = 0f;
outgoingAccumulator = 0f;
incomingAccumulator = 0f;
damageType = default;
applicationMethod = default;
isCrit = false;
totalTargetsHit = 0;
targetDead = false;
}
}
public class HealArgs : IResettable
{
public BaseAbility source;
public BaseEffect effect;
public Taggable user;
public Taggable target;
public float currentValue;
public float outgoingAccumulator;
public float incomingAccumulator;
public EffectApplicationMethod applicationMethod;
public bool isCrit;
public int totalTargetsHit;
public void Reset()
{
source = null;
effect = null;
user = null;
target = null;
currentValue = 0f;
outgoingAccumulator = 0f;
incomingAccumulator = 0f;
applicationMethod = default;
isCrit = false;
totalTargetsHit = 0;
}
}
public class InvulnerabilityArgs : IResettable
{
public Taggable user;
public bool isImmune;
public void Reset()
{
user = null;
isImmune = false;
}
}
public class DodgeArgs : IResettable
{
public Taggable user;
public bool dodgedSuccessfully;
public void Reset()
{
user = null;
dodgedSuccessfully = false;
}
}
public class BlockArgs : IResettable
{
public Taggable user;
public bool blockedSuccessfully;
public void Reset()
{
user = null;
blockedSuccessfully = false;
}
}
public class AbsorbArgs : IResettable
{
public Taggable user;
public bool absorbedDamage;
public bool absorbDepleted;
public void Reset()
{
user = null;
absorbedDamage = false;
absorbDepleted = false;
}
}