Can you set a minimum damage using percent? If for example I don't want "No Damage" being the result from a large increase between defense and offense. Can it be done?
Setting a minimum damage using percentages.
RPG Maker VXAce SupportKread-EX wrote this little code:
class RPG::UsableItem:😀amage alias_method🙂krx_one_ruid_eval, :eval) def eval(a, b, v) damage = krx_one_ruid_eval(a, b, v) damage = 1 if damage == 0 && sign == 1 damage endendShould work. And credit Kread-EX
It will set anything that does no damage to 1 damage.
class RPG::UsableItem:😀amage alias_method🙂krx_one_ruid_eval, :eval) def eval(a, b, v) damage = krx_one_ruid_eval(a, b, v) damage = 1 if damage == 0 && sign == 1 damage endendShould work. And credit Kread-EX
It will set anything that does no damage to 1 damage.
damage = [a.atk * 4 - b.def * 2, x].max
Where "x" = the minimum damage you want that attack to ever do.
This can be useful for attacks that you want to do a minimum amount of damage, no matter what the enemy defense is.
For example: An attack that will NEVER do less than 100 damage:
damage = [a.atk * 4 - b.def * 2, 100].max
Where "x" = the minimum damage you want that attack to ever do.
This can be useful for attacks that you want to do a minimum amount of damage, no matter what the enemy defense is.
For example: An attack that will NEVER do less than 100 damage:
damage = [a.atk * 4 - b.def * 2, 100].max
Well there goes two things I learned. Thanks. I'll take the script and note the formula trick.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/setting-a-minimum-damage-using-percentages.27240/