CloudTheWolf

Lurking Wolf
Member
Joined
Sep 8, 2013
Messages
19
Reaction score
6
First Language
English
Primarily Uses
RMVXA
So I have been using the ATB System by Moghunter and noticed that the Poison status effect would be removed from the player after a short while, even though this is set to never auto-remove.

After some digging in the code I think I found the issue and fixed it.

Note, this worked for me, however may not work for you as required.
Before making any changes BACK UP YOUR PROJECT!

So, the issue I found looks to be on within the remove_states_auto_atb method.

This cycles through all effects applied to battlers and checks if the state should be removed.
After doing some initial checks (Checking state turns and restrictions) it then checks the auto removal timing and max turn.

This is where is issue looks to be:

Ruby:
unless state.auto_removal_timing == 2 and state.max_turns <= 1
    remove_state(state.id)
end

As we see here, this will remove the state unless the auto removal time is 2 and the max turns is less than or equal to 1.

This is where the problem looks to be.

For those that don't know, auto removal time 0 = Never Remove, 1 = Action End, and 2 = Turn End.

So to fix this, all you need to do is change this to following and this should fix it!

Ruby:
unless state.auto_removal_timing == 0 and state.max_turns <= 1
    remove_state(state.id)
end

Ps. In my project I tweaked it a bit more as shown below but that was just personal preference:

Ruby:
next if state.auto_removal_timing == 0
next if state.max_turns <= 1
remove_state(state.id)
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,763
Reaction score
892
First Language
English
Primarily Uses
RMXP
Normally, you would create a new method for the state class as a way to let it handle those checks while only calling the state's contents once from that condition. It's not mandatory but serves as a good example of encapsulation of that process.
 

CloudTheWolf

Lurking Wolf
Member
Joined
Sep 8, 2013
Messages
19
Reaction score
6
First Language
English
Primarily Uses
RMVXA
I have encountered another issue of the back of this, in that if the Battlers HP hits 0 by status effect, they don't die until they are damaged by a skill :/
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,763
Reaction score
892
First Language
English
Primarily Uses
RMXP
RPG immortality achieved by the scripter! :o
That's as dangerous as claiming a non existing penalty during a match. :S

Double check that just in case that's not the only issue there.
 
Last edited:

CloudTheWolf

Lurking Wolf
Member
Joined
Sep 8, 2013
Messages
19
Reaction score
6
First Language
English
Primarily Uses
RMVXA
So I found the issue and not sure what would cause it (I have disabled all the battle scripts I have and it still happens so maybe a default thing?

Poison will leave the player with at least 1HP during battle, at it looks like "K.O by slip damage" was being disabled by my base troop event
 

Latest Threads

Latest Posts

Latest Profile Posts

Crystal Shock Devlog #5 yay!



This week was super fun as I got to work on my favorite thing: Combat! A new boss has been added and some new mechanics on top of that. I also made some improvements to the first town.
Home cooking is good for your health! My wrist had been hurting weirdly for months now, but when making a soup I lifted a storage container with the "bad" hand, it crunched and there was a stinging pain and now everything is back to normal.
You gotta be kidding me...
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.

Forum statistics

Threads
134,910
Messages
1,251,848
Members
177,738
Latest member
Misuki
Top