Yanfly's Hit Accuracy (YEP)

Rigor Mortex

Mankind's Mirror
Veteran
Joined
Mar 14, 2012
Messages
65
Reaction score
4
First Language
English
Primarily Uses
http://www.yanfly.moe/wiki/Hit_Accuracy_(YEP)
The plugin works as intended (as far as I can tell, anyway), other than the issue this thread is about. If a skill has a chance to inflict a State, and that skill's Hit Type is set to "Certain Hit," it will ignore any State Rate the target has (even 0%) to always inflict it; the only exception is if the target has the State Resist trait (e.g. State Resist - Poison). While a simple enough workaround would be to set State Resist where desired, doing this for Knockout causes them to become immortal due to how MV functions. As I am not a programmer, does anyone else know how to fix this? I have tested both with all my other plugins and without, and can confirm that Hit Accuracy itself is at fault.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,088
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
The default behaviour for Certain Hit skills is to ignore the target's state rate and the mutual "luck effect". Supporting excerpt from base code:
Code:
Game_Action.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);
    }
};
Yanfly's Hit Accuracy plugin is quite simple and does not change anything with regards to states. Maybe you have an error of some kind in one of your hit rate formulae?
 

Rigor Mortex

Mankind's Mirror
Veteran
Joined
Mar 14, 2012
Messages
65
Reaction score
4
First Language
English
Primarily Uses
The hit formulae in the plugin are unchanged from the default. Turning every plugin off and doing a test battle, I can confirm that a Certain Hit skill will still ignore State Rate. That is incredibly unfortunate.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,088
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
You could try saving this as a .js file and importing as a plugin:
Code:
Game_Action.prototype.itemEffectAddNormalState = function(target, effect) {
    var chance = effect.value1;
    chance *= target.stateRate(effect.dataId);
    chance *= this.lukEffectRate(target);
    if (Math.random() < chance) {
        target.addState(effect.dataId);
        this.makeSuccess(target);
    }
};
Basically, this just removes the "if not Certain Hit" part so that all states will check for the target's state rate. This is an override, so you may want to put it near the top of your Plugin Manager load order. I think that'll account for all "state add via skill" situations, but haven't tested. :kaoswt:
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
This is actually not a bug, as certain hit is meant to mean certain, as in, always works. That is why states ignore the resistance in that skill. The best way to fix it is to change your skill to a physical or magical skill instead.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top