public override void ApplyEffect(AbilityCaster caster, EventHandler[] targets, AbilityData data) { for (int i = 0; i < targets.Length; i++) { DamageInstance.Damage(this, caster, targets[i], data.SecondaryValue, data.SecondaryType); } }
public override void OnApply(BuffInstance instance) { instance.Target.GetComponent <AbilityCaster>().AddDisabler(); instance.ApplyBuffMod(AttackModHandler.Generate(EventFlag.HIT_BY_ATTACK, (atkInst) => { DamageInstance.Damage(instance.OriginEffect, instance.Caster, instance.Target, instance.Data.MainValue * (atkInst.IsCrit ? 2 : 1), instance.Data.MainType); instance.Remove(); })); }
void Execute() { Attacker.EventHandler.AttackEvents.Trigger(EventFlag.ATTACK, this); Target.AttackEvents.Trigger(EventFlag.ATTACKED, this); if (IsDefended) { Attacker.EventHandler.AttackEvents.Trigger(EventFlag.DEFEND, this); Target.AttackEvents.Trigger(EventFlag.DEFENDED, this); } if (UnityEngine.Random.Range(0, 1) < HitChance) { IsHit = true; if (OriginEffect.SFXOverride != null) { OriginEffect.SFXOverride.Spawn(Target.transform); } else if (SFX != null) { SFX.Spawn(Target.transform); } float critDeter = UnityEngine.Random.Range(0, 1f); if (critDeter < CritChance) { IsCrit = true; Damage *= CritMultiplier; } Attacker.EventHandler.AttackEvents.Trigger(EventFlag.HIT_WITH_ATTACK, this); Target.AttackEvents.Trigger(EventFlag.HIT_BY_ATTACK, this); if (IsCrit) { Attacker.EventHandler.AttackEvents.Trigger(EventFlag.CRIT, this); Target.AttackEvents.Trigger(EventFlag.CRITTED, this); } DamageInstance.Damage(OriginEffect, Attacker, Target, Damage, Type, IsCrit, IsDefended); } else { Attacker.EventHandler.AttackEvents.Trigger(EventFlag.MISS, this); Target.AttackEvents.Trigger(EventFlag.MISSED, this); } }
public override void OnTick(BuffInstance instance) { DamageInstance.Damage(instance.OriginEffect, instance.Caster, instance.Target, instance.Data.SecondaryValue, instance.Data.SecondaryType); }