Hello fellow RM Mv users, I need your help once more. 🙂
So I'm trying to manipulate the code a bit in order to make more custom damage formulas, but when I try to change the damage output:
Game_Action.prototype.executeDamage = function(target, value) {
var result = target.result();
if (value === 0) {
result.critical = false;
}
if (this.isHpEffect()) {
this.executeHpDamage(target, value);
}
if (this.isMpEffect()) {
this.executeMpDamage(target, value);
}
};
to:
Game_Action.prototype.executeDamage = function(target, value) {
var result = target.result();
if (value === 0) {
result.critical = false;
}
if (this.isHpEffect()) {
this.executeHpDamage(target, value - (target.luk / 10));
}
if (this.isMpEffect()) {
this.executeMpDamage(target, value);
}
};
the game calculates the damage with decimals and then in battle goes insane. How do I round them up, so instead of 1.11 it shows 1, or instead of 1.8 it shows 2? Maybe using Math.round? The same happens when I alter the Hp drain formula.
I don't know how to do it as I'm not a scripter myself, maybe someone more skilled knows the answer.
Also, if someone knows how to change the crit change so your agi modifys it I would be super thankful.
that's it, many thanks in advance and I hope to learn a bit more of JavaS from this! 🤘 🤘
So I'm trying to manipulate the code a bit in order to make more custom damage formulas, but when I try to change the damage output:
Game_Action.prototype.executeDamage = function(target, value) {
var result = target.result();
if (value === 0) {
result.critical = false;
}
if (this.isHpEffect()) {
this.executeHpDamage(target, value);
}
if (this.isMpEffect()) {
this.executeMpDamage(target, value);
}
};
to:
Game_Action.prototype.executeDamage = function(target, value) {
var result = target.result();
if (value === 0) {
result.critical = false;
}
if (this.isHpEffect()) {
this.executeHpDamage(target, value - (target.luk / 10));
}
if (this.isMpEffect()) {
this.executeMpDamage(target, value);
}
};
the game calculates the damage with decimals and then in battle goes insane. How do I round them up, so instead of 1.11 it shows 1, or instead of 1.8 it shows 2? Maybe using Math.round? The same happens when I alter the Hp drain formula.
I don't know how to do it as I'm not a scripter myself, maybe someone more skilled knows the answer.
Also, if someone knows how to change the crit change so your agi modifys it I would be super thankful.
that's it, many thanks in advance and I hope to learn a bit more of JavaS from this! 🤘 🤘