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

Commit

Permalink
fix: try to change the default mnk.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Mar 7, 2023
1 parent 969d958 commit 2e1acf9
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 67 deletions.
3 changes: 3 additions & 0 deletions RotationSolver/Actions/BaseAction/BaseAction_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using RotationSolver.Data;
using RotationSolver.Helpers;
using RotationSolver.Localization;
using System;
using Action = Lumina.Excel.GeneratedSheets.Action;

namespace RotationSolver.Actions.BaseAction;
Expand All @@ -16,6 +17,8 @@ internal partial class BaseAction : IBaseAction
private bool ShouldEndSpecial { get; set; }
internal bool IsTimeline { get; } = false;

public Func<uint> GetDotGcdCount { private get; set; }

/// <summary>
/// EnoughLevel for using.
/// </summary>
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Actions/BaseAction/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ bool CheckStatus(BattleChara tar)

if (TargetStatus == null) return true;

return tar.WillStatusEndGCD((uint)Service.Configuration.AddDotGCDCount, 0, true, TargetStatus);
return tar.WillStatusEndGCD(GetDotGcdCount?.Invoke() ?? (uint)Service.Configuration.AddDotGCDCount,
0, true, TargetStatus);
}

unsafe bool CanTargetTo(BattleChara tar)
Expand Down
8 changes: 3 additions & 5 deletions RotationSolver/Rotations/Basic/MNK_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ internal abstract class MNK_Base : CustomRotation.CustomRotation
/// </summary>
protected static byte Chakra => JobGauge.Chakra;

/// <summary>
/// 阴阳必杀
/// </summary>
protected static Nadi Nadi => JobGauge.Nadi;
protected static bool HasSolar => (JobGauge.Nadi & Nadi.SOLAR) != 0;
protected static bool HasLunar => (JobGauge.Nadi & Nadi.LUNAR) != 0;

public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.Monk, ClassJobID.Pugilist };

Expand Down Expand Up @@ -77,6 +75,7 @@ internal abstract class MNK_Base : CustomRotation.CustomRotation
public static IBaseAction Demolish { get; } = new BaseAction(ActionID.Demolish, isEot: true)
{
TargetStatus = new StatusID[] { StatusID.Demolish },
GetDotGcdCount = () => 2,
};

/// <summary>
Expand Down Expand Up @@ -138,7 +137,6 @@ internal abstract class MNK_Base : CustomRotation.CustomRotation
/// </summary>
public static IBaseAction PerfectBalance { get; } = new BaseAction(ActionID.PerfectBalance)
{
StatusNeed = new StatusID[] { StatusID.RaptorForm },
ActionCheck = b => InCombat,
};

Expand Down
147 changes: 86 additions & 61 deletions RotationSolver/Rotations/Melee/MNK/MNK_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,27 @@
namespace RotationSolver.Rotations.Melee.MNK;

[DefaultRotation]
[RotationDesc(ActionID.RiddleofFire)]
internal sealed class MNK_Default : MNK_Base
{
public override string GameVersion => "6.0";
public override string GameVersion => "6.31";

public override string RotationName => "Default";
public override string RotationName => "LunarSolarOpener";

private protected override IRotationConfigSet CreateConfiguration()
{
return base.CreateConfiguration().SetBool("AutoFormShift", true, "Auto use FormShift");
}

private bool OpoOpoForm(out IAction act)
private protected override IAction CountDownAction(float remainTime)
{
if (remainTime < 0.2 && MoveForwardAbility(1, out var act)) return act;
if (remainTime < 15 && FormShift.CanUse(out act)) return act;

return base.CountDownAction(remainTime);
}

private static bool OpoOpoForm(out IAction act)
{
if (ArmoftheDestroyer.CanUse(out act)) return true;
if (DragonKick.CanUse(out act)) return true;
Expand All @@ -32,57 +41,48 @@ private bool OpoOpoForm(out IAction act)
}


private bool RaptorForm(out IAction act)
private static bool RaptorForm(out IAction act)
{
if (FourpointFury.CanUse(out act)) return true;

if (Player.WillStatusEndGCD(3, 0, true, StatusID.DisciplinedFist) && TwinSnakes.CanUse(out act)) return true;

if (TrueStrike.CanUse(out act)) return true;
return false;
}

private bool CoerlForm(out IAction act)
private static bool CoerlForm(out IAction act)
{
if (Rockbreaker.CanUse(out act)) return true;
if (Demolish.CanUse(out act)) return true;
if (SnapPunch.CanUse(out act)) return true;
return false;
}

private bool LunarNadi(out IAction act)
private protected override bool GeneralGCD(out IAction act)
{
if (OpoOpoForm(out act)) return true;
return false;
}
if(PerfectBalanceActions(out act)) return true;

private bool SolarNadi(out IAction act)
{
if (!BeastChakras.Contains(BeastChakra.RAPTOR))
{
if (RaptorForm(out act)) return true;
}
else if (!BeastChakras.Contains(BeastChakra.OPOOPO))
if (Player.HasStatus(true, StatusID.CoerlForm))
{
if (OpoOpoForm(out act)) return true;
if (CoerlForm(out act)) return true;
}
else
else if (Player.HasStatus(true, StatusID.RaptorForm))
{
if (CoerlForm(out act)) return true;
if (RaptorForm(out act)) return true;
}
if (OpoOpoForm(out act)) return true;

if (RSCommands.SpecialType == SpecialCommandType.MoveForward && MoveForwardAbility(1, out act)) return true;
if (Chakra < 5 && Meditation.CanUse(out act)) return true;
if (Configs.GetBool("AutoFormShift") && FormShift.CanUse(out act)) return true;

return false;
}

private protected override bool GeneralGCD(out IAction act)
static bool PerfectBalanceActions(out IAction act)
{
bool havesolar = (Nadi & Nadi.SOLAR) != 0;
bool havelunar = (Nadi & Nadi.LUNAR) != 0;

//满了的话,放三个大招
if (!BeastChakras.Contains(BeastChakra.NONE))
{
if (havesolar && havelunar)
if (HasSolar && HasLunar)
{
if (PhantomRush.CanUse(out act, mustUse: true)) return true;
if (TornadoKick.CanUse(out act, mustUse: true)) return true;
Expand All @@ -97,59 +97,84 @@ private protected override bool GeneralGCD(out IAction act)
if (ElixirField.CanUse(out act, mustUse: true)) return true;
}
}
//有震脚就阴阳
else if (Player.HasStatus(true, StatusID.PerfectBalance))
else if (Player.HasStatus(true, StatusID.PerfectBalance) && Level >= 60)
{
if (havesolar && LunarNadi(out act)) return true;
if (SolarNadi(out act)) return true;
//Some time, no choice
if (HasSolar)
{
if (LunarNadi(out act)) return true;
}
else if(BeastChakras.Contains(BeastChakra.COEURL) || BeastChakras.Contains(BeastChakra.RAPTOR))
{
if (SolarNadi(out act)) return true;
}

//Add status when solar.
if (Player.WillStatusEndGCD(3, 0, true, StatusID.DisciplinedFist)
|| Target.WillStatusEndGCD(3, 0, true, StatusID.Demolish))
{
if (SolarNadi(out act)) return true;
}
if (LunarNadi(out act)) return true;
}

if (Player.HasStatus(true, StatusID.CoerlForm))
act = null;
return false;
}

static bool LunarNadi(out IAction act)
{
if (OpoOpoForm(out act)) return true;
return false;
}

static bool SolarNadi(out IAction act)
{
//Emergency usage of status.
if (!BeastChakras.Contains(BeastChakra.RAPTOR)
&& Player.WillStatusEndGCD(1, 0, true, StatusID.DisciplinedFist))
{
if (RaptorForm(out act)) return true;
}
if (!BeastChakras.Contains(BeastChakra.COEURL)
&& Target.WillStatusEndGCD(1, 0, true, StatusID.Demolish))
{
if (CoerlForm(out act)) return true;
}
else if (Player.HasStatus(true, StatusID.RaptorForm))

if (!BeastChakras.Contains(BeastChakra.RAPTOR))
{
if (RaptorForm(out act)) return true;
}
if (OpoOpoForm(out act)) return true;

if (RSCommands.SpecialType == SpecialCommandType.MoveForward && MoveForwardAbility(1, out act)) return true;
if (Chakra < 5 && Meditation.CanUse(out act)) return true;
if (Configs.GetBool("AutoFormShift") && FormShift.CanUse(out act)) return true;
if (!BeastChakras.Contains(BeastChakra.OPOOPO))
{
if (OpoOpoForm(out act)) return true;
}
if (!BeastChakras.Contains(BeastChakra.COEURL))
{
if (CoerlForm(out act)) return true;
}

return false;
return CoerlForm(out act);
}

private protected override bool AttackAbility(byte abilitiesRemaining, out IAction act)
{
if (InBurst)
act = null;
if (abilitiesRemaining == 1 && InCombat)
{
if (RiddleofFire.CanUse(out act)) return true;
if (Brotherhood.CanUse(out act)) return true;
if (UseBurstMedicine(out act)) return true;
if (InBurst && !CombatElapsedLess(5) && RiddleofFire.CanUse(out act)) return true;
}

//震脚
if (BeastChakras.Contains(BeastChakra.NONE))
{
//有阳斗气
if ((Nadi & Nadi.SOLAR) != 0)
{
//两种Buff都在6s以上
var dis = Player.WillStatusEndGCD(3, 0, true, StatusID.DisciplinedFist);
if (CombatElapsedLess(8)) return false;

Demolish.CanUse(out _);
var demo = Demolish.Target.WillStatusEndGCD(3, 0, true, StatusID.Demolish);
if (Brotherhood.CanUse(out act)) return true;

if (!dis && (!demo || !PerfectBalance.IsCoolingDown))
{
if (PerfectBalance.CanUse(out act, emptyOrSkipCombo: true)) return true;
}
}
else
{
if (PerfectBalance.CanUse(out act, emptyOrSkipCombo: true)) return true;
}
if (BeastChakras.Contains(BeastChakra.NONE) && Player.HasStatus(true, StatusID.RaptorForm)
&& (!RiddleofFire.EnoughLevel || Player.HasStatus(false, StatusID.RiddleofFire)))
{
if (PerfectBalance.CanUse(out act, emptyOrSkipCombo: true)) return true;
}

if (RiddleofWind.CanUse(out act)) return true;
Expand Down

0 comments on commit 2e1acf9

Please sign in to comment.