Great, no rush, hope it works out!
🙏
Edit
@Uranium:
a.atk returns the current ATK value after equips, traits, etc. The default order of calculation is
paramBase (from the actor's class) +
paramPlus (equips + permanent bonuses), all multiplied by
paramRate, which is determined by the active traits and (de)buffs. (Extra and Special params are calculated solely as a sum/product of relevant traits.) You can get the base ATK value like this if you like:
a.paramBase(2)
And yep,
params[2] is for getting the ATK value on the weapon. It's just different because of how the data happens to be stored. Basic params are indexed 0~7: MHP, MMP, ATK, DEF, MAT, MDF, AGI, and LUK respectively. This line:
a.isActor() ? (a.weapons()[0] || {params:[]}).params[2] || 0 : 0
...essentially means this:
- If the user is an actor, then...
- Get the actor's first equipped weapon or, failing that, an object with an empty
params array on it;
- Then return the value of the third entry (array indices start counting from 0) in the
params array on that object; if the array doesn't have a third entry, return 0 instead.
- If the user is not an actor, then return 0 instead.
Hope that makes sense!
😂