I want to set agility affect critical chance and dodge chance

RyanYe

RPG Game Lover
Veteran
Joined
Dec 31, 2020
Messages
77
Reaction score
11
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,366
Reaction score
1,777
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
77
Reaction score
11
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,366
Reaction score
1,777
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

Finally started working on Grim Trigger episode 2 today :LZScat: it's half comic/half visual novel!

GfY3Rwj.png
Is it interesting to get more backstory on villains? A key moment in their past, their childhood, or maybe something that shows they've always been that way? To see or not to see?
"Everything tastes like chicken until it's chicken, then it doesn't taste like chicken."
Context: chicken samosas do not taste like chicken. I thought it was veggie samosas.
Just another ordinary evening.
This pig girl is a merchant and playable character.
Currently there's no name for her yet. a suggestion is welcomed.
Merchant.jpg
Merchant-1.jpg
Want for a Nail: I'm trying to figure out what controllers work with MZ, one support thread, a plugin request thread, a dead controller, and a $48 eBay purchase, and a PS1/PS2 USB adapter later. Still stuck with keyboard controls...

Forum statistics

Threads
110,351
Messages
1,052,570
Members
143,393
Latest member
cobertk
Top