Skip to content

Commit

Permalink
ok sure
Browse files Browse the repository at this point in the history
  • Loading branch information
xanunderscore committed Jan 3, 2025
1 parent 2e2e92b commit a44067a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
19 changes: 18 additions & 1 deletion BossMod/ActionTweaks/CancelCastTweak.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ public sealed class CancelCastTweak(WorldState ws, AIHints hints)
private readonly WorldState _ws = ws;
private DateTime _nextCancelAllowed;

private static readonly uint[] InstantOutOfCombatActions = [
(uint)PCT.AID.WingMotif,
(uint)PCT.AID.ClawMotif,
(uint)PCT.AID.MawMotif,
(uint)PCT.AID.PomMotif,
(uint)PCT.AID.HammerMotif,
(uint)PCT.AID.StarrySkyMotif,
(uint)RPR.AID.SoulSow
];

public bool ShouldCancel(DateTime currentTime, bool force)
{
if (currentTime < _nextCancelAllowed)
Expand All @@ -28,10 +38,17 @@ private bool WantCancel()
if (!_config.CancelCastOnDeadTarget)
return false;

var cast = _ws.Party.Player()?.CastInfo;
if (_ws.Party.Player() is not Actor player)
return false;

var cast = player.CastInfo;
if (cast == null || cast.Action.Type == ActionType.KeyItem) // don't auto cancel quest items, that's never a good idea
return false;

// we started casting some action, but combat ended - better to cancel and get instant recast
if (!player.InCombat && InstantOutOfCombatActions.Contains(cast.Action.ID))
return true;

var target = _ws.Actors.Find(cast.TargetID);
if (target == null)
return false;
Expand Down
6 changes: 6 additions & 0 deletions BossMod/Autorotation/xan/AI/DeepDungeon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa
Hints.GoalZones.Add(Hints.GoalSingleTarget(target, 3, 0.1f));
}

if (primaryTarget is Actor ptar && ptar.IsTargetable && Player.PosRot.Y + 9 <= ptar.PosRot.Y)
{
Hints.ForcedMovement = new();
Hints.MaxCastTimeEstimate = float.MaxValue;
}

SetupKiteZone(strategy, primaryTarget);

if (Player.FindStatus(SID.ItemPenalty) != null)
Expand Down
5 changes: 0 additions & 5 deletions BossMod/BossMod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@
<Using Include="System.Numerics" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
<EmbeddedResource Include="Pathfinding\ObstacleMaps\maplist.json" />
<EmbeddedResource Include="Pathfinding\ObstacleMaps\*.bmp" />
</ItemGroup>

<PropertyGroup>
<DalamudLibPath>$(appdata)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public enum AID : uint
Hypnotize = 32737, // 3E58->self, 3.0s cast, range 20 circle
Catharsis = 32732, // 3E56->self, 10.0s cast, range 40 circle
ElectricWhorl = 33186, // 3E09->self, 4.0s cast, range 60 circle
HexEye = 32731, // 3E56->self, 3.0s cast, range 5 circle
}

public enum SID : uint
Expand Down Expand Up @@ -57,6 +58,9 @@ protected override void OnCastStarted(Actor actor)
case AID.Hypnotize:
Gazes.Add((actor, null));
break;
case AID.HexEye:
Gazes.Add((actor, new AOEShapeCircle(5)));
break;
case AID.TheDragonsVoice:
case AID.ElectricCachexia:
case AID.ElectricWhorl:
Expand Down

0 comments on commit a44067a

Please sign in to comment.