;-| for AI |---------------------------------------------------------------
[Command]
name = "AI0"
command = a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a
time = 0

[Command]
name = "AI1"
command = b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b
time = 0

[Command]
name = "AI2"
command = c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
time = 0

[Command]
name = "AI3"
command = x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time = 0

[Command]
name = "AI4"
command = y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time = 0

[Command]
name = "AI5"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time = 0

[Command]
name = "AI6"
command = s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s
time = 0

[Command]
name = "AI7"
command = F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F
time = 0

[Command]
name = "AI8"
command = D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D
time = 0

[Command]
name = "AI9"
command = B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B
time = 0

[Command]
name = "AI10"
command = U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U
time = 0

[Command]
name = "AI11"
command = a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,b
time = 0

[Command]
name = "AI12"
command = c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,x
time = 0

[Command]
name = "AI13"
command = x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,y
time = 0

[Command]
name = "AI14"
command = y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,z
time = 0

[Command]
name = "AI15"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,s
time = 0

[Command]
name = "AI16"
command = s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,a
time = 0

[Command]
name = "AI17"
command = a,B,c,x,y,z,s,B,D,F,U,a,b,c,x,y,z,s,s
time = 0

[Command]
name = "AI18"
command = a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,c
time = 0

[Command]
name = "AI19"
command = b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,x
time = 0

[Command]
name = "AI20"
command = c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,y
time = 0

[Command]
name = "AI21"
command = x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,z
time = 0

[Command]
name = "AI22"
command = y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,s
time = 0

[Command]
name = "AI23"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,a
time = 0

[Command]
name = "AI24"
command = s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,b
time = 0

[Command]
name = "AI25"
command = F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,D
time = 0

[Command]
name = "AI26"
command = D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,B
time = 0

[Command]
name = "AI27"
command = B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,U
time = 0

;-| Super Motions |--------------------------------------------------------
; Rekka Shinken (Violent Fire Grand Fist)
[Command]
name = "rekkashinken_x"
command = ~D, DF, F, D, DF, F, x
time = 25
[Command]
name = "rekkashinken_y"
command = ~D, DF, F, D, DF, F, y
time = 25
[Command]
name = "rekkashinken_z"
command = ~D, DF, F, D, DF, F, z
time = 25

; Ryu Yassai (Dragon 8-fold Smash)
; Ryu Shin Yassai (Dragon Great 8-fold Smash)
[Command]
name = "ryuyassai_x"
command = ~D, DB, B, D, DB, B, x
time = 25
[Command]
name = "ryuyassai_y"
command = ~D, DB, B, D, DB, B, y
time = 25
[Command]
name = "ryuyassai_z"
command = ~D, DB, B, D, DB, B, z
time = 25

; Shien Renkyaku (Flame Continuous Kick)
[Command]
name = "shienrenkyaku_a"
command = ~D, DB, B, D, DB, B, a
time = 25
[Command]
name = "shienrenkyaku_b"
command = ~D, DB, B, D, DB, B, b
time = 25
[Command]
name = "shienrenkyaku_c"
command = ~D, DB, B, D, DB, B, c
time = 25

; Ultimate Combo
[Command]
name = "ultimate_x"
command = ~B, F, B, F, x
time = 25
[Command]
name = "ultimate_y"
command = ~B, F, B, F, y
time = 25
[Command]
name = "ultimate_z"
command = ~B, F, B, F, z
time = 25

; Shin Dragon Stomp
[Command]
name = "sstomp_a"
command = ~D, D, D, D, a
time = 30
[Command]
name = "sstomp_b"
command = ~D, D, D, D, b
time = 30
[Command]
name = "sstomp_c"
command = ~D, D, D, D, c
time = 30

;-| Special Motions |------------------------------------------------------
; Rekkukyaku (Violent Wind Kick)
[Command]
name = "rekkukyaku_a"
command = ~B, DB, D, DF, F, a
[Command]
name = "rekkukyaku_b"
command = ~B, DB, D, DF, F, b
[Command]
name = "rekkukyaku_c"
command = ~B, DB, D, DF, F, c

; Rekkaken (Violent Fire Fist)
[Command]
name = "rekkaken_x"
command = ~D, DF, F, x
[Command]
name = "rekkaken_y"
command = ~D, DF, F, y
[Command]
name = "rekkaken_z"
command = ~D, DF, F, z

; Shienkyaku (Flame Kick)
[Command]
name = "shienkyaku_a"
command = ~B, D, DB, a
[Command]
name = "shienkyaku_b"
command = ~B, D, DB, b
[Command]
name = "shienkyaku_c"
command = ~B, D, DB, c

; Dragon Kick
[Command]
name = "dragon_a"
command = ~F, D, DF, a
[Command]
name = "dragon_b"
command = ~F, D, DF, b
[Command]
name = "dragon_c"
command = ~F, D, DF, c

; Dragon Stomp
[Command]
name = "stomp_a"
command = ~D, D, a
[Command]
name = "stomp_b"
command = ~D, D, b
[Command]
name = "stomp_c"
command = ~D, D, c

; Flaming Dragon Fist
[Command]
name = "fdragon_x"
command = ~20$B, F, x
[Command]
name = "fdragon_y"
command = ~20$B, F, y
[Command]
name = "fdragon_z"
command = ~20$B, F, z

; One-Inch Fist
[Command]
name = "fist_x"
command = ~B, F, x
[Command]
name = "fist_y"
command = ~B, F, y
[Command]
name = "fist_z"
command = ~B, F, z
 
;-| Double Tap |-----------------------------------------------------------
[Command]
name = "FF"     ;Required (do not remove)
command = F, F
time = 10

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

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

[Command]
name = "recovery"
command = y+z
time = 1

[Command]
name = "recovery"
command = x+z
time = 1

[Command]
name = "recovery"
command = a+b
time = 1

[Command]
name = "recovery"
command = b+c
time = 1

[Command]
name = "recovery"
command = a+c
time = 1

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

[Command]
name = "2p"
command = y+z
time = 1

[Command]
name = "2p"
command = x+z
time = 1

[Command]
name = "2k"
command = a+b
time = 1

[Command]
name = "2k"
command = b+c
time = 1

[Command]
name = "2k"
command = a+c
time = 1

;-| Dir + Button |---------------------------------------------------------
[Command]
name = "back_x"
command = /$B,x
time = 1

[Command]
name = "back_y"
command = /$B,y
time = 1

[Command]
name = "back_z"
command = /$B,z
time = 1

[Command]
name = "down_x"
command = /$D,x
time = 1

[Command]
name = "down_y"
command = /$D,y
time = 1

[Command]
name = "down_z"
command = /$D,z
time = 1

[Command]
name = "fwd_x"
command = /$F,x
time = 1

[Command]
name = "fwd_y"
command = /$F,y
time = 1

[Command]
name = "fwd_z"
command = /$F,z
time = 1

[Command]
name = "up_x"
command = /$U,x
time = 1

[Command]
name = "up_y"
command = /$U,y
time = 1

[Command]
name = "up_z"
command = /$U,z
time = 1

[Command]
name = "back_a"
command = /$B,a
time = 1

[Command]
name = "back_b"
command = /$B,b
time = 1

[Command]
name = "back_c"
command = /$B,c
time = 1

[Command]
name = "down_a"
command = /$D,a
time = 1

[Command]
name = "down_b"
command = /$D,b
time = 1

[Command]
name = "down_c"
command = /$D,c
time = 1

[Command]
name = "fwd_a"
command = /$F,a
time = 1

[Command]
name = "fwd_b"
command = /$F,b
time = 1

[Command]
name = "fwd_c"
command = /$F,c
time = 1

[Command]
name = "up_a"
command = /$U,a
time = 1

[Command]
name = "up_b"
command = /$U,b
time = 1

[Command]
name = "up_c"
command = /$U,c
time = 1

;-| Single Button |---------------------------------------------------------
[Command]
name = "fwd"
command = F
time = 1

[Command]
name = "back"
command = B
time = 1

[Command]
name = "up"
command = U
time = 1

[Command]
name = "down"
command = D
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 = "x"
command = x
time = 1

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

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

[Command]
name = "start"
command = s
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

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

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

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

[Command]
name = "hold_start"
command = /s
time = 1

;-| Hold Dir |--------------------------------------------------------------
[Command]
name = "holdfwd" ;Required (do not remove)
command = /$F
time = 1

[Command]
name = "holddownfwd"
command = /$DF
time = 1

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

[Command]
name = "holddownback"
command = /$DB
time = 1

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

[Command]
name = "holdupback"
command = /$UB
time = 1

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

[Command]
name = "holdupfwd"
command = /$UF
time = 1

;---------------------------------------------------------------------------
; Don't remove the following line. It's required by the CMD standard.
[Statedef -1]

;===========================================================================
;---------------------------------------------------------------------------
; Super Moves
;---------------------------------------------------------------------------
; Ultimate Combo
[State -1, Ultimate]
type = ChangeState
value = 4000
triggerall = Var(59) = 0
triggerall = power >= 1000
triggerall = command = "ultimate_x"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, Ultimate]
type = ChangeState
value = 4010
triggerall = Var(59) = 0
triggerall = power >= 2000
triggerall = command = "ultimate_y"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, Ultimate]
type = ChangeState
value = 4020
triggerall = Var(59) = 0
triggerall = power >= 3000
triggerall = command = "ultimate_z"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Rekka Shinken
[State -1, RekkaShinken]
type = ChangeState
value = 3000
triggerall = Var(59) = 0
triggerall = power >= 1000
triggerall = command = "rekkashinken_x"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, RekkaShinken]
type = ChangeState
value = 3010
triggerall = Var(59) = 0
triggerall = power >= 2000
triggerall = command = "rekkashinken_y"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, RekkaShinken]
type = ChangeState
value = 3020
triggerall = Var(59) = 0
triggerall = power >= 3000
triggerall = command = "rekkashinken_z"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Ryu Yassai
[State -1, RyuYassai]
type = ChangeState
value = 3100
triggerall = Var(59) = 0
triggerall = PalNo < 7
triggerall = power >= 3000
triggerall = command = "ryuyassai_x" || command = "ryuyassai_y" || command = "ryuyassai_z"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, RyuYassai]
type = ChangeState
value = 3110
triggerall = Var(59) = 0
triggerall = PalNo > 6
triggerall = power >= 1000
triggerall = command = "ryuyassai_x"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, RyuYassai]
type = ChangeState
value = 3120
triggerall = Var(59) = 0
triggerall = PalNo > 6
triggerall = power >= 2000
triggerall = command = "ryuyassai_y"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, RyuYassai]
type = ChangeState
value = 3130
triggerall = Var(59) = 0
triggerall = PalNo > 6
triggerall = power >= 3000
triggerall = command = "ryuyassai_z"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Shien Renkyaku
[State -1, ShienRenkyaku]
type = ChangeState
value = 3200
triggerall = Var(59) = 0
triggerall = power >= 1000
triggerall = command = "shienrenkyaku_a"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, ShienRenkyaku]
type = ChangeState
value = 3210
triggerall = Var(59) = 0
triggerall = power >= 2000
triggerall = command = "shienrenkyaku_b"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, ShienRenkyaku]
type = ChangeState
value = 3220
triggerall = Var(59) = 0
triggerall = power >= 3000
triggerall = command = "shienrenkyaku_c"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Shin Dragon Stomp
[State -1, sstomp]
type = ChangeState
value = 3300
triggerall = Var(59) = 0
triggerall = power >= 1000
triggerall = command = "sstomp_a"
triggerall = statetype != A
trigger1 = ctrl

[State -1, sstomp]
type = ChangeState
value = 3300
triggerall = Var(59) = 0
triggerall = power >= 1000
triggerall = command = "sstomp_b"
triggerall = statetype != A
trigger1 = ctrl

[State -1, sstomp]
type = ChangeState
value = 3300
triggerall = Var(59) = 0
triggerall = power >= 1000
triggerall = command = "sstomp_c"
triggerall = statetype != A
trigger1 = ctrl

;===========================================================================
;---------------------------------------------------------------------------
; Special Moves
;---------------------------------------------------------------------------
; Alpha Counter
[State -1, Counter]
type = ChangeState
value = 900
triggerall = power >= 1000
triggerall = command = "2k"
triggerall = statetype != A
trigger1 = stateno = 150
trigger2 = stateno = 151
trigger3 = stateno = 152
trigger4 = stateno = 153

;---------------------------------------------------------------------------
; Dragon Fist
[State -1, ChangeState]
type = ChangeState
value = 4100
triggerall = Var(59) = 0
triggerall = Vel X = 0
triggerall = command = "2p"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Dragon Kick
[State -1, Dragon_Kick]
type = ChangeState
value = 4110
triggerall = Var(59) = 0
triggerall = Vel X = 0
triggerall = command = "2k"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Rekkaken
[State -1, Rekkaken]
type = ChangeState
value = 1000
triggerall = Var(59) = 0
triggerall = command = "rekkaken_x"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, Rekkaken]
type = ChangeState
value = 1010
triggerall = Var(59) = 0
triggerall = command = "rekkaken_y"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, Rekkaken]
type = ChangeState
value = 1020
triggerall = Var(59) = 0
triggerall = command = "rekkaken_z"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Shienkyaku
[State -1, shienkyaku]
type = ChangeState
value = 1100
triggerall = Var(59) = 0
triggerall = command = "shienkyaku_a"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, shienkyaku]
type = ChangeState
value = 1110
triggerall = Var(59) = 0
triggerall = command = "shienkyaku_b"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, shienkyaku]
type = ChangeState
value = 1120
triggerall = Var(59) = 0
triggerall = command = "shienkyaku_c"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Rekkukyaku
[State -1, shienkyaku]
type = ChangeState
value = 1200
triggerall = Var(59) = 0
triggerall = command = "rekkukyaku_a"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, shienkyaku]
type = ChangeState
value = 1210
triggerall = Var(59) = 0
triggerall = command = "rekkukyaku_b"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, shienkyaku]
type = ChangeState
value = 1220
triggerall = Var(59) = 0
triggerall = command = "rekkukyaku_c"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Dragon Kick
[State -1, dragon]
type = ChangeState
value = 1300
triggerall = Var(59) = 0
triggerall = command = "dragon_a"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, dragon]
type = ChangeState
value = 1310
triggerall = Var(59) = 0
triggerall = command = "dragon_b"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, dragon]
type = ChangeState
value = 1320
triggerall = Var(59) = 0
triggerall = command = "dragon_c"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Dragon Stomp
[State -1, stomp]
type = ChangeState
value = 1400
triggerall = Var(59) = 0
triggerall = command = "stomp_a"
triggerall = statetype != A
trigger1 = ctrl

[State -1, stomp]
type = ChangeState
value = 1400
triggerall = Var(59) = 0
triggerall = command = "stomp_b"
triggerall = statetype != A
trigger1 = ctrl

[State -1, stomp]
type = ChangeState
value = 1400
triggerall = Var(59) = 0
triggerall = command = "stomp_c"
triggerall = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Flaming Dragon Fit
[State -1, fdragon]
type = ChangeState
value = 1600
triggerall = Var(59) = 0
triggerall = command = "fdragon_x"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, fdragon]
type = ChangeState
value = 1610
triggerall = Var(59) = 0
triggerall = command = "fdragon_y"
trigger1 = statetype != A
trigger1 = ctrl

[State -1, fdragon]
type = ChangeState
value = 1620
triggerall = Var(59) = 0
triggerall = command = "fdragon_z"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; One-Inch Fist
[State -1, fist]
type = ChangeState
value = 1500
triggerall = Var(59) = 0
triggerall = command = "fist_x"
triggerall = statetype != A
trigger1 = ctrl

[State -1, fist]
type = ChangeState
value = 1500
triggerall = Var(59) = 0
triggerall = command = "fist_y"
triggerall = statetype != A
trigger1 = ctrl

[State -1, fist]
type = ChangeState
value = 1500
triggerall = Var(59) = 0
triggerall = command = "fist_z"
triggerall = statetype != A
trigger1 = ctrl

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

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

;---------------------------------------------------------------------------
; Recovery Roll Backward
[State -1, Roll_back]
type = ChangeState
value = 5220
triggerall = alive
triggerall = stateno != 5120
triggerall = stateno != 5291
triggerall = command = "holdback"
triggerall = command = "recovery"
trigger1 = statetype = L

; Recovery Roll Forward
[State -1, Roll_fwd]
type = ChangeState
value = 5230
triggerall = alive
triggerall = stateno != 5120
triggerall = stateno != 5291
triggerall = command = "holdfwd"
triggerall = command = "recovery"
trigger1 = statetype = L

;---------------------------------------------------------------------------
; Throw Attack
[State -1, Throw]
type = ChangeState
value = 800
triggerall = Var(59) = 0
triggerall = command = "holdfwd" || command = "holdback"
triggerall = command = "2p"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Overhead Throw
[State -1, Throw]
type = ChangeState
value = 810
triggerall = Var(59) = 0
triggerall = command = "holdfwd" || command = "holdback"
triggerall = command = "2k"
trigger1 = statetype = S
trigger1 = ctrl

;===========================================================================
;---------------------------------------------------------------------------
; Taunt
[State -1, Taunt]
type = ChangeState
value = 195
triggerall = Var(59) = 0
triggerall = command = "start"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Stand Light Punch
[State -1, Stand Light Punch]
type = ChangeState
value = 200
triggerall = Var(59) = 0
triggerall = command = "x"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Stand Medium Punch
[State -1, Stand Medium Punch]
type = ChangeState
value = 210
triggerall = Var(59) = 0
triggerall = command = "y"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Stand Strong Punch
[State -1, Stand Strong Punch]
type = ChangeState
value = 220
triggerall = Var(59) = 0
triggerall = command = "z"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Stand Light Kick
[State -1, Stand Light Kick]
type = ChangeState
value = 230
triggerall = Var(59) = 0
triggerall = command = "a"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Standing Medium Kick
[State -1, Standing Medium Kick]
type = ChangeState
value = 240
triggerall = Var(59) = 0
triggerall = command = "b"
triggerall = command != "holdfwd"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Medium Hop Kick
[State -1, Hop Kick]
type = ChangeState
value = 242
triggerall = Var(59) = 0
triggerall = command = "fwd_b"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Standing Strong Kick
[State -1, Standing Strong Kick]
type = ChangeState
value = 250
triggerall = Var(59) = 0
triggerall = command = "c"
triggerall = command != "holdfwd"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Strong Hop Kick
[State -1, Hop Kick]
type = ChangeState
value = 252
triggerall = Var(59) = 0
triggerall = command = "fwd_c"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
; Crouching Light Punch
[State -1, Crouching Light Punch]
type = ChangeState
value = 400
triggerall = Var(59) = 0
triggerall = command = "x"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Crouching Medium Punch
[State -1, Crouching Medium Punch]
type = ChangeState
value = 410
triggerall = Var(59) = 0
triggerall = command = "y"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Crouching Strong Punch
[State -1, Crouching Strong Punch]
type = ChangeState
value = 420
triggerall = Var(59) = 0
triggerall = command = "z"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Crouching Light Kick
[State -1, Crouching Light Kick]
type = ChangeState
value = 430
triggerall = Var(59) = 0
triggerall = command = "a"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Crouching Medium Kick
[State -1, Crouching Medium Kick]
type = ChangeState
value = 440
triggerall = Var(59) = 0
triggerall = command = "b"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Crouching Strong Kick
[State -1, Crouching Strong Kick]
type = ChangeState
value = 450
triggerall = Var(59) = 0
triggerall = command = "c"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl

;---------------------------------------------------------------------------
; Jump Light Punch
[State -1, Jump Light Punch]
type = ChangeState
value = 600
triggerall = Var(59) = 0
triggerall = command = "x"
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Jump Medium Punch
[State -1, Jump Medium Punch]
type = ChangeState
value = 610
triggerall = Var(59) = 0
triggerall = command = "y"
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Jump Strong Punch
[State -1, Jump Strong Punch]
type = ChangeState
value = 620
triggerall = command = "z"
triggerall = Var(59) = 0
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Jump Light Kick
[State -1, Jump Light Kick]
type = ChangeState
value = 630
triggerall = command = "a"
triggerall = Var(59) = 0
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Jump Medium Kick
[State -1, Jump Medium Kick]
type = ChangeState
value = 640
triggerall = Var(59) = 0
triggerall = command = "b"
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Jump Strong Kick
[State -1, Jump Strong Kick]
type = ChangeState
value = 650
triggerall = Var(59) = 0
triggerall = command = "c"
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------


;=============================================================
;                         Fei-Long AI 
;=============================================================
;debug
[State -2, DisplayToClipboard]
Type           = DisplayToClipboard
Trigger1       = 1
Text           = "V50 = %3d, V51 = %2d, P2X = %3.0f, P2Y = %3.0f"
Params         = Var(50), Var(51), P2BodyDist X, P2BodyDist Y
IgnoreHitPause = 1

;=============================================================
;start AI
;=============================================================
[State -3, AI_VarSet]
Type       = VarSet
TriggerAll = (RoundState = [1,2]) && Var(59) = 0
Trigger1   = Command = "AI0"  || Command = "AI1"  || Command = "AI2"  || Command = "AI3"  || Command = "AI4"
Trigger2   = Command = "AI5"  || Command = "AI6"  || Command = "AI7"  || Command = "AI8"  || Command = "AI9"
Trigger3   = Command = "AI10" || Command = "AI11" || Command = "AI12" || Command = "AI13" || Command = "AI14"
Trigger4   = Command = "AI15" || Command = "AI16" || Command = "AI17" || Command = "AI18" || Command = "AI19"
Trigger5   = Command = "AI20" || Command = "AI21" || Command = "AI22" || Command = "AI23" || Command = "AI24"
Trigger6   = Command = "AI25" || Command = "AI26" || Command = "AI27"
Trigger7   = NumHelper(10000)
Trigger7   = Helper(10000),var(59)
V          = 59
Value      = 1

[State -1, AI_VarSet]
Type       = VarSet
TriggerAll = Var(59)    = 1
Trigger1   = RoundState = 4
Trigger2   = Win        = 1
Trigger3   = Lose       = 1
Trigger4   = DrawGame   = 1
V          = 59
Value      = -1

[State -1, AI_VarSet]
Type       = VarSet
TriggerAll = Var(59)    = -1
Trigger1   = RoundState = 2
V          = 59
Value      = 1


[State -1, AI_taunt]
Type       = VarSet
TriggerAll = Var(59)    = 1
Trigger1   = Var(58)    = 0 ;挧敪僆僼偵偡傞偲偒偼1偵偡傞
V          = 58
Value      = 1              ;挧敪僆僼偵偡傞偲偒偼0偵偡傞
 

[State -1, tame_VarSet]
Type       = VarSet
TriggerAll = Var(59) = 1
Trigger1   = 1
V          = 50
Value      = Var(50) + 1
[State -1, tame_VarSet]
Type       = VarSet
TriggerAll = Var(59) = 1
TriggerAll = Time <= 1
Trigger1   = StateNo >= 800
Trigger2   = StateNo = [250,252]
Trigger2   = (StateNo = [40,45]) && (Vel X >= 0)
V          = 50
Value      = 0
[State -1, tame_VarSet]
Type       = VarSet
TriggerAll = Var(59) = 1
TriggerAll = Time >= 1
Trigger1   = StateNo = 0
Trigger2   = StateNo = 100
Trigger3   = StateNo = 20 && Vel X >= 0
Trigger4   = StateNo = 19
V          = 50
Value      = 0

[State -1, tame_VarSet]
Type       = VarSet
TriggerAll = Var(59) = 1
Trigger1   = Var(50) >= 20
V          = 51
Value      = 10
[State -1, tame_VarSet]
Type       = VarSet
TriggerAll = Var(59) = 1
Trigger1   = Var(50) <= 20
Trigger1   = Var(51) > 0
V          = 51
Value      = Var(51) - 1



;=============================================================
;reversal
;=============================================================
[State -3, RyuYassai]
type = ChangeState
value = 3100
TriggerAll = Var(59) = 1
Triggerall = PalNo < 7
Triggerall = power >= 3000
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = P2StateType != A
Trigger1   = P2MoveType = A
Trigger1   = P2BodyDist X - Enemynear,Vel X * 7 = [92,95)
Trigger1   = Enemynear,ctrl = 0
Trigger1   = Enemynear,AnimTime = -11
;Trigger1   = Enemynear,Time >= 20
Trigger1   = P2BodyDist X - Enemynear,Vel X * 7 = [20,95)
Trigger2   = Enemynear,StateNo = 5120
Trigger2   = Enemynear,AnimTime = -8
Trigger2   = Enemynear,Vel X = 0

[State -3, ShienRenkyaku]
type = ChangeState
value = 3210
TriggerAll = Var(59) = 1
Triggerall = power >= 2000
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = P2StateType = A
Trigger1   = P2MoveType = A
Trigger1   = Enemynear,ctrl = 0
;Trigger1   = Enemynear,AnimTime = -6
Trigger1   = P2BodyDist X - (Enemynear,Vel x * 6) = [0,60] 
Trigger1   = P2BodyDist y + Enemynear,const(movement.yaccel) / 2 * 36 + (Enemynear,Vel y * 6) = [-30,-10]

[State -3, Ultimate]
type = ChangeState
value = ifelse(power >= 3000, 4020, ifelse(power >= 2000, 4010, 4000))
TriggerAll = Var(59) = 1
triggerall = power >= 1000
triggerAll = statetype != A
triggerAll = ctrl
Trigger1   = P2StateType != A
Trigger1   = P2MoveType = A
Trigger1   = P2BodyDist X - Enemynear,Vel X * 3 = [0,50]
Trigger1   = Enemynear,ctrl = 0
Trigger1   = Enemynear,AnimTime = -3
Trigger2   = Enemynear,GetHitVar(HitTime) >= 3
Trigger2   = Enemynear,StateNo != [120,155]

[State -3, fist]
type = ChangeState
value = 1500
TriggerAll = Var(59) = 1
Triggerall = power < 1000
Triggerall = statetype != A
TriggerAll = ctrl
TriggerAll = P2BodyDist X - Enemynear,Vel X * 3 = [0,55]
TriggerAll = P2StateType = S
Trigger1   = P2MoveType = A
Trigger1   = Enemynear,ctrl = 0
Trigger1   = Enemynear,AnimTime <= -3 && Time >= 10
Trigger2   = P2MoveType = A
Trigger2   = Enemynear,ctrl = 0
Trigger2   = Time <= 3
Trigger2   = Random < 100
Trigger3   = Enemynear,GetHitVar(HitTime) >= 3
Trigger3   = Enemynear,StateNo != [120,155]

[State -3, RekkaShinken]
type = ChangeState
value = 3010
TriggerAll = Var(59) = 1
Triggerall = power >= 2000
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = Life >= 800 && EnemyNear,Life <= 400
Trigger1   = P2StateType = S
Trigger1   = P2MoveType = A
Trigger1   = P2BodyDist X - Enemynear,Vel X * 3 = [70,90]
Trigger1   = Enemynear,ctrl = 0

[State -3, Throw]
type = ChangeState
value = 800
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = power < 1000
Trigger1   = P2StateType != A
Trigger1   = P2MoveType = A
Trigger1   = P2BodyDist X = [0,30]


;=============================================================
;guard
;=============================================================
[State -3, AI, Guard]
Type       = ChangeState
Value      = 120
TriggerAll = Var(59) = 1
TriggerAll = ctrl
Trigger1   = !EnemyNear,HitDefAttr = SCA,AT
;Trigger1   = EnemyNear,MoveType    = A
Trigger1   = EnemyNear,MoveType   != I
Trigger1   = InGuardDist
Trigger2   = !EnemyNear,HitDefAttr = SCA,AT
Trigger2   = EnemyNear,MoveType    = A
Trigger2   = InGuardDist
Trigger2   = Enemy,NumHelper > 0   || Enemy,NumProj > 0

[State -3, AI, Guard]
Type       = ChangeState
Value      = 105
TriggerAll = Var(59)              = 1
TriggerAll = StateType           != A
TriggerAll = Ctrl                 = 1
;TriggerAll = BackEdgeBodyDist    >= 40
TriggerAll = EnemyNear,MoveType   = A
TriggerAll = EnemyNear,HitDefAttr = SCA,AT
Trigger1   = 1
Trigger2   = EnemyNear,Vel X     <= 1 
Trigger2   = P2BodyDist X         = [0,50]
Trigger2   = P2BodyDist Y         = [-30,0]

[State -3, Counter]
type = ChangeState
value = 900
TriggerAll = Var(59) = 1
Triggerall = power >= 1000
TriggerAll = StateType != A
TriggerAll = P2BodyDist X = [0,70]
TriggerAll = StateNo = [150,153]
Trigger1   = BackEdgeBodyDist <= 20
Trigger2   = Random < 20

;=============================================================
;combo
;=============================================================
[State -3, Rekkaken]
type = ChangeState
value = 1022
TriggerAll = Var(59) = 1
TriggerAll = statetype != A
;TriggerAll = ctrl
Trigger1   = StateNo = 1021 && MoveHit
Trigger1   = Time > 10
[State -3, Rekkaken]
type = ChangeState
value = 1021
TriggerAll = Var(59) = 1
TriggerAll = statetype != A
;TriggerAll = ctrl
Trigger1   = StateNo = 1020 && MoveHit
Trigger1   = Time > 10
[State -3, Rekkaken]
type = ChangeState
value = 1020
TriggerAll = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = Enemynear,StateNo != [120,155]
Trigger1   = P2BodyDist X - (Enemynear,Vel x * 4) = [80,95] 

[State -3, Dragon Fist]
type = ChangeState
value = 4100
TriggerAll = Var(59) = 1
triggerall = Vel X = 0
TriggerAll = Var(51) > 0
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = Enemynear,StateNo != [120,155]
Trigger1   = P2BodyDist X - (Enemynear,Vel x * 4) = [20,80]
Trigger2   = Enemynear,StateNo = 5120
Trigger2   = Enemynear,AnimTime = -3
Trigger2   = Random < 800


;=============================================================
;ground to air
;=============================================================
[State -3, shienkyaku]
type = ChangeState
value = 1100
TriggerAll = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = P2BodyDist X - (Enemynear,Vel x * 12) = [0,40] 
Trigger1   = P2BodyDist y + Enemynear,const(movement.yaccel) / 2 * 144 + (Enemynear,Vel y * 12) = [-100,-20]

[State -3, shienkyaku]
type = ChangeState
value = 1110
TriggerAll = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = P2BodyDist X - (Enemynear,Vel x * 12) = [0,40] 
Trigger1   = P2BodyDist y + Enemynear,const(movement.yaccel) / 2 * 144 + (Enemynear,Vel y * 12) = [-110,-30]

[State -3, shienkyaku]
type = ChangeState
value = 1120
TriggerAll = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = P2BodyDist X - (Enemynear,Vel x * 12) = [0,40] 
Trigger1   = P2BodyDist y + Enemynear,const(movement.yaccel) / 2 * 144 + (Enemynear,Vel y * 12) = [-115,-35]
Trigger2   = P2BodyDist X - (Enemynear,Vel x * 12) = [0,60] 
Trigger2   = P2BodyDist y + Enemynear,const(movement.yaccel) / 2 * 81 + (Enemynear,Vel y * 9) = [-50,-10]

[State -3, dragon]
type = ChangeState
value = 1300
TriggerAll = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = P2BodyDist X - (Enemynear,Vel x * 10) = [60,100] 
Trigger1   = P2BodyDist y + Enemynear,const(movement.yaccel) / 2 * 100 + (Enemynear,Vel y * 10) = [-60,-20]

[State -3, dragon]
type = ChangeState
value = 1310
TriggerAll = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = P2BodyDist X - (Enemynear,Vel x * 10) = [60,100] 
Trigger1   = P2BodyDist y + Enemynear,const(movement.yaccel) / 2 * 100 + (Enemynear,Vel y * 10) = [-75,-35]

[State -3, dragon]
type = ChangeState
value = 1320
TriggerAll = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = P2BodyDist X - (Enemynear,Vel x * 10) = [60,100] 
Trigger1   = P2BodyDist y + Enemynear,const(movement.yaccel) / 2 * 100 + (Enemynear,Vel y * 10) = [-90,-50]


;=============================================================
;air to air
;=============================================================
[State -3, Jump Strong Punch]
type = ChangeState
value = 620
Triggerall = Var(59) = 1
TriggerAll = StateType = A
TriggerAll = P2StateType = A
TriggerAll = ctrl
TriggerAll = Vel X != 0
TriggerAll = Pos Y + const(movement.yaccel) / 2 * 64 + (Vel y * 8) <= -5
Trigger1   = P2BodyDist X - Enemynear,Vel x * 8 - Vel X * 8 = [0,50]
Trigger1   = P2BodyDist Y + Enemynear,const(movement.yaccel) / 2 * 64 + const(movement.yaccel) / 2 * 64 + (Enemynear,Vel y * 8) + (Vel y * 8) = [-30,10]

[State -3, Jump Light Kick]
type = ChangeState
value = 630
Triggerall = Var(59) = 1
TriggerAll = StateType = A
TriggerAll = P2StateType = A
TriggerAll = ctrl
TriggerAll = Vel X = 0
TriggerAll = Pos Y + const(movement.yaccel) / 2 * 4 + (Vel y * 2) <= -5
Trigger1   = P2BodyDist X - Enemynear,Vel x * 2 - Vel X * 2 = [0,35]
Trigger1   = P2BodyDist Y + Enemynear,const(movement.yaccel) / 2 * 4 + const(movement.yaccel) / 2 * 4 + (Enemynear,Vel y * 2) + (Vel y * 2) = [-10,30]

[State -3, Jump Medium Kick]
type = ChangeState
value = 640
Triggerall = Var(59) = 1
TriggerAll = statetype = A
TriggerAll = P2StateType = A
TriggerAll = ctrl
Trigger1   = Vel X != 0
Trigger1   = Pos Y + const(movement.yaccel) / 2 * 16 + (Vel y * 4) <= -5
Trigger1   = P2BodyDist X - Enemynear,Vel x * 4 - Vel X * 4 = [0,70]
Trigger1   = P2BodyDist Y + Enemynear,const(movement.yaccel) / 2 * 16 + const(movement.yaccel) / 2 * 16 + (Enemynear,Vel y * 4) + (Vel y * 4) = [-20,20]
Trigger2   = Vel X = 0
Trigger2   = Pos Y + const(movement.yaccel) / 2 * 64 + (Vel y * 8) <= -5
Trigger2   = P2BodyDist X - Enemynear,Vel x * 8 - Vel X * 8 = [0,50]
Trigger2   = P2BodyDist Y + Enemynear,const(movement.yaccel) / 2 * 64 + const(movement.yaccel) / 2 * 64 + (Enemynear,Vel y * 8) + (Vel y * 8) = [-30,10]


;=============================================================
;rade
;=============================================================
[State -3, Jump Light Punch]
type = ChangeState
value = 600
TriggerAll = Var(59) = 1
TriggerAll = statetype = A
TriggerAll = ctrl
TriggerAll = P2StateType != A && P2StateType != L
TriggerAll = P2BodyDist X = [-10,50)
TriggerAll = Pos Y + const(movement.yaccel) / 2 * 16 + (Vel y * 4) <= -5
Trigger1   = Pos Y + const(movement.yaccel) / 2 * 16 + (Vel y * 4) >= (Enemynear,const(size.head.pos.y) / ((Enemynear,StateType = C) + 1) + 25)

[State -3, Jump Medium Punch]
type = null;ChangeState
value = 610
triggerall = Var(59) = 1
triggerAll = statetype = A
TriggerAll = ctrl
TriggerAll = P2StateType != A && P2StateType != L
TriggerAll = p2BodyDist X = [-10,50)
TriggerAll = Pos Y = [-80,-53)
TriggerAll = Vel Y > 0
Trigger1   = Pos Y > -54

[State -3, Jump Strong Punch]
type = null;ChangeState
value = 620
triggerall = Var(59) = 1
triggerAll = statetype = A
TriggerAll = ctrl
TriggerAll = P2StateType != A && P2StateType != L
TriggerAll = p2BodyDist X = [-10,50)
TriggerAll = Pos Y = [-80,-63)
TriggerAll = Vel Y > 0
Trigger1   = Pos Y > -64
Trigger1   = P2StateType = S

[State -3, Jump Light Kick]
type = ChangeState
value = 630
triggerall = Var(59) = 1
triggerAll = statetype = A
TriggerAll = ctrl
TriggerAll = P2StateType != A && P2StateType != L
TriggerAll = p2BodyDist X = [-10,35)
TriggerAll = Pos Y + const(movement.yaccel) / 2 * 4 + (Vel y * 2) <= -5
Trigger1   = Pos Y + const(movement.yaccel) / 2 * 4 + (Vel y * 2) >= (Enemynear,const(size.head.pos.y) / ((Enemynear,StateType = C) + 1) + 40)

[State -3, Jump Medium Kick]
type = null;ChangeState
value = 640
Triggerall = Var(59) = 1
TriggerAll = statetype = A
TriggerAll = ctrl
TriggerAll = P2StateType != A && P2StateType != L
TriggerAll = p2BodyDist X = [-10,70)
TriggerAll = Pos Y = [-80,-42)
TriggerAll = Vel Y > 0
Trigger1   = Pos Y > -43
Trigger1   = Vel X != 0
Trigger1   = Random < 500

[State -3, Jump Strong Kick]
type = null;ChangeState
value = 650
triggerall = Var(59) = 1
trigger1 = statetype = A
trigger1 = ctrl


;=============================================================
;general move
;=============================================================
[State -3, Throw]
type = ChangeState
value = 800
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
TriggerAll = P2BodyDist X = [0,40]
TriggerAll = P2StateType != A
TriggerAll = P2MoveType != H
;Trigger1   = Enemynear,StateNo = [120,155]
Trigger1   = P2MoveType = A
Trigger1   = BackEdgeBodyDist >= 60 || FrontEdgeBodyDist <= 80

[State -3, Throw]
type = ChangeState
value = 810
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
TriggerAll = P2BodyDist X = [0,40]
TriggerAll = P2BodyDist X = [0,40]
TriggerAll = P2StateType != A
TriggerAll = P2MoveType != H
Trigger1   = Enemynear,StateNo = [120,155]
;Trigger1   = BackEdgeBodyDist < 60
;Trigger2   = P2StateType = L
;Trigger2   = P2BodyDist X = [0,40]
;Trigger2   = Enemynear,AnimTime = -1
;Trigger2   = Random < 500

[State -3, rekkuukyaku]
type = ChangeState
value = 1220
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = P2BodyDist X = [160,200]
Trigger1   = Enemynear,ctrl = 0
Trigger1   = Enemynear,AnimTime < -30
Trigger1   = Random < 100
Trigger2   = P2BodyDist X = [160,200]
Trigger2   = P2StateType = A

[State -3, sstomp]
type = ChangeState
value = 3300
Triggerall = Var(59) = 1
TriggerAll = power >= 1000
TriggerAll = statetype != A
TriggerAll = ctrl
Trigger1   = P2StateType = A && P2MoveType != H
Trigger1   = P2BodyDist X - (Enemynear,Vel x * 12) >= 130 
Trigger1   = P2BodyDist y + Enemynear,const(movement.yaccel) / 2 * 144 + (Enemynear,Vel y * 12) = [0,30]
Trigger1   = Random < 300

[State -3, stomp]
type = ChangeState
value = 1400
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
TriggerAll = P2BodyDist X = [0,40]
Trigger1   = Enemynear,StateNo = [5100,5110]
;Trigger1   = PrevStateNo != 1400
Trigger2   = P2BodyDist y + Enemynear,const(movement.yaccel) / 2 * 144 + (Enemynear,Vel y * 12) = [0,30]

[State -3, fdragon]
type = ChangeState
value = 1620
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
TriggerAll = Var(51) >= 1
TriggerAll = P2BodyDist X = [70,95]
Trigger1   = Power < 1000
Trigger1   = P2StateType != A
Trigger2   = P2StateType = L
Trigger2   = Enemynear,AnimTime = -11

[State -3, Crouching Light Punch]
type = ChangeState
value = 400
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [0,45)
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = Enemynear,StateNo = [120,155]
Trigger1   = P2BodyDist X = [0,45)
Trigger2   = P2StateType = S
Trigger2   = Random < 500
Trigger3   = P2StateType = L
Trigger3   = P2BodyDist X = [0,45)
Trigger3   = Enemynear,AnimTime = -2

[State -3, Crouching Medium Punch]
type = null;ChangeState
value = 410
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [0,95)
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = Enemynear,StateNo = [120,155]
Trigger1   = P2BodyDist X = [0,95)

[State -3, Crouching Strong Punch]
type = ChangeState
value = 420
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [0,95)
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = Enemynear,StateNo = [120,155]
Trigger1   = P2BodyDist X = [45,95)
Trigger2   = P2StateType = S
Trigger2   = Random < 500

[State -3, Crouching Light Kick]
type = null;ChangeState
value = 430
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [0,45)
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = Enemynear,StateNo = [120,155]
Trigger1   = P2BodyDist X = [0,45)

[State -3, Crouching Medium Kick]
type = ChangeState
value = 440
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [0,80)
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = Enemynear,StateNo = [120,155]
Trigger1   = P2BodyDist X = [0,80)
Trigger2   = P2StateType = S
Trigger2   = Random < 500

[State -3, Crouching Strong Kick]
type = ChangeState
value = 450
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [0,90)
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = Enemynear,StateNo = [120,155]
Trigger1   = P2BodyDist X = [80,90)
Trigger2   = P2StateType = S
Trigger2   = Random < 500
Trigger3   = P2StateType = L
Trigger3   = P2BodyDist X = [40,90)
Trigger3   = Enemynear,AnimTime = -7

[State -3, Stand Light Punch close]
type = ChangeState
value = 200
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X < 20
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = Enemynear,StateNo != [120,155]
Trigger1   = P2BodyDist X = [0,20)
[State -3, Stand Light Punch far]
type = ChangeState
value = 200
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [20,50]
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = Enemynear,StateNo != [120,155]
Trigger1   = P2BodyDist X = [20,50]

[State -3, Stand Medium Punch close]
type = null;ChangeState
value = 210
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X < 20
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = P2BodyDist X = [0,20)
[State -3, Stand Medium Punch far]
type = null;ChangeState
value = 210
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [20,65)
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = P2BodyDist X = [20,65)

[State -3, Stand Strong Punch]
type = null;ChangeState
value = 220
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X < 20
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = P2BodyDist X = [0,20)
[State -3, Stand Strong Punch]
type = null;ChangeState
value = 220
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll   = P2BodyDist X = [20,80)
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = P2BodyDist X = [20,80)

[State -3, Stand Light Kick]
type = null;ChangeState
value = 230
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X < 20
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = P2BodyDist X = [0,20)
[State -3, Stand Light Kick]
type = ChangeState
value = 230
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [20,75)
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = P2BodyDist X = [20,75)
Trigger1   = Random < 100

[State -3, Standing Medium Kick]
type = null;ChangeState
value = 240
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X < 20
TriggerAll = ctrl
Trigger1   = P2BodyDist X = [0,20)

[State -3, Standing Medium Kick]
type = null;ChangeState
value = 240
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [20,75)
TriggerAll = ctrl
Trigger1   = P2BodyDist X = [20,75)

[State -3, Hop Kick]
type = null;ChangeState
value = 242
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [0,70]
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = P2BodyDist X = [0,70]

[State -3, Standing Strong Kick]
type = null;ChangeState
value = 250
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X < 20
TriggerAll = ctrl
Trigger1   = P2BodyDist X = [0,20)

[State -3, Standing Strong Kick]
type = ChangeState
value = 250
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [20,85)
TriggerAll = ctrl
Trigger1   = P2StateType = S
Trigger1   = Enemynear,StateNo != [120,155]
Trigger1   = P2BodyDist X = [20,85)
Trigger1   = Random < 200

[State -3, Hop Kick]
type = ChangeState
value = 252
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X = [0,35]
TriggerAll = ctrl
Trigger1   = P2StateType != A
Trigger1   = Enemynear,StateNo != [120,155]
Trigger1   = Random < 300


[State -3, dash]
type = ChangeState
value = 100
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = P2BodyDist X >= 130
TriggerAll = ctrl
TriggerAll = P2StateType != A
TriggerAll = !InGuardDist
Trigger1   = Random < 100
Trigger2   = Enemynear,HitDefAttr = SC, AP
Trigger2   = P2BodyDist X >= 145

[State -3, jump fwd]
type = ChangeState
value = 42
Triggerall = Var(59) = 1
TriggerAll = statetype != A
TriggerAll = ctrl
TriggerAll = Enemynear,HitDefAttr = SC, AP
Triggerall = P2StateType != A
TriggerAll = Random < 300
Trigger1   = P2BodyDist X = [100,135]
Trigger2   = StateNo = 100
Trigger2   = P2BodyDist X = [135,165]

[State -3, 慜曕偒]
type = ChangeState
value = 19
TriggerAll = Var(59) = 1
TriggerAll = StateType != A
TriggerAll = StateNo != 19 || (StateNo = 20 && Vel X > 0)
TriggerAll = ctrl
TriggerAll = !InGuardDist
TriggerAll = P2MoveType != A
Trigger1   = StateNo != 21 || (StateNo = 21 && ((Time % 30) = 29))
Trigger1   = Random < 300
Trigger1   = P2BodyDist X >= 30
Trigger2   = P2BodyDist X >= 100

[State -3, 屻曕偒]
type = ChangeState
value = 21
TriggerAll = Var(59) = 1
TriggerAll = StateType != A
TriggerAll = StateNo != 21 || (StateNo = 20 && Vel X < 0)
TriggerAll = ctrl
TriggerAll = !InGuardDist
TriggerAll = P2MoveType != A
Trigger1   = P2BodyDist X = [0,30]
Trigger2   = P2BodyDist X = (30,80]
Trigger2   = StateNo = 19
Trigger2   = (Time % 30) = 29
Trigger2   = Random < 200


[State -3, Dragon_Kick or taunt]
type = ChangeState
value = ifelse((life < 100 && Var(58) = 1), 195, 4110)
Triggerall = Var(59) = 1 || Var(59) = -1
Triggerall = Vel X = 0
Trigger1   = statetype != A
Trigger1   = ctrl
Trigger1   = PrevStateNo != 3105
Trigger1   = PrevStateNo != 195
Trigger1   = Win




[State -3, AI婲摦梡僿儖僷乕]
type = helper
triggerall = !NumHelper(10000)
triggerall = alive
triggerall = Var(59) = 0
Triggerall = (PrevStateNo = [190,191]) || PrevStateNo = 5900 || PrevStateNo = 0
Triggerall = StateNo = 0 ;僀儞僩儘捈屻偺僗僥乕僩
trigger1 = Time <= 1
trigger2 = roundstate = 2
helpertype = normal
name = "AI"
stateno = 10000
ID = 10000
pos = 9999,9999
keyctrl = 1
pausemovetime = 2147483647
supermovetime = 2147483647
persistent = 0

[State -3, 娭學柍偄僗僥乕僩偵峴偐側偄傛偆偵]
type = changestate
trigger1 = ishelper(10000)
trigger1 = stateno != 10000
value = 10000

[State -3, 僩儗儌奐巒丒AI儕僙僢僩]
type = varset
trigger1 = !ishelper
trigger1 = Var(59) = -10000 ;僼儔僌偵巊傢側偄悢帤
trigger1 = roundstate = 2
trigger1 = stateno = 0
trigger1 = Time > 1
v = 59
value = 0

;劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒
;AI婲摦僿儖僷乕
;劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒劒
[Statedef 10000]
;anim = 10000
ctrl = 0

[State 10000, 娫堘偄偱杮懱偑棃偨傜棫偪傊堏峴]
type = selfstate
trigger1 = !ishelper
value = 0

[State 10000, 僾儗僀儎乕敾掕]
type = varset
triggerall = root,time <= 1
trigger1 = command = "up" && root,command = "up"
trigger2 = command = "down" && root,command = "down"
trigger3 = command = "back" && root,command = "back"
trigger4 = command = "fwd" && root,command = "fwd"
trigger5 = command = "a" && root,command = "a"
trigger6 = command = "b" && root,command = "b"
trigger7 = command = "c" && root,command = "c"
trigger8 = command = "x" && root,command = "x"
trigger9 = command = "y" && root,command = "y"
trigger10 = command = "z" && root,command = "z"
trigger11 = command = "start" && root,command = "start"
var(59) = -1000

[State 10000, 棫偭偨傜徚幐]
Type = DestroySelf
triggerAll = isHelper
Trigger1 = root,Var(59) || var(59) = -1000

[State 10000, 套皋ON]
type = varset
triggerall = var(59) != -1000
trigger1 = command != "up" && root,command = "up"
trigger2 = command != "down" && root,command = "down"
trigger3 = command != "back" && root,command = "back"
trigger4 = command != "fwd" && root,command = "fwd"
trigger5 = command != "a" && root,command = "a"
trigger6 = command != "b" && root,command = "b"
trigger7 = command != "c" && root,command = "c"
trigger8 = command != "x" && root,command = "x"
trigger9 = command != "y" && root,command = "y"
trigger10 = command != "z" && root,command = "z"
trigger11 = command != "start" && root,command = "start"
var(59) = 1

