From 424fc1d95793f8c4075bdb66f67046446cad88eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Mon, 23 Jan 2023 16:20:06 +0800 Subject: [PATCH] fix: add some conditions for interrupt. --- .../CustomRotation/CustomRotation_Ability.cs | 4 ++-- .../Updaters/TargetUpdater_Hostile.cs | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/RotationSolver/Rotations/CustomRotation/CustomRotation_Ability.cs b/RotationSolver/Rotations/CustomRotation/CustomRotation_Ability.cs index 2378dda27..bc0c88bef 100644 --- a/RotationSolver/Rotations/CustomRotation/CustomRotation_Ability.cs +++ b/RotationSolver/Rotations/CustomRotation/CustomRotation_Ability.cs @@ -29,7 +29,7 @@ private bool Ability(byte abilitiesRemaining, IAction nextGCD, out IAction act, var specialType = RSCommands.SpecialType; if (ShirkOrShield(role, specialType, out act)) return true; - if (AntiRepulsion(role, specialType, out act)) return true; + if (AntiKnockback(role, specialType, out act)) return true; if (specialType == SpecialCommandType.EsunaShieldNorth && role == JobRole.Melee) { @@ -104,7 +104,7 @@ private bool ShirkOrShield(JobRole role, SpecialCommandType specialType, out IAc return false; } - private bool AntiRepulsion(JobRole role, SpecialCommandType specialType, out IAction act) + private bool AntiKnockback(JobRole role, SpecialCommandType specialType, out IAction act) { act = null; diff --git a/RotationSolver/Updaters/TargetUpdater_Hostile.cs b/RotationSolver/Updaters/TargetUpdater_Hostile.cs index da95867ad..a2f80ba9f 100644 --- a/RotationSolver/Updaters/TargetUpdater_Hostile.cs +++ b/RotationSolver/Updaters/TargetUpdater_Hostile.cs @@ -1,4 +1,5 @@ using Dalamud.Game.ClientState.Objects.Types; +using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.Game.Fate; using FFXIVClientStructs.FFXIV.Client.UI; using Lumina.Excel.GeneratedSheets; @@ -82,8 +83,21 @@ internal unsafe static void UpdateHostileTargets() break; } - CanInterruptTargets = HostileTargets.Where(tar => tar.IsCasting && tar.IsCastInterruptible && tar.TotalCastTime >= 2 - && tar.CurrentCastTime >= Service.Configuration.InterruptibleTime); + CanInterruptTargets = HostileTargets.Where(tar => + { + var baseCheck = tar.IsCasting && tar.IsCastInterruptible && tar.TotalCastTime >= 2 + && tar.CurrentCastTime >= Service.Configuration.InterruptibleTime; + + if(!baseCheck) return false; + + var act = Service.DataManager.GetExcelSheet().GetRow(tar.CastActionId); + if (act == null) return false; + + //跳过扇形圆型 + if (act.CastType is 3 or 4) return false; + if (ActionManager.GetActionRange(tar.CastActionId) < 8) return false; + return true; + }); TarOnMeTargets = HostileTargets.Where(tar => tar.TargetObjectId == Service.ClientState.LocalPlayer.ObjectId);