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

Commit

Permalink
fix: add hp, mp.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Sep 12, 2023
1 parent 21aff0b commit 06de0a7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
21 changes: 20 additions & 1 deletion RotationSolver/ActionSequencer/TargetCondition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ public override bool IsTrueInside(ICustomRotation rotation)
float castTime = tar.TotalCastTime - tar.CurrentCastTime;
result = castTime > DistanceOrTime + DataCenter.WeaponRemain;
break;

case TargetConditionType.HP:
result = tar.CurrentHp > GCD;
break;

case TargetConditionType.MP:
result = tar.CurrentMp > GCD;
break;
}

return Condition ? !result : result;
Expand Down Expand Up @@ -196,6 +204,8 @@ public override void DrawInside(ICustomRotation rotation)
case TargetConditionType.Distance:
case TargetConditionType.StatusEnd:
case TargetConditionType.TimeToKill:
case TargetConditionType.HP:
case TargetConditionType.MP:
combos = new string[] { ">", "<=" };
break;
}
Expand Down Expand Up @@ -303,7 +313,14 @@ void DrawStatusIcon()
case TargetConditionType.CastingActionTimeUntil:
ImGui.SameLine();
ImGui.SetNextItemWidth(Math.Max(150 * ImGuiHelpers.GlobalScale, ImGui.CalcTextSize(DistanceOrTime.ToString()).X));
ImGui.InputFloat($"s##CastingActionTimeUntil{GetHashCode()}", ref DistanceOrTime, .1f);
ImGui.DragFloat($"s##CastingActionTimeUntil{GetHashCode()}", ref DistanceOrTime, .1f);
break;

case TargetConditionType.MP:
case TargetConditionType.HP:
ImGui.SameLine();
ImGui.SetNextItemWidth(Math.Max(150 * ImGuiHelpers.GlobalScale, ImGui.CalcTextSize(GCD.ToString()).X));
ImGui.DragInt($"##HPorMP{GetHashCode()}", ref GCD, .1f);
break;
}
}
Expand All @@ -321,4 +338,6 @@ public enum TargetConditionType : byte
CastingAction,
CastingActionTimeUntil,
TimeToKill,
HP,
MP,
}
2 changes: 2 additions & 0 deletions RotationSolver/Localization/EnumTranslations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ internal static class EnumTranslations
TargetConditionType.CastingAction => LocalizationManager.RightLang.TargetConditionType_CastingAction,
TargetConditionType.CastingActionTimeUntil => LocalizationManager.RightLang.TargetConditionType_CastingActionTimeUntil,
TargetConditionType.TimeToKill => LocalizationManager.RightLang.TargetConditionType_TimeToKill,
TargetConditionType.HP => LocalizationManager.RightLang.TargetConditionType_HP,
TargetConditionType.MP => LocalizationManager.RightLang.TargetConditionType_MP,
_ => string.Empty,
};

Expand Down
5 changes: 4 additions & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@
"TargetConditionType_StatusEndGCD": "Status End GCD",
"TargetConditionType_CastingAction": "Casting Action",
"TargetConditionType_CastingActionTimeUntil": "Casting Action Time Until",
"TargetConditionType_HP": "HP",
"TargetConditionType_MP": "MP",
"DescType_BurstActions": "Burst Actions",
"DescType_MoveForwardGCD": "Move Forward GCD",
"DescType_HealAreaGCD": "Area Healing GCD",
Expand Down Expand Up @@ -519,5 +521,6 @@
"ConfigWindow_Actions_AOECount": "How many targets are needed to use this action.",
"ConfigWindow_Actions_TTK": "TTK that this action needs the target be.",
"ConfigWindow_Actions_HealRatio": "The HP ratio to auto heal",
"ConfigWindow_Actions_ConditionDescription": "Forced Condition has a higher priority. If Forced Condition is met, Disabled Condition will be ignored."
"ConfigWindow_Actions_ConditionDescription": "Forced Condition has a higher priority. If Forced Condition is met, Disabled Condition will be ignored.",
"ConfigWindow_Auto_UseResourcesAction": "Use actions that use resources"
}
2 changes: 2 additions & 0 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ internal class Strings
public string TargetConditionType_StatusEndGCD { get; set; } = "Status End GCD";
public string TargetConditionType_CastingAction { get; set; } = "Casting Action";
public string TargetConditionType_CastingActionTimeUntil { get; set; } = "Casting Action Time Until";
public string TargetConditionType_HP { get; set; } = "HP";
public string TargetConditionType_MP { get; set; } = "MP";

#endregion

Expand Down

0 comments on commit 06de0a7

Please sign in to comment.