No matter how much PDEF or MDEF you have, I never want the player to take 0 damage. I want the minimum set to 1. I found a script but it was for Ace, not XP.
How to make minimum damage you take set to 1 (not 0) in RMXP?
RGSS Script RequestsEDIT
Misread the post, thought you wanted it for Ace, so gave a totally useless answer. Sorry about that.
Misread the post, thought you wanted it for Ace, so gave a totally useless answer. Sorry about that.
Anyone else?
In Game_Battler 3
Find:
"atk = [attacker.atk - self.pdef / 2, 0].max"
Replace with:
"atk = [attacker.atk - self.pdef / 2, 1].max"
Another way if you'd like the minimum damage to be one (as an end result of the full formula):
Find:
# Calculate basic damage
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
# Element correction
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
# If damage value is strictly positive
Replace with:
# Calculate basic damage
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
# Element correction
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
if self.damage == 0
self.damage = 1
end
# If damage value is strictly positive
Find:
"atk = [attacker.atk - self.pdef / 2, 0].max"
Replace with:
"atk = [attacker.atk - self.pdef / 2, 1].max"
Another way if you'd like the minimum damage to be one (as an end result of the full formula):
Find:
# Calculate basic damage
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
# Element correction
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
# If damage value is strictly positive
Replace with:
# Calculate basic damage
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk * (20 + attacker.str) / 20
# Element correction
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
if self.damage == 0
self.damage = 1
end
# If damage value is strictly positive
Thanks! This didn't work at first, but it was because I'm using an ABS script, so I had to find the new damage formula and add:
if self.damage == 0
self.damage = 1
end
Thanks for the help.
if self.damage == 0
self.damage = 1
end
Thanks for the help.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-minimum-damage-you-take-set-to-1-not-0-in-rmxp.35475/