;-| AI Motions |--------------------------------------------------------
[Command]
name = "AI_1"
command = U,D,F,F,B,B
time = 1

[Command]
name = "AI_2"
command = U,D,F,F,B,F
time = 1

[Command]
name = "AI_3"
command = U,D,F,F,B,D
time = 1

[Command]
name = "AI_4"
command = U,D,F,F,B,U
time = 1

[Command]
name = "AI_5"
command = U,D,F,F,U,B
time = 1

[Command]
name = "AI_6"
command = U,D,F,F,D,B
time = 1

[Command]
name = "AI_7"
command = U,D,F,F,F,B
time = 1

[Command]
name = "AI_8"
command = D,D,F,F,D,B
time = 1

[Command]
name = "AI_9"
command = D,D,F,F,F,B
time = 1

[Command]
name = "AI_10"
command = F, D, B, U
time = 1

[Command]
name = "AI_11"
command = F, U, B, D
time = 1

[Command]
name = "AI_12"
command = F, F, F, F, F, B, U, U
time = 1

[Command]
name = "AI_13"
command = U, U, D, D, F, F, U
time = 1

[Command]
name = "AI_14"
command = U, D, U, D, U, D
time = 1

[Command]
name = "AI_15"
command = F, F, B, B, U, D, U
time = 1

[Command]
name = "AI_16"
command = B, D, D, U, F, D, D
time = 1

[Command]
name = "AI_17"
command = D, D, U, U, U, U, U, U
time = 1

[Command]
name = "AI_18"
command = D, D, D, D, D, D, D, U, U
time = 1

[Command]
name = "AI_19"
command = D, U, D, D, F, D, D, U, U
time = 1

[Command]
name = "AI_20"
command = D, D, D, D, B, D, D, U, U
time = 1

;-| Super Motions |--------------------------------------------------------
;Cho Reppa Dan
[Command]
name = "firekick"
command = ~D, DB, B, D, F, a
time = 25
[Command]
name = "firekick2"
command = ~D, DB, B, D, F, b
time = 25

; Geki Hishouken
[Command]
name = "geki"
command = ~D, DF, F, D, DF, F, x
time = 25
[Command]
name = "geki"
command = ~D, DF, F, D, DF, F, y
time = 25

; ZanEi Ryuusei Ken
[Command]
name = "Megafist"
command = ~D, DB, B, D, F, x
time = 25
[Command]
name = "Megafist"
command = ~D, DB, B, D, F, y
time = 25

;-| Special Motions |------------------------------------------------------
; Hishoken
[Command]
name = "fire"
command = ~D, DB, B, x
time = 20
[Command]
name = "fire2"
command = D, DB, B, y
time = 20

; Zan EiKen
[Command]
name = "elbow"
command = ~30$DB, F,x
time = 15
[Command]
name = "elbow2"
command = ~30$DB, F,y
time = 15

; Agarre estilo Real Bout 2
[Command]
name = "RB2W"
command = ~F, DF, D, DB, B, a
time = 20
[Command]
name = "RB2S"
command = ~F, DF, D, DB, B, b
time = 20

; Mulazo volador
[Command]
name = "dive"
command = ~D, DF, F, a
time = 20
[Command]
name = "dive2"
command = ~D, DF, F, b
time = 20

; Shoryudan
[Command]
name = "rising"
command = ~F,D,DF,x
time = 15
[Command]
name = "rising2"
command = ~F,D,DF,y
time = 15

; Kuhadan
[Command]
name = "slide"
command = ~B,DB,D,DF,F, a
time = 20
[Command]
name = "slide2"
command = ~B,DB,D,DF,F, b
time = 20

; Dam Breaker
[Command]
name = "Breaker"
command = ~B,DB,D,DF,F, y
time = 20
;-| 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 = "recovery"
command = c
time = 1

[Command]
name = "rock"
command = a+y
time = 1

[Command]
name = "cd"
command = b+y
time = 1

[Command]
name = "ab"
command = a+x
time = 1

;-| Dir + Button |---------------------------------------------------------
[Command]
name = "down_a"
command = /$D,a
time = 1

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

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

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

[Command]
name = "c"
command = c
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_x"
command = /$x
time = 1

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

[Command]
name = "hold_z"
command = /$z
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 Dir |--------------------------------------------------------------
[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

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

[Command]
name = "jump"
command = ~D, $U
time = 11

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
[Statedef -1]
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; ADVANCE / EXTRA Motions
;---------------------------------------------------------------------------
;ADV
[State -1]
type = ChangeState
value = 2500
triggerall = Var(50) != 1
trigger1 = command = "a" && command = "y"
trigger1 = power >= 1000 && statetype = S && ctrl = 1 && var(17) <= 0

;EXT bar
[State -1]
type = ChangeState
value = 910
triggerall = statetype = S
triggerall = Power < 3000
triggerall = var(9) = 0
triggerall = ctrl = 1
trigger1 = command = "hold_x"
trigger1 = command = "hold_b"
;---------------------------------------------------------------------------
; Supers
;---------------------------------------------------------------------------
;Dan Da Dan
[State -1,]
type = ChangeState
value = 3200 + ((var(17) > 0) * 50)
triggerall = command = "Megafist"
triggerall = power >= 1000
triggerall = var(9) = 0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 250 && time = [9,19]
trigger5 = stateno = 235 && time = [4,16]
trigger6 = stateno = 420 && time =[7,15]


;Cho ReppaDan (WK)
[State -1,]
type = ChangeState
value = 3400 + ((var(17) > 0) * 50)
triggerall = command = "firekick"
triggerall = power >= 1000
triggerall = var(9) = 0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 250 && time = [9,19]
trigger5 = stateno = 235 && time = [4,16]
trigger6 = stateno = 420 && time =[7,15]
Cho ReppaDan (SK)
[State -1,]
type = ChangeState
value = 3410 + ((var(17) > 0) * 40)
triggerall = command = "firekick2"
triggerall = power >= 1000
triggerall = var(9) = 0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 250 && time = [9,19]
trigger5 = stateno = 235 && time = [4,16]
trigger6 = stateno = 420 && time =[7,15]

;Geki Hishouken (DM)
[State -1,]
type = ChangeState
value = 3000 + ((var(17) > 0) * 100)
triggerall = command = "geki"
triggerall = power >= 1000
triggerall = var(9) = 0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101

;---------------------------------------------------------------------------
; Tecnicas
;---------------------------------------------------------------------------
;Dam Breaker
[State -1,]
type = ChangeState
value = 1600
triggerall = var(9) = 0
triggerall = command = "Breaker"
triggerall = p2bodydist x <= 40
triggerall = p2statetype != A
triggerall = p2statetype != L
triggerall = p2stateno != 5120
trigger1 = statetype != A
trigger1 = ctrl = 1
trigger2 = stateno = 205 || stateno = 215
trigger2 = movecontact
trigger3 = stateno = 225 || stateno = 400
trigger3 = movecontact
trigger4 = stateno = 410 || stateno = 420
trigger4 = movecontact
trigger5 = stateno = 430 || stateno = 440
trigger5 = movecontact
trigger6 = stateno = 300 || stateno = 365
trigger6 = movecontact
trigger7 = stateno = 101
;---------------------------------------------------------------------------
;mulazo volador
[State -1,]
type = ChangeState
value = 1520
triggerall = command = "dive"
triggerall = var(9) = 0
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
[State -1,]
type = ChangeState
value = 1521
triggerall = command = "dive2"
triggerall = var(9) = 0
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101

;---------------------------------------------------------------------------
[State -1, Rb Throw W]
type = ChangeState
value = 1400
triggerall = command = "RB2W"
trigger1 = statetype = A
trigger1 = ctrl
[State -1, Rb Throw S]
type = ChangeState
value = 1410
triggerall = command = "RB2S"
trigger1 = statetype = A
trigger1 = ctrl
;---------------------------------------------------------------------------
;shoryudan
[State -1,]
type = ChangeState
value = 1300
triggerall = command = "rising"
triggerall = var(9) = 0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 52 || stateno = 40
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 250 && time = [9,19]
trigger5 = stateno = 235 && time = [4,16]
trigger6 = stateno = 420 && time =[7,15]
[State -1,]
type = ChangeState
value = 1316
triggerall = command = "rising2"
triggerall = var(9) = 0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 52 || stateno = 40
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 250 && time = [9,19]
trigger5 = stateno = 235 && time = [4,16]
trigger6 = stateno = 420 && time =[7,15]
;---------------------------------------------------------------------------
;ZanEiKen
[State -1,]
type = ChangeState
value = 1200
triggerall = command = "elbow"
triggerall = var(9) = 0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 250 && time = [9,19]
trigger5 = stateno = 235 && time = [4,16]
trigger6 = stateno = 420 && time =[7,15]
[State -1,]
type = ChangeState
value = 1205
triggerall = command = "elbow2"
triggerall = var(9) = 0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 250 && time = [9,19]
trigger5 = stateno = 235 && time = [4,16]
trigger6 = stateno = 420 && time =[7,15]

;---------------------------------------------------------------------------
; KuHaDan
[State -1,]
type = ChangeState
value = 1100
triggerall = command = "slide"
triggerall = var(9) = 0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 52 || stateno = 40
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 250 && time = [9,19]
trigger5 = stateno = 235 && time = [4,16]
trigger6 = stateno = 420 && time =[7,15]
[State -1,]
type = ChangeState
value = 1115
triggerall = command = "slide2"
triggerall = var(9) = 0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 52 || stateno = 40
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 250 && time = [9,19]
trigger5 = stateno = 235 && time = [4,16]
trigger6 = stateno = 420 && time =[7,15]

;---------------------------------------------------------------------------
;Hisouken
[State -1,]
type = ChangeState
value = 1030
triggerall = command = "fire"
triggerall = var(9) = 0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 250 && time = [9,19]
trigger5 = stateno = 235 && time = [4,16]
trigger6 = stateno = 420 && time =[7,15]
[State -1,]
type = ChangeState
value = 1005
triggerall = command = "fire2"
triggerall = var(9) = 0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 250 && time = [9,19]
trigger5 = stateno = 235 && time = [4,16]
trigger6 = stateno = 420 && time =[7,15]

;---------------------------------------------------------------------------
; Pasos dobles
;---------------------------------------------------------------------------
;Run Fwd 1
[State -1, Run Fwd]
type = ChangeState
value = 100
triggerall = var(22) = 0
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

;---------------------------------------------------------------------------
; Agarres
;---------------------------------------------------------------------------
;Throw 1
[State -1]
type = ChangeState
value = 800
triggerall = command = "y"
triggerall = command = "holdfwd"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = stateno != 100
trigger1 = p2bodydist x < 20
trigger1 = p2statetype != A
trigger1 = p2movetype != H
trigger1 = p2stateno != 5120
trigger1 = ctrl

;Throw 2
[State -1]
type = ChangeState
value = 830
triggerall = command = "b"
triggerall = command = "holdfwd"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = stateno != 100
trigger1 = p2bodydist x < 20
trigger1 = p2statetype != A
trigger1 = p2movetype != H
trigger1 = p2stateno != 5120
trigger1 = ctrl

;---------------------------------------------------------------------------
; CD Attacks
;---------------------------------------------------------------------------
;Counter
[State -1]
type = ChangeState
value = 305
triggerall = var(22) = 0
trigger1 = command = "cd" && var(17) > 0 && stateno = [150,151]

;Standing CD
[State -1]
type = ChangeState
value = 300
triggerall = command = "cd"
trigger1 = statetype != A
trigger1 = ctrl

;Aerial CD
[State -1]
type = ChangeState
value = 650
triggerall = command = "cd"
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Rollings y esas cosas
;---------------------------------------------------------------------------
; TIME BAR Escape Roll backward
[State -1]
type = ChangeState
value = 365
trigger1 = command = "ab" && command = "holdback" && var(17) > 0 && stateno = [150,151]
; TIME BAR Escape Roll Forward
[State -1]
type = ChangeState
value = 366
trigger1 = command = "ab" && var(17) > 0 && stateno = [150,151]

; Rolling atras
[State -1]
type = ChangeState
value = 360
triggerall = command = "ab"
triggerall = command = "holdback"
triggerall = var(9) = 0
trigger1 = statetype = S
trigger1 = ctrl

; Rolling adelante
[State -1]
type = ChangeState
value = 361
triggerall = command = "ab"
triggerall = command = "holdfwd"  
triggerall = var(9) = 0
trigger1 = statetype = S
trigger1 = ctrl

; Dodge
[State -1]
type = ChangeState
value = 362
triggerall = command = "ab"
triggerall = var(9) = 0
trigger1 = statetype = S
trigger1 = ctrl

; Dodge Ret
[State -1]
type = ChangeState
value = 363
triggerall = stateno = 362
triggerall = AnimElem = 2, >= 0
trigger1 = command = "x"
trigger2 = command = "y"
trigger3 = command = "a"
trigger4 = command = "b"
;---------------------------------------------------------------------------
; Direccion + boton
;---------------------------------------------------------------------------
; F + WP
[State -1,]
type = ChangeState
value = 250
triggerall = command = "x"
triggerall = command = "holddown"
triggerall = command = "holdfwd"
triggerall = var(9) = 0
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101

; F + WK
[State -1,]
type = ChangeState
value = 240
triggerall = command = "a"
triggerall = command = "holdfwd"
triggerall = var(9) = 0
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 215 && time = [5,12]

;---------------------------------------------------------------------------
; Ratonil Attacks
;---------------------------------------------------------------------------
; WP
[State -1]
type = ChangeState
value = 205
triggerall = command = "x"
triggerall = command != "holddown"
triggerall = var(9) = 0
triggerall = p2bodydist x < 20
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101

; WK
[State -1]
type = ChangeState
value = 215
triggerall = command = "a"
triggerall = command != "holddown"
triggerall = command != "holdfwd"
triggerall = var(9) = 0
triggerall = p2bodydist x < 20
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 410 && time = [6,11]

; SP
[State -1]
type = ChangeState
value = 225
triggerall = command = "y"
triggerall = command != "holddown"
triggerall = var(9) = 0
triggerall = p2bodydist x < 20
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101

; SK
[State -1]
type = ChangeState
value = 235
triggerall = command = "b"
triggerall = command != "holddown"
triggerall = var(9) = 0
triggerall = p2bodydist x < 20
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
;---------------------------------------------------------------------------
; Normal Attacks
;---------------------------------------------------------------------------
; WP
[State -1,]
type = ChangeState
value = 200
triggerall = command = "x"
triggerall = command != "holddown"
triggerall = p2bodydist x > 19
triggerall = var(9) = 0
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101
trigger4 = stateno = 205 && time = [4,8]

; WK
[State -1]
type = ChangeState
value = 210
triggerall = command = "a"
triggerall = command != "holddown"
triggerall = command != "holdfwd"
triggerall = p2bodydist x > 19
triggerall = var(9) = 0
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101

; SP
[State -1]
type = ChangeState
value = 220
triggerall = command = "y"
triggerall = command != "holddown"
triggerall = p2bodydist x > 19
triggerall = var(9) = 0
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101

; SK
[State -1]
type = ChangeState
value = 230
triggerall = command = "b"
triggerall = var(9) = 0
triggerall = command != "holddown"
triggerall = p2bodydist x > 19
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101

;---------------------------------------------------------------------------
; crouching Attacks
;---------------------------------------------------------------------------
; WP
[State -1]
type = ChangeState
value = 400
triggerall = command = "x"
triggerall = command = "holddown"
;triggerall = command != "holdfwd"
triggerall = var(9) = 0
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = stateno = 101

; WK
[State -1]
type = ChangeState
value = 410
triggerall = command = "a"
triggerall = command = "holddown"
triggerall = var(9) = 0
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = stateno = 101

; SP
[State -1]
type = ChangeState
value = 420
triggerall = command = "y"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = stateno = 101

; SK
[State -1]
type = ChangeState
value = 430
triggerall = command = "b"
triggerall = command = "holddown"
;triggerall = command != "holdfwd"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = stateno = 101

;---------------------------------------------------------------------------
; Jumping Attacks
;--------------------------------------------------------------------------- 
; WP
[State -1]
type = ChangeState
value = 605
triggerall = command = "x"
triggerall = vel x = 0
trigger1 = statetype = A
trigger1 = ctrl

; WPD
[State -1]
type = ChangeState
value = 600
triggerall = command = "x"
trigger1 = statetype = A
trigger1 = ctrl

;WK
[State -1]
type = ChangeState
value = 615
triggerall = command = "a"
triggerall = vel x = 0
trigger1 = statetype = A
trigger1 = ctrl

; WKD
[State -1]
type = ChangeState
value = 610
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl

; SPD
[State -1]
type = ChangeState
value = 625
triggerall = command = "y"
triggerall = vel x = 0
trigger1 = statetype = A
trigger1 = ctrl

; SP
[State -1]
type = ChangeState
value = 620
triggerall = command = "y"
trigger1 = statetype = A
trigger1 = ctrl

; SK
[State -1]
type = ChangeState
value = 635
triggerall = command = "b"
triggerall = vel x = 0
trigger1 = statetype = A
trigger1 = ctrl

; SKD
[State -1]
type = ChangeState
value = 630
triggerall = command = "b"
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
; Burla
;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 195
trigger1 = command = "start"
trigger1 = Vel X = 0
trigger1 = stateno != 195
trigger1 = statetype = S
trigger1 = ctrl = 1





;---------------------------------------------------------------------------
;-| AI MOTIONS |------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;Geki Hishouken DM
[State -1]
type = ChangeState
value = 3000 + ((var(17) > 0) * 100)
triggerall = var(9) = 1 && random > 250 && (p2stateno != [1010,1099]) && p2stateno != [5080,5120]
triggerall = power >= 1000
triggerall = p2life >= 700
triggerall = roundstate = 2
triggerall = ctrl && statetype != A
trigger1 = p2bodydist x =[1,30]
trigger1 = (enemy,ctrl = 0||p2movetype = A||p2stateno = [100,102])
trigger2 = (ctrl && statetype != A) || stateno = 100
trigger2 = p2stateno = 2207 || (p2stateno = [1800,1803])
trigger2 = p2movetype = H && p2bodydist x < 140 && p2bodydist y < -25
trigger3 = movecontact && var(9) > 0 && time = [19,22]
trigger3 = statetype != A && p2statetype != A && stateno = 1000
;---------------------------------------------------------------------------
;cho Reppa Dan DM
[State -1 ab]
type = ChangeState
value = 3400 + ((var(17) > 0) * 50)
triggerall = p2stateno != 5040 && statetype != A && power >= 1000
triggerall = var(9) = 1 && p2bodydist x <= 30
trigger1 = p2statetype != L && statetype != A && p2stateno != 5201 && ctrl && random <= 100
trigger2 = stateno = 210 && animelemtime(6) >=1 && animelemtime(7) < 0 && movehit
trigger3 = stateno = 200 && animelemtime(3) >=0 && animelemtime(4) < 0 && movehit
trigger4 = stateno = 220 && animelemtime(3) >=0 && animelemtime(4) < 0 && movehit
trigger5 = p2statetype != A && p2statetype != L && statetype != A && (p2stateno = [100,104]) && (stateno = [100,101]) && random <= 200
;Cho Reppa Dan DM
[State -1 av]
type = ChangeState
value = 3410 + ((var(17) > 0) * 40)
triggerall = p2stateno != 5040 && statetype != A && power >= 1000
triggerall = var(9) = 1
triggerall = p2bodydist x = [31,80]
trigger1 = p2statetype != A && p2statetype != L && statetype != A && p2stateno != 5201 && ctrl && random <= 100
trigger2 = stateno = 210 && animelemtime(6) >=1 && animelemtime(7) < 0 && movehit
trigger3 = stateno = 200 && animelemtime(3) >=0 && animelemtime(4) < 0 && movehit
trigger4 = stateno = 220 && animelemtime(3) >=0 && animelemtime(4) < 0 && movehit
trigger5 = p2statetype != A && p2statetype != L && statetype != A && (p2stateno = [100,104]) && (stateno = [100,101]) && random <= 200

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;Slash Kick A
[State -1]
type = ChangeState
value = 1200
triggerall = p2stateno != 5040 && p2statetype != A
triggerall = var(9) = 1 && statetype != A
trigger1 = p2bodydist x <= 130 && p2statetype != A && p2statetype != L && p2stateno != 5201 && ctrl && random <= 100
trigger2 = stateno = 500 && animelemtime(4) >=0 && animelemtime(5) < 0 && movecontact && random <= 400
trigger2 = stateno = 235 && animelemtime(7) >=0 && animelemtime(8) < 0 && movehit && p2statetype !=A && random <= 100
trigger3 = stateno = 320 && animelemtime(3) >=0 && animelemtime(4) < 0 && movehit && random <= 100

;Slash Kick B
[State -1]
type = ChangeState
value = 1205
triggerall = p2stateno != 5040 && p2statetype != A
triggerall = var(9) = 1 && statetype != A
trigger1 = p2bodydist x >= 110 && p2statetype != A && p2statetype != L && p2stateno != 5201 && ctrl && random <= 100
trigger2 = stateno = 500 && animelemtime(4) >=0 && animelemtime(5) < 0 && movecontact && random <= 400
trigger2 = stateno = 235 && animelemtime(7) >=0 && animelemtime(8) < 0 && movehit && p2statetype !=A && random <= 100
trigger3 = stateno = 320 && animelemtime(3) >=0 && animelemtime(4) < 0 && movehit && random <= 100

[state -1 bc]
type = changestate
value = 1210
triggerall = var(9) = 1
triggerall = stateno = 1207 && (p2stateno = [5000,5999])
trigger1 = time = [7,9]

;Thrush Heel A
[State -1]
type = ChangeState
value = 1100
triggerall = var(9) = 1
triggerall = statetype != A
triggerall = p2stateno != [5080, 5090]
triggerall = p2stateno != [5100, 5110]
triggerall = p2stateno != [5121, 5160]
triggerall = p2stateno != [5170, 5200]
trigger1 = p2bodydist x <= 80 && (stateno=330||stateno=230) && movehit && random <= 40
trigger2 = (p2bodydist x = [-20,30]) && p2bodydist y <= -30 && p2statetype = A &&  ctrl && random <=85 && p2movetype = H
trigger3 = ctrl && p2stateno = 1045 && FrontEdgeBodyDist>=70 && random <= 65
trigger4 = ((stateno = [231,299])||(stateno = [400,519])) && MoveHit && random = [874,883]
trigger5 = p2stateno = 5120 && time >= 12 && p2bodydist x < 45 && random > 985 && ctrl
trigger6 = (p2bodydist x = [-20,70]) && p2statetype != A &&  ctrl && random <= 20

;Thrush Heel B
[State -1]
type = ChangeState
value = 1115
triggerall = var(9) = 1
triggerall = statetype != A
triggerall = p2stateno != [5080, 5090]
triggerall = p2stateno != [5100, 5110]
triggerall = p2stateno != [5121, 5160]
triggerall = p2stateno != [5170, 5200]
trigger1 = p2bodydist x >= 80 && (stateno=330||stateno=230) && movehit && random <= 40
trigger2 = (p2bodydist x = [-20,30]) && p2bodydist y <= -30 && p2statetype = A &&  ctrl && random <=85 && p2movetype = H
trigger3 = ctrl && p2stateno = 1045 && FrontEdgeBodyDist>=70 && random <= 65
trigger4 = ((stateno = [231,299])||(stateno = [400,519])) && MoveHit && random = [874,883]
trigger5 = p2stateno = 5120 && time >= 12 && p2bodydist x < 45 && random > 985 && ctrl
trigger6 = (p2bodydist x = [-20,70]) && p2statetype != A &&  ctrl && random <= 20

;Rising Knee a
[State -1]
type = ChangeState
value = 1300
triggerall = var(9) = 1
triggerall = statetype != A
triggerall = ((p2stateno != [1054,1055]) && (p2stateno != [5030,5069]))
triggerall = p2stateno != [5080, 5090]
triggerall = p2stateno != [5100, 5110]
triggerall = p2stateno != [5120, 5160]
triggerall = p2stateno != [5170, 5200]
trigger1 = (p2bodydist x = [-20,90]) && (p2bodydist y = [-80,-10]) && p2statetype = A && ctrl && random <= 80
trigger2 = ((stateno = [200,210])||(stateno = [300,320])) && p2bodydist x <= 34 && movehit && random <=20
trigger3 = p2bodydist x <= 28 && ctrl && random <=13 
trigger4 = p2stateno = 5070 && p2bodydist x <= 20 && ctrl && random <= 30

;Rising Knee b
[State -1]
type = ChangeState
value = 1316
triggerall = var(9) = 1
triggerall = statetype != A
triggerall = ((p2stateno != [1054,1055]) && (p2stateno != [5030,5069]))
triggerall = p2stateno != [5080, 5090]
triggerall = p2stateno != [5100, 5110]
triggerall = p2stateno != [5120, 5160]
triggerall = p2stateno != [5170, 5200]
trigger1 = (p2bodydist x = [-20,90]) && (p2bodydist y = [-80,-10]) && p2statetype = A && ctrl && random <= 100
trigger2 = ((stateno = [200,210])||(stateno = [300,320])) && p2bodydist x <= 34 && movehit && random <=50
trigger3 = p2bodydist x <= 28 && ctrl && random <=13 
trigger4 = p2stateno = 5070 && p2bodydist x <= 20 && ctrl && random <= 150
trigger5 = p2movetype = A && ctrl
trigger5 = p2statetype != A
trigger5 = p2bodydist x < 40

;Diving Bycyle Kick a
[State -1]
type = ChangeState
value = 1520
triggerall = var(9) = 1
triggerall = StateType = A && Time >= 15
triggerall = stateno != 5040
trigger1 = ctrl && p2bodydist x <= 20 && random <=100
trigger2 = ((stateno=[600,699])||(stateno = [700,799])) && movecontact && random <=200

[state -1 cc]
type = changestate
value = 1540
triggerall = var(9) = 1
triggerall = stateno = 1530
triggerall = p2statetype != S && random <=100
trigger1 = time = [1,3]

[state -1]
type = changestate
value = 1535
triggerall = var(9) = 1
triggerall = stateno = 1530
triggerall = p2statetype =S && random <=100
trigger1 = time = [1,3]

;Diving Bycyle Kick b
[State -1]
type = ChangeState
value = 1521
triggerall = var(9) = 1
triggerall = StateType = A && Time >= 15
triggerall = stateno != 5040
trigger1 = ctrl && p2bodydist x <= 60 && random <=100
trigger2 = ((stateno=[600,699])||(stateno = [700,799])) && movecontact && random <=200

;Wind Burst a
[State -1]
type = ChangeState
value = 1030
triggerall = p2stateno != 5040 && p2statetype != A
triggerall = var(9) = 1 && statetype != A
triggerall = roundstate = 2
trigger1 = (p2bodydist x = [40,100]) && p2statetype != A && p2statetype != L && p2stateno != 5201 && ctrl && random <= 100
trigger2 = stateno = 200 && animelemtime(4) >=0 && animelemtime(5) < 0 && movecontact && random <= 800
trigger2 = stateno = 230 && animelemtime(7) >=0 && animelemtime(8) < 0 && movehit && p2statetype !=A && random <= 100
trigger3 = stateno = 220 && animelemtime(3) >=0 && animelemtime(4) < 0 && movehit && random <= 100
trigger4 = ctrl && (prevstateno = [1200,1399]) && random < 650

;Wind Burst b
[State -1]
type = ChangeState
value = 1010
triggerall = p2stateno != 5040 && p2statetype != A
triggerall = var(9) = 1 && statetype != A
triggerall = roundstate = 2
trigger1 = (p2bodydist x = [40,100]) && p2statetype != A && p2statetype != L && p2stateno != 5201 && ctrl && random <= 100
trigger2 = stateno = 200 && animelemtime(4) >=0 && animelemtime(5) < 0 && movecontact && random <= 800
trigger2 = stateno = 230 && animelemtime(7) >=0 && animelemtime(8) < 0 && movehit && p2statetype !=A && random <= 100
trigger3 = stateno = 220 && animelemtime(3) >=0 && animelemtime(4) < 0 && movehit && random <= 100


;Dodge forward
[State -1]
type = ChangeState
value = 361
triggerall = roundstate = 2
triggerall = var(9) = 1
triggerall = p2movetype = A
triggerall = random <= 300
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 101

;Dodge backward
[State -1]
type = ChangeState
value = 360
triggerall = roundstate = 2
triggerall = var(9) = 1
triggerall = p2movetype = A
triggerall = p2bodydist x <= 50
triggerall = random <= 300
trigger1 = statetype != A
trigger1 = ctrl

;Run Forward
[State -1]
type = ChangeState
value = 100
triggerall = roundstate = 2
triggerall = var(9) = 1
triggerall = p2movetype != A
triggerall = p2bodydist x >= 150
triggerall = random <= 30
trigger1 = statetype != A
trigger1 = ctrl

;Run Forward
[State -1]
type = ChangeState
value = 100
triggerall = roundstate = 2
triggerall = var(9) = 1
triggerall = p2statetype = L
trigger1 = stateno = 0
trigger1 = ctrl
trigger1 = p2bodydist x > 50

;Jumping strong Kick
[State -1]
type = ChangeState
value = 630
triggerall = roundstate = 2
triggerall = var(9) = 1
triggerall = p2bodydist x <= 40 && random > 100
triggerall = p2statetype != L
trigger1 = statetype = A
trigger1 = ctrl

;Forward jump
[State -1]
type = ChangeState
value = 39
triggerall = roundstate = 2
triggerall = var(9) = 1
triggerall = p2bodydist x = [75,90]
triggerall = random <= 30
trigger1 = statetype != A
trigger1 = ctrl = 1

;Crouching block
[State -1]
type = ChangeState
value = 131
triggerall = p2movetype = A
triggerall = P2bodydist X <= 40
triggerall = statetype = C
triggerall = random <= 600
triggerall = var(9) = 1
trigger1 = ctrl

;Block
[State -1]
type = ChangeState
value = 130
triggerall = p2movetype = A
triggerall = P2bodydist X <= 40
triggerall = random <= 600
triggerall = statetype = S
triggerall = var(9) = 1
trigger1 = ctrl

;Air block
[State -1]
type = ChangeState
value = 152
triggerall = p2movetype = A
triggerall = P2bodydist X <= 40
triggerall = statetype = A
triggerall = random <= 600
triggerall = var(9) = 1
trigger1 = ctrl

;RANDOM CLOSE ATTACK
[State -1]
type = ChangeState
value = 4001
triggerall = roundstate = 2
triggerall = var(9) = 1
triggerall = p2bodydist x <= 35
triggerall = random <= 300
triggerall = p2stateno != 5120
triggerall = p2statetype != L
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 52
trigger2 = animelem = 1, >= 1
trigger3 = stateno = 101

;RANDOM SPECIAL DURING A COMBO
[State -1]
type = ChangeState
value = 4002
triggerall = roundstate = 2
triggerall = var(9) = 1
trigger1 = random < 100
trigger1 = stateno = 200 && movecontact
trigger2 = random < 100
trigger2 = stateno = 210 && movecontact
trigger3 = random < 100
trigger3 = stateno = 220 && movecontact
trigger4 = random < 100
trigger4 = stateno = 230 && movecontact
trigger5 = random < 100
trigger5 = stateno = 420 && movecontact

;Recovery
[State -1]
type = ChangeState
value = 370
triggerall = var(9) = 1
triggerall = stateno >= 5030
triggerall = CanRecover
triggerall = alive
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -30

;Taunt
[State -1]
type = ChangeState
value = 195
triggerall = var(9) = 1 && statetype != A
triggerall = roundstate = 2
trigger1 = ctrl && p2statetype = L && p2bodydist x >= 240 && random <=45
