[SOLVED]Need help with custom passive condition for Yanfly Passive States

Status
Not open for further replies.

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,113
Reaction score
517
First Language
English
Primarily Uses
RMMV
Here is the link to Passive States, Buff & States Core, and Absorption Barrier. I believe these are all the plugins associated with what I'm doing.

What I've done is create a passive state that only actives when the actor has barrier points. It's very simple and works fine. This is what it looks like:

Code:
<Custom Passive Condition>
var statusblock = user.barrierPoints();
if (statusblock > 0) {
  condition = true;
} else {
  condition = false;
}
</Custom Passive Condition>
The point of this passive state is to provide protection against certain other negative status effect states while the actor has active barrier points. For example, if an attack would inflict poison and the actor has barrier points, then the poison state is not inflicted. This works fine.

What I've overlooked is that if the actor has poison inflicted at the time the passive state is activated, due to barrier points being added to the actor in some way, the poison state is then removed. That's because the passive state has the trait resist poison. I do not want a negative state to be removed when barrier points are added, I only want the negative state to be prevented if the barrier points were active when the attempt to inflict the negative state took place.

My theory is to possibly add another custom passive condition that checks if an array of these negative states are already applied to the actor, therefore preventing the passive state from activating. However, I am unsure of exactly how to write the lunatic code for that.

Also, if my theory works, then it could possibly create another problem. Let's say the actor has poison applied, he then gets barrier points added, but the passive state does not activate because the actor already had poison applied. Now, even though the actor has barrier points again, he will succumb to further negative status effects. This is what I don't want to happen.

If anyone has some ideas, I am open to try them. I would really like to have my cake and eat it too... :kaodes:
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,703
Reaction score
1,148
First Language
EN
Primarily Uses
RMMV
Instead of State Resist traits, try using State Rate 0% traits. :)

State Resist is designed to make it impossible for the state to exist on the battler.
State Rate 0% makes it impossible for the state to be added to the battler.
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,113
Reaction score
517
First Language
English
Primarily Uses
RMMV
Oh my word, I think you may have discovered the simplest of solutions. I can't believe I didn't think about doing that.

I'll test it when I get the chance, and I'll update.
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,113
Reaction score
517
First Language
English
Primarily Uses
RMMV
@caethyril Thank a lot for the solution! It works just like I wanted it to now. I still can't believe I didn't see that for myself lol :kaoswt:

I would consider this issue solved.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
6,997
Reaction score
4,740
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Yanfly told me the new earth all animations in MZ look a bit like summoning potatoes and now I can't unsee it. halp
Despite time and all the other things I am working on, I decided that I am going to start a Fire Emblem-like project. Follow your dreams! I'll just have to balance hours efficiently. I'm also not making this as complex as my Might and Magic inspired project, so it will be a much easier project to work on.
So I've taken to doing a test of the game, and making a list of everything I think of during the test to add/fix. Over the course of the night I check them off as I do them, and by the end of the night I always feel like I've accomplished something. :LZSexcite:
Eventz MZ? Events MZ!

Forum statistics

Threads
100,586
Messages
977,521
Members
132,181
Latest member
Reich
Top