I've made this to run when a state is applied on the actor.
Everything work as intended except one thing, I don't know how to force the game forget the first input, the action. So it becomes awkward since he does the random action and then the right one.
I can't find anywhere the code to make it forget the input, or if it's even possible. Lastly I tried using user.clearActions(); but the game dies.
I'm asking here because I lost a good time trying to figure it out, I think I will just use a workaround and don't mind that this isn't going how I wanted. Doing it on the beggining of the turn instead of action makes this actor move before the fastest actors, which is weird.
Here is the yanfly plugin: http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
<Custom Action Start Effect>
var skillusada = Math.floor(Math.random() * 6)
var ataqueRandom = 1;
if (Math.random() < ataqueRandom) {
var skill = $gameActors.actor(1)._skills[skillusada];
var target = -1;
if ($gameActors.actor(1)._mp <= 0) {
var skill = 1;
}
BattleManager.queueForceAction(user, skill, target);
}
user.removeState(60)
</Custom Action Start Effect>
var skillusada = Math.floor(Math.random() * 6)
var ataqueRandom = 1;
if (Math.random() < ataqueRandom) {
var skill = $gameActors.actor(1)._skills[skillusada];
var target = -1;
if ($gameActors.actor(1)._mp <= 0) {
var skill = 1;
}
BattleManager.queueForceAction(user, skill, target);
}
user.removeState(60)
</Custom Action Start Effect>
Everything work as intended except one thing, I don't know how to force the game forget the first input, the action. So it becomes awkward since he does the random action and then the right one.
I can't find anywhere the code to make it forget the input, or if it's even possible. Lastly I tried using user.clearActions(); but the game dies.
I'm asking here because I lost a good time trying to figure it out, I think I will just use a workaround and don't mind that this isn't going how I wanted. Doing it on the beggining of the turn instead of action makes this actor move before the fastest actors, which is weird.