From eff8400b6bbc14f16cff77a54441a144f29b2bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Fri, 24 Feb 2023 10:59:16 +0800 Subject: [PATCH] fix: change the lowBlow usage. --- .../CustomRotation/CustomRotation_Actions.cs | 9 ++++- .../Rotations/Healer/AST/AST_Default.cs | 4 +- docs/RotationDev/customization.md | 38 +++++++++++++++---- 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/RotationSolver/Rotations/CustomRotation/CustomRotation_Actions.cs b/RotationSolver/Rotations/CustomRotation/CustomRotation_Actions.cs index 057fcf9d9..56cc9b7f0 100644 --- a/RotationSolver/Rotations/CustomRotation/CustomRotation_Actions.cs +++ b/RotationSolver/Rotations/CustomRotation/CustomRotation_Actions.cs @@ -2,6 +2,7 @@ using RotationSolver.Actions.BaseAction; using RotationSolver.Data; using RotationSolver.Helpers; +using RotationSolver.SigReplacers; using RotationSolver.Updaters; using System; using System.Linq; @@ -167,7 +168,13 @@ internal RoleAction(ActionID actionID, JobRole[] roles, bool isFriendly = false, /// public static IBaseAction LowBlow { get; } = new RoleAction(ActionID.LowBlow, new JobRole[] { JobRole.Tank }) { - ActionCheck = b => !b.IsBoss() && !MovingUpdater.IsMoving && b.CastActionId != 0 && !b.IsCastInterruptible, + ActionCheck = b => + { + if (b.IsBoss() || MovingUpdater.IsMoving || b.CastActionId == 0) return false; + + if (!b.IsCastInterruptible || Interject.IsCoolingDown) return true; + return false; + } }; /// diff --git a/RotationSolver/Rotations/Healer/AST/AST_Default.cs b/RotationSolver/Rotations/Healer/AST/AST_Default.cs index 15052b9fc..838cdf25c 100644 --- a/RotationSolver/Rotations/Healer/AST/AST_Default.cs +++ b/RotationSolver/Rotations/Healer/AST/AST_Default.cs @@ -11,13 +11,14 @@ namespace RotationSolver.Rotations.Healer.AST; -[RotationDesc(ActionID.Divination)] +[RotationDesc("This is a burst info", ActionID.Divination)] internal sealed class AST_Default : AST_Base { public override string GameVersion => "6.28"; public override string RotationName => "Default"; + public override string Description => "Here is an Example Description"; private protected override IRotationConfigSet CreateConfiguration() => base.CreateConfiguration() .SetFloat("UseEarthlyStarTime", 15, "Use the Earthly Star in Count down time", 4, 20); @@ -42,6 +43,7 @@ private protected override IAction CountDownAction(float remainTime) return base.CountDownAction(remainTime); } + [RotationDesc("Defence Single Description...\n Please use new line manually..")] [RotationDesc(ActionID.CelestialIntersection, ActionID.Exaltation)] private protected override bool DefenceSingleAbility(byte abilitiesRemaining, out IAction act) { diff --git a/docs/RotationDev/customization.md b/docs/RotationDev/customization.md index 79bdafcc6..aba94ebc6 100644 --- a/docs/RotationDev/customization.md +++ b/docs/RotationDev/customization.md @@ -1,3 +1,5 @@ + + # Customization Want to write a better rotation? You need to customize it! @@ -45,19 +47,39 @@ Sometimes, for saving the resource. We want to save the value to the field. But ## Description -More description about your rotation? Overrive the `DescriptionDict`. +More description about your rotation? Override the `Description`. -Here is an example in BRD: +Here is an example AST: ``` c# - public override SortedList DescriptionDict => new() - { - {DescType.Description, "Please make sure that the three song times add up to 120 seconds!"}, - {DescType.DefenseArea, $"{Troubadour}"}, - {DescType.HealSingle, $"{NaturesMinne}"}, - }; + public override string Description => "Here is an Example Description."; +``` + +And for the macro special duration. You can use attribute called `RotationDesc` to describe it. + +Burst Info should be attached on the class. + +``` c# +[RotationDesc("This is a burst info", ActionID.Divination)] +internal sealed class AST_Default : AST_Base +{ + //... +} ``` +You can also separate it to describe, or just write one. + +``` c# +[RotationDesc("Defence Single Description...\n Please use new line manually..")] +[RotationDesc(ActionID.CelestialIntersection, ActionID.Exaltation)] +private protected override bool DefenceSingleAbility(byte abilitiesRemaining, out IAction act) +{ + //... +} +``` + +This is what it look like. + ## RotationCheck