Create a skill that applies 1 of 6 states at random every 5 turns

Status
Not open for further replies.

Johnboy

Veteran
Veteran
Joined
Jan 13, 2016
Messages
344
Reaction score
124
First Language
English
Primarily Uses
I'd like to make a skill that would allow my enemy to give himself one of six available states at random every five turns. I'm using Yanfly's Buffs and States Core 


as well as various other Yanfly plugins. I'm sure this can be accomplished using Lunatic mode's Custom Apply Effect but I'm still not very proficient in js.


If anyone can give me a hand with this I'll be grateful (and you'll get mention in my credits to boot!)
 

Johnboy

Veteran
Veteran
Joined
Jan 13, 2016
Messages
344
Reaction score
124
First Language
English
Primarily Uses
Ok so after tinkering a bit with Yanfly's action sequences I thought I had come up with a solution:


I made a common event which sets a random variable from 1-6


then I built this action sequence

<setup action>


clear battle log


display action


common event: 28


wait: 30


immortal: targets, true


</setup action>


<whole action>


</whole action>


<target action>


if $gameVariables.value(1)


animation 277: user


add state 64: user


wait for animation


else if $gameVariables.value(2)


animation 284: user


add state 65: user


wait for animation


else if $gameVariables.value(3)


animation 278: user


add state 66: user


wait for animation


else if $gameVariables.value(4)


animation 276: user


add state 67: user


wait for animation


else if $gameVariables.value(5)


animation 279: user


add state 68: user


wait for animation


else if $gameVariables.value(6)


animation 213: user


add state 69: user


wait for animation


death break


</target action>


<finish action>


clear battle log


immortal: targets, false


</finish action>

Except that it seems to cancel out my action sequence after it attempts to play the common event.


Anyone have any suggestions?
 
Last edited by a moderator:

Johnboy

Veteran
Veteran
Joined
Jan 13, 2016
Messages
344
Reaction score
124
First Language
English
Primarily Uses
Ok I got it figured out. Turns out I had to use this instead of using a common event:

<setup action>


clear battle log


display action


Eval: $gameVariables.setValue(181,(Math.randomInt(6)+1));


wait: 30


immortal: targets, true


</setup action>


<whole action>


</whole action>


<target action>


if $gameVariables.value(181) === 1


animation 277: user


add state 64: user


wait for animation


else if $gameVariables.value(181) === 2


animation 284: user


add state 65: user


wait for animation


else if $gameVariables.value(181) === 3


animation 278: user


add state 66: user


wait for animation


else if $gameVariables.value(181) === 4


animation 276: user


add state 67: user


wait for animation


else if $gameVariables.value(181) === 5


animation 279: user


add state 68: user


wait for animation


else if $gameVariables.value(181) === 6


animation 213: user


add state 69: user


wait for animation


death break


</target action>


<finish action>


clear battle log


immortal: targets, false


</finish action>

There's a code for anyone who might try something similar.


Sorry for the double post. This can be closed.
 
Last edited by a moderator:
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,540
Members
137,834
Latest member
EverNoir
Top