Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prishe module updated #457

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions BossMod/Components/Exaflare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)

protected IEnumerable<(WPos, DateTime, Angle)> FutureAOEs()
{
foreach (var l in Lines)
for (var i = 0; i < Lines.Count; ++i)
{
var l = Lines[i];
var num = Math.Min(l.ExplosionsLeft, l.MaxShownExplosions);
var pos = l.Next;
var time = l.NextExplosion > WorldState.CurrentTime ? l.NextExplosion : WorldState.CurrentTime;
for (var i = 1; i < num; ++i)
for (var j = 1; j < num; ++j)
{
pos += l.Advance;
time = time.AddSeconds(l.TimeToMove);
Expand Down
23 changes: 8 additions & 15 deletions BossMod/Modules/Dawntrail/Alliance/A11Prishe/A11Prishe.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
namespace BossMod.Dawntrail.Alliance.A11Prishe;

class Banishga(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.Banishga));

// Knuckle Sandwich and Brittle Impact happen at the same time and need to be staggered
class KnuckleSandwichAOE1(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.KnuckleSandwichAOE1), new AOEShapeCircle(9));
class KnuckleSandwichAOE2(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.KnuckleSandwichAOE2), new AOEShapeCircle(18));
class KnuckleSandwichAOE3(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.KnuckleSandwichAOE3), new AOEShapeCircle(27));
class BrittleImpact1(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.BrittleImpact1), new AOEShapeDonut(9, 60));
class BrittleImpact2(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.BrittleImpact2), new AOEShapeDonut(18, 60));
class BrittleImpact3(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.BrittleImpact3), new AOEShapeDonut(27, 60));

class NullifyingDropkick1(BossModule module) : Components.CastSharedTankbuster(module, ActionID.MakeSpell(AID.NullifyingDropkick1), 6);

class Holy2(BossModule module) : Components.SpreadFromCastTargets(module, ActionID.MakeSpell(AID.Holy2), 6);

class NullifyingDropkick(BossModule module) : Components.CastSharedTankbuster(module, ActionID.MakeSpell(AID.NullifyingDropkick), 6);
class Holy(BossModule module) : Components.SpreadFromCastTargets(module, ActionID.MakeSpell(AID.Holy), 6);
class BanishgaIV(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.BanishgaIV));
class Explosion(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.Explosion), new AOEShapeCircle(8));

[ModuleInfo(BossModuleInfo.Maturity.WIP, Contributors = "The Combat Reborn Team (LTS)", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 1015, NameID = 13351)]
public class A11Prishe(WorldState ws, Actor primary) : BossModule(ws, primary, new(800, 400), new ArenaBoundsSquare(35));
[ModuleInfo(BossModuleInfo.Maturity.Verified, Contributors = "The Combat Reborn Team (Malediktus, LTS)", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 1015, NameID = 13351)]
public class A11Prishe(WorldState ws, Actor primary) : BossModule(ws, primary, ArenaCenter, DefaultBounds)
{
public static readonly WPos ArenaCenter = new(800, 400);
public static readonly ArenaBoundsSquare DefaultBounds = new(35);
}
97 changes: 37 additions & 60 deletions BossMod/Modules/Dawntrail/Alliance/A11Prishe/A11PrisheEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,81 +2,58 @@

public enum OID : uint
{
Helper = 0x233C, // R0.500, x?, Helper type
Unknown1 = 0x46CF, // R1.200, x?
Unknown2 = 0x4696, // R0.465, x?
SpatialRift = 0x1EBCD1, // R0.500, x?, EventObj type
Boss = 0x4673, // R6.342, x?
BakoolJaJa = 0x4697, // R3.150, x?
LuminousRemnant = 0x4674, // R1.000-1.860, x?
Actor1ebcc9 = 0x1EBCC9, // R0.500, x?, EventObj type
Boss = 0x4673, // R6.342
LuminousRemnant = 0x4674, // R1.000-1.86
Tower = 0x1EBCC9, // R0.500, x0 (spawn during fight), EventObj type
Helper3 = 0x4696, // R0.465
Helper2 = 0x46CF, // R1.2
Helper = 0x233C
}

public enum AID : uint
{
AutoAttack = 40934, // 4673->player, no cast, single-target
Banishga = 40935, // 4673->self, 5.0s cast, range 80 circle
UnknownAbility = 40933, // 4673->location, no cast, single-target
AutoAttack = 40934, // Boss->player, no cast, single-target
Teleport = 40933, // Boss->location, no cast, single-target

KnuckleSandwich1 = 40936, // 4673->location, 12.0+1.0s cast, single-target
KnuckleSandwich2 = 40937, // 4673->location, 12.0+1.0s cast, single-target
KnuckleSandwich3 = 40938, // 4673->location, 12.0+1.0s cast, single-target
KnuckleSandwichAOE1 = 40939, // 233C->self, 13.0s cast, range 9 circle
KnuckleSandwichAOE2 = 40940, // 233C->self, 13.0s cast, range 18 circle
KnuckleSandwichAOE3 = 40941, // 233C->self, 13.0s cast, range 27 circle
Banishga = 40935, // Boss->self, 5.0s cast, range 80 circle

BrittleImpact1 = 40942, // 233C->self, 14.5s cast, range ?-60 donut
BrittleImpact2 = 40943, // 233C->self, 14.5s cast, range ?-60 donut
BrittleImpact3 = 40944, // 233C->self, 14.5s cast, range ?-60 donut
KnuckleSandwichVisual1 = 40936, // Boss->location, 12.0+1.0s cast, single-target
KnuckleSandwichVisual2 = 40937, // Boss->location, 12.0+1.0s cast, single-target
KnuckleSandwichVisual3 = 40938, // Boss->location, 12.0+1.0s cast, single-target
KnuckleSandwich1 = 40939, // Helper->self, 13.0s cast, range 9 circle
KnuckleSandwich2 = 40940, // Helper->self, 13.0s cast, range 18 circle
KnuckleSandwich3 = 40941, // Helper->self, 13.0s cast, range 27 circle
BrittleImpact1 = 40942, // Helper->self, 14.5s cast, range 9-60 donut
BrittleImpact2 = 40943, // Helper->self, 14.5s cast, range 18-60 donut
BrittleImpact3 = 40944, // Helper->self, 14.5s cast, range 27-60 donut

NullifyingDropkick1 = 40945, // 4673->players, 5.0+1.5s cast, range 6 circle
NullifyingDropkick2 = 40957, // 233C->players, 6.5s cast, range 6 circle
NullifyingDropkickVisual = 40945, // Boss->players, 5.0+1.5s cast, range 6 circle
NullifyingDropkick = 40957, // Helper->players, 6.5s cast, range 6 circle

BanishStorm = 40946, // 4673->self, 4.0s cast, single-target // Marching AOEs
Banish = 40947, // 233C->self, no cast, range 6 circle
BanishStorm = 40946, // Boss->self, 4.0s cast, single-target, marching AOEs
Banish = 40947, // Helper->self, no cast, range 6 circle

Holy1 = 40962, // 4673->self, 4.0+1.0s cast, single-target
Holy2 = 40963, // 233C->players, 5.0s cast, range 6 circle // Spread Markers
HolyVisual = 40962, // Boss->self, 4.0+1.0s cast, single-target
Holy = 40963, // Helper->players, 5.0s cast, range 6 circle, spread Markers

CrystallineThorns = 40948, // 4673->self, 4.0+1.0s cast, single-target // Arena Change
Thornbite = 40949, // 233C->self, no cast, range 80 circle
CrystallineThorns = 40948, // Boss->self, 4.0+1.0s cast, single-target, arena change
Thornbite = 40949, // Helper->self, no cast, range 80 circle

// AuroralUppercut1 = 40950, // 4673->self, 11.4+1.6s cast, single-target // Suspected single space cast
AuroralUppercut2 = 40951, // 4673->self, 11.4+1.6s cast, single-target // Suspected two space cast
AuroralUppercut3 = 40952, // 4673->self, 11.4+1.6s cast, single-target // Definitely 3 space cast
AuroralUppercut4 = 40953, // 233C->self, no cast, range 80 circle
AuroralUppercut1 = 40950, // Boss->self, 11.4+1,6s cast, single-target, knockback 12
AuroralUppercut2 = 40951, // Helper->self, 11.4+1.6s cast, single-target, knockback 25
AuroralUppercut3 = 40952, // Boss->self, 11.4+1.6s cast, single-target, knockback 38
AuroralUppercut4 = 40953, // Helper->self, no cast, range 80 circle

BanishgaIV = 40954, // 4673->self, 5.0s cast, range 80 circle // Raidwide that spawns AOEs
Explosion = 40955, // 4674->self, 5.0s cast, range 8 circle
BanishgaIV = 40954, // Boss->self, 5.0s cast, range 80 circle, raidwide that spawns AOEs
Explosion = 40955, // LuminousRemnant->self, 5.0s cast, range 8 circle

AsuranFists1 = 40956, // 4673->self, 6.5+0.5s cast, single-target
AsuranFists2 = 40958, // 233C->self, no cast, range 6 circle
AsuranFists3 = 40959, // 233C->self, no cast, range 6 circle
AsuranFists4 = 40960, // 233C->self, no cast, range 6 circle
AsuranFistsVisual = 40956, // Boss->self, 6.5+0.5s cast, single-target
AsuranFists1 = 40958, // Helper->self, no cast, range 6 circle
AsuranFists2 = 40959, // Helper->self, no cast, range 6 circle
AsuranFists3 = 40960 // Helper->self, no cast, range 6 circle
}

public enum SID : uint
{
LightResistanceDown = 2278, // Helper->player, extra=0x0
Stun1 = 4378, // none->player, extra=0x0
Stun2 = 4374, // none->player, extra=0x0
SustainedDamage1 = 2935, // Helper->player, extra=0x0
SustainedDamage2 = 3795, // none->LuminousRemnant, extra=0x1
Unknown1 = 2195, // none->Boss, extra=0x338
Unknown2 = 2056, // none->Boss, extra=0x339
Unknown3 = 3517, // Helper->player, extra=0x0
VulnerabilityUp1 = 1789, // Helper/LuminousRemnant->player, extra=0x1/0x2/0x3/0x4
VulnerabilityUp2 = 3366, // none->player, extra=0x0
}

public enum IconID : uint
{
Icon570 = 570, // player->self
Icon215 = 215, // player->self
}

public enum TetherID : uint
{
Tether215 = 215, // Unknown1->Boss
Tether297 = 297, // player->Unknown1
Knockback = 3517 // Helper->player, extra=0x0
}
17 changes: 9 additions & 8 deletions BossMod/Modules/Dawntrail/Alliance/A11Prishe/A11PrisheStates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ class A11PrisheStates : StateMachineBuilder
public A11PrisheStates(BossModule module) : base(module)
{
TrivialPhase()
.ActivateOnEnter<ArenaChanges>()
.ActivateOnEnter<AuroralUppercut>()
.ActivateOnEnter<AsuranFists>()
.ActivateOnEnter<Banishga>()
.ActivateOnEnter<KnuckleSandwichAOE1>()
.ActivateOnEnter<KnuckleSandwichAOE2>()
.ActivateOnEnter<KnuckleSandwichAOE3>()
.ActivateOnEnter<BrittleImpact1>()
.ActivateOnEnter<BrittleImpact2>()
.ActivateOnEnter<BrittleImpact3>()
.ActivateOnEnter<NullifyingDropkick1>()
.ActivateOnEnter<Holy2>()
.ActivateOnEnter<KnuckleSandwich1>()
.ActivateOnEnter<KnuckleSandwich2>()
.ActivateOnEnter<KnuckleSandwich3>()
.ActivateOnEnter<NullifyingDropkick>()
.ActivateOnEnter<Holy>()
.ActivateOnEnter<BanishStorm>()
.ActivateOnEnter<BanishgaIV>()
.ActivateOnEnter<Explosion>();
}
Expand Down
58 changes: 58 additions & 0 deletions BossMod/Modules/Dawntrail/Alliance/A11Prishe/ArenaChanges.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
namespace BossMod.Dawntrail.Alliance.A11Prishe;

class ArenaChanges(BossModule module) : Components.GenericAOEs(module)
{
private AOEInstance? _aoe;
private static readonly Square[] defaultSquare = [new(A11Prishe.ArenaCenter, 35)];
private static readonly Shape[] differenceENVC00020001 = [new Square(new(795, 405), 10), new Square(new(805, 395), 10), new Rectangle(new(810, 430), 15, 5),
new Rectangle(new(830, 420), 5, 15), new Rectangle(new(790, 370), 15, 5), new Rectangle(new(770, 380), 5, 15)];
private static readonly AOEShapeCustom arenaChangeENVC00020001 = new(defaultSquare, differenceENVC00020001);
private static readonly ArenaBoundsComplex arenaENVC00020001 = new(differenceENVC00020001);
private static readonly Shape[] differenceENVC02000100 = [new Square(new(795, 395), 10), new Square(new(805, 405), 10), new Rectangle(new(820, 370), 15, 5),
new Rectangle(new(830, 390), 5, 15), new Rectangle(new(780, 430), 15, 5), new Rectangle(new(770, 410), 5, 15)];
private static readonly AOEShapeCustom arenaChangeENVC02000100 = new(defaultSquare, differenceENVC02000100);
private static readonly ArenaBoundsComplex arenaENVC02000100 = new(differenceENVC02000100);
public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor) => Utils.ZeroOrOne(_aoe);

public override void OnEventEnvControl(byte index, uint state)
{
if (index != 0x01)
return;
switch (state)
{
case 0x00020001:
SetAOE(arenaChangeENVC00020001);
break;
case 0x02000100:
SetAOE(arenaChangeENVC02000100);
break;
case 0x00200010:
SetArena(arenaENVC00020001);
break;
case 0x08000400:
SetArena(arenaENVC02000100);
break;
case 0x00080004 or 0x00800004:
SetDefaultArena();
break;
}
}

private void SetDefaultArena()
{
Arena.Bounds = A11Prishe.DefaultBounds;
Arena.Center = A11Prishe.ArenaCenter;
}

private void SetArena(ArenaBoundsComplex bounds)
{
Arena.Bounds = bounds;
Arena.Center = bounds.Center;
_aoe = null;
}

private void SetAOE(AOEShapeCustom shape)
{
_aoe = new(shape, A11Prishe.ArenaCenter, default, WorldState.FutureTime(5));
}
}
22 changes: 22 additions & 0 deletions BossMod/Modules/Dawntrail/Alliance/A11Prishe/AsuranFists.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace BossMod.Dawntrail.Alliance.A11Prishe;

class AsuranFists(BossModule module) : Components.GenericTowers(module)
{
public override void OnActorCreated(Actor actor)
{
if ((OID)actor.OID == OID.Tower)
Towers.Add(new(actor.Position, 6, PartyState.MaxAllianceSize, PartyState.MaxAllianceSize, activation: WorldState.FutureTime(6.5f)));
}

public override void OnEventCast(Actor caster, ActorCastEvent spell)
{
if ((AID)spell.Action.ID is AID.AsuranFists1 or AID.AsuranFists2 or AID.AsuranFists3)
{
if (++NumCasts == 8)
{
NumCasts = 0;
Towers.Clear();
}
}
}
}
29 changes: 29 additions & 0 deletions BossMod/Modules/Dawntrail/Alliance/A11Prishe/AuroralUppercut.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace BossMod.Dawntrail.Alliance.A11Prishe;

class AuroralUppercut(BossModule module) : Components.Knockback(module, ignoreImmunes: true)
{
private Source? _source;
public override IEnumerable<Source> Sources(int slot, Actor actor) => Utils.ZeroOrOne(_source);

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
switch ((AID)spell.Action.ID)
{
case AID.AuroralUppercut1:
_source = new(Arena.Center, 12, Module.CastFinishAt(spell));
break;
case AID.AuroralUppercut2:
_source = new(Arena.Center, 25, Module.CastFinishAt(spell));
break;
case AID.AuroralUppercut3:
_source = new(Arena.Center, 38, Module.CastFinishAt(spell));
break;
}
}

public override void OnStatusLose(Actor actor, ActorStatus status)
{
if (_source != null && (SID)status.ID == SID.Knockback)
_source = null;
}
}
73 changes: 73 additions & 0 deletions BossMod/Modules/Dawntrail/Alliance/A11Prishe/BanishStorm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
namespace BossMod.Dawntrail.Alliance.A11Prishe;

class BanishStorm(BossModule module) : Components.Exaflare(module, 6)
{
private static readonly WPos[] positions = [new(815, 415), new(800, 385), new(785, 400), new(785, 385), new(815, 400), new(800, 415)];
private static readonly WDir[] directions =
[
4 * (-0.003f).Degrees().ToDirection(),
4 * 119.997f.Degrees().ToDirection(),
4 * (-120.003f).Degrees().ToDirection(),
4 * 180.Degrees().ToDirection(),
4 * (-60.005f).Degrees().ToDirection(),
4 * 60.Degrees().ToDirection(),
4 * 89.999f.Degrees().ToDirection(),
4 * (-150.001f).Degrees().ToDirection(),
4 * (-30.001f).Degrees().ToDirection(),
4 * (-90.004f).Degrees().ToDirection(),
4 * 29.996f.Degrees().ToDirection(),
4 * 149.996f.Degrees().ToDirection(),
];
private static readonly Dictionary<byte, (int position, int[] directions, int[] numExplosions)> LineConfigs = new()
{
{ 0x0A, (0, [0, 1, 2], [5, 5, 14]) },
{ 0x34, (0, [0, 1, 2], [5, 5, 14]) },
{ 0x0D, (0, [3, 5, 4], [13, 5, 9]) },
{ 0x05, (3, [0, 1, 2], [13, 9, 5]) },
{ 0x02, (3, [3, 5, 4], [5, 14, 5]) },
{ 0x32, (3, [3, 5, 4], [5, 14, 5]) },
{ 0x0B, (1, [3, 4, 5], [5, 10, 10]) },
{ 0x35, (1, [3, 4, 5], [5, 10, 10]) },
{ 0x08, (1, [0, 2, 1], [13, 9, 9]) },
{ 0x09, (2, [9, 11, 10], [5, 10, 10]) },
{ 0x0C, (2, [6, 7, 8], [13, 9, 9]) },
{ 0x03, (4, [6, 7, 8], [5, 10, 10]) },
{ 0x06, (4, [9, 11, 10], [13, 9, 9]) },
{ 0x07, (5, [0, 1, 2], [5, 10, 10]) },
{ 0x33, (5, [0, 1, 2], [5, 10, 10]) },
{ 0x04, (5, [3, 5, 4], [13, 9, 9]) },
};

public override void OnEventEnvControl(byte index, uint state)
{
if (state == 0x00020001 && LineConfigs.TryGetValue(index, out var config))
{
var activation1 = WorldState.FutureTime(9.1f);
var activation2 = WorldState.FutureTime(9.8f);

for (var i = 0; i < 3; ++i)
{
Lines.Add(new()
{
Next = positions[config.position] + (i > 0 ? directions[config.directions[i]] : default),
Advance = directions[config.directions[i]],
NextExplosion = i == 0 ? activation1 : activation2,
TimeToMove = 0.7f,
ExplosionsLeft = config.numExplosions[i],
MaxShownExplosions = config.numExplosions[i]
});
}
}
}

public override void OnEventCast(Actor caster, ActorCastEvent spell)
{
if ((AID)spell.Action.ID == AID.Banish)
{
var index = Lines.FindIndex(item => item.Next.AlmostEqual(caster.Position, 1));
AdvanceLine(Lines[index], caster.Position);
if (Lines[index].ExplosionsLeft == 0)
Lines.RemoveAt(index);
}
}
}
Loading