Hi All,
I'm trying to utilize the critical effect in the damage popups to trigger when someone also attacks a targets elemental weakness. I feel like I am al most there. I am working with this bit of code:
The part I can't quite figure out is how to use this bit correctly:
It works if I put in a hard number for the element ID like this:
But I don't know how to properly call for the currently used skill's element id here. If anyone can help me out I would greatly appreciate it.
I'm trying to utilize the critical effect in the damage popups to trigger when someone also attacks a targets elemental weakness. I feel like I am al most there. I am working with this bit of code:
JavaScript:
Sprite_Damage.prototype.setup = function(target) {
this._result = target.shiftDamagePopup();
var result = this._result;
if (result.missed || result.evaded) {
this.createMiss();
} else if (result.hpAffected) {
this.createDigits(0, result.hpDamage);
} else if (target.isAlive() && result.mpDamage !== 0) {
this.createDigits(2, result.mpDamage);
}
if (result.critical || target.elementRate(this._action.item().damage.elementId) > 1) {
this.setupCriticalEffect();
}
};
The part I can't quite figure out is how to use this bit correctly:
JavaScript:
target.elementRate(this._action.item().damage.elementId) > 1
It works if I put in a hard number for the element ID like this:
JavaScript:
target.elementRate(2) > 1
But I don't know how to properly call for the currently used skill's element id here. If anyone can help me out I would greatly appreciate it.