KingS001

Villager
Member
Joined
Jul 26, 2018
Messages
9
Reaction score
2
First Language
Germany
Primarily Uses
RMMV
After 5 years I finally are about to finish my game. However now there is a problem that I have not found a perfect solution yet and I can't procrastinate it anymore - so I'm asking the first time for help.

I would like to have an enemy that cannot be defeated by any of the following four elements. Below, I list the elements and their corresponding numbers:

Explosion = 10, Technology = 11, Nature = 12, Blood = 14.

Making the enemy immune to other elements is not an option, as it has a skill that reflects any other damage received proportionally. The easiest approach seems to be giving the enemy a state (numbered 145) that makes it invincible and then ignoring/removing this state upon being hit by one of these four elements.

I'm using Yanflys Elementcore plugin.
 

Kes

Regular
Regular
Joined
Aug 3, 2012
Messages
23,808
Reaction score
13,729
First Language
English
Primarily Uses
RMMZ
In the slot for this enemy click on the Traits box top right.
1685887327667.png
The very first option is Element Rate. Click on the little arrow to the right of physical and you will see a drop down list of all your elements. Select one. Then change the 100% to 0%.
Repeat for the other elements.

EDIT
Re-reading your post, I may have misunderstood what you want. Is it that you don't want them to be affected by those elements or that you don't want their HP to drop below 1 if they are hit by one of the elements?

Your proposed solution might not work. State 145 removed by being hit with one of the elements. Next attack is with another of those elements. Now no protection, so it will be defeated with one of the elements that you don't want it to be.
 
Last edited:

KingS001

Villager
Member
Joined
Jul 26, 2018
Messages
9
Reaction score
2
First Language
Germany
Primarily Uses
RMMV
Your proposed solution might not work. State 145 removed by being hit with one of the elements. Next attack is with another of those elements. Now no protection, so it will be defeated with one of the elements that you don't want it to be.

Yes. The enemy is not immune.

I will try to explain what the enemy can fully do. It is a little complicated so bear with me on this:

The enemy can deal back any damage that he takes in % damage back to the opponent. For example if he takes 30% damage because of fire spell, then he will always survive this and deal 30% back to the player. (I already have this working!) After an attack he regenerates always 100% of his HP back.
The ability has a weakness. The 4 elements that I mentioned. The enemy can't repell this type of attacks back. So he will take damage from them. The 4 types of elements are the only way to defeat him.

Currently I am forced to make the enemy "invincible" since a fire attack can deal over 100% and kill him in one shot which is not intended.
So my thought was to find a workaround. The problem that I currently have is that I can't make him invincible since the enemy won't die, but I can't make him not invincible since he can get oneshotted.
So I thought to remove the state when hit by one of the 4 effective elements.
 

AphoticAmaranth

An Ordinary Human
Regular
Joined
Mar 29, 2020
Messages
398
Reaction score
669
First Language
English
Primarily Uses
RMMV
So I thought to remove the state when hit by one of the 4 effective elements.

That won't work because once you remove the state by using the correct element once, any other element can defeat the enemy.

What I would instead suggest is to check if the element is of the correct element AND the damage is equal to or greater than the enemy's remaining HP, and only remove the state if both of those conditions are met. You'll probably need Yanfly's Buff & States core plugin for that, and a Custom React Effect on the invincibility state.
 

KingS001

Villager
Member
Joined
Jul 26, 2018
Messages
9
Reaction score
2
First Language
Germany
Primarily Uses
RMMV
That won't work because once you remove the state by using the correct element once, any other element can defeat the enemy.

What I would instead suggest is to check if the element is of the correct element AND the damage is equal to or greater than the enemy's remaining HP, and only remove the state if both of those conditions are met. You'll probably need Yanfly's Buff & States core plugin for that, and a Custom React Effect on the invincibility state.
That sounds good. How can I do this? I have nearly every Yanfly plugin - Buff and States are one of them. However I'm not that good at writing scripts from the grouns. I can only understand and alter them.
 

AphoticAmaranth

An Ordinary Human
Regular
Joined
Mar 29, 2020
Messages
398
Reaction score
669
First Language
English
Primarily Uses
RMMV
To add the state at the start of the battle, under your troop's battle event, create a page with Conditions: Turn 0 + 0 * X and Span: Battle. Create a new event command, "Change Enemy State" (under the third tab), and add the invincibility state to the enemies.


To remove the state, you can use this code in the notetag of the state (requires Yanfly's buff and states core)
Code:
<Custom React Effect>
if(value >= target.hp)
{
  switch(this.item().damage.elementId)
  {
    case 10:
    case 11:
    case 12:
    case 14:
      target.removeState(145);
    break;
      default:
    break;
  }
}
</Custom React Effect>

What this basically does is that when being hit, before the damage is applied, it will check if the value is greater than or equal to remaining HP, and if so, it will proceed to check the element of the attack/skill. If it is 10, 11, 12, or 14, it will remove state 145; otherwise, nothing happens.
 

KingS001

Villager
Member
Joined
Jul 26, 2018
Messages
9
Reaction score
2
First Language
Germany
Primarily Uses
RMMV
thank you very much. it works!
 

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,153
Reaction score
16,960
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Support. Thank you.

 

Latest Threads

Latest Posts

Latest Profile Posts

Apologies for posting again so soon, but I just had to share what I believe to be my best map yet, I'm over the moon with the way this has turned out to be.

Definitely leaning on the "try to" part of the status feed rule and I really try not to sad post, but not only is my kitty Simone more or less confirmed to have IBD... but she has some pulmonary edema and a slightly enlarged heart. They say everything is early and mild and that I'm very diligent and observant about my pets but iunno...doesn't feel like a win right now.


So it turns out music is fun to make????
A lil concept for a prison level. It's intentional that the chords and sound is the same from the previous concept I posted cause it's related to a certain character... What do u think?
I was wondering if I should ask the question
"Who Is Dalph?"
But I met him pretty fast and his answer was extremely helpful. So yeah. That probably answers it.
So in hindsight, I could have made a double-post in this category instead of setting up a post on a different site and figuring out how to share and then linking...

Forum statistics

Threads
134,908
Messages
1,251,822
Members
177,733
Latest member
Nehirumur
Top