Skip to content

Commit

Permalink
Merge pull request #570 from FFXIV-CombatReborn/mergeWIP
Browse files Browse the repository at this point in the history
fixed absolute virtue bug, merge vbm
  • Loading branch information
CarnifexOptimus authored Jan 22, 2025
2 parents 2667b11 + 4f38773 commit 72b7060
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 25 deletions.
4 changes: 2 additions & 2 deletions BossMod/Modules/Endwalker/Trial/T02Hydaelyn/Echoes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace BossMod.Endwalker.Trial.T02Hydaelyn;

class Echoes(BossModule module) : Components.UniformStackSpread(module, 6, 0, 8, 8)
{
public int NumCasts { get; private set; }
public int NumCasts;

public override void OnEventCast(Actor caster, ActorCastEvent spell)
{
Expand All @@ -20,6 +20,6 @@ public override void OnEventCast(Actor caster, ActorCastEvent spell)
public override void OnEventIcon(Actor actor, uint iconID, ulong targetID)
{
if (iconID == (uint)IconID.Echoes)
AddStack(actor);
AddStack(actor, WorldState.FutureTime(5));
}
}
23 changes: 2 additions & 21 deletions BossMod/Modules/Endwalker/Trial/T02Hydaelyn/Exodus.cs
Original file line number Diff line number Diff line change
@@ -1,35 +1,16 @@
namespace BossMod.Endwalker.Trial.T02Hydaelyn;

class Exodus(BossModule module) : BossComponent(module)
class Exodus(BossModule module) : Components.RaidwideInstant(module, ActionID.MakeSpell(AID.Exodus), 7.2f)
{
private int _numCrystalsDestroyed;
private DateTime _activation;

public override void AddGlobalHints(GlobalHints hints)
{
if (_activation != default)
hints.Add("Raidwide");
}

public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
if (_activation != default)
hints.PredictedDamage.Add((Raid.WithSlot(false, true, true).Mask(), _activation));
}

public override void OnActorDestroyed(Actor actor)
{
if ((OID)actor.OID == OID.CrystalOfLight)
{
++_numCrystalsDestroyed;
if (_numCrystalsDestroyed == 6)
_activation = WorldState.FutureTime(7.2f);
Activation = WorldState.FutureTime(7.2f);
}
}

public override void OnEventCast(Actor caster, ActorCastEvent spell)
{
if ((AID)spell.Action.ID == AID.Exodus)
_activation = default;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class BrightDarkAurora(BossModule module) : Components.GenericAOEs(module)

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
void AddAOE() => _aoes.Add(new(rect, spell.LocXZ, spell.Rotation, Module.CastFinishAt(spell)));
void AddAOE() => _aoes.Add(new(rect, spell.LocXZ, spell.Rotation, Module.CastFinishAt(spell), ActorID: caster.InstanceID));
switch ((AID)spell.Action.ID)
{
case AID.DarkAurora1:
Expand All @@ -19,6 +19,7 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell)
break;
case AID.BrightAurora1:
case AID.BrightAurora2:

if (caster.FindStatus(SID.AstralEssence) != null)
AddAOE();
break;
Expand All @@ -27,8 +28,17 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell)

public override void OnCastFinished(Actor caster, ActorCastInfo spell)
{
var count = _aoes.Count;
if (_aoes.Count != 0 && (AID)spell.Action.ID is AID.BrightAurora1 or AID.BrightAurora2 or AID.DarkAurora1 or AID.DarkAurora2)
_aoes.RemoveAt(0);
for (var i = 0; i < count; ++i)
{
var aoe = _aoes[i];
if (aoe.ActorID == caster.InstanceID)
{
_aoes.Remove(aoe);
break;
}
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions BossMod/Pathfinding/NavigationDecision.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ public static NavigationDecision Build(Context ctx, WorldState ws, AIHints hints
if (targetRadius < 1)
targetRadius = 1; // ensure targetRadius is at least 1 to prevent game from freezing

// local copies of forbidden zones and goal zones to prevent race conditions due to async pathfinding
(Func<WPos, float> shapeDistance, DateTime activation)[] localForbiddenZones = [.. hints.ForbiddenZones];
Func<WPos, float>[] localGoalZones = [.. hints.GoalZones];

var imminent = ImminentExplosionTime(ws.CurrentTime);
var len = localForbiddenZones.Length;
var numImminentZones = len;
Expand Down

0 comments on commit 72b7060

Please sign in to comment.