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

Commit

Permalink
fix: changed the casting time check for condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 27, 2023
1 parent 4194f29 commit dc40d32
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Helpers/CooldownHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static bool RecastAfterGCD(float recast, uint gcdCount = 0, float offset
return recast.IsLessThan(remain);
}

internal static bool RecastAfter(float recast, float remain, bool addWeaponRemain = true)
public static bool RecastAfter(float recast, float remain, bool addWeaponRemain = true)
{
if (addWeaponRemain) remain += DataCenter.WeaponRemain;

Expand Down
11 changes: 5 additions & 6 deletions RotationSolver/ActionSequencer/ActionCondition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ internal class ActionCondition : ICondition
public int Param2;
public float Time;


public bool IsTrue(ICustomRotation combo, bool isActionSequencer)
{
if (!isActionSequencer) return false;
Expand All @@ -44,8 +43,8 @@ public bool IsTrue(ICustomRotation combo, bool isActionSequencer)
result = !_action.WillHaveOneChargeGCD((uint)Param1, Param2); // Smaller
break;

case ActionConditionType.ShouldUse:
var option = CanUseOption.None;
case ActionConditionType.CanUse:
var option = CanUseOption.IgnoreTarget;
if (Param1 > 0) option |= CanUseOption.MustUse;
if (Param2 > 0) option |= CanUseOption.EmptyOrSkipCombo;
result = _action.CanUse(out _, option);
Expand Down Expand Up @@ -117,7 +116,7 @@ public void Draw(ICustomRotation combo, bool isActionSequencer)
combos = new string[] { ">", "<=" };
break;

case ActionConditionType.ShouldUse:
case ActionConditionType.CanUse:
combos = new string[]
{
LocalizationManager.RightLang.ActionSequencer_Can,
Expand Down Expand Up @@ -161,7 +160,7 @@ public void Draw(ICustomRotation combo, bool isActionSequencer)
}
break;

case ActionConditionType.ShouldUse:
case ActionConditionType.CanUse:

ConditionHelper.DrawCheckBox($"{LocalizationManager.RightLang.ActionSequencer_MustUse}##MustUse{GetHashCode()}", ref Param1, LocalizationManager.RightLang.ActionSequencer_MustUseDesc);
ConditionHelper.DrawCheckBox($"{LocalizationManager.RightLang.ActionSequencer_Empty}##MustUse{GetHashCode()}", ref Param2, LocalizationManager.RightLang.ActionSequencer_EmptyDesc);
Expand All @@ -184,7 +183,7 @@ public enum ActionConditionType : byte
ElapsedGCD,
Remain,
RemainGCD,
ShouldUse,
CanUse,
EnoughLevel,
IsCoolDown,
CurrentCharges,
Expand Down
5 changes: 3 additions & 2 deletions RotationSolver/ActionSequencer/TargetCondition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public bool IsTrue(ICustomRotation combo, bool isActionSequencer)
BattleChara tar = null;
if (_action != null)
{
_action.CanUse(out _, CanUseOption.EmptyOrSkipCombo | CanUseOption.MustUse);
_action.CanUse(out _, CanUseOption.EmptyOrSkipCombo | CanUseOption.MustUse
| CanUseOption.IgnoreTarget);
tar = _action.Target;
}
else
Expand Down Expand Up @@ -100,7 +101,7 @@ public bool IsTrue(ICustomRotation combo, bool isActionSequencer)
}

float castTime = tar.TotalCastTime - tar.CurrentCastTime;
result = castTime > DistanceOrTime;
result = !CooldownHelper.RecastAfter(castTime, DistanceOrTime);
break;
}

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Localization/EnumTranslations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal static class EnumTranslations
ActionConditionType.ElapsedGCD => LocalizationManager.RightLang.ActionConditionType_ElapsedGCD,
ActionConditionType.Remain => LocalizationManager.RightLang.ActionConditionType_Remain,
ActionConditionType.RemainGCD => LocalizationManager.RightLang.ActionConditionType_RemainGCD,
ActionConditionType.ShouldUse => LocalizationManager.RightLang.ActionConditionType_ShouldUse,
ActionConditionType.CanUse => LocalizationManager.RightLang.ActionConditionType_ShouldUse,
ActionConditionType.EnoughLevel => LocalizationManager.RightLang.ActionConditionType_EnoughLevel,
ActionConditionType.IsCoolDown => LocalizationManager.RightLang.ActionConditionType_IsCoolDown,
ActionConditionType.CurrentCharges => LocalizationManager.RightLang.ActionConditionType_CurrentCharges,
Expand Down

0 comments on commit dc40d32

Please sign in to comment.