Is there a way to check if anybody in the party is inflicted with a certain state, not just a specific actor?

MoltresRider

Moltres Rider/Dragon Whisperer
Regular
Joined
Apr 16, 2023
Messages
356
Reaction score
44
First Language
English
Primarily Uses
RMVXA
I have a few status effects called "sickness". While most of these can be cleared with just using the "pill" item, there are other more severe types of sickness status effects where I want the player to visit a nurse to have removed for a fee. However, I do not want the player to pay if none of the party members have any type of these sicknesses that cannot be removed with an item. Also, I do not want the nurse to remove all states, just the ones I want.

(This is why I do not like "recover all" because it removes all states including XP buffs and other buffs)

I looked in conditional branches and found that I only can choose specific actors for the conditional branches. Not if anybody in the party has a certain state.

Sure, I could nest a couple dozen conditional branches to check all avenues but that would get tedious and confusing very quickly.

Is there an easier way I can check to see if anybody has one of these few states and have the nurse remove them from the entire party (its a pay per visit rather than pay per character)
 
Joined
Jul 12, 2020
Messages
618
Reaction score
342
First Language
English
Primarily Uses
RMMV
As far as I'm aware, you can only check individual states per actor by default, so you will have to use that conditional branch multiple times to just check each possible actor.

However, I want to point out...why not just have your Nurse Check become a Common Event?
So that you are not copying/pasting it over and over again for all your nurse stops? You can find the Common Event tab in your Settings if you're unfamiliar with them.

Just go through the process of making one very thorough check inside a Common Event, and then just use that Common Event call command in your actual game to save yourself the time.
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,756
Reaction score
892
First Language
English
Primarily Uses
RMXP
New Method to let you check several states with a single call:

Ruby:
# * Has States? RG * #
#   2023-06-01

# * Script Call * #

# - For XP
#  $game_party.actors[ActorIndex].has_states?(state1, etc.)

# - For VX and VX ACE
#  $game_party.members[ActorIndex].has_states?(state1, etc.)

class Game_Actor
  def has_states?(*new_states)
    states_found = @states & new_states
    states_found.any?
  end
end
 

Latest Threads

Latest Profile Posts

The trailer for a documentary I am in a short bit of just dropped.
when you figure out someone's issue on the forums, but you aren't about that necro-posting life.
Dalph wrote on Erif's profile.
Titania has been added and she's clickable too, she redirects to your thread. I wonder how far I can go with all these blondes in the banners. It's an army already.
Pre-title animation of Rosegard :)
image.png

Forum statistics

Threads
134,855
Messages
1,251,264
Members
177,646
Latest member
madlizard
Top