Allow Luk to affect Skill Variance.

Lucky_Variance 1.0
Forteller/Dark Confidant

Introduction

Hi Guys, this is my first plugin, its suppose to let you use luk(or any other param to alter the way variance works)

What it does is simply lets say your battler has 20 Luck and you want it so for every 5 luck to get +2% variance, then with a skill that has 20% variance you will usually do somewhere between -20% to +20%, now with this plugin it would be  -12%to +20% which would make you hit for more damage on average. Also if you want you can turn off the variance ceiling and allow luck to push beyond the variance cap then with the same stats as before you could have -12% to +28%.

Hopefully that all makes sense

Features

Alter the way variance is calculated based of batter params

Enforce a variance cap or allow the stat to override variance

Screenshots
None

How to Use
Its Plug and Play

although you cannot as of yet rename the file or it will break please be sure to name the plugin Lucky_Variance.js

Demo
Seems like overkill for this plugin
Script

[spoiler]  [/spoiler]

// ------------------------------------------------// Lucky_Variance.js// ------------------------------------------------/*:*Plug and PLay Install****Note do not rename file* @plugindesc Allow LUK to Affect and other Stats to effect variance of skills* @author Dark Condiant** @param Variance_Adjustment* @desc The amount added or subtracted from the variance% before applying it to damage default: (this.subject().luk/5)*2* @default (this.subject().luk/5)*2** @param Variance_Ceiling* @desc Allow Stat to increase damage beyond the variance %?* @default false*/var alias_Variance_Handler = Game_Action.prototype.applyVariance;Game_Action.prototype.applyVariance = function (damage, variance) { alias_Variance_Handler.call(damage, variance); var parameters = PluginManager.parameters('Lucky_Variance'); var Evaltool = eval(parameters['Variance_Adjustment'] || (this.subject().luk/5)*2); var noceiling = String(parameters['Variance_Ceiling'] || "false"); var varint = Math.randomInt(variance* 2); var finder = 0; if (varint <= (varint / 2)+1){ finder+=varint;} else { finder-=varint; finder+=variance; } finder += Evaltool; if(noceiling=="false"){ if(finder>variance) { finder=variance} } var fixer = finder / 100; var pumpfix = damage * fixer; var newdamage = damage ; damage += pumpfix; return damage;};
FAQ

Cant think of anything 😮


Credit and Thanks
Dark Confidant

Heartbreak61 -  for helping me fix my 1 major error

Author's Notes
Uhm Again hooray for me actually having something that work lol
Hi, can you please reformat your post similar to others in this forum, and provide some examples of how the plugin should be used?
Hi, can you please reformat your post similar to others in this forum, and provide some examples of how the plugin should be used?
i mostly fixed it i just dont know how to add spoiler tags
how to put code in spoiler plz?
Spoiler
STUFF GOES HERE
Like that ^
thxs now i just have to figure it out lol
Terms of use?
Fixed format. *credit "Forteller/Dark Confidant"
For details: https://forums.rpgmakerweb.com/index.php?threads/allow-luk-to-affect-skill-variance.53500/

Spoiler: Plugin
Code:
// ------------------------------------------------
// Lucky_Variance.js
// ------------------------------------------------
/*:
* Plug and Play Install
****Note do not rename file
* @plugindesc Allow LUK to Affect and other Stats to effect variance of skills
* @author Dark Condiant
*
* @param Variance_Adjustment
* @desc The amount added or subtracted from the variance% before applying it to damage default: (this.subject().luk/5)*2
* @default (this.subject().luk/5)*2
* @param Variance_Ceiling
* @desc Allow Stat to increase damage beyond the variance %?
* @default false
*/
var alias_Variance_Handler = Game_Action.prototype.applyVariance;
Game_Action.prototype.applyVariance = function(damage, variance) {
    alias_Variance_Handler.call(damage, variance);
    var parameters = PluginManager.parameters('Lucky_Variance');
    var Evaltool = eval(parameters['Variance_Adjustment'] || (this.subject().luk / 5) * 2);
    var noceiling = String(parameters['Variance_Ceiling'] || "false");
    var varint = Math.randomInt(variance * 2);
    var finder = 0;
    if (varint <= (varint / 2) + 1) {
        finder += varint;
    } else {
        finder -= varint;
        finder += variance;
    }
    finder += Evaltool;
    if (noceiling == "false") {
        if (finder > variance) {
            finder = variance
        }
    }
    var fixer = finder / 100;
    var pumpfix = damage * fixer;
    var newdamage = damage;
    damage += pumpfix;
    return damage;
};

dropbox link: https://www.dropbox.com/s/nni8pmtf6m4cyjp/Lucky_Variance.js?dl=1

Original thread: https://forums.rpgmakerweb.com/threads/allow-luk-to-affect-skill-variance.53500/