Hello, I have am having an issue with how an attack's damage is displayed. I changed the
Game_BattlerBase.prototype.attackSkillId function in order to be able to differentiate basic attacks (that part works, the damage is even dealt) but any attacks running through this new function do not display anything besides the basic message for the attack (like '%1 attacks').
The new function is below:
(function(){
var _GameBattlerBase_attackSkillId = Game_BattlerBase.prototype.attackSkillId;
Game_BattlerBase.prototype.attackSkillId = function() {
if (this.isActor()) { //if actor return a variable
if (this._classId === 1){
return $gameVariables.value(21);
} else if (this._classId === 2){
return $gameVariables.value(22);
} else if (this._classId === 3){
return $gameVariables.value(23);
} else {
console.error('Your class was not defined');
}
} else { //if enemy return default
_GameBattlerBase_attackSkillId.call(this)
}
}
})();
Where my $gameVariables.value[x] is set to the skill ID for the corresponding basic attack. The enemy's attack, which is routed through the old function, still displays damage correctly. Any ideas? I couldn't decipher why it wasn't displaying (but still calculated and did) damage.
Game_BattlerBase.prototype.attackSkillId function in order to be able to differentiate basic attacks (that part works, the damage is even dealt) but any attacks running through this new function do not display anything besides the basic message for the attack (like '%1 attacks').
The new function is below:
(function(){
var _GameBattlerBase_attackSkillId = Game_BattlerBase.prototype.attackSkillId;
Game_BattlerBase.prototype.attackSkillId = function() {
if (this.isActor()) { //if actor return a variable
if (this._classId === 1){
return $gameVariables.value(21);
} else if (this._classId === 2){
return $gameVariables.value(22);
} else if (this._classId === 3){
return $gameVariables.value(23);
} else {
console.error('Your class was not defined');
}
} else { //if enemy return default
_GameBattlerBase_attackSkillId.call(this)
}
}
})();
Where my $gameVariables.value[x] is set to the skill ID for the corresponding basic attack. The enemy's attack, which is routed through the old function, still displays damage correctly. Any ideas? I couldn't decipher why it wasn't displaying (but still calculated and did) damage.