Hi friends! New here. Just like the title says I am trying to figure out how to make the minimum for all damage to be 1 instead of zero. I have every Yanfly app if that helps.
Ty in advance!
Ty in advance!
Is the suggestion that I put "Math.max(1", formula) into every damaging ability I make in game?
Okay, ty! Was hoping there was some global go around through a plug in but I'll do what's I gotta do.
Game_Action.prototype.makeDamageValue = function(target, critical) {
const item = this.item();
const baseValue = this.evalDamageFormula(target);
let value = baseValue * this.calcElementRate(target);
if (this.isPhysical()) {
value *= target.pdr;
}
if (this.isMagical()) {
value *= target.mdr;
}
if (baseValue < 0) {
value *= target.rec;
}
if (critical) {
value = this.applyCritical(value);
}
value = this.applyVariance(value, item.damage.variance);
value = this.applyGuard(value, target);
value = Math.round(value);
return value;
};
const alias_game_action_make_damage_value = Game_Action.prototype.makeDamageValue;
const alias_game_action_make_damage_value = Game_Action.prototype.makeDamageValue;
Game_Action.prototype.makeDamageValue = function(target, critical) {
const base_value = alias_game_action_make_damage_value.call(this, target, critical);
return Math.max(1, base_value);
}
Read my comment.
Yes, ty! I will consider this for later but for now but for the moment the first solution was easy and is working.
Original thread: https://forums.rpgmakerweb.com/threads/doing-1-damage.159730/