Skip to content

Commit ffbf92f

Browse files
Merge pull request #974 from FFXIV-CombatReborn/mergeWIP
fix Mica, make lighter note prediction better, show Statice config fo…
2 parents b59a0e5 + 956589c commit ffbf92f

File tree

4 files changed

+35
-26
lines changed

4 files changed

+35
-26
lines changed

BossMod/Modules/Dawntrail/FATE/MicaTheMagicalMu.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ sealed class Draw(BossModule module) : Components.GenericAOEs(module)
8686
module.Enemies((uint)OID.Card6),
8787
];
8888
private AOEInstance[] _aoes = [];
89-
private int cachedIndex = -1;
89+
private readonly List<int> cachedCardIndices = new(2);
9090

9191
private static readonly AOEShapeRect _shape = new(20f, 7f);
9292

@@ -126,7 +126,7 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell)
126126
{
127127
for (var i = 0; i < 5; ++i)
128128
{
129-
ref var aoe = ref _aoes[0];
129+
ref var aoe = ref _aoes[i];
130130
aoe.Activation = activation;
131131
aoe.Risky = true;
132132
}
@@ -137,13 +137,9 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell)
137137

138138
private void AddAOEs(int safeZoneIndex)
139139
{
140-
if (safeZoneIndex < 0)
141-
{
142-
return;
143-
}
144140
if (_aoes.Length != 0)
145141
{
146-
cachedIndex = safeZoneIndex;
142+
cachedCardIndices.Add(safeZoneIndex);
147143
return;
148144
}
149145
_aoes = new AOEInstance[5];
@@ -167,8 +163,11 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell)
167163
if (spell.Action.ID == (uint)AID.CardTrickAOEFake)
168164
{
169165
_aoes = [];
170-
AddAOEs(cachedIndex);
171-
cachedIndex = -1;
166+
if (cachedCardIndices.Count != 0)
167+
{
168+
AddAOEs(cachedCardIndices[0]);
169+
cachedCardIndices.RemoveAt(0);
170+
}
172171
}
173172
}
174173
}

BossMod/Modules/Endwalker/Alliance/A14Naldthal/FarAboveDeepBelow.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,20 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell)
9292
if (spell.Action.ID is (uint)AID.DeepestPitFirst or (uint)AID.DeepestPitRest)
9393
{
9494
var count = _aoes.Count;
95+
var aoes = CollectionsMarshal.AsSpan(_aoes);
96+
var id = caster.InstanceID;
9597
for (var i = 0; i < count; ++i)
9698
{
97-
if (_aoes[i].ActorID == caster.InstanceID)
99+
if (aoes[i].ActorID == id)
98100
{
99101
_aoes.RemoveAt(i);
100102
break;
101103
}
102104
}
103-
if (count == 0)
105+
if (_aoes.Count == 0)
106+
{
104107
_targets.Clear();
108+
}
105109
}
106110
}
107111

BossMod/Modules/Endwalker/Criterion/C03AAI/C033Statice/C033Statice.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class SFaerieRing(BossModule module) : FaerieRing(module, (uint)AID.SFaerieRing)
1212

1313
public abstract class C033Statice(WorldState ws, Actor primary) : BossModule(ws, primary, new(-200f, default), new ArenaBoundsCircle(20f));
1414

15-
[ModuleInfo(BossModuleInfo.Maturity.Verified, PrimaryActorOID = (uint)OID.NBoss, GroupType = BossModuleInfo.GroupType.CFC, GroupID = 979, NameID = 12506, SortOrder = 9, PlanLevel = 90)]
15+
[ModuleInfo(BossModuleInfo.Maturity.Verified, PrimaryActorOID = (uint)OID.NBoss, GroupType = BossModuleInfo.GroupType.CFC, GroupID = 979, NameID = 12506, SortOrder = 9, PlanLevel = 90, ConfigType = typeof(C033SStaticeConfig))]
1616
public class C033NStatice(WorldState ws, Actor primary) : C033Statice(ws, primary);
1717

1818
[ModuleInfo(BossModuleInfo.Maturity.Verified, PrimaryActorOID = (uint)OID.SBoss, GroupType = BossModuleInfo.GroupType.CFC, GroupID = 980, NameID = 12506, SortOrder = 9, PlanLevel = 90)]

BossMod/Modules/Shadowbringers/Alliance/A35FalseIdol/LighterNote.cs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public override void Update()
7171
{
7272
var c = casters[i];
7373
var cc = c.caster;
74-
if (cc.LastFrameMovement == default) // remove hints only when the marker stopped moving
74+
if (cc.LastFrameMovementVec4 == default) // remove hints only when the marker stopped moving
7575
{
7676
casters.RemoveAt(i);
7777
if (casters.Count == 0)
@@ -125,22 +125,28 @@ public override void Update()
125125
{
126126
var c = casters[i];
127127
var cc = c.caster;
128-
if (cc.LastFrameMovement == default) // add exaflare only when the marker stopped moving
128+
if (cc.LastFrameMovementVec4 != default) // add exaflare only when all markers stopped moving
129129
{
130-
var center = Arena.Center;
131-
WDir[] dirs = c.isNorthSouth ? [new(default, 1f), new(default, -1f)] : [new(1f, default), new(-1f, default)];
132-
for (var j = 0; j < 2; ++j)
130+
return;
131+
}
132+
}
133+
for (var i = count; i >= 0; --i)
134+
{
135+
var c = casters[i];
136+
var cc = c.caster;
137+
var center = Arena.Center;
138+
WDir[] dirs = c.isNorthSouth ? [new(default, 1f), new(default, -1f)] : [new(1f, default), new(-1f, default)];
139+
for (var j = 0; j < 2; ++j)
140+
{
141+
var intersect = (int)Intersect.RayAABB(cc.Position - center, dirs[j], 27f, 27f); // exaflare is allowed to go upto 27y away from center
142+
var maxexplosions = intersect / 6;
143+
if (j == 0)
133144
{
134-
var intersect = (int)Intersect.RayAABB(cc.Position - center, dirs[j], 27f, 27f); // exaflare is allowed to go upto 27y away from center
135-
var maxexplosions = intersect / 6;
136-
if (j == 0)
137-
{
138-
maxexplosions += 1;
139-
}
140-
Lines.Add(new(cc.Position + (j == 0 ? default : 6f) * dirs[j], 6f * dirs[j], j != 0 ? activation : activation.AddSeconds(1.1d), 1.1d, maxexplosions, 9));
145+
maxexplosions += 1;
141146
}
142-
casters.RemoveAt(i);
147+
Lines.Add(new(cc.Position + (j == 0 ? default : 6f) * dirs[j], 6f * dirs[j], j != 0 ? activation : activation.AddSeconds(1.1d), 1.1d, maxexplosions, 9));
143148
}
149+
casters.RemoveAt(i);
144150
}
145151
base.Update();
146152
}
@@ -154,7 +160,7 @@ public override void OnEventCast(Actor caster, ActorCastEvent spell)
154160
for (var i = 0; i < count; ++i)
155161
{
156162
var line = Lines[i];
157-
if (line.Next.AlmostEqual(pos, 0.1f))
163+
if (line.Next.AlmostEqual(pos, 0.05f))
158164
{
159165
AdvanceLine(line, pos);
160166
if (line.ExplosionsLeft == 0)

0 commit comments

Comments
 (0)