- Joined
- Dec 6, 2015
- Messages
- 211
- Reaction score
- 336
- First Language
- English
- Primarily Uses
- RMVXA
I'm trying to do the following:
PDEF and MDEF can only max out at 85 and they decrease damage by a percentage rather the default direct subtraction.
STR partially ignores armor (is currently 20% of your Str)
Physical and Magical defense does not affect healing spells
For some reason, I keep getting 0 as final damage even if I max all stats to 999 and PDEF/MDEF at 0 while making all the "_f" at 100 (except pdef_f and mdef_f). Even when I changed "power / 25" to just "power," it still ended up being 0. Can someone help me because I've been editing the damage formula, and its been a nightmare? I'm fine with someone re-editing this or just leading me to a whole new script that makes it easier.
The default damage formula is this:
This is what I have:
PDEF and MDEF can only max out at 85 and they decrease damage by a percentage rather the default direct subtraction.
STR partially ignores armor (is currently 20% of your Str)
Physical and Magical defense does not affect healing spells
For some reason, I keep getting 0 as final damage even if I max all stats to 999 and PDEF/MDEF at 0 while making all the "_f" at 100 (except pdef_f and mdef_f). Even when I changed "power / 25" to just "power," it still ended up being 0. Can someone help me because I've been editing the damage formula, and its been a nightmare? I'm fine with someone re-editing this or just leading me to a whole new script that makes it easier.
The default damage formula is this:
Code:
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = [power, 0].max
end
# Calculate rate
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# Calculate basic damage
self.damage = power * rate / 20
Code:
power = skill.power
#Damage spells
if skill.power > 1
rate = 25
rate += user.str * skill.str_f / 100
rate += user.dex * skill.dex_f / 100
rate += user.agi * skill.agi_f / 100
rate += user.int * skill.int_f / 100
rate += user.atk * skill.atk_f / 100
power *= rate
if self.pdef > 85
rate = self.pdef - 85
else
rate = 0
end
power *= (100 - (self.pdef - rate - user.str / 5)) / 100 * skill.pdef_f / 100
if self.mdef > 85
rate = self.mdef - 85
else
rate = 0
end
power *= (100 - (self.mdef - rate)) / 100 * skill.mdef_f / 100
self.damage = power / 25
end
#For healing
if skill.power <= 0
rate = 25
rate += user.str * skill.str_f / 100
rate += user.dex * skill.dex_f / 100
rate += user.agi * skill.agi_f / 100
rate += user.int * skill.int_f / 100
rate += user.atk * skill.atk_f / 100
power *= rate
self.damage = power / 25
end


