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 invincible status and change the interrupt logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 4, 2023
1 parent d8947f9 commit ac3cb97
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions RotationSolver/Data/StatusID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1119,4 +1119,5 @@ internal enum StatusID : ushort
RespellingSpray = 556,

StoneSkin = 151,
IceSpikesInvincible = 198,
}
15 changes: 9 additions & 6 deletions RotationSolver/Helpers/ObjectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using RotationSolver.Data;
using RotationSolver.Updaters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

Expand All @@ -29,20 +30,22 @@ internal static unsafe uint FateId(this GameObject obj)
internal static unsafe bool IsTargetable(this GameObject obj)
=> ((FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)(void*)obj.Address)->GetIsTargetable();

static readonly Dictionary<uint, bool> _effectRangeCheck = new Dictionary<uint, bool>();
internal static bool CanInterrupt(this BattleChara b)
{
var baseCheck = b.IsCasting && b.IsCastInterruptible && b.TotalCastTime >= 2;

if (!baseCheck) return false;
if (!Service.Configuration.InterruptibleMoreCheck) return true;

var act = Service.DataManager.GetExcelSheet<Lumina.Excel.GeneratedSheets.Action>().GetRow(b.CastActionId);
if (act == null) return false;
var id = b.CastActionId;
if (_effectRangeCheck.TryGetValue(id, out var check)) return check;

//跳过扇形圆型
if (act.CastType is 3 or 4) return false;
if (ActionManager.GetActionRange(b.CastActionId) is > 0 and < 8) return false;
return true;
var act = Service.DataManager.GetExcelSheet<Lumina.Excel.GeneratedSheets.Action>().GetRow(b.CastActionId);
if (act == null) return _effectRangeCheck[id] = false;
if (act.CastType is 3 or 4) return _effectRangeCheck[id] = false;
if (act.EffectRange is > 0 and < 8) return _effectRangeCheck[id] = false;
return _effectRangeCheck[id] = true;
}

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Helpers/StatusHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ private static IEnumerable<Status> GetAllStatus(this BattleChara obj, bool isFro
static readonly StatusID[] invincibalStatus = new StatusID[]
{
StatusID.StoneSkin,
StatusID.IceSpikesInvincible,
};

internal static bool IsInvincible(this Status status)
Expand Down
11 changes: 11 additions & 0 deletions RotationSolver/Rotations/Healer/WHM/WHM_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ private protected override IRotationConfigSet CreateConfiguration()
return base.CreateConfiguration().SetBool("UseLilyWhenFull", true, "Auto use Lily when full")
.SetBool("UsePreRegen", false, "Regen on Tank in 5 seconds.");
}
public static IBaseAction RegenDefense { get; } = new BaseAction(ActionID.Regen, true, isEot: true, isTimeline: true)
{
ChoiceTarget = TargetFilter.FindAttackedTarget,
TargetStatus = new[]
{
StatusID.Regen1,
StatusID.Regen2,
StatusID.Regen3,
}
};

public override SortedList<DescType, string> DescriptionDict => new()
{
{DescType.HealArea, $"{AfflatusRapture}, {Medica2}, {Cure3}, {Medica}\n{Asylum}"},
Expand Down

0 comments on commit ac3cb97

Please sign in to comment.