public override void ConfirmCast() { if (View.Toggleable.Active) { return; } if (!Checker.AllowCast()) { return; } View.Toggleable.Active = true; CastNoTarget(); Checker.DoCast(); Checker.Cooldown.End(); Modules.Abilitiable.NotifyAbilityCast(new AbilityEventArgs(Self, View.StatCost.Cost)); }
public override void ConfirmCast() { if (!Checker.AllowCast()) { return; } var ray = AbilityHelper.GetScreenRay(); if (!AbilityHelper.TryGetWorldOrEntity(ray, out var hit)) { return; } var unitCast = AbilityHelper.TryGetActor(hit.collider, out var actor); if (actor == Self) { return; } var position = unitCast ? actor.transform.position : hit.point; if (!CastRange.InRange(position)) { return; } if (unitCast) { if (!Checker.AllowTarget(actor)) { return; } Checker.DoCast(); CastObjectTarget(actor); } else { Checker.DoCast(); CastGroundTarget(position); } Modules.Abilitiable.NotifyAbilityCast(new AbilityEventArgs(Self, Checker.MagicCost.Cost)); }
public override void ConfirmCast() { if (!Checker.AllowCast()) { return; } var ray = AbilityHelper.GetScreenRay(); if (!AbilityHelper.TryGetWorldOrEntity(ray, out var hit)) { return; } var unitTarget = AbilityHelper.TryGetActor(hit.collider, out var actor); if (actor == Self) { return; } if (!unitTarget && !CastRange.InRange(hit.point)) { return; } if (unitTarget && !CastRange.InRange(actor)) { return; } Checker.DoCast(); if (!unitTarget) { CastGroundTarget(hit.point); } else { CastObjectTarget(actor); } Modules.Abilitiable.NotifyAbilityCast(new AbilityEventArgs(Self, View.StatCost.Cost)); }