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

Commit

Permalink
Merge branch 'pr/11' into testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed Jan 2, 2024
2 parents f9d7a62 + d8894ab commit 400c59f
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 39 deletions.
6 changes: 6 additions & 0 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ public enum PluginConfigBool : byte
[Default(false)] TargetAllForFriendly,
[Default(false)] ShowCooldownWindow,

[Default(true)] UseLostActions,
[Default(false)] UseLostFlareStarOnMobs,
[Default(true)] UseLostAssassinationOnMobs,
[Default(true)] LostReflectAutoRefresh,

[Default(true)] RecordCastingArea,

[Default(true)] AutoOffAfterCombat,
Expand Down Expand Up @@ -443,6 +448,7 @@ public enum PluginConfigFloat : byte
[Default(24f, 0f, 90f), Unit(ConfigUnitType.Degree)] MoveTargetAngle,
[Default(90f, 10f, 1800f), Unit(ConfigUnitType.Seconds)] BossTimeToKill,
[Default(10f, 0f, 60f), Unit(ConfigUnitType.Seconds)] DyingTimeToKill,
[Default(15f, 0f, 1800f), Unit(ConfigUnitType.Seconds)] LostAssassinationTimeToKill,

[Default(16f, 9.6f, 96f), Unit(ConfigUnitType.Pixels)] CooldownFontSize,

Expand Down
5 changes: 4 additions & 1 deletion RotationSolver.Basic/Configuration/OtherConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public class OtherConfiguration
{ (uint) ActionID.SteelCyclone, 2},
{ (uint) ActionID.VariantSpiritDart, 1 },
{ (uint) ActionID.VariantSpiritDart2, 1 },
{ (uint) ActionID.LostRampage, 1 },
{ (uint) ActionID.LostBurst, 1 },
{ (uint) ActionID.LostFlarestar, 1 }
};

public static Dictionary<uint, float> ActionTTK = new()
Expand Down Expand Up @@ -259,4 +262,4 @@ private static void InitOne<T>(ref T value, string name, bool download = true)
}
}
#pragma warning restore CA2211
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
24 changes: 22 additions & 2 deletions RotationSolver.Basic/Data/ActionID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5208,6 +5208,21 @@ public enum ActionID : uint
/// </summary>
LostBurst = 23909,

/// <summary>
///
/// </summary>
LostProtect = 20719,

/// <summary>
///
/// </summary>
LostShell = 20710,

/// <summary>
///
/// </summary>
LostReflect = 20711,

/// <summary>
///
/// </summary>
Expand All @@ -5216,12 +5231,17 @@ public enum ActionID : uint
/// <summary>
///
/// </summary>
LostProtect = 20719,
LostFontOfPower = 20717,

/// <summary>
///
/// </summary>
LostShell = 20710,
BannerOfHonoredSacrifice = 20721,

/// <summary>
///
/// </summary>
LostAssassination = 23914,

/// <summary>
///
Expand Down
24 changes: 22 additions & 2 deletions RotationSolver.Basic/Data/StatusID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1341,23 +1341,43 @@ public enum StatusID : ushort
/// <summary>
///
/// </summary>
LostSpellforge = 2338,
SpiritOfTheBeast = 2324,

/// <summary>
///
/// </summary>
MagicalAversion = 2370,
BannerOfHonoredSacrifice = 2327,

/// <summary>
///
/// </summary>
LostReflect = 2337,

/// <summary>
///
/// </summary>
LostSpellforge = 2338,

/// <summary>
///
/// </summary>
LostSteelsting = 2339,

/// <summary>
///
/// </summary>
LostFontOfPower = 2346,

/// <summary>
///
/// </summary>
PhysicalAversion = 2369,

/// <summary>
///
/// </summary>
MagicalAversion = 2370,

/// <summary>
///
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions RotationSolver.Basic/Rotations/CustomRotation_Ability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ protected virtual bool AttackAbility(out IAction act)
if (VariantSpiritDart2.CanUse(out act, CanUseOption.MustUse)) return true;
if (VariantRampart.CanUse(out act)) return true;
if (VariantRampart2.CanUse(out act)) return true;
if (LostAssassination.CanUse(out act)) return true;
return false;
}
}
115 changes: 90 additions & 25 deletions RotationSolver.Basic/Rotations/CustomRotation_Actions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using ECommons.ExcelServices;
using RotationSolver.Basic.Traits;
using RotationSolver.Basic.Configuration;

namespace RotationSolver.Basic.Rotations;

Expand Down Expand Up @@ -98,7 +99,7 @@ public override bool CanUse(out IAction act, CanUseOption option = CanUseOption.
public static IBaseAction SecondWind { get; } = new RoleAction(ActionID.SecondWind,
new JobRole[] { JobRole.RangedPhysical, JobRole.Melee }, ActionOption.Heal)
{
ActionCheck = (b, m) => Player?.GetHealthRatio() < Service.Config.GetValue(DataCenter.Job, Configuration.JobConfigFloat.HealthSingleAbility) && InCombat,
ActionCheck = (b, m) => Player?.GetHealthRatio() < Service.Config.GetValue(DataCenter.Job, JobConfigFloat.HealthSingleAbility) && InCombat,
};

/// <summary>
Expand Down Expand Up @@ -392,8 +393,8 @@ public override bool CanUse(out IAction act, CanUseOption option = CanUseOption.
public static IBaseAction LostSpellforge { get; } = new BaseAction(ActionID.LostSpellforge,
ActionOption.DutyAction | ActionOption.Friendly)
{
StatusProvide = new StatusID[] { StatusID.LostSpellforge },
ActionCheck = (b, m) => LostSpellforge.Target?.HasStatus(false, StatusID.MagicalAversion) ?? false,
TargetStatus = new StatusID[] { StatusID.LostSpellforge },
// TargetStatusIsGlobal = true,
ChoiceTarget = (targets, mustUse) => targets.FirstOrDefault(t => (Job)t.ClassJob.Id switch
{
Job.WAR
Expand Down Expand Up @@ -421,8 +422,8 @@ or Job.RDM
public static IBaseAction LostSteelsting { get; } = new BaseAction(ActionID.LostSteelsting,
ActionOption.DutyAction | ActionOption.Friendly)
{
StatusProvide = new StatusID[] { StatusID.LostSteelsting },
ActionCheck = (b, m) => LostSteelsting.Target?.HasStatus(false, StatusID.PhysicalAversion) ?? false,
TargetStatus = new StatusID[] { StatusID.LostSteelsting },
// TargetStatusIsGlobal = true,
ChoiceTarget = (targets, mustUse) => targets.FirstOrDefault(t => (Job)t.ClassJob.Id switch
{
Job.WHM
Expand All @@ -446,21 +447,53 @@ or Job.RDM
/// <summary>
///
/// </summary>
public static IBaseAction LostRampage { get; } = new BaseAction(ActionID.LostRampage,
ActionOption.DutyAction | ActionOption.Friendly)
{
StatusProvide = new StatusID[] { StatusID.LostRampage },
ActionCheck = (b, m) => LostRampage.Target?.HasStatus(false, StatusID.PhysicalAversion) ?? false,
public static IBaseAction LostRampage { get; } = new RoleAction(
ActionID.LostRampage,
new JobRole[] { JobRole.Melee, JobRole.Tank, JobRole.RangedPhysical },
ActionOption.DutyAction | ActionOption.Eot
) {
TargetStatus = new StatusID[] { StatusID.LostRampage },
// TargetStatusIsGlobal = true,
FilterForHostiles = (targets) => targets.Where(tar =>
ObjectHelper.CanInterrupt(tar) ||
(tar.IsBossFromIcon() && tar.HasStatus(false, StatusID.PhysicalAversion)))
};

/// <summary>
///
/// </summary>
public static IBaseAction LostBurst { get; } = new BaseAction(ActionID.LostBurst,
ActionOption.DutyAction | ActionOption.Friendly)
{
StatusProvide = new StatusID[] { StatusID.LostBurst },
ActionCheck = (b, m) => LostBurst.Target?.HasStatus(false, StatusID.MagicalAversion) ?? false,
public static IBaseAction LostBurst { get; } = new RoleAction(
ActionID.LostBurst,
new JobRole[] { JobRole.Healer, JobRole.RangedMagical },
ActionOption.DutyAction | ActionOption.Eot
) {
TargetStatus = new StatusID[] { StatusID.LostBurst },
// TargetStatusIsGlobal = true,
FilterForHostiles = (targets) => targets.Where(tar =>
ObjectHelper.CanInterrupt(tar) ||
(tar.IsBossFromIcon() && tar.HasStatus(false, StatusID.MagicalAversion))),
};

/// <summary>
///
/// </summary>
public static IBaseAction LostAssassination { get; } = new RoleAction(
ActionID.LostAssassination,
new JobRole[] { JobRole.Melee, JobRole.Tank, JobRole.RangedPhysical },
ActionOption.DutyAction
) {
ActionCheck = (tar, mustUse) => {
if (tar.IsBossFromIcon()) {
// use for Lost Font of Power on bosses
return Player.HasStatus(true, StatusID.SpiritOfTheBeast) && !tar.IsDying();
} else if (Service.Config.GetValue(PluginConfigBool.UseLostAssassinationOnMobs)) {
// use to instakill tanky mobs
var ttk = Service.Config.GetValue(PluginConfigFloat.LostAssassinationTimeToKill);
return tar.FindEnemyPositional() == EnemyPositional.Rear && tar.GetTimeToKill(true) >= ttk;
}
return false;
}
};

/// <summary>
Expand All @@ -469,7 +502,8 @@ or Job.RDM
public static IBaseAction LostBravery { get; } = new BaseAction(ActionID.LostBravery,
ActionOption.DutyAction | ActionOption.Friendly)
{
StatusProvide = new StatusID[] { StatusID.LostBravery },
TargetStatus = new StatusID[] { StatusID.LostBravery },
// TargetStatusIsGlobal = true,
};

/// <summary>
Expand All @@ -478,7 +512,8 @@ or Job.RDM
public static IBaseAction LostProtect { get; } = new BaseAction(ActionID.LostProtect,
ActionOption.DutyAction | ActionOption.Friendly)
{
StatusProvide = new StatusID[] { StatusID.LostProtect, StatusID.LostProtect2 },
TargetStatus = new StatusID[] { StatusID.LostProtect, StatusID.LostProtect2 },
// TargetStatusIsGlobal = true,
};

/// <summary>
Expand All @@ -487,7 +522,8 @@ or Job.RDM
public static IBaseAction LostShell { get; } = new BaseAction(ActionID.LostShell,
ActionOption.DutyAction | ActionOption.Friendly)
{
StatusProvide = new StatusID[] { StatusID.LostShell, StatusID.LostShell2 },
TargetStatus = new StatusID[] { StatusID.LostShell, StatusID.LostShell2 },
// TargetStatusIsGlobal = true,
};

/// <summary>
Expand All @@ -496,7 +532,8 @@ or Job.RDM
public static IBaseAction LostProtect2 { get; } = new BaseAction(ActionID.LostProtect2,
ActionOption.DutyAction | ActionOption.Friendly)
{
StatusProvide = new StatusID[] { StatusID.LostProtect2 },
TargetStatus = new StatusID[] { StatusID.LostProtect2 },
// TargetStatusIsGlobal = true,
};

/// <summary>
Expand All @@ -505,7 +542,8 @@ or Job.RDM
public static IBaseAction LostShell2 { get; } = new BaseAction(ActionID.LostShell2,
ActionOption.DutyAction | ActionOption.Friendly)
{
StatusProvide = new StatusID[] { StatusID.LostShell2 },
TargetStatus = new StatusID[] { StatusID.LostShell2 },
// TargetStatusIsGlobal = true,
};

/// <summary>
Expand All @@ -514,7 +552,8 @@ or Job.RDM
public static IBaseAction LostBubble { get; } = new BaseAction(ActionID.LostBubble,
ActionOption.DutyAction | ActionOption.Friendly)
{
StatusProvide = new StatusID[] { StatusID.LostBubble },
TargetStatus = new StatusID[] { StatusID.LostBubble },
// TargetStatusIsGlobal = true,
};

/// <summary>
Expand All @@ -524,7 +563,8 @@ or Job.RDM
ActionOption.DutyAction | ActionOption.Defense)
{
ChoiceTarget = TargetFilter.FindAttackedTarget,
StatusProvide = new StatusID[] { StatusID.LostStoneskin },
TargetStatus = new StatusID[] { StatusID.LostStoneskin },
// TargetStatusIsGlobal = true,
};

/// <summary>
Expand All @@ -540,9 +580,20 @@ or Job.RDM
///
/// </summary>
public static IBaseAction LostFlarestar { get; } = new BaseAction(ActionID.LostFlarestar,
ActionOption.DutyAction)
ActionOption.DutyAction | ActionOption.Dot)
{
StatusProvide = new StatusID[] { StatusID.LostFlarestar },
FilterForHostiles = (tars) => tars.Where(t => t.IsBossFromIcon() || Service.Config.GetValue(PluginConfigBool.UseLostFlareStarOnMobs)),
TargetStatus = new StatusID[] { StatusID.LostFlarestar },
// TargetStatusIsGlobal = true,
};

/// <summary>
///
/// </summary>
public static IBaseAction LostReflect { get; } = new BaseAction(ActionID.LostReflect, ActionOption.DutyAction | ActionOption.Friendly) {
ChoiceTarget = (tars, mustUse) => tars.FirstOrDefault(b =>
b.HasStatus(true, StatusID.LostReflect) &&
b.WillStatusEndGCD(1, 0, true, StatusID.LostReflect))
};

/// <summary>
Expand All @@ -551,7 +602,21 @@ or Job.RDM
public static IBaseAction LostSeraphStrike { get; } = new BaseAction(ActionID.LostSeraphStrike,
ActionOption.DutyAction)
{
StatusProvide = new StatusID[] { StatusID.LostSeraphStrike },
TargetStatus = new StatusID[] { StatusID.LostSeraphStrike },
};

/// <summary>
///
/// </summary>
public static IBaseAction LostFontOfPower { get; } = new BaseAction(ActionID.LostFontOfPower, ActionOption.DutyAction) {
StatusProvide = new StatusID[] { StatusID.LostFontOfPower },
};

/// <summary>
///
/// </summary>
public static IBaseAction BannerOfHonoredSacrifice { get; } = new BaseAction(ActionID.BannerOfHonoredSacrifice, ActionOption.DutyAction) {
StatusProvide = new StatusID[] { StatusID.BannerOfHonoredSacrifice },
};
#endregion

Expand Down
10 changes: 2 additions & 8 deletions RotationSolver.Basic/Rotations/CustomRotation_GCD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,16 @@ private static bool EsunaAction(out IAction act, CanUseOption option = CanUseOpt
protected virtual bool EmergencyGCD(out IAction act)
{
#region Bozja
if (LostSpellforge.CanUse(out act)) return true;
if (LostSteelsting.CanUse(out act)) return true;
if (LostFlarestar.CanUse(out act)) return true;
if (LostRampage.CanUse(out act)) return true;
if (LostBurst.CanUse(out act)) return true;

if (Service.Config.GetValue(PluginConfigBool.LostReflectAutoRefresh) && LostReflect.CanUse(out act)) return true;
if (LostBravery.CanUse(out act)) return true;
if (LostBubble.CanUse(out act)) return true;
if (LostShell2.CanUse(out act)) return true;
if (LostShell.CanUse(out act)) return true;
if (LostProtect2.CanUse(out act)) return true;
if (LostProtect.CanUse(out act)) return true;

//Add your own logic here.
//if (LostFlarestar.CanUse(out act)) return true;
//if (LostSeraphStrike.CanUse(out act)) return true;

#endregion

#region PvP
Expand Down
5 changes: 5 additions & 0 deletions RotationSolver/Localization/ConfigTranslation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ internal static class ConfigTranslation
PluginConfigBool.HealWhenNothingTodo => LocalizationManager.RightLang.ConfigWindow_Param_HealWhenNothingTodo,
PluginConfigBool.UseResourcesAction => LocalizationManager.RightLang.ConfigWindow_Auto_UseResourcesAction,
PluginConfigBool.OnlyHealSelfWhenNoHealer => LocalizationManager.RightLang.ConfigWindow_Auto_OnlyHealSelfWhenNoHealer,
PluginConfigBool.UseLostActions => LocalizationManager.RightLang.ConfigWindow_Auto_UseLostActions,
PluginConfigBool.UseLostFlareStarOnMobs => LocalizationManager.RightLang.ConfigWindow_Auto_UseLostFlareStarOnMobs,
PluginConfigBool.UseLostAssassinationOnMobs => LocalizationManager.RightLang.ConfigWindow_Auto_UseLostAssassinationOnMobs,
PluginConfigBool.LostReflectAutoRefresh => LocalizationManager.RightLang.ConfigWindow_Auto_LostReflectAutoRefresh,

// target
PluginConfigBool.AddEnemyListToHostile => LocalizationManager.RightLang.ConfigWindow_Param_AddEnemyListToHostile,
Expand Down Expand Up @@ -204,6 +208,7 @@ internal static class ConfigTranslation
PluginConfigFloat.AutoHealTimeToKill => LocalizationManager.RightLang.ConfigWindow_Auto_AutoHealTimeToKill,
PluginConfigFloat.ProvokeDelayMin => LocalizationManager.RightLang.ConfigWindow_Auto_ProvokeDelay,
PluginConfigFloat.HealthForGuard => LocalizationManager.RightLang.ConfigWindow_Param_HealthForGuard,
PluginConfigFloat.LostAssassinationTimeToKill => LocalizationManager.RightLang.ConfigWindow_Auto_LostAssassinationTimeToKill,
// target
PluginConfigFloat.BossTimeToKill => LocalizationManager.RightLang.ConfigWindow_Param_BossTimeToKill,
PluginConfigFloat.DyingTimeToKill => LocalizationManager.RightLang.ConfigWindow_Param_DyingTimeToKill,
Expand Down
Loading

0 comments on commit 400c59f

Please sign in to comment.