From 1a7ba899ac8f1a888b4a3b29b66d5ea78e00ca26 Mon Sep 17 00:00:00 2001 From: CarnifexOptimus <156172553+CarnifexOptimus@users.noreply.github.com> Date: Fri, 27 Dec 2024 07:16:43 +0100 Subject: [PATCH] chaotic stuff and merge fixes --- BossMod/BossModule/BossModuleInfo.cs | 1 + BossMod/Config/ModuleViewer.cs | 1 + .../Alliance/A11Prishe/ArenaChanges.cs | 9 +-- .../Ch01CloudOfDarkness/ArenaChanges.cs | 73 +++++++++++++++++++ .../Ch01CloudOfDarkness.cs | 67 ++++------------- .../Ch01CloudOfDarknessEnums.cs | 7 +- .../Chaotic/Ch01CloudOfDarkness/Enaero.cs | 4 +- .../Chaotic/Ch01CloudOfDarkness/Endeath.cs | 8 +- .../D092OverseerKanilokka.cs | 14 ++-- .../Modules/Dawntrail/Ultimate/FRU/FRUAI.cs | 7 -- .../Dawntrail/Ultimate/FRU/P2DiamondDust.cs | 21 ++---- .../Ultimate/FRU/P4DarklitDragonsong.cs | 2 +- .../Extreme/Ex3Titan/Ex3TitanAI.cs | 5 +- BossMod/Util/Angle.cs | 11 --- 14 files changed, 120 insertions(+), 110 deletions(-) create mode 100644 BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/ArenaChanges.cs diff --git a/BossMod/BossModule/BossModuleInfo.cs b/BossMod/BossModule/BossModuleInfo.cs index 210c23caa8..3c07066cf1 100644 --- a/BossMod/BossModule/BossModuleInfo.cs +++ b/BossMod/BossModule/BossModuleInfo.cs @@ -38,6 +38,7 @@ public enum Category Ultimate, Unreal, Alliance, + Chaotic, Foray, VariantCriterion, DeepDungeon, diff --git a/BossMod/Config/ModuleViewer.cs b/BossMod/Config/ModuleViewer.cs index 6470090336..82c01419a0 100644 --- a/BossMod/Config/ModuleViewer.cs +++ b/BossMod/Config/ModuleViewer.cs @@ -58,6 +58,7 @@ public ModuleViewer(PlanDatabase? planDB, WorldState ws) Customize(BossModuleInfo.Category.DeepDungeon, contentType.GetRow(21)); Customize(BossModuleInfo.Category.Ultimate, contentType.GetRow(28)); Customize(BossModuleInfo.Category.VariantCriterion, contentType.GetRow(30)); + Customize(BossModuleInfo.Category.Chaotic, contentType.GetRow(37)); var playStyle = Service.LuminaSheet()!; Customize(BossModuleInfo.Category.Foray, playStyle.GetRow(6)); diff --git a/BossMod/Modules/Dawntrail/Alliance/A11Prishe/ArenaChanges.cs b/BossMod/Modules/Dawntrail/Alliance/A11Prishe/ArenaChanges.cs index 612bcc7703..99562d8788 100644 --- a/BossMod/Modules/Dawntrail/Alliance/A11Prishe/ArenaChanges.cs +++ b/BossMod/Modules/Dawntrail/Alliance/A11Prishe/ArenaChanges.cs @@ -37,17 +37,12 @@ public override void OnEventEnvControl(byte index, uint state) SetArena(ArenaENVC02000100); break; case 0x00080004 or 0x00800004: - SetDefaultArena(); + Arena.Bounds = A11Prishe.DefaultBounds; + Arena.Center = A11Prishe.ArenaCenter; break; } } - private void SetDefaultArena() - { - Arena.Bounds = A11Prishe.DefaultBounds; - Arena.Center = A11Prishe.ArenaCenter; - } - private void SetArena(ArenaBoundsComplex bounds) { Arena.Bounds = bounds; diff --git a/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/ArenaChanges.cs b/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/ArenaChanges.cs new file mode 100644 index 0000000000..ab9b1434eb --- /dev/null +++ b/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/ArenaChanges.cs @@ -0,0 +1,73 @@ +namespace BossMod.Dawntrail.Chaotic.Ch01CloudOfDarkness; + +class ArenaChanges(BossModule module) : Components.GenericAOEs(module) +{ + private AOEInstance? _aoe; + private static readonly Square[] DefaultPolygon = [new(Ch01CloudOfDarkness.DefaultCenter, 40)]; + private static readonly AOEShapeCustom P1Transition = new(DefaultPolygon, Ch01CloudOfDarkness.Diamond); + private static readonly AOEShapeCustom P2Transition = new(DefaultPolygon, Ch01CloudOfDarkness.Phase2ShapesWD); + private static readonly AOEShapeDonut donut = new(34, 40); + + public override IEnumerable ActiveAOEs(int slot, Actor actor) => Utils.ZeroOrOne(_aoe); + + public override void OnEventEnvControl(byte index, uint state) + { + if (index == 0x00) + switch (state) + { + case 0x00200010: + SetAOE(P1Transition); + break; + case 0x00020001: + SetAOE(P2Transition); + break; + } + else if (index == 0x02) + switch (state) + { + case 0x00020001: + SetArena(Ch01CloudOfDarkness.Phase2BoundsND); + break; + case 0x00080004: + SetArena(Ch01CloudOfDarkness.Phase2BoundsWD); + break; + } + } + + public override void OnEventDirectorUpdate(uint updateID, uint param1, uint param2, uint param3, uint param4) + { + if (updateID != 0x8000000D) + return; + switch (param1) + { + case 0x10000000: // default arena + Arena.Bounds = Ch01CloudOfDarkness.DefaultArena; + Arena.Center = Ch01CloudOfDarkness.DefaultCenter; + break; + case 0x20000000: // (phase 2) + SetArena(Ch01CloudOfDarkness.Phase2BoundsWD); + break; + case 0x40000000: // diamond arena (phase 1) + SetArena(Ch01CloudOfDarkness.Phase1Bounds); + break; + } + } + + public override void OnCastStarted(Actor caster, ActorCastInfo spell) + { + if ((AID)spell.Action.ID == AID.DarkDominion) + SetAOE(donut); + } + + private void SetArena(ArenaBoundsComplex bounds) + { + Arena.Bounds = bounds; + Arena.Center = bounds.Center; + _aoe = null; + } + + private void SetAOE(AOEShape shape) + { + _aoe = new(shape, Arena.Center, default, WorldState.FutureTime(9)); + } +} diff --git a/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Ch01CloudOfDarkness.cs b/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Ch01CloudOfDarkness.cs index 1b8a0cfc19..02af1473bf 100644 --- a/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Ch01CloudOfDarkness.cs +++ b/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Ch01CloudOfDarkness.cs @@ -17,7 +17,8 @@ class Ch01CloudOfDarknessStates : StateMachineBuilder { public Ch01CloudOfDarknessStates(BossModule module) : base(module) { - DeathPhase(0, SinglePhase); + DeathPhase(0, SinglePhase) + .ActivateOnEnter(); } private void SinglePhase(uint id) @@ -58,65 +59,25 @@ private void SinglePhase(uint id) } } -// TODO: mechanic phase bounds // TODO: flood bounds & squares // TODO: particle concentration towers // TODO: evil seed // TODO: chaser beam // TODO: tankswap hints? -[ModuleInfo(BossModuleInfo.Maturity.WIP, GroupType = BossModuleInfo.GroupType.CFC, GroupID = 1010, NameID = 13624)] -public class Ch01CloudOfDarkness(WorldState ws, Actor primary) : BossModule(ws, primary, DefaultCenter, InitialBounds) +[ModuleInfo(BossModuleInfo.Maturity.WIP, Contributors = "The Combat Reborn Team (Malediktus, LTS)", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 1010, NameID = 13624)] +public class Ch01CloudOfDarkness(WorldState ws, Actor primary) : BossModule(ws, primary, DefaultCenter, DefaultArena) { public static readonly WPos DefaultCenter = new(100, 100); - public static readonly ArenaBoundsCircle InitialBounds = new(40); - public static readonly ArenaBoundsCustom Phase1Bounds = new(InitialBounds.Radius, new(BuildPhase1BoundsContour())); - public static readonly ArenaBoundsCustom Phase2Bounds = new(InitialBounds.Radius, BuildPhase2BoundsPoly()); - public static readonly WPos Phase1Midpoint = DefaultCenter + Phase1Bounds.Poly.Parts[0].Vertices[1] + Phase1Bounds.Poly.Parts[0].Vertices[3]; - - public static List BuildPhase1BoundsContour() - { - // north 'diagonal' is at [+/-15, -37] (it almost intersects the initial circle - at x=15 z is ~37.08) - // the main diagonal is 20, rotated by 45 degrees, which means that side corners are at x=+/- 40/sqrt(2), z = -37 + 40/sqrt(2) - 15 - var nz = -37; - var nx = 15; - var halfDiag = 40 / MathF.Sqrt(2); - var cz = nz + halfDiag - nx; - return [new(nx, nz), new(halfDiag, cz), new(0, cz + halfDiag), new(-halfDiag, cz), new(-nx, nz)]; - } - - public static RelSimplifiedComplexPolygon BuildPhase2BoundsPoly() - { - // mid is union of 4 rects - var midHalfWidth = 3; - var midHalfLength = 24; - var midOffset = 15; - var op1 = new PolygonClipper.Operand(); - var op2 = new PolygonClipper.Operand(); - op1.AddContour(CurveApprox.Rect(new WDir(0, +midOffset), new(1, 0), midHalfWidth, midHalfLength)); - op1.AddContour(CurveApprox.Rect(new WDir(0, -midOffset), new(1, 0), midHalfWidth, midHalfLength)); - op2.AddContour(CurveApprox.Rect(new WDir(+midOffset, 0), new(0, 1), midHalfWidth, midHalfLength)); - op2.AddContour(CurveApprox.Rect(new WDir(-midOffset, 0), new(0, 1), midHalfWidth, midHalfLength)); - var mid = InitialBounds.Clipper.Union(op1, op2); - - // sides is union of two platforms and the outside ring - var sideHalfWidth = 7.5f; - var sideHalfLength = 10; - var sideOffset = 19 + sideHalfLength; - var sideRingWidth = 6; - op1.Clear(); - op2.Clear(); - op1.AddContour(CurveApprox.Rect(new WDir(+sideOffset, 0), new(1, 0), sideHalfWidth, sideHalfLength)); - op1.AddContour(CurveApprox.Rect(new WDir(-sideOffset, 0), new(1, 0), sideHalfWidth, sideHalfLength)); - op2.AddContour(CurveApprox.Circle(InitialBounds.Radius, 0.1f)); - op2.AddContour(CurveApprox.Circle(InitialBounds.Radius - sideRingWidth, 0.1f)); - var side = InitialBounds.Clipper.Union(op1, op2); - - op1.Clear(); - op2.Clear(); - op1.AddPolygon(mid); - op2.AddPolygon(side); - return InitialBounds.Clipper.Union(op1, op2); - } + public static readonly WPos Phase1BoundsCenter = new(100, 76.28427f); + public static readonly PolygonCustom[] Diamond = [new([new(115, 63), new(128.28427f, 76.28427f), new(100, 104.56854f), new(71.71573f, 76.28427f), new(85, 63)])]; + private static readonly DonutV[] donut = [new(DefaultCenter, 34, 40, 80)]; + public static readonly Shape[] Phase2ShapesND = [new Rectangle(new(100, 115), 24, 3), new Rectangle(new(100, 85), 24, 3), new Rectangle(new(115, 100), 3, 24), + new Rectangle(new(85, 100), 3, 24), new Square(new(126.5f, 100), 7.5f), new Square(new(73.5f, 100), 7.5f)]; + public static readonly Shape[] Phase2ShapesWD = [.. donut, .. Phase2ShapesND]; + public static readonly ArenaBoundsCircle DefaultArena = new(40); + public static readonly ArenaBoundsComplex Phase1Bounds = new(Diamond); + public static readonly ArenaBoundsComplex Phase2BoundsWD = new(Phase2ShapesWD); + public static readonly ArenaBoundsComplex Phase2BoundsND = new(Phase2ShapesND, donut); } // envcontrols: diff --git a/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Ch01CloudOfDarknessEnums.cs b/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Ch01CloudOfDarknessEnums.cs index 617023a819..9628060f00 100644 --- a/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Ch01CloudOfDarknessEnums.cs +++ b/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Ch01CloudOfDarknessEnums.cs @@ -128,7 +128,12 @@ public enum AID : uint LoomingChaosBoss = 41674, // Boss->self, 7.0s cast, single-target, visual (position swaps) LoomingChaosAOE = 41675, // Helper->self, 7.7s cast, range 50 circle, raidwide + position swaps - //_Weaponskill_FeintParticleBeam = 40477, // Boss->self, 6.0+0.7s cast, single-target + FeintParticleBeamVisual = 40477, // Boss->self, 6.0+0,7s cast, single-target, chasing AOE + FeintParticleBeamFirst = 40478, // Helper->location, 4.0s cast, range 3 circle + FeintParticleBeamRest = 40479, // Helper->location, no cast, range 3 circle + FloodOfDarkness2 = 40455, // Boss->location, 7.0s cast, range 60 circle + Evaporation = 40454, // StygianShadow->Boss, 2.0s cast, single-target + DelugeOfDarknessEnrage = 40533, // Boss->location, 12.0s cast, range 100 circle } public enum SID : uint diff --git a/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Enaero.cs b/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Enaero.cs index 7828a9c80a..897f864a87 100644 --- a/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Enaero.cs +++ b/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Enaero.cs @@ -59,7 +59,7 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell) } } - private void Start(DateTime activation) => _source = new(Ch01CloudOfDarkness.Phase1Midpoint, 15, activation); + private void Start(DateTime activation) => _source = new(Ch01CloudOfDarkness.Phase1BoundsCenter, 15, activation); } class EnaeroAOE(BossModule module) : Components.GenericAOEs(module) @@ -103,7 +103,7 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell) private void Start(DateTime activation) { - _aoe = new(_shape, Ch01CloudOfDarkness.Phase1Midpoint, default, activation); + _aoe = new(_shape, Ch01CloudOfDarkness.Phase1BoundsCenter, default, activation); _delayed = false; } } diff --git a/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Endeath.cs b/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Endeath.cs index 35f468ddf5..17887d8f75 100644 --- a/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Endeath.cs +++ b/BossMod/Modules/Dawntrail/Chaotic/Ch01CloudOfDarkness/Endeath.cs @@ -7,7 +7,7 @@ class EndeathVortex(BossModule module) : Components.Knockback(module) public override IEnumerable Sources(int slot, Actor actor) => Utils.ZeroOrOne(_source); - public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => (pos - Ch01CloudOfDarkness.Phase1Midpoint).LengthSq() <= 36; + public override bool DestinationUnsafe(int slot, Actor actor, WPos pos) => (pos - Ch01CloudOfDarkness.Phase1BoundsCenter).LengthSq() <= 36; public override void AddHints(int slot, Actor actor, TextHints hints) { @@ -61,7 +61,7 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell) } } - private void Start(DateTime activation) => _source = new(Ch01CloudOfDarkness.Phase1Midpoint, 15, activation, Kind: Kind.TowardsOrigin); + private void Start(DateTime activation) => _source = new(Ch01CloudOfDarkness.Phase1BoundsCenter, 15, activation, Kind: Kind.TowardsOrigin); } class EndeathAOE(BossModule module) : Components.GenericAOEs(module) @@ -109,8 +109,8 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell) private void Start(DateTime activation) { - _aoes.Add(new(_shapeOut, Ch01CloudOfDarkness.Phase1Midpoint, default, activation.AddSeconds(2))); - _aoes.Add(new(_shapeIn, Ch01CloudOfDarkness.Phase1Midpoint, default, activation.AddSeconds(4))); + _aoes.Add(new(_shapeOut, Ch01CloudOfDarkness.Phase1BoundsCenter, default, activation.AddSeconds(2))); + _aoes.Add(new(_shapeIn, Ch01CloudOfDarkness.Phase1BoundsCenter, default, activation.AddSeconds(4))); _delayed = false; } } diff --git a/BossMod/Modules/Dawntrail/Dungeon/D09YuweyawataFieldStation/D092OverseerKanilokka.cs b/BossMod/Modules/Dawntrail/Dungeon/D09YuweyawataFieldStation/D092OverseerKanilokka.cs index 2d15fed2ca..242790320e 100644 --- a/BossMod/Modules/Dawntrail/Dungeon/D09YuweyawataFieldStation/D092OverseerKanilokka.cs +++ b/BossMod/Modules/Dawntrail/Dungeon/D09YuweyawataFieldStation/D092OverseerKanilokka.cs @@ -56,28 +56,28 @@ public override void OnEventEnvControl(byte index, uint state) switch (state) { case 0x00020001: - SetArena(D092OverseerKanilokka.DefaultArena, D092OverseerKanilokka.DefaultArena.Center); + SetArena(D092OverseerKanilokka.DefaultArena); break; case 0x00200010: - SetArena(D092OverseerKanilokka.TinyArena, D092OverseerKanilokka.TinyArena.Center); + SetArena(D092OverseerKanilokka.TinyArena); break; case 0x00800040: - SetArena(D092OverseerKanilokka.ArenaENVC00800040, D092OverseerKanilokka.ArenaENVC00800040.Center); + SetArena(D092OverseerKanilokka.ArenaENVC00800040); break; case 0x02000100: - SetArena(D092OverseerKanilokka.ArenaENVC02000100, D092OverseerKanilokka.ArenaENVC02000100.Center); + SetArena(D092OverseerKanilokka.ArenaENVC02000100); break; case 0x00080004: - SetArena(D092OverseerKanilokka.StartingBounds, D092OverseerKanilokka.StartingBounds.Center); + SetArena(D092OverseerKanilokka.StartingBounds); break; } _aoe = null; } - private void SetArena(ArenaBounds bounds, WPos center) + private void SetArena(ArenaBoundsComplex bounds) { Arena.Bounds = bounds; - Arena.Center = center; + Arena.Center = bounds.Center; } } diff --git a/BossMod/Modules/Dawntrail/Ultimate/FRU/FRUAI.cs b/BossMod/Modules/Dawntrail/Ultimate/FRU/FRUAI.cs index a60cb161f3..8b34ba8422 100644 --- a/BossMod/Modules/Dawntrail/Ultimate/FRU/FRUAI.cs +++ b/BossMod/Modules/Dawntrail/Ultimate/FRU/FRUAI.cs @@ -37,13 +37,6 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa _ => Player.Position }; - // TODO: account for leeway for casters - private WPos PathfindPosition(Actor? meleeGreedTarget) - { - var res = NavigationDecision.Build(NavigationContext, World, Hints, Player, Speed()); - return meleeGreedTarget != null && res.Destination != null ? ClosestInMelee(res.Destination.Value, meleeGreedTarget) : (res.Destination ?? Player.Position); - } - // assumption: pull range is 12; hitbox is 5, so maxmelee is 8, meaning we have approx 4m to move during pull - with sprint, speed is 7.8, accel is 30 => over 0.26s accel period we move 1.014m, then need another 0.38s to reach boss (but it also moves) private WPos PrepullPosition(FRU module, PartyRolesConfig.Assignment assignment) { diff --git a/BossMod/Modules/Dawntrail/Ultimate/FRU/P2DiamondDust.cs b/BossMod/Modules/Dawntrail/Ultimate/FRU/P2DiamondDust.cs index dcb423cdad..eccbd4212b 100644 --- a/BossMod/Modules/Dawntrail/Ultimate/FRU/P2DiamondDust.cs +++ b/BossMod/Modules/Dawntrail/Ultimate/FRU/P2DiamondDust.cs @@ -219,14 +219,14 @@ public override IEnumerable Sources(int slot, Actor actor) public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints) { if (_safeDirs[slot] != default) - hints.AddForbiddenZone(ShapeDistance.PrecisePosition(Module.Center + 6 * _safeDirs[slot], new(1, 0), Module.Bounds.MapResolution, actor.Position, 0.25f), _activation); + hints.AddForbiddenZone(ShapeDistance.PrecisePosition(Arena.Center + 6 * _safeDirs[slot], new(1, 0), Arena.Bounds.MapResolution, actor.Position, 0.25f), _activation); } public override void DrawArenaForeground(int pcSlot, Actor pc) { base.DrawArenaForeground(pcSlot, pc); if (_safeDirs[pcSlot] != default) - Arena.AddCircle(Module.Center + 18 * _safeDirs[pcSlot], 1, ArenaColor.Safe); + Arena.AddCircle(Arena.Center + 18 * _safeDirs[pcSlot], 1, Colors.Safe); } private static WDir[] BuildSafeDirs(BossModule module) @@ -346,7 +346,6 @@ class P2TwinStillnessSilence(BossModule module) : Components.GenericAOEs(module) private BitMask _thinIce; private P2SinboundHolyVoidzone? _voidzones; // used for hints only - private const float SlideDistance = 32; private readonly AOEShapeCone _shapeFront = new(30, 135.Degrees()); private readonly AOEShapeCone _shapeBack = new(30, 45.Degrees()); @@ -371,7 +370,7 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme // first, find a set of allowed angles along the border var zoneList = new ArcList(Arena.Center, 17); foreach (var z in _voidzones.Sources(Module)) - zoneList.ForbidCircle(z.Position, _voidzones.Shape.Radius); + zoneList.ForbidCircle(z.Position, 6); // now find closest allowed zone var actorDir = Angle.FromDirection(actor.Position - Module.Center); @@ -384,21 +383,17 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme { // destination is very wide, narrow it down a bit to be in line with the boss halfWidth = 5.Degrees(); - var sourceDir = Angle.FromDirection(_source.Position - Module.Center); + var sourceDir = Angle.FromDirection(_source.Position - Arena.Center); var sourceDist = sourceDir.DistanceToRange(closest.min + halfWidth, closest.max - halfWidth); var oppositeDist = (sourceDir + 180.Degrees()).DistanceToRange(closest.min + halfWidth, closest.max - halfWidth); desiredDir = oppositeDist.Abs().Rad < sourceDist.Abs().Rad ? (sourceDir + 180.Degrees() + oppositeDist) : (sourceDir + sourceDist); } - hints.AddForbiddenZone(ShapeDistance.Circle(Module.Center, 16), WorldState.FutureTime(50)); - hints.AddForbiddenZone(ShapeDistance.InvertedCone(Module.Center, 100, desiredDir, halfWidth), DateTime.MaxValue); + hints.AddForbiddenZone(ShapeDistance.Circle(Arena.Center, 16), WorldState.FutureTime(50)); + hints.AddForbiddenZone(ShapeDistance.InvertedCone(Arena.Center, 100, desiredDir, halfWidth), DateTime.MaxValue); } return; } - // at this point, we have thin ice, so we can either stay or move fixed distance - hints.AddForbiddenZone(ShapeDistance.Donut(actor.Position, 1, 31)); - hints.AddForbiddenZone(ShapeDistance.InvertedCircle(actor.Position, 33)); - if (AOEs.Count == 0) { // if we're behind boss, slide over @@ -416,8 +411,8 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme { var offset = z.Position - actor.Position; var dist = offset.Length(); - if (dist > _voidzones.Shape.Radius) - hints.AddForbiddenZone(ShapeDistance.Cone(actor.Position, 100, Angle.FromDirection(offset), Angle.Asin(dist / _voidzones.Shape.Radius))); + if (dist > 6) + hints.AddForbiddenZone(ShapeDistance.Cone(actor.Position, 100, Angle.FromDirection(offset), Angle.Asin(dist / 6))); } } diff --git a/BossMod/Modules/Dawntrail/Ultimate/FRU/P4DarklitDragonsong.cs b/BossMod/Modules/Dawntrail/Ultimate/FRU/P4DarklitDragonsong.cs index 9114fb9f4a..d0999d9fcd 100644 --- a/BossMod/Modules/Dawntrail/Ultimate/FRU/P4DarklitDragonsong.cs +++ b/BossMod/Modules/Dawntrail/Ultimate/FRU/P4DarklitDragonsong.cs @@ -19,7 +19,7 @@ public override void AddGlobalHints(GlobalHints hints) public override void DrawArenaForeground(int pcSlot, Actor pc) { foreach (var t in _tethers) - Arena.AddLine(t.from.Position, t.to.Position, ArenaColor.Safe); // TODO: min/max break distance + Arena.AddLine(t.from.Position, t.to.Position, Colors.Safe); // TODO: min/max break distance } public override void OnStatusGain(Actor actor, ActorStatus status) diff --git a/BossMod/Modules/RealmReborn/Extreme/Ex3Titan/Ex3TitanAI.cs b/BossMod/Modules/RealmReborn/Extreme/Ex3Titan/Ex3TitanAI.cs index 60107d646f..dcda2b676f 100644 --- a/BossMod/Modules/RealmReborn/Extreme/Ex3Titan/Ex3TitanAI.cs +++ b/BossMod/Modules/RealmReborn/Extreme/Ex3Titan/Ex3TitanAI.cs @@ -1,20 +1,18 @@ using BossMod.AI; using BossMod.Autorotation; -using BossMod.Pathfinding; namespace BossMod.RealmReborn.Extreme.Ex3Titan; sealed class Ex3TitanAIRotation(RotationModuleManager manager, Actor player) : AIRotationModule(manager, player) { public enum Track { Movement } - public enum MovementStrategy { None, Pathfind, Explicit } + public enum MovementStrategy { None, Explicit } public static RotationModuleDefinition Definition() { var res = new RotationModuleDefinition("AI Experiment", "Experimental encounter-specific rotation", "Encounter AI", "veyn", RotationModuleQuality.WIP, new(~1ul), 1000, 1, typeof(Ex3Titan)); res.Define(Track.Movement).As("Movement", "Movement") .AddOption(MovementStrategy.None, "None", "No automatic movement") - .AddOption(MovementStrategy.Pathfind, "Pathfind", "Use standard pathfinding to move") .AddOption(MovementStrategy.Explicit, "Explicit", "Move to specific point", supportedTargets: ActionTargets.Area); return res; } @@ -26,7 +24,6 @@ public override void Execute(StrategyValues strategy, Actor? primaryTarget, floa private WPos CalculateDestination(StrategyValues.OptionRef strategy) => strategy.As() switch { - MovementStrategy.Pathfind => NavigationDecision.Build(NavigationContext, World, Hints, Player, Speed()).Destination ?? Player.Position, MovementStrategy.Explicit => ResolveTargetLocation(strategy.Value), _ => Player.Position }; diff --git a/BossMod/Util/Angle.cs b/BossMod/Util/Angle.cs index 8127312f07..5f4b9880ee 100644 --- a/BossMod/Util/Angle.cs +++ b/BossMod/Util/Angle.cs @@ -62,17 +62,6 @@ public readonly Angle DistanceToRange(Angle min, Angle max) return midDist.Rad > width.Rad ? midDist - width : midDist.Rad < -width.Rad ? midDist + width : default; } - // closest distance to move from this angle to destination (== 0 if equal, >0 if moving in positive/CCW dir, <0 if moving in negative/CW dir) - public readonly Angle DistanceToAngle(Angle other) => (other - this).Normalized(); - - // returns 0 if angle is within range, positive value if min is closest, negative if max is closest - public readonly Angle DistanceToRange(Angle min, Angle max) - { - var width = (max - min) * 0.5f; - var midDist = DistanceToAngle((min + max) * 0.5f); - return midDist.Rad > width.Rad ? midDist - width : midDist.Rad < -width.Rad ? midDist + width : default; - } - public override readonly string ToString() => Deg.ToString("f3"); }