Okay, then you can just reference the weapon's ATK by itself.
Code:
a.weapons()[0].params[2]
If there's a possibility of your actors being unarmed, put a check in there for it:
Code:
(a.weapons()[0] ? a.weapons()[0].params[2] : 0)
Okay, then you can just reference the weapon's ATK by itself.
a.weapons()[0].params[2]
(a.weapons()[0] ? a.weapons()[0].params[2] : 0)
For anyone following along, RPGM MV assumes the percentage will be 100% by default, so I had to do
(100 * a.elementRate(2) - 100) to make it work. Relevant because I'm also including a disarming mechanic by sealing a character's weapon for the battle... although the fact that enemies can't equip weapons probably means I'll be modifying this later anyway. But at least it works on the player characters.\Thank you! The one issue with this is that I don't want weapons also adding to ATK. Which is easily solved in formula by subtracting the weapon's ATK from the character's ATK. But would still display the combined ATK on the menu. (Haven't even looked at those while I'm learning.)
So, if you want Atk, Mat, Def, and MDf to all contribute to the same formula, the results of the individual brackets aren't actually going to matter if the numbers don't change. You could easily do (Atk+Mat) - (Def+Mdf) and still get the same result, assuming that the numbers being added and subtracted are always the same.
Normally, when the result is a negative, it should not do any damage. However, if you want to make sure the minimum is 0, or any other number, you can use:
Math.max(0, X)
Everything you need is explained in this thread:
forums.rpgmakerweb.com
There has to be a simpler way to do this without a plugin. It's a single skill for one of my characters and no one else, including enemies.
...then you use the information in the thread I already linked to you?
To get a portion of a number you can either divide it by another number (fractions) or multiply by a decimal.
The same math applies.
Math.round(b.tp*.5)So you would not use the Disperse Damage tag on the skill. Instead, give it the Yanfly Skill Core notetag:
<Pre-Damage Eval>
if (BattleManager._targets.length>1)
value/=2;
</Pre-Damage Eval>
the 5 is the engine not rounding. youll have to use Math.ceil() or some other rounding function to get rid of decimal results
value = Math.ceil(value/2);
Original thread: https://forums.rpgmakerweb.com/threads/rmmv-damage-formula-ideas-and-help.47099/