Skip to content

Commit

Permalink
Merge pull request #179 from FFXIV-CombatReborn/mergeWIP2
Browse files Browse the repository at this point in the history
code analyzer fix
  • Loading branch information
CarnifexOptimus authored Jul 15, 2024
2 parents 2c37e47 + 48795b8 commit b47b63c
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions BossMod/Modules/Dawntrail/Dungeon/D05Origenics/D052Deceiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,30 +130,32 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
if ((AID)spell.Action.ID == AID.Surge)
{
var safewalls = GetActiveSafeWalls();
activation = spell.NPCFinishAt.AddSeconds(0.8f);
_sources.Add(new(caster.Position, 30, activation, _shape, spell.Rotation + 90.Degrees(), Kind.DirForward, default, safewalls));
_sources.Add(new(caster.Position, 30, activation, _shape, spell.Rotation - 90.Degrees(), Kind.DirForward, default, safewalls));
_sources.Add(new(caster.Position, 30, activation, _shape, spell.Rotation + 90.Degrees(), Kind.DirForward, default, ActiveSafeWalls));
_sources.Add(new(caster.Position, 30, activation, _shape, spell.Rotation - 90.Degrees(), Kind.DirForward, default, ActiveSafeWalls));
}
}

private List<SafeWall> GetActiveSafeWalls()
public List<SafeWall> ActiveSafeWalls
{
foreach (var kvp in ArenaChanges.ArenaBoundsMap)
get
{
if (Module.Arena.Bounds == kvp.Value)
foreach (var kvp in ArenaChanges.ArenaBoundsMap)
{
return kvp.Key switch
if (Module.Arena.Bounds == kvp.Value)
{
0x1B => walls2A1B,
0x1E => walls2C1E,
0x1D => walls2D1D,
0x1C => walls2B1C,
_ => []
};
return kvp.Key switch
{
0x1B => walls2A1B,
0x1E => walls2C1E,
0x1D => walls2D1D,
0x1C => walls2B1C,
_ => []
};
}
}
return [];
}
return [];
}

public override void OnCastFinished(Actor caster, ActorCastInfo spell)
Expand All @@ -170,8 +172,7 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme
if (Sources(slot, actor).Any() || activation > Module.WorldState.CurrentTime) // 0.8s delay to wait for action effect
{
var forbidden = new List<Func<WPos, float>>();
var safewalls = GetActiveSafeWalls();
foreach (var w in safewalls)
foreach (var w in ActiveSafeWalls)
forbidden.Add(ShapeDistance.InvertedRect(new(Module.Center.X, w.Vertex1.Z - 5), w.Vertex1.X == -187.5f ? new WDir(-4, 0) : new(4, 0), 8, 0, 20));
hints.AddForbiddenZone(p => forbidden.Select(f => f(p)).Max(), activation);
}
Expand Down

0 comments on commit b47b63c

Please sign in to comment.