JavaScript:
Game_Action.prototype.elementsMaxRate = function(target, elements) {
// attackElements() determines whether this condition runs or not, should the target have any.
if (elements.length > 0) {
// When a target is attacked, their elementRate is returned as an
// array. The elementId is retrieved from somewhere...
const rates = elements.map(elementId => target.elementRate(elementId));
// Returns the highest element Rate from the rates array.
return Math.max(...rates);
} else {
return 1;
}
};
I can't figure out where elementId is being set. Obviously it's being set by the game, because logging that through the console will return an undefined error.