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

Commit

Permalink
feat: add a MNK Old rotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Mar 17, 2023
1 parent 2c485c9 commit 9c2aef2
Show file tree
Hide file tree
Showing 9 changed files with 232 additions and 26 deletions.
7 changes: 1 addition & 6 deletions RotationSolver.Default/Healer/WHM_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ protected override IRotationConfigSet CreateConfiguration()
public static IBaseAction RegenDefense { get; } = new BaseAction(ActionID.Regen, true, isEot: true, isTimeline: true)
{
ChoiceTarget = TargetFilter.FindAttackedTarget,
TargetStatus = new[]
{
StatusID.Regen1,
StatusID.Regen2,
StatusID.Regen3,
}
TargetStatus = Regen.TargetStatus,
};

protected override bool GeneralGCD(out IAction act)
Expand Down
30 changes: 14 additions & 16 deletions RotationSolver.Default/RotationSolver.Default.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<PlatformTarget>x64</PlatformTarget>
<DalamudLibPath>$(AppData)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
<Platforms>AnyCPU</Platforms>
<Authors>ArchiTed</Authors>
<Version>0.9.0</Version>
<PlatformTarget>x64</PlatformTarget>
<DalamudLibPath>$(AppData)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
<Platforms>AnyCPU</Platforms>
<Authors>ArchiTed</Authors>
<Version>0.9.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -41,18 +41,16 @@
<HintPath>$(DalamudLibPath)Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>

<ItemGroup>
<Using Include="Dalamud.Game.ClientState.JobGauge.Enums" />
<Using Include="RotationSolver.Actions.BaseAction" />
<Using Include="RotationSolver.Basic" />
<Using Include="RotationSolver.Basic.Actions" />
<Using Include="RotationSolver.Basic.Attributes" />
<Using Include="RotationSolver.Basic.Configuration.RotationConfig" />
<Using Include="RotationSolver.Basic.Data" />
<Using Include="RotationSolver.Basic.Helpers" />
<Using Include="RotationSolver.Basic.Rotations.Basic" />
<Using Include="Dalamud.Game.ClientState.JobGauge.Enums" />
<Using Include="RotationSolver.Actions.BaseAction" />
<Using Include="RotationSolver.Basic" />
<Using Include="RotationSolver.Basic.Actions" />
<Using Include="RotationSolver.Basic.Attributes" />
<Using Include="RotationSolver.Basic.Configuration.RotationConfig" />
<Using Include="RotationSolver.Basic.Data" />
<Using Include="RotationSolver.Basic.Helpers" />
<Using Include="RotationSolver.Basic.Rotations.Basic" />
</ItemGroup>

</Project>
148 changes: 148 additions & 0 deletions RotationSolver.Old/Melee/MNK_Old.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
namespace RotationSolver.Old.Melee;

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

public override string RotationName => "Old";

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

private bool OpoOpoForm(out IAction act)
{
if (ArmoftheDestroyer.CanUse(out act)) return true;
if (DragonKick.CanUse(out act)) return true;
if (Bootshine.CanUse(out act)) return true;
return false;
}

private 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)
{
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)
{
if (OpoOpoForm(out act)) return true;
return false;
}

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

return false;
}

protected override bool GeneralGCD(out IAction act)
{
//满了的话,放三个大招
if (!BeastChakras.Contains(BeastChakra.NONE))
{
if (HasSolar && HasLunar)
{
if (PhantomRush.CanUse(out act, mustUse: true)) return true;
if (TornadoKick.CanUse(out act, mustUse: true)) return true;
}
if (BeastChakras.Contains(BeastChakra.RAPTOR))
{
if (RisingPhoenix.CanUse(out act, mustUse: true)) return true;
if (FlintStrike.CanUse(out act, mustUse: true)) return true;
}
else
{
if (ElixirField.CanUse(out act, mustUse: true)) return true;
}
}
//有震脚就阴阳
else if (Player.HasStatus(true, StatusID.PerfectBalance))
{
if (HasSolar && LunarNadi(out act)) return true;
if (SolarNadi(out act)) return true;
}

if (Player.HasStatus(true, StatusID.CoerlForm))
{
if (CoerlForm(out act)) return true;
}
else if (Player.HasStatus(true, StatusID.RaptorForm))
{
if (RaptorForm(out act)) return true;
}
if (OpoOpoForm(out act)) return true;

if (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;
}

protected override bool AttackAbility(byte abilitiesRemaining, out IAction act)
{
if (InBurst)
{
if (RiddleofFire.CanUse(out act)) return true;
if (Brotherhood.CanUse(out act)) return true;
}

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

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

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 (RiddleofWind.CanUse(out act)) return true;

if (HowlingFist.CanUse(out act)) return true;
if (SteelPeak.CanUse(out act)) return true;
if (HowlingFist.CanUse(out act, mustUse: true)) return true;

return false;
}
}
60 changes: 60 additions & 0 deletions RotationSolver.Old/RotationSolver.Old.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<PlatformTarget>x64</PlatformTarget>
<DalamudLibPath>$(AppData)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
<Platforms>AnyCPU</Platforms>
<Authors>ArchiTed</Authors>

</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\RotationSolver.Basic\RotationSolver.Basic.csproj" />

<Reference Include="Dalamud">
<HintPath>$(DalamudLibPath)Dalamud.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ImGui.NET">
<HintPath>$(DalamudLibPath)ImGui.NET.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ImGuiScene">
<HintPath>$(DalamudLibPath)ImGuiScene.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Lumina">
<HintPath>$(DalamudLibPath)Lumina.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Lumina.Excel">
<HintPath>$(DalamudLibPath)Lumina.Excel.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="FFXIVClientStructs">
<HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>$(DalamudLibPath)Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>

<Using Include="Dalamud.Game.ClientState.JobGauge.Enums" />
<Using Include="RotationSolver.Actions.BaseAction" />
<Using Include="RotationSolver.Basic" />
<Using Include="RotationSolver.Basic.Actions" />
<Using Include="RotationSolver.Basic.Attributes" />
<Using Include="RotationSolver.Basic.Configuration.RotationConfig" />
<Using Include="RotationSolver.Basic.Data" />
<Using Include="RotationSolver.Basic.Helpers" />
<Using Include="RotationSolver.Basic.Rotations.Basic" />
</ItemGroup>
<ItemGroup>
<Folder Include="Healer\" />
<Folder Include="Magical\" />
<Folder Include="Tank\" />
<Folder Include="Ranged\" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions RotationSolver.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RotationSolver.Basic", "Rot
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RotationSolver", "RotationSolver\RotationSolver.csproj", "{99EA3D95-33DC-424F-A9E6-FE6064F11592}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RotationSolver.Old", "RotationSolver.Old\RotationSolver.Old.csproj", "{0F07FDE9-7189-43E9-8651-F1963D829DDA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -32,6 +34,10 @@ Global
{99EA3D95-33DC-424F-A9E6-FE6064F11592}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99EA3D95-33DC-424F-A9E6-FE6064F11592}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99EA3D95-33DC-424F-A9E6-FE6064F11592}.Release|Any CPU.Build.0 = Release|Any CPU
{0F07FDE9-7189-43E9-8651-F1963D829DDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F07FDE9-7189-43E9-8651-F1963D829DDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F07FDE9-7189-43E9-8651-F1963D829DDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F07FDE9-7189-43E9-8651-F1963D829DDA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Commands/RSCommands_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ internal static unsafe void DoAnAction(bool isGCD)
}

internal static void ResetSpecial() => DoSpecialCommandType(SpecialCommandType.EndSpecial, false);
internal static void CancelState()
private static void CancelState()
{
if (StateType != StateCommandType.Cancel) DoStateCommandType(StateCommandType.Cancel);
}
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/RotationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ internal static class RotationHelper
static readonly string[] _allowedAssembly = new string[]
{
DefaultAssembly,
"RotationSolver.Old",
};

public static bool IsDefault(this ICustomRotation rotation)
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/RotationSolverPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public unsafe RotationSolverPlugin(DalamudPluginInterface pluginInterface)
File.ReadAllText(Service.Interface.ConfigFile.FullName))
?? new PluginConfiguration();
}
catch()
catch
{
Service.Config = new PluginConfiguration();
}
Expand Down
2 changes: 0 additions & 2 deletions RotationSolver/Updaters/SocialUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ internal static void Enable()

static async void DutyState_DutyCompleted(object sender, ushort e)
{
RSCommands.CancelState();

if (DataCenter.PartyMembers.Count() < 2) return;

await Task.Delay(new Random().Next(4000, 6000));
Expand Down

0 comments on commit 9c2aef2

Please sign in to comment.