Random state rolls

I'm making a "gunner" class that will have this as a possibility; every attack he does will give one of 4 random states which I will describe as several bullet types (to simulate a reload effect on top of consuming a bullet) which occur on the next skill/shot (and thus do not need timers):

  • Basic Bullet: No state exists
  • Soul Bullet: A light damage over time (akin to poison)
  • Vigor Bullet: A small burst heal equal to 80% of attack
  • Paralyzing Bullet: Reduces enemy attack by 20%
  • Speedy Bullet: Invocation is 20% quicker
Each state will have a 10% chance of occurring (more likely basic bullets than the rest). Is there a variable that can simulate this?
If you want to allow multiple states, then you could simple!y do this by adding all of them with a 10% chance to the attack.
If you don't want multiple results, you'll have to check plugins for that Option.
Andar said:
If you want to allow multiple states, then you could simple!y do this by adding all of them with a 10% chance to the attack.
If you don't want multiple results, you'll have to check plugins for that Option.

Ah yes, forgot to mention that tidbit that they have to be mutally exclusive. Any plugins for that?

EDIT: I solved it with a plugin I already had. I used the following (after changing speedy bullet to silencing bullet):
<Post-Damage Eval>
if (a.isStateAffected(44)){
b.addState(12);
a.removeState(44);
} else if (a.isStateAffected(45)){
a.gainHP(a.atk * 0.8);
a.removeState(45);
} else if (a.isStateAffected(46)){
b.addState(21);
a.removeState(46);
} else if (a.isStateAffected(47)){
b.addState(6);
a.removeState(47);
}
</Post-Damage Eval>

<After Eval>
var Roll = Math.randomInt(8)+1;
if (Roll === 1){
a.addState(44);
} else if (Roll === 2){
a.addState(45);
} else if (Roll === 3){
a.addState(46);
} else if (Roll === 4){
a.addState(47);
}
</After Eval>

Hope this helps someone. Next is for me to apply this to an Action Sequence.
P.S. This used Yanfly's Skill Core should anyone else need this effect.

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.

Original thread: https://forums.rpgmakerweb.com/threads/random-state-rolls.95596/