Skip to content

Commit

Permalink
Merge pull request #608 from FFXIV-CombatReborn/mergeWIP
Browse files Browse the repository at this point in the history
Bar the Passage modules, removed SQLite dependency
  • Loading branch information
CarnifexOptimus authored Feb 16, 2025
2 parents a9d794e + e365c82 commit 0f263cd
Show file tree
Hide file tree
Showing 28 changed files with 1,900 additions and 212 deletions.
14 changes: 0 additions & 14 deletions BossMod/BossModReborn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@

<ItemGroup>
<PackageReference Include="DalamudPackager" Version="11.0.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.2" />
<PackageReference Include="SharpDX.Mathematics" Version="4.2.0" />
<PackageReference Include="System.Data.Sqlite" Version="1.0.119" />
<ProjectReference Include="..\CodeAnalysis\CodeAnalysis.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>Analyzer</OutputItemType>
Expand Down Expand Up @@ -111,16 +109,4 @@
<ItemGroup>
<EmbeddedResource Include="Pathfinding\ObstacleMaps\*" />
</ItemGroup>

<ItemGroup>
<Content Include="System.Data.SQLite.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SQLite.Interop.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="DDTrapsData.sqlite3">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
Binary file removed BossMod/DDTrapsData.sqlite3
Binary file not shown.
2 changes: 0 additions & 2 deletions BossMod/Framework/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ public unsafe Plugin(IDalamudPluginInterface dalamud, ICommandManager commandMan
dalamud.UiBuilder.Draw += DrawUI;
dalamud.UiBuilder.OpenMainUi += () => OpenConfigUI();
dalamud.UiBuilder.OpenConfigUi += () => OpenConfigUI();

Global.DeepDungeon.DDTrapsData.Initialize(dalamud);
}

public void Dispose()
Expand Down
5 changes: 3 additions & 2 deletions BossMod/Modules/Dawntrail/Alliance/A11Prishe/Explosion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ public override IEnumerable<AOEInstance> ActiveAOEs(int slot, Actor actor)
var count = _aoes.Count;
if (count == 0)
return [];
var firstactivation = _aoes[0].Activation;
var act0 = _aoes[0].Activation;
var compareFL = (_aoes[count - 1].Activation - act0).TotalSeconds > 1d;
var aoes = new AOEInstance[count];
var color = Colors.Danger;
for (var i = 0; i < count; ++i)
{
var aoe = _aoes[i];
aoes[i] = (aoe.Activation - firstactivation).TotalSeconds < 1d ? aoe with { Color = color } : aoe with { Risky = false };
aoes[i] = (aoe.Activation - act0).TotalSeconds < 1d ? aoe with { Color = compareFL ? color : 0 } : aoe with { Risky = false };
}
return aoes;
}
Expand Down
19 changes: 9 additions & 10 deletions BossMod/Modules/Dawntrail/Dungeon/D06Alexandria/D063Eliminator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ class Impact(BossModule module) : Components.KnockbackFromCastTarget(module, Act

public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
var source = Sources(slot, actor).FirstOrDefault();
if (source != default)
hints.AddForbiddenZone(ShapeDistance.InvertedDonutSector(source.Origin, 6, 8, source.Origin.Z == -640 ? 180.Degrees() : default, halfAngle), source.Activation);
var source = Casters.Count != 0 ? Casters[0] : null;
if (source != null)
hints.AddForbiddenZone(ShapeDistance.InvertedDonutSector(source.Position, 6f, 8f, source.Position.Z == -640f ? 180f.Degrees() : default, halfAngle), Module.CastFinishAt(source.CastInfo));
}
}

class Compression(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.Compression), 6);
class Compression(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.Compression), 6f);

class Overexposure(BossModule module) : Components.LineStack(module, ActionID.MakeSpell(AID.OverexposureMarker), ActionID.MakeSpell(AID.Overexposure), 5f, 40f, 3f);
class LightOfDevotion(BossModule module) : Components.LineStack(module, ActionID.MakeSpell(AID.LightOfDevotionMarker), ActionID.MakeSpell(AID.LightOfDevotion), 5.5f, 40f, 3f)
Expand All @@ -156,7 +156,7 @@ public override void OnEventEnvControl(byte index, uint state)
class LightOfSalvation(BossModule module) : Components.GenericBaitAway(module)
{
private readonly Impact _kb = module.FindComponent<Impact>()!;
private static readonly AOEShapeRect rect = new(40, 3);
private static readonly AOEShapeRect rect = new(40f, 3f);

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
Expand All @@ -178,8 +178,7 @@ public override void OnEventEnvControl(byte index, uint state)

public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
var source = _kb.Sources(slot, actor).FirstOrDefault();
if (source != default)
if (_kb.Casters.Count != 0)
{ }
else
base.AddAIHints(slot, actor, assignment, hints);
Expand Down Expand Up @@ -211,13 +210,13 @@ public D063EliminatorStates(BossModule module) : base(module)
[ModuleInfo(BossModuleInfo.Maturity.Verified, Contributors = "The Combat Reborn Team (Malediktus, LTS), erdelf", GroupType = BossModuleInfo.GroupType.CFC, GroupID = 827, NameID = 12729)]
public class D063Eliminator(WorldState ws, Actor primary) : BossModule(ws, primary, ArenaCenter, StartingBounds)
{
public static readonly WPos ArenaCenter = new(-759, -648);
public static readonly WPos ArenaCenter = new(-759f, -648f);
public static readonly ArenaBoundsSquare StartingBounds = new(15.5f);
public static readonly ArenaBoundsSquare DefaultBounds = new(15);
public static readonly ArenaBoundsSquare DefaultBounds = new(15f);

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actor(PrimaryActor);
Arena.Actors(Enemies(OID.LightningGenerator), Colors.Object);
Arena.Actors(Enemies((uint)OID.LightningGenerator), Colors.Object);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,19 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme
{
if (Active)
{
var source = Module.Enemies(OID.HornedLizard).FirstOrDefault(x => x.Position.AlmostEqual(new(403, -105), 1)); // NPCs always seem to ignore the middle tether
Actor? source = null;
var enemies = Module.Enemies((uint)OID.HornedLizard);
var sourcePosition = new WPos(403, -105); // NPCs always seem to ignore the middle tether
var count = enemies.Count;
for (var i = 0; i < count; ++i)
{
var enemy = enemies[i];
if (enemy.Position.AlmostEqual(sourcePosition, 1f))
{
source = enemy;
break;
}
}
if (source == null)
return;
var target = WorldState.Actors.Find(source.Tether.Target);
Expand Down
34 changes: 18 additions & 16 deletions BossMod/Modules/Dawntrail/Quest/Role/AHunterTrue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,32 +76,33 @@ public enum IconID : uint
Bait = 101 // player/Kuiyki
}

class ScathingSunshot(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.ScathingSunshot), new AOEShapeCone(70, 60.Degrees()));
class Foxflare(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.Foxflare), new AOEShapeRect(50, 5));
class NinefoldCurse(BossModule module) : Components.RaidwideCastDelay(module, ActionID.MakeSpell(AID.NinefoldCurseVisual), ActionID.MakeSpell(AID.NinefoldCurse), 2);
class ScathingSunshot(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.ScathingSunshot), new AOEShapeCone(70f, 60f.Degrees()));
class Foxflare(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.Foxflare), new AOEShapeRect(50f, 5f));
class NinefoldCurse(BossModule module) : Components.RaidwideCastDelay(module, ActionID.MakeSpell(AID.NinefoldCurseVisual), ActionID.MakeSpell(AID.NinefoldCurse), 2f);
class NinetyNinefoldCurse(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.NinetyNinefoldCurse));
class Roar(BossModule module) : Components.RaidwideCast(module, ActionID.MakeSpell(AID.Roar));
class SonicStorm(BossModule module) : Components.SpreadFromCastTargets(module, ActionID.MakeSpell(AID.SonicStorm), 6);
class RushBait(BossModule module) : Components.BaitAwayChargeTether(module, 4, 8.3f, ActionID.MakeSpell(AID.RushBait), ActionID.MakeSpell(AID.RushBaitFail), (uint)TetherID.TetherBad, (uint)TetherID.TetherGood, (uint)OID.Dzo, 30);
class SonicStorm(BossModule module) : Components.SpreadFromCastTargets(module, ActionID.MakeSpell(AID.SonicStorm), 6f);
class RushBait(BossModule module) : Components.BaitAwayChargeTether(module, 4f, 8.3f, ActionID.MakeSpell(AID.RushBait), ActionID.MakeSpell(AID.RushBaitFail), (uint)TetherID.TetherBad, (uint)TetherID.TetherGood, (uint)OID.Dzo, 30f);
class RushLineStack(BossModule module) : Components.LineStack(module, ActionID.MakeSpell(AID.RushLineStackMarker), ActionID.MakeSpell(AID.RushLineStack), 4.9f, markerIsFinalTarget: false);
class Trample(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.Trample), 15);
class Trample(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.Trample), 15f);

class FallingDusk(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.FallingDusk), 15)
class FallingDusk(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.FallingDusk), 15f)
{
public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
if (Module.Enemies(OID.FilthyShackle).All(x => x.IsDead))
var shackle = Module.Enemies((uint)OID.FilthyShackle);
if (shackle.Count != 0 && !shackle[0].IsDead)
base.AddAIHints(slot, actor, assignment, hints);
}
}

class DancingWind(BossModule module) : Components.KnockbackFromCastTarget(module, ActionID.MakeSpell(AID.DancingWind), 8, kind: Kind.TowardsOrigin)
class DancingWind(BossModule module) : Components.KnockbackFromCastTarget(module, ActionID.MakeSpell(AID.DancingWind), 8f, kind: Kind.TowardsOrigin)
{
public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
var source = Sources(slot, actor).FirstOrDefault();
if (source != default)
hints.AddForbiddenZone(ShapeDistance.Circle(source.Origin, 18.5f), source.Activation);
var source = Casters.Count != 0 ? Casters[0] : null;
if (source != null)
hints.AddForbiddenZone(ShapeDistance.Circle(source.Position, 18.5f), Module.CastFinishAt(source.CastInfo));
}
}

Expand All @@ -114,13 +115,13 @@ class DawnlitBolt(BossModule module) : Components.GenericAOEs(module)

public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
if ((AID)spell.Action.ID == AID.DawnlitBoltTelegraph)
if (spell.Action.ID == (uint)AID.DawnlitBoltTelegraph)
_aoes.Add(new(circle, spell.LocXZ, default, Module.CastFinishAt(spell)));
}

public override void OnEventCast(Actor caster, ActorCastEvent spell)
{
if ((AID)spell.Action.ID == AID.DawnlitBolt)
if (spell.Action.ID == (uint)AID.DawnlitBolt)
_aoes.RemoveAll(x => x.Origin.AlmostEqual(spell.TargetXZ, 1));
}
}
Expand All @@ -129,7 +130,8 @@ class Fetters(BossModule module) : BossComponent(module)
{
public override void AddGlobalHints(GlobalHints hints)
{
if (Module.Enemies(OID.FilthyShackle).Any(x => !x.IsDead))
var shackle = Module.Enemies((uint)OID.FilthyShackle);
if (shackle.Count != 0 && !shackle[0].IsDead)
hints.Add($"Destroy fetters on Kuiyki!");
}
}
Expand Down Expand Up @@ -164,6 +166,6 @@ public class AHunterTrue(WorldState ws, Actor primary) : BossModule(ws, primary,
protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actors(Enemies(all));
Arena.Actors(Enemies(OID.FilthyShackle), Colors.Object);
Arena.Actors(Enemies((uint)OID.FilthyShackle), Colors.Object);
}
}
43 changes: 24 additions & 19 deletions BossMod/Modules/Dawntrail/Quest/Role/AnAntidoteForAnarchy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,52 +66,55 @@ public enum SID : uint
TemporaryMisdirectionNPC = 2936 // Helper->LoashkanaTheLeal, extra=0x168
}

class StingingMalady(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.StingingMalady), new AOEShapeCone(50, 30.Degrees()));
class StingingMalady(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.StingingMalady), StingingMaladyBait.Cone);
class StingingMaladyBait(BossModule module) : Components.GenericBaitAway(module)
{
private static readonly AOEShapeCone cone = new(50, 30.Degrees());
public static readonly AOEShapeCone Cone = new(50f, 30f.Degrees());

public override void OnEventCast(Actor caster, ActorCastEvent spell)
{
if ((AID)spell.Action.ID == AID.StingingMaladyMarker)
CurrentBaits.Add(new(caster, WorldState.Actors.Find(spell.MainTargetID)!, cone, WorldState.FutureTime(5)));
else if ((AID)spell.Action.ID == AID.StingingMaladyBait)
if (spell.Action.ID == (uint)AID.StingingMaladyMarker)
CurrentBaits.Add(new(caster, WorldState.Actors.Find(spell.MainTargetID)!, Cone, WorldState.FutureTime(5d)));
else if (spell.Action.ID == (uint)AID.StingingMaladyBait)
CurrentBaits.Clear();
}
}

class BewilderingBlight(BossModule module) : Components.SpreadFromCastTargets(module, ActionID.MakeSpell(AID.BewilderingBlight), 6);
class BewilderingBlight(BossModule module) : Components.SpreadFromCastTargets(module, ActionID.MakeSpell(AID.BewilderingBlight), 6f);
class BewilderingBlightTM(BossModule module) : Components.TemporaryMisdirection(module, ActionID.MakeSpell(AID.BewilderingBlight));

abstract class SkineaterSurge(BossModule module, AID aid) : Components.SimpleAOEs(module, ActionID.MakeSpell(aid), new AOEShapeCone(40, 90.Degrees()));
abstract class SkineaterSurge(BossModule module, AID aid) : Components.SimpleAOEs(module, ActionID.MakeSpell(aid), new AOEShapeCone(40f, 90f.Degrees()));
class SkineaterSurge1(BossModule module) : SkineaterSurge(module, AID.SkineaterSurge1);
class SkineaterSurge2(BossModule module) : SkineaterSurge(module, AID.SkineaterSurge2);

abstract class PoisonCloud(BossModule module, AID aid) : Components.SimpleAOEs(module, ActionID.MakeSpell(aid), 10);
abstract class PoisonCloud(BossModule module, AID aid) : Components.SimpleAOEs(module, ActionID.MakeSpell(aid), 10f);
class Burst(BossModule module) : PoisonCloud(module, AID.Burst1);
class SkineaterSurgePoisonCloud(BossModule module) : PoisonCloud(module, AID.SkineaterSurgePoisonCloud);

class SelfDestruct(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.SelfDestruct), 5);
class SelfDestructKBMammet(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.SelfDestructKBMammet), 7, 8);
class SelfDestruct(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.SelfDestruct), 5f);
class SelfDestructKBMammet(BossModule module) : Components.SimpleAOEs(module, ActionID.MakeSpell(AID.SelfDestructKBMammet), 7f, 8);
class Fester(BossModule module) : Components.SingleTargetCast(module, ActionID.MakeSpell(AID.Fester));

class TriDisaster(BossModule module) : Components.StackWithCastTargets(module, ActionID.MakeSpell(AID.TriDisasterFirst), 5, 2, 2)
class TriDisaster(BossModule module) : Components.StackWithCastTargets(module, ActionID.MakeSpell(AID.TriDisasterFirst), 5f, 2, 2)
{
private int numCasts;

public override void OnCastFinished(Actor caster, ActorCastInfo spell) { }

public override void OnEventCast(Actor caster, ActorCastEvent spell)
{
if ((AID)spell.Action.ID == AID.TriDisasterRest)
if (spell.Action.ID == (uint)AID.TriDisasterRest)
{
if (++numCasts == 4)
Stacks.Clear();
}
}
}

class SuffocatingCloud(BossModule module) : Components.PersistentVoidzone(module, 9, m => m.Enemies(OID.PoisonVoidzone));
class SuffocatingCloud(BossModule module) : Components.PersistentVoidzone(module, 9f, GetVoidzone)
{
private static List<Actor> GetVoidzone(BossModule module) => module.Enemies((uint)OID.PoisonVoidzone);
}

abstract class Raidwides(BossModule module, AID aid) : Components.RaidwideCast(module, ActionID.MakeSpell(aid), "Raidwide + bleed (Esuna!)");
class StingingAnguish(BossModule module) : Raidwides(module, AID.StingingAnguish);
Expand All @@ -120,23 +123,24 @@ class ScornOfTheScorpion(BossModule module) : Raidwides(module, AID.ScornOfTheSc

class Esuna(BossModule module) : BossComponent(module)
{
private readonly List<Actor> _affected = [];
private readonly List<Actor> _affected = new(2);

public override void OnStatusGain(Actor actor, ActorStatus status)
{
if ((SID)status.ID is SID.Bleeding or SID.HPRecoveryDown)
if (status.ID is (uint)SID.Bleeding or (uint)SID.HPRecoveryDown)
_affected.Add(actor);
}

public override void OnStatusLose(Actor actor, ActorStatus status)
{
if ((SID)status.ID is SID.Bleeding or SID.HPRecoveryDown)
if (status.ID is (uint)SID.Bleeding or (uint)SID.HPRecoveryDown)
_affected.Remove(actor);
}

public override void AddHints(int slot, Actor actor, TextHints hints)
{
var loashkana = Module.Enemies(OID.LoashkanaTheLeal).FirstOrDefault();
var loashkanaL = Module.Enemies(OID.LoashkanaTheLeal);
var loashkana = loashkanaL.Count != 0 ? loashkanaL[0] : null;
if (_affected.Contains(actor))
hints.Add("Use Esuna on yourself.");
if (loashkana != null && _affected.Contains(loashkana))
Expand All @@ -145,8 +149,9 @@ public override void AddHints(int slot, Actor actor, TextHints hints)

public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
foreach (var c in _affected)
hints.ActionsToExecute.Push(ActionID.MakeSpell(ClassShared.AID.Esuna), c, ActionQueue.Priority.High);
var count = _affected.Count;
for (var i = 0; i < count; ++i)
hints.ActionsToExecute.Push(ActionID.MakeSpell(ClassShared.AID.Esuna), _affected[i], ActionQueue.Priority.High);
}
}

Expand Down
Loading

0 comments on commit 0f263cd

Please sign in to comment.