Skip to content

Commit

Permalink
Fixes after merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
awgil committed Mar 24, 2024
1 parent 73b667d commit 68fe828
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 76 deletions.
43 changes: 23 additions & 20 deletions BossMod/Components/UnavoidableDamage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,47 @@ 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 class RaidwideAfterNPCYell : CastCounter
{
public uint NPCYellID;
public float Delay; //delay from NPCyell for raidwide to cast event
private bool casting;
public float Delay; // delay from NPCYell for raidwide to cast event
public string Hint;
private DateTime _activation;

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

public override void OnActorNpcYell(BossModule module, Actor actor, ushort id)
public override void AddGlobalHints(BossModule module, GlobalHints hints)
{
if (id == NPCYellID)
{
casting = true;
_activation = module.WorldState.CurrentTime;
}
if (_activation != default && Hint.Length > 0)
hints.Add(Hint);
}

public override void OnEventCast(BossModule module, Actor caster, ActorCastEvent spell)
public override void AddAIHints(BossModule module, int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
if (spell.Action == WatchedAction)
casting = false;
if (_activation != default)
hints.PredictedDamage.Add((module.Raid.WithSlot().Mask(), _activation));
}

public override void AddAIHints(BossModule module, int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
public override void OnEventCast(BossModule module, Actor caster, ActorCastEvent spell)
{
if (casting)
hints.PredictedDamage.Add((module.Raid.WithSlot().Mask(), _activation.AddSeconds(Delay)));
if (spell.Action == WatchedAction)
{
++NumCasts;
_activation = default;
}
}

public override void AddGlobalHints(BossModule module, GlobalHints hints)
public override void OnActorNpcYell(BossModule module, Actor actor, ushort id)
{
if (casting && Hint.Length > 0)
hints.Add(Hint);
if (id == NPCYellID)
{
_activation = module.WorldState.CurrentTime.AddSeconds(Delay);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// CONTRIB: made by malediktus, not checked
using System.Linq;

namespace BossMod.Endwalker.Dungeon.D13LapisManalis.D130AlbusGriffin
namespace BossMod.Endwalker.Dungeon.D11LapisManalis.D110AlbusGriffin
{
public enum OID : uint
{
Expand Down Expand Up @@ -31,9 +31,9 @@ class Freefall : Components.LocationTargetedAOEs
public Freefall() : base(ActionID.MakeSpell(AID.Freefall), 8) { }
}

class D130AlbusGriffinStates : StateMachineBuilder
class D110AlbusGriffinStates : StateMachineBuilder
{
public D130AlbusGriffinStates(BossModule module) : base(module)
public D110AlbusGriffinStates(BossModule module) : base(module)
{
TrivialPhase()
.ActivateOnEnter<Freefall>()
Expand All @@ -44,8 +44,8 @@ public D130AlbusGriffinStates(BossModule module) : base(module)
}

[ModuleInfo(CFCID = 896, NameID = 12245)]
public class D130AlbusGriffin : BossModule
public class D110AlbusGriffin : BossModule
{
public D130AlbusGriffin(WorldState ws, Actor primary) : base(ws, primary, new ArenaBoundsRect(new(47, -570.5f), 8.5f, 11.5f)) { }
public D110AlbusGriffin(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
@@ -1,7 +1,7 @@
// CONTRIB: made by malediktus, not checked
using System.Linq;

namespace BossMod.Endwalker.Dungeon.D13LapisManalis.D130CaladriusMaturus
namespace BossMod.Endwalker.Dungeon.D11LapisManalis.D110CaladriusMaturus
{
public enum OID : uint
{
Expand All @@ -20,9 +20,9 @@ class TransonicBlast : Components.SelfTargetedAOEs
public TransonicBlast() : base(ActionID.MakeSpell(AID.TransonicBlast), new AOEShapeCone(9, 45.Degrees())) { }
}

class D130CaladriusMaturusStates : StateMachineBuilder
class D110CaladriusMaturusStates : StateMachineBuilder
{
public D130CaladriusMaturusStates(BossModule module) : base(module)
public D110CaladriusMaturusStates(BossModule module) : base(module)
{
TrivialPhase()
.ActivateOnEnter<TransonicBlast>()
Expand All @@ -31,16 +31,15 @@ public D130CaladriusMaturusStates(BossModule module) : base(module)
}

[ModuleInfo(CFCID = 896, NameID = 12078)]
public class D130CaladriusMaturus : BossModule
public class D110CaladriusMaturus : BossModule
{
public D130CaladriusMaturus(WorldState ws, Actor primary) : base(ws, primary, new ArenaBoundsRect(new(47, -570.5f), 8.5f, 11.5f)) { }
public D110CaladriusMaturus(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);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Collections.Generic;
using System.Linq;

namespace BossMod.Endwalker.Dungeon.D13LapisManalis.D131Albion
namespace BossMod.Endwalker.Dungeon.D11LapisManalis.D111Albion
{
public enum OID : uint
{
Expand Down Expand Up @@ -54,21 +54,21 @@ class WildlifeCrossing : Components.GenericAOEs
private Angle _rotation2;
private DateTime _reset1;
private DateTime _reset2;
private List<Actor> beasts1 = new();
private List<Actor> beasts1 = new();
private List<Actor> beasts2 = new();
private WPos stampede1 = default;
private WPos stampede2 = default;

public override IEnumerable<AOEInstance> ActiveAOEs(BossModule module, int slot, Actor actor)
{
if (active1 && beasts1.Count > 0)
yield return new(new AOEShapeRect((beasts1.First().Position - beasts1.Last().Position).Length() + 30, 5), new (beasts1.Last().Position.X, stampede1.Z), _rotation1);
yield return new(new AOEShapeRect((beasts1.First().Position - beasts1.Last().Position).Length() + 30, 5), new(beasts1.Last().Position.X, stampede1.Z), _rotation1);
if (active2 && beasts2.Count > 0)
yield return new(new AOEShapeRect((beasts2.First().Position - beasts2.Last().Position).Length() + 30, 5), new (beasts2.Last().Position.X, stampede2.Z), _rotation2);
yield return new(new AOEShapeRect((beasts2.First().Position - beasts2.Last().Position).Length() + 30, 5), new(beasts2.Last().Position.X, stampede2.Z), _rotation2);
if (active1 && beasts1.Count == 0)
yield return new(rect, stampede1, 90.Degrees());
yield return new(rect, stampede1, 90.Degrees());
if (active2 && beasts2.Count == 0)
yield return new(rect, stampede2, 90.Degrees());
yield return new(rect, stampede2, 90.Degrees());
}

public override void OnEventEnvControl(BossModule module, byte index, uint state)
Expand Down Expand Up @@ -101,7 +101,7 @@ public override void OnEventEnvControl(BossModule module, byte index, uint state
active2 = true;
_rotation2 = -90.Degrees();
stampede2 = new(44, -759);
}
}
if (index == 0x22)
if (newstampede)
{
Expand All @@ -127,7 +127,7 @@ public override void OnEventEnvControl(BossModule module, byte index, uint state
active2 = true;
_rotation2 = -90.Degrees();
stampede2 = new(44, -749);
}
}
if (index == 0x23)
if (newstampede)
{
Expand Down Expand Up @@ -186,30 +186,30 @@ public override void OnEventEnvControl(BossModule module, byte index, uint state
public override void Update(BossModule module)
{
foreach (var b in module.Enemies(OID.WildBeasts4))
if (b.Position.InRect(new(24, stampede1.Z), _rotation1, 33, 33, 5) && !beasts1.Contains(b))
beasts1.Add(b);
if (b.Position.InRect(new(24, stampede1.Z), _rotation1, 33, 33, 5) && !beasts1.Contains(b))
beasts1.Add(b);
foreach (var b in module.Enemies(OID.WildBeasts3))
if (b.Position.InRect(new(24, stampede1.Z), _rotation1, 33, 33, 5) && !beasts1.Contains(b))
beasts1.Add(b);
if (b.Position.InRect(new(24, stampede1.Z), _rotation1, 33, 33, 5) && !beasts1.Contains(b))
beasts1.Add(b);
foreach (var b in module.Enemies(OID.WildBeasts2))
if (b.Position.InRect(new(24, stampede1.Z), _rotation1, 33, 33, 5) && !beasts1.Contains(b))
beasts1.Add(b);
if (b.Position.InRect(new(24, stampede1.Z), _rotation1, 33, 33, 5) && !beasts1.Contains(b))
beasts1.Add(b);
foreach (var b in module.Enemies(OID.WildBeasts1))
if (b.Position.InRect(new(24, stampede1.Z), _rotation1, 33, 33, 5) && !beasts1.Contains(b))
beasts1.Add(b);
if (b.Position.InRect(new(24, stampede1.Z), _rotation1, 33, 33, 5) && !beasts1.Contains(b))
beasts1.Add(b);

foreach (var b in module.Enemies(OID.WildBeasts4))
if (b.Position.InRect(new(24, stampede2.Z), _rotation2, 33, 33, 5) && !beasts2.Contains(b))
beasts2.Add(b);
if (b.Position.InRect(new(24, stampede2.Z), _rotation2, 33, 33, 5) && !beasts2.Contains(b))
beasts2.Add(b);
foreach (var b in module.Enemies(OID.WildBeasts3))
if (b.Position.InRect(new(24, stampede2.Z), _rotation2, 33, 33, 5) && !beasts2.Contains(b))
beasts2.Add(b);
if (b.Position.InRect(new(24, stampede2.Z), _rotation2, 33, 33, 5) && !beasts2.Contains(b))
beasts2.Add(b);
foreach (var b in module.Enemies(OID.WildBeasts2))
if (b.Position.InRect(new(24, stampede2.Z), _rotation2, 33, 33, 5) && !beasts2.Contains(b))
beasts2.Add(b);
if (b.Position.InRect(new(24, stampede2.Z), _rotation2, 33, 33, 5) && !beasts2.Contains(b))
beasts2.Add(b);
foreach (var b in module.Enemies(OID.WildBeasts1))
if (b.Position.InRect(new(24, stampede2.Z), _rotation2, 33, 33, 5) && !beasts2.Contains(b))
beasts2.Add(b);
if (b.Position.InRect(new(24, stampede2.Z), _rotation2, 33, 33, 5) && !beasts2.Contains(b))
beasts2.Add(b);

if (_reset1 != default && module.WorldState.CurrentTime > _reset1)
{
Expand Down Expand Up @@ -342,9 +342,9 @@ public RoarOfAlbion() : base(ActionID.MakeSpell(AID.RoarOfAlbion), 60, false) {
public override IEnumerable<Actor> BlockerActors(BossModule module) => module.Enemies(OID.IcyCrystal);
}

class D131AlbionStates : StateMachineBuilder
class D111AlbionStates : StateMachineBuilder
{
public D131AlbionStates(BossModule module) : base(module)
public D111AlbionStates(BossModule module) : base(module)
{
TrivialPhase()
.ActivateOnEnter<WildlifeCrossing>()
Expand All @@ -360,8 +360,8 @@ public D131AlbionStates(BossModule module) : base(module)
}

[ModuleInfo(CFCID = 896, NameID = 11992)]
public class D131Albion : BossModule
public class D111Albion : BossModule
{
public D131Albion(WorldState ws, Actor primary) : base(ws, primary, new ArenaBoundsSquare(new(24, -744), 19.5f)) { }
public D111Albion(WorldState ws, Actor primary) : base(ws, primary, new ArenaBoundsSquare(new(24, -744), 19.5f)) { }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Collections.Generic;
using System.Linq;

namespace BossMod.Endwalker.Dungeon.D13LapisManalis.D132GalateaMagna
namespace BossMod.Endwalker.Dungeon.D11LapisManalis.D112GalateaMagna
{
public enum OID : uint
{
Expand Down Expand Up @@ -59,7 +59,7 @@ class ScarecrowChase : Components.GenericAOEs
public override IEnumerable<AOEInstance> ActiveAOEs(BossModule module, int slot, Actor actor)
{
var activation = 3 * (_casters.Count - _casterssorted.Count);
if (_casterssorted.Count == 1)
if (_casterssorted.Count == 1)
yield return new(cross, _casterssorted[0].Position, 45.Degrees(), _activation.AddSeconds(activation), ArenaColor.Danger);
if (_casterssorted.Count > 1)
{
Expand Down Expand Up @@ -158,8 +158,8 @@ class GlassyEyed : Components.GenericGaze
public override IEnumerable<Eye> ActiveEyes(BossModule module, int slot, Actor actor)
{
foreach (var a in _affected)
if (_affected.Count > 0 && module.WorldState.CurrentTime > _activation.AddSeconds(-10))
yield return new(a.Position, _activation);
if (_affected.Count > 0 && module.WorldState.CurrentTime > _activation.AddSeconds(-10))
yield return new(a.Position, _activation);
}

public override void OnStatusGain(BossModule module, Actor actor, ActorStatus status)
Expand Down Expand Up @@ -208,11 +208,10 @@ public override void AddAIHints(BossModule module, int slot, Actor actor, PartyR
class Doom : BossComponent
{
private List<Actor> _doomed = new();
public bool Doomed { get; private set; }

public override void OnStatusGain(BossModule module, Actor actor, ActorStatus status)
{
if ((SID)status.ID == SID.Doom)
if ((SID)status.ID == SID.Doom)
_doomed.Add(actor);
}

Expand Down Expand Up @@ -251,9 +250,9 @@ class SoulScythe : Components.LocationTargetedAOEs
public SoulScythe() : base(ActionID.MakeSpell(AID.SoulScythe), 18) { }
}

class D132GalateaMagnaStates : StateMachineBuilder
class D112GalateaMagnaStates : StateMachineBuilder
{
public D132GalateaMagnaStates(BossModule module) : base(module)
public D112GalateaMagnaStates(BossModule module) : base(module)
{
TrivialPhase()
.ActivateOnEnter<Doom>()
Expand All @@ -267,8 +266,8 @@ public D132GalateaMagnaStates(BossModule module) : base(module)
}

[ModuleInfo(CFCID = 896, NameID = 10308)]
public class D132GalateaMagna : BossModule
public class D112GalateaMagna : BossModule
{
public D132GalateaMagna(WorldState ws, Actor primary) : base(ws, primary, new ArenaBoundsCircle(new(350, -394), 19.5f)) { }
public D112GalateaMagna(WorldState ws, Actor primary) : base(ws, primary, new ArenaBoundsCircle(new(350, -394), 19.5f)) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System;
using System.Collections.Generic;

namespace BossMod.Endwalker.Dungeon.D13LapisManalis.D133Cagnazzo
namespace BossMod.Endwalker.Dungeon.D11LapisManalis.D113Cagnazzo
{
public enum OID : uint
{
Expand Down Expand Up @@ -213,10 +213,9 @@ public override void OnEventCast(BossModule module, Actor caster, ActorCastEvent
}
}


class D133CagnazzoStates : StateMachineBuilder
class D113CagnazzoStates : StateMachineBuilder
{
public D133CagnazzoStates(BossModule module) : base(module)
public D113CagnazzoStates(BossModule module) : base(module)
{
TrivialPhase()
.ActivateOnEnter<Voidcleaver>()
Expand All @@ -239,9 +238,9 @@ public D133CagnazzoStates(BossModule module) : base(module)
}

[ModuleInfo(CFCID = 896, NameID = 11995)]
public class D133Cagnazzo : BossModule
public class D113Cagnazzo : BossModule
{
public D133Cagnazzo(WorldState ws, Actor primary) : base(ws, primary, new ArenaBoundsSquare(new(-250, 130), 20)) { }
public D113Cagnazzo(WorldState ws, Actor primary) : base(ws, primary, new ArenaBoundsSquare(new(-250, 130), 20)) { }
protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actor(PrimaryActor, ArenaColor.Enemy);
Expand Down

0 comments on commit 68fe828

Please sign in to comment.