[VXA] Transfer State?

Ateliae

Defying Gravity
Veteran
Joined
Jun 4, 2016
Messages
42
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Hello!

Is there a way to make it possible to transfer states or debuffs from the user to the selected target through skills?
Ex. X has Poison, transfer Poison to Y, basically cleansing their states.

I've been searching for ways to do this, even through common events, but I'm stuck on the matter. Is this something only possible through a script or does anybody know of any that exist?

Hope to hear back soon!
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
4,816
Reaction score
5,506
First Language
Indonesian
Primarily Uses
RMVXA
Code:
a.states.each {|state| b.add_state(state.id)}; a.clear_states; 0
In the damage formula
 

Ateliae

Defying Gravity
Veteran
Joined
Jun 4, 2016
Messages
42
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Code:
a.states.each {|state| b.add_state(state.id)}; a.clear_states; 0
In the damage formula
Oooh! I didn't know that. Would you be able to transfer multiple states? How would you write it out or is it only for single?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
4,816
Reaction score
5,506
First Language
Indonesian
Primarily Uses
RMVXA
Would you be able to transfer multiple states?
My code "transfers" multiples. It basically adds state based on every state you have (buff/debuff alike). Then clear your own state.

You can even make your own method to transfer state or whatever mechanic you want, like
Code:
class Game_Battler
  def transfer_some_state(target, some_states)
    @states.each do |state_id|
      next unless some_states.include?(state_id)
      target.add_state(state_id)
      self.remove_state(state_id)
    end
  end
end
Then in damage formula, you just need to write
Code:
a.transfer_some_state(b, [2,3,4,5,6,7,8)]
This code in particular let you transfer specific states included in []
 

Ateliae

Defying Gravity
Veteran
Joined
Jun 4, 2016
Messages
42
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Thank you SO much for this! :kaojoy:
I didn't know it was possible through the formula, haha.
 

Crazetex

Veteran
Veteran
Joined
Apr 26, 2012
Messages
105
Reaction score
85
First Language
English
Primarily Uses
Hey! If you're up to using Yanfly Lunatic Objects, I have some similar script snippets you're more than welcome to steal. They're virtually identical to the above, but will give you more space/granularity than the damage field.

Code:
    when /MUTUALISM/i
      gas_buffs = []; tar_buffs = []
      for state in target.states
        tar_buffs.push(state.id) if state.priority <= 50
      end
      for state in user.states
        gas_buffs.push(state.id) if state.priority <= 50
      end
      
      for state_id in tar_buffs
        user.add_state(state_id) unless user.state?(state_id)
      end
      for state_id in gas_buffs
        target.add_state(state_id) unless target.state?(state_id)
      end
This will copy all buffs between the user and the target. (I use buffs with priority < 50 and debuffs with priority > 50. Obviously, you can change any of this to match what you need.)

Code:
    when /WEIGHT OF THE WORLD/i
      for member in $game_party.alive_members
        next if member == user
        for state in member.states
          next if state.priority <= 50
          user.tp += 4 unless user.state?(state.id)
          user.add_state(state.id)
          member.remove_state(state.id)
        end
      end
This pulls all debuffs to the caster. It also grants TP if it's a new status ailment -- you can cut that out of course, but hey, maybe you like the idea.

Code:
    when "MANUS DIABOLI"
      user_debuffs = []
      for state in user.states
        next if target.state?(state.id)
        next if target.state_resist?(state.id)
        if state.priority > 50
          user_debuffs.push(state.id)  
        end
      end

      unless user_debuffs.empty?
        ss = rand(user_debuffs.size)
        target.add_state(user_debuffs[ss]) 
        user.remove_state(user_debuffs[ss])
      end
This moves one ailment that the target doesn't have or is immune to, to the target. (Weird sentence, sorry.) You can move all of them with a for loop, of course. :)

Sorry this is a bit behind the times, but I hope this helps you make some cool abilities! Feel free to poke around in my games to copy-paste these or to see others -- https://rpgmaker.net/users/Craze/ . (These are from Owlpocalypse and KO Cupid.)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How do you do when you want to work on projects but the game companies make so many games available for free because of the quarantine?
Kes
I have just stepped down from being a Mod, so please don't send me any more pm's with Mod questions. Thanks
The laptop I've had for almost 3 years has blue screened and is stuck on a boot loop. Can't wait to make games on nothing!
Made a brief video showcasing early game play... Got a copyright claim by BIG UP! (https://big-up.style/) for using music I bought from here (Future Steam Punk Pack). Now I wonder if I should strip any purchased music from here out of my game. :LZSskeptic:
Cleaned character animation and new room


I'm not sure if I should open a thread for this in games in development..

Forum statistics

Threads
95,477
Messages
929,441
Members
125,717
Latest member
Schiraz
Top