Skip to content

Commit

Permalink
Merge pull request #481 from FFXIV-CombatReborn/mergeWIP
Browse files Browse the repository at this point in the history
shadow lord tower fix, merge vbm
  • Loading branch information
CarnifexOptimus authored Dec 1, 2024
2 parents 203b726 + 6ec1612 commit 0f5734f
Show file tree
Hide file tree
Showing 27 changed files with 1,607 additions and 12 deletions.
4 changes: 2 additions & 2 deletions BossMod/Components/StackSpread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public record struct Spread(
public IEnumerable<Stack> ActiveStacks => IncludeDeadTargets ? Stacks : Stacks.Where(s => !s.Target.IsDead);
public IEnumerable<Spread> ActiveSpreads => IncludeDeadTargets ? Spreads : Spreads.Where(s => !s.Target.IsDead);

public bool IsStackTarget(Actor actor) => Stacks.Any(s => s.Target == actor);
public bool IsSpreadTarget(Actor actor) => Spreads.Any(s => s.Target == actor);
public bool IsStackTarget(Actor? actor) => Stacks.Any(s => s.Target == actor);
public bool IsSpreadTarget(Actor? actor) => Spreads.Any(s => s.Target == actor);

public override void AddHints(int slot, Actor actor, TextHints hints)
{
Expand Down
5 changes: 3 additions & 2 deletions BossMod/Components/Towers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme
var forbidden = new List<Func<WPos, float>>();
if (!Towers.Any(x => x.ForbiddenSoakers[slot]))
{
foreach (var t in Towers.Where(x => !x.IsInside(actor) && x.InsufficientAmountInside(Module) && x.NumInside(Module) > 0))
forbiddenInverted.Add(ShapeDistance.InvertedCircle(t.Position, t.Radius));
if (Raid.WithoutSlot(true).Count() <= 8) // don't do this in unorganized content where people do whatever
foreach (var t in Towers.Where(x => !x.IsInside(actor) && x.InsufficientAmountInside(Module) && x.NumInside(Module) > 0))
forbiddenInverted.Add(ShapeDistance.InvertedCircle(t.Position, t.Radius));
var inTower = Towers.Any(x => x.IsInside(actor) && x.CorrectAmountInside(Module));
var missingSoakers = !inTower && Towers.Any(x => x.InsufficientAmountInside(Module));
if (forbiddenInverted.Count == 0)
Expand Down
14 changes: 14 additions & 0 deletions BossMod/Config/GroupAssignment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,20 @@ public static GroupAssignmentUnique Default()
return r;
}

public static GroupAssignmentUnique DefaultRoles()
{
GroupAssignmentUnique r = new();
r[PartyRolesConfig.Assignment.MT] = 0;
r[PartyRolesConfig.Assignment.OT] = 1;
r[PartyRolesConfig.Assignment.H1] = 2;
r[PartyRolesConfig.Assignment.H2] = 3;
r[PartyRolesConfig.Assignment.M1] = 4;
r[PartyRolesConfig.Assignment.M2] = 5;
r[PartyRolesConfig.Assignment.R1] = 6;
r[PartyRolesConfig.Assignment.R2] = 7;
return r;
}

public override bool Validate()
{
BitMask mask = new();
Expand Down
4 changes: 1 addition & 3 deletions BossMod/Data/WorldState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ public sealed record class OpRSVData(string Key, string Value) : Operation
{
protected override void Exec(WorldState ws)
{
// TODO: reconsider...
//lock (Service.LuminaRSVLock)
// Service.LuminaGameData?.Excel.RsvProvider.Add(Key, Value);
Service.LuminaRSV[Key] = System.Text.Encoding.UTF8.GetBytes(Value); // TODO: reconsider...
ws.RSVEntries[Key] = Value;
ws.RSVDataReceived.Fire(this);
}
Expand Down
3 changes: 2 additions & 1 deletion BossMod/Framework/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Dalamud.IoC;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;
using System.Collections.Concurrent;

namespace BossMod;

Expand Down Expand Up @@ -34,10 +35,10 @@ public sealed class Service
public static Action<string>? LogHandler;
public static void Log(string msg) => LogHandler?.Invoke(msg);

public static object LuminaRSVLock = new(); // TODO: replace with System.Threading.Lock
public static Lumina.GameData? LuminaGameData;
public static Lumina.Excel.ExcelSheet<T>? LuminaSheet<T>() where T : struct, Lumina.Excel.IExcelRow<T> => LuminaGameData?.GetExcelSheet<T>(Lumina.Data.Language.English);
public static T? LuminaRow<T>(uint row) where T : struct, Lumina.Excel.IExcelRow<T> => LuminaSheet<T>()?.GetRowOrDefault(row);
public static ConcurrentDictionary<Lumina.Text.ReadOnly.ReadOnlySeString, Lumina.Text.ReadOnly.ReadOnlySeString> LuminaRSV = []; // TODO: reconsider

public static WindowSystem? WindowSystem;
#pragma warning restore CA2211
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public override void OnCastFinished(Actor caster, ActorCastInfo spell)
}
}

class EchoesOfAgony(BossModule module) : Components.StackWithIcon(module, (uint)IconID.EchoesOfAgony, ActionID.MakeSpell(AID.EchoesOfAgonyAOE), 5, 9.2f, 8)
class EchoesOfAgony(BossModule module) : Components.StackWithIcon(module, (uint)IconID.EchoesOfAgony, ActionID.MakeSpell(AID.EchoesOfAgonyAOE), 5, 9.2f, 8, PartyState.MaxAllianceSize)
{
public override void OnCastStarted(Actor caster, ActorCastInfo spell)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected override void CalculateModuleAIHints(int slot, Actor actor, PartyRoles
OID.TuraliOnion => 5,
OID.TuraliEggplant => 4,
OID.TuraliGarlic => 3,
OID.TuraliTomato => 2,
OID.TuraliTomato or OID.AlpacaOfFortune => 2,
OID.TuligoraQueen or OID.UolonOfFortune => 1,
_ => 0
};
Expand Down
32 changes: 32 additions & 0 deletions BossMod/Modules/Dawntrail/Ultimate/FRU/FRU.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace BossMod.Dawntrail.Ultimate.FRU;

class P1BrightfireSmall(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.BrightfireSmall), new AOEShapeCircle(5));
class P1BrightfireLarge(BossModule module) : Components.SelfTargetedAOEs(module, ActionID.MakeSpell(AID.BrightfireLarge), new AOEShapeCircle(10));
class P2QuadrupleSlap(BossModule module) : Components.TankSwap(module, ActionID.MakeSpell(AID.QuadrupleSlapFirst), ActionID.MakeSpell(AID.QuadrupleSlapFirst), ActionID.MakeSpell(AID.QuadrupleSlapSecond), 4.1f, null, true);
class P2CrystalOfLight(BossModule module) : Components.Adds(module, (uint)OID.CrystalOfLight);

[ModuleInfo(BossModuleInfo.Maturity.WIP, GroupType = BossModuleInfo.GroupType.CFC, GroupID = 1006, NameID = 9707, PlanLevel = 100)]
public class FRU(WorldState ws, Actor primary) : BossModule(ws, primary, new(100, 100), new ArenaBoundsCircle(20))
{
private Actor? _bossP2;
private Actor? _iceVeil;

public Actor? BossP1() => PrimaryActor;
public Actor? BossP2() => _bossP2;
public Actor? IceVeil() => _iceVeil;

protected override void UpdateModule()
{
// TODO: this is an ugly hack, think how multi-actor fights can be implemented without it...
// the problem is that on wipe, any actor can be deleted and recreated in the same frame
_bossP2 ??= StateMachine.ActivePhaseIndex == 1 ? Enemies(OID.BossP2).FirstOrDefault() : null;
_iceVeil ??= StateMachine.ActivePhaseIndex == 1 ? Enemies(OID.IceVeil).FirstOrDefault() : null;
}

protected override void DrawEnemies(int pcSlot, Actor pc)
{
Arena.Actor(PrimaryActor);
Arena.Actor(_bossP2);
Arena.Actor(_iceVeil);
}
}
35 changes: 35 additions & 0 deletions BossMod/Modules/Dawntrail/Ultimate/FRU/FRUConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
namespace BossMod.Dawntrail.Ultimate.FRU;

[ConfigDisplay(Order = 0x200, Parent = typeof(DawntrailConfig))]
public class FRUConfig() : ConfigNode()
{
// TODO: fixed tethers option
[PropertyDisplay("P1 Bound of Faith (light party tethers): group assignments & flex priority (lower number flexes)")]
[GroupDetails(["N prio 1", "N prio 2", "N prio 3", "N prio 4", "S prio 1", "S prio 2", "S prio 3", "S prio 4"])]
[GroupPreset("Supports N, DD S", [0, 1, 2, 3, 4, 5, 6, 7])]
public GroupAssignmentUnique P1BoundOfFaithAssignment = GroupAssignmentUnique.DefaultRoles();

[PropertyDisplay("P1 Fall of Faith (cone tethers) : conga priority (two people without tethers with lower priorities join odd group)")]
[GroupDetails(["1", "2", "3", "4", "5", "6", "7", "8"])]
[GroupPreset("TTHHMMRR", [0, 1, 2, 3, 4, 5, 6, 7])]
[GroupPreset("RHMTTMHR", [3, 4, 1, 6, 2, 5, 0, 7])]
public GroupAssignmentUnique P1FallOfFaithAssignment = GroupAssignmentUnique.DefaultRoles();

[PropertyDisplay("P1 Fall of Faith (cone tethers): odd groups go W (rather than N)")]
public bool P1FallOfFaithEW = false;

[PropertyDisplay("P1 Explosions: tower fill priority (lower number goes north)")]
[GroupDetails(["MT (ignore)", "OT (ignore)", "Fixed N", "Fixed Center", "Fixed S", "Flex 1", "Flex 2", "Flex 3"])]
[GroupPreset("H1-R2-H2 fixed, M1-M2-R1 flex", [0, 1, 2, 4, 5, 6, 7, 3])]
public GroupAssignmentUnique P1ExplosionsAssignment = GroupAssignmentUnique.DefaultRoles();

[PropertyDisplay("P2 Diamond Dust: cardinal assignments")]
[GroupDetails(["Support N", "Support E", "Support S", "Support W", "DD N", "DD E", "DD S", "DD W"])]
public GroupAssignmentUnique P2DiamondDustCardinals = GroupAssignmentUnique.DefaultRoles();

[PropertyDisplay("P2 Diamond Dust: supports go to CCW intercardinal")]
public bool P2DiamondDustSupportsCCW;

[PropertyDisplay("P2 Diamond Dust: DD go to CCW intercardinal")]
public bool P2DiamondDustDDCCW;
}
Loading

0 comments on commit 0f5734f

Please sign in to comment.