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

Commit

Permalink
fix: fixed rotation condition IsTrue value.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Oct 23, 2023
1 parent bb27f6b commit 5b9851c
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 106 deletions.
1 change: 0 additions & 1 deletion Resources/UsersHash.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[
"Cs5AdOZTzkt2xdRfVaLw9Q==",
"cs5AdOZTzkt2xdRfVaLw9Q==",
"1jvDI83Mn8heGaogKWl1fA=="
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ internal class RotationCondition : DelayCondition
{
public ComboConditionType ComboConditionType = ComboConditionType.Float;
internal PropertyInfo _prop;
public string PropertyName = nameof(CustomRotation.CombatTime);
public string PropertyName = "Not Chosen";

MethodInfo _method;
public string MethodName = string.Empty;
public string MethodName = "Not Chosen";

internal IBaseAction _action;
public ActionID ID { get; set; } = ActionID.None;
Expand All @@ -17,13 +17,12 @@ internal class RotationCondition : DelayCondition
public int Param1;
public float Param2;


public override bool CheckBefore(ICustomRotation rotation)
{
return CheckBaseAction(rotation, ID, ref _action)
&& CheckMemberInfo(rotation, ref PropertyName, ref _prop)
&& CheckMemberInfo(rotation, ref MethodName, ref _method)
&& base.CheckBefore(rotation);
CheckBaseAction(rotation, ID, ref _action);
CheckMemberInfo(rotation, ref PropertyName, ref _prop);
CheckMemberInfo(rotation, ref MethodName, ref _method);
return base.CheckBefore(rotation);
}

public override bool IsTrueInside(ICustomRotation rotation)
Expand Down
22 changes: 10 additions & 12 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public static MajorConditionSet RightSet

public static ICustomRotation RightNowRotation { get; internal set; }


internal static bool NoPoslock => Svc.Condition[ConditionFlag.OccupiedInEvent]
|| !Service.Config.GetValue(PluginConfigBool.PoslockCasting)
//Key cancel.
Expand Down Expand Up @@ -252,30 +251,30 @@ public static void SetSpecialType(SpecialCommandType specialType)
public static IEnumerable<BattleChara> AllianceTanks { get; internal set; } = Array.Empty<PlayerCharacter>();

public static ObjectListDelay<BattleChara> DeathPeopleAll { get; } = new(
() => (Service.Config.GetValue(Configuration.PluginConfigFloat.DeathDelayMin),
Service.Config.GetValue(Configuration.PluginConfigFloat.DeathDelayMax)));
() => (Service.Config.GetValue(PluginConfigFloat.DeathDelayMin),
Service.Config.GetValue(PluginConfigFloat.DeathDelayMax)));

public static ObjectListDelay<BattleChara> DeathPeopleParty { get; } = new(
() => (Service.Config.GetValue(Configuration.PluginConfigFloat.DeathDelayMin),
Service.Config.GetValue(Configuration.PluginConfigFloat.DeathDelayMax)));
() => (Service.Config.GetValue(PluginConfigFloat.DeathDelayMin),
Service.Config.GetValue(PluginConfigFloat.DeathDelayMax)));

public static ObjectListDelay<BattleChara> WeakenPeople { get; } = new(
() => (Service.Config.GetValue(Configuration.PluginConfigFloat.WeakenDelayMin),
Service.Config.GetValue(Configuration.PluginConfigFloat.WeakenDelayMax)));
() => (Service.Config.GetValue(PluginConfigFloat.WeakenDelayMin),
Service.Config.GetValue(PluginConfigFloat.WeakenDelayMax)));

public static IEnumerable<BattleChara> DyingPeople { get; internal set; } = Array.Empty<BattleChara>();

public static ObjectListDelay<BattleChara> HostileTargets { get; } = new ObjectListDelay<BattleChara>(
() => (Service.Config.GetValue(Configuration.PluginConfigFloat.HostileDelayMin),
Service.Config.GetValue(Configuration.PluginConfigFloat.HostileDelayMax)));
() => (Service.Config.GetValue(PluginConfigFloat.HostileDelayMin),
Service.Config.GetValue(PluginConfigFloat.HostileDelayMax)));

public static IEnumerable<BattleChara> AllHostileTargets { get; internal set; } = Array.Empty<BattleChara>();

public static IEnumerable<BattleChara> TarOnMeTargets { get; internal set; } = Array.Empty<BattleChara>();

public static ObjectListDelay<BattleChara> CanInterruptTargets { get; } = new ObjectListDelay<BattleChara>(
() => (Service.Config.GetValue(Configuration.PluginConfigFloat.InterruptDelayMin),
Service.Config.GetValue(Configuration.PluginConfigFloat.InterruptDelayMax)));
() => (Service.Config.GetValue(PluginConfigFloat.InterruptDelayMin),
Service.Config.GetValue(PluginConfigFloat.InterruptDelayMax)));

public static IEnumerable<GameObject> AllTargets { get; set; }

Expand All @@ -297,7 +296,6 @@ public static void SetSpecialType(SpecialCommandType specialType)

public static bool HasPet { get; internal set; }


public static unsafe bool HasCompanion => (IntPtr)Player.BattleChara != IntPtr.Zero
&& (IntPtr)CharacterManager.Instance()->LookupBuddyByOwnerObject(Player.BattleChara) != IntPtr.Zero;

Expand Down
5 changes: 5 additions & 0 deletions RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ public abstract partial class CustomRotation
/// </summary>
public static bool HasHostilesInRange => DataCenter.HasHostilesInRange;

/// <summary>
/// Is there any hostile target in 25 yalms?
/// </summary>
public static bool HasHostilesInMaxRange => DataCenter.HasHostilesInMaxRange;

/// <summary>
/// How many hostile targets in range? 25 for ranged jobs and healer, 3 for melee and tank.
/// </summary>
Expand Down
3 changes: 1 addition & 2 deletions RotationSolver/Commands/RSCommands_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ internal static void UpdateRotationState()
CancelState();
}
else if (Service.Config.GetValue(PluginConfigBool.AutoOffBetweenArea)
&& (
Svc.Condition[ConditionFlag.BetweenAreas]
&& (Svc.Condition[ConditionFlag.BetweenAreas]
|| Svc.Condition[ConditionFlag.BetweenAreas51]))
{
CancelState();
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@
"IsTargetDying": "Is target going to die",
"IsTargetBoss": "Is target a boss",
"HasHostilesInRange": "Has hostiles in Range",
"HasHostilesInMaxRange": "Has hostiles in 25 yalms",
"NumberOfHostilesInRange": "The number of hostiles in Range",
"NumberOfHostilesInMaxRange": "The number of hostiles in max Range",
"NumberOfAllHostilesInRange": "The number of all hostiles in Range",
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ internal class Strings
{ nameof(CustomRotation.IsTargetDying), "Is target going to die"},
{ nameof(CustomRotation.IsTargetBoss), "Is target a boss"},
{ nameof(CustomRotation.HasHostilesInRange), "Has hostiles in Range"},
{ nameof(CustomRotation.HasHostilesInMaxRange), "Has hostiles in 25 yalms"},
{ nameof(CustomRotation.NumberOfHostilesInRange), "The number of hostiles in Range"},
{ nameof(CustomRotation.NumberOfHostilesInMaxRange), "The number of hostiles in max Range"},
{ nameof(CustomRotation.NumberOfAllHostilesInRange), "The number of all hostiles in Range"},
Expand Down
Loading

0 comments on commit 5b9851c

Please sign in to comment.