Skip to content

Commit

Permalink
Merge pull request #498 from FFXIV-CombatReborn/mergeWIP
Browse files Browse the repository at this point in the history
jeuno improvements
  • Loading branch information
CarnifexOptimus authored Dec 12, 2024
2 parents 4efe0fb + 6b3c6c5 commit 29b6dc2
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 21 deletions.
12 changes: 10 additions & 2 deletions BossMod/Modules/Dawntrail/Alliance/A11Prishe/AsuranFists.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ namespace BossMod.Dawntrail.Alliance.A11Prishe;

class AsuranFists(BossModule module) : Components.GenericTowers(module)
{
public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
if ((AID)spell.Action.ID == AID.AsuranFistsVisual)
{
Towers.Add(new(spell.LocXZ, 6, PartyState.MaxAllianceSize, PartyState.MaxAllianceSize, activation: Module.CastFinishAt(spell, 0.5f)));
}
}

public override void OnActorEAnim(Actor actor, uint state)
{
if ((OID)actor.OID == OID.Tower && state == 0x00100020)
if (Towers.Count != 0 && (OID)actor.OID == OID.Tower && state == 0x00100020)
{
Towers.Add(new(actor.Position, 6, PartyState.MaxAllianceSize, PartyState.MaxAllianceSize, activation: WorldState.FutureTime(6)));
Towers[0] = Towers[0] with { Position = actor.Position }; // spell position can be about one or two pixels off the real tower position...
}
}

Expand Down
2 changes: 1 addition & 1 deletion BossMod/Modules/Dawntrail/Alliance/A12Fafnir/A12Fafnir.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class PestilentSphere(BossModule module) : Components.SingleTargetCast(module, A

class ShudderingEarth(BossModule module) : Components.CastCounter(module, ActionID.MakeSpell(AID.ShudderingEarth));

class Darter(BossModule module) : Components.Adds(module, (uint)OID.Darter)
class Darter(BossModule module) : Components.Adds(module, (uint)OID.Darter, 1)
{
public override bool KeepOnPhaseChange => true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme
var w = _smallWhirldwinds[i];
forbidden.Add(ShapeDistance.Capsule(w.Position, !moving ? w.Rotation + a180 : w.Rotation, length, 5));
}
hints.AddForbiddenZone(p => forbidden.Min(f => f(p)));
hints.AddForbiddenZone(p => forbidden.Min(f => f(p)), WorldState.FutureTime(1.1f));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ namespace BossMod.Dawntrail.Alliance.A12Fafnir;
class Touchdown(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.Touchdown), new AOEShapeCircle(24))
{
public override bool KeepOnPhaseChange => true;
private readonly DragonBreath? _aoe = module.FindComponent<DragonBreath>();

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
{
return _aoe?.AOE == null || Arena.Bounds != A12Fafnir.FireArena
return Module.FindComponent<DragonBreath>()?.AOE == null || Arena.Bounds != A12Fafnir.FireArena
? ActiveCasters.Select(c => new AOEInstance(Shape, c.Position, c.CastInfo!.Rotation, Module.CastFinishAt(c.CastInfo))) : [];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public A13ArkAngelsStates(A13ArkAngels module) : base(module)
{
_module = module;
DeathPhase(0, SinglePhase)
.ActivateOnEnter<DecisiveBattle>()
.ActivateOnEnter<ArenaChange>()
.ActivateOnEnter<Cloudsplitter>()
.ActivateOnEnter<TachiYukikaze>()
.ActivateOnEnter<TachiGekko>()
Expand Down Expand Up @@ -66,9 +68,7 @@ private void SinglePhase(uint id)

private void DecisiveBattle(uint id, float delay)
{
ActorCast(id, _module.BossMR, AID.DecisiveBattleMR, delay, 4, true, "Assign target")
.ActivateOnEnter<ArenaChange>()
.ActivateOnEnter<DecisiveBattle>();
ActorCast(id, _module.BossMR, AID.DecisiveBattleMR, delay, 4, true, "Assign target");
}

private void Cloudsplitter(uint id, float delay)
Expand Down Expand Up @@ -105,7 +105,8 @@ private void MeikyoShisui(uint id, float delay)

private void Meteor(uint id, float delay)
{
ActorCast(id, _module.BossTT, AID.Meteor, delay, 11, true, "Interrupt", true);
ActorCast(id, _module.BossTT, AID.Meteor, delay, 11, true, "Interrupt", true)
.OnExit(() => _module.Arena.Bounds = A13ArkAngels.DefaultBounds); // fall back for people who joined fight late
}

private State HavocSpiral(uint id, float delay)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)

class CrossReaver(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.CrossReaverAOE), new AOEShapeCross(50, 6))
{
private readonly LightsChain? _aoe = module.FindComponent<LightsChain>();
public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
{
var check = _aoe != null && _aoe.Casters.Count != 0;
var chain = Module.FindComponent<LightsChain>();
var check = chain != null && chain.Casters.Count != 0;
return ActiveCasters.Select(c => new AOEInstance(Shape, c.Position, c.CastInfo!.Rotation, Module.CastFinishAt(c.CastInfo), Risky: !check));
}
}
14 changes: 14 additions & 0 deletions BossMod/Modules/Dawntrail/Alliance/A13ArkAngels/DecisiveBattle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ public override void OnTethered(Actor source, ActorTetherInfo tether)
}
}

// fall back since players outside arena bounds do not get tethered but will still receive status effects
public override void OnStatusGain(Actor actor, ActorStatus status)
{
var boss = (SID)status.ID switch
{
SID.EpicHero => OID.BossMR,
SID.VauntedHero => OID.BossTT,
SID.FatedHero => OID.BossGK,
_ => default
};
if (boss != default && Raid.FindSlot(actor.InstanceID) is var slot && slot >= 0)
AssignedBoss[slot] = Module.Enemies(boss).FirstOrDefault();
}

public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
if (slot < AssignedBoss.Length && AssignedBoss[slot] != null)
Expand Down
14 changes: 7 additions & 7 deletions BossMod/Modules/Dawntrail/Alliance/A14ShadowLord/GigaSlash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ namespace BossMod.Dawntrail.Alliance.A14ShadowLord;

class GigaSlash(BossModule module) : Components.GenericAOEs(module)
{
private readonly List<AOEInstance> _aoes = [];
public readonly List<AOEInstance> AOEs = [];
private static readonly HashSet<AID> castEnds = [AID.GigaSlashLAOE1, AID.GigaSlashRAOE2, AID.GigaSlashRAOE1, AID.GigaSlashLAOE2, AID.GigaSlashNightfallFAOE3,
AID.GigaSlashNightfallBAOE3, AID.GigaSlashNightfallLAOE1, AID.GigaSlashNightfallRAOE2, AID.GigaSlashNightfallRAOE1, AID.GigaSlashNightfallLAOE2];
private static readonly AOEShapeCone[] _shapes = [new(60, 112.5f.Degrees()), new(60, 135.Degrees()), new(60, 105.Degrees())];

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor) => _aoes.Take(1);
public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor) => AOEs.Take(1);

public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
base.AddAIHints(slot, actor, assignment, hints);
// stay close to the middle if there is next imminent aoe from same origin
if (_aoes.Count > 1 && _aoes[0].Origin == _aoes[1].Origin)
hints.AddForbiddenZone(ShapeDistance.InvertedCircle(_aoes[0].Origin, 3), _aoes[0].Activation);
if (AOEs.Count > 1 && AOEs[0].Origin == AOEs[1].Origin)
hints.AddForbiddenZone(ShapeDistance.InvertedCircle(AOEs[0].Origin, 3), AOEs[0].Activation);
}

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
Expand All @@ -23,7 +23,7 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell)
var position = caster.Position;

void AddAOE(AOEShapeCone shape, float rotationOffset, float finishOffset)
=> _aoes.Add(new(shape, position, rotation + rotationOffset.Degrees(), Module.CastFinishAt(spell, finishOffset)));
=> AOEs.Add(new(shape, position, rotation + rotationOffset.Degrees(), Module.CastFinishAt(spell, finishOffset)));

switch ((AID)spell.Action.ID)
{
Expand Down Expand Up @@ -63,8 +63,8 @@ public override void OnEventCast(Actor caster, ActorCastEvent spell)
if (castEnds.Contains((AID)spell.Action.ID))
{
++NumCasts;
if (_aoes.Count != 0)
_aoes.RemoveAt(0);
if (AOEs.Count != 0)
AOEs.RemoveAt(0);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Implosion(BossModule module) : Components.GenericAOEs(module)

private static readonly AOEShapeCone _shapeSmall = new(12, 90.Degrees()), _shapeLarge = new(90, 90.Degrees());

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor) => _aoes;
public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor) => Module.FindComponent<GigaSlash>()?.AOEs.Count == 0 ? _aoes : [];

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public override void OnEventCast(Actor caster, ActorCastEvent spell)
++NumCasts;
}

private AOEShape? ShapeForAction(ActionID action) => (AID)action.ID switch
private static AOEShape? ShapeForAction(ActionID action) => (AID)action.ID switch
{
AID.FlamesOfTheDeadReal => _shapeIn,
AID.LivingHeatReal => _shapeOut,
Expand Down

0 comments on commit 29b6dc2

Please sign in to comment.