State that Resists/Immune to Buffs and Debuffs

Status
Not open for further replies.
Joined
Aug 6, 2016
Messages
95
Reaction score
5
First Language
English
Primarily Uses
Hello, everybody!


Is there any way to make a state that makes a battler immune to buffs and debuffs?


No, not state, but the buffs and debuffs from the "Add Buff" command from the Effects part in the Skills tab.


Because I'm making a state that pretty much avoids everything including buffs and debuffs. Thanks. 
 

Silverskin

Villager
Member
Joined
Jun 21, 2016
Messages
27
Reaction score
11
First Language
English
Primarily Uses
are you using yanflys buffs & states core?


If yes, replay and I will figure out the code for you :)
 
Joined
Aug 6, 2016
Messages
95
Reaction score
5
First Language
English
Primarily Uses
are you using yanflys buffs & states core?


If yes, replay and I will figure out the code for you :)
I'm using Yanfly Engine Ace - Buff & State Manager v1.07 


Seems like Buffs and States Core is for MV :D
 

Silverskin

Villager
Member
Joined
Jun 21, 2016
Messages
27
Reaction score
11
First Language
English
Primarily Uses
Oh, I am sorry, didn't see you are using RMVXA, I am only familiar with RMV...


But my approach would have been a state that (if that works with the ace script) has a formular like

if (target.isBuffAffected(paramId)) {


target.atk -= target.paramPlus(paramId); 


}
but I think this won't be that easy because RMV uses javascript and RMVXA ruby...


Hope I could help you nevertheless...
 

xdan

Veteran
Veteran
Joined
Aug 21, 2016
Messages
158
Reaction score
59
First Language
Spanish
Primarily Uses
I think it can be done with a really complex engine. I can explain if you don't find any script.


Another option that involves Tsukihime's Battle Reactions: http://himeworks.com/2013/09/battle-reactions/


Make a skill that removes buffs and debuffs from the user. Then make a state that reacts to buffs and debuffs with that skill.
 
Last edited by a moderator:

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
579
Reaction score
219
First Language
English
Primarily Uses
RMVXA
I found this much easier to code myself.

#==============================================================================
# ** Resist Buff State Module
#------------------------------------------------------------------------------
#  Set the ID of the state(s) that will resist buffs and/or debuffs.
#==============================================================================
module RINOBI module RB_State
  Buff_Resist   = [1, 2, 5, 9]
  Debuff_Resist = [1, 2, 5, 9]
end end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  A battler class with methods for sprites and actions added. This class 
# is used as a super class of the Game_Actor class and Game_Enemy class.
#==============================================================================
class Game_Battler < Game_BattlerBase
  #--------------------------------------------------------------------------
  # * Alias Method: Add Buff
  #--------------------------------------------------------------------------
  alias :rb_add_buff :add_buff
  def add_buff(param_id, turns)
    rb = RINOBI::RB_State::Buff_Resist
    return if states.any? {|state| rb.include?(state.id)}
    rb_add_buff(param_id, turns)
  end
  #--------------------------------------------------------------------------
  # * Alias Method: Add Debuff
  #--------------------------------------------------------------------------
  alias :rb_add_debuff :add_debuff
  def add_debuff(param_id, turns)
    rb = RINOBI::RB_State::Debuff_Resist
    return if states.any? {|state| rb.include?(state.id)}
    rb_add_debuff(param_id, turns)
  end
end
 
Joined
Aug 6, 2016
Messages
95
Reaction score
5
First Language
English
Primarily Uses
Thanks both of you! I'll see what I can do..


@xdan how exactly the buff removal works? Does it only remove 1 buff stage or does it remove all  stages?


For example Actor A has his Attack buffed 3 times (3 stages)


Then when I remove buff for Attack, does it became 2 stages or it became 0 stages (Attack buffs completely removed)? 
 
Last edited by a moderator:
Joined
Aug 6, 2016
Messages
95
Reaction score
5
First Language
English
Primarily Uses
I found this much easier to code myself.

#==============================================================================
# ** Resist Buff State Module
#------------------------------------------------------------------------------
#  Set the ID of the state(s) that will resist buffs and/or debuffs.
#==============================================================================
module RINOBI module RB_State
  Buff_Resist   = [1, 2, 5, 9]
  Debuff_Resist = [1, 2, 5, 9]
end end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  A battler class with methods for sprites and actions added. This class 
# is used as a super class of the Game_Actor class and Game_Enemy class.
#==============================================================================
class Game_Battler < Game_BattlerBase
  #--------------------------------------------------------------------------
  # * Alias Method: Add Buff
  #--------------------------------------------------------------------------
  alias :rb_add_buff :add_buff
  def add_buff(param_id, turns)
    rb = RINOBI::RB_State::Buff_Resist
    return if states.any? {|state| rb.include?(state.id)}
    rb_add_buff(param_id, turns)
  end
  #--------------------------------------------------------------------------
  # * Alias Method: Add Debuff
  #--------------------------------------------------------------------------
  alias :rb_add_debuff :add_debuff
  def add_debuff(param_id, turns)
    rb = RINOBI::RB_State::Debuff_Resist
    return if states.any? {|state| rb.include?(state.id)}
    rb_add_debuff(param_id, turns)
  end
end
Thanks Rinobi!! It seems to work!


(Sorry for double posting but I just had to say thanks)
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Kevin Eontrainer, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


What you do is click on the edit button of your last post and add what you want to say.


So can this be closed as solved?
 

xdan

Veteran
Veteran
Joined
Aug 21, 2016
Messages
158
Reaction score
59
First Language
Spanish
Primarily Uses
Thanks both of you! I'll see what I can do..


@xdan how exactly the buff removal works? Does it only remove 1 buff stage or does it remove all  stages?


For example Actor A has his Attack buffed 3 times (3 stages)


Then when I remove buff for Attack, does it became 2 stages or it became 0 stages (Attack buffs completely removed)? 


It removes all stages. Somebody wrote some script for this thought.
 
Joined
Aug 6, 2016
Messages
95
Reaction score
5
First Language
English
Primarily Uses
@xdan Yeah the script worked fine till now. Thanks for trying to help.


@ksjp17 yeah.. like this, right?
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,975
Members
137,563
Latest member
cexojow
Top