RMMV K-O state resistance not taken into account

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,969
Reaction score
845
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
126
Reaction score
68
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,052
Reaction score
1,481
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,969
Reaction score
845
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
126
Reaction score
68
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,969
Reaction score
845
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
126
Reaction score
68
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,052
Reaction score
1,481
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,969
Reaction score
845
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,969
Reaction score
845
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,052
Reaction score
1,481
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

Just finished composing a boss battle theme!
Scripted a multi-variable weather system that randomizes wind speed, cloudiness, rain, fogginess, etc, while attempting to realistically account for interactions between them (e.g. wind speed affects fogginess, cloudiness affects rain, etc), the current weather pattern, and the player's biome e.g. swamp, beach, etc. Now I "just" have to tie visuals and sounds to the variables so stuff actually happens...
I'm having a headache balancing the combat using flat defense so I'm gonna use percentual armor, in this pic, Simon has 16 on Defense which means all the incoming damage will be reduced by 16% this will ease my burden a bit.
!Have a nice day everybody¡
SO glad they patched outer worlds for switch! I can finally play it! Weird that other peeps are still having issues. I know it was really chugging on my lite when it first came out.

Forum statistics

Threads
105,557
Messages
1,014,640
Members
137,236
Latest member
Crowned_gaming_youtube
Top