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

Commit

Permalink
style: changed code sytle.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Oct 27, 2023
1 parent 3619f2d commit abca46c
Show file tree
Hide file tree
Showing 89 changed files with 533 additions and 552 deletions.
8 changes: 8 additions & 0 deletions Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@
"3615": 0.1,
"3625": 0.6,
"3629": 0.6,
"3639": 0.6,
"3640": 0.6,
"3643": 0.6,
"4262": 0.6,
"4401": 0.6,
"4402": 0.6,
Expand All @@ -175,6 +178,7 @@
"7387": 0.6,
"7388": 0.6,
"7389": 0.6,
"7390": 0.6,
"7394": 0.6,
"7395": 0.6,
"7396": 0.6,
Expand Down Expand Up @@ -346,6 +350,8 @@
"16461": 0.6,
"16462": 0.6,
"16464": 0.6,
"16470": 0.6,
"16472": 0.6,
"16473": 0.6,
"16478": 0.8,
"16479": 0.6,
Expand Down Expand Up @@ -514,6 +520,8 @@
"25751": 0.6,
"25752": 0.6,
"25753": 1.15,
"25755": 0.6,
"25757": 0.6,
"25758": 0.6,
"25759": 0.6,
"25760": 0.6,
Expand Down
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ClickingCount": 24497,
"ClickingCount": 24524,
"SaidUsers": []
}
8 changes: 4 additions & 4 deletions RotationSolver.Basic/Actions/BaseAction_ActionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace RotationSolver.Basic.Actions;
public partial class BaseAction
{
/// <summary>
/// The user seted heal ratio.
/// The user set heal ratio.
/// </summary>
public float AutoHealRatio
{
Expand Down Expand Up @@ -111,7 +111,7 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO
}

if (IsFriendly && DataCenter.AverageTimeToKill < TimeToKill) return false;

if (DataCenter.DisabledActionSequencer != null && DataCenter.DisabledActionSequencer.Contains(ID)) return false;

if (!Service.Config.GetValue(PluginConfigBool.UseResourcesAction) && _option.HasFlag(ActionOption.UseResources)) return false;
Expand Down Expand Up @@ -148,7 +148,7 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO
}
}

if(!IsRealGCD)
if (!IsRealGCD)
{
if (option.HasFlag(CanUseOption.OnLastAbility))
{
Expand Down Expand Up @@ -220,7 +220,7 @@ public unsafe bool Use()

return ActionManager.Instance()->UseActionLocation(ActionType.Action, ID, Player.Object.ObjectId, &loc);
}
else if(Svc.Objects.SearchById(_targetId) == null)
else if (Svc.Objects.SearchById(_targetId) == null)
{
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver.Basic/Actions/BaseAction_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,16 @@ public BaseAction(ActionID actionID, ActionOption option = ActionOption.None)
_action = Service.GetSheet<Action>().GetRow((uint)actionID);

option &= ~(ActionOption.GeneralGCD | ActionOption.RealGCD);
if(_action.IsGeneralGCD()) option |= ActionOption.GeneralGCD;
if(_action.IsRealGCD()) option |= ActionOption.RealGCD;
if (_action.IsGeneralGCD()) option |= ActionOption.GeneralGCD;
if (_action.IsRealGCD()) option |= ActionOption.RealGCD;
_option = option;

CoolDownGroup = _action.GetCoolDownGroup();
}

internal static void CleanSpecial()
{
OtherOption = CanUseOption.None;
OtherOption = CanUseOption.None;
AutoHealCheck = SkipDisable = false;
}

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/BaseAction_Cooldown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public bool WillHaveOneChargeGCD(uint gcdCount = 0, float offset = 0)
/// </summary>
/// <param name="remain"></param>
/// <returns></returns>
public bool WillHaveOneCharge(float remain)
public bool WillHaveOneCharge(float remain)
=> HasOneCharge || RecastTimeRemainOneCharge <= remain;

unsafe RecastDetail* CoolDownDetail => ActionManager.Instance()->GetRecastGroupDetail(CoolDownGroup - 1);
Expand Down
31 changes: 14 additions & 17 deletions RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Logging;
using ECommons;
using ECommons.DalamudServices;
using ECommons.ExcelServices;
using ECommons.GameFunctions;
using ECommons.GameHelpers;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
using RotationSolver.Basic.Configuration;
using System.Runtime.InteropServices;

namespace RotationSolver.Basic.Actions;

Expand All @@ -22,7 +19,7 @@ public byte AOECount
get
{
return OtherConfiguration.ActionAOECounts.TryGetValue(ID, out var count)
? count : IsFriendly ? (byte)1 :(byte)3;
? count : IsFriendly ? (byte)1 : (byte)3;
}
set
{
Expand All @@ -34,7 +31,7 @@ public byte AOECount
/// <summary>
/// How many time does this action need the target keep in live.
/// </summary>
public float TimeToKill
public float TimeToKill
{
get
{
Expand Down Expand Up @@ -69,7 +66,7 @@ public float TimeToKill
public BattleChara Target { get; private set; } = Player.Object;

internal bool IsTargetArea => _action.TargetArea;

/// <summary>
/// The position
/// </summary>
Expand Down Expand Up @@ -260,15 +257,15 @@ private bool TargetAreaFriend(float range, bool mustUse, PlayerCharacter player)
break;

case 2: // Target
if(Svc.Targets.Target != null && Svc.Targets.Target.DistanceToPlayer() < range)
if (Svc.Targets.Target != null && Svc.Targets.Target.DistanceToPlayer() < range)
{
Position = Svc.Targets.Target.Position;
return true;
}
break;
}

if (Svc.Targets.Target is BattleChara b && b.DistanceToPlayer() < range &&
if (Svc.Targets.Target is BattleChara b && b.DistanceToPlayer() < range &&
b.IsBoss() && b.HasPositional() && b.HitboxRadius <= 8)
{
Position = b.Position;
Expand Down Expand Up @@ -393,7 +390,7 @@ private bool TargetHostile(float range, bool mustUse, int aoeCount, out BattleCh
if (Service.Config.GetValue(PluginConfigBool.ChooseAttackMark))
{
var b = MarkingHelper.GetAttackMarkChara(DataCenter.HostileTargets);
if (b != null && ChoiceTarget(GetMostObjects(TargetFilterFuncEot(new BattleChara[] { b }, mustUse), Service.Config.GetValue(PluginConfigBool.CanAttackMarkAOE) ? aoeCount : int.MaxValue), mustUse) != null)
if (b != null && ChoiceTarget(GetMostObjects(TargetFilterFuncEot(new BattleChara[] { b }, mustUse), Service.Config.GetValue(PluginConfigBool.CanAttackMarkAOE) ? aoeCount : int.MaxValue), mustUse) != null)
{
target = b;
return true;
Expand Down Expand Up @@ -427,7 +424,7 @@ private bool TargetHostileManual(BattleChara b, bool mustUse, int aoeCount, out
return true;
}

if (Service.Config.GetValue(PluginConfigBool.UseAOEAction)
if (Service.Config.GetValue(PluginConfigBool.UseAOEAction)
&& Service.Config.GetValue(PluginConfigBool.UseAOEWhenManual) || mustUse)
{
if (GetMostObjects(TargetFilterFuncEot(DataCenter.HostileTargets, mustUse), aoeCount).Contains(b))
Expand Down Expand Up @@ -461,7 +458,7 @@ private bool TargetSelf(bool mustUse, int aoeCount)

var tars = TargetFilter.GetObjectInRadius(TargetFilterFuncEot(DataCenter.HostileTargets, mustUse), EffectRange);
if (tars.Count() < aoeCount) return false;

if (Service.Config.GetValue(PluginConfigBool.NoNewHostiles) && TargetFilter.GetObjectInRadius(DataCenter.AllHostileTargets, EffectRange)
.Any(t => t.TargetObject == null)) return false;
}
Expand Down Expand Up @@ -504,11 +501,11 @@ private int CanGetTargetCount(BattleChara target, IEnumerable<BattleChara> canAt
int count = 0;
foreach (var t in canAttack)
{
if(target == t)
if (target == t)
{
count++;
}
else if(CanGetTarget(target, t))
else if (CanGetTarget(target, t))
{
count++;
}
Expand Down Expand Up @@ -539,7 +536,7 @@ internal bool CanGetTarget(BattleChara target, BattleChara subTarget)
return Vector3.Distance(target.Position, subTarget.Position) - subTarget.HitboxRadius <= EffectRange;

case 3: // Sector
if(subTarget.DistanceToPlayer() > EffectRange) return false;
if (subTarget.DistanceToPlayer() > EffectRange) return false;
tdir += dir / dir.Length() * target.HitboxRadius / (float)Math.Sin(_alpha);
return Vector3.Dot(dir, tdir) / (dir.Length() * tdir.Length()) >= Math.Cos(_alpha);

Expand Down Expand Up @@ -605,7 +602,7 @@ bool CheckStatus(BattleChara tar)

if (TargetStatus == null) return true;

return tar.WillStatusEndGCD(GetDotGcdCount?.Invoke() ?? (uint)Service.Config.GetValue(DataCenter.Job, JobConfigInt.AddDotGCDCount),
return tar.WillStatusEndGCD(GetDotGcdCount?.Invoke() ?? (uint)Service.Config.GetValue(DataCenter.Job, JobConfigInt.AddDotGCDCount),
0, true, TargetStatus);
}

Expand All @@ -627,8 +624,8 @@ private static bool NoAOE
{
if (!Service.Config.GetValue(PluginConfigBool.UseAOEAction)) return true;

return Service.Config.GetValue(PluginConfigBool.ChooseAttackMark)
&& !Service.Config.GetValue(PluginConfigBool.CanAttackMarkAOE)
return Service.Config.GetValue(PluginConfigBool.ChooseAttackMark)
&& !Service.Config.GetValue(PluginConfigBool.CanAttackMarkAOE)
&& MarkingHelper.HaveAttackChara(DataCenter.HostileTargets);
}
}
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver.Basic/Actions/BaseItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public bool IsInCooldown
/// <param name="row"></param>
/// <param name="a4"></param>
public unsafe BaseItem(uint row, uint a4 = 65535)
:this (Service.GetSheet<Item>().GetRow(row), a4)
: this(Service.GetSheet<Item>().GetRow(row), a4)
{
}

Expand Down Expand Up @@ -164,14 +164,14 @@ public virtual unsafe bool CanUse(out IAction item, bool clippingCheck = true)
if (_item == null) return false;
if (!CanUseThis) return false;
if (DataCenter.DisabledActionSequencer != null && DataCenter.DisabledActionSequencer.Contains(ID)) return false;
if(!IsEnabled) return false;
if (!IsEnabled) return false;

if (ConfigurationHelper.BadStatus.Contains(ActionManager.Instance()->GetActionStatus(ActionType.Item, ID))
&& ConfigurationHelper.BadStatus.Contains(ActionManager.Instance()->GetActionStatus(ActionType.Item, ID + 1000000))) return false;

var remain = RecastTimeOneChargeRaw - RecastTimeElapsedRaw;

if(DataCenter.WeaponRemain > 0)
if (DataCenter.WeaponRemain > 0)
{
if (DataCenter.NextAbilityToNextGCD > AnimationLockTime + DataCenter.Ping) return false;

Expand Down
4 changes: 2 additions & 2 deletions RotationSolver.Basic/Attributes/RotationDescAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public class RotationDescAttribute : Attribute
{
DescType.BurstActions => 62583,

DescType.HealAreaGCD or DescType.HealAreaAbility or
DescType.HealAreaGCD or DescType.HealAreaAbility or
DescType.HealSingleGCD or DescType.HealSingleAbility => 62582,

DescType.DefenseAreaGCD or DescType.DefenseAreaAbility or
DescType.DefenseAreaGCD or DescType.DefenseAreaAbility or
DescType.DefenseSingleGCD or DescType.DefenseSingleAbility => 62581,

DescType.MoveForwardGCD or DescType.MoveForwardAbility or
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ECommons.DalamudServices;
using ECommons.GameHelpers;
using ECommons.GameHelpers;

namespace RotationSolver.Basic.Configuration.Conditions;

Expand Down
28 changes: 14 additions & 14 deletions RotationSolver.Basic/Configuration/Conditions/MajorConditionSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ public Dictionary<uint, ConditionSet> DisableConditionDict
public Dictionary<PluginConfigBool, ConditionSet> ForceDisableConditions { get; private set; }
= new();

public ConditionSet HealAreaConditionSet { get; set; } = new ();
public ConditionSet HealSingleConditionSet { get; set; } = new ();
public ConditionSet DefenseAreaConditionSet { get; set; } = new ();
public ConditionSet DefenseSingleConditionSet { get; set; } = new ();
public ConditionSet EsunaStanceNorthConditionSet { get; set; } = new ();
public ConditionSet RaiseShirkConditionSet { get; set; } = new ();
public ConditionSet MoveForwardConditionSet { get; set; } = new ();
public ConditionSet MoveBackConditionSet { get; set; } = new ();
public ConditionSet AntiKnockbackConditionSet { get; set; } = new ();
public ConditionSet SpeedConditionSet { get; set; } = new ();

public ConditionSet SwitchAutoConditionSet { get; set; } = new ();
public ConditionSet SwitchManualConditionSet { get; set; } = new ();
public ConditionSet SwitchCancelConditionSet { get; set; } = new ();
public ConditionSet HealAreaConditionSet { get; set; } = new();
public ConditionSet HealSingleConditionSet { get; set; } = new();
public ConditionSet DefenseAreaConditionSet { get; set; } = new();
public ConditionSet DefenseSingleConditionSet { get; set; } = new();
public ConditionSet EsunaStanceNorthConditionSet { get; set; } = new();
public ConditionSet RaiseShirkConditionSet { get; set; } = new();
public ConditionSet MoveForwardConditionSet { get; set; } = new();
public ConditionSet MoveBackConditionSet { get; set; } = new();
public ConditionSet AntiKnockbackConditionSet { get; set; } = new();
public ConditionSet SpeedConditionSet { get; set; } = new();

public ConditionSet SwitchAutoConditionSet { get; set; } = new();
public ConditionSet SwitchManualConditionSet { get; set; } = new();
public ConditionSet SwitchCancelConditionSet { get; set; } = new();

public (string Name, ConditionSet Condition)[] NamedConditions { get; set; }
= Array.Empty<(string, ConditionSet)>();
Expand Down
Loading

0 comments on commit abca46c

Please sign in to comment.