I want to set agility affect critical chance and dodge chance

RyanYe

RPG Game Lover
Veteran
Joined
Dec 31, 2020
Messages
81
Reaction score
12
First Language
English
Primarily Uses
RMMV
Ahhh i am so dumb, i have tried many ways but all have failed!
I don't know how to do this, so I want to ask how to:

1, set Crit.Chance+ = (a.agility - b.agility)*0.1

2, set Dodge.Chance+ =(a.agility - b.agility)*0.05

help!
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,374
Reaction score
1,781
First Language
EN
Primarily Uses
RMMZ
You'll need a plugin that changes how the crit/evasion chances are calculated. This might work:
JavaScript:
/*:
 * @plugindesc Changes action crit/eva formulae.
 * @author Caethyril
 * @help Free to use and modify.
 */

(function(alias) {
  Game_Action.prototype.itemCri = function(target) {
    return alias.apply(this, arguments) + (this.subject().agi - target.agi) * 0.1;
  };
})(Game_Action.prototype.itemCri);

(function(alias) {
  Game_Action.prototype.itemEva = function(target) {
    return alias.apply(this, arguments) + (this.subject().agi - target.agi) * 0.05;
  };
})(Game_Action.prototype.itemEva);
To use it:
  1. Copy the code into a text editor (e.g. Notepad);
  2. Save as a .js file (Save As > File Type: All Files, Filename: whatever.js);
  3. Import into your project as a plugin, via Tools > Plugin Manager;
  4. Save your project to apply plugin changes;
  5. Test! :kaohi:
 

RyanYe

RPG Game Lover
Veteran
Joined
Dec 31, 2020
Messages
81
Reaction score
12
First Language
English
Primarily Uses
RMMV
thank you! It works!
After some test, i can see my formula is super imba, but i can change it from here!

(function(alias) {
Game_Action.prototype.itemCri = function(target) {
return alias.apply(this, arguments) + (this.subject().agi - target.agi) * 0.001;
};
})(Game_Action.prototype.itemCri);

(function(alias) {
Game_Action.prototype.itemEva = function(target) {
return alias.apply(this, arguments) - (this.subject().agi - target.agi) * 0.0005;
};
})(Game_Action.prototype.itemEva);

I have changed the parameter for balancing purpose
and i have changed the "+"/"-" for the dodge chance, because i had mistaken that as "HitChance" in my requirement post.

cheers!!
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,374
Reaction score
1,781
First Language
EN
Primarily Uses
RMMZ
You're welcome! If you wanted to change the hit formula instead of the eva formula, replace itemEva with itemHit. (Or make a third block for that one if you want to change both.)

Happy RPG Making~ :kaojoy:
 

Latest Threads

Latest Posts

Latest Profile Posts

Yay, our new game, Causality is finally released on Steam!
A good way to practice writing is to write "flash fiction"; very short stories. Link
[CM]
5VaUMjAFpz1I6fSsgDrfJc.jpg

Title is star.
Dam, does the night get to me, I sound and look like a monster. Its 3:54 am right now...I need sleep...or...coffee.

Forum statistics

Threads
110,488
Messages
1,053,675
Members
143,582
Latest member
beru
Top