I decided to use yanflys lunatic mode to set a variable to set up cost = 100% -1.
Then set that to a variable I use in the damage formula.
Surprising number of yanflys script work.
<Before Eval>
if (this._recoveredMp === undefined) {
this._recoveredMp = Math.ceil(user.hp * 0.25);
}
</Before Eval>
<After Eval>
user.setHp(user.hp - this._recoveredMp);
target.startAnimation(x);
target.gainMp(this._recoveredMp);
target.startDamagePopup();
target.clearResult();
</After Eval>
<Damage Formula>
value = a.atk * (100.0/(100.0 + b.def));
if(a.isActor() && [6,7,8].some(function(e){return a.hasWeapon($dataWeapons[e])})){
value = 1000;
}
</Damage Formula>
Thanks again for the help, the skill now seems to be working in the manner that I intended it to.
<Damage Formula>
value = a.atk * (100.0/(100.0 + b.def));
var WpnType = x;
if(user.isActor() && user.isWtypeEquipped(WpnType)){
value = 1000;
}
</Damage Formula>
<Damage Formula>
value = a.atk * 4 - b.def * 2;
value *= 2 - user.hpRate();
value = Math.ceil(value);
</Damage Formula>
Actually, this is exactly what I was looking for. I didn't actually intend for a 1:1 recreation of the Frog Squash tech, I just wanted a skill that functioned in a somewhat similar manner. Thanks again for the help!
<Damage Formula>
value = <default formula>;
var meeleWpns = [1, 2, 3];
var rangedWpns = [4, 5, 6];
if(user.isActor() && meeleWpns.some(function(e){return user.isWtypeEquipped(e)})){
value = <Meele formula>;
} else if (user.isActor() && rangedWpns.some(function(e){return user.isWtypeEquipped(e)})){
value = <Ranged formula>;
}
</Damage Formula>
b.mhp - ((b.level - 1) * (0.05 * b.mhp))
<Damage Formula>
var dmg = user.atk * 4 - target.def * 2;
var totalEnemies = target.friendsUnit().aliveMembers().length;
value = dmg * totalEnemies ;
</Damage Formula>
c = Math.randomInt(6)+1; c === 1 ? 1 + a.atk - b.def : c === 6 ? b.addState(10); a.atk * 6 - b.def * 2 : a.atk * 4 - b.def * 2
b.addState(10); a.atk * 6 - b.def * 2
var rnd = Math.floor(Math.random() * 6) + 1;(rnd == 1) ? 1 + a.atk - b.def : (rnd == 6) ? (b.addState(10), a.atk * 6 - b.def * 2) : a.atk * 4 - b.def * 2;
Original thread: https://forums.rpgmakerweb.com/threads/rmmv-damage-formula-ideas-and-help.47099/