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

Commit

Permalink
fix: change the Job.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed May 25, 2023
1 parent 84065f3 commit 47f3975
Show file tree
Hide file tree
Showing 51 changed files with 164 additions and 220 deletions.
15 changes: 15 additions & 0 deletions Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,17 @@
"7439": 0.6,
"7442": 0.1,
"7447": 0.1,
"7477": 0.6,
"7478": 0.6,
"7479": 0.6,
"7480": 0.6,
"7481": 0.6,
"7482": 0.6,
"7487": 0.1,
"7489": 0.1,
"7490": 0.6,
"7495": 0.6,
"7499": 0.6,
"7503": 0.1,
"7505": 0.6,
"7506": 0.6,
Expand Down Expand Up @@ -219,6 +230,10 @@
"16478": 0.8,
"16479": 0.6,
"16480": 1.5,
"16481": 0.6,
"16482": 0.6,
"16486": 0.6,
"16487": 0.6,
"16495": 0.6,
"16496": 0.6,
"16498": 0.6,
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver.Basic/Actions/BaseAction_ActionInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using ECommons.ExcelServices;
using ECommons.GameHelpers;
using FFXIVClientStructs.FFXIV.Client.Game;

Expand Down Expand Up @@ -30,7 +31,7 @@ private bool WillCooldown
}
else
{
if ((ClassJobID)Player.Object.ClassJob.Id != ClassJobID.BlueMage
if ((Job)Player.Object.ClassJob.Id != Job.BLU
&& ChoiceTarget != TargetFilter.FindTargetForMoving
&& DataCenter.LastAction == (ActionID)AdjustedID) return false;

Expand Down
3 changes: 2 additions & 1 deletion RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Logging;
using ECommons.DalamudServices;
using ECommons.ExcelServices;
using ECommons.GameHelpers;
using FFXIVClientStructs.FFXIV.Client.Game;

Expand Down Expand Up @@ -44,7 +45,7 @@ internal static bool TankDefenseSelf(BattleChara chara, bool mustUse)
{
return DataCenter.TarOnMeTargets.Any() | mustUse;
}
internal static bool TankBreakOtherCheck(ClassJobID id)
internal static bool TankBreakOtherCheck(Job id)
{
var tankHealth = id.GetHealthForDyingTank();

Expand Down
5 changes: 3 additions & 2 deletions RotationSolver.Basic/Actions/HealPotionItem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.GameHelpers;
using ECommons.ExcelServices;
using ECommons.GameHelpers;

namespace RotationSolver.Basic.Actions;

Expand Down Expand Up @@ -28,7 +29,7 @@ public override bool CanUse(out IAction item)
{
item = null;
if (!Player.Available) return false;
var job = (ClassJobID)Player.Object.ClassJob.Id;
var job = (Job)Player.Object.ClassJob.Id;
if (Player.Object.GetHealthRatio() > job.GetHealSingleAbility() -
job.GetHealingOfTimeSubtractSingle()) return false;
if (Player.Object.MaxHp - Player.Object.CurrentHp < MaxHealHp) return false;
Expand Down
15 changes: 8 additions & 7 deletions RotationSolver.Basic/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Dalamud.Game.ClientState.GamePad;
using Dalamud.Logging;
using ECommons.DalamudServices;
using ECommons.ExcelServices;

namespace RotationSolver.Basic.Configuration;

Expand Down Expand Up @@ -91,22 +92,22 @@ public class PluginConfiguration : IPluginConfiguration
public float AlphaInFill = 0.15f;
public float MinLastAbilityAdvanced = 0.1f;

public Dictionary<ClassJobID, float> HealingOfTimeSubtractSingles { get; set; } = new Dictionary<ClassJobID, float>();
public Dictionary<Job, float> HealingOfTimeSubtractSingles { get; set; } = new Dictionary<Job, float>();

public Dictionary<ClassJobID, float> HealingOfTimeSubtractAreas { get; set; } = new Dictionary<ClassJobID, float>();
public Dictionary<ClassJobID, float> HealthAreaAbilities { get; set; } = new Dictionary<ClassJobID, float>();
public Dictionary<Job, float> HealingOfTimeSubtractAreas { get; set; } = new Dictionary<Job, float>();
public Dictionary<Job, float> HealthAreaAbilities { get; set; } = new Dictionary<Job, float>();
public float HealthAreaAbility = 0.75f;

public Dictionary<ClassJobID, float> HealthAreaSpells { get; set; } = new Dictionary<ClassJobID, float>();
public Dictionary<Job, float> HealthAreaSpells { get; set; } = new Dictionary<Job, float>();
public float HealthAreaSpell = 0.65f;

public Dictionary<ClassJobID, float> HealthSingleAbilities { get; set; } = new Dictionary<ClassJobID, float>();
public Dictionary<Job, float> HealthSingleAbilities { get; set; } = new Dictionary<Job, float>();
public float HealthSingleAbility = 0.7f;

public Dictionary<ClassJobID, float> HealthSingleSpells { get; set; } = new Dictionary<ClassJobID, float>();
public Dictionary<Job, float> HealthSingleSpells { get; set; } = new Dictionary<Job, float>();
public float HealthSingleSpell = 0.55f;

public Dictionary<ClassJobID, float> HealthForDyingTanks { get; set; } = new Dictionary<ClassJobID, float>();
public Dictionary<Job, float> HealthForDyingTanks { get; set; } = new Dictionary<Job, float>();

public float HealthTankRatio = 0.4f;
public float HealthHealerRatio = 0.4f;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
namespace RotationSolver.Basic.Configuration.RotationConfig;
using ECommons.ExcelServices;

namespace RotationSolver.Basic.Configuration.RotationConfig;

public interface IRotationConfig
{
string Name { get; }
string DisplayName { get; }
string GetValue(ClassJobID job, string rotationName);
string GetDisplayValue(ClassJobID job, string rotationName);
void SetValue(ClassJobID job, string rotationName, string value);
string GetValue(Job job, string rotationName);
string GetDisplayValue(Job job, string rotationName);
void SetValue(Job job, string rotationName, string value);
bool DoCommand(IRotationConfigSet set, string str);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace RotationSolver.Basic.Configuration.RotationConfig;
using ECommons.ExcelServices;

namespace RotationSolver.Basic.Configuration.RotationConfig;

public abstract class RotationConfigBase : IRotationConfig
{
Expand All @@ -13,17 +15,17 @@ public RotationConfigBase(string name, string value, string displayName)
DisplayName = displayName;
}

public string GetValue(ClassJobID job, string rotationName)
public string GetValue(Job job, string rotationName)
{
if (!Service.Config.RotationsConfigurations.TryGetValue((uint)job, out var jobDict)) return DefaultValue;
if (!jobDict.TryGetValue(rotationName, out var configDict)) return DefaultValue;
if (!configDict.TryGetValue(Name, out var config)) return DefaultValue;
return config;
}

public virtual string GetDisplayValue(ClassJobID job, string rotationName) => GetValue(job, rotationName);
public virtual string GetDisplayValue(Job job, string rotationName) => GetValue(job, rotationName);

public void SetValue(ClassJobID job, string rotationName, string value)
public void SetValue(Job job, string rotationName, string value)
{
if (!Service.Config.RotationsConfigurations.TryGetValue((uint)job, out var jobDict))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace RotationSolver.Basic.Configuration.RotationConfig;
using ECommons.ExcelServices;

namespace RotationSolver.Basic.Configuration.RotationConfig;

public class RotationConfigCombo : RotationConfigBase
{
Expand All @@ -8,7 +10,7 @@ public RotationConfigCombo(string name, int value, string displayName, string[]
Items = items;
}

public override string GetDisplayValue(ClassJobID job, string rotationName)
public override string GetDisplayValue(Job job, string rotationName)
{
var indexStr = base.GetDisplayValue(job, rotationName);
if (!int.TryParse(indexStr, out var index)) return Items[0];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
using System.Collections;
using ECommons.ExcelServices;
using System.Collections;

namespace RotationSolver.Basic.Configuration.RotationConfig;

public class RotationConfigSet : IRotationConfigSet
{
readonly ClassJobID _job;
readonly Job _job;
readonly string _rotationName;
public HashSet<IRotationConfig> Configs { get; } = new HashSet<IRotationConfig>(new RotationConfigComparer());

public RotationConfigSet(ClassJobID job, string rotationName)
public RotationConfigSet(Job job, string rotationName)
{
_job = job;
_rotationName = rotationName;
Expand Down
38 changes: 0 additions & 38 deletions RotationSolver.Basic/Data/ChatPayload.cs

This file was deleted.

64 changes: 0 additions & 64 deletions RotationSolver.Basic/Data/ClassJobID.cs

This file was deleted.

4 changes: 2 additions & 2 deletions RotationSolver.Basic/Data/IconSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public static void Dispose()
public static uint GetJobIcon(ICustomRotation combo)
{
IconType type = IconType.Gold;
switch (combo.Job.GetJobRole())
switch (combo.ClassJob.GetJobRole())
{
case JobRole.Tank:
type = IconType.Blue;
Expand All @@ -265,6 +265,6 @@ public static uint GetJobIcon(ICustomRotation combo)

public static uint GetJobIcon(ICustomRotation combo, IconType type)
{
return _icons[type][(uint)combo.JobIDs[0] - 1];
return _icons[type][(uint)combo.Jobs[0] - 1];
}
}
3 changes: 2 additions & 1 deletion RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Logging;
using ECommons.DalamudServices;
using ECommons.ExcelServices;
using ECommons.GameHelpers;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.Game.Fate;
Expand Down Expand Up @@ -251,7 +252,7 @@ public static float RatioOfMembersIn2minsBurst
{
foreach (var burstInfo in StatusHelper.Burst2Mins)
{
if (burstInfo.Jobs.Contains((ClassJobID)member.ClassJob.Id))
if (burstInfo.Jobs.Contains((Job)member.ClassJob.Id))
{
if (member.Level >= burstInfo.Level)
{
Expand Down
15 changes: 8 additions & 7 deletions RotationSolver.Basic/Helpers/ConfigurationHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Game.ClientState.Keys;
using ECommons.ExcelServices;

namespace RotationSolver.Basic.Helpers;

Expand Down Expand Up @@ -33,25 +34,25 @@ public record PositionalInfo(EnemyPositional Pos, byte[] Tags);

public static readonly VirtualKey[] Keys = new VirtualKey[] { VirtualKey.CONTROL, VirtualKey.SHIFT, VirtualKey.MENU };

public static float GetHealAreaAbility(this ClassJobID job)
public static float GetHealAreaAbility(this Job job)
=> Service.Config.HealthAreaAbilities.TryGetValue(job, out var value) ? value : Service.Config.HealthAreaAbility;

public static float GetHealAreaSpell(this ClassJobID job)
public static float GetHealAreaSpell(this Job job)
=> Service.Config.HealthAreaSpells.TryGetValue(job, out var value) ? value : Service.Config.HealthAreaSpell;

public static float GetHealingOfTimeSubtractArea(this ClassJobID job)
public static float GetHealingOfTimeSubtractArea(this Job job)
=> Service.Config.HealingOfTimeSubtractAreas.TryGetValue(job, out var value) ? value : HealingOfTimeSubtractAreasDefault;

public static float GetHealSingleAbility(this ClassJobID job)
public static float GetHealSingleAbility(this Job job)
=> Service.Config.HealthSingleAbilities.TryGetValue(job, out var value) ? value : Service.Config.HealthSingleAbility;

public static float GetHealSingleSpell(this ClassJobID job)
public static float GetHealSingleSpell(this Job job)
=> Service.Config.HealthSingleSpells.TryGetValue(job, out var value) ? value : Service.Config.HealthSingleSpell;

public static float GetHealingOfTimeSubtractSingle(this ClassJobID job)
public static float GetHealingOfTimeSubtractSingle(this Job job)
=> Service.Config.HealingOfTimeSubtractSingles.TryGetValue(job, out var value) ? value : HealingOfTimeSubtractSinglesDefault;

public static float GetHealthForDyingTank(this ClassJobID job)
public static float GetHealthForDyingTank(this Job job)
=> Service.Config.HealthForDyingTanks.TryGetValue(job, out var value) ? value : HealthForDyingTanksDefault;

public const float HealingOfTimeSubtractAreasDefault = 0.2f;
Expand Down
Loading

0 comments on commit 47f3975

Please sign in to comment.