I'm having trouble writing the damage formula I've decided on into MV.
Basically it works like this:
(a.X - b.def) * (a.Y / 2)
X is the total attack stat of the attacker, equipment bonus included,
while Y is the user's BASE attack stat, minus any bonuses granted by equipment.
How would one write this?
I am new to RPG MAKER MV and Javascript so I am not sure if this is a dumb question or not but how do you use an eval code? If so, how do I check if an actor is having a specific state? Like if they have a "poison" state then the attack will deal more damage?
I was trying to work on my damage formula so I set the Mdf of a enemy too 1 and my character has a magic stat of 70 or so but the spell will do 0 damage. It will start doing damage if I take off the mdf from the formula but I don't think it's supposed to work that way. Can anyone help with this.
OK, so if my current damage formula is impossible, then I'm gonna need help coming up with a replacement.
Therefore, I will list as much as I can about the stats in my game and the results I want out of them.
First, there's the average ATK stat the heroes will have at each level. At lv1, it's 40, and at lv50, it's 68. Not too drastic of an increase from 49 level-ups.
Second, there's the average DEF stat the enemies will have at each projected level. At lv1, it's 10, and at lv50, it's 38. Again, small numbers.
So, at lv1, you have (an average of) 40 ATK vs 10 DEF, and at lv50, you have 68 ATK vs 38 DEF.
Now, I'm trying to come up with a formula that will result in particular damage ranges at each of these levels. For level 1, I'd like the base damage (before variance) to be somewhere between 150-200. For level 50, somewhere between 550-750.
Any more experienced mathmeticians out there wanna solve this for me?
EDIT: I have discovered and perfected the perfect damage formula for my needs. Please disregard this post.
Let's say I have a skill where the formula is 100 + 50.
Without making a duplicate skill, is there a way to set it up so that if the person using the skill is an enemy, it becomes 100 - 50 instead?
I was using them as examples, yes. In reality, the numbers being used were really complicated formulas.
But someone else actually helped me to figure this out a moment ago. The solution is:
s = a.isEnemy() ? -1 : 1; 100 + (50 * s)
I'm running with: (a.atk * 2) - ((b.def / 2) + (b.agi / 4))
In the game Heavy armor has high Defense and negative agility and light armors have low defense and positive agility.
Seems okay so far.
How would one go around to setting up a basic attack, that does more damage based on how much HP the user has lost?