Skip to content

Commit

Permalink
Fix stay/move activation times.
Browse files Browse the repository at this point in the history
  • Loading branch information
awgil committed Nov 20, 2024
1 parent 10f9b34 commit 9670579
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions BossMod/Components/StayMove.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public override void AddHints(int slot, Actor actor, TextHints hints)

public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
if (PlayerStates[slot].Activation == default)
return;
switch (PlayerStates[slot].Requirement)
{
case Requirement.Stay:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public override void OnEventIcon(Actor actor, uint iconID, ulong targetID)
{
if (iconID == (uint)IconID.CalamitysChill && Raid.FindSlot(actor.InstanceID) is var slot && slot >= 0)
{
PlayerStates[slot] = new(Requirement.Move, default);
PlayerStates[slot] = new(Requirement.Move, WorldState.FutureTime(7));
++NumImminent;
}
}
Expand Down
2 changes: 1 addition & 1 deletion BossMod/Modules/Dawntrail/Hunt/RankS/ArchAethereater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public override void OnStatusLose(Actor actor, ActorStatus status)
SID.Heatstroke => new(Requirement.Stay, status.ExpireAt),
SID.Pyretic => new(Requirement.Stay, WorldState.CurrentTime, 1),
SID.ColdSweats => new(Requirement.Move, status.ExpireAt.AddSeconds(1)),
SID.FreezingUp => new(Requirement.Move, status.ExpireAt, 1),
SID.FreezingUp => new(Requirement.Move, WorldState.CurrentTime, 1),
_ => default
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ public override void OnStatusGain(Actor actor, ActorStatus status)
{
case SID.ArcaneFever:
if (Raid.FindSlot(actor.InstanceID) is var feverSlot && feverSlot >= 0)
PlayerStates[feverSlot] = new(Requirement.Stay, default);
PlayerStates[feverSlot] = new(Requirement.Stay, status.ExpireAt);
break;
case SID.FeverReversed:
if (Raid.FindSlot(actor.InstanceID) is var revSlot && revSlot >= 0)
PlayerStates[revSlot] = new(Requirement.Move, default);
PlayerStates[revSlot] = new(Requirement.Move, status.ExpireAt);
break;
case SID.Pyretic:
case SID.FreezingUp:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell)
};
if (req != Requirement.None)
{
Array.Fill(PlayerStates, new(req, default));
Array.Fill(PlayerStates, new(req, Module.CastFinishAt(spell)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public override void OnStatusGain(Actor actor, ActorStatus status)
if ((SID)status.ID is SID.AccelerationBomb)
{
if (Raid.FindSlot(actor.InstanceID) is var slot && slot >= 0)
PlayerStates[slot] = new(Requirement.Stay, default);
PlayerStates[slot] = new(Requirement.Stay, status.ExpireAt);
}
}

Expand All @@ -31,7 +31,7 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell)
if ((AID)spell.Action.ID == AID.SenseWeakness)
{
if (Raid.FindSlot(caster.TargetID) is var slot && slot >= 0)
PlayerStates[slot] = new(Requirement.Move, default);
PlayerStates[slot] = new(Requirement.Move, Module.CastFinishAt(spell));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void ApplyNextRequirement()
1 => _second,
_ => Requirement.None
};
Array.Fill(PlayerStates, new(req, default));
Array.Fill(PlayerStates, new(req, WorldState.FutureTime(4.1f)));
}
}

Expand Down
4 changes: 2 additions & 2 deletions BossMod/Modules/Shadowbringers/Ultimate/TEA/P4FinalWord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell)
if (req != Requirement.None)
{
_first = req;
Array.Fill(PlayerStates, new(req, default));
Array.Fill(PlayerStates, new(req, Module.CastFinishAt(spell)));
}
}

Expand All @@ -73,7 +73,7 @@ public override void OnEventCast(Actor caster, ActorCastEvent spell)
var slot = Raid.FindSlot(spell.MainTargetID);
if (slot >= 0)
{
PlayerStates[slot].Requirement = PlayerStates[slot].Requirement != _first ? Requirement.None : _first == Requirement.Move ? Requirement.Stay : Requirement.Move;
PlayerStates[slot] = PlayerStates[slot].Requirement != _first ? default : new(_first == Requirement.Move ? Requirement.Stay : Requirement.Move, WorldState.FutureTime(11));
}
}
}
Expand Down

0 comments on commit 9670579

Please sign in to comment.