forked from awgil/ffxiv_bossmod
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #385 from FFXIV-CombatReborn/mergeWIP
merge VBM
- Loading branch information
Showing
61 changed files
with
1,260 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace BossMod; | ||
|
||
// This tweak controls auto attacks to prevent early pulls and to enable them asap when pulling, changing targets or starting casts. | ||
public sealed class AutoAutosTweak(WorldState ws, AIHints hints) | ||
{ | ||
private readonly ActionTweaksConfig _config = Service.Config.Get<ActionTweaksConfig>(); | ||
private bool _lastActionDisabledAutos; | ||
|
||
public const float PrePullThreshold = 0.5f; // effect result delay for autos | ||
|
||
public bool Enabled => _config.AutoAutos; | ||
|
||
public bool ShouldPreventAutoActivation(uint spellId) | ||
{ | ||
var actionData = Service.LuminaRow<Lumina.Excel.GeneratedSheets.Action>(spellId); | ||
_lastActionDisabledAutos = actionData?.Unknown50 is 3 or 6 or 7; | ||
return Enabled && ws.Client.CountdownRemaining > PrePullThreshold && !(ws.Party.Player()?.InCombat ?? false); | ||
} | ||
|
||
public bool GetDesiredState(bool currentState) | ||
{ | ||
if (!Enabled || _lastActionDisabledAutos) | ||
return currentState; | ||
|
||
var player = ws.Party.Player(); | ||
if (player == null || player.Statuses.Any(s => s.ID is 418 or 2648)) // transcendent | ||
return currentState; | ||
|
||
var target = ws.Actors.Find(player.TargetID); | ||
if (target == null || target.IsAlly) | ||
return currentState; | ||
|
||
if (_config.PyreticThreshold > 0 && hints.ImminentSpecialMode.mode == AIHints.SpecialMode.Pyretic && hints.ImminentSpecialMode.activation < ws.FutureTime(_config.PyreticThreshold)) | ||
return false; // pyretic => disable autos | ||
|
||
return player.InCombat || ws.Client.CountdownRemaining <= PrePullThreshold; // no reason not to enable autos! | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.