;The Commands.
;This is how you tell your character to move, based on what inputs the player applies.
;This is also where you'll be putting your AI.

[Remap] ;These are all mandatory. Do not remove any of them!
x = x
y = y
z = z
a = a
b = b
c = c
s = s

[Defaults]
command.time = 15
command.buffer.time = 1

;======================================;
;         DASHING AND RECOVERY         ;
;======================================;

[Command]
name = "FF"     ;Required (do not remove)
command = F, F
time = 10

[Command]
name = "BB"     ;Required (do not remove)
command = B, B
time = 10

[Command]
name = "recovery";Required (do not remove)
command = x+y
time = 1

;======================================;
;          DIRECTIONAL INPUTS          ;
;======================================;
[Command]
name = "holdfwd";Required (do not remove)
command = /$F
time = 1

[Command]
name = "holdback";Required (do not remove)
command = /$B
time = 1

[Command]
name = "holdup" ;Required (do not remove)
command = /$U
time = 1

[Command]
name = "holddown";Required (do not remove)
command = /$D
time = 1

;======================================;
;         BUTTON INPUTS          ;
;======================================;

[Command]
name = "x"
command = x
time = 1

[Command]
name = "y"
command = y
time = 1

[Command]
name = "z"
command = z
time = 1

[Command]
name = "a"
command = a
time = 1

[Command]
name = "b"
command = b
time = 1

[Command]
name = "c"
command = c
time = 1

;======================================;

[StateDef -1]

[State -1, AI ON] ; Turn the AI on when
Type = VarSet
TriggerAll = Var(59) < 1; it is not on yet and
TriggerAll = RoundState=2 ; the fight has started and is not over yet and
Trigger1 = AILevel>0 ; the computer is playing the character
v = 59
value= 1 ; value of 1 will mean the AI is on
Ignorehitpause=1

[State -1, AI OFF] ; Turn the AI off when
Type=VarSet
Trigger1=var(59)>0 ; it is on and
Trigger1=RoundState!=2 ; the round is not started yet or is already over
Trigger2=!IsHelper ; OR if we are a player, but
Trigger2=AILevel=0 ; the computer is not in control
v=59
value=0 ; value of 0 will mean the AI is off. values other than 0 and 1 are not used in this example, we have only one AI mode, the normal one.
Ignorehitpause=1

[State -1]
Type=VarSet
Trigger1=1
var(50)= 10 ;Change the 60 to whatever you want. Take note of this value, as I mention it below.

;[State -1]
;Type=Changestate
;Triggerall=Inguarddist; Guard when in guard distance
;Triggerall=var(59)>0; and the AI is on
;Triggerall=ctrl; and we have control
;Trigger1 = random< (var(50)* 99) ; Feel free to change the * 99 to whatever you want, 
;value=120

[State -1]; The engine will still guard by through pressing the back button, we need to disable that.
Type=Assertspecial
Triggerall=StateNo!=[120,160]
Trigger1=var(59)>0
flag=noairguard
flag2=nocrouchguard
flag3=nostandguard

[State Grass]
type = ChangeState
value = 1175
Triggerall = var(59)>0 
triggerall = var(10) = 17
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 10
[State Grass]
type = ChangeState
value = 1170
Triggerall = var(59)>0 
triggerall = var(10) = 17
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 10

[State Poison]
type = ChangeState
value = 1165
Triggerall = var(59)>0  
triggerall = var(10) = 16
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 10
[State Poison]
type = ChangeState
value = 1160
Triggerall = var(59)>0 
triggerall = var(10) = 16
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 10


[State Dragon]
type = ChangeState
value = 1155
Triggerall = var(59)>0 
triggerall = var(10) = 15
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Dragon]
type = ChangeState
value = 1150
Triggerall = var(59)>0 
triggerall = var(10) = 15
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25


[State Fairy]
type = ChangeState
value = 1145
Triggerall = var(59)>0 
triggerall = var(10) = 14
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Fairy]
type = ChangeState
value = 1140
Triggerall = var(59)>0 
triggerall = var(10) = 14
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25

[State Psychic]
type = ChangeState
value = 1135
Triggerall = var(59)>0 
triggerall = var(10) = 13
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Psychic]
type = ChangeState
value = 1130
Triggerall = var(59)>0 
triggerall = var(10) = 13
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25

[State Steel]
type = ChangeState
value = 1125
Triggerall = var(59)>0 
triggerall = var(10) = 12
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Steel]
type = ChangeState
value = 1120
Triggerall = var(59)>0 
triggerall = var(10) = 12
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25

[State Rock]
type = ChangeState
value = 1115
Triggerall = var(59)>0 
triggerall = var(10) = 11
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Rock]
type = ChangeState
value = 1110
Triggerall = var(59)>0 
triggerall = var(10) = 11
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25

[State Normal]
type = ChangeState
value = 1105
Triggerall = var(59)>0 
triggerall = var(10) = 10
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Normal]
type = ChangeState
value = 1100
Triggerall = var(59)>0 
triggerall = var(10) = 10
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25

[State Ghost]
type = ChangeState
value = 1095
Triggerall = var(59)>0 
triggerall = var(10) = 9
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Ghost]
type = ChangeState
value = 1090
Triggerall = var(59)>0 
triggerall = var(10) = 9
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25

[State Ice]
type = ChangeState
value = 1085
Triggerall = var(59)>0 
triggerall = var(10) = 8
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Ice]
type = ChangeState
value = 1080
Triggerall = var(59)>0 
triggerall = var(10) = 8
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25

[State Ground]
type = ChangeState
value = 1075
Triggerall = var(59)>0 
triggerall = var(10) = 7
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Ground]
type = ChangeState
value = 1070
Triggerall = var(59)>0 
triggerall = var(10) = 7
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25

[State Bug]
type = ChangeState
value = 1065
Triggerall = var(59)>0 
triggerall = var(10) = 6
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Bug]
type = ChangeState
value = 1060
Triggerall = var(59)>0 
triggerall = var(10) = 6
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25

[State Dark]
type = ChangeState
value = 1055
Triggerall = var(59)>0 
triggerall = var(10) = 5
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Dark]
type = ChangeState
value = 1050
Triggerall = var(59)>0 
triggerall = var(10) = 5
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25

[State Fightning]
type = ChangeState
value = 1045
Triggerall = var(59)>0 
triggerall = var(10) = 4
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Fightning]
type = ChangeState
value = 1040
Triggerall = var(59)>0 
triggerall = var(10) = 4
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25


[State Fire]
type = ChangeState
value = 1035
Triggerall = var(59)>0 
triggerall = var(10) = 3
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Fire]
type = ChangeState
value = 1030
Triggerall = var(59)>0 
triggerall = var(10) = 3
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25

[State Flying]
type = ChangeState
value = 1025
Triggerall = var(59)>0 
triggerall = var(10) = 2
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Flying]
type = ChangeState
value = 1020
Triggerall = var(59)>0 
triggerall = var(10) = 2
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25

[State Electric]
type = ChangeState
value = 1015
Triggerall = var(59)>0 
triggerall = var(10) = 1
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Electric]
type = ChangeState
value = 1010
Triggerall = var(59)>0 
triggerall = var(10) = 1
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25


[State Water]
type = ChangeState
value = 1005
Triggerall = var(59)>0 
triggerall = var(10) = 0
triggerall = p2bodydist y = [-75,75]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = random<var(50) * 25
[State Water]
type = ChangeState
value = 1000
Triggerall = var(59)>0 
triggerall = var(10) = 0
trigger1 = statetype = S
trigger1 = ctrl
trigger1 = random<var(50) * 25



[State Grass]
type = ChangeState
value = 1175
triggerall = Var(59) <= 0
triggerall = var(10) = 17
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Grass]
type = ChangeState
value = 1170
triggerall = Var(59) <= 0
triggerall = var(10) = 17
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Poison]
type = ChangeState
value = 1165
triggerall = Var(59) <= 0
triggerall = var(10) = 16
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Poison]
type = ChangeState
value = 1160
triggerall = Var(59) <= 0
triggerall = var(10) = 16
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl


[State Dragon]
type = ChangeState
value = 1155
triggerall = Var(59) <= 0
triggerall = var(10) = 15
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Dragon]
type = ChangeState
value = 1150
triggerall = Var(59) <= 0
triggerall = var(10) = 15
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Fairy]
type = ChangeState
value = 1145
triggerall = Var(59) <= 0
triggerall = var(10) = 14
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Fairy]
type = ChangeState
value = 1140
triggerall = Var(59) <= 0
triggerall = var(10) = 14
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Psychic]
type = ChangeState
value = 1135
triggerall = Var(59) <= 0
triggerall = var(10) = 13
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Psychic]
type = ChangeState
value = 1130
triggerall = Var(59) <= 0
triggerall = var(10) = 13
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Steel]
type = ChangeState
value = 1125
triggerall = Var(59) <= 0
triggerall = var(10) = 12
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Steel]
type = ChangeState
value = 1120
triggerall = Var(59) <= 0
triggerall = var(10) = 12
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Rock]
type = ChangeState
value = 1115
triggerall = Var(59) <= 0
triggerall = var(10) = 11
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Rock]
type = ChangeState
value = 1110
triggerall = Var(59) <= 0
triggerall = var(10) = 11
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl


[State Normal]
type = ChangeState
value = 1105
triggerall = Var(59) <= 0
triggerall = var(10) = 10
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Normal]
type = ChangeState
value = 1100
triggerall = Var(59) <= 0
triggerall = var(10) = 10
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl


[State Ghost]
type = ChangeState
value = 1095
triggerall = Var(59) <= 0
triggerall = var(10) = 9
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Ghost]
type = ChangeState
value = 1090
triggerall = Var(59) <= 0
triggerall = var(10) = 9
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Ice]
type = ChangeState
value = 1085
triggerall = Var(59) <= 0
triggerall = var(10) = 8
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Ice]
type = ChangeState
value = 1080
triggerall = Var(59) <= 0
triggerall = var(10) = 8
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Ground]
type = ChangeState
value = 1075
triggerall = Var(59) <= 0
triggerall = var(10) = 7
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Ground]
type = ChangeState
value = 1070
triggerall = Var(59) <= 0
triggerall = var(10) = 7
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Bug]
type = ChangeState
value = 1065
triggerall = Var(59) <= 0
triggerall = var(10) = 6
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Bug]
type = ChangeState
value = 1060
triggerall = Var(59) <= 0
triggerall = var(10) = 6
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Dark]
type = ChangeState
value = 1055
triggerall = Var(59) <= 0
triggerall = var(10) = 5
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Dark]
type = ChangeState
value = 1050
triggerall = Var(59) <= 0
triggerall = var(10) = 5
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Fightning]
type = ChangeState
value = 1045
triggerall = Var(59) <= 0
triggerall = var(10) = 4
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Fightning]
type = ChangeState
value = 1040
triggerall = Var(59) <= 0
triggerall = var(10) = 4
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl


[State Fire]
type = ChangeState
value = 1035
triggerall = Var(59) <= 0
triggerall = var(10) = 3
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Fire]
type = ChangeState
value = 1030
triggerall = Var(59) <= 0
triggerall = var(10) = 3
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Flying]
type = ChangeState
value = 1025
triggerall = Var(59) <= 0
triggerall = var(10) = 2
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Flying]
type = ChangeState
value = 1020
triggerall = Var(59) <= 0
triggerall = var(10) = 2
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Electric]
type = ChangeState
value = 1015
triggerall = Var(59) <= 0
triggerall = var(10) = 1
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
[State Electric]
type = ChangeState
value = 1010
triggerall = Var(59) <= 0
triggerall = var(10) = 1
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl

[State Water]
type = ChangeState
value = 1000
triggerall = Var(59) <= 0
triggerall = var(10) = 0
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl
[State Water]
type = ChangeState
value = 1005
triggerall = Var(59) <= 0
triggerall = var(10) = 0
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl

[State -1,Run_Fwd]
type=changestate
Triggerall = var(59)>0
Triggerall = alive = 1
Triggerall = ctrl
triggerall = RoundState = 2
triggerall = statetype = S
trigger1 = random<var(50) * 5
value = 20

[State -1, Run Fwd]
type = ChangeState
value = 100
trigger1 = command = "FF"
trigger1 = statetype = S
trigger1 = ctrl

[State -1, Dash Back]
type = ChangeState
value = 105
trigger1 = command = "BB"
trigger1 = statetype = S
trigger1 = ctrl