Formulas
Description
The formulas.lua
file specifies which formulas contain which functions and in what order they are executed. Generally, every formula consists of 1 or more functions.
Formula functions are split into 2 groups: OnCast and OnHit.
OnCast functions are executed when the action is cast, so once the charge bar is full. They usually calculate the chance for the action to miss, being reflected, the target countering it, being immune to it, etc.
OnHit functions are executed once the action (visually) hits the target. They usually calculate the damage the target should receive, what status effect they should get, etc.
Assignment
Functions are assigned to a group based on their goal.
For example, if an action heals the target, its formula should first check if the target can even be hit before actually modifying their hp. The former check is usually done via an OnCast function while the latter is done via an OnHit function.
So OnCast functions are usually used for smaller tasks and help with the processing of OnHit functions.
Layout
Every table entry uses a formula identifier (e.g. 30
) as the key and a table of formula functions (e.g. {16, 6}
) as the value.
Notes
Formula 0 is used to indicate that an action or equipment has no formula. Therefore it should not be assigned any function identifiers, as they are ignored anyway.
If an action (e.g. Attack) uses formula 0, the formula of the equipment (e.g. Broadsword) will be used instead. If that is also 0, the formula processing will be skipped.
Last updated