I am trying to build an achievement system and I want to give a reward if the player reaches a 9999 damage in a single action.
to get the damage done I use this function:
The problem is this function give me any damage done by the party or by the troop.
I wanted try finding if target is enemy using javascript find function():
But it throws an error.
How to know if a target is an enemy or ally?
to get the damage done I use this function:
Code:
var _Game_Damage_Done = Game_Action.prototype.executeHpDamage;
Game_Action.prototype.executeHpDamage = function(target, value) {
_Game_Damage_Done.call(this, target, value);
console.log(value);
};
The problem is this function give me any damage done by the party or by the troop.
I wanted try finding if target is enemy using javascript find function():
Code:
if(this._enemy.find(target)){
console.log(value + " to enemy");
}else{
console.log(value + " to ally");
}
But it throws an error.
How to know if a target is an enemy or ally?