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
39,144
Reaction score
12,418
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
605
Reaction score
1,007
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 Profile Posts

On the plus side, if all this rioting sparks another Covid outbreak... I will have a whole lot of time to work on my game. Not exactly how I wanted to get that time, but hey I'm a glass is half full... of RM kind of guy. :LZSwink:
A video once in a while won't hurt.
Have a craving for a Nesquik milkshake. No idea why. Haven't had one since I was a kid. lol. I remember them kinda tasting nice, but also leaving a lot of nasty powder at the bottom of the cup.
The more I think about it, the weirdest part of going to work post-virus will probably be getting used to seeing my coworkers' mouths again. :LZYshock:
I think one of my weirdest realizations is that my speed of game development would probably be about the same if I *didn't* work a full-time manual labor job.

Forum statistics

Threads
98,061
Messages
948,981
Members
129,340
Latest member
guangdi
Top