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

Commit

Permalink
fix: change macro name from EsunaShieldNorth to EsunaStanceNorth
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 15, 2023
1 parent b9e6470 commit 9aa44e6
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 60 deletions.
2 changes: 1 addition & 1 deletion RotationSolver/Commands/RSCommandType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ internal enum SpecialCommandType : byte
HealSingle,
DefenseArea,
DefenseSingle,
EsunaShieldNorth,
EsunaStanceNorth,
RaiseShirk,
MoveForward,
MoveBack,
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Helpers/StatusHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal static class StatusHelper
StatusID.AspectedBenefic, StatusID.Regen1, StatusID.Regen2, StatusID.Regen3
};

public static StatusID[] SheildStatus { get; } = new StatusID[]
public static StatusID[] TankStanceStatus { get; } = new StatusID[]
{
StatusID.Grit, StatusID.RoyalGuard, StatusID.IronWill, StatusID.Defiance
};
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Helpers/TargetFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal static BattleChara DefaultChooseFriend(IEnumerable<BattleChara> availab

availableCharas = availableCharas.GetJobCategory(JobRole.Tank);

return availableCharas.FirstOrDefault(t => t.HasStatus(false, StatusHelper.SheildStatus))
return availableCharas.FirstOrDefault(t => t.HasStatus(false, StatusHelper.TankStanceStatus))
?? availableCharas.FirstOrDefault();
}

Expand Down Expand Up @@ -139,7 +139,7 @@ internal static BattleChara FindAttackedTarget(IEnumerable<BattleChara> charas,

if (!attachedT.Any())
{
attachedT = charas.Where(tank => tank.HasStatus(false, StatusHelper.SheildStatus));
attachedT = charas.Where(tank => tank.HasStatus(false, StatusHelper.TankStanceStatus));
}

if (!attachedT.Any())
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver/Localization/EnumTranslations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ internal static class EnumTranslations
SpecialCommandType.HealSingle => LocalizationManager.RightLang.SpecialCommandType_HealSingle,
SpecialCommandType.DefenseArea => LocalizationManager.RightLang.SpecialCommandType_DefenseArea,
SpecialCommandType.DefenseSingle => LocalizationManager.RightLang.SpecialCommandType_DefenseSingle,
SpecialCommandType.EsunaShieldNorth => role switch
SpecialCommandType.EsunaStanceNorth => role switch
{
JobRole.Tank => LocalizationManager.RightLang.SpecialCommandType_Shield,
JobRole.Healer => CustomRotation.Esuna.Name,
JobRole.Melee => CustomRotation.TrueNorth.Name,
_ => nameof(SpecialCommandType.EsunaShieldNorth),
_ => nameof(SpecialCommandType.EsunaStanceNorth),
},
SpecialCommandType.RaiseShirk => role switch
{
Expand Down Expand Up @@ -152,7 +152,7 @@ internal static class EnumTranslations
SpecialCommandType.HealSingle => LocalizationManager.RightLang.Configwindow_HelpItem_HealSingle,
SpecialCommandType.DefenseArea => LocalizationManager.RightLang.Configwindow_HelpItem_DefenseArea,
SpecialCommandType.DefenseSingle => LocalizationManager.RightLang.Configwindow_HelpItem_DefenseSingle,
SpecialCommandType.EsunaShieldNorth => LocalizationManager.RightLang.Configwindow_HelpItem_EsunaShield,
SpecialCommandType.EsunaStanceNorth => LocalizationManager.RightLang.Configwindow_HelpItem_EsunaShield,
SpecialCommandType.RaiseShirk => LocalizationManager.RightLang.Configwindow_HelpItem_RaiseShirk,
SpecialCommandType.MoveForward => LocalizationManager.RightLang.Configwindow_HelpItem_MoveForward,
SpecialCommandType.MoveBack => LocalizationManager.RightLang.Configwindow_HelpItem_MoveBack,
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Rotations/Basic/BRD_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ internal abstract class BRD_Base : CustomRotation.CustomRotation
private protected override bool EmergencyAbility(byte abilityRemain, IAction nextGCD, out IAction act)
{
//有某些非常危险的状态。
if (RSCommands.SpecialType == SpecialCommandType.EsunaShieldNorth && TargetUpdater.WeakenPeople.Any() || TargetUpdater.DyingPeople.Any())
if (RSCommands.SpecialType == SpecialCommandType.EsunaStanceNorth && TargetUpdater.WeakenPeople.Any() || TargetUpdater.DyingPeople.Any())
{
if (WardensPaean.CanUse(out act, mustUse: true)) return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private bool Ability(byte abilitiesRemaining, IAction nextGCD, out IAction act,
if (ShirkOrShield(role, specialType, out act)) return true;
if (AntiKnockback(role, specialType, out act)) return true;

if (specialType == SpecialCommandType.EsunaShieldNorth && role == JobRole.Melee)
if (specialType == SpecialCommandType.EsunaStanceNorth && role == JobRole.Melee)
{
if (TrueNorth.CanUse(out act)) return true;
}
Expand Down Expand Up @@ -87,16 +87,16 @@ private bool ShirkOrShield(JobRole role, SpecialCommandType specialType, out IAc
if (Shirk.CanUse(out act)) return true;
break;

case SpecialCommandType.EsunaShieldNorth:
case SpecialCommandType.EsunaStanceNorth:
if (Shield.CanUse(out act)) return true;
break;
}

if (Service.Configuration.AutoShield)
{
if (!TargetUpdater.AllianceTanks.Any(t => t.CurrentHp != 0 && t.HasStatus(false, StatusHelper.SheildStatus)))
if (!TargetUpdater.AllianceTanks.Any(t => t.CurrentHp != 0 && t.HasStatus(false, StatusHelper.TankStanceStatus)))
{
if (!HasShield && Shield.CanUse(out act)) return true;
if (!HasTankStance && Shield.CanUse(out act)) return true;
}
}

Expand Down Expand Up @@ -164,7 +164,7 @@ private bool AutoDefense(byte abilitiesRemaining, JobRole role, bool helpDefense
&& TargetFilter.ProvokeTarget(TargetUpdater.HostileTargets, true).Count() != TargetUpdater.HostileTargets.Count())

{
if (!HasShield && Shield.CanUse(out act)) return true;
if (!HasTankStance && Shield.CanUse(out act)) return true;
if (Provoke.CanUse(out act, mustUse: true)) return true;
}

Expand All @@ -181,7 +181,7 @@ private bool AutoDefense(byte abilitiesRemaining, JobRole role, bool helpDefense
}

//Defnece himself.
if (role == JobRole.Tank && HasShield)
if (role == JobRole.Tank && HasTankStance)
{
var tarOnmeCount = TargetUpdater.TarOnMeTargets.Count();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private IAction GCD(byte abilityRemain, bool helpDefenseAOE, bool helpDefenseSin
if (helpDefenseSingle && DefenseSingleGCD(out act)) return act;

//Esuna
if ((specialType == SpecialCommandType.EsunaShieldNorth || !HasHostilesInRange || Service.Configuration.EsunaAll)
if ((specialType == SpecialCommandType.EsunaStanceNorth || !HasHostilesInRange || Service.Configuration.EsunaAll)
&& TargetUpdater.WeakenPeople.Any()
|| TargetUpdater.DyingPeople.Any())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal abstract partial class CustomRotation
/// <summary>
///
/// </summary>
internal static bool HasShield => Player?.HasStatus(true, StatusHelper.SheildStatus) ?? false;
internal static bool HasTankStance => Player?.HasStatus(true, StatusHelper.TankStanceStatus) ?? false;

/// <summary>
/// Check the player is moving, such as running, walking or jumping.
Expand Down
7 changes: 7 additions & 0 deletions RotationSolver/Rotations/RangedMagicial/BLM/BLM_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using RotationSolver.Data;
using RotationSolver.Helpers;
using RotationSolver.Rotations.Basic;
using RotationSolver.Rotations.CustomRotation;
using System.Collections.Generic;

namespace RotationSolver.Rotations.RangedMagicial.BLM;

Expand All @@ -12,6 +14,11 @@ internal class BLM_Default : BLM_Base

public override string RotationName => "Default";

public override SortedList<DescType, string> DescriptionDict => new SortedList<DescType, string>()
{
{DescType.HealSingle, $"{BetweenTheLines}, {Leylines}" }
};

private static bool NeedToGoIce
{
get
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Rotations/RangedMagicial/BLU/BLU_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private protected override bool HealAreaGCD(out IAction act)
if (BlueId == BLUID.Healer)
{
//有某些非常危险的状态。
if (RSCommands.SpecialType == SpecialCommandType.EsunaShieldNorth && TargetUpdater.WeakenPeople.Any() || TargetUpdater.DyingPeople.Any())
if (RSCommands.SpecialType == SpecialCommandType.EsunaStanceNorth && TargetUpdater.WeakenPeople.Any() || TargetUpdater.DyingPeople.Any())
{
if (Exuviation.CanUse(out act, mustUse: true)) return true;
}
Expand Down
78 changes: 38 additions & 40 deletions RotationSolver/Rotations/Tank/DRK/DRK_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@ internal sealed class DRK_Default : DRK_Base

protected override bool CanHealSingleAbility => false;

/// <summary>
/// 在4人本的道中已经聚好怪可以使用相关技能(不移动且身边有大于3只小怪)
/// </summary>
private static bool CanUseSpellInDungeonsMiddle => TargetUpdater.PartyMembers.Count() is > 1 and <= 4 && !Target.IsBoss() && !IsMoving
&& TargetUpdater.HostileTargets.GetObjectInRadius(5).Count() >= 3;

public override SortedList<DescType, string> DescriptionDict => new()
{
{DescType.Description, "If you don't want to use Provoke, please remove the tank stance." },
{DescType.HealSingle, $"{TheBlackestNight}"},
{DescType.DefenseArea, $"{DarkMissionary}"},
{DescType.DefenseSingle, $"{Oblation}, {ShadowWall}, {DarkMind}"},
Expand All @@ -39,6 +34,16 @@ private protected override IRotationConfigSet CreateConfiguration()
.SetBool("TheBlackestNight", true, "Keep 3000 MP");
}

private protected override IAction CountDownAction(float remainTime)
{
//Provoke when has Shield.
if (HasTankStance && remainTime <= 0.7 && Provoke.CanUse(out var act)) return act;
if (remainTime <= 2 && UseTincture(out act)) return act;
if (remainTime <= 3 && TheBlackestNight.CanUse(out act)) return act;
if (remainTime <= 4 && BloodWeapon.CanUse(out act)) return act;
return base.CountDownAction(remainTime);
}

private protected override bool HealSingleAbility(byte abilitiesRemaining, out IAction act)
{
if (TheBlackestNight.CanUse(out act)) return true;
Expand All @@ -54,6 +59,32 @@ private protected override bool DefenceAreaAbility(byte abilitiesRemaining, out
return false;
}

private protected override bool DefenceSingleAbility(byte abilitiesRemaining, out IAction act)
{
if (TheBlackestNight.CanUse(out act)) return true;

if (abilitiesRemaining == 2)
{
//10
if (TargetUpdater.HostileTargets.Count() > 1 && Oblation.CanUse(out act)) return true;

//30
if (ShadowWall.CanUse(out act)) return true;

//20
if (Rampart.CanUse(out act)) return true;
if (DarkMind.CanUse(out act)) return true;

//10
if(Oblation.CanUse(out act, emptyOrSkipCombo:true)) return true;
}

if (Reprisal.CanUse(out act)) return true;

act = null;
return false;
}

private protected override bool GeneralGCD(out IAction act)
{
//寂灭
Expand All @@ -70,7 +101,6 @@ private protected override bool GeneralGCD(out IAction act)
if (Blood >= 50 && BloodWeapon.WillHaveOneChargeGCD(1) || Blood >= 90 && !Player.HasStatus(true, StatusID.Delirium)) return true;

if (!Delirium.EnoughLevel) return true;

}

//AOE
Expand All @@ -83,14 +113,13 @@ private protected override bool GeneralGCD(out IAction act)
if (HardSlash.CanUse(out act)) return true;

if (RSCommands.SpecialType == SpecialCommandType.MoveForward && MoveForwardAbility(1, out act)) return true;

if (Unmend.CanUse(out act)) return true;

return false;
}
private protected override bool AttackAbility(byte abilitiesRemaining, out IAction act)
{
if (InBurst && (!IsFullParty && CanUseSpellInDungeonsMiddle || IsFullParty))
//if (InBurst && (!IsFullParty && CanUseSpellInDungeonsMiddle || IsFullParty))
{
//嗜血
if (BloodWeapon.CanUse(out act)) return true;
Expand Down Expand Up @@ -140,30 +169,6 @@ private protected override bool AttackAbility(byte abilitiesRemaining, out IActi
}


private protected override bool DefenceSingleAbility(byte abilitiesRemaining, out IAction act)
{
//上黑盾
if (TheBlackestNight.CanUse(out act)) return true;

if (abilitiesRemaining == 2)
{
//减伤10%
if (Oblation.CanUse(out act)) return true;

//减伤30%
if (ShadowWall.CanUse(out act)) return true;

//减伤20%
if (Rampart.CanUse(out act)) return true;
if (DarkMind.CanUse(out act)) return true;
}
//降低攻击
//雪仇
if (Reprisal.CanUse(out act)) return true;

act = null;
return false;
}

private bool CanUseEdgeofDarkness(out IAction act)
{
Expand All @@ -184,11 +189,4 @@ private bool CanUseEdgeofDarkness(out IAction act)

return false;
}
private protected override IAction CountDownAction(float remainTime)
{
//战斗前嗜血和血乱
if (remainTime <= 7 && Delirium.CanUse(out var act)) return act;
if (remainTime <= 5 && BloodWeapon.CanUse(out var act1)) return act1;
return base.CountDownAction(remainTime);
}
}
2 changes: 1 addition & 1 deletion RotationSolver/Rotations/Tank/PLD/PLD_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private protected override bool AttackAbility(byte abilitiesRemaining, out IActi
}
if (OathGauge == 100 && Player.CurrentHp < Player.MaxHp)//忠义已满且不满血
{
if (HasShield && Sheltron.CanUse(out act)) return true;//盾阵
if (HasTankStance && Sheltron.CanUse(out act)) return true;//盾阵

}
return false;
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Rotations/Tank/WAR/WAR_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private protected override bool AttackAbility(byte abilitiesRemaining, out IActi
}

//奶个队友啊。
if (!HasShield && NascentFlash.CanUse(out act)) return true;
if (!HasTankStance && NascentFlash.CanUse(out act)) return true;

//战嚎
if (Infuriate.CanUse(out act, emptyOrSkipCombo: true)) return true;
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Windows/RotationConfigWindow_Help.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private void DrawHelpTab()
SpecialCommandType.MoveBack.DisplayCommandHelp(getHelp: EnumTranslations.ToHelp);
ImGui.Separator();

SpecialCommandType.EsunaShieldNorth.DisplayCommandHelp(getHelp: EnumTranslations.ToHelp);
SpecialCommandType.EsunaStanceNorth.DisplayCommandHelp(getHelp: EnumTranslations.ToHelp);
ImGui.Separator();

SpecialCommandType.RaiseShirk.DisplayCommandHelp(getHelp: EnumTranslations.ToHelp);
Expand Down

0 comments on commit 9aa44e6

Please sign in to comment.