From 10f9b34f8f95bfeddbb985e024445a05ba13fe0e Mon Sep 17 00:00:00 2001 From: Andrew Gilewsky Date: Tue, 19 Nov 2024 23:44:03 +0000 Subject: [PATCH 1/3] Unreal tweaks. --- .../Dawntrail/Unreal/Un1Byakko/Intermission.cs | 11 +++++++++++ .../Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs | 5 ++++- .../Dawntrail/Unreal/Un1Byakko/Un1ByakkoEnums.cs | 1 + .../Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs | 10 ++++++++-- .../Dawntrail/Unreal/Un1Byakko/UnrelentingAnguish.cs | 2 +- 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Intermission.cs b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Intermission.cs index 91358214c4..ec927fe876 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 94620b9296..1f6b09425a 100644 --- a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs +++ b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs @@ -10,8 +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, GroupType = BossModuleInfo.GroupType.CFC, GroupID = 1007, NameID = 7092, PlanLevel = 100)] -public class Un1Byakko(WorldState ws, Actor primary) : BossModule(ws, primary, new(0, 0), new ArenaBoundsCircle(20)) +public class Un1Byakko(WorldState ws, Actor primary) : BossModule(ws, primary, new(0, 0), NormalBounds) { + public static readonly ArenaBoundsCircle NormalBounds = new(20); + public static readonly ArenaBoundsCircle IntermissionBounds = new(15); + 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 b814d22a9b..b90db83721 100644 --- a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs +++ b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs @@ -152,7 +152,10 @@ private void Intermission(uint id, float delay) .ActivateOnEnter() .DeactivateOnExit() .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") @@ -163,7 +166,10 @@ private void Intermission(uint id, float delay) .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); diff --git a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/UnrelentingAnguish.cs b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/UnrelentingAnguish.cs index 8bf4fa7f94..f7cb7d9d3b 100644 --- a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/UnrelentingAnguish.cs +++ b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/UnrelentingAnguish.cs @@ -40,7 +40,7 @@ class VacuumClaw(BossModule module) : Components.GenericAOEs(module, ActionID.Ma { private readonly IReadOnlyList _sources = module.Enemies(OID.VacuumClaw); - private static readonly AOEShapeCircle _shape = new(10); // TODO: verify radius; initial voidzone is 6, but spell radius is 1 in sheets; after 5th hit we get 4 stacks of area-of-influence increase + private static readonly AOEShapeCircle _shape = new(12); // TODO: verify radius; initial voidzone is 6, but spell radius is 1 in sheets; after 5th hit we get 4 stacks of area-of-influence increase public override IEnumerable ActiveAOEs(int slot, Actor actor) => _sources.Select(s => new AOEInstance(_shape, s.Position)); } From 7b753937c1ec9001b365a28c0c7416afcf606060 Mon Sep 17 00:00:00 2001 From: CarnifexOptimus <156172553+CarnifexOptimus@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:32:04 +0100 Subject: [PATCH 2/3] stylistic change --- .../D093Lunipyati.cs | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) 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) From e1e8dba595257aa2f9a51de46f2bea9e412729fb Mon Sep 17 00:00:00 2001 From: CarnifexOptimus <156172553+CarnifexOptimus@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:39:46 +0100 Subject: [PATCH 3/3] merge fix --- BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs | 2 +- BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs index 540882db4e..3510fb75f6 100644 --- a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs +++ b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs @@ -10,7 +10,7 @@ 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 NormalBounds = new([new Polygon(default, 19.5f, 48)]); public static readonly ArenaBoundsComplex IntermissionBounds = new([new Polygon(default, 15, 48)]); diff --git a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs index c04a4ec8af..b90db83721 100644 --- a/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs +++ b/BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs @@ -151,7 +151,6 @@ 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 + 0x12, 5.7f, comp => comp.Active) .ActivateOnEnter() @@ -163,7 +162,6 @@ private void Intermission(uint id, float delay) .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")