private static void DodgeWithWalk(TrackedDash dash) { LocalPlayer.BlockAllInput = true; var dir = dash.ClosestPoint.Extend(LocalPlayer.Instance.Pos(), 10).Normalized; LocalPlayer.Move(dir); }
private static void DodgeWithAbilities(TrackedDash dash) { var timeToImpact = dash.EstimatedImpact - Time.time; if (PlayerIsSafe(timeToImpact)) { return; } foreach (var ability in AbilityDatabase.GetDodge(LocalPlayer.Instance.CharName).OrderBy(a => a.Priority)) { if (!ability.UseInEvade || timeToImpact > ability.CastTime + 0.25f || timeToImpact < ability.CastTime + 0.05f) { continue; } if (ability.ShouldUse() && ability.IsReady() && ability.GetDanger() <= dash.Data.GetDanger() && (dash.Data.CanCounter || ability.AbilityType != DodgeAbilityType.Counter) && (dash.Data.CanCounter || ability.AbilityType != DodgeAbilityType.Shield) && (ability.AbilityType != DodgeAbilityType.KnockAway || dash.DashObject.GameObject.ObjectName == "Rush")) { if (ability.NeedsSelfCast) { LocalPlayer.PressAbility(ability.AbilitySlot, true); } else { LocalPlayer.PressAbility(ability.AbilitySlot, true); } return; } } }
private static bool CanDodge(TrackedDash dash) { var timeToDodge = (dash.Data.Radius + LocalPlayer.Instance.MapCollision.MapCollisionRadius - LocalPlayer.Instance.Distance(dash.ClosestPoint)) / 3.4f; return(dash.EstimatedImpact - Time.time < timeToDodge); }