Skip to content

Commit

Permalink
dang yo
Browse files Browse the repository at this point in the history
  • Loading branch information
xanunderscore committed Oct 12, 2024
1 parent 13fd380 commit 2303c4c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 160 deletions.
31 changes: 25 additions & 6 deletions BossMod/Modules/Endwalker/Dungeon/D08Troia/D083Scarmiglione.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,20 @@ public enum AID : uint
_Weaponskill_BlightedBladework = 30259, // Boss->location, 10.0+1.0s cast, single-target
_Weaponskill_BlightedBladework1 = 30260, // Helper->self, 11.0s cast, range 25 circle
_Weaponskill_BlightedSweep = 30261, // Boss->self, 7.0s cast, range 40 180-degree cone
_Spell_Firedamp = 30262, // Boss->self, 5.0s cast, single-target
_Spell_Firedamp1 = 30263, // Helper->player, 5.4s cast, range 5 circle
_Spell_CreepingDecay = 30240, // Boss->self, 4.0s cast, single-target
_Ability_1 = 30244, // Boss->self, no cast, single-target
_AutoAttack_Attack = 872, // 39C7->player, no cast, single-target
_Spell_Nox = 30241, // Helper->self, 5.0s cast, range 10 circle
_Spell_VoidVortex = 30243, // Helper->player, 5.0s cast, range 6 circle
_Spell_VoidGravity = 30242, // Helper->players, 5.0s cast, range 6 circle
}

class VoidGravity(BossModule module) : Components.SpreadFromCastTargets(module, ActionID.MakeSpell(AID._Spell_VoidGravity), 6);
class Firedamp(BossModule module) : Components.BaitAwayCast(module, ActionID.MakeSpell(AID._Spell_Firedamp1), new AOEShapeCircle(5), true);
class Nox(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID._Spell_Nox), new AOEShapeCircle(10));
class VoidVortex(BossModule module) : Components.StackWithCastTargets(module, ActionID.MakeSpell(AID._Spell_VoidVortex), 6);
class BlightedBladework(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID._Weaponskill_BlightedBladework1), new AOEShapeCircle(25));
class BlightedSweep(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID._Weaponskill_BlightedSweep), new AOEShapeCone(40, 90.Degrees()));
class BlightedBedevilment(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID._Weaponskill_BlightedBedevilment), new AOEShapeCircle(9));
Expand All @@ -32,13 +44,16 @@ class VacuumWave(BossModule module) : Components.KnockbackFromCastTarget(module,
{
private readonly List<(ulong ID, Angle Angle)> Walls = [];

public const float WallHalfWidth = 6; // this is probably wrong
public static readonly Angle WallHalfAngle = WallHalfWidth.Degrees();

public override void DrawArenaForeground(int pcSlot, Actor pc)
{
base.DrawArenaForeground(pcSlot, pc);
foreach (var (_, w) in Walls)
{
Arena.PathArcTo(Arena.Center, 20, (w - 6.5f.Degrees()).Rad, (w + 6.5f.Degrees()).Rad);
Arena.PathStroke(false, ArenaColor.Border);
Arena.PathArcTo(Arena.Center, 20, (w - WallHalfAngle).Rad, (w + WallHalfAngle).Rad);
Arena.PathStroke(false, 0x80ffffff, 2);
}
}

Expand All @@ -57,15 +72,15 @@ public override void OnActorDestroyed(Actor actor)
public override IEnumerable<Source> Sources(int slot, Actor actor)
{
foreach (var c in Casters)
yield return new(c.Position, WallCheck(actor.Position) > 0 ? 19 - (actor.Position - Module.Arena.Center).Length() : Distance, Module.CastFinishAt(c.CastInfo));
yield return new(c.Position, WallCheck(actor.Position) ? 19 - (actor.Position - Module.Arena.Center).Length() : Distance, Module.CastFinishAt(c.CastInfo));
}

private float WallCheck(WPos pos) => Walls.Max(w => pos.InCone(Arena.Center, w.Angle, 6.5f.Degrees()) ? 1 : 0);
private bool WallCheck(WPos pos) => Walls.Any(w => Angle.FromDirection(pos - Arena.Center).AlmostEqual(w.Angle, 5.Degrees().Rad));

public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
if (Casters.FirstOrDefault() is Actor c)
hints.AddForbiddenZone(p => WallCheck(p) - 1, Module.CastFinishAt(c.CastInfo));
hints.AddForbiddenZone(p => WallCheck(p) ? 0 : -1, Module.CastFinishAt(c.CastInfo));
}
}

Expand All @@ -80,7 +95,11 @@ public ScarmiglioneStates(BossModule module) : base(module)
.ActivateOnEnter<BlightedBedevilment>()
.ActivateOnEnter<CursedEcho>()
.ActivateOnEnter<BlightedBladework>()
.ActivateOnEnter<BlightedSweep>();
.ActivateOnEnter<BlightedSweep>()
.ActivateOnEnter<Firedamp>()
.ActivateOnEnter<Nox>()
.ActivateOnEnter<VoidVortex>()
.ActivateOnEnter<VoidGravity>();
}
}

Expand Down
90 changes: 0 additions & 90 deletions BossMod/Pathfinding/PathDatabase.cs

This file was deleted.

52 changes: 0 additions & 52 deletions BossMod/Pathfinding/PathManager.cs

This file was deleted.

12 changes: 0 additions & 12 deletions BossMod/QuestBattle/QuestBattleDirector.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using BossMod.AI;
using BossMod.Autorotation;
using BossMod.Pathfinding;
using Dalamud.Plugin.Ipc;
using System.Threading.Tasks;

Expand Down Expand Up @@ -33,7 +32,6 @@ public sealed class QuestBattleDirector : IDisposable
private readonly BossModuleManager bmm;
private readonly EventSubscriptions _subscriptions;
private readonly QuestBattleConfig _config;
private readonly PathManager _pm;

public readonly record struct NavigationWaypoint(Vector3 Position, bool SpecifiedInPath);

Expand Down Expand Up @@ -65,7 +63,6 @@ public QuestBattleDirector(WorldState ws, BossModuleManager bmm)
{
World = ws;
_config = Service.Config.Get<QuestBattleConfig>();
_pm = new(ws);
this.bmm = bmm;

_subscriptions = new(
Expand Down Expand Up @@ -306,13 +303,6 @@ private async void TryPathfind(Vector3 start, List<Waypoint> connections, int ma
if (connections.Count == 0)
return;

if (_pm.TryGetPath(connections.Last().Position, out var wp))
{
Service.Log($"[QBD] returning cached points");
CurrentWaypoints = wp.Select(p => new NavigationWaypoint(p, false)).ToList();
return;
}

if (Service.PluginInterface == null)
{
Service.Log($"[QBD] UIDev detected, returning player's current position for waypoint");
Expand All @@ -321,8 +311,6 @@ private async void TryPathfind(Vector3 start, List<Waypoint> connections, int ma
else
{
CurrentWaypoints = await TryPathfind([new Waypoint(start, false), .. connections], maxRetries).ConfigureAwait(false);

_pm.SavePath(connections.Last().Position, CurrentWaypoints.Select(p => p.Position).ToList());
}
}

Expand Down

0 comments on commit 2303c4c

Please sign in to comment.