As far as dealing more damage the lower your hp is
a.maxHp - a.hp
But this the literal number of hit points missing, so at low level it's very weak, instead
(a.maxHp - a.hp)/a.maxHp
This turns it into a percentage value (between 0 and 1~) if you use this and multiply the number (eg. 0.5*4=2) then multiply it by attack you have a simple system, though I'm sure if as a buff this is the best measure, but it should help
i dont want my crits to be a flat 3x more dmg though, i want them to be 1.5x, but i would like to up the multiplier to a max of 3 based on luck
would this formula work?
value *= (1.5 + Math.min(1.5, user.luk/(target.luk*3))) + bonus;
just leave the flat bonus formula blank so only the multiplier counts, or would that mess up the plugin? and is "target.luk" even a plausible thing in formulas for RMMV? lol
In the Yanfly code, yes target.luk is a thing
so then that formula of mine could work in making the crit dmg multiplier grow the more luck you have over your foe?
yes it would work in that sense.... so long as at one point your luck score goes above 3x enemy luck.....it would be better done as user.luk (or a.luk if your worried) / target.luk (or if your worried b.luk) this way the boost is more reasonable.... also you want to keep + bonus at the end if you plan on making gear or skills or states that buff the crit damage multiplier
an even better formula would be for it (1.5 + (1 + (user.luk - target.luk) / 100)) + bonus
in my formula, if the user luk is 3x enemy luck, then it would just add +1 to the multiplier wouldn't it? for a total of 2.5x crit dmg?
cause 300 luk vs 100 luk in my formula would = 1 ?
cause i want it to be somewhat hard to get the crit dmg bonus, cause to me, 1.5x multiplier is pretty good, so getting even higher, i want them to really work for it, but not get to a point where it doesnt matter what they are against, they have max crit dmg, hence why i want the enemy to have a factor in the formula, so it isnt just as simple as "oh i have 500 luk, so now i always do 3x crit dmg no matter what!" lol
i also want a reason to use some of my skills that boost the luk stat, hence why i went with "target.luk*3" so on even ground, you can get about, +0.3 to the multiplier, but once you start stacking on luck bonuses and buffs and luck boosting states, you feel like all that luck boosting wasnt pointless cause now yo ucan visibly see that your crits are doing much better
Math.max() returns the highest number
eg. Math.max(10, 15, 25, 100) will return 100
It does not limit the highest number allowed
so i want math.min then
cause i want the default crit multiplier to be 1.5, but can go no higher than 3 with enough luck
value *= (1.5 + Math.min(1.5, user.luk/(target.luk*3))) + bonus;
that's what my formula for the crit dmg multiplier is right now, does that look right? or do i have unneeded parenthasis somewhere? lol
that should be fine
the max with this would be
value *= 3 + bonus //since 1.5 + 1.5 = 3
remember, value is the raw damage from your attack formula, '*=' means its equal itself times whatever is on the right hand side
i have so much to learn of how things like that in variables work, but thank you guys for helping me figure it out slowly, my game is coming along more and more nicely thanks to all your help ^-^