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

Commit

Permalink
fix: PvP ready!
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Nov 3, 2023
1 parent e8faf66 commit 3a8fb6c
Show file tree
Hide file tree
Showing 27 changed files with 308 additions and 74 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.4.7</Version>
<Version>3.4.7.2</Version>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU</Platforms>

Expand Down
6 changes: 6 additions & 0 deletions Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,12 @@
"24305": 0.6,
"24309": 0.6,
"24310": 0.6,
"24311": 0.6,
"24312": 0.1,
"24313": 0.6,
"24315": 0.6,
"24316": 0.6,
"24317": 0.6,
"24373": 0.6,
"24374": 0.6,
"24375": 0.6,
Expand Down Expand Up @@ -589,6 +591,8 @@
"28901": 2.1,
"28917": 2.1,
"28924": 2.1,
"29054": 0.6,
"29056": 0.6,
"29223": 0.1,
"29224": 0.1,
"29226": 0.6,
Expand All @@ -601,9 +605,11 @@
"29396": 0.6,
"29397": 0.6,
"29398": 0.6,
"29399": 0.6,
"29400": 0.6,
"29401": 2.5,
"29709": 0.1,
"29711": 0.6,
"30800": 0.1,
"31323": 2.1,
"31338": 2.1,
Expand Down
9 changes: 8 additions & 1 deletion Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -451,5 +451,12 @@
35680,
35695,
35696,
35870
35870,
35732,
35457,
35476,
35725,
34943,
34921,
35113
]
3 changes: 2 additions & 1 deletion Resources/InvincibleStatus.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
469,
350,
592,
385
385,
3054
]
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ClickingCount": 43226,
"ClickingCount": 47041,
"SaidUsers": []
}
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/BaseAction_ActionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO
Target = player;

if (!SkipDisable && !IsEnabled) return false;
if (IsDutyAction && !IsDutyActionOnSlot) return false;
if (!IsOnSlot) return false;

if (AutoHealCheck && IsFriendly)
{
Expand Down
21 changes: 14 additions & 7 deletions RotationSolver.Basic/Actions/BaseAction_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,22 @@ public partial class BaseAction : IBaseAction
/// </summary>
public bool IsRealGCD => _option.HasFlag(ActionOption.RealGCD);

/// <summary>
/// Is this action a duty action.
/// </summary>
/// <inheritdoc/>
public bool IsDutyAction => _option.HasFlag(ActionOption.DutyAction);

/// <summary>
/// Is this duty action on the slot.
/// </summary>
public bool IsDutyActionOnSlot => DataCenter.DutyActions.Contains(AdjustedID);
/// <inheritdoc/>
public bool IsOnSlot
{
get
{
if (IsDutyAction)
{
return DataCenter.DutyActions.Contains(AdjustedID);
}

return _action.IsPvP == DataCenter.Territory?.IsPvpZone;
}
}

/// <summary>
/// How many gcd left to add the dot.
Expand Down
4 changes: 3 additions & 1 deletion RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,9 @@ internal bool CanGetTarget(BattleChara target, BattleChara subTarget)

case 4: //Line
if (subTarget.DistanceToPlayer() > EffectRange) return false;
return Vector3.Cross(dir, tdir).Length() / dir.Length() <= 2 + target.HitboxRadius;

return Vector3.Cross(dir, tdir).Length() / dir.Length() <= 2 + target.HitboxRadius
&& Vector3.Dot(dir, tdir) >= 0;

case 10: //Donut
var dis = Vector3.Distance(target.Position, subTarget.Position) - subTarget.HitboxRadius;
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver.Basic/Actions/IBaseAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ public interface IBaseAction : IAction
bool IsDutyAction { get; }

/// <summary>
/// Is this duty action on the slot.
/// Is this action on the slot.
/// </summary>
bool IsDutyActionOnSlot { get; }
bool IsOnSlot { get; }

/// <summary>
/// Can I use this action at this time. It will check a lot of things.
Expand Down
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Configuration/OtherConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class OtherConfiguration
{ (uint) ActionID.Overpower, 2},
{ (uint) ActionID.MythrilTempest, 2},
{ (uint) ActionID.SteelCyclone, 2},
{ (uint) ActionID.VariantSpiritDart, 1 },
{ (uint) ActionID.VariantSpiritDart2, 1 },
};

public static Dictionary<uint, float> ActionTTK = new()
Expand Down
86 changes: 79 additions & 7 deletions RotationSolver.Basic/Data/ActionID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public enum ActionID : uint
/// </summary>
None = 0,

#region Astrologian
#region AST
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -177,7 +177,7 @@ public enum ActionID : uint
Spire = 4406,
#endregion

#region BlackMage
#region BLM
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -324,7 +324,7 @@ public enum ActionID : uint
Freeze = 159,
#endregion

#region BlueMage
#region BLU
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -956,7 +956,7 @@ public enum ActionID : uint
BeingMortal = 34582,
#endregion

#region Bard
#region BRD
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -1076,9 +1076,54 @@ public enum ActionID : uint
///
/// </summary>
Troubadour = 7405,

/// <summary>
///
/// </summary>
PvP_PowerfulShot = 29391,

/// <summary>
///
/// </summary>
PvP_EmpyrealArrow = 29396,

/// <summary>
///
/// </summary>
PvP_PitchPerfect = 29392,

/// <summary>
///
/// </summary>
PvP_ApexArrow = 29393,

/// <summary>
///
/// </summary>
PvP_SilentNocturne = 29395,

/// <summary>
///
/// </summary>
PvP_RepellingShot = 29399,

/// <summary>
///
/// </summary>
PvP_TheWardensPaean = 29400,

/// <summary>
///
/// </summary>
PvP_FinalFantasia = 29401,

/// <summary>
///
/// </summary>
PvP_BlastArrow = 29394,
#endregion

#region Dancer
#region DNC
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -1235,7 +1280,7 @@ public enum ActionID : uint
Tillana = 25790,
#endregion

#region Dragoon
#region DRG
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -3450,7 +3495,7 @@ public enum ActionID : uint
Temperance = 16536,
#endregion

#region General
#region General PvE
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -3562,6 +3607,33 @@ public enum ActionID : uint
Sprint = 3,
#endregion

#region General PvP
/// <summary>
///
/// </summary>
PvP_StandardIssueElixir = 29055,

/// <summary>
///
/// </summary>
PvP_Recuperate = 29711,

/// <summary>
///
/// </summary>
PvP_Purify = 29056,

/// <summary>
///
/// </summary>
PvP_Guard = 29054,

/// <summary>
///
/// </summary>
PvP_Sprint = 29057,
#endregion

#region Variant Actions
/// <summary>
///
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 @@ -1461,4 +1461,19 @@ public enum StatusID : ushort
///
/// </summary>
MortalFlame = 3643,

/// <summary>
///
/// </summary>
PvP_Guard = 3054,

/// <summary>
///
/// </summary>
PvP_BlastArrowReady = 3142,

/// <summary>
///
/// </summary>
PvP_Repertoire = 3137,
}
10 changes: 8 additions & 2 deletions RotationSolver.Basic/Helpers/TargetFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal static BattleChara DefaultChooseFriend(IEnumerable<BattleChara> availab
?? tankTars.FirstOrDefault();
}

internal static BattleChara DefaultFindHostile(IEnumerable<BattleChara> availableCharas, bool mustUse)
internal static BattleChara DefaultFindHostile(IEnumerable<BattleChara> availableCharas, bool _)
{
if (availableCharas == null || !availableCharas.Any()) return null;

Expand Down Expand Up @@ -367,7 +367,12 @@ public static IEnumerable<T> GetObjectInRadius<T>(this IEnumerable<T> objects, f
=> objects.Where(o => o.DistanceToPlayer() <= radius);

private static IEnumerable<BattleChara> DefaultTargetingType(IEnumerable<BattleChara> charas)
=> DataCenter.TargetingType switch
{
if(DataCenter.Territory?.IsPvpZone ?? false)
{
return charas.OrderBy(p => p.CurrentHp);
}
return DataCenter.TargetingType switch
{
TargetingType.Small => charas.OrderBy(p => p.HitboxRadius),
TargetingType.HighHP => charas.OrderByDescending(p => p.CurrentHp),
Expand All @@ -376,4 +381,5 @@ private static IEnumerable<BattleChara> DefaultTargetingType(IEnumerable<BattleC
TargetingType.LowMaxHP => charas.OrderBy(p => p.MaxHp),
_ => charas.OrderByDescending(p => p.HitboxRadius),
};
}
}
Loading

0 comments on commit 3a8fb6c

Please sign in to comment.