It skews the random distribution from uniform to binomial: extreme variance is less likely. E.g.
- 1 roll of 2~4 gives results: 2, 3, 4.
- 2 rolls of 1~2 gives results: 1 + 1 = 2, 1 + 2 = 3, 2 + 1 = 3, 2 + 2 = 4.
It skews the random distribution from uniform to binomial: extreme variance is less likely. E.g.
well, as far as I know you would need to use ternaries when dealing with the damage formula directly.
(formula to check) ? (if true) : (if false)<enemyType:bee>, then on the skill make it check for $dataEnemies[target._enemyId].meta.enemyType === "bee"[1, 2, 3].contains(target._enemyId)target.isEnemy(), unless you are certain it will be a player's only skill.No, any valid JavaScript code works, including regular if statements. In fact, you need to use if statements when there's going to be more than one command as a result. However:
That's invalid syntax. Your condition needs to be inside parentheses.
These are both good.
Really?
if (b.isActor()) { alert('actor target'); 50 } else { alert('enemy target'); 100 }It could be that you're remembering someone commenting about how if-else constructs behave a little strangely in an eval context. An eval returns the result of the last expression. If there is an if-else construct and no additional expression after it, then the expression returned is the last part of the branch that was taken. That also means that if there is no else branch, it returns null if the branch is not taken.
var x = 1; if(b.isActor()) { x = 2 }; x * a.atk doubles the damage if the enemy is an actor)I'm trying to find the earlier subject you're referencing and I'm not sure what your context of "this" is.
new Function vs eval.]"This" being the post right that was above my previous post. I'm sorry you missed it.
You can be snarky if you like, but the post above yours didn't talk about anything being warned against, so your question is still unclear.
You were snarky first sir, I only responded in kind.
Asking for clarification is not snark. If it were an honest question, you should've had no problem simply saying "I meant this."

You're getting 0 because isActor() is not a standalone function, and the one that exists on battlers doesn't take an argument. What you want is
a.isActor() && a.actorId() === 1 ? v[21] / 5 + a.atk + a.agi - b.def * 2 : a.atk + a.agi - b.def * 2
X * a.atk / b.def
X * a.mat / b.mdf
X * a.atk * a.agi / b.def / b.agi
So basically what you're doing is applying the percentage of difference between the relevant stats as a bonus/penalty to the damage. I know a few people who do this kind of thing, it's definitely a lot more interesting than dealing with flat values.
That is exactly what I am doing. 🙂 I see those stats as percentages.
Original thread: https://forums.rpgmakerweb.com/threads/rmmv-damage-formula-ideas-and-help.47099/