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

Commit

Permalink
fix: add use aoe action option.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 23, 2023
1 parent 21fc5b6 commit 3870dff
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 16 deletions.
24 changes: 14 additions & 10 deletions RotationSolver/Actions/BaseAction/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private bool TargetHostile(float range, bool mustUse, int aoeCount, out BattleCh
}

//判断一下AOE攻击的时候如果有攻击目标标记目标
if (_action.CastType > 1 && NoAOEForAttackMark)
if (_action.CastType > 1 && NoAOE)
{
target = null;
return false;
Expand Down Expand Up @@ -310,7 +310,7 @@ private bool TargetHostileManual(BattleChara b, bool mustUse, int aoeCount, out
return true;
}

if (Service.Configuration.UseAOEWhenManual || mustUse)
if (Service.Configuration.UseAOEAction && Service.Configuration.UseAOEWhenManual || mustUse)
{
if (GetMostObjects(TargetFilterFuncEot(TargetUpdater.HostileTargets, mustUse), aoeCount).Contains(b))
{
Expand All @@ -326,7 +326,7 @@ private bool TargetSelf(bool mustUse, int aoeCount)
{
if (_action.EffectRange > 0 && !_isFriendly)
{
if (NoAOEForAttackMark)
if (NoAOE)
{
return false;
}
Expand Down Expand Up @@ -479,11 +479,15 @@ unsafe bool CanTargetTo(BattleChara tar)
return id is 0 or 565;
}

/// <summary>
/// 开启攻击标记且有攻击标记目标且不开AOE。
/// </summary>
private static bool NoAOEForAttackMark =>
Service.Configuration.ChooseAttackMark
&& !Service.Configuration.CanAttackMarkAOE
&& MarkingHelper.HaveAttackChara(TargetUpdater.HostileTargets);
private static bool NoAOE
{
get
{
if (!Service.Configuration.UseAOEAction) return true;

return Service.Configuration.ChooseAttackMark
&& !Service.Configuration.CanAttackMarkAOE
&& MarkingHelper.HaveAttackChara(TargetUpdater.HostileTargets);
}
}
}
1 change: 1 addition & 0 deletions RotationSolver/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class PluginConfiguration : IPluginConfiguration
public bool AutoShield = true;
public bool AddEnemyListToHostile = true;
public bool UseAOEWhenManual = false;
public bool UseAOEAction = true;
public bool UseItem = false;
public bool PositionalFeedback = true;
public bool ShowMoveTarget = true;
Expand Down
2 changes: 2 additions & 0 deletions RotationSolver/Localization/Strings_Major.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ internal partial class Strings
public string Configwindow_Param_ShowInfoOnToast { get; set; } = "Display plugin state on toast";
public string Configwindow_Param_NamePlateIconId { get; set; } = "Player's name plate icon id when state is on. Recommand 61435, 61437";
public string Configwindow_Param_Action { get; set; } = "Action";
public string Configwindow_Param_UseAOEAction { get; set; } = "Use AOE actions";

public string Configwindow_Param_UseAOEWhenManual { get; set; } = "Use AOE actions in manual mode";
public string Configwindow_Param_AutoBurst { get; set; } = "Automatic burst";
public string Configwindow_Param_UseAbility { get; set; } = "Auto-use abilities";
Expand Down
18 changes: 12 additions & 6 deletions RotationSolver/Windows/RotationConfigWindow_Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,18 @@ private void DrawParamDisplay()

private void DrawParamAction()
{
DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_UseAOEWhenManual,
ref Service.Configuration.UseAOEWhenManual);
DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_UseAOEAction,
ref Service.Configuration.UseAOEAction);

DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_NoNewHostiles,
ref Service.Configuration.NoNewHostiles,
LocalizationManager.RightLang.Configwindow_Params_NoNewHostilesDesc);
if(Service.Configuration.UseAOEAction)
{
DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_UseAOEWhenManual,
ref Service.Configuration.UseAOEWhenManual);

DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_NoNewHostiles,
ref Service.Configuration.NoNewHostiles,
LocalizationManager.RightLang.Configwindow_Params_NoNewHostilesDesc);
}

ImGui.Separator();

Expand Down Expand Up @@ -350,7 +356,7 @@ private void DrawParamTarget()
DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_ChooseAttackMark,
ref Service.Configuration.ChooseAttackMark);

if (Service.Configuration.ChooseAttackMark)
if (Service.Configuration.ChooseAttackMark && Service.Configuration.UseAOEAction)
{
ImGui.Indent();

Expand Down

0 comments on commit 3870dff

Please sign in to comment.