S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Hello, I need help with something, I'm making a stat works like Serene grace from Pokemon games, those who are not familiarized with this state, well... It increases the probability to add a state of an attack, for example: There is an attack can make some damage and has a 20% to add the "confuse" state, but with Serene grace, this attack now has a 40% to add the same state

Thanks to Waterguy to make this one, he could solve it of this way

class Game_Battler < Game_BattlerBase
def custom_damage_state(a, b, state, state_chance, damage)
chance = state_chance
chance *= b.state_rate(state)
chance *= b.luk_effect_rate(a)
chance *= 2 if a.state?(41)
b.add_state(state) if rand(100) <= chance
damage
end
end

It works perfectly, but now I want to make the same to make an attack adds a parameter buff/debuff with an attack, can someone adapt this formula to make this possible? Thank you
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,842
First Language
English
Primarily Uses
RMVXA
I think this is the method you're looking for in Game_Battler.

  #--------------------------------------------------------------------------  # * [Debuff] Effect  #--------------------------------------------------------------------------  def item_effect_add_debuff(user, item, effect)    chance = debuff_rate(effect.data_id) * luk_effect_rate(user)    if rand < chance      add_debuff(effect.data_id, effect.value1)      @result.success = true    end  endSo just do the same thing as you mentioned in your first post: add the chance *= 2 if a.state?(x) line right after chance is calculated.
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Sorry, I didn't get it, would you mind to make that for me? That thing confuses me still :S
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,842
First Language
English
Primarily Uses
RMVXA
OK...

Code:
  #--------------------------------------------------------------------------  # * [Debuff] Effect  #--------------------------------------------------------------------------  def item_effect_add_debuff(user, item, effect)    chance = debuff_rate(effect.data_id) * luk_effect_rate(user)    chance *= 2 if a.state?(42)    if rand < chance      add_debuff(effect.data_id, effect.value1)      @result.success = true    end  end
 
Last edited by a moderator:

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Let's see, to become that in a damage formula (because I see this damage formula and I don't see this (a, b, state, state_chance, damage) so I can asume it's not made to become it in a damage formula) It'd be like this:

class Game_Battler < Game_BattlerBase

  def debuff_custom_damage(a, b, debuff, debuff_rate, damage)

    chance = debuff_rate(effect.data_id) * luk_effect_rate(user)

    chance *= 2 if a.state?(51)

    b.add_debuff(effect.data_id, effect.value1) if rand(100) <= chance

    damage

    end

  end

I don't know how to add the parameter I want to be debuffed there, any idea?
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,842
First Language
English
Primarily Uses
RMVXA
This state affects all debuffs that the battler would inflict on enemies, not just debuffs from a single skill, right?

Just replace the method in Game_Battler with the one I gave you.  You don't need to do anything with formula boxes.
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
That'll add a buff/debuff even if the attack doesn't do any damage, right?
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Ok, it's solved, sorry by not answering that before, I have been busy, but it works
 

Latest Threads

Latest Profile Posts

FL Studio is a huge step up from LMMS but I'm having such a tough time with it D:<
The new Dune movie reminds me of the game Dune 2 made by Westwood. A quality product on its own, but extremely disloyal to its source of inspiration.
Terrible Writing Advice, you've done it again.
1635026211997.png
Feeling like my new profile picture is nice. Thinking of making it semi-permanent, does any one has an opinion? Does it look too evil or does it work as a public profile picture? :)
Bishiba.png

Forum statistics

Threads
116,034
Messages
1,095,142
Members
151,368
Latest member
aj1913
Top