Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: add some conditions for interrupt.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jan 23, 2023
1 parent df6f1e7 commit 424fc1d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;

Expand Down
18 changes: 16 additions & 2 deletions RotationSolver/Updaters/TargetUpdater_Hostile.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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<Action>().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);

Expand Down

0 comments on commit 424fc1d

Please sign in to comment.