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

Commit

Permalink
fix: new logic of healing potion usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jun 6, 2023
1 parent 8a05b6d commit bd7b6b7
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions RotationSolver.Basic/Rotations/CustomRotation_Ability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ public abstract partial class CustomRotation
private bool Ability(IAction nextGCD, out IAction act, bool helpDefenseAOE, bool helpDefenseSingle)
{
act = DataCenter.CommandNextAction;
if (act is IBaseAction a && a != null && !a.IsRealGCD && a.CanUse(out _, CanUseOption.MustUse | CanUseOption.SkipDisable | CanUseOption.EmptyOrSkipCombo)) return true;
if (act is IBaseAction a && a != null && !a.IsRealGCD && a.CanUse(out _,
CanUseOption.MustUse | CanUseOption.SkipDisable | CanUseOption.EmptyOrSkipCombo)) return true;

if(act is IBaseItem i && i.CanUse(out _)) return true;

if (!Configuration.PluginConfiguration.GetValue(SettingsCommand.UseAbility)
Expand Down Expand Up @@ -40,6 +42,14 @@ private bool Ability(IAction nextGCD, out IAction act, bool helpDefenseAOE, bool

if (GeneralUsingAbility(role, out act)) return true;

if (DataCenter.HPNotFull && InCombat)
{
if (DataCenter.SpecialType == SpecialCommandType.HealSingle || CanHealSingleAbility)
{
if (UseHealPotion(out act)) return true;
}
}

if (HasHostilesInRange && AttackAbility(out act)) return true;
if (GeneralAbility(out act)) return true;

Expand Down Expand Up @@ -148,7 +158,10 @@ private bool GeneralHealAbility(SpecialCommandType specialType, out IAction act)

if ((DataCenter.HPNotFull || ClassJob.GetJobRole() != JobRole.Healer) && InCombat)
{
if ((DataCenter.SpecialType == SpecialCommandType.HealArea || CanHealAreaAbility) && HealAreaAbility(out act)) return true;
if (DataCenter.SpecialType == SpecialCommandType.HealArea || CanHealAreaAbility)
{
if (HealAreaAbility(out act)) return true;
}
if (DataCenter.SpecialType == SpecialCommandType.HealSingle || CanHealSingleAbility)
{
if (HealSingleAbility(out act)) return true;
Expand Down Expand Up @@ -290,7 +303,7 @@ protected virtual bool MoveBackAbility(out IAction act)
[RotationDesc(DescType.HealSingleAbility)]
protected virtual bool HealSingleAbility(out IAction act)
{
return UseHealPotion(out act);
act = null; return false;
}

[RotationDesc(DescType.HealAreaAbility)]
Expand Down

0 comments on commit bd7b6b7

Please sign in to comment.