I need Certain hit not to ignore resistance.

DarkAdria

Villager
Member
Joined
Jul 29, 2020
Messages
22
Reaction score
1
First Language
Spanish
Primarily Uses
RMMV
Hi all.
I would like to make an inquiry, to see if anyone could help me.
I have created a skill that has Success: 50%.
This ability causes Death status 1000%. The idea is that this ability fails half of the time but, if it hits, it always causes Death.
Some enemies are "immune to Death", but if I put that parameter, when the enemy's life reaches 0 the enemy does not die, so I have put the estate resists Death *0.
The problem is that the ability is configured as Hit type: Certain hit, because the ability must not be countered by Magic reflection or Counter attack.
Do you know how I could configure it?
If there is no way ... do you know any plugin?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,225
Reaction score
13,771
First Language
English
Primarily Uses
RMVXA

I've moved this thread to MV support. Please be sure to post your threads in the correct forum next time. Thank you.

 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,712
Reaction score
1,162
First Language
EN
Primarily Uses
RMMV
Could you just have the skill's Add State effect chance be 50% instead? :)
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,321
Reaction score
1,204
First Language
English
Primarily Uses
RMMV
Not tested, but try adding this to a text file, rename it WhateverYouWant.js, and set it 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);
    }
};
Edit: Note that it'll make all certain hit effects require a state rate check.
 

Pako

Veteran
Veteran
Joined
Jun 20, 2019
Messages
51
Reaction score
15
First Language
English
Primarily Uses
RMMV
I have a similar skill in my game and what I did was that the skill would give 999999 damage and be of the "Death" element and set success rate to 50%. If I want a monster to not be affected by this, I just set its Status Resist to Death Element to 0
 

DarkAdria

Villager
Member
Joined
Jul 29, 2020
Messages
22
Reaction score
1
First Language
Spanish
Primarily Uses
RMMV
I've moved this thread to MV support. Please be sure to post your threads in the correct forum next time. Thank you.
Oh sorry! I thought I should put the post here.
Sorry.

Could you just have the skill's Add State effect chance be 50% instead? :)
I already thought about that, the problem is that if I put 50%, the luck stat influences too much and if the luck of the character is much higher than that of the enemy, it will no longer be 50%. I need that 50% to be fixed :/

I have a similar skill in my game and what I did was that the skill would give 999999 damage and be of the "Death" element and set success rate to 50%. If I want a monster to not be affected by this, I just set its Status Resist to Death Element to 0
I thought of this option as the only viable option if there was no other option, but I just don't want "999999" to appear on the screen.
I don't want it to do damage.
But if there is no other option, I will have to do this.

Not tested, but try adding this to a text file, rename it WhateverYouWant.js, and set it 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);
    }
};
Edit: Note that it'll make all certain hit effects require a state rate check.
I'm going to try to do this when I got home.
Please don't go too far, hahaha.
I have not understood your last sentence (the edit).
I'm not very good at speaking English, excuse me please.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
376
Reaction score
147
First Language
english
Primarily Uses
RMMV
make the 50% chance and state apply as damage formula while the skill itself is 100% invocation
Math.randomInt(100)+1 > 50 ? b.addstate(1) : 0;
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,712
Reaction score
1,162
First Language
EN
Primarily Uses
RMMV
I already thought about that, the problem is that if I put 50%, the luck stat influences too much and if the luck of the character is much higher than that of the enemy, it will no longer be 50%. I need that 50% to be fixed :/
Have you tested this? I'm pretty sure both the luck effect and the state rate are ignored for Certain Hit skills/items. Here's a supporting code excerpt (with comments by me):
JavaScript:
Game_Action.prototype.itemEffectAddNormalState = function(target, effect) {
    var chance = effect.value1;  // get add state chance
    if (!this.isCertainHit()) {  // if not certain hit
        chance *= target.stateRate(effect.dataId);  // apply state rate
        chance *= this.lukEffectRate(target);  // apply luck effect
    }
    if (Math.random() < chance) {  // roll against chance; if successful then
        target.addState(effect.dataId);  // add the state
        this.makeSuccess(target);  // show success message/refresh/etc
    }
};
:kaopride:

If you want to do this via the damage formula like Tiamat suggests, I'd recommend this formula instead:
JavaScript:
if (Math.random() < 0.5) b.addState(1); 0
I.e. "50% chance to add state 1 to the target; then do 0 damage". I think I'd personally prefer Pako's suggestion if doing this via damage formula, but that's up to you~ :kaothx:

If you want to avoid the "0" or "999999" damage popups (and for whatever reason can't or don't want to work with my original suggestion) then I think you'll need a plugin. You could check out Yanfly's Skill Core:
Amongst other things it offers an <After Eval> notetag, e.g.
Code:
<After Eval>
if (Math.random() < 0.5) {  // 50% chance to
  target.addState(1);  // add state 1 to target
}
</After Eval>
:)
Edit: oh wait I think I misunderstood what you're aiming for. :kaoback: Check Aesica's solution instead~
 
Last edited:

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,321
Reaction score
1,204
First Language
English
Primarily Uses
RMMV
I'm going to try to do this when I got home.
Please don't go too far, hahaha.
I have not understood your last sentence (the edit).
I'm not very good at speaking English, excuse me please.
I just mean that it will cause every certain hit ability to check resistances before applying states.

make the 50% chance and state apply as damage formula while the skill itself is 100% invocation
Math.randomInt(100)+1 > 50 ? b.addstate(1) : 0;
I think the OP wants it to take the target's death resistance into account, so if doing it via the damage formula, you'll want to do it this way instead:

Code:
Math.random() < b.stateRate(1) * 0.5 ? b.hp : 0
Set damage variance to 0

Now, if you use Yanfly's action sequences, I can write up a quick one for you that checks resistances properly and will kill the enemy without any tacky damage popups. Looks a lot more professional that way.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
376
Reaction score
147
First Language
english
Primarily Uses
RMMV
honestly i dont think there is even a need for anything fancy here.
50% invocation, certain hit with normal effects: add state 1
and state rate(not state resist) on mobs cant instant kill works completely as intended.

50% success rate on normal mobs. and other mobs can only be killed from having 0 HP


edit: nvm. all mine like this are physical/magical not certain. just played with it.
if you just happen to be using yanfly counter control plugin already though there is <cannot counter> tags

edit2: b.stateRate(1) > 0 ? b.die() : 0;
this will make certain hit skills fail if the state rate is 0% yet can still kill if there is so much as 1% chance that enemy can be effected by instant death skills
 
Last edited:

DarkAdria

Villager
Member
Joined
Jul 29, 2020
Messages
22
Reaction score
1
First Language
Spanish
Primarily Uses
RMMV
Not tested, but try adding this to a text file, rename it WhateverYouWant.js, and set it 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);
    }
};
Edit: Note that it'll make all certain hit effects require a state rate check.
Hello again.
I have created the .js with the text that you have given me above.
Now happens that when doing the (Certain hit) ability, it never causes the Death state, whether the enemy has state rate *0% or not.
I attach a video of how the ability currently works and I attach an image so you can see how I have the ability configured.

Video:
 

Attachments

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,321
Reaction score
1,204
First Language
English
Primarily Uses
RMMV
Oh, that's odd. Anyway since I see you have action sequences, just get rid of that thing I suggested from earlier, then if you want, paste your entire action sequence here and I can add some stuff that'll make the kills look nice and clean.
 

DarkAdria

Villager
Member
Joined
Jul 29, 2020
Messages
22
Reaction score
1
First Language
Spanish
Primarily Uses
RMMV
Oh, that's odd. Anyway since I see you have action sequences, just get rid of that thing I suggested from earlier, then if you want, paste your entire action sequence here and I can add some stuff that'll make the kills look nice and clean.
OK.
Here is the Notes sequence.
<Whole Action>

wait: 30

opacity user: 100%, 1

float user: 0, 20

wait: 10

animation 161: targets

shake screen: 5, 5, 5

wait: 50

animation 25: targets

wait for animation

action effect

</Whole Action>

// Target: Ensure nothing happens.

<Target Action>

</Target Action>



// Follow: Reset everything.

<Follow Action>

wait for movement

</Follow Action>

I'm not sure if I have expressed well about how I want the skill to work ... I'm horrible with languages >.<

The idea is that the skill fails 50% of the time, but if it hits (the other half of the time) it causes the Death state to the enemies.
However, certain enemies (bosses) are immune to death status, which means that this skill will not affect them.
If I add state resist Death to bosses, when their life drops to 0, they will still be alive, so my only option is to put them state rate Death * 0%.
If the ability were (in Hit Type) Physical Attack or Magic Attack, the bosses would resist the Death state.
But if the ability was Physical Attack or Magic Attack, it could be countered by counterattack or magic reflex (Ex-parameters) and I don't want that to happen, so the ability is Certain Hit.
But Certain Hit ignores state rate and kills bosses :/

If I put Success 50% instead of 100% and in Effects I put Add State Death 50%, then the character's (and the enemy's) Luck stat will influence and if it is too high it will cause the Death state too many times. And if the Luck stat is too low, it will cause the Death state a few times. And I do not want that.


Thank you very much for your help. You are all great^^
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,321
Reaction score
1,204
First Language
English
Primarily Uses
RMMV
Okay, try this:

Code:
<Whole Action>
wait: 30
opacity user: 100%, 1
float user: 0, 20
wait: 10
animation 161: targets
shake screen: 5, 5, 5
wait: 50
animation 25: targets
wait for animation
</Whole Action>

// Target: Execute the effect on a per-target basis after checking their resistance to death
<Target Action>
if (Math.random() < target.stateRate(1) * 0.5)
  action effect: target
end
</Target Action>

// Follow: Reset everything.
<Follow Action>
wait for movement
</Follow Action>
Try that out. Note that I moved the action effect to target action so we can perform conditional checks on each target vs their resistance. Set the state effect to apply death 100% of the time. Since the 50% chance is done in the action sequence, It should 1. ignore luck entirely and 2. have a 50% chance, modified by the target's death resistance, to inflict death per target.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
376
Reaction score
147
First Language
english
Primarily Uses
RMMV
damage formula
b.stateRate(1) > 0 ? b.die() : 0;
this will make certain hit skills fail if the state rate is 0% yet can still kill if there is so much as 1% chance that enemy can be effected by instant death skills
 

DarkAdria

Villager
Member
Joined
Jul 29, 2020
Messages
22
Reaction score
1
First Language
Spanish
Primarily Uses
RMMV
Okay, try this:

Code:
<Whole Action>
wait: 30
opacity user: 100%, 1
float user: 0, 20
wait: 10
animation 161: targets
shake screen: 5, 5, 5
wait: 50
animation 25: targets
wait for animation
</Whole Action>

// Target: Execute the effect on a per-target basis after checking their resistance to death
<Target Action>
if (Math.random() < target.stateRate(1) * 0.5)
  action effect: target
end
</Target Action>

// Follow: Reset everything.
<Follow Action>
wait for movement
</Follow Action>
Try that out. Note that I moved the action effect to target action so we can perform conditional checks on each target vs their resistance. Set the state effect to apply death 100% of the time. Since the 50% chance is done in the action sequence, It should 1. ignore luck entirely and 2. have a 50% chance, modified by the target's death resistance, to inflict death per target.
OMG! I LOVE YOU. Works!

I tried the code as you told me, but some enemies died even if they dodged the attack. Other enemies (not bosses) resisted although the attack hit them.
I have tried to change this: if (Math.random () <target.stateRate (1) * 0.5)
for this: if (Math.random () <target.stateRate (1) * 1)
and works!!!

In the end, I left the skill configured like this:
Sin título.png

Enemies now die when the skill hits them, and survive when the skill fails.

In bosses, skill never kills.

I LOVE YOU!

The problem is solved and this topic can be closed.

Please, I would be grateful if you had time to see this topic: https://forums.rpgmakerweb.com/index.php?threads/problem-with-jump-atb.124671/
I'm having trouble with another skill and maybe you know how to fix it.

I am infinitely grateful to you.

I love you all.
 
Last edited:

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,321
Reaction score
1,204
First Language
English
Primarily Uses
RMMV
OOH! I somehow misunderstood that you wanted the skill to have a 50% chance to fail outright. Yeah, that change you made is ideal then. Glad you got it working. :)
 

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

Latest Threads

Latest Profile Posts

Currently without internet due to storm damage and most of our state is devastated. No idea how long I'll be unable to log onto here, but I'll answer questions as soon as I can.
This is supposed to be pso2 photon blast inspired animation
I'm sure this question's been asked before, but I can't find an answer: is there any way to run the Steam version of RPGMaker *without* being logged into Steam? It's a frustrating extra step sometimes.
Been seeing bright flashes in the sky for a while, and thought it was my eyes playing tricks on me. Nope! Lightning. Now it's raining heavily. Seeing lightning, but not hearing thunder, is weird.
Small Update for myself:
>Two Dungeon maps are done, Dungeon 3 is in progress. Dungeon 4 needs work.
>4 characters set up out of a possible 6 but those come later.
>Hub area needs work.
>Game completion..., 20-25% maybe?

Forum statistics

Threads
100,713
Messages
978,663
Members
132,327
Latest member
Devaks21
Top