10-03-2024, 06:05 PM
(This post was last modified: 10-03-2024, 06:07 PM by DerVVulfman.)
Looking at the default scripts in relation to battler damage and healing, and I've come to the realization that RPGMaker XP's ITEM damage formula is singularly the odd-man-out.
When it comes to RPGMaker XP's melee damage and skill damage, the system calculates all the damage including variations and random values that can be attributed to power levels and the like. And only after that, it then checks to see if the one being struck is 'guarding/defending'. And if the target is defending itself, the calculated damage is cut in half.
HOWEVER... RPGMaker XP's item damage, and only RPGMaker XP's item damage, is wholly different. It calculates the basic damage that is generated by the item and then looks to see if the target is guarding/defending. But after it checks to see if the target is defending and subsequently halves the damage, it will then apply the additional random damage attributes. The bonus values given to item damage or recovery is not halved like the rest of the content.
With RPGMaker's engines after XP, this is not the case. All variants are calculated before checking to see if the victim is defending, this for all battler attack actions from RPGMaker VX on up. And this, even for the python-driven versions such as RPGMaker MV as shown below:
Game_Action.prototype.makeDamageValue = function(target, critical) {
var item = this.item();
var baseValue = this.evalDamageFormula(target);
var 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;
};
Weird, eh? And nope, I don't have MV. I just have the scripts database for examination. I'm dangerous that way.
If I do decide to release an XP-like replacement of default scripts (sorta like the RMXP SDK on steroids), this would be a clear correction.
When it comes to RPGMaker XP's melee damage and skill damage, the system calculates all the damage including variations and random values that can be attributed to power levels and the like. And only after that, it then checks to see if the one being struck is 'guarding/defending'. And if the target is defending itself, the calculated damage is cut in half.
HOWEVER... RPGMaker XP's item damage, and only RPGMaker XP's item damage, is wholly different. It calculates the basic damage that is generated by the item and then looks to see if the target is guarding/defending. But after it checks to see if the target is defending and subsequently halves the damage, it will then apply the additional random damage attributes. The bonus values given to item damage or recovery is not halved like the rest of the content.
With RPGMaker's engines after XP, this is not the case. All variants are calculated before checking to see if the victim is defending, this for all battler attack actions from RPGMaker VX on up. And this, even for the python-driven versions such as RPGMaker MV as shown below:
Game_Action.prototype.makeDamageValue = function(target, critical) {
var item = this.item();
var baseValue = this.evalDamageFormula(target);
var 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;
};
Weird, eh? And nope, I don't have MV. I just have the scripts database for examination. I'm dangerous that way.
If I do decide to release an XP-like replacement of default scripts (sorta like the RMXP SDK on steroids), this would be a clear correction.