Skip to content

Commit 0f2d433

Browse files
committed
add special pyretic to dash safety check
1 parent f3f30c6 commit 0f2d433

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

BossMod/ActionQueue/ActionDefinition.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ public void Dispose()
298298
public static Actor? FindEsunaTarget(WorldState ws) => ws.Party.WithoutSlot().FirstOrDefault(p => p.Statuses.Any(s => Utils.StatusIsRemovable(s.ID)));
299299
public static Actor? SmartTargetEsunable(WorldState ws, Actor player, Actor? primaryTarget, AIHints hints) => SmartTargetFriendly(primaryTarget) ?? FindEsunaTarget(ws) ?? player;
300300

301-
public static bool DashToTargetCheck(WorldState _, Actor player, ActionQueue.Entry action, AIHints hints)
301+
public static bool DashToTargetCheck(WorldState ws, Actor player, ActionQueue.Entry action, AIHints hints)
302302
{
303303
var cfg = Service.Config.Get<ActionTweaksConfig>();
304304
var target = action.Target;
@@ -319,6 +319,11 @@ public static bool DashToTargetCheck(WorldState _, Actor player, ActionQueue.Ent
319319
if (hints.ForbiddenDirections.Any(d => dir.AlmostEqual(d.center, d.halfWidth.Rad)))
320320
return true;
321321

322+
// TODO: check against action's animation lock duration instead of constant 0.8?
323+
var (mode, deadline) = hints.ImminentSpecialMode;
324+
if (mode is AIHints.SpecialMode.Pyretic or AIHints.SpecialMode.PyreticMove && deadline <= ws.FutureTime(0.8f))
325+
return true;
326+
322327
return IsDashDangerous(src, src + dir.ToDirection() * MathF.Max(0, dist), hints);
323328
}
324329

0 commit comments

Comments
 (0)