Skip to content

Commit

Permalink
Merge pull request #447 from FFXIV-CombatReborn/mergeWIP
Browse files Browse the repository at this point in the history
small change
  • Loading branch information
CarnifexOptimus authored Nov 20, 2024
2 parents c99d151 + e1e8dba commit 98bcdec
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -204,22 +206,6 @@ private void GenerateAOEsForMixedPattern2()
}
}

private static bool HasTwoOppositePairs(List<float> 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<float> 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)
Expand Down
11 changes: 11 additions & 0 deletions BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Intermission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<AOEInstance> AOEs = [];
Expand Down
7 changes: 4 additions & 3 deletions BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1Byakko.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions BossMod/Modules/Dawntrail/Unreal/Un1Byakko/Un1ByakkoStates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<VoiceOfThunder>()
.DeactivateOnExit<VoiceOfThunder>()
.OnExit(() => _module.Arena.Bounds = Un1Byakko.FreeFallBounds)
.SetHint(StateMachine.StateHint.Raidwide | StateMachine.StateHint.DowntimeStart);
ComponentCondition<IntermissionSweepTheLeg>(id + 0x20, 42.2f, comp => comp.NumCasts > 0, "Donut 1")
ComponentCondition<Intermission>(id + 0x12, 5.7f, comp => comp.Active)
.ActivateOnEnter<Intermission>()
.OnExit(() => Module.Arena.Bounds = Un1Byakko.IntermissionBounds);
ComponentCondition<IntermissionSweepTheLeg>(id + 0x20, 36.5f, comp => comp.NumCasts > 0, "Donut 1")
.ActivateOnEnter<IntermissionOrbAratama>()
.ActivateOnEnter<IntermissionSweepTheLeg>();
ComponentCondition<ImperialGuard>(id + 0x21, 5.7f, comp => comp.NumCasts > 0, "Line 1")
.ActivateOnEnter<ImperialGuard>();
ComponentCondition<ImperialGuard>(id + 0x22, 12, comp => comp.NumCasts > 1, "Line 2");
ComponentCondition<IntermissionSweepTheLeg>(id + 0x23, 13.6f, comp => comp.NumCasts > 1, "Donut 2")
.OnExit(() => _module.Arena.Bounds = Un1Byakko.DefaultBounds)
.DeactivateOnExit<IntermissionOrbAratama>()
.DeactivateOnExit<IntermissionSweepTheLeg>();
ComponentCondition<ImperialGuard>(id + 0x24, 3.4f, comp => comp.NumCasts > 2, "Line 3")
.DeactivateOnExit<ImperialGuard>();
ComponentCondition<FellSwoop>(id + 0x25, 27.7f, comp => comp.NumCasts > 0, "Raidwide")
ComponentCondition<Intermission>(id + 0x25, 7.5f, comp => !comp.Active)
.DeactivateOnExit<Intermission>()
.OnExit(() => Module.Arena.Bounds = Un1Byakko.NormalBounds);
ComponentCondition<FellSwoop>(id + 0x26, 20.2f, comp => comp.NumCasts > 0, "Raidwide")
.ActivateOnEnter<FellSwoop>()
.DeactivateOnExit<FellSwoop>()
.SetHint(StateMachine.StateHint.Raidwide);
Expand Down

0 comments on commit 98bcdec

Please sign in to comment.