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

Commit

Permalink
fix: add lb things.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 24, 2024
1 parent 8aa60a2 commit 8635306
Show file tree
Hide file tree
Showing 9 changed files with 896 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ClickingCount": 76809,
"ClickingCount": 77120,
"SayingHelloCount": 66,
"SaidUsers": []
}
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Actions/ActionBasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ internal readonly bool BasicCheck(bool skipStatusProvideCheck, bool skipCombo, b
{
if (!_action.Config.IsEnabled || !IsOnSlot) return false;

if (IsLimitBreak) return true;

//Disabled.
if (DataCenter.DisabledActionSequencer?.Contains(ID) ?? false) return false;

Expand Down
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Actions/BaseAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ public bool CanUse(out IAction act, bool skipStatusProvideCheck = false, bool sk
}

if (!Info.BasicCheck(skipStatusProvideCheck, skipCombo, ignoreCastingCheck)) return false;

if (!Cooldown.CooldownCheck(isEmpty, onLastAbility, ignoreClippingCheck, gcdCountForAbility)) return false;


if (Setting.IsMeleeRange && IActionHelper.IsLastAction(IActionHelper.MovingActions)) return false; //No range actions after moving.
if (Setting.IsFriendly && DataCenter.AverageTimeToKill < Config.TimeToKill) return false;

Expand Down
1 change: 1 addition & 0 deletions RotationSolver.Basic/Rotations/CustomRotation_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ static partial void ModifySprintPvP(ref ActionSetting setting)
private protected virtual IBaseAction? LimitBreak1 => null;
private protected virtual IBaseAction? LimitBreak2 => null;
private protected virtual IBaseAction? LimitBreak3 => null;
private protected virtual IBaseAction? LimitBreakPvP => null;

public virtual IAction[] AllActions =>
[
Expand Down
8 changes: 6 additions & 2 deletions RotationSolver.Basic/Rotations/CustomRotation_GCD.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace RotationSolver.Basic.Rotations;
using ECommons.DalamudServices;

namespace RotationSolver.Basic.Rotations;

partial class CustomRotation
{
Expand Down Expand Up @@ -121,7 +123,9 @@ private bool UseLimitBreak(out IAction? act)

return LimitBreakLevel switch
{
1 => LimitBreak1?.CanUse(out act, skipAoeCheck: true) ?? false,
1 => ((DataCenter.Territory?.IsPvpZone ?? false)
? LimitBreakPvP?.CanUse(out act, skipAoeCheck: true)
: LimitBreak1?.CanUse(out act, skipAoeCheck: true)) ?? false,
2 => LimitBreak2?.CanUse(out act, skipAoeCheck: true) ?? false,
3 => LimitBreak3?.CanUse(out act, skipAoeCheck: true) ?? false,
_ => false,
Expand Down
35 changes: 31 additions & 4 deletions RotationSolver.GameData/Getters/RotationGetter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Lumina.Excel.GeneratedSheets;
using Lumina.Data;
using Lumina.Excel.GeneratedSheets;
using RotationSolver.GameData.Getters.Actions;
using System.Xml.Linq;

namespace RotationSolver.GameData.Getters;

Expand Down Expand Up @@ -48,10 +50,13 @@ public abstract partial class {{GetName()}} : CustomRotation
{{GetLBInRotation(job.LimitBreak1.Value, 1)}}
{{GetLBInRotation(job.LimitBreak2.Value, 2)}}
{{GetLBInRotation(job.LimitBreak3.Value, 3)}}
{{GetLBInRotationPvP(gameData.GetExcelSheet<Lumina.Excel.GeneratedSheets.Action>()?.FirstOrDefault(i => i.ActionCategory.Row is 15
&& ((bool?)i.ClassJobCategory.Value?.GetType().GetRuntimeProperty(job.Abbreviation)?.GetValue(i.ClassJobCategory.Value) ?? false)))}}
#endregion
#region Traits
{{traitsCode.Table()}}
{{Util.ArrayNames("AllTraits", "IBaseTrait",
Expand All @@ -66,7 +71,7 @@ private string GetLBInRotation(Lumina.Excel.GeneratedSheets.Action? action, int
if (action == null) return string.Empty;
if (action.RowId == 0) return string.Empty;

var code = GetLB(action, out var name);
var code = GetLBPvE(action, out var name);

return code + "\n" + $"""
/// <summary>
Expand All @@ -76,14 +81,36 @@ private string GetLBInRotation(Lumina.Excel.GeneratedSheets.Action? action, int
private sealed protected override IBaseAction LimitBreak{index} => {name};
""";
}

private string GetLB(Lumina.Excel.GeneratedSheets.Action action, out string name)
private string GetLBPvE(Lumina.Excel.GeneratedSheets.Action action, out string name)
{
name = action.Name.RawString.ToPascalCase() + $"PvE";
var descName = action.GetDescName();

return action.ToCode(name, descName, GetDesc(action), false);
}
private string GetLBInRotationPvP(Lumina.Excel.GeneratedSheets.Action? action)
{
if (action == null) return string.Empty;
if (action.RowId == 0) return string.Empty;

var code = GetLBPvP(action, out var name);

return code + "\n" + $"""
/// <summary>
/// {action.GetDescName()}
/// {GetDesc(action)}
/// </summary>
private sealed protected override IBaseAction LimitBreakPvP => {name};
""";
}

private string GetLBPvP(Lumina.Excel.GeneratedSheets.Action action, out string name)
{
name = action.Name.RawString.ToPascalCase() + $"PvP";
var descName = action.GetDescName();

return action.ToCode(name, descName, GetDesc(action), false);
}

private string GetDesc(Lumina.Excel.GeneratedSheets.Action item)
{
Expand Down
Loading

0 comments on commit 8635306

Please sign in to comment.