Skip to content

Commit

Permalink
Merge pull request #188 from FFXIV-CombatReborn/mergeWIP2
Browse files Browse the repository at this point in the history
M1N module updated
  • Loading branch information
CarnifexOptimus authored Jul 17, 2024
2 parents e807221 + 5998151 commit 21232b7
Show file tree
Hide file tree
Showing 12 changed files with 361 additions and 222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public override void OnCastStarted(Actor caster, ActorCastInfo spell)

private void AddAOE(AOEShape shape, WPos position, Angle rotation, DateTime activation)
{
_aoes.Add(new AOEInstance(shape, position, rotation, activation));
_aoes.Add(new(shape, position, rotation, activation));
}

public override void OnEventCast(Actor caster, ActorCastEvent spell)
Expand Down
69 changes: 69 additions & 0 deletions BossMod/Modules/Dawntrail/Raid/M1NBIackCat/BlackCatCrossing.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
namespace BossMod.Dawntrail.Raid.M1NBlackCat;

public class BlackCatCrossing(BossModule module) : Components.GenericAOEs(module)
{
private readonly List<AOEInstance> _aoes = [];
private static readonly Angle[] anglesIntercardinals = [-45.003f.Degrees(), 44.998f.Degrees(), 134.999f.Degrees(), -135.005f.Degrees()];
private static readonly Angle[] anglesCardinals = [-90.004f.Degrees(), -0.003f.Degrees(), 180.Degrees(), 89.999f.Degrees()];
private static readonly AOEShapeCone cone = new(60, 22.5f.Degrees());
private enum Pattern { None, Cardinals, Intercardinals }
private Pattern _currentPattern;

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
{
if (_aoes.Count > 3)
for (var i = 0; i < 4; i++)
yield return _aoes[i] with { Color = ArenaColor.Danger };
if (_aoes.Count > 7)
for (var i = 4; i < 8; i++)
yield return _aoes[i] with { Risky = false };
}

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
switch ((AID)spell.Action.ID)
{
case AID.BlackCatCrossingFirst:
case AID.BlackCatCrossingRest:
_aoes.Add(new(cone, caster.Position, spell.Rotation, spell.NPCFinishAt));
_aoes.SortBy(x => x.Activation);
break;
case AID.LeapingBlackCatCrossingVisual1:
_currentPattern = Pattern.Cardinals;
break;
case AID.LeapingBlackCatCrossingVisual2:
_currentPattern = Pattern.Intercardinals;
break;
}
}

public override void OnActorCreated(Actor actor)
{
if ((OID)actor.OID == OID.LeapingAttacks && _currentPattern != Pattern.None)
{
AddLeapingAOEs(actor, _currentPattern == Pattern.Cardinals ? anglesCardinals : anglesIntercardinals, 9);
AddLeapingAOEs(actor, _currentPattern == Pattern.Cardinals ? anglesIntercardinals : anglesCardinals, 11);
_currentPattern = Pattern.None;
}
}

public override void OnCastFinished(Actor caster, ActorCastInfo spell)
{
if (_aoes.Count > 0)
switch ((AID)spell.Action.ID)
{
case AID.BlackCatCrossingFirst:
case AID.BlackCatCrossingRest:
case AID.LeapingBlackCatCrossingFirst:
case AID.LeapingBlackCatCrossingRest:
_aoes.RemoveAt(0);
break;
}
}

private void AddLeapingAOEs(Actor actor, Angle[] angles, int futureTime)
{
foreach (var angle in angles)
_aoes.Add(new(cone, actor.Position, angle, Module.WorldState.FutureTime(futureTime)));
}
}
34 changes: 34 additions & 0 deletions BossMod/Modules/Dawntrail/Raid/M1NBIackCat/ElevateAndEviscerate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
namespace BossMod.Dawntrail.Raid.M1NBlackCat;

class ElevateAndEvisverate(BossModule module) : Components.Knockback(module)
{
private DateTime activation;
private (Actor source, Actor target) _tether;

public override IEnumerable<Source> Sources(int slot, Actor actor)
{
if (_tether != default && actor == _tether.target)
yield return new(_tether.source.Position, 10, activation);
}

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
if ((AID)spell.Action.ID == AID.ElevateAndEviscerate)
activation = spell.NPCFinishAt;
}

public override void OnTethered(Actor source, ActorTetherInfo tether)
{
if (tether.ID is (uint)TetherID.ElevateAndEviscerateGood or (uint)TetherID.ElevateAndEviscerateBad)
_tether = (source, WorldState.Actors.Find(tether.Target)!);
}

public override void OnCastFinished(Actor caster, ActorCastInfo spell)
{
if ((AID)spell.Action.ID == AID.ElevateAndEviscerate)
{
_tether = default;
++NumCasts;
}
}
}
138 changes: 4 additions & 134 deletions BossMod/Modules/Dawntrail/Raid/M1NBIackCat/M1NBIackCat.cs
Original file line number Diff line number Diff line change
@@ -1,141 +1,11 @@
namespace BossMod.Dawntrail.Raid.M1NBlackCat;

class BlackCatCrossing3(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.BlackCatCrossing3), new AOEShapeCone(60, 22.5f.Degrees()));
class BlackCatCrossing4(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.BlackCatCrossing4), new AOEShapeCone(60, 22.5f.Degrees()));
class BloodyScratch(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.BloodyScratch));

class OneTwoPaw(BossModule module) : Components.GenericAOEs(module)
{
private readonly List<AOEInstance> _aoes = [];

private static readonly AOEShapeCone cone = new(60, 90.Degrees());

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
{
if (_aoes.Count > 0)
yield return _aoes[0] with { Color = ArenaColor.Danger };
if (_aoes.Count > 1)
yield return _aoes[1] with { Risky = false };
}

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
if ((AID)spell.Action.ID is AID.OneTwoPaw2 or AID.OneTwoPaw3 or AID.OneTwoPaw5 or AID.OneTwoPaw6)
{
_aoes.Add(new(cone, caster.Position, spell.Rotation, spell.NPCFinishAt));
_aoes.SortBy(x => x.Activation);
}
}

public override void OnCastFinished(Actor caster, ActorCastInfo spell)
{
if (_aoes.Count > 0 && (AID)spell.Action.ID is AID.OneTwoPaw2 or AID.OneTwoPaw3 or AID.OneTwoPaw5 or AID.OneTwoPaw6)
_aoes.RemoveAt(0);
}
}

class BlackCatCrossing(BossModule module) : Components.GenericAOEs(module)
{
private readonly List<AOEInstance> _aoes = [];

private static readonly AOEShapeCone cone = new(60, 22.5f.Degrees());

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
{
if (_aoes.Count > 0)
yield return _aoes[0] with { Color = ArenaColor.Danger };
if (_aoes.Count > 1)
yield return _aoes[1] with { Risky = false };
}

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
if ((AID)spell.Action.ID is AID.BlackCatCrossing3 or AID.BlackCatCrossing4)
{
_aoes.Add(new(cone, caster.Position, spell.Rotation, spell.NPCFinishAt));
_aoes.SortBy(x => x.Activation);
}
}

public override void OnCastFinished(Actor caster, ActorCastInfo spell)
{
if (_aoes.Count > 0 && (AID)spell.Action.ID is AID.BlackCatCrossing3 or AID.BlackCatCrossing4)
_aoes.RemoveAt(0);
}
}

class BiscuitMaker(BossModule module) : Components.SingleTargetCast(module, ActionID.MakeSpell(AID.BiscuitMaker));
class Clawful2(BossModule module) : Components.StackWithCastTargets(module, ActionID.MakeSpell(AID.Clawful2), 5, 8);
class Shockwave2(BossModule module) : Components.KnockbackFromCastTarget(module, ActionID.MakeSpell(AID.Shockwave2), 18, stopAtWall: true, kind: Kind.AwayFromOrigin);

class PredaceousPounce2(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.PredaceousPounce2), new AOEShapeCircle(11));
class PredaceousPounce3(BossModule module) : Components.ChargeAOEs(module, ActionID.MakeSpell(AID.PredaceousPounce3), 3);
class PredaceousPounce5(BossModule module) : Components.ChargeAOEs(module, ActionID.MakeSpell(AID.PredaceousPounce5), 3);
class PredaceousPounce6(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.PredaceousPounce6), new AOEShapeCircle(11));

class Clawful(BossModule module) : Components.StackWithCastTargets(module, ActionID.MakeSpell(AID.Clawful), 5, 8);
class Shockwave(BossModule module) : Components.KnockbackFromCastTarget(module, ActionID.MakeSpell(AID.Shockwave), 18, stopAfterWall: true);
class GrimalkinGale2(BossModule module) : Components.SpreadFromCastTargets(module, ActionID.MakeSpell(AID.GrimalkinGale2), 5);
class Overshadow(BossModule module) : Components.LineStack(module, ActionID.MakeSpell(AID.OverShadowMarker), ActionID.MakeSpell(AID.Overshadow), 5.3f, 60, 2.5f);

class LeapingOneTwoPaw(BossModule module) : Components.GenericAOEs(module)
{
private readonly List<AOEInstance> _aoes = [];

private static readonly AOEShapeCone cone = new(60, 90.Degrees());

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
{
if (_aoes.Count > 0)
yield return _aoes[0] with { Color = ArenaColor.Danger };
if (_aoes.Count > 1)
yield return _aoes[1] with { Risky = false };
}

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
if ((AID)spell.Action.ID is AID.LeapingOneTwoPaw6 or AID.LeapingOneTwoPaw7 or AID.LeapingOneTwoPaw9 or AID.LeapingOneTwoPaw10)
{
_aoes.Add(new(cone, caster.Position, spell.Rotation, spell.NPCFinishAt));
_aoes.SortBy(x => x.Activation);
}
}

public override void OnCastFinished(Actor caster, ActorCastInfo spell)
{
if (_aoes.Count > 0 && (AID)spell.Action.ID is AID.LeapingOneTwoPaw6 or AID.LeapingOneTwoPaw7 or AID.LeapingOneTwoPaw9 or AID.LeapingOneTwoPaw10)
_aoes.RemoveAt(0);
}
}

class LeapingBlackCatCrossing(BossModule module) : Components.GenericAOEs(module)
{
private readonly List<AOEInstance> _aoes = [];

private static readonly AOEShapeCone cone = new(60, 22.5f.Degrees());

public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
{
if (_aoes.Count > 0)
yield return _aoes[0] with { Color = ArenaColor.Danger };
if (_aoes.Count > 1)
yield return _aoes[1] with { Risky = false };
}

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
if ((AID)spell.Action.ID is AID.LeapingBlackCatCrossing4 or AID.LeapingBlackCatCrossing5)
{
_aoes.Add(new(cone, caster.Position, spell.Rotation, spell.NPCFinishAt));
_aoes.SortBy(x => x.Activation);
}
}

public override void OnCastFinished(Actor caster, ActorCastInfo spell)
{
if (_aoes.Count > 0 && (AID)spell.Action.ID is AID.LeapingBlackCatCrossing4 or AID.LeapingBlackCatCrossing5)
_aoes.RemoveAt(0);
}
}

class Overshadow(BossModule module) : Components.LineStack(module, ActionID.MakeSpell(AID.Overshadow1), ActionID.MakeSpell(AID.Overshadow2), 5.2f);

[ModuleInfo(BossModuleInfo.Maturity.WIP, Contributors = "The Combat Reborn Team", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 985, NameID = 12686)]
[ModuleInfo(BossModuleInfo.Maturity.Verified, Contributors = "The Combat Reborn Team (Malediktus, LTS)", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 985, NameID = 12686)]
public class M1NBlackCat(WorldState ws, Actor primary) : BossModule(ws, primary, new(100, 100), new ArenaBoundsSquare(20));
Loading

0 comments on commit 21232b7

Please sign in to comment.