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
360
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,764
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

I'm just gonna remove the Dark Spells from my game. They wouldn't be fighting Gods or Angels. So why have it?
Every day I'm getting rough-outs of another sprite sheet or two. Getting real close to just needing to make new original stuff and editing my tables and chairs to look correct for the taller sprites is among the top of the revisions list.
Eye_Guys.gif
Some eyew guys! One is absent for... reasons of taste
Eeee! X3 Ever since I started doing 3d Art ,my Pixel Art got sooo much better! I cant wait till im done with the tileset!
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.

Forum statistics

Threads
134,918
Messages
1,251,910
Members
177,755
Latest member
Sprk_3D
Top