Skip to content

Commit

Permalink
Merge pull request #23 from awgil/master
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
LTS-FFXIV authored Apr 2, 2024
2 parents d178177 + 7cbfbc2 commit 0e4dc3e
Show file tree
Hide file tree
Showing 63 changed files with 1,010 additions and 499 deletions.
30 changes: 30 additions & 0 deletions BossMod/Components/BaitAway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,36 @@ public override void OnUntethered(BossModule module, Actor source, ActorTetherIn
}
}

// component for mechanics requiring icon targets to bait their aoe away from raid
public class BaitAwayIcon : GenericBaitAway
{
public AOEShape Shape;
public uint IID;
public float ActivationDelay;

public virtual Actor? BaitSource(BossModule module, Actor target) => module.PrimaryActor;

public BaitAwayIcon(AOEShape shape, uint iconID, ActionID aid = default, float activationDelay = 5.1f) : base(aid)
{
Shape = shape;
IID = iconID;
ActivationDelay = activationDelay;
}

public override void OnEventIcon(BossModule module, Actor actor, uint iconID)
{
if (iconID == IID && BaitSource(module, actor) is var source && source != null)
CurrentBaits.Add(new(source, actor, Shape, module.WorldState.CurrentTime.AddSeconds(ActivationDelay)));
}

public override void OnEventCast(BossModule module, Actor caster, ActorCastEvent spell)
{
base.OnEventCast(module, caster, spell);
if (spell.Action == WatchedAction)
CurrentBaits.Clear();
}
}

// component for mechanics requiring cast targets to gtfo from raid (aoe tankbusters etc)
public class BaitAwayCast : GenericBaitAway
{
Expand Down
61 changes: 61 additions & 0 deletions BossMod/Components/Chains.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
namespace BossMod.Components;

// component for breakable chains
public class Chains : CastCounter
{
public uint TID { get; init; }
public bool TethersAssigned { get; private set; }
private Actor?[] _partner = new Actor?[PartyState.MaxAllianceSize];

public Chains(uint tetherID, ActionID aid = default) : base(aid)
{
TID = tetherID;
}

public override void AddHints(BossModule module, int slot, Actor actor, TextHints hints, MovementHints? movementHints)
{
if (_partner[slot] != null)
hints.Add("Break the tether!");
}

public override PlayerPriority CalcPriority(BossModule module, int pcSlot, Actor pc, int playerSlot, Actor player, ref uint customColor)
{
return _partner[pcSlot] == player ? PlayerPriority.Danger : PlayerPriority.Irrelevant;
}

public override void DrawArenaForeground(BossModule module, int pcSlot, Actor pc, MiniArena arena)
{
if (_partner[pcSlot] is var partner && partner != null)
arena.AddLine(pc.Position, partner.Position, ArenaColor.Danger);
}

public override void OnTethered(BossModule module, Actor source, ActorTetherInfo tether)
{
if (tether.ID == TID)
{
TethersAssigned = true;
var target = module.WorldState.Actors.Find(tether.Target);
if (target != null)
{
SetPartner(module, source.InstanceID, target);
SetPartner(module, target.InstanceID, source);
}
}
}

public override void OnUntethered(BossModule module, Actor source, ActorTetherInfo tether)
{
if (tether.ID == TID)
{
SetPartner(module, source.InstanceID, null);
SetPartner(module, tether.Target, null);
}
}

private void SetPartner(BossModule module, ulong source, Actor? target)
{
var slot = module.Raid.FindSlot(source);
if (slot >= 0)
_partner[slot] = target;
}
}
2 changes: 1 addition & 1 deletion BossMod/Components/StayMove.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public override void AddHints(BossModule module, int slot, Actor actor, TextHint
hints.Add("Stay!", _lastPositions[slot].prev != _lastPositions[slot].curr || actor.CastInfo != null || actor.TargetID != 0); // note: assume if target is selected, we might autoattack...
break;
case Requirement.Move:
hints.Add("Move!", _lastPositions[slot].prev == _lastPositions[slot].curr && actor.CastInfo == null);
hints.Add("Move!", _lastPositions[slot].prev == _lastPositions[slot].curr);
break;
}
}
Expand Down
53 changes: 2 additions & 51 deletions BossMod/Modules/Endwalker/Savage/P12S2PallasAthena/Gaiaochos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,58 +11,9 @@ class UltimaRay : Components.SelfTargetedAOEs
public UltimaRay() : base(ActionID.MakeSpell(AID.UltimaRay), new AOEShapeRect(20, 3)) { }
}

class MissingLink : Components.CastCounter
class MissingLink : Components.Chains
{
public bool TethersAssigned { get; private set; }
private int[] _partner = Utils.MakeArray(PartyState.MaxPartySize, -1);

public MissingLink() : base(ActionID.MakeSpell(AID.MissingLink)) { }

public override void AddHints(BossModule module, int slot, Actor actor, TextHints hints, MovementHints? movementHints)
{
if (_partner[slot] >= 0)
hints.Add("Break the tether!");
}

public override PlayerPriority CalcPriority(BossModule module, int pcSlot, Actor pc, int playerSlot, Actor player, ref uint customColor)
{
return _partner[pcSlot] == playerSlot ? PlayerPriority.Danger : PlayerPriority.Irrelevant;
}

public override void DrawArenaForeground(BossModule module, int pcSlot, Actor pc, MiniArena arena)
{
if (module.Raid[_partner[pcSlot]] is var partner && partner != null)
arena.AddLine(pc.Position, partner.Position, ArenaColor.Danger);
}

public override void OnTethered(BossModule module, Actor source, ActorTetherInfo tether)
{
if (tether.ID == (uint)TetherID.MissingLink)
{
TethersAssigned = true;
var slot1 = module.Raid.FindSlot(source.InstanceID);
var slot2 = module.Raid.FindSlot(tether.Target);
if (slot1 >= 0 && slot2 >= 0)
{
_partner[slot1] = slot2;
_partner[slot2] = slot1;
}
}
}

public override void OnUntethered(BossModule module, Actor source, ActorTetherInfo tether)
{
if (tether.ID == (uint)TetherID.MissingLink)
{
var slot1 = module.Raid.FindSlot(source.InstanceID);
var slot2 = module.Raid.FindSlot(tether.Target);
if (slot1 >= 0 && slot2 >= 0)
{
_partner[slot1] = -1;
_partner[slot2] = -1;
}
}
}
public MissingLink() : base((uint)TetherID.MissingLink, ActionID.MakeSpell(AID.MissingLink)) { }
}

class DemiParhelion : Components.SelfTargetedAOEs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,24 @@ class MercifulBlooms : Components.SelfTargetedAOEs
public MercifulBlooms() : base(ActionID.MakeSpell(AID.MercifulBlooms), new AOEShapeCircle(20)) { }
}

// TODO: it's a cleave, target can be determined by icon
class MercifulArc : Components.CastCounter
class MercifulArc : Components.BaitAwayIcon
{
public MercifulArc() : base(ActionID.MakeSpell(AID.MercifulArc)) { }
public MercifulArc() : base(new AOEShapeCone(12, 45.Degrees()), (uint)IconID.MercifulArc, ActionID.MakeSpell(AID.MercifulArc)) { } // TODO: verify angle
}

// TODO: depending on phantom edge, it's either a shared tankbuster cleave or a weird cleave ignoring closest target (?)
class BalefulOnslaught1 : Components.Cleave
{
public BalefulOnslaught1() : base(ActionID.MakeSpell(AID.BalefulOnslaughtAOE1), new AOEShapeCone(10, 45.Degrees())) { } // TODO: verify angle
}
class BalefulOnslaught2 : Components.Cleave
{
public BalefulOnslaught2() : base(ActionID.MakeSpell(AID.BalefulOnslaughtAOE2), new AOEShapeCone(10, 45.Degrees())) { } // TODO: verify angle
}

class BurningChains : Components.Chains
{
public BurningChains() : base((uint)TetherID.BurningChains, ActionID.MakeSpell(AID.ScorchingShackle)) { }
}

// TODO: it's a line stack, but I don't think there's a way to determine cast target - so everyone should just stack?..
Expand All @@ -32,6 +46,11 @@ class IronRose : Components.SelfTargetedAOEs
public IronRose() : base(ActionID.MakeSpell(AID.IronRose), new AOEShapeRect(50, 4)) { }
}

class DeadIron : Components.BaitAwayTethers
{
public DeadIron() : base(new AOEShapeCone(50, 15.Degrees()), (uint)TetherID.DeadIron, ActionID.MakeSpell(AID.DeadIronAOE)) { DrawTethers = false; }
}

[ModuleInfo(GroupType = BossModuleInfo.GroupType.CFC, GroupID = 761, NameID = 9834)]
public class DRS1 : BossModule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public enum AID : uint
BalefulSwathe = 23248, // Boss->self, no cast, single-target, visual (side aoes)
BalefulSwatheAOE = 23249, // Helper->self, no cast, range 50 ?-degree cone (doesn't really look like cone...)
BalefulOnslaught = 23690, // Boss->self, 4.0s cast, single-target, visual (tankbuster, shareable or skipping closest target)
BalefulOnslaughtAOE1 = 23253, // Boss->self, no cast, range 10 ?-degree cone tankbuster (shareable/invulable)
BalefulOnslaughtAOE1 = 23253, // Boss->self, no cast, range 10 ?-degree cone tankbuster (shareable/invulnable)
BalefulOnslaughtAOE2 = 23254, // Boss->self, no cast, range 10 ?-degree cone tankbuster (solo, skipping closest target)
PhantomEdge = 23229, // Boss->self, 4.0s cast, single-target, visual (applies status changing some effects)
ScorchingShackle = 23243, // Helper->self, no cast, ??? (happens if chains aren't broken in time)
Expand Down Expand Up @@ -79,6 +79,13 @@ public enum SID : uint

public enum TetherID : uint
{
//_Gen_Tether_128 = 128, // player->player
BurningChains = 128, // player->player
DeadIron = 138, // player->SeekerAvatar
};

public enum IconID : uint
{
BurningChains = 238, // player
DeadIron = 237, // player
MercifulArc = 243, // player
};
Loading

0 comments on commit 0e4dc3e

Please sign in to comment.