Remove state from an enemy during the turn of the enemy

Klunky2

Veteran
Veteran
Joined
Jul 2, 2017
Messages
118
Reaction score
4
First Language
german
Primarily Uses
RMMV
Ok this sounds kinda weird. I hope I can describe my problem as clear as possible.

I have a Spell: it's a fire shield. where the enemy gets damage when he attacks. I managed to implement it with a state, where the damage calculation is located.
Now my problem is there is a another spell which creates a state that protects enemies from physical hits. The state vanishes when the caster gets any kind of damage, this is implemented by the RPG-Maker MV standard function, which is applied for the example of the "sleeping" state as well.

There is one enemy in my game that uses the spell. A way to deal with him would be that you let him attack your fire shield. Now the problem is for some reason, the state won't go away although he takes damage. I assume it doesn't work when the enemy gets damage in his own turn at least it looks like that it doesn't count as "hit". Otherwise this works fine.

So what can I do now? I thought about removing the state of the enemy on the same site where the damage calculation for the fire shield state is located. This is made by a YanFly Plug-in: check this out for example:


I modified it but, I can't apply the remove state effect for some reason. How should it go? I can't use the same commands that I usually put in damage formulas, right?

Would be thankful for any help here.
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,226
Reaction score
603
First Language
English
Primarily Uses
RMMV
So the problem is that a player character has Fire shield state, an enemy has a state that protects it from physical damage for one hit, but when this enemy attacks the player with Fire shield while have the protective state on it, the protective state does not go away when the damage happens?

You may need to add an if/then statement within your <custom react effect> that checks if a the damage is a physical or magical attack.

//check to see if the damage is physical and it deal positive HP damage
if (this.isPhysical() && this.isHpEffect() && value > 0) {
//make the damage received zero
value = 0;
}

I'm not sure if you have the damage being dealt by the Fire shield set to either Physical, Magical, or Certain; but, if you set the damage, then maybe use the protective state to check if the damage if physical because it's supposed to only protect against a physical attack right?

edit: sorry if I did not clarify, but within the if/then statement you would need to change it how you see fit to dispose of the state, I only put up a portion to check the type of damage being dealt.

Hopefully this helps

edit 2: probably by way of user.removeState(x)

Am I close to what the problem is?
 

Klunky2

Veteran
Veteran
Joined
Jul 2, 2017
Messages
118
Reaction score
4
First Language
german
Primarily Uses
RMMV
Actually the state, will be lifted by any kind of damage it's just that if the attack is phyiscal it won't hit. The maker differs between physical and magical evasion and the phyiscal evasion is set to the maximum in this state.
So I assume I have to set this custom react effect for the "high physical evasion" stat instead for the fire shield? Thanks for the remove State command will it work in custom react effects? I will try it out once i'm at the maker again.
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,226
Reaction score
603
First Language
English
Primarily Uses
RMMV
I think you would set the react effect with the if dmg is physical then remove the state and do zero dmg, if not physical then keep the dmg and remove the state. Since you can control dmg within the note tag you don’t need the evasion settings on the state because that would never allow the physical dmg to ever hit so the react effect would not happen.

edit: if you look at buff and state core lunatic code help file, it says that a custom react effect will occur before damage is calculated but only if the attack connects, so if the evasion for physical damage is set at 100% then a physical attack technically never hits, thus nullifying the custom react effect note tag.
 
Last edited:

Klunky2

Veteran
Veteran
Joined
Jul 2, 2017
Messages
118
Reaction score
4
First Language
german
Primarily Uses
RMMV
Nah it's ok user.removeState(x) worked fine right under the damage calculation, i already check if the attack is physical for recoil damage. But there is no need to adjust the damage value, the enemy gets hit hit by the recoil (fire damage) regardless even if it's evasion is over 9000.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,540
Members
137,834
Latest member
EverNoir
Top