Skip to content

Commit

Permalink
Merge pull request #304 from CarnifexOptimus/slave_cagnazzo
Browse files Browse the repository at this point in the history
Lapis Manalis modules
  • Loading branch information
awgil authored Mar 24, 2024
2 parents 4700dac + d2118e1 commit 73b667d
Show file tree
Hide file tree
Showing 9 changed files with 1,038 additions and 1 deletion.
46 changes: 45 additions & 1 deletion BossMod/Components/UnavoidableDamage.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace BossMod.Components
using System;

namespace BossMod.Components
{
// generic unavoidable raidwide cast
public class RaidwideCast : CastHint
Expand All @@ -12,6 +14,48 @@ public override void AddAIHints(BossModule module, int slot, Actor actor, PartyR
}
}

// generic unavoidable raidwide cast after NPC yell, typically used at the end of boss "limit break" phases
public class RaidwideAfterNPCYell : CastHint
{
public uint NPCYellID;
public float Delay; //delay from NPCyell for raidwide to cast event
private bool casting;
private DateTime _activation;

public RaidwideAfterNPCYell(ActionID aid, uint nPCYellid, float delay, string hint = "Raidwide") : base(aid, hint)
{
NPCYellID = nPCYellid;
Delay = delay;
}

public override void OnActorNpcYell(BossModule module, Actor actor, ushort id)
{
if (id == NPCYellID)
{
casting = true;
_activation = module.WorldState.CurrentTime;
}
}

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

public override void AddAIHints(BossModule module, int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
if (casting)
hints.PredictedDamage.Add((module.Raid.WithSlot().Mask(), _activation.AddSeconds(Delay)));
}

public override void AddGlobalHints(BossModule module, GlobalHints hints)
{
if (casting && Hint.Length > 0)
hints.Add(Hint);
}
}

// generic unavoidable single-target damage cast (typically tankbuster, but not necessary)
public class SingleTargetCast : CastHint
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// CONTRIB: made by malediktus, not checked
using System.Linq;

namespace BossMod.Endwalker.Dungeon.D13LapisManalis.D130AlbusGriffin
{
public enum OID : uint
{
Boss = 0x3E9F, //R=4.6
}

public enum AID : uint
{
AutoAttack = 870, // Boss->player, no cast, single-target
WindsOfWinter = 32785, // Boss->self, 5,0s cast, range 40 circle
Freefall = 32786, // Boss->location, 3,5s cast, range 8 circle
GoldenTalons = 32787, // Boss->self, 4,5s cast, range 8 90-degree cone
};

class WindsOfWinter : Components.RaidwideCast
{
public WindsOfWinter() : base(ActionID.MakeSpell(AID.WindsOfWinter), "Stun Albus Griffin, Raidwide") { }
}

class GoldenTalons : Components.SelfTargetedAOEs
{
public GoldenTalons() : base(ActionID.MakeSpell(AID.GoldenTalons), new AOEShapeCone(8, 45.Degrees())) { }
}

class Freefall : Components.LocationTargetedAOEs
{
public Freefall() : base(ActionID.MakeSpell(AID.Freefall), 8) { }
}

class D130AlbusGriffinStates : StateMachineBuilder
{
public D130AlbusGriffinStates(BossModule module) : base(module)
{
TrivialPhase()
.ActivateOnEnter<Freefall>()
.ActivateOnEnter<WindsOfWinter>()
.ActivateOnEnter<GoldenTalons>()
.Raw.Update = () => module.Enemies(OID.Boss).All(e => e.IsDead);
}
}

[ModuleInfo(CFCID = 896, NameID = 12245)]
public class D130AlbusGriffin : BossModule
{
public D130AlbusGriffin(WorldState ws, Actor primary) : base(ws, primary, new ArenaBoundsRect(new(47, -570.5f), 8.5f, 11.5f)) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// CONTRIB: made by malediktus, not checked
using System.Linq;

namespace BossMod.Endwalker.Dungeon.D13LapisManalis.D130CaladriusMaturus
{
public enum OID : uint
{
Boss = 0x3D56, //R=3.96
Caladrius = 0x3CE2, //R=1.8
}

public enum AID : uint
{
AutoAttack = 872, // Caladrius/Boss->player, no cast, single-target
TransonicBlast = 32535, // Caladrius->self, 4,0s cast, range 9 90-degree cone
};

class TransonicBlast : Components.SelfTargetedAOEs
{
public TransonicBlast() : base(ActionID.MakeSpell(AID.TransonicBlast), new AOEShapeCone(9, 45.Degrees())) { }
}

class D130CaladriusMaturusStates : StateMachineBuilder
{
public D130CaladriusMaturusStates(BossModule module) : base(module)
{
TrivialPhase()
.ActivateOnEnter<TransonicBlast>()
.Raw.Update = () => module.Enemies(OID.Boss).All(e => e.IsDead) && module.Enemies(OID.Caladrius).All(e => e.IsDead);
}
}

[ModuleInfo(CFCID = 896, NameID = 12078)]
public class D130CaladriusMaturus : BossModule
{
public D130CaladriusMaturus(WorldState ws, Actor primary) : base(ws, primary, new ArenaBoundsRect(new(47, -570.5f), 8.5f, 11.5f)) { }

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actor(PrimaryActor, ArenaColor.Enemy);
foreach (var s in Enemies(OID.Caladrius))
Arena.Actor(s, ArenaColor.Enemy);
}

}
}
Loading

0 comments on commit 73b667d

Please sign in to comment.