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

Commit

Permalink
fix: fix the NoNewHostiles strategy.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 16, 2023
1 parent cadc3f5 commit 13ceffc
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 22 deletions.
9 changes: 7 additions & 2 deletions RotationSolver/Actions/BaseAction/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,14 @@ private int CanGetTargetCount(BattleChara target, IEnumerable<BattleChara> canAt
int count = 0;
foreach (var t in canAttack)
{
if(CanGetTarget(target, t))
if(target == t)
{
if (Service.Configuration.NoNewHostiles && t.TargetObject == null)
count++;
}
else if(CanGetTarget(target, t))
{
if (Service.Configuration.NoNewHostiles
&& t.TargetObject == null)
{
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Helpers/ObjectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ or 71204 //Main Quest
or 71144 //Majur Quest
or 71224 //Other Quest
or 71244 //Leve
or 71344 //Major Quest
) return true;
if(icon == 0) return false;
var type = obj.GetEventType();
Expand Down
28 changes: 28 additions & 0 deletions RotationSolver/Rotations/Basic/BLU_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public bool RightType
{
get
{
if (_type == BLUActionType.None) return true;
if (AttackType == BLUAttackType.Physical && _type == BLUActionType.Magical) return false;
if (AttackType == BLUAttackType.Magical && _type == BLUActionType.Physical) return false;

Expand Down Expand Up @@ -795,4 +796,31 @@ private protected override void UpdateInfo()
AttackType = (BLUAttackType)Configs.GetCombo("AttackType");
base.UpdateInfo();
}

private protected override bool HealSingleGCD(out IAction act)
{
if (BlueId == BLUID.Healer)
{
//if (Exuviation.CanUse(out act, mustUse: true)) return true;

if (PomCure.CanUse(out act)) return true;
}
if (WhiteWind.CanUse(out act, mustUse: true)) return true;
return base.HealSingleGCD(out act);
}

private protected override bool HealAreaGCD(out IAction act)
{
if (BlueId == BLUID.Healer)
{
//if (Exuviation.CanUse(out act, mustUse: true)) return true;

if (AngelsSnack.CanUse(out act)) return true;
if (Stotram.CanUse(out act)) return true;
if (Stotram.CanUse(out act)) return true;
}

if (WhiteWind.CanUse(out act, mustUse: true)) return true;
return base.HealAreaGCD(out act);
}
}
9 changes: 3 additions & 6 deletions RotationSolver/Rotations/RangedMagicial/BLU/BLU_25.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ private protected override bool AttackAbility(byte abilitiesRemaining, out IActi

private protected override bool GeneralGCD(out IAction act)
{
if (ChocoMeteor.CanUse(out act, mustUse: TargetUpdater.HaveCompanion)) return true;


if (TripleTrident.OnSlot && TripleTrident.RightType && TripleTrident.WillHaveOneChargeGCD(OnSlotCount(Whistle, Tingle), 0))
{
if (Whistle.CanUse(out act)) return true;
Expand All @@ -37,11 +40,5 @@ private protected override bool GeneralGCD(out IAction act)

return false;
}

private protected override bool HealAreaGCD(out IAction act)
{
if (WhiteWind.CanUse(out act, mustUse: true)) return true;
return base.HealAreaGCD(out act);
}
}
#endif
4 changes: 2 additions & 2 deletions RotationSolver/Rotations/RangedMagicial/BLU/BLU_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private protected override bool GeneralGCD(out IAction act)
return false;
}

private protected override bool HealAreaGCD(out IAction act)
private protected override bool HealSingleGCD(out IAction act)
{
if (BlueId == BLUID.Healer)
{
Expand All @@ -119,7 +119,7 @@ private protected override bool HealAreaGCD(out IAction act)
if (WhiteWind.CanUse(out act, mustUse: true)) return true;
}

return base.HealAreaGCD(out act);
return base.HealSingleGCD(out act);
}

/// <summary>
Expand Down
24 changes: 12 additions & 12 deletions RotationSolver/Windows/RotationConfigWindow_Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ private unsafe void DrawStatus()
private unsafe void DrawParty()
{
var status = AgentDeepDungeonStatus.Instance();
if ((IntPtr)status != IntPtr.Zero)
{
foreach (var item in status->Data->PomanderSpan)
{
ImGui.Text(item.Name.ToString() + " : " + item.ItemId.ToString());
}

foreach (var item in status->Data->MagiciteSpan)
{
ImGui.Text(item.Name.ToString() + " : " + item.ItemId.ToString());
}
}
//if ((IntPtr)status != IntPtr.Zero)
//{
// foreach (var item in status->Data->PomanderSpan)
// {
// ImGui.Text(item.Name.ToString() + " : " + item.ItemId.ToString());
// }

// foreach (var item in status->Data->MagiciteSpan)
// {
// ImGui.Text(item.Name.ToString() + " : " + item.ItemId.ToString());
// }
//}

ImGui.Text("Party: " + TargetUpdater.PartyMembers.Count().ToString());
ImGui.Text("CanHealSingleAbility: " + TargetUpdater.CanHealSingleAbility.ToString());
Expand Down

0 comments on commit 13ceffc

Please sign in to comment.