- Joined
- Mar 25, 2015
- Messages
- 34
- Reaction score
- 8
- First Language
- Français
- Primarily Uses
Hi Everyone !
I'm using Yanfly Plugins (Battle Core, Buff and Sate etc...)
I'm trying to do a state that win stacks and each stack will up the user's critical chance, up his attack but lower his hit rate.
My state is "Alcohol" i put Yanfly confusion's code from Pokemon for the user to have a chance to hit himself. But my state of alcohol will increase Critical rate, buff his Attack and lower his hit rate. So more he drinks more he have critical chances and stronger he is but less he can hit his target (because he's drunk as hell and he can't see nothing)
So, my code here is
And i know that now what is missing is to add critical chance multiply by my number of stacks, a code for buffing his Attack for some turns AND my Hit Rate divided my number of stacks too.
Thanks in advance for your help and sorry for my english, if some sentences are weird it's only because i'm french.
I'm using Yanfly Plugins (Battle Core, Buff and Sate etc...)
I'm trying to do a state that win stacks and each stack will up the user's critical chance, up his attack but lower his hit rate.
My state is "Alcohol" i put Yanfly confusion's code from Pokemon for the user to have a chance to hit himself. But my state of alcohol will increase Critical rate, buff his Attack and lower his hit rate. So more he drinks more he have critical chances and stronger he is but less he can hit his target (because he's drunk as hell and he can't see nothing)
So, my code here is
<Custom Apply Effect>
target.addStateCounter(stateId, 1);
</Custom Apply Effect>
<Custom Action Start Effect>
// Calculate the confusion success rate
var confuseRate = 0.17;
// Check RNG if it passed
if (Math.random() < confuseRate) {
// Get the confusion skill for the user to perform
var confusionSkill = 5;
// Start the animation
user.startAnimation(63);
// Get the user's current action
var action = user.currentAction();
// Set it to the confusion skill
action.setSkill(confusionSkill);
}
</Custom Action Start Effect>
target.addStateCounter(stateId, 1);
</Custom Apply Effect>
<Custom Action Start Effect>
// Calculate the confusion success rate
var confuseRate = 0.17;
// Check RNG if it passed
if (Math.random() < confuseRate) {
// Get the confusion skill for the user to perform
var confusionSkill = 5;
// Start the animation
user.startAnimation(63);
// Get the user's current action
var action = user.currentAction();
// Set it to the confusion skill
action.setSkill(confusionSkill);
}
</Custom Action Start Effect>
And i know that now what is missing is to add critical chance multiply by my number of stacks, a code for buffing his Attack for some turns AND my Hit Rate divided my number of stacks too.
Thanks in advance for your help and sorry for my english, if some sentences are weird it's only because i'm french.