; Clark's Command File
;=====================
;-| CPU Functions |--------------------------------------------------------
[command]
name = Dma1
command = c
time = 20

[command]
name = Throw1
command =  b
time = 20

[command]
name = Throw2
command =  /D, b
time = 20

[command]
name = Drop
command =  b
time = 20

[command]
name = Drop
command =  c
time = 20

[command]
name = Tubro_punch
command = /F, b
time = 20

[Command]
name = Knockdown
command = /D, c
time = 1

;-| Super Motions |--------------------------------------------------------
[command]
name = Dma1
command = ~F,DF,D,DB,B,~F,DF,D,DB,B,x
time = 100

[command]
name = Dma2
command = ~F,DF,D,DB,B,~F,DF,D,DB,B,z
time = 100

;-| Special Motions |------------------------------------------------------
;-----------------
[command]
name = Tubro_punch
command = x,x,x
time = 20

[command]
name = Tubro_punch_a
command = z,z,z
time = 20

[command]
name = Throw1
command =  ~B, DB,D, DF,F,y
time = 20

[command]
name = Throw1_b
command =  ~B, DB,D, DF,F,a
time = 20

[command]
name = Throw2
command =  ~B, DB,D, DF,F,x
time = 20

[command]
name = Drop
command =  ~D, DF,F,x
time = 15

[command]
name = Drop_b
command =  ~D, DF,F,z
time = 15

;-| Single Button |-----------------------------------------------------------
[command]
name = taunt
command = s
time = 1

[command]
name = Light_punch
command = x
time = 1

[command]
name = Light_kick
command = y
time = 1

[command]
name = Strong_punch
command = z
time = 1

[command]
name = Strong_kick
command = a
time = 1

;-| Double Tap |-----------------------------------------------------------
[Command]
name = FF      
command = F, F
time = 10

[Command]
name = BB       
command = B, B
time = 10

;-| 2/3 Button Combination |-----------------------------------------------
[Command]
name = recovery 
command = x+y
time = 1

[Command]
name = Roll_Fwd
command = x+y
time = 1

[Command]
name = Roll_Back
command = /B, x+y
time = 1

[Command]
name = Knockdown
command = z+a
time = 1

;-| Dir + Button |---------------------------------------------------------
[Command]
name = Stand_fwd_kick
command = /F, y
time = 1

;-| Hold Button |-----------------------------------------------------------

[Command]
name = hold_x
command = /x
time = 1

[Command]
name = hold_y
command = /y
time = 1

[Command]
name = hold_z
command = /z
time = 1

;-| Hold Dir |--------------------------------------------------------------
[Command]
name = holdfwd  
command = /$F
time = 1

[Command]
name = holdback 
command = /$B
time = 1

[Command]
name = holdup   
command = /$U
time = 1

[Command]
name = holddown 
command = /$D
time = 1

;---------------------------------------------------------------------------
; State Entry
;============
[Statedef -1]

;RunFwd
[State -1]
type = ChangeState
value = 100
trigger1 = command = FF
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
;RunBack
[State -1]
type = ChangeState
value = 105
trigger1 = command = BB
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; roll fwd
[State -1]
type = ChangeState
value = 510
triggerall = command = Roll_Fwd
triggerall = command != Roll_Back
;trigger1 = command != hold_x
;trigger1 = command != hold_y
trigger1 = statetype != A
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Roll back
[State -1]
type = ChangeState
value = 512
triggerall = command = Roll_Back
;trigger1 = command != hold_x
;trigger1 = command != hold_y
trigger1 = statetype != A
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Charge
[State -1]
type = ChangeState
value = 731
triggerall = statetype = S
triggerall = Power < 3000
triggerall = ctrl = 1
trigger1 = command = hold_x
trigger1 = command = hold_y
trigger1 = command = hold_z

;---------------------------------------------------------------------------
; Taunt
[State -1]
type = ChangeState
value = 195
trigger1 = command = taunt
trigger1 = command != holddown
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Guard cancel roll (forward)
[State -1]
type = ChangeState
value = 800
triggerall = command = Roll_Fwd
triggerall = command != Roll_Back
triggerall = power >= 500
trigger1 = stateno >= 150
trigger1 = stateno <= 152

;---------------------------------------------------------------------------
; Guard cancel roll (backwards)
[State -1]
type = ChangeState
value = 801
triggerall = command = Roll_Back
triggerall = power >= 500
trigger1 = stateno >= 150
trigger1 = stateno <= 152

;---------------------------------------------------------------------------
; Guard reversal
[State -1]
type = ChangeState
value = 251
triggerall = command = Knockdown
triggerall = power >= 1000
trigger1 = stateno >= 150
trigger1 = stateno <= 152

;---------------------------------------------------------------------------
; Dash Up Foward
;[State -1]
;type = ChangeState
;value = 700
;trigger1 = command = holdupFwd
;trigger1 = stateno = 100
;trigger1 = AnimElem >= 1, >= 0

;---------------------------------------------------------------------------
; Light punch
[State -1]
type = ChangeState
value = 200
triggerall = command != Tubro_punch
triggerall = command != Throw2
triggerall = command != Dma1
triggerall = command != holddown
trigger1 = statetype = S
trigger1 = command = Light_punch
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Crouching light punch
[State -1]
type = ChangeState
value = 201
triggerall = command != Tubro_punch
triggerall = command != Throw2
triggerall = command != Dma1
trigger1 = statetype = C
trigger1 = command = Light_punch
trigger1 = command = holddown
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Jumping light punch
[State -1]
type = ChangeState
value = 600
triggerall = command != Dma1
triggerall = command != Throw2
trigger1 = command = Light_punch
trigger1 = statetype = A
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Light kick
[State -1]
type = ChangeState
value = 210
triggerall = command != Stand_fwd_kick
triggerall = command != Throw1
trigger1 = statetype = S
trigger1 = P2bodydist X <= 12
trigger1 = ctrl = 1
trigger1 = command = Light_kick
trigger1 = command != holddown

;---------------------------------------------------------------------------
; Light kick(near)
[State -1]
type = ChangeState
value = 211
triggerall = command != Stand_fwd_kick
triggerall = command != Throw1
trigger1 = statetype = S
trigger1 = P2bodydist X > 12
trigger1 = ctrl = 1
trigger1 = command = Light_kick
trigger1 = command != holddown

;---------------------------------------------------------------------------
; Crouching light kick
[State -1]
type = ChangeState
value = 213
trigger1 = statetype = C
trigger1 = ctrl = 1
trigger1 = command = Light_kick
trigger1 = command = holddown

;---------------------------------------------------------------------------
; Standing forward kick
[State -1]
type = ChangeState
value = 212
triggerall = command = Stand_fwd_kick
triggerall = command != Throw1
trigger1 = command != holddown
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Jumping light kick
[State -1]
type = ChangeState
value = 601
trigger1 = command = Light_kick
trigger1 = statetype = A
trigger1 = Vel X = 0
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Jumping forward light kick
[State -1]
type = ChangeState
value = 602
trigger1 = command = Light_kick
trigger1 = statetype = A
trigger1 = Vel X != 0
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Standing near strong punch
[State -1]
type = ChangeState
value = 220
triggerall = command = Strong_punch
triggerall = command != Dma2
triggerall = command != Knockdown
triggerall = command != Tubro_punch_a
triggerall = command != holddown
trigger1 = P2bodydist X <= 42
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Cancel strong punch to forward kick
[State -1]
type = ChangeState
value = 214
trigger1 = command = Stand_fwd_kick
trigger1 = stateno = 220
trigger1 = command != Throw1
trigger1 = command != holddown
trigger1 = AnimElem = 3, >= 1
trigger1 = AnimElem = 3, <= 2

;---------------------------------------------------------------------------
; Cancel strong punch to turbo punch
[State -1]
type = ChangeState
value = 810
triggerall = movehit = 1
triggerall = stateno = 220
triggerall = command != Throw1
triggerall = command != holddown
triggerall = AnimElem = 3, >= 1
triggerall = AnimElem = 3, <= 2
trigger1 = command = Tubro_punch
trigger2 = command = Tubro_punch_a

;---------------------------------------------------------------------------
; Standing far strong punch
[State -1]
type = ChangeState
value = 225
triggerall = command = Strong_punch
triggerall = command != Dma2
triggerall = command != Knockdown
triggerall = command != Tubro_punch_a
triggerall = command != holddown
trigger1 = P2bodydist X > 42
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Crouching strong punch
[State -1]
type = ChangeState
value = 221
triggerall = command = Strong_punch
triggerall = command != Dma2
triggerall = command != Knockdown
triggerall = command != Tubro_punch_a
trigger1 = command = holddown
trigger1 = statetype = C
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Jumping strong punch
[State -1]
type = ChangeState
value = 603
triggerall = command != Knockdown
triggerall = command != Dma2
trigger1 = command = Strong_punch
trigger1 = statetype = A
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Standing far strong kick
[State -1]
type = ChangeState
value = 230
triggerall = command = Strong_kick
triggerall = command != Knockdown
trigger1 = command != holddown
trigger1 = command != Throw1_b
trigger1 = P2bodydist X > 52
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Standing far strong kick
[State -1]
type = ChangeState
value = 232
triggerall = command = Strong_kick
triggerall = command != Knockdown
trigger1 = command != holddown
trigger1 = command != Throw1_b
trigger1 = P2bodydist X <= 52
trigger1 = statetype = S
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Crouching strong kick
[State -1]
type = ChangeState
value = 233
triggerall = command = Strong_kick
triggerall = command != Knockdown
trigger1 = command = holddown
trigger1 = command != Throw1_b
trigger1 = statetype = C
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Jumping forward strong kick
[State -1]
type = ChangeState
value = 604
triggerall = command != Knockdown
trigger1 = command = Strong_kick
trigger1 = statetype = A
trigger1 = Vel X != 0
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Jumping strong kick
[State -1]
type = ChangeState
value = 605
triggerall = command != Knockdown
trigger1 = command = Strong_kick
trigger1 = statetype = A
trigger1 = Vel X = 0
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Knockdown
[State -1]
type = ChangeState
value = 250
triggerall = command = Knockdown
trigger1 = statetype != A
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Jumping Knockdown
[State -1]
type = ChangeState
value = 255
trigger1 = command = Knockdown
trigger1 = statetype = A
trigger1 = ctrl = 1

;---------------------------------------------------------------------------
; Clark turbo punch
[State -1]
type = ChangeState
value = 810
triggerall = command != Dma1
triggerall = command != Dma2
triggerall = command != Throw2
triggerall = stateno != 810
triggerall = statetype != A
;triggerall = statetype = C
;triggerall = statetype = S
triggerall = ctrl = 1
trigger1 = command = Tubro_punch
trigger2 = command = Tubro_punch_a

;---------------------------------------------------------------------------
; Cancel clark turbo punch to throw 1
[State -1]
type = ChangeState
value = 910
triggerall = stateno = 810
triggerall = AnimElem = 4, >= 1
triggerall = AnimElem = 18, <= 3
triggerall = movehit = 1
triggerall = command != Throw2
trigger1 = command = Throw1
trigger2 = command = Throw1_b

;---------------------------------------------------------------------------
; Cancel clark turbo punch to throw 2
[State -1]
type = ChangeState
value = 930
triggerall = stateno = 810
triggerall = AnimElem = 4, >= 1
triggerall = AnimElem = 18, <= 3
triggerall = movehit = 1
trigger1 = command = Throw2

;---------------------------------------------------------------------------
; Cancel clark turbo punch to super throw
[State -1]
type = ChangeState
value = 1000
triggerall = power >= 1000
triggerall = stateno = 810
triggerall = AnimElem = 4, >= 1
triggerall = AnimElem = 18, <= 3
triggerall = movehit = 1
trigger1 = command = Dma1
trigger2 = command = Dma2

;---------------------------------------------------------------------------
; Throw 1
[State -1]
type = ChangeState
value = 900
triggerall = stateno != 901
triggerall = stateno != 105
triggerall = stateno != 106
triggerall = stateno != 150
triggerall = stateno != 151
triggerall = stateno != 152
triggerall = stateno != 5000
triggerall = stateno != 5001
triggerall = stateno != 5002
triggerall = stateno != 5005
triggerall = stateno != 5006
triggerall = stateno != 5007
triggerall = stateno != 5010
triggerall = stateno != 5011
triggerall = stateno != 5012
triggerall = stateno != 5015
triggerall = stateno != 5016
triggerall = stateno != 5017
triggerall = stateno != 5020
triggerall = stateno != 5021
triggerall = stateno != 5022
triggerall = stateno != 5025
triggerall = stateno != 5026
triggerall = stateno != 5027
triggerall = stateno != 5030
triggerall = stateno != 5035
triggerall = stateno != 5040
triggerall = stateno != 5050
triggerall = stateno != 5051
triggerall = stateno != 5070
triggerall = stateno != 5080
triggerall = stateno != 5090
triggerall = stateno != 5100
triggerall = stateno != 5105
triggerall = stateno != 5155
triggerall = stateno != 5200
triggerall = stateno != 5210
triggerall = stateno != 5300
triggerall = statetype != A
triggerall = command != Throw2
triggerall = command != Tubro_punch
triggerall = ctrl = 1
trigger1 = command = Throw1
trigger2 = command = Throw1_b

;---------------------------------------------------------------------------
; Throw 2
[State -1]
type = ChangeState
value = 930
triggerall = stateno != 901
triggerall = stateno != 932
triggerall = stateno != 105
triggerall = stateno != 106
triggerall = stateno != 150
triggerall = stateno != 151
triggerall = stateno != 152
triggerall = stateno != 5000
triggerall = stateno != 5001
triggerall = stateno != 5002
triggerall = stateno != 5005
triggerall = stateno != 5006
triggerall = stateno != 5007
triggerall = stateno != 5010
triggerall = stateno != 5011
triggerall = stateno != 5012
triggerall = stateno != 5015
triggerall = stateno != 5016
triggerall = stateno != 5017
triggerall = stateno != 5020
triggerall = stateno != 5021
triggerall = stateno != 5022
triggerall = stateno != 5025
triggerall = stateno != 5026
triggerall = stateno != 5027
triggerall = stateno != 5030
triggerall = stateno != 5035
triggerall = stateno != 5040
triggerall = stateno != 5050
triggerall = stateno != 5051
triggerall = stateno != 5070
triggerall = stateno != 5080
triggerall = stateno != 5090
triggerall = stateno != 5100
triggerall = stateno != 5105
triggerall = stateno != 5155
triggerall = stateno != 5200
triggerall = stateno != 5210
triggerall = stateno != 5300
triggerall = statetype != A
triggerall = ctrl = 1
trigger1 = command = Throw2

;---------------------------------------------------------------------------
; Drop
[State -1]
type = ChangeState
value = 926
triggerall = command = Drop
trigger1 = AnimElem = 9, >= 0
trigger1 = AnimElem = 11, <= 7
trigger1 = stateno = 901
trigger2 = AnimElem = 11, >= 15
trigger2 = AnimElem = 12, <= 6
trigger2 = stateno = 932

;---------------------------------------------------------------------------
; Drop b
[State -1]
type = ChangeState
value = 926
triggerall = command = Drop_b
trigger1 = AnimElem = 9, >= 0
trigger1 = AnimElem = 11, <= 7
trigger1 = stateno = 901
trigger2 = AnimElem = 11, >= 15
trigger2 = AnimElem = 12, <= 6
trigger2 = stateno = 932

;---------------------------------------------------------------------------
; Cancel strong punch to throw 1
[State -1]
type = ChangeState
value = 910
triggerall = statetype != A
triggerall = stateno != 901
triggerall = stateno != 105
triggerall = stateno != 106
triggerall = stateno != 150
triggerall = stateno != 151
triggerall = stateno != 152
triggerall = command != Tubro_punch
triggerall = command != Throw2
triggerall = movehit = 1
triggerall = stateno = 220
triggerall = AnimElem = 3, >= 1
triggerall = AnimElem = 3, <= 2
trigger1 = command = Throw1
trigger2 = command = Throw1_b

;---------------------------------------------------------------------------
; Cancel strong punch to throw 2
[State -1]
type = ChangeState
value = 930
triggerall = statetype != A
triggerall = stateno != 932
triggerall = stateno != 105
triggerall = stateno != 106
triggerall = stateno != 150
triggerall = stateno != 151
triggerall = stateno != 152
triggerall = movehit = 1
triggerall = stateno = 220
triggerall = AnimElem = 3, >= 1
triggerall = AnimElem = 3, <= 2
trigger1 = command = Throw2

;---------------------------------------------------------------------------
; Cancel strong punch to super throw
[State -1]
type = ChangeState
value = 1000
triggerall = power >= 1000
triggerall = statetype != A
triggerall = stateno != 1000
triggerall = stateno != 105
triggerall = stateno != 106
triggerall = stateno != 150
triggerall = stateno != 151
triggerall = stateno != 152
triggerall = movehit = 1
triggerall = stateno = 220
triggerall = AnimElem = 3, >= 1
triggerall = AnimElem = 3, <= 2
trigger1 = command = Dma1
trigger2 = command = Dma2

;---------------------------------------------------------------------------
; Cancel foward kick (fast) to throw 1 
[State -1]
type = ChangeState
value = 910
triggerall = statetype != A
triggerall = stateno != 901
triggerall = stateno != 930
triggerall = stateno != 105
triggerall = stateno != 106
triggerall = stateno != 150
triggerall = stateno != 151
triggerall = stateno != 152
triggerall = command != Tubro_punch
triggerall = command != Throw2
triggerall = movehit = 1
triggerall = stateno = 214
triggerall = AnimElem = 3, >= 1
triggerall = AnimElem = 7, <= 2
trigger1 = command = Throw1_b
trigger2 = command = Throw1

;---------------------------------------------------------------------------
; Cancel foward kick (fast) to throw 2
[State -1]
type = ChangeState
value = 930
triggerall = statetype != A
triggerall = stateno != 932
triggerall = stateno != 910
triggerall = stateno != 105
triggerall = stateno != 106
triggerall = stateno != 150
triggerall = stateno != 151
triggerall = stateno != 152
triggerall = movehit = 1
triggerall = stateno = 214
triggerall = AnimElem = 4, >= 1
triggerall = AnimElem = 7, <= 2
trigger1 = command = Throw2

;---------------------------------------------------------------------------
; Cancel foward kick to throw 1 
[State -1]
type = ChangeState
value = 910
triggerall = statetype != A
triggerall = stateno != 901
triggerall = stateno != 930
triggerall = stateno != 105
triggerall = stateno != 106
triggerall = stateno != 150
triggerall = stateno != 151
triggerall = stateno != 152
triggerall = command != Tubro_punch
triggerall = command != Throw2
triggerall = movehit = 1
triggerall = stateno = 212
triggerall = AnimElem = 3, >= 1
triggerall = AnimElem = 7, <= 2
trigger1 = command = Throw1_b
trigger2 = command = Throw1

;---------------------------------------------------------------------------
; Cancel foward kick to throw 2
[State -1]
type = ChangeState
value = 930
triggerall = statetype != A
triggerall = stateno != 932
triggerall = stateno != 910
triggerall = stateno != 105
triggerall = stateno != 106
triggerall = stateno != 150
triggerall = stateno != 151
triggerall = stateno != 152
triggerall = movehit = 1
triggerall = stateno = 212
triggerall = AnimElem = 5, >= 3
triggerall = AnimElem = 7, <= 2
trigger1 = command = Throw2

;---------------------------------------------------------------------------
; Clark's super throw 
[State -1]
type = ChangeState
value = 1000
triggerall = power >= 1000
triggerall = stateno != 1000
triggerall = stateno != 105
triggerall = stateno != 106
triggerall = stateno != 150
triggerall = stateno != 151
triggerall = stateno != 152
triggerall = stateno != 5000
triggerall = stateno != 5001
triggerall = stateno != 5002
triggerall = stateno != 5005
triggerall = stateno != 5006
triggerall = stateno != 5007
triggerall = stateno != 5010
triggerall = stateno != 5011
triggerall = stateno != 5012
triggerall = stateno != 5015
triggerall = stateno != 5016
triggerall = stateno != 5017
triggerall = stateno != 5020
triggerall = stateno != 5021
triggerall = stateno != 5022
triggerall = stateno != 5025
triggerall = stateno != 5026
triggerall = stateno != 5027
triggerall = stateno != 5030
triggerall = stateno != 5035
triggerall = stateno != 5040
triggerall = stateno != 5050
triggerall = stateno != 5051
triggerall = stateno != 5070
triggerall = stateno != 5080
triggerall = stateno != 5090
triggerall = stateno != 5100
triggerall = stateno != 5105
triggerall = stateno != 5155
triggerall = stateno != 5200
triggerall = stateno != 5210
triggerall = stateno != 5300
trigger1 = command != Knockdown
triggerall = statetype != A
triggerall = ctrl = 1
trigger1 = command = Dma1
trigger2 = command = Dma2

;---------------------------------------------------------------------------
; Landing performing super throw
;[State -1]
;type = ChangeState
;value = 1000
;triggerall = power >= 1000
;triggerall = stateno = 047
;triggerall = AnimElem = 1, >= 0
;trigger1 = command = Dma1
;trigger2 = command = Dma2
;
;---------------------------------------------------------------------------
; Rolling performing super throw
;[State -1]
;type = ChangeState
;value = 1000
;triggerall = power >= 1000
;triggerall = stateno = 510
;triggerall = AnimElem = 8, >= 0
;triggerall = AnimElem = 9, >= 3
;trigger1 = command = Dma1
;trigger2 = command = Dma2