Gambit
Description
HP / MP gambits use formula functions to determine whether a party member's currently active gambit should be interrupted by one with higher priority based on if the related action is intended to be beneficial to the target. If it is, a party member won't bother to interrupt their action to restore the target's HP or MP if another character already plans to do it. Priority is based on a party member's identifier (lower first).
This only applies to actions that have the Is Positive
and Can Restore HP
or Can Restore MP
flags enabled in Battlepack Section 14.
Example
You can examine these checks by disabling the mod and doing the following:
Set Battle Mode to Wait.
Set the active party to Vaan and Ashe.
Delete all of their gambits.
Give Ashe the gambit
Ally: HP < 100% -> Cure
.Turn Vaan's and Ashe's gambits off.
Attack Vaan until he has less than 100% HP.
Cast
Cure
with Vaan, targeting himself.Enable Ashe's gambits before Vaan finishes casting.
Now the Cure formula's OnHit middleware functions will be executed to check if Vaan will be able to fully heal himself. If he will not be, Ashe will also cast Cure on him. Otherwise, she won't.
Concerns
These checks are executed on every frame (e.g. 60 times per second). Normally, this wouldn't be an issue, but since formulas are now executed with Lua, which is significantly slower than assembly, they can impact performance. Frame spikes become more likely when many party members have HP / MP gambits, and the game runs faster, either due to higher FPS or the speed mode multiplier. Since this will eventually lead to performance issues, formula executions with gambits have been disabled. As a result, it will be possible to overheal with gambits. To workaround this issue, you can limit the amount of healing gambits to one party member in the active party.
Last updated