Skip to content

Commit

Permalink
Origenics improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
CarnifexOptimus committed Jul 17, 2024
1 parent fb204b6 commit 62f185e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public enum AID : uint
IncendiaryRing = 38452 // Aerostat2->self, 4.8s cast, range 3-12 donut
}

class IncendiaryRing(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.IncendiaryRing), new AOEShapeDonut(3, 10));
class IncendiaryRing(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.IncendiaryRing), new AOEShapeDonut(3, 12));

class D040VanguardAerostat1States : StateMachineBuilder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum AID : uint
SpreadShot = 39017, // SentryS7->self, 4.0s cast, range 12 90-degree cone
}

class IncendiaryRing(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.IncendiaryRing), new AOEShapeDonut(3, 10));
class IncendiaryRing(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.IncendiaryRing), new AOEShapeDonut(3, 12));
class Electrobeam(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.Electrobeam), new AOEShapeRect(50, 2));
class SpreadShot(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.SpreadShot), new AOEShapeCone(12, 90.Degrees()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public enum AID : uint
GrenadoShot = 35428, // OrigenicsSentryG10->location, 3.0s cast, range 5 circle
}

class IncendiaryCircle(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.IncendiaryCircle), new AOEShapeDonut(3, 10));
class GrenadoShot(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.GrenadoShot), new AOEShapeCircle(5));
class IncendiaryCircle(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.IncendiaryCircle), new AOEShapeDonut(3, 12));
class GrenadoShot(BossModule module) : Components.LocationTargetedAOEs(module, ActionID.MakeSpell(AID.GrenadoShot), 5);

class D050OrigenicsAerostatStates : StateMachineBuilder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ class Surge(BossModule module) : Components.Knockback(module)
new(new(-156.5f, -152), new(-156.5f, -162)), new(new(-156.5f, -122), new(-156.5f, -132))];
private static readonly List<SafeWall> walls2D1D = [new(new(-187.5f, -152), new(-187.5f, -162)), new(new(-187.5f, -122), new(-187.5f, -132)),
new(new(-156.5f, -142), new(-156.5f, -152)), new(new(-156.5f, -132), new(-156.5f, -142))];
private static readonly List<SafeWall> walls2B1C = [new(new(-187.5f, -152), new(-187.5f, -162)), new(new(-187.5f, -122), new(-187.5f, -132)),
new(new(-156.5f, -142), new(-156.5f, -152)), new(new(-156.5f, -132), new(-156.5f, -142))];
private static readonly List<SafeWall> walls2B1C = [new(new(-187.5f, -152), new(-187.5f, -162)), new(new(-187.5f, -132), new(-187.5f, -142)),
new(new(-156.5f, -142), new(-156.5f, -152)), new(new(-156.5f, -122), new(-156.5f, -132))];
private static readonly AOEShapeCone _shape = new(60, 90.Degrees());

public override IEnumerable<Source> Sources(int slot, Actor actor) => _sources;
Expand Down Expand Up @@ -173,7 +173,7 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme
{
var forbidden = new List<Func<WPos, float>>();
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));
forbidden.Add(ShapeDistance.InvertedRect(new(Module.Center.X, w.Vertex1.Z - 5), w.Vertex1.X == -187.5f ? new WDir(-4, 0) : new(4, 0), 10, 0, 20));
hints.AddForbiddenZone(p => forbidden.Select(f => f(p)).Max(), activation);
}
}
Expand Down
19 changes: 10 additions & 9 deletions BossMod/Modules/Dawntrail/Dungeon/D05Origenics/D053Ambrose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ExtrasensoryExpulsion(BossModule module) : Components.Knockback(module, ma
public readonly List<(WPos, Angle)> Data = [];
public DateTime Activation;
private readonly List<Source> _sources = [];
public static readonly AOEShapeRect RectNS = new(HalfHeight, QuarterWidth);
private static readonly AOEShapeRect rectNS = new(HalfHeight, QuarterWidth);
private static readonly AOEShapeRect rectEW = new(15, QuarterHeight);
private static readonly Angle[] angles = [-0.003f.Degrees(), -180.Degrees(), -89.982f.Degrees(), 89.977f.Degrees()];

Expand All @@ -96,15 +96,15 @@ private void HandleCastStarted(WPos position)
{
if (position.AlmostEqual(new(182.7f, 8.75f), 0.1f))
{
AddSourceAndData(new WDir(QuarterWidth, -HalfHeight), RectNS, angles[0]);
AddSourceAndData(new WDir(-QuarterWidth, HalfHeight), RectNS, angles[1]);
AddSourceAndData(new WDir(QuarterWidth, -HalfHeight), rectNS, angles[0]);
AddSourceAndData(new WDir(-QuarterWidth, HalfHeight), rectNS, angles[1]);
AddSource(new WDir(0, -QuarterHeight), rectEW, angles[2]);
AddSource(new WDir(0, QuarterHeight), rectEW, angles[3]);
}
else if (position.AlmostEqual(new(182.5f, -8.75f), 0.1f))
{
AddSourceAndData(new WDir(-QuarterWidth, -HalfHeight), RectNS, angles[0]);
AddSourceAndData(new WDir(QuarterWidth, HalfHeight), RectNS, angles[1]);
AddSourceAndData(new WDir(-QuarterWidth, -HalfHeight), rectNS, angles[0]);
AddSourceAndData(new WDir(QuarterWidth, HalfHeight), rectNS, angles[1]);
AddSource(new WDir(0, -QuarterHeight), rectEW, angles[3]);
AddSource(new WDir(0, QuarterHeight), rectEW, angles[2]);
}
Expand Down Expand Up @@ -135,7 +135,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 forbiddenZones = Data.Select(w => ShapeDistance.InvertedRect(w.Item1, w.Item2, HalfHeight, 0, QuarterWidth)).ToList();
var forbiddenZones = Data.Select(w => ShapeDistance.InvertedRect(w.Item1, w.Item2, HalfHeight - 0.5f, 0, QuarterWidth)).ToList();
hints.AddForbiddenZone(p => forbiddenZones.Max(f => f(p)), Activation);
}
}
Expand All @@ -148,6 +148,7 @@ class OverwhelmingCharge(BossModule module) : Components.GenericAOEs(module)
private const string Risk2Hint = "Walk into safespot for knockback!";
private const string StayHint = "Wait inside safespot for knockback!";
private static readonly AOEShapeCone cone = new(26, 90.Degrees());
private static readonly AOEShapeRect rect = new(19, 7.5f);
private AOEInstance _aoe;

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
Expand All @@ -160,12 +161,12 @@ public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
if (componentActive)
{
var safezone = component.Data.FirstOrDefault(x => _aoe.Rotation.AlmostEqual(x.Item2 + 180.Degrees(), Helpers.RadianConversion));
yield return new(ExtrasensoryExpulsion.RectNS, safezone.Item1, safezone.Item2, component.Activation, ArenaColor.SafeFromAOE, false);
yield return new(rect, safezone.Item1, safezone.Item2, component.Activation, ArenaColor.SafeFromAOE, false);
}
}
else if (componentActive)
foreach (var c in component.Data)
yield return new(ExtrasensoryExpulsion.RectNS, c.Item1, c.Item2, component.Activation, ArenaColor.SafeFromAOE, false);
yield return new(rect, c.Item1, c.Item2, component.Activation, ArenaColor.SafeFromAOE, false);
}

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
Expand Down Expand Up @@ -193,7 +194,7 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme
public override void AddHints(int slot, Actor actor, TextHints hints)
{
base.AddHints(slot, actor, hints);
var activeSafespot = ActiveAOEs(slot, actor).Where(c => c.Shape == ExtrasensoryExpulsion.RectNS).ToList();
var activeSafespot = ActiveAOEs(slot, actor).Where(c => c.Shape == rect).ToList();
if (activeSafespot.Count != 0)
{
if (!activeSafespot.Any(c => c.Check(actor.Position)))
Expand Down

0 comments on commit 62f185e

Please sign in to comment.