[VXA] Transfer State?

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!
Code:
a.states.each {|state| b.add_state(state.id)}; a.clear_states; 0
In the damage formula
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?
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 []
Thank you SO much for this! 😂
I didn't know it was possible through the formula, haha.
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.)

Original thread: https://forums.rpgmakerweb.com/threads/vxa-transfer-state.116490/