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 ids.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 28, 2023
1 parent 3dc7156 commit 9f03e7c
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net7.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>ArchiTed</Authors>
<Version>3.2.8</Version>
<Version>3.2.8.1</Version>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU</Platforms>

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/BaseAction_ActionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO
//Is knocking back.
if (DateTime.Now > DataCenter.KnockbackStart && DateTime.Now < DataCenter.KnockbackFinished) return false;

if (DataCenter.NoPoslock && DataCenter.IsMovingOrJumping && !option.HasFlag(CanUseOption.IgnoreCastCheck)) return false;
if (DataCenter.NoPoslock && DataCenter.IsMoving && !option.HasFlag(CanUseOption.IgnoreCastCheck)) return false;
}

if (IsGeneralGCD && IsEot && IsFriendly && IActionHelper.IsLastGCD(true, this)
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private bool TargetAreaMove(float range, bool mustUse)
private bool TargetAreaFriend(float range, bool mustUse, PlayerCharacter player)
{
if (!Service.Config.GetValue(PluginConfigBool.UseGroundBeneficialAbility)) return false;
if (!Service.Config.GetValue(PluginConfigBool.UseGroundBeneficialAbilityWhenMoving) && DataCenter.IsMovingOrJumping) return false;
if (!Service.Config.GetValue(PluginConfigBool.UseGroundBeneficialAbilityWhenMoving) && DataCenter.IsMoving) return false;

var strategy = Service.Config.GetValue(PluginConfigInt.BeneficialAreaStrategy);
switch (strategy)
Expand Down
15 changes: 15 additions & 0 deletions RotationSolver.Basic/Data/StatusID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1341,4 +1341,19 @@ public enum StatusID : ushort
///
/// </summary>
MagicResistance = 942,

/// <summary>
///
/// </summary>
Exaltation = 2717,

/// <summary>
///
/// </summary>
Macrocosmos = 2718,

/// <summary>
///
/// </summary>
CollectiveUnconscious = 849,
}
2 changes: 1 addition & 1 deletion RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static TargetingType TargetingType
}
}

public static bool IsMovingOrJumping { get; internal set; }
public static bool IsMoving { get; internal set; }

internal static float StopMovingRaw { get; set; }

Expand Down
11 changes: 9 additions & 2 deletions RotationSolver.Basic/Rotations/Basic/AST_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ public abstract class AST_Base : CustomRotation
/// <summary>
///
/// </summary>
public static IBaseAction Macrocosmos { get; } = new BaseAction(ActionID.Macrocosmos, ActionOption.Heal);
public static IBaseAction Macrocosmos { get; } = new BaseAction(ActionID.Macrocosmos, ActionOption.Heal)
{
StatusProvide = new StatusID[] { StatusID.Macrocosmos }
};
#endregion

#region Defense Single
Expand All @@ -155,14 +158,18 @@ public abstract class AST_Base : CustomRotation
public static IBaseAction Exaltation { get; } = new BaseAction(ActionID.Exaltation, ActionOption.Heal)
{
ChoiceTarget = TargetFilter.FindAttackedTarget,
TargetStatus = new StatusID[] { StatusID.Exaltation },
};
#endregion

#region Defense Area
/// <summary>
///
/// </summary>
public static IBaseAction CollectiveUnconscious { get; } = new BaseAction(ActionID.CollectiveUnconscious, ActionOption.Defense);
public static IBaseAction CollectiveUnconscious { get; } = new BaseAction(ActionID.CollectiveUnconscious, ActionOption.Defense)
{
StatusProvide = new StatusID[] { StatusID.CollectiveUnconscious },
};

#endregion

Expand Down
8 changes: 4 additions & 4 deletions RotationSolver.Basic/Rotations/Basic/SAM_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static bool IsMoonTimeLessThanFlower
public static IBaseAction OgiNamikiri { get; } = new BaseAction(ActionID.OgiNamikiri)
{
StatusNeed = new[] { StatusID.OgiNamikiriReady },
ActionCheck = (b, m) => !IsMovingOrJumping
ActionCheck = (b, m) => !IsMoving
};

/// <summary>
Expand All @@ -174,7 +174,7 @@ public static bool IsMoonTimeLessThanFlower
/// </summary>
public static IBaseAction Higanbana { get; } = new BaseAction(ActionID.Higanbana, ActionOption.Dot)
{
ActionCheck = (b, m) => !IsMovingOrJumping && SenCount == 1,
ActionCheck = (b, m) => !IsMoving && SenCount == 1,
TargetStatus = new[] { StatusID.Higanbana },
TimeToDie = 40,
};
Expand All @@ -184,15 +184,15 @@ public static bool IsMoonTimeLessThanFlower
/// </summary>
public static IBaseAction TenkaGoken { get; } = new BaseAction(ActionID.TenkaGoken)
{
ActionCheck = (b, m) => !IsMovingOrJumping && SenCount == 2,
ActionCheck = (b, m) => !IsMoving && SenCount == 2,
};

/// <summary>
///
/// </summary>
public static IBaseAction MidareSetsugekka { get; } = new BaseAction(ActionID.MidareSetsugekka)
{
ActionCheck = (b, m) => !IsMovingOrJumping && SenCount == 3,
ActionCheck = (b, m) => !IsMoving && SenCount == 3,
};

/// <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 @@ -83,7 +83,7 @@ public abstract class SCH_Base : CustomRotation
/// </summary>
public static IBaseAction SacredSoil { get; } = new BaseAction(ActionID.SacredSoil, ActionOption.Heal)
{
ActionCheck = (b, m) => HasAetherflow && !IsMovingOrJumping,
ActionCheck = (b, m) => HasAetherflow && !IsMoving,
};

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Basic/WHM_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ protected static bool LilyAfterGCD(uint gcdCount = 0, float offset = 0)
/// </summary>
public static IBaseAction PresenceOfMind { get; } = new BaseAction(ActionID.PresenceOfMind, ActionOption.Buff)
{
ActionCheck = (b, m) => !IsMovingOrJumping && IsLongerThan(10),
ActionCheck = (b, m) => !IsMoving && IsLongerThan(10),
};

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/CustomRotation_Ability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private bool Ability(IAction nextGCD, out IAction act, bool helpDefenseAOE, bool
if (GeneralAbility(out act)) return true;

//Run!
if (IsMovingOrJumping && NotInCombatDelay && Service.Config.GetValue(PluginConfigBool.AutoSpeedOutOfCombat)
if (IsMoving && NotInCombatDelay && Service.Config.GetValue(PluginConfigBool.AutoSpeedOutOfCombat)
&& SpeedAbility(out act)) return true;

return false;
Expand Down
15 changes: 10 additions & 5 deletions RotationSolver.Basic/Rotations/CustomRotation_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ public override bool CanUse(out IAction act, CanUseOption option = CanUseOption.
/// </summary>
public static IBaseAction LowBlow { get; } = new RoleAction(ActionID.LowBlow, new JobRole[] { JobRole.Tank })
{
FilterForHostiles = bs => bs.Where(b =>
FilterForHostiles = bs => bs.Where((Func<BattleChara, bool>)(b =>
{
if (b.IsBoss() || IsMovingOrJumping || b.CastActionId == 0) return false;
if (b.IsBoss() || CustomRotation.IsMoving || b.CastActionId == 0) return false;

if (!b.IsCastInterruptible || Interject.IsCoolingDown) return true;
return false;
}),
})),
};

/// <summary>
Expand Down Expand Up @@ -211,8 +211,13 @@ public override bool CanUse(out IAction act, CanUseOption option = CanUseOption.
/// </summary>
public static IBaseAction Peloton { get; } = new RoleAction(ActionID.Peloton, new JobRole[] { JobRole.RangedPhysical }, ActionOption.Friendly)
{
ActionCheck = (b, m) => NotInCombatDelay && PartyMembers.GetObjectInRadius(20)
.Any(p => p.WillStatusEnd(3, false, StatusID.Peloton) && !p.InCombat()),
ActionCheck = (b, m) =>
{
if (!NotInCombatDelay) return false;
var players = PartyMembers.GetObjectInRadius(20);
if (players.Any(ObjectHelper.InCombat)) return false;
return players.Any(p => p.WillStatusEnd(3, false, StatusID.Peloton));
},
};

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/CustomRotation_GCD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private bool RaiseSpell(SpecialCommandType specialType, out IAction act, bool mu
{
return DataCenter.SetAutoStatus(AutoStatus.Raise, true);
}
else if(!IsMovingOrJumping)
else if(!IsMoving)
{
act = action;
return DataCenter.SetAutoStatus(AutoStatus.Raise, true);
Expand Down
10 changes: 2 additions & 8 deletions RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ public abstract partial class CustomRotation
/// <summary>
/// Check the player is moving, such as running, walking or jumping.
/// </summary>
public static bool IsMovingOrJumping => DataCenter.IsMovingOrJumping;

/// <summary>
/// Is moving.
/// </summary>
[Obsolete("Please use IsMovingOrJumping Instead")]
public static bool IsMoving => IsMovingOrJumping;
public static bool IsMoving => DataCenter.IsMoving;

/// <summary>
/// Is in combat.
Expand Down Expand Up @@ -487,7 +481,7 @@ public static float CombatTime
/// The time of stopping moving.
/// <br>WARNING: Do Not make this method the main of your rotation.</br>
/// </summary>
public static float StopMovingTime => IsMovingOrJumping ? 0 : DataCenter.StopMovingRaw + DataCenter.WeaponRemain;
public static float StopMovingTime => IsMoving ? 0 : DataCenter.StopMovingRaw + DataCenter.WeaponRemain;

/// <summary>
/// Time from GCD.
Expand Down
10 changes: 8 additions & 2 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
"ActionSequencer_Adjusted": "Adjusted",
"ActionSequencer_StatusSelf": "From Self",
"ActionSequencer_StatusAll": "From All",
"ActionSequencer_Delay_Description": "How many seconds do you want to delay its turning to true.",
"Action_Friendly": "Support",
"Action_Ability": "0GCD",
"Action_Attack": "Attack",
Expand Down Expand Up @@ -255,6 +256,7 @@
"TargetConditionType_HasStatus": "Has Status",
"TargetConditionType_IsDying": "Is Dying",
"TargetConditionType_IsBoss": "Is Boss",
"TargetConditionType_InCombat": "In Combat",
"TargetConditionType_Distance": "Distance",
"TargetConditionType_StatusEnd": "Status End",
"TargetConditionType_DeadTime": "Dead Time",
Expand All @@ -275,7 +277,7 @@
"DescType_MoveBackAbility": "Move Back Ability",
"DescType_SpeedAbility": "Speed Ability",
"MemberInfoName": {
"IsMoving": "Is Moving",
"IsMoving": "Is Moving or Jumping",
"HasSwift": "Has Swift",
"HasTankStance": "Has tank stance",
"InCombat": "In Combat",
Expand All @@ -291,6 +293,8 @@
"HasHostilesInRange": "Has hostiles in Range",
"NumberOfHostilesInRange": "The number of hostiles in Range",
"NumberOfHostilesInMaxRange": "The number of hostiles in max Range",
"NumberOfAllHostilesInRange": "The number of all hostiles in Range",
"NumberOfAllHostilesInMaxRange": "The number of all hostiles in max Range",
"InBurst": "In burst.",
"CanHealAreaAbility": "Can heal area ability",
"CanHealAreaSpell": "Can heal area spell",
Expand Down Expand Up @@ -500,5 +504,7 @@
"ConfigWindow_UI_StateIconSize": "State Icon size",
"ConfigWindow_UI_ShowStateIcon": "Show State Icon",
"ConfigWindow_Auto_UseGroundBeneficialAbilityWhenMoving": "Use beneficial area action when moving.",
"ConfigWindow_Auto_AutoDefenseNumber": "The count of hostiles who target on me. If it's larger than this, defense single."
"ConfigWindow_Auto_AutoDefenseNumber": "The count of hostiles who target on me. If it's larger than this, defense single.",
"ConfigWindow_Target_OnlyAttackInSight": "Only attack the targets in sight",
"ConfigWindow_Target_AngleOfSight": "The angle of your sight"
}
2 changes: 1 addition & 1 deletion RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ internal partial class Strings
public Dictionary<string, string> MemberInfoName { get; set; } = new Dictionary<string, string>()
{
#region Rotation
{ nameof(CustomRotation.IsMovingOrJumping), "Is Moving or Jumping"},
{ nameof(CustomRotation.IsMoving), "Is Moving or Jumping"},
{ nameof(CustomRotation.HasSwift), "Has Swift"},
{ nameof(CustomRotation.HasTankStance), "Has tank stance"},
{ nameof(CustomRotation.InCombat), "In Combat"},
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2030,7 +2030,7 @@ private static unsafe void DrawStatus()
{
ImGui.Text("Fate: " + DataCenter.FateId.ToString());
}
ImGui.Text("Moving: " + DataCenter.IsMovingOrJumping.ToString());
ImGui.Text("Moving: " + DataCenter.IsMoving.ToString());
ImGui.Text("Stop Moving: " + DataCenter.StopMovingRaw.ToString());

ImGui.Text("TerritoryType: " + DataCenter.TerritoryContentType.ToString());
Expand Down
8 changes: 4 additions & 4 deletions RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ private unsafe static void UpdateSlots()
static DateTime _stopMovingTime = DateTime.MinValue;
private unsafe static void UpdateMoving()
{
var last = DataCenter.IsMovingOrJumping;
DataCenter.IsMovingOrJumping = AgentMap.Instance()->IsPlayerMoving > 0 || Player.GameObject->GetHeight() > 0;
if (last && !DataCenter.IsMovingOrJumping)
var last = DataCenter.IsMoving;
DataCenter.IsMoving = AgentMap.Instance()->IsPlayerMoving > 0;
if (last && !DataCenter.IsMoving)
{
_stopMovingTime = DateTime.Now;
}
else if (DataCenter.IsMovingOrJumping)
else if (DataCenter.IsMoving)
{
_stopMovingTime = DateTime.MinValue;
}
Expand Down

0 comments on commit 9f03e7c

Please sign in to comment.