;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


;======================================;
;         SPECIAL ATTACK     ;
;======================================;

[Command]
Name= "TheEnd"
command = D, DB, B, D, DB, B, z+y
time = 30

[Command]
Name= "Wutville"
command = D, DB, B, y
time = 30

[Command]
Name= "CanYouQuack"
command = D, DF, F, y
time = 30

[Command]
Name= "Van"
command = D, DF, F, z
time = 30

[Command]
Name= "Disconnection"
command = D, DB, B, z
time = 30

[Command]
Name= "Medic"
command = F,B, z
time = 30

[Command]
Name= "Unusual"
command = B, F, z
time = 30

[Command]
Name= "Teleport_F"
command = F, x
time = 30

[Command]
Name= "Teleport_B"
command = B, x
time = 30


;======================================;
;         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

[Command]
name = "s"
command = s
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 -1, TheEnd]
type = ChangeState
value = 7777
Triggerall = var(59)>0
triggerall = NumHelper(7778) = 0
triggerall = RoundState = 2
triggerall = statetype = S
triggerall = power >= 3000
triggerall = life <= 293
trigger1 = ctrl
Trigger1 = random < 100

[State -1, Shoot] 
Type=Changestate
Triggerall = var(59)>0
Triggerall = alive = 1
trigger1 = statetype != A
triggerall = numhelper(201) = 0 
triggerall = RoundState = 2
triggerall = Numhelper(7778) = 0
Trigger1 = random < 300
Trigger1= ctrl
value = 200

[State -1, TeleportF] 
Type=Changestate
Triggerall = var(59)>0
Triggerall = alive = 1
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = numhelper(301) = 0
Triggerall= ctrl
triggerall = numhelper(301) = 0 
trigger1 = BackEdgeBodyDist < 30
Trigger1 = P2BodyDist X <= 40
Trigger1 = random <(var(50)* 20)
trigger2 = P2BodyDist X <= 40
trigger2 = P2Movetype = A
Trigger2 = random <(var(50)* 20)
Trigger3 = P2BodyDist X <= 40
Trigger3 = Numhelper(7778) = 1
Trigger3 = random <(var(50)* 40)
value = 300

[State -1, TeleportB] 
Type=Changestate
Triggerall = var(59)>0
Triggerall = alive = 1
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = numhelper(301) = 0
Triggerall= ctrl
triggerall = BackEdgeBodyDist > 100
triggerall = numhelper(301) = 0 
Trigger1 = P2BodyDist X <= 30
Trigger1 = random <(var(50)* 20)
trigger2 = P2BodyDist X <= 60
trigger2 = P2Movetype = A
Trigger2 = random <(var(50)* 25)
Trigger3 = Numhelper(7778) = 1
trigger3 = P2BodyDist X <= 60
Trigger3 = random <(var(50)* 40)
value = 305

[State -1, Jarate] 
Type=Changestate
Triggerall = var(59)>0
Triggerall = alive = 1
trigger1 = statetype != A
triggerall = RoundState = 2
triggerall = numhelper(210) = 0
triggerall = power >= 500
Triggerall = P2BodyDist X >= 70
Trigger1 = random <= 900
Trigger1 = random <= 1
Trigger1= ctrl
value = 210

[State -1, Spray] 
Type=Changestate
Triggerall = var(59)>0
Triggerall = alive = 1
triggerall = statetype = S
triggerall = numhelper(1001) = 0 
triggerall = RoundState = 2
Triggerall = time%60 = 0
Triggerall = random <= 15
Trigger1= ctrl
value = 1000

[State -1, Winter Maker]
type = Helper
stateno = 1100
id = 1100
Triggerall = var(59)>0
triggerall = RoundState = 2
triggerall = statetype = S
triggerall = ctrl
triggerall = NumHelper(1300) < 1  
Trigger1 = random <= 1

[State -1, 100000thVisitor] 
Type=Changestate
Triggerall = var(59)>0
Triggerall = alive = 1
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = numhelper(221) < 2 
triggerall = power >= 1000
triggerall = Numhelper(7778) = 0
Trigger1 = ctrl
Trigger1 = random <= 700
Trigger1 = random <= 1
value = 220

[State -1, Medic]
type = ChangeState
Triggerall = var(59)>0
triggerall = numhelper(271)<1
triggerall = statetype = S
triggerall = power >= 1500
trigger1 = ctrl
Trigger1 = random <= 900
Trigger1 = random <= 1
value = 270

[State -1, CanYouQuack] 
Type=Changestate
Triggerall = var(59)>0
Triggerall = alive = 1
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = power >= 1000
triggerall = numhelper(282) = 0 
triggerall = Numhelper(7778) = 0
Trigger1 = ctrl
Trigger1 = random <= 700
Trigger1 = random <= 1
value = 280

[State -1, Wutville] 
Type=Changestate
Triggerall = var(59)>0
Triggerall = alive = 1
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = power >= 1000
triggerall = Numhelper(7778) = 0
Trigger1 = ctrl
Trigger1 = random <= 600
Trigger1 = random <= 1
value = 290

[State -1, Unusual] 
Type=Changestate
Triggerall = var(59)>0
Triggerall = alive = 1
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = power >= 1000
triggerall = numhelper(262) = 0 
triggerall = Numhelper(7778) = 0
Trigger1 = ctrl
Trigger1 = random <= 500
Trigger1 = random <= 1
value = 260

[State -1, Disconnection] 
Type=Changestate
Triggerall = var(59)>0
Triggerall = alive = 1
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = power >= 1000
triggerall = numhelper(251) = 0 
Triggerall = NumHelper(254) = 0
triggerall = Numhelper(7778) = 0
Triggerall = ctrl
Trigger1 = random <= 500
Trigger1 = random <= 1
Trigger2 = P2movetype = H 
trigger2 = P2statetype = A
trigger2 = numhelper(231) = 1
value = 250

[State -1, Van] 
Type=Changestate
Triggerall = var(59)>0
Triggerall = alive = 1
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = power >= 1000
triggerall = numhelper(231) = 0 
triggerall = Numhelper(7778) = 0
Triggerall = ctrl
Trigger1 = random <= 650
Trigger1 = random <= 1
Trigger2 = P2BodyDist X >= 200
Trigger2 = random <= 2
value = 230


[State -1, Wall]
type = ChangeState
triggerall = Var(59)>0
triggerall = RoundState = 2
triggerall = statetype != A
triggerall = numhelper(241) = 0 
triggerall = power >= 500
trigger1 = ctrl
Trigger1 = P2BodyDist X >= 50
Trigger1 = random <= 1
Trigger2 = Numhelper(7778) = 1
Trigger2 = P2BodyDist X >= 50
Trigger2 = random <(var(50)* 40)
value = 240



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


[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

[State -1, TheEnd]
type = ChangeState
value = 7777
triggerall = Var(59) <= 0
triggerall = NumHelper(7778) = 0
triggerall = RoundState = 2
triggerall = command = "TheEnd"
triggerall = statetype = S
triggerall = power >= 3000
triggerall = life <= 293
trigger1 = ctrl

[State -1, CanYouQuack]
type = ChangeState
value = 290
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = command = "Wutville"
triggerall = statetype = S
triggerall = power >= 1000
triggerall = Numhelper(7778) = 0
trigger1 = ctrl

[State -1, CanYouQuack]
type = ChangeState
value = 280
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = command = "CanYouQuack"
triggerall = statetype = S
triggerall = numhelper(282) = 0 
triggerall = power >= 1000
triggerall = Numhelper(7778) = 0
trigger1 = ctrl

[State -1, Teleport_F]
type = ChangeState
value = 300
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = command = "Teleport_F"
triggerall = statetype = S
triggerall = numhelper(301) = 0 
trigger1 = ctrl

[State -1, Teleport_B]
type = ChangeState
value = 305
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = command = "Teleport_B"
triggerall = statetype = S
triggerall = numhelper(301) = 0 
trigger1 = ctrl

[State -1, Shoot]
type = ChangeState
value = 200
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = command = "a"
triggerall = statetype = S
triggerall = numhelper(201) = 0 
triggerall = Numhelper(7778) = 0
trigger1 = ctrl

[State -1, Jarate]
type = ChangeState
value = 210
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = command = "b"
triggerall = statetype = S
triggerall = numhelper(210) = 0
triggerall = power >= 500
trigger1 = ctrl

[State -1, 100000thVisitor]
type = ChangeState
value = 220
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = command = "c"
triggerall = statetype = S
triggerall = numhelper(221) < 2 
triggerall = power >= 1000
triggerall = Numhelper(7778) = 0
trigger1 = ctrl

[State -1, Van]
type = ChangeState
value = 230
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = command = "Van"
triggerall = statetype = S
triggerall = numhelper(231) = 0 
triggerall = power >= 1000
triggerall = Numhelper(7778) = 0
trigger1 = ctrl

[State -1, Wall]
type = ChangeState
value = 240
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = command = "y"
triggerall = statetype = S
triggerall = numhelper(241) = 0 
trigger1 = ctrl

[State -1, Disconnection]
type = ChangeState
value = 250
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = command = "Disconnection"
triggerall = statetype = S
triggerall = numhelper(251) = 0 
Triggerall = NumHelper(254) = 0
triggerall = power >= 1000
triggerall = Numhelper(7778) = 0
trigger1 = ctrl

[State -1, Unusual]
type = ChangeState
value = 260
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = command = "Unusual"
triggerall = statetype = S
triggerall = numhelper(262) = 0 
triggerall = Numhelper(7778) = 0
trigger1 = ctrl

[State -1, Medic]
type = ChangeState
value = 270
triggerall = Var(59) <= 0
triggerall = RoundState = 2 && numhelper(271)<1
triggerall = command = "Medic"
triggerall = statetype = S
triggerall = numhelper(262) = 0 
triggerall = power >= 1500
trigger1 = ctrl

[State -1, Spray]
type = ChangeState
value = 1000
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = command = "s"
triggerall = command != "holdfwd"
triggerall = command != "holddown"
triggerall = command != "holdback"
triggerall = statetype = S
triggerall = numhelper(1001) = 0
trigger1 = ctrl

[State -1, Winter Maker]
type = Helper
stateno = 1100
id = 1100
triggerall = Var(59) <= 0
triggerall = RoundState = 2
triggerall = statetype = S
triggerall = ctrl
triggerall = numhelper(1100)<1
trigger1 = command = "holdfwd"
trigger1 = command = "s"
trigger2 = command = "holddown"
trigger2 = command = "s"
trigger3 = command = "holdback"
trigger3 = command = "s"

[State -1, ChangeState]
type = ChangeState
trigger1 = Numhelper(8888) = 1
value = 7780

