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

Commit

Permalink
fix: add ast counting down.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 15, 2023
1 parent 2d2f5ad commit 20ed886
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 29 deletions.
5 changes: 1 addition & 4 deletions RotationSolver/Actions/BaseAction/BaseAction_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ public bool IsEnabled

private byte CoolDownGroup { get; }

/// <summary>
/// 真实咏唱时间
/// </summary>
internal unsafe float CastTime => ActionManager.GetAdjustedCastTime(ActionType.Spell, AdjustedID) / 1000f;
public unsafe float CastTime => ActionManager.GetAdjustedCastTime(ActionType.Spell, AdjustedID) / 1000f;

internal virtual EnemyPositional EnermyPositonal
{
Expand Down
5 changes: 5 additions & 0 deletions RotationSolver/Actions/IBaseAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ internal interface IBaseAction : IAction, IEnable
/// </summary>
uint MPNeed { get; }

/// <summary>
/// Casting time
/// </summary>
float CastTime { get; }

/// <summary>
/// If combo id is on this list, this aciton will not used.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Localization/EnumTranslations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ internal static class EnumTranslations
SpecialCommandType.DefenseSingle => LocalizationManager.RightLang.SpecialCommandType_DefenseSingle,
SpecialCommandType.EsunaStanceNorth => role switch
{
JobRole.Tank => LocalizationManager.RightLang.SpecialCommandType_Shield,
JobRole.Tank => LocalizationManager.RightLang.SpecialCommandType_TankStance,
JobRole.Healer => CustomRotation.Esuna.Name,
JobRole.Melee => CustomRotation.TrueNorth.Name,
_ => nameof(SpecialCommandType.EsunaStanceNorth),
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.EsunaStanceNorth => LocalizationManager.RightLang.Configwindow_HelpItem_EsunaShield,
SpecialCommandType.EsunaStanceNorth => LocalizationManager.RightLang.Configwindow_HelpItem_Esuna,
SpecialCommandType.RaiseShirk => LocalizationManager.RightLang.Configwindow_HelpItem_RaiseShirk,
SpecialCommandType.MoveForward => LocalizationManager.RightLang.Configwindow_HelpItem_MoveForward,
SpecialCommandType.MoveBack => LocalizationManager.RightLang.Configwindow_HelpItem_MoveBack,
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"Configwindow_HelpItem_HealSingle": "Open a window to use one or more single heal.",
"Configwindow_HelpItem_DefenseArea": "Open a window to use one or more AoE defense.",
"Configwindow_HelpItem_DefenseSingle": "Open a window to use one or more single defense.",
"Configwindow_HelpItem_EsunaShield": "Open a window to use Esuna,tank stance actions or True North.",
"Configwindow_HelpItem_Esuna": "Open a window to use Esuna,tank stance actions or True North.",
"Configwindow_HelpItem_RaiseShirk": "Open a window to use Raise or Shirk.",
"Configwindow_HelpItem_AntiKnockback": "Open a window to use knockback-penalty actions.",
"Configwindow_HelpItem_Break": "Open a window to use break-combo.",
Expand Down Expand Up @@ -194,7 +194,7 @@
"SpecialCommandType_HealSingle": "Heal Single",
"SpecialCommandType_DefenseArea": "Defense Area",
"SpecialCommandType_DefenseSingle": "Defense Single",
"SpecialCommandType_Shield": "Shield",
"SpecialCommandType_TankStance": "Tank Stance",
"SpecialCommandType_MoveForward": "Move Forward",
"SpecialCommandType_MoveBack": "Move Back",
"SpecialCommandType_AntiKnockback": "Anti-Knockback",
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Localization/Strings_Major.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal partial class Strings
public string Configwindow_HelpItem_DefenseSingle { get; set; }
= "Open a window to use one or more single defense.";

public string Configwindow_HelpItem_EsunaShield { get; set; }
public string Configwindow_HelpItem_Esuna { get; set; }
= "Open a window to use Esuna,tank stance actions or True North.";

public string Configwindow_HelpItem_RaiseShirk { get; set; }
Expand Down Expand Up @@ -266,7 +266,7 @@ internal partial class Strings
public string SpecialCommandType_HealSingle { get; set; } = "Heal Single";
public string SpecialCommandType_DefenseArea { get; set; } = "Defense Area";
public string SpecialCommandType_DefenseSingle { get; set; } = "Defense Single";
public string SpecialCommandType_Shield { get; set; } = "Shield";
public string SpecialCommandType_TankStance { get; set; } = "Tank Stance";
public string SpecialCommandType_MoveForward { get; set; } = "Move Forward";
public string SpecialCommandType_MoveBack { get; set; } = "Move Back";
public string SpecialCommandType_AntiKnockback { get; set; } = "Anti-Knockback";
Expand Down
10 changes: 8 additions & 2 deletions RotationSolver/Rotations/Basic/GNB_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ internal abstract class GNB_Base : CustomRotation.CustomRotation
/// <summary>
/// 恶魔切
/// </summary>
public static IBaseAction DemonSlice { get; } = new BaseAction(ActionID.DemonSlice);
public static IBaseAction DemonSlice { get; } = new BaseAction(ActionID.DemonSlice)
{
AOECount = 2,
};

/// <summary>
/// 闪雷弹
Expand Down Expand Up @@ -98,7 +101,10 @@ internal abstract class GNB_Base : CustomRotation.CustomRotation
/// <summary>
/// 恶魔杀
/// </summary>
public static IBaseAction DemonSlaughter { get; } = new BaseAction(ActionID.DemonSlaughter);
public static IBaseAction DemonSlaughter { get; } = new BaseAction(ActionID.DemonSlaughter)
{
AOECount = 2,
};

/// <summary>
/// 极光
Expand Down
17 changes: 17 additions & 0 deletions RotationSolver/Rotations/Healer/AST/AST_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,30 @@ internal sealed class AST_Default : AST_Base
{DescType.BreakingAction, $"{Divination}"}
};

private protected override IRotationConfigSet CreateConfiguration()
=> base.CreateConfiguration()
.SetFloat("UseEarthlyStarTime", 15, "Use the Earthly Star in Count down time", 4, 20);

private static IBaseAction AspectedBeneficDefense { get; } = new BaseAction(ActionID.AspectedBenefic, true, isEot: true)
{
ChoiceTarget = TargetFilter.FindAttackedTarget,
ActionCheck = b => b.IsJobCategory(JobRole.Tank),
TargetStatus = new StatusID[] { StatusID.AspectedBenefic },
};

private protected override IAction CountDownAction(float remainTime)
{
if (remainTime < Malefic.CastTime + Service.Configuration.WeaponInterval
&& Malefic.CanUse(out var act)) return act;
if (remainTime < 3 && UseTincture(out act)) return act;
if (remainTime < 4 && AspectedBeneficDefense.CanUse(out act)) return act;
if (remainTime < Configs.GetFloat("UseEarthlyStarTime")
&& EarthlyStar.CanUse(out act)) return act;
if (remainTime < 30 && Draw.CanUse(out act)) return act;

return base.CountDownAction(remainTime);
}

private protected override bool DefenceSingleAbility(byte abilitiesRemaining, out IAction act)
{
//天星交错
Expand Down
3 changes: 1 addition & 2 deletions RotationSolver/Rotations/RangedMagicial/BLM/BLM_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@ private static bool NeedToTransposeGoIce(bool usedOne)

private protected override IRotationConfigSet CreateConfiguration()
=> base.CreateConfiguration()
.SetFloat("CountDownTime", 3.8f, "What Time to Fire3 when Counting down.", 2, 5)
.SetBool("UseTransposeForParadox", true, "Use Transpose to Fire for Paradox")
.SetBool("ExtendTimeSafely", false, "Extend Fire Element Time Safely")
.SetBool("UseN15", false, "Use N15");

private protected override IAction CountDownAction(float remainTime)
{
IAction act;
if(remainTime < Configs.GetFloat("CountDownTime"))
if(remainTime < Fire3.CastTime + Service.Configuration.WeaponInterval)
{
if (Fire3.CanUse(out act)) return act;
}
Expand Down
6 changes: 2 additions & 4 deletions RotationSolver/Rotations/Tank/DRK/DRK_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@ private bool UseBlood
}

private protected override IRotationConfigSet CreateConfiguration()
{
return base.CreateConfiguration()
=> base.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 (HasTankStance && remainTime <= Service.Configuration.WeaponInterval && 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;
Expand Down
16 changes: 5 additions & 11 deletions RotationSolver/Rotations/Tank/GNB/GNB_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ private protected override bool GeneralGCD(out IAction act)
//爆发击
if (CanUseBurstStrike(out act)) return true;

//单体三连
//如果烈牙剩0.5秒冷却好,不释放基础连击,主要因为技速不同可能会使烈牙延后太多所以判定一下
//if (GnashingFang.IsCoolDown && GnashingFang.WillHaveOneCharge(0.5f) && GnashingFang.EnoughLevel) return false;
if (SolidBarrel.CanUse(out act)) return true;
if (BrutalShell.CanUse(out act)) return true;
if (KeenEdge.CanUse(out act)) return true;
Expand All @@ -65,7 +62,6 @@ private protected override bool GeneralGCD(out IAction act)
}



private protected override bool AttackAbility(byte abilitiesRemaining, out IAction act)
{
//无情,目前只有4GCD起手的判断
Expand Down Expand Up @@ -117,20 +113,19 @@ private protected override bool DefenceSingleAbility(byte abilitiesRemaining, ou
{
if (abilitiesRemaining == 2)
{
//减伤10%)
//10
if (HeartofStone.CanUse(out act)) return true;

//星云(减伤30%)
//30
if (Nebula.CanUse(out act)) return true;

//铁壁(减伤20%)
//20
if (Rampart.CanUse(out act)) return true;

//伪装(减伤10%)
//10
if (Camouflage.CanUse(out act)) return true;
}
//降低攻击
//雪仇

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

act = null;
Expand All @@ -140,7 +135,6 @@ private protected override bool DefenceSingleAbility(byte abilitiesRemaining, ou
private protected override bool HealSingleAbility(byte abilitiesRemaining, out IAction act)
{
if (Aurora.CanUse(out act, emptyOrSkipCombo: true) && abilitiesRemaining == 1) return true;

return false;
}

Expand Down

0 comments on commit 20ed886

Please sign in to comment.