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

Commit

Permalink
fix: add dead time for some buff actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 22, 2023
1 parent 89cb700 commit 18013ce
Show file tree
Hide file tree
Showing 26 changed files with 141 additions and 53 deletions.
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ public enum PluginConfigFloat : byte
[Default(8f)] ControlProgressHeight,
[Default(1.2f, 0f, 30f)] DistanceForMoving,
[Default(0.2f, 0.01f, 0.5f)] MaxPing,

[Default(8f, 0f, 30f)] AutoHealDeadTime,
}

public enum PluginConfigVector4 : byte
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Data/ActionID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3432,7 +3432,7 @@ public enum ActionID : uint
/// <summary>
///
/// </summary>
PresenseOfMind = 136,
PresenceOfMind = 136,

/// <summary>
///
Expand Down
1 change: 1 addition & 0 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ public static void SetSpecialType(SpecialCommandType specialType)
public static bool HasHostilesInMaxRange => NumberOfHostilesInMaxRange > 0;
public static int NumberOfHostilesInRange { get; internal set; }
public static int NumberOfHostilesInMaxRange { get; internal set; }
public static float AverageDeadTime { get; internal set; }

public static bool IsHostileCastingAOE { get; internal set; }

Expand Down
17 changes: 13 additions & 4 deletions RotationSolver.Basic/Rotations/Basic/AST_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,25 +170,34 @@ public abstract class AST_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Lightspeed { get; } = new BaseAction(ActionID.Lightspeed);
public static IBaseAction Lightspeed { get; } = new BaseAction(ActionID.Lightspeed)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
/// </summary>
public static IBaseAction NeutralSect { get; } = new BaseAction(ActionID.NeutralSect, ActionOption.Heal);
public static IBaseAction NeutralSect { get; } = new BaseAction(ActionID.NeutralSect, ActionOption.Heal)
{
ActionCheck = (b, m) => IsLongerThan(15),
};

/// <summary>
///
/// </summary>
public static IBaseAction Astrodyne { get; } = new BaseAction(ActionID.Astrodyne)
{
ActionCheck = (b, m) => !Seals.Contains(SealType.NONE),
ActionCheck = (b, m) => !Seals.Contains(SealType.NONE) && IsLongerThan(10),
};

/// <summary>
///
/// </summary>
public static IBaseAction Divination { get; } = new BaseAction(ActionID.Divination, ActionOption.Buff);
public static IBaseAction Divination { get; } = new BaseAction(ActionID.Divination, ActionOption.Buff)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
Expand Down
1 change: 1 addition & 0 deletions RotationSolver.Basic/Rotations/Basic/BLM_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ public override bool CanUse(out IAction act, CanUseOption option = CanUseOption.
public static IBaseAction LeyLines { get; } = new BaseAction(ActionID.LeyLines, ActionOption.Buff | ActionOption.EndSpecial)
{
StatusProvide = new[] { StatusID.LeyLines, },
ActionCheck = (b, m) => IsLongerThan(15),
};

/// <summary>
Expand Down
13 changes: 10 additions & 3 deletions RotationSolver.Basic/Rotations/Basic/BRD_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,18 @@ protected static bool SongEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction BattleVoice { get; } = new BaseAction(ActionID.BattleVoice, ActionOption.Buff);
public static IBaseAction BattleVoice { get; } = new BaseAction(ActionID.BattleVoice, ActionOption.Buff)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
/// </summary>
public static IBaseAction RadiantFinale { get; } = new BaseAction(ActionID.RadiantFinale, ActionOption.Buff)
{
ActionCheck = (b, m) => JobGauge.Coda.Any(s => s != Song.NONE),
ActionCheck = (b, m) => JobGauge.Coda.Any(s => s != Song.NONE)
&& IsLongerThan(10),
};

/// <summary>
Expand All @@ -200,7 +204,10 @@ protected static bool SongEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction RagingStrikes { get; } = new BaseAction(ActionID.RagingStrikes);
public static IBaseAction RagingStrikes { get; } = new BaseAction(ActionID.RagingStrikes)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
Expand Down
6 changes: 5 additions & 1 deletion RotationSolver.Basic/Rotations/Basic/DNC_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ public abstract class DNC_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Devilment { get; } = new BaseAction(ActionID.Devilment);
public static IBaseAction Devilment { get; } = new BaseAction(ActionID.Devilment)
{
ActionCheck = (b, m) => IsLongerThan(10)
};

/// <summary>
///
Expand Down Expand Up @@ -260,6 +263,7 @@ public abstract class DNC_Base : CustomRotation
StatusID.StandardFinish,
},
StatusProvide = StandardStep.StatusProvide,
ActionCheck = (b, m) => IsLongerThan(20),
};

/// <summary>
Expand Down
11 changes: 9 additions & 2 deletions RotationSolver.Basic/Rotations/Basic/DRG_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ protected static bool LOTDEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction LanceCharge { get; } = new BaseAction(ActionID.LanceCharge);
public static IBaseAction LanceCharge { get; } = new BaseAction(ActionID.LanceCharge)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
Expand All @@ -235,12 +238,16 @@ protected static bool LOTDEndAfterGCD(uint gctCount = 0, float offset = 0)

return Targets.GetJobCategory(JobRole.Melee, JobRole.RangedMagical, JobRole.RangedPhysical, JobRole.Tank).FirstOrDefault();
},
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
/// </summary>
public static IBaseAction BattleLitany { get; } = new BaseAction(ActionID.BattleLitany, ActionOption.Buff);
public static IBaseAction BattleLitany { get; } = new BaseAction(ActionID.BattleLitany, ActionOption.Buff)
{
ActionCheck = (b, m) => IsLongerThan(10),
};
#endregion

#region Traits
Expand Down
11 changes: 9 additions & 2 deletions RotationSolver.Basic/Rotations/Basic/DRK_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,19 @@ protected static bool ShadowTimeEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction BloodWeapon { get; } = new BaseAction(ActionID.BloodWeapon);
public static IBaseAction BloodWeapon { get; } = new BaseAction(ActionID.BloodWeapon)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
/// </summary>
public static IBaseAction Delirium { get; } = new BaseAction(ActionID.Delirium);
public static IBaseAction Delirium { get; } = new BaseAction(ActionID.Delirium)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

#endregion

#region Traits
Expand Down
5 changes: 4 additions & 1 deletion RotationSolver.Basic/Rotations/Basic/GNB_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ public abstract class GNB_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction NoMercy { get; } = new BaseAction(ActionID.NoMercy);
public static IBaseAction NoMercy { get; } = new BaseAction(ActionID.NoMercy)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
Expand Down
13 changes: 10 additions & 3 deletions RotationSolver.Basic/Rotations/Basic/MCH_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,17 @@ protected static bool OverheatedEndAfterGCD(uint gctCount = 0, float offset = 0)
/// </summary>
public static IBaseAction Hypercharge { get; } = new BaseAction(ActionID.Hypercharge)
{
ActionCheck = (b, m) => !JobGauge.IsOverheated && JobGauge.Heat >= 50,
ActionCheck = (b, m) => !JobGauge.IsOverheated && JobGauge.Heat >= 50
&& IsLongerThan(8),
};

/// <summary>
///
/// </summary>
public static IBaseAction Wildfire { get; } = new BaseAction(ActionID.Wildfire);
public static IBaseAction Wildfire { get; } = new BaseAction(ActionID.Wildfire)
{
ActionCheck = (b, m) => IsLongerThan(8),
};

/// <summary>
///
Expand All @@ -188,7 +192,10 @@ protected static bool OverheatedEndAfterGCD(uint gctCount = 0, float offset = 0)
/// <summary>
///
/// </summary>
public static IBaseAction QueenOverdrive { get; } = new BaseAction(ActionID.QueenOverdrive);
public static IBaseAction QueenOverdrive { get; } = new BaseAction(ActionID.QueenOverdrive)
{
ActionCheck = (b, m) => IsLongerThan(8),
};

/// <summary>
///
Expand Down
24 changes: 18 additions & 6 deletions RotationSolver.Basic/Rotations/Basic/MNK_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ public abstract class MNK_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Mantra { get; } = new BaseAction(ActionID.Mantra, ActionOption.Heal);
public static IBaseAction Mantra { get; } = new BaseAction(ActionID.Mantra, ActionOption.Heal)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
Expand All @@ -173,14 +176,17 @@ public abstract class MNK_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction RiddleOfWind { get; } = new BaseAction(ActionID.RiddleOfWind);
public static IBaseAction RiddleOfWind { get; } = new BaseAction(ActionID.RiddleOfWind)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
/// </summary>
public static IBaseAction PerfectBalance { get; } = new BaseAction(ActionID.PerfectBalance)
{
ActionCheck = (b, m) => InCombat,
ActionCheck = (b, m) => InCombat && IsLongerThan(5),
};

/// <summary>
Expand All @@ -199,12 +205,18 @@ public abstract class MNK_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Brotherhood { get; } = new BaseAction(ActionID.Brotherhood, ActionOption.Buff);
public static IBaseAction Brotherhood { get; } = new BaseAction(ActionID.Brotherhood, ActionOption.Buff)
{
ActionCheck = (b, m) => IsLongerThan(10)
};

/// <summary>
///
/// </summary>
public static IBaseAction RiddleOfFire { get; } = new BaseAction(ActionID.RiddleOfFire);
public static IBaseAction RiddleOfFire { get; } = new BaseAction(ActionID.RiddleOfFire)
{
ActionCheck = (b, m) => IsLongerThan(10)
};
#endregion

#region Traits
Expand Down Expand Up @@ -292,8 +304,8 @@ public abstract class MNK_Base : CustomRotation
ChoiceTarget = TargetFilter.FindTargetForMoving,
};

[RotationDesc(ActionID.Thunderclap)]
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
[RotationDesc(ActionID.Thunderclap)]
protected sealed override bool MoveForwardAbility(out IAction act)
{
if (Thunderclap.CanUse(out act)) return true;
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver.Basic/Rotations/Basic/NIN_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ protected static bool HutonEndAfterGCD(uint gctCount = 0, float offset = 0)
/// </summary>
public static IBaseAction Mug { get; } = new BaseAction(ActionID.Mug)
{
ActionCheck = (b, m) => JobGauge.Ninki <= 60,
ActionCheck = (b, m) => JobGauge.Ninki <= 60 && IsLongerThan(10),
};

/// <summary>
Expand All @@ -184,6 +184,7 @@ protected static bool HutonEndAfterGCD(uint gctCount = 0, float offset = 0)
public static IBaseAction TrickAttack { get; } = new BaseAction(ActionID.TrickAttack)
{
StatusNeed = new StatusID[] { StatusID.Suiton, StatusID.Hidden },
ActionCheck = (b, m) =>IsLongerThan(10),
};

/// <summary>
Expand Down
10 changes: 8 additions & 2 deletions RotationSolver.Basic/Rotations/Basic/PLD_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,18 @@ public abstract class PLD_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Requiescat { get; } = new BaseAction(ActionID.Requiescat, ActionOption.Buff);
public static IBaseAction Requiescat { get; } = new BaseAction(ActionID.Requiescat, ActionOption.Buff)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
/// </summary>
public static IBaseAction FightOrFlight { get; } = new BaseAction(ActionID.FightOrFlight, ActionOption.Buff);
public static IBaseAction FightOrFlight { get; } = new BaseAction(ActionID.FightOrFlight, ActionOption.Buff)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
Expand Down
7 changes: 5 additions & 2 deletions RotationSolver.Basic/Rotations/Basic/RDM_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,17 @@ public abstract class RDM_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Embolden { get; } = new BaseAction(ActionID.Embolden, ActionOption.Buff);
public static IBaseAction Embolden { get; } = new BaseAction(ActionID.Embolden, ActionOption.Buff)
{
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
///
/// </summary>
public static IBaseAction Manafication { get; } = new BaseAction(ActionID.Manafication)
{
ActionCheck = (b, m) => WhiteMana <= 50 && BlackMana <= 50 && InCombat && ManaStacks == 0,
ActionCheck = (b, m) => WhiteMana <= 50 && BlackMana <= 50 && InCombat && ManaStacks == 0 && IsLongerThan(10),
ComboIdsNot = new[] { ActionID.Riposte, ActionID.Zwerchhau, ActionID.Scorch, ActionID.Verflare, ActionID.Verholy },
};
#endregion
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver.Basic/Rotations/Basic/RPR_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ public abstract class RPR_Base : CustomRotation
/// </summary>
public static IBaseAction ArcaneCircle { get; } = new BaseAction(ActionID.ArcaneCircle, ActionOption.Buff)
{
StatusProvide = new[] { StatusID.CircleOfSacrifice, StatusID.BloodSownCircle }
StatusProvide = new[] { StatusID.CircleOfSacrifice, StatusID.BloodSownCircle },
ActionCheck = (b, m) => IsLongerThan(10),
};

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions RotationSolver.Basic/Rotations/Basic/SAM_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ public static bool IsMoonTimeLessThanFlower
public static IBaseAction MeikyoShisui { get; } = new BaseAction(ActionID.MeikyoShisui)
{
StatusProvide = new[] { StatusID.MeikyoShisui },
ActionCheck = (b, m) => IsLongerThan(8),
};

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/SCH_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public abstract class SCH_Base : CustomRotation
/// </summary>
public static IBaseAction ChainStratagem { get; } = new BaseAction(ActionID.ChainStratagem)
{
ActionCheck = (b, m) => InCombat && IsTargetBoss
ActionCheck = (b, m) => InCombat && IsTargetBoss && IsLongerThan(10),
};

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/SMN_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public override void DisplayStatus()
public static IBaseAction SearingLight { get; } = new BaseAction(ActionID.SearingLight, ActionOption.Buff)
{
StatusProvide = new[] { StatusID.SearingLight },
ActionCheck = (b, m) => InCombat,
ActionCheck = (b, m) => InCombat && IsLongerThan(15),
};

/// <summary>
Expand Down
Loading

0 comments on commit 18013ce

Please sign in to comment.