RMMV K-O state resistance not taken into account

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,951
Reaction score
821
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
114
Reaction score
65
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
1,936
Reaction score
1,386
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,951
Reaction score
821
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
114
Reaction score
65
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,951
Reaction score
821
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
114
Reaction score
65
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
1,936
Reaction score
1,386
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,951
Reaction score
821
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,951
Reaction score
821
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
1,936
Reaction score
1,386
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 Profile Posts

This video really speaks to me...

Stream will be live shortly with a session of the interactive text adenture! Feel free to drop by!
I worked a lot more today and I am thinking about Youtube videos to make to my channel, but I am still looking for some content :D

But I am happy to be back at work :D
Update... no scam calls all day. I think they learned their lesson. And I'm working on a fake anti-piracy video, featuring a fan game I'm making in MV. If I had the permission to make the game a licensed game that I could sell (rather than having it totally free like fan games are required to be), I'd use a really cool anti-piracy screen...

Forum statistics

Threads
104,362
Messages
1,005,840
Members
135,878
Latest member
hjbkwjhef
Top