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

Commit

Permalink
feat: seperate the name choice to PvE and PvP .
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Nov 9, 2023
1 parent c630525 commit 8f35bd3
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 174 deletions.
17 changes: 9 additions & 8 deletions Resources/InvincibleStatus.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
151,
198,
469,
350,
592,
385,
3054,
1240,
1302,
1303,
2413,
3052,
2413
1303,
1302,
1240,
3054,
385,
592,
350,
3039
]
4 changes: 2 additions & 2 deletions Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ClickingCount": 57846,
"SayingHelloCount": 1,
"ClickingCount": 58199,
"SayingHelloCount": 2,
"SaidUsers": []
}
3 changes: 1 addition & 2 deletions RotationSolver.Basic/Actions/BaseAction_ActionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,15 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO
act = this;

option |= OtherOption;

var mustUse = option.HasFlag(CanUseOption.MustUse);

var player = Player.Object;
if (player == null) return false;
Target = player;
AffectedTargets = Array.Empty<BattleChara>();

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

if (AutoHealCheck && IsFriendly)
{
Expand Down
14 changes: 0 additions & 14 deletions RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,6 @@ public float TimeToKill
/// </summary>
public BattleChara Target { get; private set; } = Player.Object;

/// <summary>
/// Is this action's target dead?
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Please use Target.IsDying() instead.", true)]
public bool IsTargetDying => Target?.IsDying() ?? false;

/// <summary>
/// Is this action's target is a boss?
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Please use Target.IsBossFromTTK() or Target.IsBossFromIcon() instead.", true)]
public bool IsTargetBoss => Target?.IsBossFromTTK() ?? false;

/// <inheritdoc/>
public BattleChara[] AffectedTargets { get; private set; } = Array.Empty<BattleChara>();

Expand Down
14 changes: 0 additions & 14 deletions RotationSolver.Basic/Actions/IBaseAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,6 @@ public interface IBaseAction : IAction
/// </summary>
bool IsSingleTarget { get; }

/// <summary>
/// Is target will die immediately.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Please use Target.IsDying() instead.", true)]
bool IsTargetDying { get; }

/// <summary>
/// Is target a boss.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Please use Target.IsBossFromTTK() or Target.IsBossFromIcon() instead.", true)]
bool IsTargetBoss { get; }

/// <summary>
/// How many targets are needed to use this action.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,4 @@ internal enum TargetConditionType : byte
TargetName,
ObjectEffect,
Vfx,

[Obsolete("Please use Target type instead.")]
IsBoss = IsBossFromTTK,
}
1 change: 1 addition & 0 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public void Save()
public class JobConfig
{
public string RotationChoice { get; set; }
public string PvPRotationChoice { get; set; }
public DictionConfig<JobConfigFloat, float> Floats { get; set; } = new();

public DictionConfig<JobConfigInt, int> Ints { get; set; } = new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ public interface IRotationConfigSet : IEnumerable<IRotationConfig>
/// </summary>
HashSet<IRotationConfig> Configs { get; }

/// <summary>
/// Set the double.
/// </summary>
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="displayName"></param>
/// <param name="min"></param>
/// <param name="max"></param>
/// <param name="speed"></param>
/// <returns></returns>
[Obsolete("Please use the one with types!", true)]
IRotationConfigSet SetFloat(string name, float value, string displayName, float min = 0, float max = 1, float speed = 0.002f);

/// <summary>
/// Set the float.
/// </summary>
Expand All @@ -36,16 +23,6 @@ public interface IRotationConfigSet : IEnumerable<IRotationConfig>
/// <param name="speed"></param>
IRotationConfigSet SetFloat(ConfigUnitType unit, CombatType type, string name, float value, string displayName, float min = 0, float max = 1, float speed = 0.002f);

/// <summary>
/// Set the string.
/// </summary>
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="displayName"></param>
/// <returns></returns>
[Obsolete("Please use the one with types!", true)]
IRotationConfigSet SetString(string name, string value, string displayName);

/// <summary>
/// Set the string.
/// </summary>
Expand All @@ -56,16 +33,6 @@ public interface IRotationConfigSet : IEnumerable<IRotationConfig>
/// <returns></returns>
IRotationConfigSet SetString(CombatType type, string name, string value, string displayName);

/// <summary>
/// Set the bool.
/// </summary>
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="displayName"></param>
/// <returns></returns>
[Obsolete("Please use the one with types!", true)]
IRotationConfigSet SetBool(string name, bool value, string displayName);

/// <summary>
///
/// </summary>
Expand All @@ -76,17 +43,6 @@ public interface IRotationConfigSet : IEnumerable<IRotationConfig>
/// <returns></returns>
IRotationConfigSet SetBool(CombatType type, string name, bool value, string displayName);

/// <summary>
/// Set the combo.
/// </summary>
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="displayName"></param>
/// <param name="items"></param>
/// <returns></returns>
[Obsolete("Please use the one with types!", true)]
IRotationConfigSet SetCombo(string name, int value, string displayName, params string[] items);

/// <summary>
///
/// </summary>
Expand All @@ -98,19 +54,6 @@ public interface IRotationConfigSet : IEnumerable<IRotationConfig>
/// <returns></returns>
IRotationConfigSet SetCombo(CombatType type, string name, int value, string displayName, params string[] items);

/// <summary>
/// Set the int.
/// </summary>
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="displayName"></param>
/// <param name="min"></param>
/// <param name="max"></param>
/// <param name="speed"></param>
/// <returns></returns>
[Obsolete("Please use the one with types!", true)]
IRotationConfigSet SetInt(string name, int value, string displayName, int min = 0, int max = 10, int speed = 1);

/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,61 +15,30 @@ public RotationConfigSet(Job job, string rotationName)
_rotationName = rotationName;
}

#region Set
[Obsolete("Please use the one with types!", true)]
public IRotationConfigSet SetFloat(string name, float value, string displayName, float min = 0, float max = 1, float speed = 0.002f)
{
return SetFloat(ConfigUnitType.None, CombatType.Both, name, value, displayName, min, max, speed);
}

public IRotationConfigSet SetFloat(ConfigUnitType unit, CombatType type, string name, float value, string displayName, float min = 0, float max = 1, float speed = 0.002f)
{
Configs.Add(new RotationConfigFloat(name, value, displayName, min, max, speed, unit, type));
return this;
}

[Obsolete("Please use the one with types!", true)]
public IRotationConfigSet SetString(string name, string value, string displayName)
{
return SetString(CombatType.Both, name, value, displayName);
}

public IRotationConfigSet SetString(CombatType type, string name, string value, string displayName)
{
Configs.Add(new RotationConfigString(name, value, displayName, type));
return this;
}

[Obsolete("Please use the one with types!", true)]
public IRotationConfigSet SetBool(string name, bool value, string displayName)
{
return SetBool(CombatType.Both, name, value, displayName);
}

public IRotationConfigSet SetBool(CombatType type, string name, bool value, string displayName)
{
Configs.Add(new RotationConfigBoolean(name, value, displayName, type));
return this;
}

[Obsolete("Please use the one with types!", true)]
public IRotationConfigSet SetCombo(string name, int value, string displayName, params string[] items)
{
return SetCombo(CombatType.Both, name, value, displayName, items);
}

public IRotationConfigSet SetCombo(CombatType type, string name, int value, string displayName, params string[] items)
{
Configs.Add(new RotationConfigCombo(name, value, displayName, items, type));
return this;
}

[Obsolete("Please use the one with types!", true)]
public IRotationConfigSet SetInt(string name, int value, string displayName, int min = 0, int max = 10, int speed = 1)
{
return SetInt(CombatType.Both, name, value, displayName, min, max, speed);
}

public IRotationConfigSet SetInt(CombatType type, string name, int value, string displayName, int min = 0, int max = 10, int speed = 1)
{
Configs.Add(new RotationConfigInt(name, value, displayName, min, max, speed, type));
Expand All @@ -82,7 +51,6 @@ public void SetValue(string name, string value)
if (config == null) return;
config.SetValue(_job, _rotationName, value);
}
#endregion

#region Get
public int GetCombo(string name)
Expand Down
11 changes: 0 additions & 11 deletions RotationSolver.Basic/Helpers/ObjectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,6 @@ internal static bool CanInterrupt(this BattleChara b)
/// <returns></returns>
public static bool IsDummy(this BattleChara obj) => obj?.NameId == 541;

/// <summary>
/// Is character a boss? Max HP exceeds a certain amount.
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
[Obsolete("Please use IsBossFromTTK or IsBossFromIcon instead", true)]
public static bool IsBoss(this BattleChara obj)
{
return IsBossFromTTK(obj);
}

/// <summary>
/// Is character a boss? Calculate from ttk.
/// </summary>
Expand Down
6 changes: 0 additions & 6 deletions RotationSolver.Basic/Rotations/Basic/DRG_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ protected static bool LOTDEndAfterGCD(uint gctCount = 0, float offset = 0)
/// </summary>
public static IBaseAction FullThrust { get; } = new BaseAction(ActionID.FullThrust);

/// <summary>
/// 3
/// </summary>
[Obsolete("Please use Full Thrust instead.")]
public static IBaseAction HeavensThrust { get; } = new BaseAction(ActionID.HeavensThrust);

/// <summary>
///
/// </summary>
Expand Down
7 changes: 0 additions & 7 deletions RotationSolver.Basic/Rotations/Basic/MNK_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ public abstract class MNK_Base : CustomRotation
/// </summary>
public static IBaseAction ArmOfTheDestroyer { get; } = new BaseAction(ActionID.ArmOfTheDestroyer);

/// <summary>
///
/// </summary>

[Obsolete("Please use ArmOfTheDestroyer instead.")]
public static IBaseAction ShadowOfTheDestroyer { get; } = new BaseAction(ActionID.ShadowOfTheDestroyer);

/// <summary>
///
/// </summary>
Expand Down
5 changes: 0 additions & 5 deletions RotationSolver.Basic/Rotations/Basic/PLD_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ public abstract class PLD_Base : CustomRotation
/// </summary>
public static IBaseAction SpiritsWithin { get; } = new BaseAction(ActionID.SpiritsWithin);

/// <summary>
///
/// </summary>
[Obsolete("Please use SpiritsWithin instead.")]
public static IBaseAction Expiacion { get; } = new BaseAction(ActionID.Expiacion);
#endregion

#region Attack Area
Expand Down
3 changes: 1 addition & 2 deletions RotationSolver.Basic/Rotations/CustomRotation_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace RotationSolver.Basic.Rotations;
public abstract partial class CustomRotation : ICustomRotation
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public virtual CombatType Type => CombatType.None;
public abstract CombatType Type { get; }

public abstract Job[] Jobs { get; }

Expand Down Expand Up @@ -116,5 +116,4 @@ public virtual void DisplayStatus()
/// The things on territory changed.
/// </summary>
public virtual void OnTerritoryChanged() { }

}
9 changes: 9 additions & 0 deletions RotationSolver.Basic/Rotations/CustomRotation_Invoke.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ public bool TryInvoke(out IAction newAction, out IAction gcdAction)
return false;
}

//if(DataCenter.Territory?.IsPvpZone ?? false)
//{
// if (!Type.HasFlag(CombatType.PvP)) return false;
//}
//else
//{
// if (!Type.HasFlag(CombatType.PvE)) return false;
//}

try
{
UpdateInfo();
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/CustomRotation_Medicine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ protected bool UseBurstMedicine(out IAction act, bool clippingCheck = true)
.Where(i => i.FilterGroup == 8 && i.ItemSearchCategory.Row == 43)
.Select(i => new HealPotionItem(i)).ToArray();

private bool UseHealPotion(out IAction act)
private static bool UseHealPotion(out IAction act)
{
var acts = from a in Potions
where a.CanUse(out _, true)
Expand Down
Loading

0 comments on commit 8f35bd3

Please sign in to comment.