Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Okina module, potential fix to open world modules not unloading if boss resets #7

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion BossMod/Modules/Endwalker/FATE/Chi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ public ChiStates(BossModule module) : base(module)
.ActivateOnEnter<ThermobaricExplosive>()
.ActivateOnEnter<Bunkerbuster>()
.ActivateOnEnter<BouncingBomb>()
.ActivateOnEnter<MissileShower>();
.ActivateOnEnter<MissileShower>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
12 changes: 6 additions & 6 deletions BossMod/Modules/Endwalker/FATE/Daivadipa.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public enum SID : uint
class LitPath : Components.GenericAOEs
{
private static readonly AOEShapeRect rect = new(50, 5);
private static readonly Angle[] rotations = [0.Degrees(), 90.Degrees(), 180.Degrees(), -90.Degrees()];
private DateTime _activation;
private bool redblue1;
private bool redblue2;
Expand All @@ -73,16 +72,16 @@ public override IEnumerable<AOEInstance> ActiveAOEs(BossModule module, int slot,
{
foreach (var o in module.Enemies(OID.OrbOfImmolationBlue))
{
if (bluered1 && o.Rotation.AlmostEqual(rotations.FirstOrDefault(r => o.Rotation.AlmostEqual(r, maxError)), maxError))
if (bluered1 && (o.Rotation.AlmostEqual(90.Degrees(), maxError) || o.Rotation.AlmostEqual(180.Degrees(), maxError)))
yield return new(rect, o.Position, o.Rotation, _activation.AddSeconds(1.9f));
if (redblue2 && !redblue1 && o.Rotation.AlmostEqual(rotations.FirstOrDefault(r => o.Rotation.AlmostEqual(r, maxError)), maxError))
if (redblue2 && !redblue1 && (o.Rotation.AlmostEqual(90.Degrees(), maxError) || o.Rotation.AlmostEqual(180.Degrees(), maxError)))
yield return new(rect, o.Position, o.Rotation, _activation.AddSeconds(4));
}
foreach (var o in module.Enemies(OID.OrbOfImmolationRed))
{
if (bluered2 && !bluered1 && o.Rotation.AlmostEqual(rotations.FirstOrDefault(r => o.Rotation.AlmostEqual(r, maxError)), maxError))
if (bluered2 && !bluered1 && (o.Rotation.AlmostEqual(90.Degrees(), maxError) || o.Rotation.AlmostEqual(180.Degrees(), maxError)))
yield return new(rect, o.Position, o.Rotation, _activation.AddSeconds(4));
if (redblue1 && o.Rotation.AlmostEqual(rotations.FirstOrDefault(r => o.Rotation.AlmostEqual(r, maxError)), maxError))
if (redblue1 && (o.Rotation.AlmostEqual(90.Degrees(), maxError) || o.Rotation.AlmostEqual(180.Degrees(), maxError)))
yield return new(rect, o.Position, o.Rotation, _activation.AddSeconds(1.9f));
}
}
Expand Down Expand Up @@ -314,7 +313,8 @@ public DaivadipaStates(BossModule module) : base(module)
.ActivateOnEnter<ErrantAkasa>()
.ActivateOnEnter<KarmicFlames>()
.ActivateOnEnter<LitPath>()
.ActivateOnEnter<Burn>();
.ActivateOnEnter<Burn>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
7 changes: 4 additions & 3 deletions BossMod/Modules/Endwalker/HuntA/Aegeiros.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public enum AID : uint
class LeafstormRimestorm : Components.GenericAOEs
{
private DateTime _rimestormExpected;
private static AOEShapeCircle _leafstorm = new(10);
private static AOEShapeCone _rimestorm = new(40, 90.Degrees());
private static readonly AOEShapeCircle _leafstorm = new(10);
private static readonly AOEShapeCone _rimestorm = new(40, 90.Degrees());

public override IEnumerable<AOEInstance> ActiveAOEs(BossModule module, int slot, Actor actor)
{
Expand Down Expand Up @@ -71,7 +71,8 @@ public AegeirosStates(BossModule module) : base(module)
.ActivateOnEnter<LeafstormRimestorm>()
.ActivateOnEnter<Snowball>()
.ActivateOnEnter<Canopy>()
.ActivateOnEnter<BackhandBlow>();
.ActivateOnEnter<BackhandBlow>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
3 changes: 2 additions & 1 deletion BossMod/Modules/Endwalker/HuntA/ArchEta.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public ArchEtaStates(BossModule module) : base(module)
.ActivateOnEnter<TailSwipe>()
.ActivateOnEnter<HeavyStomp>()
.ActivateOnEnter<SonicHowl>()
.ActivateOnEnter<SteelFang>();
.ActivateOnEnter<SteelFang>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
3 changes: 2 additions & 1 deletion BossMod/Modules/Endwalker/HuntA/FanAil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public FanAilStates(BossModule module) : base(module)
.ActivateOnEnter<LiquidHell>()
.ActivateOnEnter<Plummet>()
.ActivateOnEnter<DeathSentence>()
.ActivateOnEnter<CycloneWing>();
.ActivateOnEnter<CycloneWing>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
3 changes: 2 additions & 1 deletion BossMod/Modules/Endwalker/HuntA/Gurangatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public GurangatchStates(BossModule module) : base(module)
{
TrivialPhase()
.ActivateOnEnter<Slammer>()
.ActivateOnEnter<BoneShaker>();
.ActivateOnEnter<BoneShaker>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
3 changes: 2 additions & 1 deletion BossMod/Modules/Endwalker/HuntA/Hulder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public HulderStates(BossModule module) : base(module)
.ActivateOnEnter<TempestuousWrath>()
.ActivateOnEnter<RottingElegy>()
.ActivateOnEnter<OdeToLostLove>()
.ActivateOnEnter<StormOfColor>();
.ActivateOnEnter<StormOfColor>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
3 changes: 2 additions & 1 deletion BossMod/Modules/Endwalker/HuntA/LunatenderQueen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public LunatenderQueenStates(BossModule module) : base(module)
.ActivateOnEnter<WickedWhim>()
.ActivateOnEnter<AvertYourEyesInverted>()
.ActivateOnEnter<YouMayApproachInverted>()
.ActivateOnEnter<AwayWithYouInverted>();
.ActivateOnEnter<AwayWithYouInverted>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
3 changes: 2 additions & 1 deletion BossMod/Modules/Endwalker/HuntA/Minerva.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ public MinervaStates(BossModule module) : base(module)
.ActivateOnEnter<BallisticMissile>()
.ActivateOnEnter<Hyperflame>()
.ActivateOnEnter<SonicAmplifier>()
.ActivateOnEnter<HammerKnuckles>();
.ActivateOnEnter<HammerKnuckles>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
3 changes: 2 additions & 1 deletion BossMod/Modules/Endwalker/HuntA/MoussePrincess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public MoussePrincessStates(BossModule module) : base(module)
.ActivateOnEnter<WhimsyAlaMode>()
.ActivateOnEnter<AmorphicFlail>()
.ActivateOnEnter<PrincessCacophony>()
.ActivateOnEnter<Banish>();
.ActivateOnEnter<Banish>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
3 changes: 2 additions & 1 deletion BossMod/Modules/Endwalker/HuntA/Petalodus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public PetalodusStates(BossModule module) : base(module)
.ActivateOnEnter<MarineMayhem>()
.ActivateOnEnter<Waterga>()
.ActivateOnEnter<TidalGuillotine>()
.ActivateOnEnter<AncientBlizzard>();
.ActivateOnEnter<AncientBlizzard>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
3 changes: 2 additions & 1 deletion BossMod/Modules/Endwalker/HuntA/Storsie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public StorsieStates(BossModule module) : base(module)
{
TrivialPhase()
.ActivateOnEnter<Aspect>()
.ActivateOnEnter<FangsEnd>();
.ActivateOnEnter<FangsEnd>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
5 changes: 3 additions & 2 deletions BossMod/Modules/Endwalker/HuntA/Sugriva.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Rip : Components.SelfTargetedAOEs
class RockThrow : Components.GenericAOEs
{
private Actor? _target;
private static AOEShapeCircle _shape = new(6);
private static readonly AOEShapeCircle _shape = new(6);

public RockThrow() : base(ActionID.MakeSpell(AID.RockThrowRest)) { }

Expand Down Expand Up @@ -142,7 +142,8 @@ public SugrivaStates(BossModule module) : base(module)
.ActivateOnEnter<ButcherHint>()
.ActivateOnEnter<Rip>()
.ActivateOnEnter<RockThrow>()
.ActivateOnEnter<Crosswind>();
.ActivateOnEnter<Crosswind>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
8 changes: 5 additions & 3 deletions BossMod/Modules/Endwalker/HuntA/Yilan.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace BossMod.Endwalker.HuntA.Yilan
{
Expand Down Expand Up @@ -31,7 +32,7 @@ class Soundstorm : Components.StatusDrivenForcedMarch
{
public Soundstorm() : base(2, (uint)SID.ForwardMarch, (uint)SID.AboutFace, (uint)SID.LeftFace, (uint)SID.RightFace) { }

public override bool DestinationUnsafe(BossModule module, int slot, Actor actor, WPos pos) => MiniLight.Shape.Check(pos, module.PrimaryActor);
public override bool DestinationUnsafe(BossModule module, int slot, Actor actor, WPos pos) => module.FindComponent<MiniLight>()?.ActiveAOEs(module, slot, actor).Any(z => z.Shape.Check(pos, z.Origin, z.Rotation)) ?? false;

public override void AddGlobalHints(BossModule module, GlobalHints hints)
{
Expand All @@ -44,7 +45,7 @@ class MiniLight : Components.GenericAOEs
{
private DateTime _activation;

public static AOEShapeCircle Shape = new(18);
private static readonly AOEShapeCircle Shape = new(18);

public override IEnumerable<AOEInstance> ActiveAOEs(BossModule module, int slot, Actor actor)
{
Expand Down Expand Up @@ -95,7 +96,8 @@ public YilanStates(BossModule module) : base(module)
.ActivateOnEnter<MiniLight>()
.ActivateOnEnter<Devour>()
.ActivateOnEnter<BogBomb>()
.ActivateOnEnter<BrackishRain>();
.ActivateOnEnter<BrackishRain>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
3 changes: 2 additions & 1 deletion BossMod/Modules/Endwalker/HuntS/Armstrong.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public ArmstrongStates(BossModule module) : base(module)
.ActivateOnEnter<AcceleratedLanding>()
.ActivateOnEnter<CalculatedCombustion>()
.ActivateOnEnter<Pummel>()
.ActivateOnEnter<SoporificGas>();
.ActivateOnEnter<SoporificGas>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}
[ModuleInfo(NotoriousMonsterID = 196)]
Expand Down
5 changes: 3 additions & 2 deletions BossMod/Modules/Endwalker/HuntS/Burfurlur.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public enum AID : uint
class QuintupleSneeze : Components.GenericAOEs
{
private Angle _referenceAngle;
private List<Angle> _pendingOffsets = new();
private readonly List<Angle> _pendingOffsets = [];
private DateTime _nextSneeze;

private static readonly AOEShapeCone _shape = new(40, 45.Degrees());
Expand Down Expand Up @@ -89,7 +89,8 @@ public BurfurlurStates(BossModule module) : base(module)
TrivialPhase()
.ActivateOnEnter<QuintupleSneeze>()
.ActivateOnEnter<Uppercut>()
.ActivateOnEnter<RottenSpores>();
.ActivateOnEnter<RottenSpores>()
.Raw.Update = () => module.PrimaryActor.IsDead || !module.PrimaryActor.InCombat;
}
}

Expand Down
Loading