Skip to content

Commit

Permalink
FRU LR AI WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
awgil committed Jan 10, 2025
1 parent 95663ae commit bc89951
Show file tree
Hide file tree
Showing 4 changed files with 252 additions and 79 deletions.
17 changes: 15 additions & 2 deletions BossMod/Modules/Dawntrail/Ultimate/FRU/FRUConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ public class FRUConfig() : ConfigNode()
[PropertyDisplay("P3 Apocalypse: uptime swaps (only consider swaps within prio 1/2 and 3/4, assuming these are melee and ranged)")]
public bool P3ApocalypseUptime;

[PropertyDisplay("P4 Darklit Dragonsong: assignments (lower prio stays more clockwise, lowest prio support takes N tower)", separator: true)]
[PropertyDisplay("P4 Darklit Dragonsong: assignments (lower prio stays more clockwise, lowest prio support takes N tower)")]
[GroupDetails(["Support prio1", "Support prio2", "Support prio3", "Support prio4", "DD prio1", "DD prio2", "DD prio3", "DD prio4"])]
[GroupPreset("Default (healer N)", [2, 3, 0, 1, 4, 5, 6, 7])]
public GroupAssignmentUnique P4DarklitDragonsongAssignments = new() { Assignments = [2, 3, 0, 1, 4, 5, 6, 7] };

[PropertyDisplay("P4 Crystallize Time: assignments for claws (lower prio goes west)")]
[PropertyDisplay("P4 Crystallize Time: assignments for claws (lower prio goes west)", separator: true)]
[GroupDetails(["Prio 1", "Prio 2", "Prio 3", "Prio 4", "Prio 5", "Prio 6", "Prio 7", "Prio 8"])]
[GroupPreset("Default HTMR", [3, 2, 1, 0, 4, 5, 6, 7])]
public GroupAssignmentUnique P4CrystallizeTimeAssignments = new() { Assignments = [3, 2, 1, 0, 4, 5, 6, 7] };
Expand Down Expand Up @@ -111,4 +111,17 @@ public class FRUConfig() : ConfigNode()
[GroupDetails(["Boss wall right", "Boss wall left", "Boss center", "Boss diagonal", "Mirror wall right", "Mirror wall left", "Mirror center", "Mirror diagonal"])]
[GroupPreset("Default", [1, 0, 6, 7, 2, 3, 4, 5])]
public GroupAssignmentUnique P2MirrorMirror2SpreadSpots = new() { Assignments = [1, 0, 6, 7, 2, 3, 4, 5] };

[PropertyDisplay("P2 Banish after Light Rampant: spread clock spots (supports should be near dd to resolve pairs)", tooltip: "Only used by AI")]
[GroupDetails(["N", "NE", "E", "SE", "S", "SW", "W", "NW"])]
[GroupPreset("Default", [0, 4, 6, 2, 5, 3, 7, 1])]
public GroupAssignmentUnique P2Banish2SpreadSpots = new() { Assignments = [0, 4, 6, 2, 5, 3, 7, 1] };

[PropertyDisplay("P2 Banish after Light Rampant: role that moves from their default spread spot to resolve pairs", tooltip: "Only used by AI")]
[PropertyCombo("DD", "Supports")]
public bool P2Banish2SupportsMoveToStack = true;

[PropertyDisplay("P2 Banish after Light Rampant: direction to move to resolve pairs", tooltip: "Only used by AI")]
[PropertyCombo("CW", "CCW")]
public bool P2Banish2MoveCCWToStack = true;
}
17 changes: 13 additions & 4 deletions BossMod/Modules/Dawntrail/Ultimate/FRU/FRUStates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,25 +309,34 @@ private void P2LightRampant(uint id, float delay)
.ActivateOnEnter<P2LightRampant>()
.ActivateOnEnter<P2LuminousHammer>()
.ActivateOnEnter<P2BrightHunger1>()
.ActivateOnEnter<P2LightRampantAITowers>()
.SetHint(StateMachine.StateHint.DowntimeStart);
ComponentCondition<P2LuminousHammer>(id + 0x20, 4.8f, comp => comp.NumCasts > 0, "Puddle bait");
ComponentCondition<P2BrightHunger1>(id + 0x30, 3.3f, comp => comp.NumCasts > 0, "Towers")
.ActivateOnEnter<P2SinboundHolyVoidzone>()
.DeactivateOnExit<P2LightRampantAITowers>()
.DeactivateOnExit<P2BrightHunger1>();
ComponentCondition<P2PowerfulLight>(id + 0x40, 5.7f, comp => !comp.Active, "Stack")
ComponentCondition<P2HolyLightBurst>(id + 0x38, 3.2f, comp => comp.Casters.Count > 0)
.ActivateOnEnter<P2HolyLightBurst>()
.ActivateOnEnter<P2PowerfulLight>()
.DeactivateOnExit<P2LuminousHammer>() // last puddle is baited right before holy light burst casts start
.DeactivateOnExit<P2PowerfulLight>();
.ActivateOnEnter<P2LightRampantAIStack>()
.DeactivateOnExit<P2LuminousHammer>(); // last puddle is baited right before holy light burst casts start
ComponentCondition<P2PowerfulLight>(id + 0x40, 2.5f, comp => !comp.Active, "Stack")
.DeactivateOnExit<P2PowerfulLight>()
.DeactivateOnExit<P2LightRampantAIStack>();
ComponentCondition<P2HolyLightBurst>(id + 0x50, 2.4f, comp => comp.NumCasts > 0, "Orbs 1")
.ActivateOnEnter<P2LightRampantAIOrbs>()
.ActivateOnEnter<P2BrightHunger2>();
ComponentCondition<P2HolyLightBurst>(id + 0x60, 3, comp => comp.NumCasts > 3, "Orbs 2")
.DeactivateOnExit<P2LightRampantAIOrbs>()
.DeactivateOnExit<P2HolyLightBurst>()
.DeactivateOnExit<P2LightRampant>(); // tethers resolve right after first orbs

ActorCastStartMulti(id + 0x70, _module.BossP2, [AID.BanishStack, AID.BanishSpread], 1.7f, true);
ActorCastStartMulti(id + 0x70, _module.BossP2, [AID.BanishStack, AID.BanishSpread], 1.7f, true)
.ActivateOnEnter<P2LightRampantAIResolve>();
ComponentCondition<P2BrightHunger2>(id + 0x71, 1.9f, comp => comp.NumCasts > 0, "Central tower")
.ActivateOnEnter<P2Banish2>()
.DeactivateOnExit<P2LightRampantAIResolve>()
.DeactivateOnExit<P2BrightHunger2>()
.DeactivateOnExit<P2SinboundHolyVoidzone>();
ActorCastEnd(id + 0x72, _module.BossP2, 3.1f, true);
Expand Down
39 changes: 37 additions & 2 deletions BossMod/Modules/Dawntrail/Ultimate/FRU/P2Banish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,44 @@ public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignme
// this variant provides hints after rampant
class P2Banish2(BossModule module) : P2Banish(module)
{
private readonly FRUConfig _config = Service.Config.Get<FRUConfig>();
private bool _allowHints;

public override void AddAIHints(int slot, Actor actor, PartyRolesConfig.Assignment assignment, AIHints hints)
{
// TODO
base.AddAIHints(slot, actor, assignment, hints);
if (!_allowHints)
return; // don't interfere with tower hints until it's done
var prepos = PrepositionLocation(assignment);
if (prepos != null)
hints.AddForbiddenZone(ShapeDistance.InvertedCircle(prepos.Value, 1), DateTime.MaxValue);
else
base.AddAIHints(slot, actor, assignment, hints);
}

private WPos? PrepositionLocation(PartyRolesConfig.Assignment assignment)
{
var clockspot = _config.P2Banish2SpreadSpots[assignment];
if (clockspot < 0)
return null; // no assignment

var assignedDirection = (180 - 45 * clockspot).Degrees();
if (Stacks.Count > 0 && Stacks[0].Activation > WorldState.FutureTime(1))
{
var isSupport = assignment is PartyRolesConfig.Assignment.MT or PartyRolesConfig.Assignment.OT or PartyRolesConfig.Assignment.H1 or PartyRolesConfig.Assignment.H2;
if (_config.P2Banish2SupportsMoveToStack == isSupport)
assignedDirection += (_config.P2Banish2MoveCCWToStack ? 45 : -45).Degrees();
return Module.Center + 10 * assignedDirection.ToDirection();
}
else if (Spreads.Count > 0 && Spreads[0].Activation > WorldState.FutureTime(1))
{
return Module.Center + 13 * assignedDirection.ToDirection();
}
return null;
}

public override void OnEventCast(Actor caster, ActorCastEvent spell)
{
if ((AID)spell.Action.ID == AID.BrightHunger)
_allowHints = true;
}
}
Loading

0 comments on commit bc89951

Please sign in to comment.