Inflict State After Attack With Chance?

MushReen

Gacha Guy
Veteran
Joined
Jun 8, 2017
Messages
76
Reaction score
489
First Language
ID, US
Primarily Uses
RMMV
Hello!

So, I've been developing games with quite complicated database.
I've come to a problem, actually.

I made a skill with inflicting state to enemy after attack, so I use this formula.
b.addState(x); (a.atk * 4 - b.def * 2) * 2

But I want one of the skill has chance to inflict the state to enemies after the attack. Is there any further information about this formula? Like, adding the chance or something.

Thanks!
 

Blue Symphony

Wandering soul
Veteran
Joined
Jan 24, 2014
Messages
63
Reaction score
27
First Language
Spanish
Primarily Uses
RMMV
Yes there is!
If you're using Yanfly's Damagecore plugin you can paste this on the skills notebox:
Code:
<Damage formula>
value = (a.atk * 4 - b.def * 2) * 2;
if (randomNumber=Math.randomInt(4) !== 4){
target.addState(x);
}
</Damage formula>
If not you can write it the ugly way on the damage formula box:
Code:
if (randomNumber=Math.randomInt(4) !== 4){b.addState(x);} (a.atk * 4 - b.def * 2) * 2
Were the 4 on the formula represents the chance, if you write a 4 you have a 1/4 chance of success, you write an 8 you get 1/8 an so on.
The x is the sate ID you want to apply.
 

MushReen

Gacha Guy
Veteran
Joined
Jun 8, 2017
Messages
76
Reaction score
489
First Language
ID, US
Primarily Uses
RMMV
Yes there is!
If you're using Yanfly's Damagecore plugin you can paste this on the skills notebox:
Code:
<Damage formula>
value = (a.atk * 4 - b.def * 2) * 2;
if (randomNumber=Math.randomInt(4) !== 4){
target.addState(x);
}
</Damage formula>
If not you can write it the ugly way on the damage formula box:
Code:
if (randomNumber=Math.randomInt(4) !== 4){b.addState(x);} (a.atk * 4 - b.def * 2) * 2
Were the 4 on the formula represents the chance, if you write a 4 you have a 1/4 chance of success, you write an 8 you get 1/8 an so on.
The x is the sate ID you want to apply.
Thank you, mate!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Are we allowed to post about non-RPG Maker games?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:

Forum statistics

Threads
105,884
Messages
1,017,238
Members
137,608
Latest member
Arm9
Top