Serene grace-like state

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
hmm... maybe b.luk_effect_rate(a)? Not sure, I honestly forgot all about the "luck" status :p
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
According to help window, it works like this:

The change in states and debuff effectiveness due to luck is as shown below. Note, however, that 0 is the lower limit.

Chance (%) = 100 + (user's luck - target's luck) ÷ 10 So, is there a way to apply that in the damage formula you made?

 
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
let's do one better: let's remake the formula so it not only fixes this lack and another I figured out, let's make it more generic so you can call the same code for every state attack instead of making one for each state.

class Game_Battler < Game_BattlerBase def custom_damage_state(a, b, state, state_chance, damage) (b.state?(41) ? (100 - 20 * 2 * b.state_rate(2)) : (100 - 20 * b.state_rate(2))); chance = state_chance chance *= b.state_rate(state) chance *= a.atk_states_rate(state) chance *= b.luk_effect_rate(a) chance /= 2 if b.state?(41) b.add_state(2) if rand(100) < chance damage endendthis way you'll call your poison skill with a.custom_damage_state(a, b, 2, 20, 500)

didn't test yet, but it is based on the normal add_state, so it should work.
 
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 do one better: let's remake the formula so it not only fixes this lack and another I figured out, let's make it more generic so you can call the same code for every state attack instead of making one for each state.

class Game_Battler < Game_BattlerBase def custom_damage_state(a, b, state, state_chance, damage) (b.state?(41) ? (100 - 20 * 2 * b.state_rate(2)) : (100 - 20 * b.state_rate(2))); chance = state_chance chance *= b.state_rate(state) chance *= a.atk_states_rate(state) chance *= b.luk_effect_rate(a) chance /= 2 if b.state?(41) b.add_state(2) if rand(100) < chance damage endendthis way you'll call your poison skill with a.custom_damage_state(a, b, 2, 20, 500)

didn't test yet, but it is based on the normal add_state, so it should work.
Just a dumb question

Considering it'd be more generic, that means I can put any single state with any percent and any damage, using this damage formula, why in the script it looks like it only affect the state id 2 with 20%? I meant specially by this part

(b.state?(41) ? (100 - 20 * 2 * b.state_rate(2)) : (100 - 20 * b.state_rate(2)));

Also, I guess it's almost the same if I want to make the same for an attack adds a debuff, right?

Sorry if I'm asking/requesting too much
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
Because I forgot to remove that line :p

Sorry, here is the right code:

class Game_Battler < Game_BattlerBase def custom_damage_state(a, b, state, state_chance, damage) chance = state_chance chance *= b.state_rate(state) chance *= a.atk_states_rate(state) chance *= b.luk_effect_rate(a) chance /= 2 if b.state?(41) b.add_state(2) if rand(100) < chance damage endendonly if  your "debuff" is a state, the actual debuff option is a bit different, although I'm not sure how much
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Is the "b.add_state(2) if rand(100) < chance" still necessary for the general state formula? It sounds quite specific with the state id and all that
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
ops, let it pass again, sorry.

this one should work

class Game_Battler < Game_BattlerBase def custom_damage_state(a, b, state, state_chance, damage) chance = state_chance chance *= b.state_rate(state) chance *= a.atk_states_rate(state) chance *= b.luk_effect_rate(a) chance /= 2 if b.state?(41) b.add_state(state) if rand(100) < chance damage endendSorry for all the mistakes
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
ops, let it pass again, sorry.

this one should work

class Game_Battler < Game_BattlerBase def custom_damage_state(a, b, state, state_chance, damage) chance = state_chance chance *= b.state_rate(state) chance *= a.atk_states_rate(state) chance *= b.luk_effect_rate(a) chance /= 2 if b.state?(41) b.add_state(state) if rand(100) < chance damage endendSorry for all the mistakes
Thanks a lof for the help, just a last question... Multipling a.atk_states_rate(state) by b.luk_effect_rate(a) has the same effect than (a.luck-b.luck)/10, just like the luck state has effect in the game?
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
what? no!

b.state_rate is the chance of b getting the state
a.atk_states_rate is the chance of a adding the effect to a b with 100%
b.luk_effect_rate(a) is where luck is calculated.
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Woah, I misreaded what you wrote, sorry

Anyways, tested and even when the user of this attack has 999 of luck and 100% of chance to add it, it just doesn't add the state, odd...
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
even without the Serene Grace?

try this one:
 

Code:
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  endend
 

removed the chance *= a.atk_states_rate(state) line, it was the problem. it is for something else, not this
 
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
even without the Serene Grace?

try this one:

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 endend 

removed the chance *= a.atk_states_rate(state) line, it was the problem. it is for something else, not this
Now it does work, wow, it's really cool seeing those ideas in process, thanks a lot :3
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
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

Forum statistics

Threads
105,857
Messages
1,017,019
Members
137,564
Latest member
McFinnaPants
Top