- 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:
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!
Ps. In my project I tweaked it a bit more as shown below but that was just personal preference:
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)