Simple change to State Rates

jonthefox

Veteran
Veteran
Joined
Jan 3, 2015
Messages
1,436
Reaction score
596
Primarily Uses
I would like a simple change to the way the engine calculates state rates.   I would like the target's state resistance to be subtracted from the attacker's state chance.

For example, say a skill has 50% chance to stun.  If I have 50% stun resistance, I would like to never be stunned.  If I have 40% stun resistance, I would like the net chance for me to be stunned to be 10%.  

I would like this to be the case for all state resistance, regardless of whether it's coming from the "add state" feature on a skill, or the "attack state" property of an actor/class/enemy/equipment/item.

Thank you.
 

Heartbreak61

Wandering Noob
Veteran
Joined
Sep 5, 2012
Messages
187
Reaction score
90
First Language
Indonesian
Primarily Uses
RMMV
/*:


* @plugindesc Addition of state rate instead of multiplication


*/


(function($) {


$.prototype.itemEffectAddAttackState = function(target, effect) {


this.subject().attackStates().forEach(function(stateId) {


var chance = this.subject().attackStatesRate(stateId);


chance *= effect.value1;


chance -= target.stateRate(stateId);


chance *= this.lukEffectRate(target);


if (Math.random() < chance) {


target.addState(stateId);


this.makeSuccess(target);


}


}.bind(this), target);


};


$.prototype.itemEffectAddNormalState = function(target, effect) {


var chance = effect.value1;


if (!this.isCertainHit()) {


chance -= target.stateRate(effect.dataId);


chance *= this.lukEffectRate(target);


}


if (Math.random() < chance) {


target.addState(effect.dataId);


this.makeSuccess(target);


}


};


})(Game_Action);
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,456
Members
137,821
Latest member
Capterson
Top