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

Commit

Permalink
fix: add target dead time for action sequencer.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 22, 2023
1 parent e9cc997 commit 50c1514
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 42 deletions.
8 changes: 7 additions & 1 deletion RotationSolver/ActionSequencer/TargetCondition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public bool IsTrue(ICustomRotation rotation)
result = !tar.WillStatusEndGCD((uint)GCD, DistanceOrTime, FromSelf, StatusId);
break;

case TargetConditionType.DeadTime:
result = tar.GetDeadTime() > DistanceOrTime;
break;

case TargetConditionType.CastingAction:
if (string.IsNullOrEmpty(CastingActionName) || tar.CastActionId == 0)
{
Expand Down Expand Up @@ -186,6 +190,7 @@ public void Draw(ICustomRotation rotation)
case TargetConditionType.CastingActionTimeUntil:
case TargetConditionType.Distance:
case TargetConditionType.StatusEnd:
case TargetConditionType.DeadTime:
combos = new string[] { ">", "<=" };
break;
}
Expand Down Expand Up @@ -308,5 +313,6 @@ public enum TargetConditionType : byte
StatusEnd,
StatusEndGCD,
CastingAction,
CastingActionTimeUntil
CastingActionTimeUntil,
DeadTime,
}
27 changes: 1 addition & 26 deletions RotationSolver/Localization/EnumTranslations.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Dalamud.Game.ClientState.Keys;
using RotationSolver.ActionSequencer;
using RotationSolver.Commands;

namespace RotationSolver.Localization;

Expand All @@ -16,6 +15,7 @@ internal static class EnumTranslations
TargetConditionType.StatusEndGCD => LocalizationManager.RightLang.TargetConditionType_StatusEndGCD,
TargetConditionType.CastingAction => LocalizationManager.RightLang.TargetConditionType_CastingAction,
TargetConditionType.CastingActionTimeUntil => LocalizationManager.RightLang.TargetConditionType_CastingActionTimeUntil,
TargetConditionType.DeadTime => LocalizationManager.RightLang.TargetConditionType_DeadTime,
_ => string.Empty,
};

Expand All @@ -42,17 +42,6 @@ internal static class EnumTranslations
_ => string.Empty,
};

public static string ToName(this VirtualKey k) => k switch
{
VirtualKey.SHIFT => "SHIFT",
VirtualKey.CONTROL => "CTRL",
VirtualKey.MENU => "ALT",
VirtualKey.LBUTTON => "Left Mouse",
VirtualKey.MBUTTON => "Middle Mouse",
VirtualKey.RBUTTON => "Right Mouse",
_ => k.ToString(),
};

public static string ToName(this DescType type) => type switch
{
DescType.BurstActions => LocalizationManager.RightLang.DescType_BurstActions,
Expand All @@ -75,20 +64,6 @@ internal static class EnumTranslations
_ => string.Empty,
};

public static string ToName(this JobRole role) => role switch
{
JobRole.None => LocalizationManager.RightLang.JobRole_None,
JobRole.Tank => LocalizationManager.RightLang.JobRole_Tank,
JobRole.Melee => LocalizationManager.RightLang.JobRole_Melee,
JobRole.Ranged => LocalizationManager.RightLang.JobRole_Ranged,
JobRole.Healer => LocalizationManager.RightLang.JobRole_Healer,
JobRole.RangedPhysical => LocalizationManager.RightLang.JobRole_RangedPhysical,
JobRole.RangedMagical => LocalizationManager.RightLang.JobRole_RangedMagical,
JobRole.DiscipleOfTheLand => LocalizationManager.RightLang.JobRole_DiscipleOfTheLand,
JobRole.DiscipleOfTheHand => LocalizationManager.RightLang.JobRole_DiscipleOfTheHand,
_ => string.Empty,
};

public static string ToName(this TargetingType role) => role switch
{
TargetingType.Big => LocalizationManager.RightLang.TargetingType_Big,
Expand Down
14 changes: 1 addition & 13 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ internal partial class Strings
public string TargetConditionType_IsBoss { get; set; } = "Is Boss";
public string TargetConditionType_Distance { get; set; } = "Distance";
public string TargetConditionType_StatusEnd { get; set; } = "Status End";
public string TargetConditionType_DeadTime { get; set; } = "Dead Time";
public string TargetConditionType_StatusEndGCD { get; set; } = "Status End GCD";
public string TargetConditionType_CastingAction { get; set; } = "Casting Action";
public string TargetConditionType_CastingActionTimeUntil { get; set; } = "Casting Action Time Until";
Expand All @@ -396,19 +397,6 @@ internal partial class Strings

#endregion

#region JobRole
public string JobRole_None { get; set; } = "Gathering&Production";
public string JobRole_Tank { get; set; } = "Tank";
public string JobRole_Melee { get; set; } = "Melee";
public string JobRole_Ranged { get; set; } = "Ranged";
public string JobRole_Healer { get; set; } = "Healer";
public string JobRole_RangedPhysical { get; set; } = "Ranged";
public string JobRole_RangedMagical { get; set; } = "Magical";
public string JobRole_DiscipleOfTheLand { get; set; } = "Disciple of the Land";
public string JobRole_DiscipleOfTheHand { get; set; } = "Disciple of the Hand";

#endregion

public Dictionary<string, string> MemberInfoName { get; set; } = new Dictionary<string, string>()
{
#region Rotation
Expand Down
4 changes: 3 additions & 1 deletion RotationSolver/Updaters/RotationUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,9 @@ internal static ICustomRotation GetChosenRotation(CustomRotationGroup group)
var name = Service.Config.GetJobConfig(group.JobId).RotationChoice;

var rotation = group.Rotations.FirstOrDefault(r => r.GetType().FullName == name);
rotation ??= group.Rotations.FirstOrDefault(r => r.GetType().FullName.Contains("Default", StringComparison.OrdinalIgnoreCase));
rotation ??= group.Rotations.FirstOrDefault(r => r.GetType().Assembly.FullName.Contains("SupportersRotations", StringComparison.OrdinalIgnoreCase));

rotation ??= group.Rotations.FirstOrDefault(r => r.GetType().Assembly.FullName.Contains("DefaultRotations", StringComparison.OrdinalIgnoreCase));

rotation ??= group.Rotations.FirstOrDefault();

Expand Down
2 changes: 1 addition & 1 deletion XIVPainter

0 comments on commit 50c1514

Please sign in to comment.