RMMV K-O state resistance not taken into account

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
I'm using a lot of YEP's plugins.
While other states (such as poisoned) seem to be taken into account, K-O resistance is not.
If I put 0% the enemy can still be insta-killed by a skill using, for instance, Add State K-O 100% (or even 90%).
I tried to see if 0% was the problem so I put 1% instead but I still got the insta-kill each time.
Basically it seems only the spell effect matters (ie Add State xx%), the enemy resistance is completely overlooked... which is extremely bad.
What's happening there? Any clue why the K-O state isn't behaving properly? Is it a glitch in YEP's plugins?
 

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
132
Reaction score
73
First Language
French
Primarily Uses
RMMV
Does the skill that shouldn't kill also deal damage?
The way the engine processes units reaching 0 HP is by a good old target.addState(1) which applies the state as long as the target doesn't have a state immunity, disregarding reduced state rates.
What happens if you replace the state rate of 0% by a state immunity?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,091
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
Not sure about what effect Yanfly's plugins might have, but by default there are two types of traits for "state resistance":
  • State Rate:
    • Multiplies the state apply chance.
    • Ignored by skills of Certain Hit type.
    • Does not affect states already present on the bearer.
  • State Resist:
    • Makes it impossible for the state to exist on the bearer.
    • Removes the state (if present) when the State Resist trait is added to the bearer.
It sounds like you'd want a State Resist trait here.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
@caethyril
It sounds like you'd want a State Resist trait here.


Felt the same as you.
Yet, this makes the monster invincible. Reaches 0HP, doesn't die. Not good.

What happens if you replace the state rate of 0% by a state immunity?

See above.

EDIT:
That said, do you mean to say by this:
"Ignored by skills of Certain Hit type. "
that the monster resistance is no longer taken into account? If so, then this is totally the issue.
 
Last edited:

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
132
Reaction score
73
First Language
French
Primarily Uses
RMMV
Then maybe a passive state on it that gives the state immunity would work. In the condition for this passive to stop working (so the statement that sets condition to false), put in how you want the enemy to lose its immunity to death.

Note: From a game dev to another, make sure there's clarity in the method to remove the immortality.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
@caethyril
You were right, this is because of CERTAIN HIT.
At this point I wonder if there could be a quick fix to just remove whatever line makes CERTAIN HIT skills bypass the enemy state resistance. Is it also the same with attributes (fire, ice etc)?
I don't particularly like this take on CERTAIN HIT to be honest.
@CHKNRAVE
Or changing the skill to "magic" instead. Adding a passive state seems to complicate things IMO. I just wish certain hit skills wouldn't bypass enemy resistances.
 

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
132
Reaction score
73
First Language
French
Primarily Uses
RMMV
Oh, of course, I completely overlooked that. Certain hit skills do always land, their states as well.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,091
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
At this point I wonder if there could be a quick fix to just remove whatever line makes CERTAIN HIT skills bypass the enemy state resistance. Is it also the same with attributes (fire, ice etc)?
You can save this as a .js file (copy into a text-editor, Save As > File Type: All Files, Filename: whatever.js) and import it as a plugin:
JavaScript:
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);
    }
};
This is just the default method with the Certain Hit check removed. :)

Certain Hit just makes the skill and its states always apply, it doesn't affect skill damage/elements/etc.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
It seems to me that it worked. Thank you, you're a lifesaver. <3
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
@caethyril
Just a question: how hard would it be to make certain hit skills be affected by PDR and MDR?
I don't know if I'm such a fan of them NOT being affected by that too.
I mean, to me certain hit always meant you would never miss no matter CNT, MEV or MRF of the opponent. It wasn't really about immune to everything. Just my 2 cents anyway.
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,091
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
I think the developers designed Certain Hit for ally-related skills, but I agree that it does seem to cause a lot of confusion! :kaoswt2:

By default a skill's hit type is what determines whether a it is physical, magical, or "other" (i.e. Certain Hit). This is used to decide what damage reduction to apply: PDR, MDR, or none. How would you determine which damage reduction to apply to which skills?

Instead, I'd suggest including the damage resist in the skill's formula, e.g.
Code:
Math.round((a.atk * 4 - b.def * 2) * b.pdr)
Math.round just rounds to the nearest integer. :)

[Edit: oops, PDR/MDR are damage rates, not resistances.
Corrected * (1 - b.pdr) in above example to * b.pdr. :kaoslp:]
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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.

Forum statistics

Threads
105,868
Messages
1,017,088
Members
137,585
Latest member
Reversinator
Top