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

Commit

Permalink
fix: add traits.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed May 25, 2023
1 parent cd98916 commit 2c607ed
Show file tree
Hide file tree
Showing 27 changed files with 432 additions and 24 deletions.
3 changes: 0 additions & 3 deletions RotationSolver.Basic/Actions/BaseAction_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ public partial class BaseAction : IBaseAction

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

/// <summary>
/// EnoughLevel for using.
/// </summary>
public bool EnoughLevel => Player.Level >= Level;
public byte Level => _action.ClassJobLevel;
public string Name => _action.Name;
Expand Down
10 changes: 2 additions & 8 deletions RotationSolver.Basic/Actions/IAction.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
namespace RotationSolver.Basic.Actions;

public interface IAction : ITexture
public interface IAction : ITexture, IEnouthLevel
{
uint ID { get; }
uint AdjustedID { get; }
float RecastTimeOneCharge { get; }
float AnimationLockTime { get; }
uint SortKey { get; }
public bool IsActionSequencer { get; }

/// <summary>
/// Please don't use it.
/// </summary>
Expand All @@ -19,13 +20,6 @@ public interface IAction : ITexture
/// </summary>
bool IsCoolingDown { get; }

/// <summary>
/// Player's level is enough for this action's usage.
/// </summary>
bool EnoughLevel { get; }

internal byte Level { get; }

bool IsInCooldown { get; set; }

bool Use();
Expand Down
11 changes: 11 additions & 0 deletions RotationSolver.Basic/IEnouthLevel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace RotationSolver.Basic;

public interface IEnouthLevel
{
/// <summary>
/// Player's level is enough for this action's usage.
/// </summary>
bool EnoughLevel { get; }

internal byte Level { get; }
}
37 changes: 37 additions & 0 deletions RotationSolver.Basic/Rotations/Basic/AST_Base.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Dalamud.Interface.Animation;
using ECommons.DalamudServices;
using RotationSolver.Basic.Traits;

namespace RotationSolver.Basic.Rotations.Basic;

Expand Down Expand Up @@ -163,6 +165,41 @@ public abstract class AST_Base : CustomRotation
};
#endregion

#region Traits
protected static IBaseTrait MaimAndMend { get; } = new BaseTrait(122);

protected static IBaseTrait EnhancedBenefic { get; } = new BaseTrait(124);

protected static IBaseTrait MaimAndMend2 { get; } = new BaseTrait(125);

protected static IBaseTrait CombustMastery { get; } = new BaseTrait(186);

protected static IBaseTrait MaleficMastery { get; } = new BaseTrait(187);

protected static IBaseTrait MaleficMastery2 { get; } = new BaseTrait(188);

protected static IBaseTrait HyperLightspeed { get; } = new BaseTrait(189);

protected static IBaseTrait CombustMastery2 { get; } = new BaseTrait(314);

protected static IBaseTrait MaleficMastery3 { get; } = new BaseTrait(315);

protected static IBaseTrait EnhancedEssentialDignity { get; } = new BaseTrait(316);

protected static IBaseTrait EnhancedDraw { get; } = new BaseTrait(495);

protected static IBaseTrait EnhancedDraw2 { get; } = new BaseTrait(496);

protected static IBaseTrait MaleficMastery4 { get; } = new BaseTrait(497);

protected static IBaseTrait GravityMastery { get; } = new BaseTrait(498);

protected static IBaseTrait EnhancedHealingMagic { get; } = new BaseTrait(499);

protected static IBaseTrait EnhancedCelestialIntersection { get; } = new BaseTrait(500);

#endregion

protected static bool PlayCard(out IAction act)
{
act = null;
Expand Down
44 changes: 44 additions & 0 deletions RotationSolver.Basic/Rotations/Basic/BLM_Base.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using RotationSolver.Basic.Traits;

namespace RotationSolver.Basic.Rotations.Basic;

Expand Down Expand Up @@ -207,7 +208,50 @@ public override bool CanUse(out IAction act, CanUseOption option = CanUseOption.
};
#endregion

#region Traits
protected static IBaseTrait MaimAndMend { get; } = new BaseTrait(29);

protected static IBaseTrait MaimAndMend2 { get; } = new BaseTrait(31);

protected static IBaseTrait Firestarter { get; } = new BaseTrait(32);

protected static IBaseTrait Thundercloud { get; } = new BaseTrait(33);

protected static IBaseTrait ThunderMastery { get; } = new BaseTrait(171);

protected static IBaseTrait ThunderMastery2 { get; } = new BaseTrait(172);

protected static IBaseTrait EnhancedEnochian {get; } = new BaseTrait(174);

protected static IBaseTrait EnhancedFreeze {get; } = new BaseTrait(295);

protected static IBaseTrait AspectMastery {get; } = new BaseTrait(296);

protected static IBaseTrait EnhancedPolyglot {get; } = new BaseTrait(297);

protected static IBaseTrait EnhancedSharpcast { get; } = new BaseTrait(321);

protected static IBaseTrait EnhancedEnochian2 { get; } = new BaseTrait(322);

protected static IBaseTrait AspectMastery2 { get; } = new BaseTrait(458);

protected static IBaseTrait AspectMastery3 { get; } = new BaseTrait(459);

protected static IBaseTrait Enochian { get; } = new BaseTrait(460);

protected static IBaseTrait EnhancedFoul { get; } = new BaseTrait(461);

protected static IBaseTrait AspectMastery4 { get; } = new BaseTrait(462);

protected static IBaseTrait EnhancedManafont { get; } = new BaseTrait(463);

protected static IBaseTrait EnhancedSharpcast2 { get; } = new BaseTrait(464);

protected static IBaseTrait AspectMastery5 { get; } = new BaseTrait(465);

protected static IBaseTrait EnhancedEnochian3 { get; } = new BaseTrait(509);

#endregion
protected static float Fire4Time { get; private set; }
protected override void UpdateInfo()
{
Expand Down
12 changes: 11 additions & 1 deletion RotationSolver.Basic/Rotations/Basic/BLU_Base.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using RotationSolver.Basic.Traits;

namespace RotationSolver.Basic.Rotations.Basic;

Expand Down Expand Up @@ -418,7 +419,16 @@ public override bool CanUse(out IAction act, CanUseOption option = CanUseOption.

#endregion

protected override bool MoveForwardGCD(out IAction act)
#region Traits
protected static IBaseTrait Learning { get; } = new BaseTrait(219);
protected static IBaseTrait MaimAndMend { get; } = new BaseTrait(220);
protected static IBaseTrait MaimAndMend2 { get; } = new BaseTrait(221);
protected static IBaseTrait MaimAndMend3 { get; } = new BaseTrait(222);
protected static IBaseTrait MaimAndMend4 { get; } = new BaseTrait(223);
protected static IBaseTrait MaimAndMend5 { get; } = new BaseTrait(224);
#endregion

protected sealed override bool MoveForwardGCD(out IAction act)
{
if (Loom.CanUse(out act)) return true;
return base.MoveForwardGCD(out act);
Expand Down
21 changes: 21 additions & 0 deletions RotationSolver.Basic/Rotations/Basic/BRD_Base.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using RotationSolver.Basic.Traits;

namespace RotationSolver.Basic.Rotations.Basic;

Expand Down Expand Up @@ -123,6 +124,26 @@ protected static bool SongEndAfterGCD(uint gctCount = 0, float offset = 0)
};
#endregion

#region Traits
protected static IBaseTrait HeavierShot { get; } = new BaseTrait(17);
protected static IBaseTrait IncreasedActionDamage { get; } = new BaseTrait(18);
protected static IBaseTrait IncreasedActionDamage2 { get; } = new BaseTrait(20);
protected static IBaseTrait BiteMastery { get; } = new BaseTrait(168);
protected static IBaseTrait EnhancedEmpyrealArrow { get; } = new BaseTrait(169);
protected static IBaseTrait StraightShotMastery { get; } = new BaseTrait(282);
protected static IBaseTrait EnhancedQuickNock { get; } = new BaseTrait(283);
protected static IBaseTrait BiteMastery2 { get; } = new BaseTrait(284);
protected static IBaseTrait HeavyShotMastery { get; } = new BaseTrait(285);
protected static IBaseTrait EnhancedArmysPaeon { get; } = new BaseTrait(286);
protected static IBaseTrait SoulVoiceTraits { get; } = new BaseTrait(287);
protected static IBaseTrait QuickNockMastery { get; } = new BaseTrait(444);
protected static IBaseTrait EnhancedBloodletter { get; } = new BaseTrait(445);
protected static IBaseTrait EnhancedApexArrow { get; } = new BaseTrait(446);
protected static IBaseTrait EnhancedTroubadour { get; } = new BaseTrait(447);
protected static IBaseTrait MinstrelsCoda { get; } = new BaseTrait(448);

#endregion

protected override bool EmergencyAbility(IAction nextGCD, out IAction act)
{
//Esuna
Expand Down
15 changes: 15 additions & 0 deletions RotationSolver.Basic/Rotations/Basic/DNC_Base.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using RotationSolver.Basic.Traits;

namespace RotationSolver.Basic.Rotations.Basic;
public abstract class DNC_Base : CustomRotation
Expand Down Expand Up @@ -237,6 +238,20 @@ protected static bool ExecuteStepGCD(out IAction act)
}
#endregion

#region Traits
protected static IBaseTrait IncreasedActionDamage { get; } = new BaseTrait(251);
protected static IBaseTrait FourfoldFantasy { get; } = new BaseTrait(252);
protected static IBaseTrait IncreasedActionDamage2 { get; } = new BaseTrait(253);
protected static IBaseTrait EnhancedEnAvant { get; } = new BaseTrait(254);
protected static IBaseTrait EspritTrait { get; } = new BaseTrait(255);
protected static IBaseTrait EnhancedEnAvant2 { get; } = new BaseTrait(256);
protected static IBaseTrait EnhancedTechnicalFinish { get; } = new BaseTrait(453);
protected static IBaseTrait EnhancedEsprit { get; } = new BaseTrait(454);
protected static IBaseTrait EnhancedFlourish { get; } = new BaseTrait(455);
protected static IBaseTrait EnhancedShieldSamba { get; } = new BaseTrait(456);
protected static IBaseTrait EnhancedDevilment { get; } = new BaseTrait(457);

#endregion
[RotationDesc(ActionID.EnAvant)]
protected sealed override bool MoveForwardAbility(out IAction act)
{
Expand Down
16 changes: 16 additions & 0 deletions RotationSolver.Basic/Rotations/Basic/DRG_Base.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using RotationSolver.Basic.Traits;

namespace RotationSolver.Basic.Rotations.Basic;

Expand Down Expand Up @@ -157,6 +158,21 @@ protected static bool SongEndAfterGCD(uint gctCount = 0, float offset = 0)
public static IBaseAction BattleLitany { get; } = new BaseAction(ActionID.BattleLitany, ActionOption.Buff);
#endregion

#region Traits
protected static IBaseTrait LanceMastery { get; } = new BaseTrait(162);
protected static IBaseTrait LifeOfTheDragon { get; } = new BaseTrait(163);
protected static IBaseTrait LanceMastery2 { get; } = new BaseTrait(247);
protected static IBaseTrait JumpMastery { get; } = new BaseTrait(275);
protected static IBaseTrait LifeOfTheDragonMastery { get; } = new BaseTrait(276);
protected static IBaseTrait BloodOfTheDragon { get; } = new BaseTrait(434);
protected static IBaseTrait EnhancedCoerthanTorment { get; } = new BaseTrait(435);
protected static IBaseTrait EnhancedSpineshatterDive { get; } = new BaseTrait(436);
protected static IBaseTrait LanceMastery3 { get; } = new BaseTrait(437);
protected static IBaseTrait EnhancedLifeSurge { get; } = new BaseTrait(438);
protected static IBaseTrait LanceMastery4 { get; } = new BaseTrait(508);

#endregion

public static IBaseAction ElusiveJump { get; } = new BaseAction(ActionID.ElusiveJump);

[RotationDesc(ActionID.Feint)]
Expand Down
15 changes: 14 additions & 1 deletion RotationSolver.Basic/Rotations/Basic/DRK_Base.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using ECommons.DalamudServices;
using RotationSolver.Basic.Traits;

namespace RotationSolver.Basic.Rotations.Basic;
public abstract class DRK_Base : CustomRotation
{

public override MedicineType MedicineType => MedicineType.Strength;

public sealed override ClassJobID[] JobIDs => new ClassJobID[] { ClassJobID.DarkKnight };
Expand Down Expand Up @@ -157,6 +157,19 @@ protected static bool ShadowTimeEndAfterGCD(uint gctCount = 0, float offset = 0)
public static IBaseAction Delirium { get; } = new BaseAction(ActionID.Delirium);
#endregion

#region Traits
protected static IBaseTrait Blackblood { get; } = new BaseTrait(158);
protected static IBaseTrait EnhancedBlackblood { get; } = new BaseTrait(159);
protected static IBaseTrait DarksideMastery { get; } = new BaseTrait(271);
protected static IBaseTrait EnhancedPlunge { get; } = new BaseTrait(272);
protected static IBaseTrait TankMastery { get; } = new BaseTrait(319);
protected static IBaseTrait EnhancedUnmend { get; } = new BaseTrait(422);
protected static IBaseTrait EnhancedLivingShadow2 { get; } = new BaseTrait(423);
protected static IBaseTrait MeleeMastery { get; } = new BaseTrait(506);
protected static IBaseTrait EnhancedLivingShadow { get; } = new BaseTrait(511);

#endregion

protected override bool EmergencyAbility(IAction nextGCD, out IAction act)
{
if (LivingDead.CanUse(out act) && BaseAction.TankBreakOtherCheck(JobIDs[0])) return true;
Expand Down
17 changes: 16 additions & 1 deletion RotationSolver.Basic/Rotations/Basic/GNB_Base.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using ECommons.DalamudServices;
using RotationSolver.Basic.Traits;
using System.Security.Policy;

namespace RotationSolver.Basic.Rotations.Basic;

Expand All @@ -14,7 +16,7 @@ public abstract class GNB_Base : CustomRotation

protected static byte Ammo => JobGauge.Ammo;
protected static byte AmmoComboStep => JobGauge.AmmoComboStep;
protected static byte MaxAmmo => Level >= 88 ? (byte)3 : (byte)2;
protected static byte MaxAmmo => CartridgeCharge2.EnoughLevel ? (byte)3 : (byte)2;
#endregion

#region Attack Single
Expand Down Expand Up @@ -159,6 +161,19 @@ public abstract class GNB_Base : CustomRotation

#endregion

#region Traits
protected static IBaseTrait CartridgeCharge { get; } = new BaseTrait(257);
protected static IBaseTrait EnhancedBrutalShell { get; } = new BaseTrait(258);
protected static IBaseTrait DangerZoneMastery { get; } = new BaseTrait(259);
protected static IBaseTrait TankMastery { get; } = new BaseTrait(320);
protected static IBaseTrait HeartOfStoneMastery { get; } = new BaseTrait(424);
protected static IBaseTrait EnhancedAurora { get; } = new BaseTrait(425);
protected static IBaseTrait EnhancedContinuation { get; } = new BaseTrait(426);
protected static IBaseTrait CartridgeCharge2 { get; } = new BaseTrait(427);
protected static IBaseTrait MeleeMastery { get; } = new BaseTrait(507);

#endregion

protected override bool EmergencyAbility(IAction nextGCD, out IAction act)
{
if (SuperBolide.CanUse(out act) && BaseAction.TankBreakOtherCheck(JobIDs[0])) return true;
Expand Down
19 changes: 18 additions & 1 deletion RotationSolver.Basic/Rotations/Basic/MCH_Base.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using RotationSolver.Basic.Traits;

namespace RotationSolver.Basic.Rotations.Basic;

Expand Down Expand Up @@ -113,7 +114,6 @@ protected static bool OverheatedEndAfterGCD(uint gctCount = 0, float offset = 0)
};
#endregion


#region Defense
public static IBaseAction Tactician { get; } = new BaseAction(ActionID.Tactician, ActionOption.Defense)
{
Expand All @@ -123,6 +123,23 @@ protected static bool OverheatedEndAfterGCD(uint gctCount = 0, float offset = 0)
public static IBaseAction Dismantle { get; } = new BaseAction(ActionID.Dismantle, ActionOption.Defense);
#endregion

#region Traits
protected static IBaseTrait IncreasedActionDamage { get; } = new BaseTrait(117);
protected static IBaseTrait IncreasedActionDamage2 { get; } = new BaseTrait(119);
protected static IBaseTrait SplitShotMastery { get; } = new BaseTrait(288);
protected static IBaseTrait SlugShotMastery { get; } = new BaseTrait(289);
protected static IBaseTrait CleanShotMastery { get; } = new BaseTrait(290);
protected static IBaseTrait HotShotMastery { get; } = new BaseTrait(291);
protected static IBaseTrait ChargedActionMastery { get; } = new BaseTrait(292);
protected static IBaseTrait EnhancedWildfire { get; } = new BaseTrait(293);
protected static IBaseTrait Promotion { get; } = new BaseTrait(294);
protected static IBaseTrait SpreadShotMastery { get; } = new BaseTrait(449);
protected static IBaseTrait EnhancedReassemble { get; } = new BaseTrait(450);
protected static IBaseTrait QueensGambit { get; } = new BaseTrait(451);
protected static IBaseTrait EnhancedTactician { get; } = new BaseTrait(452);
protected static IBaseTrait MarksmansMastery { get; } = new BaseTrait(517);
#endregion

[RotationDesc(ActionID.Tactician, ActionID.Dismantle)]
protected sealed override bool DefenseAreaAbility(out IAction act)
{
Expand Down
Loading

0 comments on commit 2c607ed

Please sign in to comment.