From 143a45458c24810ba1a9075cc492b94f5c22c08b Mon Sep 17 00:00:00 2001 From: CarnifexOptimus <156172553+CarnifexOptimus@users.noreply.github.com> Date: Wed, 12 Feb 2025 06:23:43 +0100 Subject: [PATCH] some refactoring/tweaks --- .../Alliance/A14ShadowLord/GigaSlash.cs | 2 +- .../Dungeon/D01Ihuykatumu/D013Apollyon.cs | 60 +++++---- .../D03QitanaRavel/D030RonkanDreamer.cs | 44 +++---- .../Dungeon/D03QitanaRavel/D031Lozatl.cs | 22 ++-- .../Dungeon/D03QitanaRavel/D032Batsquatch.cs | 51 ++++---- .../Dungeon/D03QitanaRavel/D033Eros.cs | 114 ++++++++++-------- .../D04MalikahsWell/D041GreaterArmadillo.cs | 27 +++-- .../D04MalikahsWell/D042AmphibiousTalos.cs | 44 +++++-- .../Dungeon/D04MalikahsWell/D043Storge.cs | 61 ++++------ .../Ultimate/TEA/P3TemporalStasis.cs | 18 +-- 10 files changed, 249 insertions(+), 194 deletions(-) diff --git a/BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/GigaSlash.cs b/BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/GigaSlash.cs index bd70f56124..5d98c2215a 100644 --- a/BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/GigaSlash.cs +++ b/BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/GigaSlash.cs @@ -23,7 +23,7 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme public override void OnCastStarted(Actor caster, ActorCastInfo spell) { void AddAOE(AOEShapeCone shape, float rotationOffset, float finishOffset) - => AOEs.Add(new(shape, caster.Position, spell.Rotation + rotationOffset.Degrees(), Module.CastFinishAt(spell, finishOffset))); + => AOEs.Add(new(shape, spell.LocXZ, spell.Rotation + rotationOffset.Degrees(), Module.CastFinishAt(spell, finishOffset))); switch (spell.Action.ID) { diff --git a/BossMod/Modules/Dawntrail/Dungeon/D01Ihuykatumu/D013Apollyon.cs b/BossMod/Modules/Dawntrail/Dungeon/D01Ihuykatumu/D013Apollyon.cs index 88f0306e50..9c3165163a 100644 --- a/BossMod/Modules/Dawntrail/Dungeon/D01Ihuykatumu/D013Apollyon.cs +++ b/BossMod/Modules/Dawntrail/Dungeon/D01Ihuykatumu/D013Apollyon.cs @@ -51,8 +51,10 @@ public enum AID : uint BitingWind = 36761 // Helper->player, no cast, single-target } -class Whirlwind(BossModule module) : Components.PersistentVoidzone(module, 4.5f, m => m.Enemies(OID.Whirlwind), 5); - +class Whirlwind(BossModule module) : Components.PersistentVoidzone(module, 4.5f, GetWhirlwind, 5f) +{ + private static List GetWhirlwind(BossModule module) => module.Enemies((uint)OID.Whirlwind); +} class Blade(BossModule module) : Components.SingleTargetCast(module, ActionID.MakeSpell(AID.Blade)); class HighWind(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.HighWind)); @@ -61,7 +63,26 @@ class RazorZephyr(BossModule module) : Blades(module, AID.RazorZephyr); class BladesOfFamine(BossModule module) : Blades(module, AID.BladesOfFamine); class Levinsickle(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.Levinsickle), 4f); -class LevinsickleSpark(BossModule module) : Components.PersistentVoidzoneAtCastTarget(module, 4f, ActionID.MakeSpell(AID.LevinsickleSpark), m => m.Enemies(OID.LightningVoidzone).Where(z => z.EventState != 7), 0.7f); +class LevinsickleSpark(BossModule module) : Components.PersistentVoidzoneAtCastTarget(module, 4f, ActionID.MakeSpell(AID.LevinsickleSpark), GetVoidzones, 0.7f) +{ + private static Actor[] GetVoidzones(BossModule module) + { + var enemies = module.Enemies((uint)OID.LightningVoidzone); + var count = enemies.Count; + if (count == 0) + return []; + + var voidzones = new Actor[count]; + var index = 0; + for (var i = 0; i < count; ++i) + { + var z = enemies[i]; + if (z.EventState != 7) + voidzones[index++] = z; + } + return voidzones[..index]; + } +} class WingOfLightning(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.WingOfLightning), new AOEShapeCone(40f, 22.5f.Degrees()), 8); class ThunderIII2(BossModule module) : Components.SpreadFromCastTargets(module, ActionID.MakeSpell(AID.ThunderIII), 6f); @@ -69,7 +90,7 @@ class ThunderIII2(BossModule module) : Components.SpreadFromCastTargets(module, { public override void AddGlobalHints(GlobalHints hints) { - if (CurrentBaits.Count > 0) + if (CurrentBaits.Count != 0) hints.Add("Tankbuster cleave"); } } @@ -94,31 +115,22 @@ public override IEnumerable ActiveAOEs(int slot, Actor actor) return aoes; } - private static readonly Dictionary coords = new() - { - [new WPos(-121, 279)] = [new(-102.935f, 274.357f), new(-108.935f, 262.224f), new(-105.733f, 252.340f)], // SW whirlwind - [new WPos(-93, 251)] = [new(-111.688f, 253.942f), new(-102.276f, 264.313f), new(-108.922f, 276.528f)] // NW whirlwind - }; - - private static readonly float[] delays = [8.6f, 16.7f, 24.7f]; + private static readonly double[] delays = [8.6d, 16.7d, 24.7d]; private static readonly Angle[] angles = [89.999f.Degrees(), 44.998f.Degrees(), 134.999f.Degrees(), -0.003f.Degrees()]; - private void AddAOEs(WPos pos, float delay) - { - for (var i = 0; i < 4; ++i) - _aoes.Add(new(rect, pos, angles[i], WorldState.FutureTime(delay))); - } - public override void OnActorCreated(Actor actor) { + void AddWhirlwind(ReadOnlySpan pos) + { + for (var i = 0; i < 3; ++i) + for (var j = 0; j < 4; ++j) + _aoes.Add(new(rect, WPos.ClampToGrid(pos[i]), angles[j], WorldState.FutureTime(delays[i]))); + } if (actor.OID == (uint)OID.Whirlwind) - foreach (var pos in coords.Keys) - if (actor.Position.AlmostEqual(pos, 1f)) - { - for (var i = 0; i < 3; ++i) - AddAOEs(coords[pos][i], delays[i]); - break; - } + if (actor.Position.AlmostEqual(new WPos(-121f, 279f), 1f)) + AddWhirlwind([new(-102.935f, 274.357f), new(-108.935f, 262.224f), new(-105.733f, 252.340f)]); // SW whirlwind + else + AddWhirlwind([new(-111.688f, 253.942f), new(-102.276f, 264.313f), new(-108.922f, 276.528f)]); // NW whirlwind } public override void OnEventCast(Actor caster, ActorCastEvent spell) diff --git a/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D030RonkanDreamer.cs b/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D030RonkanDreamer.cs index 0f8a0479b7..8de61084a1 100644 --- a/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D030RonkanDreamer.cs +++ b/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D030RonkanDreamer.cs @@ -31,12 +31,12 @@ public enum TetherID : uint } class RonkanFire(BossModule module) : Components.SingleTargetCast(module, ActionID.MakeSpell(AID.RonkanFire)); -class RonkanAbyss(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.RonkanAbyss), 6); +class RonkanAbyss(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.RonkanAbyss), 6f); class WrathOfTheRonka(BossModule module) : Components.GenericAOEs(module) { private readonly List _aoes = new(6); - private static readonly AOEShapeRect rectShort = new(12, 4), rectMedium = new(22, 4), rectLong = new(35, 4); + private static readonly AOEShapeRect rectShort = new(12f, 4f), rectMedium = new(22f, 4f), rectLong = new(35f, 4f); private static readonly (WPos Position, AOEShapeRect Shape)[] aoeMap = [(new(-17, 627), rectMedium), (new(17, 642), rectMedium), @@ -51,26 +51,29 @@ public override void OnTethered(Actor source, ActorTetherInfo tether) if (tether.ID == (uint)TetherID.StatueActivate) { var aoeShape = GetAOEShape(source.Position) ?? rectLong; - _aoes.Add(new(aoeShape, source.Position, source.Rotation, WorldState.FutureTime(6))); + _aoes.Add(new(aoeShape, WPos.ClampToGrid(source.Position), source.Rotation, WorldState.FutureTime(6d))); } } public override void OnEventCast(Actor caster, ActorCastEvent spell) { - if ((AID)spell.Action.ID is AID.WrathOfTheRonkaShort or AID.WrathOfTheRonkaMedium or AID.WrathOfTheRonkaLong) + if (spell.Action.ID is (uint)AID.WrathOfTheRonkaShort or (uint)AID.WrathOfTheRonkaMedium or (uint)AID.WrathOfTheRonkaLong) _aoes.Clear(); } private static AOEShapeRect? GetAOEShape(WPos position) { - foreach (var (pos, shape) in aoeMap) - if (position.AlmostEqual(pos, 1)) - return shape; + for (var i = 0; i < 8; ++i) + { + var aoe = aoeMap[i]; + if (position.AlmostEqual(aoe.Position, 1f)) + return aoe.Shape; + } return null; } } -class BurningBeam(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.BurningBeam), new AOEShapeRect(15, 2)); +class BurningBeam(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.BurningBeam), new AOEShapeRect(15f, 2f)); class D030RonkanDreamerStates : StateMachineBuilder { @@ -87,21 +90,20 @@ public D030RonkanDreamerStates(BossModule module) : base(module) [ModuleInfo(BossModuleInfo.Maturity.Verified, Contributors = "Malediktus", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 651, NameID = 8639)] public class D030RonkanDreamer(WorldState ws, Actor primary) : BossModule(ws, primary, primary.Position.Z > 550 ? arena1.Center : arena2.Center, primary.Position.Z > 550 ? arena1 : arena2) { - private static readonly WPos[] vertices1 = [new(-3.82f, 640.12f), new(-3.95f, 640.67f), new(-3.98f, 646.62f), new(-6.08f, 646.51f), new(-6.58f, 644.99f), - new(-6.28f, 643.05f), new(-6.38f, 641.22f), new(-6.60f, 639.71f), new(-6.29f, 639.34f), new(-4.27f, 639.03f)]; - private static readonly WPos[] vertices2 = [new(6.61f, 625.6f), new(6.3f, 627.46f), new(6.32f, 629.1f), new(6.54f, 630.78f), new(6.28f, 631.19f), - new(4.28f, 631.45f), new(3.83f, 630.55f), new(3.82f, 629.67f), new(3.96f, 623.91f), new(6.07f, 623.83f)]; - private static readonly WPos[] vertices3 = [new(-3.77f, 418.91f), new(-3.94f, 419.58f), new(-3.97f, 425.34f), new(-6.11f, 425.47f), new(-6.59f, 423.67f), - new(-6.38f, 421.66f), new(-6.38f, 420.01f), new(-6.53f, 418.49f), new(-6.27f, 418.12f), new(-4, 417.82f), - new(-3.77f, 418.91f)]; - private static readonly WPos[] vertices4 = [new(6.09f, 432.98f), new(6.64f, 434.58f), new(6.37f, 436.54f), new(6.31f, 438.11f), new(6.50f, 439.59f), - new(6.48f, 440.24f), new(4.29f, 440.32f), new(3.81f, 439.47f), new(3.95f, 438.75f), new(4.00f, 432.74f), - new(6.09f, 432.98f)]; - private static readonly ArenaBoundsComplex arena1 = new([new Rectangle(new(0, 640), 17.5f, 23)], [new PolygonCustom(vertices1), new PolygonCustom(vertices2)]); - private static readonly ArenaBoundsComplex arena2 = new([new Rectangle(new(0, 434.5f), 17.5f, 24)], [new PolygonCustom(vertices3), new PolygonCustom(vertices4)]); + private static readonly WPos[] vertices1 = [new(-4.299f, 646.21f), new(-4.298f, 640.685f), new(-4.118f, 640.131f), new(-4.467f, 639.508f), new(-6.074f, 639.653f), + new(-6.195f, 639.858f), new(-5.99f, 641.313f), new(-5.958f, 643.01f), new(-6.236f, 644.911f), new(-5.856f, 646.17f)]; + private static readonly WPos[] vertices2 = [new(6.074f, 630.811f), new(6.195f, 630.606f), new(5.99f, 629.151f), new(5.958f, 627.454f), new(6.236f, 625.553f), + new(5.856f, 624.294f), new(4.299f, 624.254f), new(4.298f, 629.779f), new(4.118f, 630.333f), new(4.467f, 630.956f)]; + private static readonly WPos[] vertices3 = [new(6.074f, 439.811f), new(6.195f, 439.606f), new(5.99f, 438.151f), new(5.958f, 436.454f), new(6.236f, 434.553f), + new(5.856f, 433.294f), new(4.299f, 433.254f), new(4.298f, 438.779f), new(4.118f, 439.333f), new(4.467f, 439.956f)]; + private static readonly WPos[] vertices4 = [new(-4.299f, 424.978f), new(-4.298f, 419.453f), new(-4.118f, 418.899f), new(-4.467f, 418.277f), new(-6.074f, 418.421f), + new(-6.195f, 418.626f), new(-5.99f, 420.081f), new(-5.958f, 421.778f), new(-6.236f, 423.679f), new(-5.856f, 424.938f)]; + private static readonly ArenaBoundsComplex arena1 = new([new Rectangle(new(default, 640f), 17.25f, 23f)], [new PolygonCustomO(vertices1, 0.5f), new PolygonCustomO(vertices2, 0.5f)]); + private static readonly ArenaBoundsComplex arena2 = new([new Rectangle(new(default, 434.5f), 17.25f, 23.75f)], [new PolygonCustomO(vertices3, 0.5f), new PolygonCustomO(vertices4, 0.5f)]); protected override void DrawEnemies(int pcSlot, Actor pc) { - Arena.Actors(Enemies(OID.RonkanVessel).Concat([PrimaryActor]).Concat(Enemies(OID.RonkanThorn)).Concat(Enemies(OID.RonkanIdol))); + Arena.Actor(PrimaryActor); + Arena.Actors(Enemies([(uint)OID.RonkanVessel, (uint)OID.RonkanThorn, (uint)OID.RonkanIdol])); } } diff --git a/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D031Lozatl.cs b/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D031Lozatl.cs index b7781da050..6deb19e0c0 100644 --- a/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D031Lozatl.cs +++ b/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D031Lozatl.cs @@ -21,36 +21,36 @@ public enum AID : uint LozatlsFury2 = 15503 // Boss->self, 4.0s cast, range 60 width 20 rect } -abstract class LozatlsFury(BossModule module, AID aid) : Components.SimpleAOEs(module, ActionID.MakeSpell(aid), new AOEShapeRect(60, 20)); +abstract class LozatlsFury(BossModule module, AID aid) : Components.SimpleAOEs(module, ActionID.MakeSpell(aid), new AOEShapeRect(60f, 10f)); class LozatlsFury1(BossModule module) : LozatlsFury(module, AID.LozatlsFury1); class LozatlsFury2(BossModule module) : LozatlsFury(module, AID.LozatlsFury2); class Stonefist(BossModule module) : Components.SingleTargetDelayableCast(module, ActionID.MakeSpell(AID.Stonefist)); class LozatlsScorn(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.LozatlsScorn)); -class SunToss(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.SunToss), 5); +class SunToss(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.SunToss), 5f); class RonkanLight(BossModule module) : Components.GenericAOEs(module) { - private static readonly AOEShapeRect rect = new(60, 20); //TODO: double halfwidth is strange + private static readonly AOEShapeRect rect = new(60f, 20f); private AOEInstance? _aoe; public override IEnumerable ActiveAOEs(int slot, Actor actor) => Utils.ZeroOrOne(_aoe); public override void OnActorEAnim(Actor actor, uint state) { + void AddAOE(Angle rot) => _aoe = new(rect, D031Lozatl.ArenaCenter, rot, WorldState.FutureTime(8d)); if (state == 0x00040008) { - var activation = WorldState.FutureTime(8); - if (actor.Position.AlmostEqual(new(8, 328), 1)) - _aoe = new(rect, D031Lozatl.ArenaCenter, 90.Degrees(), activation); - else if (actor.Position.AlmostEqual(new(-7, 328), 1)) - _aoe = new(rect, D031Lozatl.ArenaCenter, -90.Degrees(), activation); + if (actor.Position.AlmostEqual(new(8, 328), 1f)) + AddAOE(90f.Degrees()); + else if (actor.Position.AlmostEqual(new(-7, 328), 1f)) + AddAOE(-90f.Degrees()); } } public override void OnEventCast(Actor caster, ActorCastEvent spell) { - if ((AID)spell.Action.ID is AID.RonkanLightLeft or AID.RonkanLightRight) + if (spell.Action.ID is (uint)AID.RonkanLightLeft or (uint)AID.RonkanLightRight) _aoe = null; } } @@ -72,6 +72,6 @@ public D031LozatlStates(BossModule module) : base(module) [ModuleInfo(BossModuleInfo.Maturity.Verified, Contributors = "Malediktus", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 651, NameID = 8231)] public class D031Lozatl(WorldState ws, Actor primary) : BossModule(ws, primary, arena.Center, arena) { - public static readonly WPos ArenaCenter = new(0, 315); - private static readonly ArenaBoundsComplex arena = new([new Polygon(ArenaCenter, 19.5f * CosPI.Pi40th, 40)], [new Rectangle(new(0, 335.1f), 20, 2), new Rectangle(new(0, 294.5f), 20, 2)]); + public static readonly WPos ArenaCenter = new(default, 315f); + private static readonly ArenaBoundsComplex arena = new([new Polygon(ArenaCenter, 19.5f * CosPI.Pi40th, 40)], [new Rectangle(new(default, 335.1f), 20f, 2f), new Rectangle(new(default, 294.5f), 20f, 2f)]); } diff --git a/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D032Batsquatch.cs b/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D032Batsquatch.cs index 84f2552526..77261dae07 100644 --- a/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D032Batsquatch.cs +++ b/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D032Batsquatch.cs @@ -11,43 +11,52 @@ public enum OID : uint public enum AID : uint { - AutoAttack = 870, // 27B0->player, no cast, single-target + AutoAttack = 870, // Boss->player, no cast, single-target - RipperFang = 15505, // 27B0->player, 4.0s cast, single-target - Soundwave = 15506, // 27B0->self, 3.0s cast, range 40 circle - Subsonics = 15507, // 27B0->self, 6.0s cast, single-target - Subsonics2 = 15508, // 233C->self, no cast, range 40 circle - FallingRock = 15510, // 233C->self, 2.0s cast, range 3 circle - FallingRock2 = 15509, // 233C->self, 2.0s cast, range 2 circle - FallingBoulder = 15511, // 233C->self, 2.0s cast, range 4 circle - Towerfall = 15512 // 233C->self, 3.0s cast, range 15 30.5-degree cone + RipperFang = 15505, // Boss->player, 4.0s cast, single-target + Soundwave = 15506, // Boss->self, 3.0s cast, range 40 circle + Subsonics = 15507, // Boss->self, 6.0s cast, single-target + Subsonics2 = 15508, // Helper->self, no cast, range 40 circle + FallingRock = 15510, // Helper->self, 2.0s cast, range 3 circle + FallingRock2 = 15509, // Helper->self, 2.0s cast, range 2 circle + FallingBoulder = 15511, // Helper->self, 2.0s cast, range 4 circle + Towerfall = 15512 // Helper->self, 3.0s cast, range 15 30-degree cone } class Towerfall(BossModule module) : Components.GenericAOEs(module) { - private static readonly AOEShapeCone cone = new(15, 15.25f.Degrees()); - public List _aoes = []; + private static readonly AOEShapeCone cone = new(15f, 15f.Degrees()); + public List _aoes = new(3); public override IEnumerable ActiveAOEs(int slot, Actor actor) => _aoes; public override void OnActorCreated(Actor actor) { - if ((OID)actor.OID == OID.StalactiteBig) - _aoes.Add(new(cone, actor.Position, actor.Rotation, WorldState.FutureTime(12))); + if (actor.OID == (uint)OID.StalactiteBig) // preliminary, caster position is somewhat off from stalactite position... + _aoes.Add(new(cone, actor.Position, actor.Rotation, WorldState.FutureTime(12d))); } public override void OnCastStarted(Actor caster, ActorCastInfo spell) { - if ((AID)spell.Action.ID == AID.Soundwave) + if (spell.Action.ID == (uint)AID.Towerfall) { - for (var i = 0; i < _aoes.Count; ++i) - _aoes[i] = _aoes[i] with { Activation = Module.CastFinishAt(spell, 3.7f) }; + var count = _aoes.Count; // remove preliminary AOE + for (var i = 0; i < count; ++i) + { + var aoe = _aoes[i]; + if (aoe.Origin == caster.Position) + { + _aoes.Remove(aoe); + break; + } + } + _aoes.Add(new(cone, spell.LocXZ, spell.Rotation, Module.CastFinishAt(spell))); // add aoe with correct location and activation } } public override void OnCastFinished(Actor caster, ActorCastInfo spell) { - if ((AID)spell.Action.ID == AID.Towerfall) + if (_aoes.Count != 0 && spell.Action.ID == (uint)AID.Towerfall) _aoes.Clear(); } } @@ -55,9 +64,9 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell) class Soundwave(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.Soundwave), "Raidwide + towers fall"); class Subsonics(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.Subsonics), "Raidwide x11"); class RipperFang(BossModule module) : Components.SingleTargetDelayableCast(module, ActionID.MakeSpell(AID.RipperFang)); -class FallingBoulder(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.FallingBoulder), 4); -class FallingRock(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.FallingRock), 3); -class FallingRock2(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.FallingRock2), 2); +class FallingBoulder(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.FallingBoulder), 4f); +class FallingRock(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.FallingRock), 3f); +class FallingRock2(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.FallingRock2), 2f); class D032BatsquatchStates : StateMachineBuilder { @@ -77,5 +86,5 @@ public D032BatsquatchStates(BossModule module) : base(module) [ModuleInfo(BossModuleInfo.Maturity.Verified, Contributors = "Malediktus", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 651, NameID = 8232)] public class D032Batsquatch(WorldState ws, Actor primary) : BossModule(ws, primary, arena.Center, arena) { - private static readonly ArenaBoundsComplex arena = new([new Polygon(new(62, -35), 14.5f * CosPI.Pi28th, 28)], [new Rectangle(new(61.9f, -20), 20, 2), new Rectangle(new(61.9f, -50), 20, 2)]); + private static readonly ArenaBoundsComplex arena = new([new Polygon(new(62f, -35f), 14.5f * CosPI.Pi28th, 28)], [new Rectangle(new(61.9f, -20), 20f, 2f), new Rectangle(new(61.9f, -50f), 20f, 2f)]); } diff --git a/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D033Eros.cs b/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D033Eros.cs index 86bbde93c1..ad9bb80f6f 100644 --- a/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D033Eros.cs +++ b/BossMod/Modules/Shadowbringers/Dungeon/D03QitanaRavel/D033Eros.cs @@ -35,85 +35,103 @@ public enum AID : uint ConfessionOfFaithSpread = 15523 // Helper->player, 5.8s cast, range 5 circle, spread } -class HoundOutOfHeaven(BossModule module) : Components.StretchTetherDuo(module, 19, 5.2f); -class ViperPoisonVoidzone(BossModule module) : Components.PersistentVoidzoneAtCastTarget(module, 6, ActionID.MakeSpell(AID.ViperPoisonPatterns), m => m.Enemies(OID.PoisonVoidzone).Where(z => z.EventState != 7), 0); -class ConfessionOfFaithStack(BossModule module) : Components.StackWithCastTargets(module, ActionID.MakeSpell(AID.ConfessionOfFaithStack), 6, 4, 4); -class ConfessionOfFaithSpread(BossModule module) : Components.SpreadFromCastTargets(module, ActionID.MakeSpell(AID.ConfessionOfFaithSpread), 5); - -class ConfessionOfFaithBreath(BossModule module) : Components.GenericAOEs(module) +class HoundOutOfHeaven(BossModule module) : Components.StretchTetherDuo(module, 19f, 5.2f); +class ViperPoisonVoidzone(BossModule module) : Components.PersistentVoidzoneAtCastTarget(module, 6f, ActionID.MakeSpell(AID.ViperPoisonPatterns), GetVoidzones, 0.8f) { - private static readonly AOEShapeCone cone = new(60, 30.Degrees()); - private readonly List _aoes = new(2); - - public override IEnumerable ActiveAOEs(int slot, Actor actor) => _aoes; - - public override void OnCastStarted(Actor caster, ActorCastInfo spell) + private static Actor[] GetVoidzones(BossModule module) { - if ((AID)spell.Action.ID == AID.ConfessionOfFaithCenter) - _aoes.Add(new(cone, caster.Position + 5 * (caster.Rotation + 180.Degrees()).ToDirection(), spell.Rotation, Module.CastFinishAt(spell))); - else if ((AID)spell.Action.ID is AID.ConfessionOfFaithLeft or AID.ConfessionOfFaithRight) - _aoes.Add(new(cone, caster.Position + Module.PrimaryActor.HitboxRadius * (caster.Rotation + 180.Degrees()).ToDirection(), spell.Rotation, Module.CastFinishAt(spell))); - } - - public override void OnCastFinished(Actor caster, ActorCastInfo spell) - { - if ((AID)spell.Action.ID is AID.ConfessionOfFaithCenter or AID.ConfessionOfFaithLeft) - _aoes.Clear(); + var enemies = module.Enemies((uint)OID.PoisonVoidzone); + var count = enemies.Count; + if (count == 0) + return []; + + var voidzones = new Actor[count]; + var index = 0; + for (var i = 0; i < count; ++i) + { + var z = enemies[i]; + if (z.EventState != 7) + voidzones[index++] = z; + } + return voidzones[..index]; } } +class ConfessionOfFaithStack(BossModule module) : Components.StackWithCastTargets(module, ActionID.MakeSpell(AID.ConfessionOfFaithStack), 6f, 4, 4); +class ConfessionOfFaithSpread(BossModule module) : Components.SpreadFromCastTargets(module, ActionID.MakeSpell(AID.ConfessionOfFaithSpread), 5f); + +abstract class Breath(BossModule module, AID aid) : Components.SimpleAOEs(module, ActionID.MakeSpell(aid), new AOEShapeCone(60f, 30f.Degrees())); +class ConfessionOfFaithCenter(BossModule module) : Breath(module, AID.ConfessionOfFaithCenter); +class ConfessionOfFaithLeft(BossModule module) : Breath(module, AID.ConfessionOfFaithLeft); +class ConfessionOfFaithRight(BossModule module) : Breath(module, AID.ConfessionOfFaithRight); -class ViperPoisonBait(BossModule module) : Components.BaitAwayCast(module, ActionID.MakeSpell(AID.ViperPoisonBait), new AOEShapeCircle(6), true) +class ViperPoisonBait(BossModule module) : Components.BaitAwayCast(module, ActionID.MakeSpell(AID.ViperPoisonBait), new AOEShapeCircle(6f), true) { public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints) { base.AddAIHints(slot, actor, assignment, hints); if (ActiveBaits.Any(x => x.Target == actor)) - hints.AddForbiddenZone(ShapeDistance.Rect(new(17, -518), new(17, -558), 13)); + hints.AddForbiddenZone(ShapeDistance.Rect(new(17f, -518f), new(17f, -558f), 13f)); } } -class Inhale(BossModule module) : Components.KnockbackFromCastTarget(module, ActionID.MakeSpell(AID.Inhale), 50, kind: Kind.TowardsOrigin) +class Inhale(BossModule module) : Components.KnockbackFromCastTarget(module, ActionID.MakeSpell(AID.Inhale), 50f, kind: Kind.TowardsOrigin) { private readonly ViperPoisonVoidzone _aoe = module.FindComponent()!; public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints) { - var source = Sources(slot, actor).FirstOrDefault(); - if (source != default) + var source = Casters.Count != 0 ? Casters[0] : null; + if (source != null) { - Components.GenericAOEs.AOEInstance[] component = [.. _aoe.ActiveAOEs(slot, actor)]; - var len = component.Length; - var forbidden = new List>(len); - for (var i = 0; i < len; ++i) - forbidden.Add(ShapeDistance.Rect(component[i].Origin, Module.PrimaryActor.Rotation, 40, 0, 6)); - if (forbidden.Count != 0) - hints.AddForbiddenZone(ShapeDistance.Union(forbidden), source.Activation); + var component = _aoe.Sources(Module).ToList(); + var count = component.Count; + var forbidden = new Func[count]; + for (var i = 0; i < count; ++i) + forbidden[i] = ShapeDistance.Rect(component[i].Position, Module.PrimaryActor.Rotation, 40f, default, 6f); + if (forbidden.Length != 0) + hints.AddForbiddenZone(ShapeDistance.Union(forbidden), Module.CastFinishAt(source.CastInfo)); } } - public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => Module.FindComponent()?.ActiveAOEs(slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)) ?? false; + public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) + { + foreach (var aoe in _aoe.ActiveAOEs(slot, actor)) + { + if (aoe.Check(pos)) + return true; + } + return false; + } } -class HeavingBreath(BossModule module) : Components.KnockbackFromCastTarget(module, ActionID.MakeSpell(AID.HeavingBreath), 35, kind: Kind.DirForward, stopAtWall: true) +class HeavingBreath(BossModule module) : Components.KnockbackFromCastTarget(module, ActionID.MakeSpell(AID.HeavingBreath), 35f, kind: Kind.DirForward, stopAtWall: true) { private readonly ViperPoisonVoidzone _aoe = module.FindComponent()!; public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints) { - var source = Sources(slot, actor).FirstOrDefault(); - if (source != default) + var source = Casters.Count != 0 ? Casters[0] : null; + if (source != null) { - Components.GenericAOEs.AOEInstance[] component = [.. _aoe.ActiveAOEs(slot, actor)]; - var len = component.Length; - var forbidden = new List>(len); - for (var i = 0; i < len; ++i) - forbidden.Add(ShapeDistance.Rect(component[i].Origin, new WDir(0, 1), 40, 40, 6)); - if (forbidden.Count != 0) - hints.AddForbiddenZone(ShapeDistance.Union(forbidden), source.Activation); + var component = _aoe.Sources(Module).ToList(); + var count = component.Count; + var forbidden = new Func[count]; + for (var i = 0; i < count; ++i) + forbidden[i] = ShapeDistance.Rect(component[i].Position, new WDir(0f, 1f), 40f, 40f, 6f); + if (forbidden.Length != 0) + hints.AddForbiddenZone(ShapeDistance.Union(forbidden), Module.CastFinishAt(source.CastInfo)); } } - public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => Module.FindComponent()?.ActiveAOEs(slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)) ?? false; + public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) + { + foreach (var aoe in _aoe.ActiveAOEs(slot, actor)) + { + if (aoe.Check(pos)) + return true; + } + return false; + } } class Glossolalia(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.Glossolalia)); @@ -129,7 +147,9 @@ public D033ErosStates(BossModule module) : base(module) .ActivateOnEnter() .ActivateOnEnter() .ActivateOnEnter() - .ActivateOnEnter() + .ActivateOnEnter() + .ActivateOnEnter() + .ActivateOnEnter() .ActivateOnEnter() .ActivateOnEnter() .ActivateOnEnter() diff --git a/BossMod/Modules/Shadowbringers/Dungeon/D04MalikahsWell/D041GreaterArmadillo.cs b/BossMod/Modules/Shadowbringers/Dungeon/D04MalikahsWell/D041GreaterArmadillo.cs index 86ccfb91f3..370c52e973 100644 --- a/BossMod/Modules/Shadowbringers/Dungeon/D04MalikahsWell/D041GreaterArmadillo.cs +++ b/BossMod/Modules/Shadowbringers/Dungeon/D04MalikahsWell/D041GreaterArmadillo.cs @@ -24,10 +24,10 @@ public enum AID : uint } class StoneFlail(BossModule module) : Components.SingleTargetCast(module, ActionID.MakeSpell(AID.StoneFlail)); -class FallingRock(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.FallingRock), 4); -class FlailSmash(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.FlailSmash), 10); -class HeadToss(BossModule module) : Components.StackWithCastTargets(module, ActionID.MakeSpell(AID.HeadToss), 6, 4, 4); -class Earthshake(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.Earthshake), new AOEShapeDonut(10, 20)); +class FallingRock(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.FallingRock), 4f); +class FlailSmash(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.FlailSmash), 10f); +class HeadToss(BossModule module) : Components.StackWithCastTargets(module, ActionID.MakeSpell(AID.HeadToss), 6f, 4, 4); +class Earthshake(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.Earthshake), new AOEShapeDonut(10f, 20f)); class Rehydration(BossModule module) : Components.CastInterruptHint(module, ActionID.MakeSpell(AID.Rehydration), showNameInHint: true); class RightRound(BossModule module) : Components.GenericAOEs(module) @@ -39,13 +39,13 @@ class RightRound(BossModule module) : Components.GenericAOEs(module) public override void OnCastStarted(Actor caster, ActorCastInfo spell) { - if ((AID)spell.Action.ID == AID.RightRoundVisual) + if (spell.Action.ID == (uint)AID.RightRoundVisual) // TODO: find more precise way to calculate spell location. seems to be neither spell.LocXZ nor morningstar location, instead its somewhere in the middle, seen distances of 0-7.6 away from morningstar _aoe = new(circle, spell.LocXZ, default, Module.CastFinishAt(spell, 0.9f)); } public override void OnEventCast(Actor caster, ActorCastEvent spell) { - if ((AID)spell.Action.ID == AID.RightRound) + if (spell.Action.ID == (uint)AID.RightRound) _aoe = null; } } @@ -68,16 +68,19 @@ public D041GreaterArmadilloStates(BossModule module) : base(module) [ModuleInfo(BossModuleInfo.Maturity.Verified, Contributors = "The Combat Reborn Team (Malediktus)", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 656, NameID = 8252)] public class D041GreaterArmadillo(WorldState ws, Actor primary) : BossModule(ws, primary, arena.Center, arena) { - private static readonly ArenaBoundsComplex arena = new([new Circle(new(278, 204), 19.5f)], [new Rectangle(new(278, 223.75f), 20, 1)]); + private static readonly ArenaBoundsComplex arena = new([new Polygon(new(278f, 204f), 19.5f, 40)], [new Rectangle(new(278f, 223.594f), 20f, 1f)]); protected override void CalculateModuleAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints) { - foreach (var e in hints.PotentialTargets) + var count = hints.PotentialTargets.Count; + if (count == 0) + return; + for (var i = 0; i < count; ++i) { - e.Priority = (OID)e.Actor.OID switch + var e = hints.PotentialTargets[i]; + e.Priority = e.Actor.OID switch { - OID.PackArmadillo => 2, - OID.Boss => 1, + (uint)OID.PackArmadillo => 1, _ => 0 }; } @@ -86,6 +89,6 @@ protected override void CalculateModuleAIHints(int slot, Actor actor, PartyRoles protected override void DrawEnemies(int pcSlot, Actor pc) { Arena.Actor(PrimaryActor); - Arena.Actors(Enemies(OID.PackArmadillo)); + Arena.Actors(Enemies((uint)OID.PackArmadillo)); } } diff --git a/BossMod/Modules/Shadowbringers/Dungeon/D04MalikahsWell/D042AmphibiousTalos.cs b/BossMod/Modules/Shadowbringers/Dungeon/D04MalikahsWell/D042AmphibiousTalos.cs index ff2e8b9822..f36d460a26 100644 --- a/BossMod/Modules/Shadowbringers/Dungeon/D04MalikahsWell/D042AmphibiousTalos.cs +++ b/BossMod/Modules/Shadowbringers/Dungeon/D04MalikahsWell/D042AmphibiousTalos.cs @@ -10,6 +10,7 @@ public enum OID : uint public enum AID : uint { AutoAttack = 872, // Boss->player, no cast, single-target + Efface = 15595, // Boss->player, 4.5s cast, single-target Wellbore = 15597, // Boss->self, 7.0s cast, range 15 circle GeyserEruption = 15598, // Helper->self, 3.5s cast, range 8 circle @@ -26,18 +27,18 @@ public enum IconID : uint class SwiftSpillRotation(BossModule module) : Components.GenericRotatingAOE(module) { - private static readonly Angle a60 = 60.Degrees(); + private static readonly Angle a60 = 60f.Degrees(); private Angle _increment; private Angle _rotation; private DateTime _activation; - private static readonly AOEShapeCone _shape = new(50, 30.Degrees()); + private static readonly AOEShapeCone _shape = new(50f, 30f.Degrees()); public override void OnEventIcon(Actor actor, uint iconID, ulong targetID) { - var increment = (IconID)iconID switch + var increment = iconID switch { - IconID.RotateCW => -a60, - IconID.RotateCCW => a60, + (uint)IconID.RotateCW => -a60, + (uint)IconID.RotateCCW => a60, _ => default }; if (increment != default) @@ -49,7 +50,7 @@ public override void OnEventIcon(Actor actor, uint iconID, ulong targetID) public override void OnCastStarted(Actor caster, ActorCastInfo spell) { - if ((AID)spell.Action.ID == AID.SwiftSpillFirst) + if (spell.Action.ID == (uint)AID.SwiftSpillFirst) { _rotation = spell.Rotation; _activation = Module.CastFinishAt(spell); @@ -60,7 +61,7 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell) public override void OnEventCast(Actor caster, ActorCastEvent spell) { - if ((AID)spell.Action.ID is AID.SwiftSpillFirst or AID.SwiftSpillRest) + if (spell.Action.ID is (uint)AID.SwiftSpillFirst or (uint)AID.SwiftSpillRest) AdvanceSequence(0, WorldState.CurrentTime); } @@ -77,9 +78,28 @@ private void InitIfReady(Actor source) class Efface(BossModule module) : Components.SingleTargetCast(module, ActionID.MakeSpell(AID.Efface)); class HighPressureRaidwide(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.HighPressure)); -class HighPressureKnockback(BossModule module) : Components.KnockbackFromCastTarget(module, ActionID.MakeSpell(AID.HighPressure), 20, stopAtWall: true); -class GeyserEruption(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.GeyserEruption), 8); -class Geysers(BossModule module) : Components.PersistentVoidzone(module, 4, m => m.Enemies(OID.Geyser).Where(v => v.EventState != 7)); +class HighPressureKnockback(BossModule module) : Components.KnockbackFromCastTarget(module, ActionID.MakeSpell(AID.HighPressure), 20f, stopAtWall: true); +class GeyserEruption(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.GeyserEruption), 8f); +class Geysers(BossModule module) : Components.PersistentVoidzone(module, 4, GetVoidzones) +{ + private static Actor[] GetVoidzones(BossModule module) + { + var enemies = module.Enemies((uint)OID.Geyser); + var count = enemies.Count; + if (count == 0) + return []; + + var voidzones = new Actor[count]; + var index = 0; + for (var i = 0; i < count; ++i) + { + var z = enemies[i]; + if (z.EventState != 7) + voidzones[index++] = z; + } + return voidzones[..index]; + } +} class Wellbore(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.Wellbore), 15); class D042AmphibiousTalosStates : StateMachineBuilder @@ -100,7 +120,5 @@ public D042AmphibiousTalosStates(BossModule module) : base(module) [ModuleInfo(BossModuleInfo.Maturity.Verified, Contributors = "The Combat Reborn Team (Malediktus)", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 656, NameID = 8250)] public class D042AmphibiousTalos(WorldState ws, Actor primary) : BossModule(ws, primary, arena.Center, arena) { - private static readonly Circle[] union = [new Circle(new(208, 275), 19.55f)]; - private static readonly Rectangle[] difference = [new Rectangle(new(208, 255.4f), 20, 1), new Rectangle(new(208, 294.55f), 20, 1)]; - private static readonly ArenaBoundsComplex arena = new(union, difference); + private static readonly ArenaBoundsComplex arena = new([new Polygon(new(208f, 275f), 19.5f, 48)], [new Rectangle(new(208f, 255.45f), 20f, 1f), new Rectangle(new(208.089f, 294.664f), 20f, 1.25f, 1.92f.Degrees())]); } diff --git a/BossMod/Modules/Shadowbringers/Dungeon/D04MalikahsWell/D043Storge.cs b/BossMod/Modules/Shadowbringers/Dungeon/D04MalikahsWell/D043Storge.cs index 8797cf94be..e257bf4f2d 100644 --- a/BossMod/Modules/Shadowbringers/Dungeon/D04MalikahsWell/D043Storge.cs +++ b/BossMod/Modules/Shadowbringers/Dungeon/D04MalikahsWell/D043Storge.cs @@ -30,58 +30,49 @@ public enum AID : uint } class IntestinalCrank(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.IntestinalCrank)); -class BreakingWheel(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.BreakingWheel1), new AOEShapeDonut(5, 60)); -class HereticsFork(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.HereticsFork1), new AOEShapeCross(60, 5)); -class CrystalNail(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.CrystalNail), 5); +class BreakingWheel(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.BreakingWheel1), new AOEShapeDonut(5f, 60f)); +class HereticsFork(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.HereticsFork1), new AOEShapeCross(60f, 5f)); +class CrystalNail(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.CrystalNail), 5f); class HereticsForkBreakingWheelStreak(BossModule module) : Components.GenericAOEs(module) { - private static readonly AOEShapeDonut donut = new(5, 60); - private static readonly AOEShapeCross cross = new(60, 5); - private readonly List _aoes = new(4); - private AOEInstance? _aoe; + private static readonly AOEShapeDonut donut = new(5f, 60f); + private static readonly AOEShapeCross cross = new(60f, 5f); + private readonly List _aoes = new(5); - public override IEnumerable ActiveAOEs(int slot, Actor actor) - { - var count = _aoes.Count; - if (count != 0) - yield return _aoes[0]; - if (count == 0 && _aoe != null) - yield return _aoe.Value; - } + public override IEnumerable ActiveAOEs(int slot, Actor actor) => _aoes.Count != 0 ? [_aoes[0]] : []; public override void OnCastStarted(Actor caster, ActorCastInfo spell) { - switch ((AID)spell.Action.ID) + void AddAOE(AOEShape shape) { - case AID.HereticsFork2: - _aoes.Add(new(cross, caster.Position, spell.Rotation, Module.CastFinishAt(spell))); - break; - case AID.BreakingWheel2: - _aoes.Add(new(donut, caster.Position, default, Module.CastFinishAt(spell))); - break; - case AID.HereticsFork3: - _aoe = new(cross, caster.Position, spell.Rotation, Module.CastFinishAt(spell)); + _aoes.Add(new(shape, spell.LocXZ, spell.Rotation, Module.CastFinishAt(spell))); + _aoes.Sort((x, y) => x.Activation.CompareTo(y.Activation)); + } + switch (spell.Action.ID) + { + case (uint)AID.HereticsFork2: + case (uint)AID.HereticsFork3: + AddAOE(cross); break; - case AID.BreakingWheel3: - _aoe = new(donut, caster.Position, default, Module.CastFinishAt(spell)); + case (uint)AID.BreakingWheel2: + case (uint)AID.BreakingWheel3: + AddAOE(donut); break; } } public override void OnCastFinished(Actor caster, ActorCastInfo spell) { - switch ((AID)spell.Action.ID) + switch (spell.Action.ID) { - case AID.HereticsFork2: - case AID.BreakingWheel2: + case (uint)AID.HereticsFork2: + case (uint)AID.BreakingWheel2: + case (uint)AID.HereticsFork3: + case (uint)AID.BreakingWheel3: if (_aoes.Count != 0) _aoes.RemoveAt(0); break; - case AID.HereticsFork3: - case AID.BreakingWheel3: - _aoe = null; - break; } } } @@ -102,6 +93,6 @@ public D043StorgeStates(BossModule module) : base(module) [ModuleInfo(BossModuleInfo.Maturity.Verified, Contributors = "The Combat Reborn Team (Malediktus)", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 656, NameID = 8249)] public class D043Storge(WorldState ws, Actor primary) : BossModule(ws, primary, arena.Center, arena) { - private static readonly ArenaBoundsComplex arena = new([new Cross(new(196, -95), 19.5f, 14), new Square(new(182, -81), 0.3f, 45.Degrees()), - new Square(new(210, -81), 0.3f, 45.Degrees()), new Square(new(182, -109), 0.3f, 45.Degrees()), new Square(new(210, -109), 0.3f, 45.Degrees())]); + private static readonly ArenaBoundsComplex arena = new([new Cross(new(196f, -95f), 19.5f, 14f), new Square(new(182f, -81f), 0.3f, 45f.Degrees()), + new Square(new(210, -81), 0.3f, 45f.Degrees()), new Square(new(182f, -109f), 0.3f, 45f.Degrees()), new Square(new(210f, -109f), 0.3f, 45f.Degrees())]); } diff --git a/BossMod/Modules/Shadowbringers/Ultimate/TEA/P3TemporalStasis.cs b/BossMod/Modules/Shadowbringers/Ultimate/TEA/P3TemporalStasis.cs index 15b35ebd5e..e236ddc06f 100644 --- a/BossMod/Modules/Shadowbringers/Ultimate/TEA/P3TemporalStasis.cs +++ b/BossMod/Modules/Shadowbringers/Ultimate/TEA/P3TemporalStasis.cs @@ -26,11 +26,11 @@ public override void AddHints(int slot, Actor actor, TextHints hints) switch (_playerMechanics[slot]) { case Mechanic.StayClose: - if (FindPartner(slot) is var partner1 && partner1 != null && (partner1.Position - actor.Position).LengthSq() > 5 * 5) + if (FindPartner(slot) is var partner1 && partner1 != null && (partner1.Position - actor.Position).LengthSq() > 25f) hints.Add("Stay closer to partner!"); break; case Mechanic.StayFar: - if (FindPartner(slot) is var partner2 && partner2 != null && (partner2.Position - actor.Position).LengthSq() < 30 * 30) + if (FindPartner(slot) is var partner2 && partner2 != null && (partner2.Position - actor.Position).LengthSq() < 900f) hints.Add("Stay farther from partner!"); break; } @@ -49,11 +49,11 @@ public override void DrawArenaForeground(int pcSlot, Actor pc) { case Mechanic.StayClose: if (FindPartner(pcSlot) is var partner1 && partner1 != null) - Arena.AddLine(pc.Position, partner1.Position, (partner1.Position - pc.Position).LengthSq() > 5 * 5 ? Colors.Danger : Colors.Safe); + Arena.AddLine(pc.Position, partner1.Position, (partner1.Position - pc.Position).LengthSq() > 25f ? Colors.Danger : Colors.Safe); break; case Mechanic.StayFar: if (FindPartner(pcSlot) is var partner2 && partner2 != null) - Arena.AddLine(pc.Position, partner2.Position, (partner2.Position - pc.Position).LengthSq() < 30 * 30 ? Colors.Danger : Colors.Safe); + Arena.AddLine(pc.Position, partner2.Position, (partner2.Position - pc.Position).LengthSq() < 300f ? Colors.Danger : Colors.Safe); break; } @@ -64,19 +64,19 @@ public override void DrawArenaForeground(int pcSlot, Actor pc) public override void OnStatusGain(Actor actor, ActorStatus status) { - switch ((SID)status.ID) + switch (status.ID) { - case SID.AggravatedAssault: + case (uint)SID.AggravatedAssault: AssignMechanic(actor, Mechanic.AvoidDamage); ForbiddenPlayers.Set(Raid.FindSlot(actor.InstanceID)); break; - case SID.HouseArrest: + case (uint)SID.HouseArrest: AssignMechanic(actor, Mechanic.StayClose); break; - case SID.RestrainingOrder: + case (uint)SID.RestrainingOrder: AssignMechanic(actor, Mechanic.StayFar); break; - case SID.TemporalDisplacement: + case (uint)SID.TemporalDisplacement: Frozen = true; break; }