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

Commit

Permalink
fix: identify boss by mobs' rank, which is 2 or 6.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Nov 4, 2023
1 parent 5731349 commit 9b2e39a
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ClickingCount": 54459,
"ClickingCount": 54509,
"SaidUsers": []
}
6 changes: 5 additions & 1 deletion RotationSolver.Basic/Actions/BaseAction_ActionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO
if (IsGeneralGCD && IsEot && IsFriendly && IActionHelper.IsLastGCD(true, this)
&& DataCenter.TimeSinceLastAction.TotalSeconds < 3) return false;

if (!FindTarget(mustUse, aoeCount, out var target, out var affectedTargets) || target == null) return false;
if (!FindTarget(mustUse, aoeCount, out var target, out var affectedTargets) || target == null)
{
AffectedTargets = affectedTargets;
return false;
}

if (ActionCheck != null && !ActionCheck(target, mustUse)) return false;

Expand Down
6 changes: 3 additions & 3 deletions RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,13 @@ private bool TargetSelf(bool mustUse, int aoeCount, out BattleChara[] affectedTa
}

var tars = TargetFilter.GetObjectInRadius(TargetFilterFuncEot(DataCenter.HostileTargets, mustUse), EffectRange);

affectedTargets = GetAffectedTargets(DataCenter.AllHostileTargets, Player.Object);

if (tars.Count() < aoeCount) return false;

if (Service.Config.GetValue(PluginConfigBool.NoNewHostiles) && TargetFilter.GetObjectInRadius(DataCenter.AllHostileTargets, EffectRange)
.Any(t => t.TargetObject == null)) return false;

affectedTargets = GetAffectedTargets(DataCenter.AllHostileTargets, Player.Object);
}

return true;
Expand Down Expand Up @@ -582,7 +583,6 @@ private bool CanGetTarget(BattleChara target, BattleChara subTarget)
{
if (target == null) return false;
if (IsSingleTarget) return false;
if (target.DistanceToPlayer() > Range) return false;

var pPos = Player.Object.Position;
Vector3 dir = target.Position - pPos;
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Helpers/ObjectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public static bool IsBoss(this BattleChara obj)
if (obj == null) return false;
if (obj.IsDummy() && !Service.Config.GetValue(Configuration.PluginConfigBool.ShowTargetTimeToKill)) return true;

return !(obj.GetObjectNPC()?.IsTargetLine ?? true);
return obj.GetObjectNPC()?.Rank is 2 or 6;
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver.Basic/Rotations/Basic/DNC_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public abstract class DNC_Base : CustomRotation
/// <summary>
///
/// </summary>
protected static IBaseAction StandardFinish { get; } = new BaseAction(ActionID.StandardFinish)
public static IBaseAction StandardFinish { get; } = new BaseAction(ActionID.StandardFinish)
{
StatusNeed = new[] { StatusID.StandardStep },
ActionCheck = (b, m) => IsDancing && CompletedSteps == 2,
Expand All @@ -274,7 +274,7 @@ public abstract class DNC_Base : CustomRotation
/// <summary>
///
/// </summary>
protected static IBaseAction TechnicalFinish { get; } = new BaseAction(ActionID.TechnicalFinish)
public static IBaseAction TechnicalFinish { get; } = new BaseAction(ActionID.TechnicalFinish)
{
StatusNeed = new[] { StatusID.TechnicalStep },
ActionCheck = (b, m) => IsDancing && CompletedSteps == 4,
Expand Down
7 changes: 6 additions & 1 deletion RotationSolver/Commands/RSCommands_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ public static void DoAction()

if (act.ShouldEndSpecial) ResetSpecial();
#if DEBUG
//Svc.Log.Debug($"{act}, {act.Target.Name}");
//Svc.Chat.Print(act.Name);
//Svc.Chat.Print(act.Target?.Name.TextValue ?? string.Empty);
//foreach (var item in act.AffectedTargets)
//{
// Svc.Chat.Print(item?.Name.TextValue ?? string.Empty);
//}
#endif
//Change Target
var tar = (act.Target == null || act.Target == Player.Object)
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/TargetUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private static bool IsCastingTankVfx()

private static bool IsCastingAreaVfx()
{
return false;
return IsCastingVfx(s => s.StartsWith("vfx/lockon/eff/com_share"));
}

private static bool IsCastingVfx(Func<string, bool> isVfx)
Expand Down

0 comments on commit 9b2e39a

Please sign in to comment.