diff --git a/BossMod/Modules/Dawntrail/Dungeon/D09YuweyawataFieldStation/D093Lunipyati.cs b/BossMod/Modules/Dawntrail/Dungeon/D09YuweyawataFieldStation/D093Lunipyati.cs index a65237ac14..0edaeeb2f4 100644 --- a/BossMod/Modules/Dawntrail/Dungeon/D09YuweyawataFieldStation/D093Lunipyati.cs +++ b/BossMod/Modules/Dawntrail/Dungeon/D09YuweyawataFieldStation/D093Lunipyati.cs @@ -156,10 +156,12 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell) angles.Add(spell.Rotation.Rad); if (angles.Count < 4) return; - Service.Log($"{HasTwoOppositePairs(angles)}, {HasMixedPattern1(angles)}"); - if (HasTwoOppositePairs(angles)) + var total = 0f; + for (var i = 0; i < 4; ++i) + total += angles[i]; + if (MathF.Round(total) is 5 or -2) GenerateAOEsForOppositePairPattern(); - else if (HasMixedPattern1(angles)) + else if (MathF.Round(2 * total) == 3) GenerateAOEsForMixedPattern1(); else GenerateAOEsForMixedPattern2(); @@ -204,22 +206,6 @@ private void GenerateAOEsForMixedPattern2() } } - private static bool HasTwoOppositePairs(List angles) - { - var total = 0f; - for (var i = 0; i < 4; ++i) - total += angles[i]; - return MathF.Round(total) is 5 or -2; - } - - private static bool HasMixedPattern1(List angles) - { - var total = 0f; - for (var i = 0; i < 4; ++i) - total += angles[i]; - return MathF.Round(2 * total) == 3; - } - private void AddAOEs(WPos[] points) { for (var i = 0; i < 4; ++i) diff --git a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Intermission.cs b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Intermission.cs index 3fdbb0a5d7..1c5c03f873 100644 --- a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Intermission.cs +++ b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Intermission.cs @@ -14,6 +14,17 @@ public override void AddHints(int slot, Actor actor, TextHints hints) } } +class Intermission(BossModule module) : BossComponent(module) +{ + public bool Active; + + public override void OnActorEAnim(Actor actor, uint state) + { + if ((OID)actor.OID == OID.ArenaFeatures && state is 0x00040008 or 0x00100020) + Active = state == 0x00040008; + } +} + class IntermissionOrbAratama(BossModule module) : Components.GenericAOEs(module, ActionID.MakeSpell(AID.IntermissionOrbAratama), "GTFO from puddle!") { public readonly List AOEs = []; diff --git a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs index 3fa556aeb5..3510fb75f6 100644 --- a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs +++ b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs @@ -10,10 +10,11 @@ class WhiteHerald(BossModule module) : Components.SpreadFromIcon(module, (uint)I class SweepTheLegBoss(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.SweepTheLegBoss), new AOEShapeCone(28.3f, 135.Degrees())); [ModuleInfo(BossModuleInfo.Maturity.Verified, Contributors = "veyn, Malediktus", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 1007, NameID = 7092, PlanLevel = 100)] -public class Un1Byakko(WorldState ws, Actor primary) : BossModule(ws, primary, default, DefaultBounds) +public class Un1Byakko(WorldState ws, Actor primary) : BossModule(ws, primary, default, NormalBounds) { - public static readonly ArenaBoundsComplex DefaultBounds = new([new Polygon(default, 19.5f, 48)]); - public static readonly ArenaBoundsComplex FreeFallBounds = new([new Polygon(default, 15, 48)]); + public static readonly ArenaBoundsComplex NormalBounds = new([new Polygon(default, 19.5f, 48)]); + public static readonly ArenaBoundsComplex IntermissionBounds = new([new Polygon(default, 15, 48)]); + private Actor? _hakutei; public Actor? Boss() => PrimaryActor; public Actor? Hakutei() => _hakutei; diff --git a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoEnums.cs b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoEnums.cs index 70eda09d82..b9c54ef649 100644 --- a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoEnums.cs +++ b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoEnums.cs @@ -11,6 +11,7 @@ public enum OID : uint AratamaPuddle = 0x1E8EA9, // R0.500, x0 (spawn during fight), EventObj type IntermissionHelper = 0x1EA87E, // R0.500, x0 (spawn during fight), EventObj type VacuumClaw = 0x1EA957, // R0.500, x0 (spawn during fight), EventObj type + ArenaFeatures = 0x1EA1A1, // R2.000, x1, EventObj type } public enum AID : uint diff --git a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs index da3c5ce6be..b90db83721 100644 --- a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs +++ b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs @@ -151,21 +151,25 @@ private void Intermission(uint id, float delay) ActorCast(id + 0x10, _module.Hakutei, AID.RoarOfThunder, 4.4f, 20, true, "Add enrage") // note: pretty large variance here .ActivateOnEnter() .DeactivateOnExit() - .OnExit(() => _module.Arena.Bounds = Un1Byakko.FreeFallBounds) .SetHint(StateMachine.StateHint.Raidwide | StateMachine.StateHint.DowntimeStart); - ComponentCondition(id + 0x20, 42.2f, comp => comp.NumCasts > 0, "Donut 1") + ComponentCondition(id + 0x12, 5.7f, comp => comp.Active) + .ActivateOnEnter() + .OnExit(() => Module.Arena.Bounds = Un1Byakko.IntermissionBounds); + ComponentCondition(id + 0x20, 36.5f, comp => comp.NumCasts > 0, "Donut 1") .ActivateOnEnter() .ActivateOnEnter(); ComponentCondition(id + 0x21, 5.7f, comp => comp.NumCasts > 0, "Line 1") .ActivateOnEnter(); ComponentCondition(id + 0x22, 12, comp => comp.NumCasts > 1, "Line 2"); ComponentCondition(id + 0x23, 13.6f, comp => comp.NumCasts > 1, "Donut 2") - .OnExit(() => _module.Arena.Bounds = Un1Byakko.DefaultBounds) .DeactivateOnExit() .DeactivateOnExit(); ComponentCondition(id + 0x24, 3.4f, comp => comp.NumCasts > 2, "Line 3") .DeactivateOnExit(); - ComponentCondition(id + 0x25, 27.7f, comp => comp.NumCasts > 0, "Raidwide") + ComponentCondition(id + 0x25, 7.5f, comp => !comp.Active) + .DeactivateOnExit() + .OnExit(() => Module.Arena.Bounds = Un1Byakko.NormalBounds); + ComponentCondition(id + 0x26, 20.2f, comp => comp.NumCasts > 0, "Raidwide") .ActivateOnEnter() .DeactivateOnExit() .SetHint(StateMachine.StateHint.Raidwide);