From 54b523b96cce8e7b5423961b42380d7625a1e4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Fri, 17 Mar 2023 08:35:04 +0800 Subject: [PATCH] fix: fixed the interrupt targeting andLowBlow targeting. --- .../Rotations/CustomRotation_Ability.cs | 4 ++-- .../Rotations/CustomRotation_Actions.cs | 21 +++++++++++++------ RotationSolver/RotationSolverPlugin.cs | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/RotationSolver.Basic/Rotations/CustomRotation_Ability.cs b/RotationSolver.Basic/Rotations/CustomRotation_Ability.cs index c39c9f6fb..812e5dfd2 100644 --- a/RotationSolver.Basic/Rotations/CustomRotation_Ability.cs +++ b/RotationSolver.Basic/Rotations/CustomRotation_Ability.cs @@ -115,13 +115,13 @@ private bool AntiKnockback(JobRole role, SpecialCommandType specialType, out IAc if (ArmsLength.CanUse(out act)) return true; break; case JobRole.Healer: - if (Surecast.CanUse(out act)) return true; + if (SureCast.CanUse(out act)) return true; break; case JobRole.RangedPhysical: if (ArmsLength.CanUse(out act)) return true; break; case JobRole.RangedMagical: - if (Surecast.CanUse(out act)) return true; + if (SureCast.CanUse(out act)) return true; break; } diff --git a/RotationSolver.Basic/Rotations/CustomRotation_Actions.cs b/RotationSolver.Basic/Rotations/CustomRotation_Actions.cs index d525bdc86..143cd0dd4 100644 --- a/RotationSolver.Basic/Rotations/CustomRotation_Actions.cs +++ b/RotationSolver.Basic/Rotations/CustomRotation_Actions.cs @@ -160,36 +160,45 @@ internal RoleAction(ActionID actionID, JobRole[] roles, bool isFriendly = false, /// /// 插言 /// - public static IBaseAction Interject { get; } = new RoleAction(ActionID.Interject, new JobRole[] { JobRole.Tank }); + public static IBaseAction Interject { get; } = new RoleAction(ActionID.Interject, new JobRole[] { JobRole.Tank }) + { + FilterForHostiles = b => b.Where(ObjectHelper.CanInterrupt), + }; /// /// 下踢 /// public static IBaseAction LowBlow { get; } = new RoleAction(ActionID.LowBlow, new JobRole[] { JobRole.Tank }) { - ActionCheck = b => + FilterForHostiles = bs => bs.Where(b => { if (b.IsBoss() || IsMoving || b.CastActionId == 0) return false; if (!b.IsCastInterruptible || Interject.IsCoolingDown) return true; return false; - } + }), }; /// /// 扫腿 /// - public static IBaseAction LegSweep { get; } = new RoleAction(ActionID.LegSweep, new JobRole[] { JobRole.Melee }); + public static IBaseAction LegSweep { get; } = new RoleAction(ActionID.LegSweep, new JobRole[] { JobRole.Melee }) + { + FilterForHostiles = b => b.Where(ObjectHelper.CanInterrupt), + }; /// /// 伤头 /// - public static IBaseAction HeadGraze { get; } = new RoleAction(ActionID.HeadGraze, new JobRole[] { JobRole.RangedPhysical }); + public static IBaseAction HeadGraze { get; } = new RoleAction(ActionID.HeadGraze, new JobRole[] { JobRole.RangedPhysical }) + { + FilterForHostiles = b => b.Where(ObjectHelper.CanInterrupt), + }; /// /// 沉稳咏唱 /// - public static IBaseAction Surecast { get; } = new RoleAction(ActionID.Surecast, + public static IBaseAction SureCast { get; } = new RoleAction(ActionID.Surecast, new JobRole[] { JobRole.RangedMagical, JobRole.Healer }, true, shouldEndSpecial: true); /// diff --git a/RotationSolver/RotationSolverPlugin.cs b/RotationSolver/RotationSolverPlugin.cs index db4a4097b..73ee944d5 100644 --- a/RotationSolver/RotationSolverPlugin.cs +++ b/RotationSolver/RotationSolverPlugin.cs @@ -33,7 +33,7 @@ public unsafe RotationSolverPlugin(DalamudPluginInterface pluginInterface) File.ReadAllText(Service.Interface.ConfigFile.FullName)) ?? new PluginConfiguration(); } - catch(Exception ex) + catch() { Service.Config = new PluginConfiguration(); }