Allow Luk to affect Skill Variance.

forteller

Veteran
Veteran
Joined
Dec 2, 2013
Messages
105
Reaction score
19
First Language
English
Primarily Uses
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 :o


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
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,533
Reaction score
12,057
First Language
English
Primarily Uses
RMMV
Hi, can you please reformat your post similar to others in this forum, and provide some examples of how the plugin should be used?
 

forteller

Veteran
Veteran
Joined
Dec 2, 2013
Messages
105
Reaction score
19
First Language
English
Primarily Uses
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
 

forteller

Veteran
Veteran
Joined
Dec 2, 2013
Messages
105
Reaction score
19
First Language
English
Primarily Uses
how to put code in spoiler plz?
 

forteller

Veteran
Veteran
Joined
Dec 2, 2013
Messages
105
Reaction score
19
First Language
English
Primarily Uses
thxs now i just have to figure it out lol
 

NeoPGX

~ King of Cuteness ~
Veteran
Joined
May 15, 2014
Messages
785
Reaction score
89
First Language
English (US)
Primarily Uses
N/A
Terms of use?
 

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
548
Reaction score
886
First Language
English
Primarily Uses
N/A
Fixed format. *credit "Forteller/Dark Confidant"
For details: https://forums.rpgmakerweb.com/index.php?threads/allow-luk-to-affect-skill-variance.53500/

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
 

Attachments

Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Been so busy lately that I wonder if I should slowly start preparing the advent calendar resources so I have enough in december.
Man, I wish it was harder for mean d-holes to make me feel like crying.
Made 8 games. Was aiming for 20. Gonna go for 40. Because 20 + 20. /Bed.
Got myself card game plugin, its bit laggy but worth it
Finally made battler stuff for my last character...

Forum statistics

Threads
94,535
Messages
921,706
Members
124,400
Latest member
Standanddeliver
Top