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

Commit

Permalink
fix: add back the rotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jan 19, 2024
1 parent 9e1645f commit c97be9e
Show file tree
Hide file tree
Showing 29 changed files with 4,392 additions and 22 deletions.
2 changes: 2 additions & 0 deletions DefaultRotations/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[assembly: AuthorHash(Hash ="Ig4lHXUohMZNIeheUtAtRg==")]
[assembly: AssemblyLink(Donate = "https://ko-fi.com/archited", UserName = "ArchiDog1998", Repository = "FFXIVRotations")]
29 changes: 29 additions & 0 deletions DefaultRotations/DefaultRotations.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>full</DebugType>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\RotationSolver.Basic\RotationSolver.Basic.csproj" />
</ItemGroup>
<ItemGroup>

<Using Include="Dalamud.Game.ClientState.JobGauge.Enums" />
<Using Include="Dalamud.Game.ClientState.Objects.Types" />
<Using Include="Dalamud.Interface" />
<Using Include="ImGuiNET" />
<Using Include="Newtonsoft.Json" />
<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" />
<Using Include="RotationSolver.Basic.Rotations.Basic" />
<Using Include="System.Numerics" />
<Using Include="System.Reflection" />
</ItemGroup>
</Project>
242 changes: 242 additions & 0 deletions DefaultRotations/Healer/AST_Default.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
namespace DefaultRotations.Healer;

[RotationDesc(ActionID.Divination)]
[SourceCode(Path = "main/DefaultRotations/Healer/AST_Default.cs")]
public sealed class AST_Default : AST_Base
{
public override CombatType Type => CombatType.PvE;

public override string GameVersion => "6.28";

public override string RotationName => "Default";

protected override IRotationConfigSet CreateConfiguration()
=> base.CreateConfiguration()
.SetFloat(RotationSolver.Basic.Configuration.ConfigUnitType.Seconds, CombatType.PvE, "UseEarthlyStarTime", 15, "Use Earthly Star during countdown timer.", 4, 20);

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

protected override IAction CountDownAction(float remainTime)
{
if (remainTime < Malefic.CastTime + CountDownAhead
&& Malefic.CanUse(out var act, CanUseOption.IgnoreClippingCheck)) return act;
if (remainTime < 3 && UseBurstMedicine(out act)) return act;
if (remainTime < 4 && AspectedBeneficDefense.CanUse(out act, CanUseOption.IgnoreClippingCheck)) return act;
if (remainTime < Configs.GetFloat("UseEarthlyStarTime")
&& EarthlyStar.CanUse(out act, CanUseOption.IgnoreClippingCheck)) return act;
if (remainTime < 30 && Draw.CanUse(out act, CanUseOption.IgnoreClippingCheck)) return act;

return base.CountDownAction(remainTime);
}

[RotationDesc(ActionID.CelestialIntersection, ActionID.Exaltation)]
protected override bool DefenseSingleAbility(out IAction act)
{
//天星交错
if (CelestialIntersection.CanUse(out act, CanUseOption.EmptyOrSkipCombo)) return true;

//给T减伤,这个很重要。
if (Exaltation.CanUse(out act)) return true;
return base.DefenseSingleAbility(out act);
}

[RotationDesc(ActionID.Macrocosmos)]
protected override bool DefenseAreaGCD(out IAction act)
{
if (Macrocosmos.CanUse(out act)) return true;
return base.DefenseAreaGCD(out act);
}

[RotationDesc(ActionID.CollectiveUnconscious)]
protected override bool DefenseAreaAbility(out IAction act)
{
if (CollectiveUnconscious.CanUse(out act)) return true;

return base.DefenseAreaAbility(out act);
}

protected override bool GeneralGCD(out IAction act)
{
//Add AspectedBeneficwhen not in combat.
if (NotInCombatDelay && AspectedBeneficDefense.CanUse(out act)) return true;

//群体输出
if (Gravity.CanUse(out act)) return true;

//单体输出
if (Combust.CanUse(out act)) return true;
if (Malefic.CanUse(out act)) return true;
if (Combust.CanUse(out act, CanUseOption.MustUse)) return true;

return base.GeneralGCD(out act);
}

[RotationDesc(ActionID.AspectedHelios, ActionID.Helios)]
protected override bool HealAreaGCD(out IAction act)
{
//阳星相位
if (AspectedHelios.CanUse(out act)) return true;

//阳星
if (Helios.CanUse(out act)) return true;

return base.HealAreaGCD(out act);
}

protected override bool EmergencyAbility(IAction nextGCD, out IAction act)
{
if (base.EmergencyAbility(nextGCD, out act)) return true;

if (PartyHealers.Count() == 1 && Player.HasStatus(false, StatusID.Silence)
&& HasHostilesInRange && EchoDrops.CanUse(out act)) return true;

if (!InCombat) return false;

//如果要群奶了,先上个天宫图!
if (nextGCD.IsTheSameTo(true, AspectedHelios, Helios))
{
if (Horoscope.CanUse(out act)) return true;

//中间学派
if (NeutralSect.CanUse(out act)) return true;
}

//如果要单奶了,先上星位合图!
if (nextGCD.IsTheSameTo(true, Benefic, Benefic2, AspectedBenefic))
{
if (Synastry.CanUse(out act)) return true;
}
return base.EmergencyAbility(nextGCD, out act);
}

protected override bool GeneralAbility(out IAction act)
{
//如果当前还没有卡牌,那就抽一张
if (Draw.CanUse(out act)) return true;

//如果当前卡牌已经拥有了,就重抽
if (Redraw.CanUse(out act)) return true;

return base.GeneralAbility(out act);
}

[RotationDesc(ActionID.AspectedBenefic, ActionID.Benefic2, ActionID.Benefic)]
protected override bool HealSingleGCD(out IAction act)
{
//吉星相位
if (AspectedBenefic.CanUse(out act)
&& (IsMoving || AspectedBenefic.Target.GetHealthRatio() > 0.4)) return true;

//福星
if (Benefic2.CanUse(out act)) return true;

//吉星
if (Benefic.CanUse(out act)) return true;

return base.HealSingleGCD(out act);
}

protected override bool AttackAbility(out IAction act)
{
if (IsBurst && !IsMoving && Divination.CanUse(out act)) return true;

//如果当前还没有皇冠卡牌,那就抽一张
if (MinorArcana.CanUse(out act, CanUseOption.EmptyOrSkipCombo)) return true;

//如果当前还没有卡牌,那就抽一张
if (Draw.CanUse(out act, IsBurst ? CanUseOption.EmptyOrSkipCombo : CanUseOption.None)) return true;

//光速,创造更多的内插能力技的机会。
if (IsMoving && Lightspeed.CanUse(out act)) return true;


if (!IsMoving)
{
//如果没有地星也没有巨星,那就试试看能不能放个。
if (!Player.HasStatus(true, StatusID.EarthlyDominance, StatusID.GiantDominance))
{
if (EarthlyStar.CanUse(out act, CanUseOption.MustUse)) return true;
}
//加星星的进攻Buff
if (Astrodyne.CanUse(out act)) return true;
}

if (DrawnCrownCard == CardType.LORD || MinorArcana.WillHaveOneChargeGCD(1, 0))
{
//进攻牌,随便发。或者CD要转好了,赶紧发掉。
if (MinorArcana.CanUse(out act, CanUseOption.MustUse)) return true;
}

//发牌
if (Redraw.CanUse(out act)) return true;
if (PlayCard(out act)) return true;

return base.AttackAbility(out act);
}

[RotationDesc(ActionID.EssentialDignity, ActionID.CelestialIntersection, ActionID.CelestialOpposition,
ActionID.EarthlyStar, ActionID.Horoscope)]
protected override bool HealSingleAbility(out IAction act)
{
//常规奶
if (EssentialDignity.CanUse(out act)) return true;
//带盾奶
if (CelestialIntersection.CanUse(out act, CanUseOption.EmptyOrSkipCombo)) return true;

//奶量牌,要看情况。
if (DrawnCrownCard == CardType.LADY && MinorArcana.CanUse(out act, CanUseOption.MustUse)) return true;

var tank = PartyTanks;
var isBoss = Malefic.Target.IsBossFromTTK();
if (EssentialDignity.IsCoolingDown && tank.Count() == 1 && tank.Any(t => t.GetHealthRatio() < 0.5) && !isBoss)
{
//群Hot
if (CelestialOpposition.CanUse(out act)) return true;

//如果有巨星主宰
if (Player.HasStatus(true, StatusID.GiantDominance))
{
//需要回血的时候炸了。
act = EarthlyStar;
return true;
}

//天宫图
if (!Player.HasStatus(true, StatusID.HoroscopeHelios, StatusID.Horoscope) && Horoscope.CanUse(out act)) return true;
//阳星天宫图
if (Player.HasStatus(true, StatusID.HoroscopeHelios) && Horoscope.CanUse(out act)) return true;
//超紧急情况天宫图
if (tank.Any(t => t.GetHealthRatio() < 0.3) && Horoscope.CanUse(out act)) return true;
}

return base.HealSingleAbility(out act);
}

[RotationDesc(ActionID.CelestialOpposition, ActionID.EarthlyStar, ActionID.Horoscope)]
protected override bool HealAreaAbility(out IAction act)
{
//群Hot
if (CelestialOpposition.CanUse(out act)) return true;

//如果有巨星主宰
if (Player.HasStatus(true, StatusID.GiantDominance))
{
//需要回血的时候炸了。
act = EarthlyStar;
return true;
}

//天宫图
if (Player.HasStatus(true, StatusID.HoroscopeHelios) && Horoscope.CanUse(out act)) return true;

//奶量牌,要看情况。
if (DrawnCrownCard == CardType.LADY && MinorArcana.CanUse(out act, CanUseOption.MustUse)) return true;

return base.HealAreaAbility(out act);
}
}
Loading

0 comments on commit c97be9e

Please sign in to comment.