From 6b3c6c5341a0a2fd8a5e87f4cc5f7e68feb04821 Mon Sep 17 00:00:00 2001 From: CarnifexOptimus <156172553+CarnifexOptimus@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:32:56 +0100 Subject: [PATCH] jeuno improvements --- .../Dawntrail/Alliance/A11Prishe/AsuranFists.cs | 12 ++++++++++-- .../Dawntrail/Alliance/A12Fafnir/A12Fafnir.cs | 2 +- .../Dawntrail/Alliance/A12Fafnir/HurricaneWing.cs | 2 +- .../Alliance/A12Fafnir/OffensivePosture.cs | 3 +-- .../Alliance/A13ArkAngels/A13ArkAngelsStates.cs | 9 +++++---- .../Alliance/A13ArkAngels/ConeDonutCross.cs | 4 ++-- .../Alliance/A13ArkAngels/DecisiveBattle.cs | 14 ++++++++++++++ .../Dawntrail/Alliance/A14ShadowLord/GigaSlash.cs | 14 +++++++------- .../Dawntrail/Alliance/A14ShadowLord/Implosion.cs | 2 +- .../Alliance/A14Naldthal/HeatAboveFlamesBelow.cs | 2 +- 10 files changed, 43 insertions(+), 21 deletions(-) diff --git a/BossMod/Modules/Dawntrail/Alliance/A11Prishe/AsuranFists.cs b/BossMod/Modules/Dawntrail/Alliance/A11Prishe/AsuranFists.cs index 6c0a247298..e1079febc3 100644 --- a/BossMod/Modules/Dawntrail/Alliance/A11Prishe/AsuranFists.cs +++ b/BossMod/Modules/Dawntrail/Alliance/A11Prishe/AsuranFists.cs @@ -2,11 +2,19 @@ namespace BossMod.Dawntrail.Alliance.A11Prishe; class AsuranFists(BossModule module) : Components.GenericTowers(module) { + public override void OnCastStarted(Actor caster, ActorCastInfo spell) + { + if ((AID)spell.Action.ID == AID.AsuranFistsVisual) + { + Towers.Add(new(spell.LocXZ, 6, PartyState.MaxAllianceSize, PartyState.MaxAllianceSize, activation: Module.CastFinishAt(spell, 0.5f))); + } + } + public override void OnActorEAnim(Actor actor, uint state) { - if ((OID)actor.OID == OID.Tower && state == 0x00100020) + if (Towers.Count != 0 && (OID)actor.OID == OID.Tower && state == 0x00100020) { - Towers.Add(new(actor.Position, 6, PartyState.MaxAllianceSize, PartyState.MaxAllianceSize, activation: WorldState.FutureTime(6))); + Towers[0] = Towers[0] with { Position = actor.Position }; // spell position can be about one or two pixels off the real tower position... } } diff --git a/BossMod/Modules/Dawntrail/Alliance/A12Fafnir/A12Fafnir.cs b/BossMod/Modules/Dawntrail/Alliance/A12Fafnir/A12Fafnir.cs index 6949b2ad1f..4262b36fff 100644 --- a/BossMod/Modules/Dawntrail/Alliance/A12Fafnir/A12Fafnir.cs +++ b/BossMod/Modules/Dawntrail/Alliance/A12Fafnir/A12Fafnir.cs @@ -17,7 +17,7 @@ class PestilentSphere(BossModule module) : Components.SingleTargetCast(module, A class ShudderingEarth(BossModule module) : Components.CastCounter(module, ActionID.MakeSpell(AID.ShudderingEarth)); -class Darter(BossModule module) : Components.Adds(module, (uint)OID.Darter) +class Darter(BossModule module) : Components.Adds(module, (uint)OID.Darter, 1) { public override bool KeepOnPhaseChange => true; } diff --git a/BossMod/Modules/Dawntrail/Alliance/A12Fafnir/HurricaneWing.cs b/BossMod/Modules/Dawntrail/Alliance/A12Fafnir/HurricaneWing.cs index 29bf5b8400..a18d70df4b 100644 --- a/BossMod/Modules/Dawntrail/Alliance/A12Fafnir/HurricaneWing.cs +++ b/BossMod/Modules/Dawntrail/Alliance/A12Fafnir/HurricaneWing.cs @@ -129,7 +129,7 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme var w = _smallWhirldwinds[i]; forbidden.Add(ShapeDistance.Capsule(w.Position, !moving ? w.Rotation + a180 : w.Rotation, length, 5)); } - hints.AddForbiddenZone(p => forbidden.Min(f => f(p))); + hints.AddForbiddenZone(p => forbidden.Min(f => f(p)), WorldState.FutureTime(1.1f)); } } diff --git a/BossMod/Modules/Dawntrail/Alliance/A12Fafnir/OffensivePosture.cs b/BossMod/Modules/Dawntrail/Alliance/A12Fafnir/OffensivePosture.cs index 0c67c38414..8882b4caf7 100644 --- a/BossMod/Modules/Dawntrail/Alliance/A12Fafnir/OffensivePosture.cs +++ b/BossMod/Modules/Dawntrail/Alliance/A12Fafnir/OffensivePosture.cs @@ -8,11 +8,10 @@ namespace BossMod.Dawntrail.Alliance.A12Fafnir; class Touchdown(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.Touchdown), new AOEShapeCircle(24)) { public override bool KeepOnPhaseChange => true; - private readonly DragonBreath? _aoe = module.FindComponent(); public override IEnumerable ActiveAOEs(int slot, Actor actor) { - return _aoe?.AOE == null || Arena.Bounds != A12Fafnir.FireArena + return Module.FindComponent()?.AOE == null || Arena.Bounds != A12Fafnir.FireArena ? ActiveCasters.Select(c => new AOEInstance(Shape, c.Position, c.CastInfo!.Rotation, Module.CastFinishAt(c.CastInfo))) : []; } } diff --git a/BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/A13ArkAngelsStates.cs b/BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/A13ArkAngelsStates.cs index 0f5df4f665..438c5d0338 100644 --- a/BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/A13ArkAngelsStates.cs +++ b/BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/A13ArkAngelsStates.cs @@ -8,6 +8,8 @@ public A13ArkAngelsStates(A13ArkAngels module) : base(module) { _module = module; DeathPhase(0, SinglePhase) + .ActivateOnEnter() + .ActivateOnEnter() .ActivateOnEnter() .ActivateOnEnter() .ActivateOnEnter() @@ -66,9 +68,7 @@ private void SinglePhase(uint id) private void DecisiveBattle(uint id, float delay) { - ActorCast(id, _module.BossMR, AID.DecisiveBattleMR, delay, 4, true, "Assign target") - .ActivateOnEnter() - .ActivateOnEnter(); + ActorCast(id, _module.BossMR, AID.DecisiveBattleMR, delay, 4, true, "Assign target"); } private void Cloudsplitter(uint id, float delay) @@ -105,7 +105,8 @@ private void MeikyoShisui(uint id, float delay) private void Meteor(uint id, float delay) { - ActorCast(id, _module.BossTT, AID.Meteor, delay, 11, true, "Interrupt", true); + ActorCast(id, _module.BossTT, AID.Meteor, delay, 11, true, "Interrupt", true) + .OnExit(() => _module.Arena.Bounds = A13ArkAngels.DefaultBounds); // fall back for people who joined fight late } private State HavocSpiral(uint id, float delay) diff --git a/BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/ConeDonutCross.cs b/BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/ConeDonutCross.cs index 7605aa2bcf..32e0458fb4 100644 --- a/BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/ConeDonutCross.cs +++ b/BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/ConeDonutCross.cs @@ -25,10 +25,10 @@ public override IEnumerable ActiveAOEs(int slot, Actor actor) class CrossReaver(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.CrossReaverAOE), new AOEShapeCross(50, 6)) { - private readonly LightsChain? _aoe = module.FindComponent(); public override IEnumerable ActiveAOEs(int slot, Actor actor) { - var check = _aoe != null && _aoe.Casters.Count != 0; + var chain = Module.FindComponent(); + var check = chain != null && chain.Casters.Count != 0; return ActiveCasters.Select(c => new AOEInstance(Shape, c.Position, c.CastInfo!.Rotation, Module.CastFinishAt(c.CastInfo), Risky: !check)); } } diff --git a/BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/DecisiveBattle.cs b/BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/DecisiveBattle.cs index b94492eacf..531fee4e9a 100644 --- a/BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/DecisiveBattle.cs +++ b/BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/DecisiveBattle.cs @@ -22,6 +22,20 @@ public override void OnTethered(Actor source, ActorTetherInfo tether) } } + // fall back since players outside arena bounds do not get tethered but will still receive status effects + public override void OnStatusGain(Actor actor, ActorStatus status) + { + var boss = (SID)status.ID switch + { + SID.EpicHero => OID.BossMR, + SID.VauntedHero => OID.BossTT, + SID.FatedHero => OID.BossGK, + _ => default + }; + if (boss != default && Raid.FindSlot(actor.InstanceID) is var slot && slot >= 0) + AssignedBoss[slot] = Module.Enemies(boss).FirstOrDefault(); + } + public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints) { if (slot < AssignedBoss.Length && AssignedBoss[slot] != null) diff --git a/BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/GigaSlash.cs b/BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/GigaSlash.cs index 265557c806..a9a6448e58 100644 --- a/BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/GigaSlash.cs +++ b/BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/GigaSlash.cs @@ -2,19 +2,19 @@ namespace BossMod.Dawntrail.Alliance.A14ShadowLord; class GigaSlash(BossModule module) : Components.GenericAOEs(module) { - private readonly List _aoes = []; + public readonly List AOEs = []; private static readonly HashSet castEnds = [AID.GigaSlashLAOE1, AID.GigaSlashRAOE2, AID.GigaSlashRAOE1, AID.GigaSlashLAOE2, AID.GigaSlashNightfallFAOE3, AID.GigaSlashNightfallBAOE3, AID.GigaSlashNightfallLAOE1, AID.GigaSlashNightfallRAOE2, AID.GigaSlashNightfallRAOE1, AID.GigaSlashNightfallLAOE2]; private static readonly AOEShapeCone[] _shapes = [new(60, 112.5f.Degrees()), new(60, 135.Degrees()), new(60, 105.Degrees())]; - public override IEnumerable ActiveAOEs(int slot, Actor actor) => _aoes.Take(1); + public override IEnumerable ActiveAOEs(int slot, Actor actor) => AOEs.Take(1); public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints) { base.AddAIHints(slot, actor, assignment, hints); // stay close to the middle if there is next imminent aoe from same origin - if (_aoes.Count > 1 && _aoes[0].Origin == _aoes[1].Origin) - hints.AddForbiddenZone(ShapeDistance.InvertedCircle(_aoes[0].Origin, 3), _aoes[0].Activation); + if (AOEs.Count > 1 && AOEs[0].Origin == AOEs[1].Origin) + hints.AddForbiddenZone(ShapeDistance.InvertedCircle(AOEs[0].Origin, 3), AOEs[0].Activation); } public override void OnCastStarted(Actor caster, ActorCastInfo spell) @@ -23,7 +23,7 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell) var position = caster.Position; void AddAOE(AOEShapeCone shape, float rotationOffset, float finishOffset) - => _aoes.Add(new(shape, position, rotation + rotationOffset.Degrees(), Module.CastFinishAt(spell, finishOffset))); + => AOEs.Add(new(shape, position, rotation + rotationOffset.Degrees(), Module.CastFinishAt(spell, finishOffset))); switch ((AID)spell.Action.ID) { @@ -63,8 +63,8 @@ public override void OnEventCast(Actor caster, ActorCastEvent spell) if (castEnds.Contains((AID)spell.Action.ID)) { ++NumCasts; - if (_aoes.Count != 0) - _aoes.RemoveAt(0); + if (AOEs.Count != 0) + AOEs.RemoveAt(0); } } } diff --git a/BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/Implosion.cs b/BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/Implosion.cs index 28a6a73a17..df8489397f 100644 --- a/BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/Implosion.cs +++ b/BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/Implosion.cs @@ -6,7 +6,7 @@ class Implosion(BossModule module) : Components.GenericAOEs(module) private static readonly AOEShapeCone _shapeSmall = new(12, 90.Degrees()), _shapeLarge = new(90, 90.Degrees()); - public override IEnumerable ActiveAOEs(int slot, Actor actor) => _aoes; + public override IEnumerable ActiveAOEs(int slot, Actor actor) => Module.FindComponent()?.AOEs.Count == 0 ? _aoes : []; public override void OnCastStarted(Actor caster, ActorCastInfo spell) { diff --git a/BossMod/Modules/Endwalker/Alliance/A14Naldthal/HeatAboveFlamesBelow.cs b/BossMod/Modules/Endwalker/Alliance/A14Naldthal/HeatAboveFlamesBelow.cs index c50481920c..063adf24ba 100644 --- a/BossMod/Modules/Endwalker/Alliance/A14Naldthal/HeatAboveFlamesBelow.cs +++ b/BossMod/Modules/Endwalker/Alliance/A14Naldthal/HeatAboveFlamesBelow.cs @@ -30,7 +30,7 @@ public override void OnEventCast(Actor caster, ActorCastEvent spell) ++NumCasts; } - private AOEShape? ShapeForAction(ActionID action) => (AID)action.ID switch + private static AOEShape? ShapeForAction(ActionID action) => (AID)action.ID switch { AID.FlamesOfTheDeadReal => _shapeIn, AID.LivingHeatReal => _shapeOut,