Ratio in skill description

Hello,

In League Of Legends, each skill deals damage according to a ratio of one of your stat : your Ability Power ("Magic Attack"), your Attack Damage ("Physical Attack"), your Armor, your HP etc., plus a fixed base damage.

Some examples :

Base damage

Ratio

-Annie's Disintegrate deals up to [220 + (80% AP)] magic damage to her target.

-Malphite's Ground Slam deals up to [220 + (30% Armor) + (20% AP)] magic damage to his target.

-Sion's Soul Furnace can shiel him up to [130 + (40% AP) + (10% Max HP)]

Is there a way to show the formula, as it appears in game ?

22abc9ce30.jpg


I usually create a common event where I proceed like this :

Variable 001 (0.8 AP Annie) -> 8*Annie's APVariable 001 (0.8 AP Annie) -> /10Then I just use the \V[n] code in the description's message to show the ratio. But it's boring process, and it doesn't refresh the ratio is I buff myself in battle.

So can someone write a plugin to draw this kind of formula in skill description ? Would be awesome 🙂

Thanks a lot.
bump
I would be interested in this functionality as well.  I think the most efficient/best way to accomplish it would be to allow escape codes in the skill description that can pull the actor who own's the skills variables (a.mhp, a.atk, etc.) into a formula.  Usage maybe like below:

Deals 80 (+\formula[(a.atk)]) damage.  

So if a.atk is 15 it would show  Deals 80 (+15) damage.
Hey ♫

I took Nohmaan's suggestion and put this together! As always, instructions in the help box!

Spoiler
Code:
/*=======================================TextFormula.js=======================================  /*: * @plugindesc TextFormula * @author Kaimonkey  * @help  * ============================================================================ * Terms and Conditions * ============================================================================  * The plug in may only be used for NONCOMMERCIAL projects. If you wish to * use this plug in in a commercial product, please contact Kaimonkey for a  * licience * * While reasonable effort will be made to fix any faults in the product, the  * product comes "as is", and Kaimonkey is under no legal obligation to do so.    * ============================================================================ * Intro * ============================================================================ * Use the escape code \aform to activate the "actor" formula, for example using * \aform["a.atk * 2 + 10"]   * In a skill's description will show you double the user's attack + 10. * Using the escape code in times were the user isn't clear (Such as in a  * normal message box, or from a store) will result in the leader being * used instead. *  * Use the escape code \form to activate the standard formula, for example * \form["v[1]*100 + 15"] * Will return the first variable, times by 100, added to 15! */ (function() { //Start Pluginvar _kmky_convertAlias = Window_Base.prototype.convertEscapeCharacters;Window_Base.prototype.convertEscapeCharacters = function(text) {   text = _kmky_convertAlias.call(this, text);   text = text.replace(/\x1baform\[".*?"\]/gi, function() {    if(SceneManager._scene.actor===undefined)        var a = $gameParty.leader();         else{    var a = SceneManager._scene.actor();   }         var form = arguments[0].split("[\"")[1].split("\"]")[0];         return eval(form);   }.bind(this));       text = text.replace(/\x1bform\[".*?"\]/gi, function() {     var v = $gameVariables._data;         var form = arguments[0].split("[\"")[1].split("\"]")[0];         return eval(form);   }.bind(this));   return text;}; })(); //Close Plugin
 

I hope it works for you, and help's to lighten you're work load!

 

/Kai
Awesome, dude ! Thanks a lot for this 🙂 But is it possible to round the result up ? I got a decimal...

If you can't there is no problem about it 🙂

PS : You should post it in the Plugin Release section if you didn't so far, would help a lot of people !

Love you !
Use 

\aform["Math.floor(a.atk/2)"]
Math.floor means "round down"
Thanks a lot 🙂
Kai Monkey, you are awesome!!!!!!

I was looking for this script! Thanks!

And thanks Luth for asking for it heheh
I found a bug... When I have 2 or more actors with the same skill, on the battle the formula just show the first actor damage.
Ah, yes, I realised this will not work in the battle menu, I will post a fix when I have time 
Ah, yes, I realised this will not work in the battle menu, I will post a fix when I have time 
Bump this x'D I hope you'll fix it soon 🙁
Something similar was discussed in this thread. Maybe try the code snippet from there in the meantime.

Original thread: https://forums.rpgmakerweb.com/threads/ratio-in-skill-description.51499/