Skip to content

Commit

Permalink
Merge pull request #490 from FFXIV-CombatReborn/mergeWIP
Browse files Browse the repository at this point in the history
some P3S improvements
  • Loading branch information
CarnifexOptimus authored Dec 8, 2024
2 parents 6f97fb1 + 869aba1 commit b576dc4
Show file tree
Hide file tree
Showing 24 changed files with 169 additions and 261 deletions.
15 changes: 1 addition & 14 deletions BossMod/Components/Gaze.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public override void DrawArenaForeground(int pcSlot, Actor pc)
foreach (var eye in ActiveEyes(pcSlot, pc))
{
var danger = HitByEye(pc, eye) != Inverted;
var eyeCenter = IndicatorScreenPos(eye.Position);
var eyeCenter = Arena.WorldPositionToScreenPosition(eye.Position);
DrawEye(eyeCenter, danger);

if (pc.Position.InCircle(eye.Position, eye.Range))
Expand All @@ -71,19 +71,6 @@ public static void DrawEye(Vector2 eyeCenter, bool danger)
}

private static bool HitByEye(Actor actor, Eye eye) => (actor.Rotation + eye.Forward).ToDirection().Dot((eye.Position - actor.Position).Normalized()) >= 0.707107f; // 45-degree

private Vector2 IndicatorScreenPos(WPos eye)
{
if (Arena.InBounds(eye))
{
return Arena.WorldPositionToScreenPosition(eye);
}
else
{
var dir = (eye - Arena.Center).Normalized();
return Arena.ScreenCenter + Arena.RotatedCoords(dir.ToVec2()) * (Arena.ScreenHalfSize + Arena.ScreenMarginSize * 0.5f);
}
}
}

// gaze that happens on cast end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public FlightOfTheGriffinStates(BossModule module) : base(module)
.ActivateOnEnter<FrigidPulse>()
.ActivateOnEnter<FervidPulse>()
.ActivateOnEnter<EyeOfTheFierce>()
.Raw.Update = () => module.Enemies(OID.TheBirdOfPrey).Concat([module.PrimaryActor]).All(e => e.IsDeadOrDestroyed);
.Raw.Update = () => module.Enemies(FlightOfTheGriffin.All).All(e => e.IsDeadOrDestroyed);
}
}

Expand Down Expand Up @@ -79,11 +79,12 @@ public class FlightOfTheGriffin(WorldState ws, Actor primary) : BossModule(ws, p
new(-8.3f, -292.66f), new(-7.07f, -292.66f), new(-7.07f, -292.13f), new(-7.01f, -291.61f), new(-5.11f, -291.43f),
new(-4.58f, -291.43f), new(-4.08f, -291.51f), new(-3.91f, -291.99f), new(-3.67f, -292.43f), new(-3.58f, -292.94f),
new(-3.58f, -294.47f)];

private static readonly ArenaBoundsComplex arena = new([new PolygonCustom(vertices)]);
public static readonly uint[] All = [(uint)OID.Boss, (uint)OID.TheBirdOfPrey];

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actors(Enemies(OID.TheBirdOfPrey).Concat([PrimaryActor]));
Arena.Actor(PrimaryActor);
Arena.Actors(Enemies(OID.TheBirdOfPrey));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ namespace BossMod.Dawntrail.Quest.JobQuests.Pictomancer.SomewhereOnlySheKnows.Ja

public enum OID : uint
{

Boss = 0x4298, // R4.000, x1
AFlowerInTheSun = 0x4299, // R2.72
OerTheAncientArbor = 0x429A, // R2.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public TheWingedSteedStates(BossModule module) : base(module)
TrivialPhase()
.ActivateOnEnter<BurningBright>()
.ActivateOnEnter<Nicker>()
.Raw.Update = () => module.Enemies(OID.SonOfTheKingdom1).Concat([module.PrimaryActor]).Concat(module.Enemies(OID.SonOfTheKingdom2)).All(e => e.IsDeadOrDestroyed);
.Raw.Update = () => module.Enemies(TheWingedSteed.All).All(e => e.IsDeadOrDestroyed);
}
}

Expand Down Expand Up @@ -59,9 +59,10 @@ public class TheWingedSteed(WorldState ws, Actor primary) : BossModule(ws, prima
new(25.8f, -229.2f), new(26.32f, -229.19f), new(26.58f, -230.24f), new(26.95f, -230.62f), new(27.47f, -230.59f),
new(27.9f, -230.94f), new(27.9f, -232.19f)];
private static readonly ArenaBoundsComplex arena = new([new PolygonCustom(vertices)]);
public static readonly uint[] All = [(uint)OID.Boss, (uint)OID.SonOfTheKingdom1, (uint)OID.SonOfTheKingdom2];

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actors(Enemies(OID.SonOfTheKingdom1).Concat([PrimaryActor]).Concat(Enemies(OID.SonOfTheKingdom2)));
Arena.Actors(Enemies(All));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ public FangsOfTheViperStates(BossModule module) : base(module)
public class FangsOfTheViper(WorldState ws, Actor primary) : BossModule(ws, primary, arena.Center, arena)
{
private static readonly ArenaBoundsComplex arena = new([new Polygon(new(264, 480), 19.5f, 20)]);
private static readonly uint[] all = [(uint)OID.FawningWivre, (uint)OID.FawningPeiste, (uint)OID.FawningRaptor, (uint)OID.WanderingGowrow];

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actors(Enemies(OID.FawningWivre).Concat(Enemies(OID.FawningPeiste)).Concat(Enemies(OID.FawningRaptor)).Concat(Enemies(OID.WanderingGowrow)));
Arena.Actors(Enemies(all));
}

protected override bool CheckPull() => Raid.WithoutSlot().Any(x => x.InCombat);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ public VengeanceOfTheViperStates(BossModule module) : base(module)
public class VengeanceOfTheViper(WorldState ws, Actor primary) : BossModule(ws, primary, arena.Center, arena)
{
private static readonly ArenaBoundsComplex arena = new([new Polygon(new(-402, 738), 19.5f, 20)]);
private static readonly uint[] all = [(uint)OID.Boss, (uint)OID.RightWing, (uint)OID.LeftWing];

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actors(Enemies(OID.RightWing).Concat(Enemies(OID.LeftWing)).Concat([PrimaryActor]));
Arena.Actors(Enemies(all));
}
}
23 changes: 20 additions & 3 deletions BossMod/Modules/Dawntrail/Quest/MSQ/TakingAStand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace BossMod.Dawntrail.Quest.MSQ.TakingAStand;
public enum OID : uint
{
Boss = 0x4211, // R=3.5
BakoolJaJaShade = 0x4215, // R3.500, x3
BakoolJaJaShade = 0x4215, // R3.5
Deathwall = 0x1EBA1F,
MagickedStandardOrange = 0x4212, // R1.0
MagickedStandardGreen = 0x4213, // R1.0
Expand All @@ -24,6 +24,7 @@ public enum AID : uint
AutoAttack2 = 871, // HoobigoLancer->player, no cast, single-target
AutoAttack3 = 873, // HiredThug3->player, no cast, single-target
Teleport = 37089, // Boss->location, no cast, single-target

Roar1 = 37090, // Boss->self, 5.0s cast, range 45 circle, spawns death wall
Roar2 = 37091, // Boss->self, 5.0s cast, range 45 circle
LethalSwipe = 37092, // Boss->self, 6.0s cast, range 45 180-degree cone
Expand Down Expand Up @@ -213,15 +214,31 @@ public TakingAStandStates(BossModule module) : base(module)
.ActivateOnEnter<TuraliStoneIII>()
.ActivateOnEnter<Fireflood>()
.ActivateOnEnter<RunThrough1>()
.ActivateOnEnter<RunThrough2>();
.ActivateOnEnter<RunThrough2>()
.Raw.Update = () => module.PrimaryActor.IsDestroyed || module.PrimaryActor.HPMP.CurHP == 1;
}
}

[ModuleInfo(BossModuleInfo.Maturity.Verified, Contributors = "The Combat Reborn Team (Malediktus)", GroupType = BossModuleInfo.GroupType.Quest, GroupID = 70438, NameID = 12677)]
public class TakingAStand(WorldState ws, Actor primary) : BossModule(ws, primary, new(500, -175), new ArenaBoundsCircle(24.5f))
{
private static readonly uint[] all = [(uint)OID.Boss, (uint)OID.HiredThug1, (uint)OID.HiredThug2, (uint)OID.HiredThug3, (uint)OID.HiredThug3, (uint)OID.HoobigoGuardian,
(uint)OID.HoobigoLancer, (uint)OID.DopproIllusionist];
protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actors(WorldState.Actors.Where(x => !x.IsAlly));
Arena.Actors(Enemies(all));
}

protected override void CalculateModuleAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
for (var i = 0; i < hints.PotentialTargets.Count; ++i)
{
var e = hints.PotentialTargets[i];
e.Priority = (OID)e.Actor.OID switch
{
OID.BakoolJaJaShade => AIHints.Enemy.PriorityForbidFully,
_ => 0
};
}
}
}
4 changes: 2 additions & 2 deletions BossMod/Modules/Dawntrail/Quest/MSQ/TheFeatOfBrotherhood.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ namespace BossMod.Dawntrail.Quest.MSQ.TheFeatOfBrotherhood;
public enum OID : uint
{
Boss = 0x4206, // R5.0
WukLamat = 0x4209, // R1.0
EphemeralSword = 0x4228, // R2.5
BallOfFire = 0x44B6, // R1.0-2.5
OathOfFire = 0x4229, // R2.500
Expand Down Expand Up @@ -257,6 +256,7 @@ public TheFeatOfBrotherhoodStates(BossModule module) : base(module)
{
protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actors(WorldState.Actors.Where(x => !x.IsAlly));
Arena.Actor(PrimaryActor);
Arena.Actors(Enemies(OID.OathOfFire));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell)

public override void OnCastFinished(Actor caster, ActorCastInfo spell)
{
if (_aoes.Count > 0 && (AID)spell.Action.ID == AID.Rush)
if (_aoes.Count != 0 && (AID)spell.Action.ID == AID.Rush)
_aoes.RemoveAt(0);
}
}
Expand Down Expand Up @@ -101,8 +101,11 @@ public OtisOathbrokenStates(BossModule module) : base(module)
{
protected override bool CheckPull() => Raid.WithoutSlot().Any(x => x.InCombat);

private static readonly uint[] all = [(uint)OID.Boss, (uint)OID.EverkeepTurret, (uint)OID.EverkeepAerostat, (uint)OID.EverkeepAerostat2, (uint)OID.EverkeepSentryG10,
(uint)OID.EverkeepSentryR10];

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actors(WorldState.Actors.Where(x => !x.IsAlly));
Arena.Actors(Enemies(all));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ namespace BossMod.Dawntrail.Quest.MSQ.TheProtectorAndTheDestroyer.Gwyddrud;
public enum OID : uint
{
Boss = 0x4349, // R5.0
Gwyddrud = 0x3A5E, // R1.000, x24
LimitBreakHelper = 0x40B5, // R1.000, x1
WukLamat = 0x4146, // R0.500, x1
Alisaie = 0x4339, // R0.485, x1
OtisOathmender = 0x4348, // R1.500, x1
Sphene = 0x4337, // R0.500, x1
BallOfLevin = 0x434A, // R1.500, x0 (spawn during fight)
SuperchargedLevin = 0x39C4, // R2.000, x0 (spawn during fight)
LimitBreakHelper = 0x40B5, // R1.0
BallOfLevin = 0x434A, // R1.5
SuperchargedLevin = 0x39C4, // R2.0
Helper2 = 0x3A5E, // R1.0
Helper = 0x233C
}

Expand All @@ -37,16 +33,16 @@ public enum AID : uint
LevinStartMoving = 38226, // BallOfLevin/SuperchargedLevin->LimitBreakHelper, no cast, single-target
GatheringSurge = 38243, // Boss->self, no cast, single-target
UntamedCurrent = 38232, // Boss->self, 3.3+0,7s cast, range 40 circle, knockback 15, away from source
UntamedCurrentAOE1 = 38233, // Gwyddrud->location, 3.1s cast, range 5 circle
UntamedCurrentAOE2 = 19718, // Gwyddrud->location, 3.2s cast, range 5 circle
UntamedCurrentAOE3 = 19719, // Gwyddrud->location, 3.3s cast, range 5 circle
UntamedCurrentAOE4 = 19999, // Gwyddrud->location, 3.0s cast, range 5 circle
UntamedCurrentAOE5 = 38234, // Gwyddrud->location, 3.1s cast, range 5 circle
UntamedCurrentAOE6 = 19720, // Gwyddrud->location, 3.2s cast, range 5 circle
UntamedCurrentAOE7 = 19721, // Gwyddrud->location, 3.3s cast, range 5 circle
UntamedCurrentAOE8 = 19728, // Gwyddrud->location, 3.3s cast, range 5 circle
UntamedCurrentAOE9 = 19727, // Gwyddrud->location, 3.2s cast, range 5 circle
UntamedCurrentAOE10 = 19179, // Gwyddrud->location, 3.1s cast, range 5 circle
UntamedCurrentAOE1 = 38233, // Helper2->location, 3.1s cast, range 5 circle
UntamedCurrentAOE2 = 19718, // Helper2->location, 3.2s cast, range 5 circle
UntamedCurrentAOE3 = 19719, // Helper2->location, 3.3s cast, range 5 circle
UntamedCurrentAOE4 = 19999, // Helper2->location, 3.0s cast, range 5 circle
UntamedCurrentAOE5 = 38234, // Helper2->location, 3.1s cast, range 5 circle
UntamedCurrentAOE6 = 19720, // Helper2->location, 3.2s cast, range 5 circle
UntamedCurrentAOE7 = 19721, // Helper2->location, 3.3s cast, range 5 circle
UntamedCurrentAOE8 = 19728, // Helper2->location, 3.3s cast, range 5 circle
UntamedCurrentAOE9 = 19727, // Helper2->location, 3.2s cast, range 5 circle
UntamedCurrentAOE10 = 19179, // Helper2->location, 3.1s cast, range 5 circle
UntamedCurrentSpread = 19181, // Helper->all, 5.0s cast, range 5 circle
UntamedCurrentStack = 19276, // Helper->Alisaie, 5.0s cast, range 6 circle
}
Expand Down Expand Up @@ -152,8 +148,10 @@ public GwyddrudStates(BossModule module) : base(module)
[ModuleInfo(BossModuleInfo.Maturity.Verified, Contributors = "The Combat Reborn Team (Malediktus)", GroupType = BossModuleInfo.GroupType.Quest, GroupID = 70478, NameID = 13170)]
public class Gwyddrud(WorldState ws, Actor primary) : BossModule(ws, primary, new(349, -14), new ArenaBoundsCircle(19.5f))
{
private static readonly uint[] all = [(uint)OID.Boss, (uint)OID.SuperchargedLevin, (uint)OID.BallOfLevin];

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actors(WorldState.Actors.Where(x => !x.IsAlly));
Arena.Actors(Enemies(all));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ public enum OID : uint
Ceratoraptor = 0x4634, // R1.95
HornedLizard = 0x4635, // R2.2
AlphaAlligator = 0x4637, // R5.13
Alligator = 0x4636, // R2.7
}

public enum AID : uint
{
AutoAttack1 = 870, // Yeheheceyaa/Ceratoraptor/AlphaAlligator->player/WukLamat/Koana/Boss, no cast, single-target
AutoAttack1 = 870, // Yeheheceyaa/Ceratoraptor/AlphaAlligator/Alligator->player/WukLamat/Koana/Boss, no cast, single-target
AutoAttack2 = 872, // HornedLizard->player/WukLamat/Koana, no cast, single-target

ToxicSpitVisual = 40561, // HornedLizard->self, 8.0s cast, single-target
ToxicSpit = 40562, // HornedLizard->Boss/Koana/WukLamat, no cast, single-target
CriticalBite = 40563, // 4636->self, 25.0s cast, range 10 120-degree cone
CriticalBite = 40563, // Alligator->self, 25.0s cast, range 10 120-degree cone
}

class FeedingTime(BossModule module) : Components.InterceptTether(module, ActionID.MakeSpell(AID.ToxicSpit), excludedAllies: [(uint)OID.Boss])
Expand Down Expand Up @@ -53,8 +54,7 @@ public AlphaAlligatorStates(BossModule module) : base(module)
TrivialPhase()
.ActivateOnEnter<FeedingTime>()
.ActivateOnEnter<CriticalBite>()
.Raw.Update = () => Module.WorldState.Actors.Where(x => !x.IsAlly && x.Position.AlmostEqual(Module.Arena.Center, Module.Bounds.Radius))
.All(x => x.IsDestroyed) || Module.Enemies(OID.AlphaAlligator).Any(x => x.IsDead);
.Raw.Update = () => module.Enemies(AlphaAlligator.All).Any(x => x.IsDestroyed) || module.Enemies(OID.AlphaAlligator).Any(x => x.IsDead);
}
}

Expand All @@ -74,9 +74,10 @@ public class AlphaAlligator(WorldState ws, Actor primary) : BossModule(ws, prima
new(406.61f, -125.40f), new(407.32f, -126.66f), new(407.47f, -127.25f), new(407.42f, -127.82f), new(406.67f, -128.79f),
new(406.44f, -129.39f), new(407.78f, -134.79f), new(408.15f, -135.35f), new(420.82f, -140.11f), new(423.33f, -140.59f)];
private static readonly ArenaBoundsComplex arena = new([new PolygonCustom(vertices)]);
public static readonly uint[] All = [(uint)OID.Yeheheceyaa, (uint)OID.AlphaAlligator, (uint)OID.HornedLizard, (uint)OID.Ceratoraptor, (uint)OID.Alligator];

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actors(WorldState.Actors.Where(x => !x.IsAlly));
Arena.Actors(Enemies(All));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ namespace BossMod.Dawntrail.Quest.MSQ.TheWarmthOfTheFamily.Tturuhhetso;

public enum OID : uint
{

Boss = 0x4638, // R5.95
ScaleArmoredLeg = 0x4648, // R5.95
BallOfFire = 0x4639, // R1.0
Expand Down Expand Up @@ -215,6 +214,7 @@ public class Tturuhhetso(WorldState ws, Actor primary) : BossModule(ws, primary,

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actors(WorldState.Actors.Where(x => !x.IsAlly));
Arena.Actor(PrimaryActor);
Arena.Actors(Enemies(OID.ScaleArmoredLeg));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public class TheMightiestShield(WorldState ws, Actor primary) : BossModule(ws, p
private static readonly ArenaBoundsComplex arena = new([new Polygon(new(-191, 72), 14.5f, 20)]);
private static readonly uint[] all = [(uint)OID.Boss, (uint)OID.CravenFollower1, (uint)OID.CravenFollower2, (uint)OID.CravenFollower3, (uint)OID.CravenFollower4,
(uint)OID.CravenFollower5, (uint)OID.CravenFollower6, (uint)OID.CravenFollower7, (uint)OID.CravenFollower8, (uint)OID.MagitekMissile, (uint)OID.UnyieldingMettle2,
(uint)OID.UnyieldingMettle3, (uint)OID.CrackedMettle1, (uint)OID.CrackedMettle2];
(uint)OID.UnyieldingMettle3]; // except CrackedMettle1/2 since the Parry component is drawing them

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ public D012SanduruvaStates(BossModule module) : base(module)
{
protected override void CalculateModuleAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
foreach (var e in hints.PotentialTargets)
for (var i = 0; i < hints.PotentialTargets.Count; ++i)
{
var e = hints.PotentialTargets[i];
e.Priority = (OID)e.Actor.OID switch
{
OID.Boss => 1,
OID.BerserkerSphere => -1,
OID.BerserkerSphere => AIHints.Enemy.PriorityForbidFully,
_ => 0
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,28 +204,28 @@ public D013MagusSistersStates(BossModule module) : base(module)
.ActivateOnEnter<DeltaBlizzardIII1>()
.ActivateOnEnter<DeltaBlizzardIII2>()
.ActivateOnEnter<DeltaBlizzardIII3>()
.Raw.Update = () => module.Enemies(OID.Sanduruva).Concat(module.Enemies(OID.Minduruva)).Concat([module.PrimaryActor]).All(e => e.IsDeadOrDestroyed);
.Raw.Update = () => module.Enemies(D013MagusSisters.Bosses).All(e => e.IsDeadOrDestroyed);
}
}

[ModuleInfo(BossModuleInfo.Maturity.Contributed, Contributors = "dhoggpt, Malediktus", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 783, NameID = 10265)]
class D013MagusSisters(WorldState ws, Actor primary) : BossModule(ws, primary, new(-27.5f, -49.5f), new ArenaBoundsCircle(20))
{
public static readonly uint[] Bosses = [(uint)OID.Boss, (uint)OID.Sanduruva, (uint)OID.Minduruva];
protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actor(PrimaryActor);
Arena.Actors(Enemies(OID.Minduruva).Concat(Enemies(OID.Sanduruva)));
Arena.Actors(Enemies(Bosses));
}

protected override void CalculateModuleAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
foreach (var e in hints.PotentialTargets)
for (var i = 0; i < hints.PotentialTargets.Count; ++i)
{
var e = hints.PotentialTargets[i];
e.Priority = (OID)e.Actor.OID switch
{
OID.Boss => 3,
OID.Minduruva => 2,
OID.Sanduruva => 1,
OID.Boss => 2,
OID.Minduruva => 1,
_ => 0
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace BossMod.Endwalker.Savage.P3SPhoinix;

// state related to brightened fire mechanic
// this helper relies on waymarks 1-4, and assumes they don't change during fight - this is of course quite an assumption, but whatever...
// this helper relies on waymarks 1-4
class BrightenedFire(BossModule module) : Components.CastCounter(module, ActionID.MakeSpell(AID.BrightenedFireAOE))
{
private readonly int[] _playerOrder = new int[8]; // 0 if unknown, 1-8 otherwise
Expand Down
Loading

0 comments on commit b576dc4

Please sign in to comment.