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

;-| Ghetto |-----------------------------------------------------------
[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,a
time = 0
[Command]
name = "AI12"
command = c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
time = 0
[Command]
name = "AI13"
command = x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time = 0
[Command]
name = "AI14"
command = y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time = 0
[Command]
name = "AI15"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time = 0
[Command]
name = "AI16"
command = s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s
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,a
time = 0
[Command]
name = "AI19"
command = b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b
time = 0
[Command]
name = "AI20"
command = c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
time = 0
[Command]
name = "AI21"
command = x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time = 0
[Command]
name = "AI22"
command = y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time = 0
[Command]
name = "AI23"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time = 0
[Command]
name = "AI24"
command = s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s
time = 0
[Command]
name = "AI25"
command = F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F
time = 0
[Command]
name = "AI26"
command = D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D
time = 0
[Command]
name = "AI27"
command = B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B
time = 0
[Command]
name = "AI28"
command = U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U
time = 0
[Command]
name = "AI29"
command = a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a
time = 0
[Command]
name = "AI30"
command = c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
time = 0
[Command]
name = "AI31"
command = x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time = 0
[Command]
name = "AI32"
command = y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time = 0
[Command]
name = "AI33"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time = 0
[Command]
name = "AI34"
command = s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s
time = 0
[Command]
name = "AI35"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time = 0
[Command]
name = "AI36"
command = z,z,z,z,z,z,a,a,a,z,z,z,z,z,z,z,z,z,z
time = 0
[Command]
name = "AI37"
command = z,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,z,z,z
time = 0
[Command]
name = "AI38"
command = z,z,z,z,z,a,a,a,z,z,z,z,z,a,a,a,z,z,z
time = 0
[Command]
name = "AI39"
command = z,z,z,z,z,a,a,a,z,z,z,z,z,z,a,a,z,z,z
time = 0
[Command]
name = "AI40"
command = z,z,z,z,a,a,a,z,z,z,z,a,z,z,a,a,z,z,z
time = 0

;-| Super |----------------------------------------------
[Command]
name = "QCFHCB_p"
command = ~D, F, $D, B, x
time = 25
[Command]
name = "QCFHCB_p"
command = ~D, F, $D, B, y
time = 25
[Command]
name = "QCFHCB_p"
command = ~D, F, $D, B, z
time = 25

[Command]
name = "2QCF_kk"
command = ~D, F, $D, F, a+b
time = 20
[Command]
name = "2QCF_kk"
command = ~D, F, $D, F, b+c
time = 20
[Command]
name = "2QCF_kk"
command = ~D, F, $D, F, a+c
time = 20

[Command]
name = "2QCF_p"
command = ~D, F, $D, F, x
time = 20
[Command]
name = "2QCF_p"
command = ~D, F, $D, F, y
time = 20
[Command]
name = "2QCF_p"
command = ~D, F, $D, F, z
time = 20

[Command]
name = "2QCF_pp"
command = ~D, F, $D, F, x+y
time = 20
[Command]
name = "2QCF_pp"
command = ~D, F, $D, F, y+z
time = 20
[Command]
name = "2QCF_pp"
command = ~D, F, $D, F, x+z
time = 20

[Command]
name = "2QCB_p"
command = ~D, B, $D, B, x
time = 20
[Command]
name = "2QCB_p"
command = ~D, B, $D, B, y
time = 20
[Command]
name = "2QCB_p"
command = ~D, B, $D, B, z
time = 20

[Command]
name = "2QCB_kk"
command = ~D, B, $D, B, a+b
time = 20
[Command]
name = "2QCB_kk"
command = ~D, B, $D, B, b+c
time = 20
[Command]
name = "2QCB_kk"
command = ~D, B, $D, B, a+c
time = 20

[Command]
name = "2QCB_k"
command = ~D, B, $D, B, a
time = 20
[Command]
name = "2QCB_k"
command = ~D, B, $D, B, b
time = 20
[Command]
name = "2QCB_k"
command = ~D, B, $D, B, c
time = 20

;-| EX Special |-------------------------------------------
[Command]
name = "QCF_2p"
command = ~D, DF, F, x+y
time = 15
[Command]
name = "QCF_2p"
command = ~D, DF, F, y+z
time = 15
[Command]
name = "QCF_2p"
command = ~D, DF, F, x+z
time = 15

[Command]
name = "QCB_2p"
command = ~D, DB, B, x+y
time = 15
[Command]
name = "QCB_2p"
command = ~D, DB, B, y+z
time = 15
[Command]
name = "QCB_2p"
command = ~D, DB, B, x+z
time = 15

;-| Special |----------------------------------------------
[Command]
name = "QCF_p"
command = ~D, DF, F, x
time = 15
[Command]
name = "QCF_p"
command = ~D, DF, F, y
time = 15
[Command]
name = "QCF_p"
command = ~D, DF, F, z
time = 15

[Command]
name = "QCB_x"
command = ~D, DB, B, x
time = 15
[Command]
name = "QCB_y"
command = ~D, DB, B, y
time = 15
[Command]
name = "QCB_z"
command = ~D, DB, B, z
time = 15

[Command]
name = "QCB_2k"
command = ~D, DB, B, a+b
time = 15
[Command]
name = "QCB_2k"
command = ~D, DB, B, b+c
time = 15
[Command]
name = "QCB_2k"
command = ~D, DB, B, a+c
time = 15

[Command]
name = "QCB_a"
command = ~D, DB, B, a
time = 15
[Command]
name = "QCB_b"
command = ~D, DB, B, b
time = 15
[Command]
name = "QCB_c"
command = ~D, DB, B, c
time = 15

[Command]
name = "DP_2p"
command = ~F, D, DF, x+y
time = 15
[Command]
name = "DP_2p"
command = ~F, D, DF, y+z
time = 15
[Command]
name = "DP_2p"
command = ~F, D, DF, x+z
time = 15

[Command]
name = "DP_p"
command = ~F, D, DF, x
time = 15
[Command]
name = "DP_p"
command = ~F, D, DF, y
time = 15
[Command]
name = "DP_p"
command = ~F, D, DF, z
time = 15

[Command]
name = "DP_2k"
command = ~F, D, DF, a+b
time = 15
[Command]
name = "DP_2k"
command = ~F, D, DF, b+c
time = 15
[Command]
name = "DP_2k"
command = ~F, D, DF, a+c
time = 15

[Command]
name = "DP_k"
command = ~F, D, DF, a
time = 15
[Command]
name = "DP_k"
command = ~F, D, DF, b
time = 15
[Command]
name = "DP_k"
command = ~F, D, DF, c
time = 15

[Command]
name = "HCF_2k"
command = ~B, $D, F, a+b
time = 20
[Command]
name = "HCF_2k"
command = ~B, $D, F, b+c
time = 20
[Command]
name = "HCF_2k"
command = ~B, $D, F, a+c
time = 20

[Command]
name = "HCF_k"
command = ~B, $D, F, a
time = 20
[Command]
name = "HCF_k"
command = ~B, $D, F, b
time = 20
[Command]
name = "HCF_k"
command = ~B, $D, F, c
time = 20

;-| 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+a
time = 1

;-| Single Button |---------------------------------------------------------
[Command]
name = "fwd"
command = $F
time = 1
[Command]
name = "down"
command = $D
time = 1
[Command]
name = "back"
command = $B
time = 1
[Command]
name = "up"
command = $U
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

[Command]
name = "a_"
command = a
time = 2
buffer.time = 4
[Command]
name = "b_"
command = b
time = 2
buffer.time = 4
[Command]
name = "c_"
command = c
time = 2
buffer.time = 4
[Command]
name = "x_"
command = x
time = 2
buffer.time = 4
[Command]
name = "y_"
command = y
time = 2
buffer.time = 4
[Command]
name = "z_"
command = z
time = 2
buffer.time = 4

;-| 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_s"
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

[Statedef -1]
; Another one Of Melvana's Many Asian Wives
;===========================================================================
;---------------------------------------------------------------------------
[State -1, AI Guard]
Type = ChangeState
Value = 120
triggerall = StateType != A && Var(15) != 0 && Ctrl
trigger1 = (Var(15)*Var(15)*Var(15)*2)*0.1
trigger1 = !(enemynear,hitdefattr=SCA,AT) && inguarddist
trigger1 = (stateno!=[120,155])

[State -1, AI Passive Reset]
type = VarSet
trigger1 = Var(15)
var(13) = 0

[State -1, AI Passive On]
type = VarSet
triggerall = Var(15)
trigger1 = EnemyNear,StateNo = [5100,5120]
var(13) = 1

[State -1, AI Jump]
Type = ChangeState
Value = 40
triggerall = StateType != A && Var(15) != 0 && (Ctrl || StateNo = 100) && RoundState = 2
trigger1 = (Var(15)**3)*2*0.6 > random
trigger1 = EnemyNear,StateNo = 5120 && P2Dist X < 64
trigger2 = (Var(15)**3)*2*0.3 > random
trigger2 = (P2Dist X = [48,80]) && !Var(13) && EnemyNear,MoveType != H
trigger3 = (Var(15)**3)*2*0.6 > random
trigger3 = Abs(P2Dist Y) > 64
trigger4 = (Var(15)**3)*2*0.7 > random
trigger4 = StateNo = 100 && (EnemyNear,StateNo = [1420,1422]) && EnemyNear,MoveType = H && P2Dist X < 96


;---------------------------------------------------------------------------
; * * * TEST * * * 
[State -1, * * * TEST * * * ]
type = ChangeState
value = 2700
triggerall = statetype != A && ctrl
trigger1 = command = "holddown" && command = "start" && Var(15) = 0

;===========================================================================
;---------------------------------------------------------------------------
;Run Fwd
[State -1, ff]
type = ChangeState
value = 100
triggerall = statetype = S && ctrl
trigger1 = command = "FF" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI runs in after Seether
trigger2 = (EnemyNear,StateNo = [1420,1422]) && EnemyNear,MoveType = H && P2Dist X > 32
trigger3 = Var(15) && (Var(15)**3)*2*0.6 > random && RoundState = 2 ; AI runs in if enemy is hurt
trigger3 = EnemyNear,MoveType = H && P2Dist X > 32

;---------------------------------------------------------------------------
;Run Back
[State -1, bb]
type = ChangeState
value = 105
triggerall = statetype = S && ctrl
trigger1 = command = "BB" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.5 > random && RoundState = 2 ; AI dashes back if they're down
trigger2 = P2Dist X < 56 && var(13)

;---------------------------------------------------------------------------
;Roll Dodge
[State -1, a+x]
type = ChangeState
value = 110
triggerall = statetype != A && ctrl
trigger1 = command = "a" && command = "x" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.5 > random && RoundState = 2 ; AI attempts to roll through
trigger2 = !(enemynear,hitdefattr=SCA,AT) && inguarddist

;---------------------------------------------------------------------------
; Taunt B
[State -1, B,s]
type = ChangeState
value = 197
triggerall = statetype != A && ctrl
trigger1 = command = "start" && command = "holdback" && command != "holdfwd" && Var(15) = 0
trigger2 = Var(15) && 10 > random && RoundState = 3 ; AI taunts after win
trigger2 = PrevStateNo != 195 && PrevStateNo != 196 && PrevStateNo != 197

;---------------------------------------------------------------------------
; Taunt N
[State -1, N,s]
type = ChangeState
value = 195
triggerall = statetype != A && ctrl
trigger1 = command = "start" && command != "holdback" && command != "holdfwd" && Var(15) = 0
trigger2 = Var(15) && 90 > random && RoundState = 3 ; AI taunts after win
trigger2 = PrevStateNo != 195 && PrevStateNo != 196 && PrevStateNo != 197

;---------------------------------------------------------------------------
;Taunt F
[State -1, s]
type = ChangeState
value = 199
triggerall = statetype != A && ctrl
trigger1 = command = "start" && command != "holdback" && command = "holdfwd" && Var(15) = 0

;===========================================================================
;---------------------------------------------------------------------------
; Katriarch
[State -1, 2QCB,pp]
type = ChangeState
value = 2600
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = Power >= 2000
triggerall = ctrl || (StateNo = [100,101]) || (((Stateno = [200,2000)) && MoveContact && StateNo != 1051) || (StateNo = 1051 && Time > 40)) || StateNo = 1100 && Var(5) = 1
trigger1 = command = "2QCF_kk" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI counters
trigger2 = enemynear,movetype = A && inguarddist && (p2dist X = [8,72]) && abs(p2dist y < 64)
trigger2 = power >= 2500

;---------------------------------------------------------------------------
; SpinGirl
;[State -1, 2QCB,kk]
;type = ChangeState
;value = 2700
;triggerall = statetype != A
;triggerall = RoundState = 2
;triggerall = Power >= 2000
;triggerall = ctrl || (StateNo = [100,101]) || (((Stateno = [200,2000)) && MoveContact && StateNo != 1051) || (StateNo = 1051 && Time > 40)) || StateNo = 1100 && Var(5) = 1
;trigger1 = command = "2QCB_kk" && Var(15) = 0

;---------------------------------------------------------------------------
; A MIGHTY STORM
[State -1, 2QCB,k]
type = ChangeState
value = 2500
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = Power >= 2000
triggerall = ctrl || (StateNo = [100,101]) || (((Stateno = [200,2000)) && MoveContact && StateNo != 1051) || (StateNo = 1051 && Time > 40)) || StateNo = 1100 && Var(5) = 1
trigger1 = command = "2QCB_kk" && Var(15) = 0

;---------------------------------------------------------------------------
; whos the hand
[State -1, 2QCB,p]
type = ChangeState
value = 2400
triggerall = statetype = A
triggerall = RoundState = 2
triggerall = Power >= 1000
triggerall = ctrl || (StateNo = [100,101]) || (((Stateno = [200,2000)) && MoveContact && StateNo != 1051) || (StateNo = 1051 && Time > 40)) || StateNo = 1100 && Var(5) = 1
trigger1 = command = "2QCB_p" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.7 > random && RoundState = 2 ; AI might combo out of demoncradle
trigger2 = StateNo = 1301 && MoveHit && !MoveReversed && (Time = [28,29])

;---------------------------------------------------------------------------
; Bulletstorm
[State -1, 2QCF,pp]
type = ChangeState
value = 2300
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = Power >= 2000
triggerall = ctrl || (StateNo = [100,101]) || (((Stateno = [200,2000)) && MoveContact && StateNo != 1051) || (StateNo = 1051 && Time > 40)) || StateNo = 1100 && Var(5) = 1
trigger1 = command = "2QCF_pp" && Var(15) = 0

;---------------------------------------------------------------------------
; Yagami Style
[State -1, QCFHCB,p]
type = ChangeState
value = 2100
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = Power >= 1000
triggerall = ctrl || (StateNo = [100,101]) || (((Stateno = [200,2000)) && MoveContact && StateNo != 1051) || (StateNo = 1051 && Time > 40)) || StateNo = 1100 && Var(5) = 1
trigger1 = command = "QCFHCB_p" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.7 > random && RoundState = 2 ; AI might combo if cornering
trigger2 = (StateNo = 1110) && MoveHit && !MoveReversed && EnemyNear,BackEdgeDist < 16
trigger3 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI combos from upperkick
trigger3 = StateNo = 1201 && Time < 2 && MoveHit && !MoveReversed
trigger4 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI combos from gyro
trigger4 = StateNo = 1121 && Time < 2 && MoveHit && !MoveReversed

;---------------------------------------------------------------------------
; StrifeGuy
[State -1, 2QCB,p]
type = ChangeState
value = 2200
triggerall = statetype != A
triggerall = RoundState = 2
triggerall = Power >= 1000
triggerall = ctrl || (StateNo = [100,101])
trigger1 = command = "2QCB_p" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.6 > random && RoundState = 2 ; AI counters
trigger2 = (enemynear,hitdefattr=SCA,AA) && inguarddist && p2bodydist X < 96

;---------------------------------------------------------------------------
; Pillar
[State -1, 2QCF,p]
type = ChangeState
value = 2000
;triggerall = statetype != A
triggerall = RoundState = 2
triggerall = Power >= 1000
triggerall = ctrl || (StateNo = [100,101]) || (((Stateno = [200,2000)) && MoveContact && StateNo != 1051) || (StateNo = 1051 && Time > 40)) || StateNo = 1100 && Var(5) = 1
trigger1 = command = "2QCF_p" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI might combo out of BLADE!
trigger2 = StateNo = 1010 && MoveHit && !MoveReversed 
trigger3 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI might combo out of ninjakiller
trigger3 = StateNo = 1110 && MoveHit && !MoveReversed && EnemyNear,Pos Y < -56 && EnemyNear,Vel Y < 0
trigger4 = Var(15) && (Var(15)**3)*2*0.5 > random && RoundState = 2 ; AI throws out to counter
trigger4 = (P2Dist X = [160,240]) && (EnemyNear,StateNo = [190,5000)) && EnemyNear,MoveType != H && Power > 3000
trigger5 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from air hp if not able to double
trigger5 = StateNo = 620 && MoveHit && !MoveReversed && !Var(12)

;===========================================================================
;---------------------------------------------------------------------------
;DEMONCRADLE EX
[State -1, DP,2p]
type = ChangeState
value = 1350
triggerall = statetype != A
triggerall = Power >= 1000
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
trigger1 = command = "DP_2p" && Var(15) = 0

;---------------------------------------------------------------------------
;DEMONCRADLE
[State -1, DP,p]
type = ChangeState
value = 1300
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
trigger1 = command = "DP_p" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.4 > random && RoundState = 2 ; AI might wakeup dp
trigger2 = (EnemyNear,MoveType = A || EnemyNear,StateType = A && EnemyNear,MoveType != H) && (P2Dist X = [0,48]) && abs(P2Dist Y) < 64; && PrevStateNo = 5120
trigger3 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from c.HP
trigger3 = StateNo = 420 && MoveHit && !MoveReversed

;---------------------------------------------------------------------------
;Gyro EX
[State -1, QCB,2k]
type = ChangeState
value = 1150
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
trigger1 = command = "QCB_2k" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from heavy kick
trigger2 = StateNo = 320 && MoveHit && !MoveReversed

;---------------------------------------------------------------------------
;Gyro
[State -1, QCB,hk]
type = ChangeState
value = 1120
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
trigger1 = command = "QCB_c" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from heavy kick
trigger2 = StateNo = 320 && MoveHit && !MoveReversed

;---------------------------------------------------------------------------
;Ninjakiller
[State -1, QCB,mk]
type = ChangeState
value = 1110
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
trigger1 = command = "QCB_b" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from heavy kick
trigger2 = StateNo = 320 && MoveHit && !MoveReversed

;---------------------------------------------------------------------------
;Airhorn
[State -1, QCB,lk]
type = ChangeState
value = 1100
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
trigger1 = command = "QCB_a" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from heavy kick
trigger2 = StateNo = 320 && MoveHit && !MoveReversed

;---------------------------------------------------------------------------
; Kanoken EX
[State -1, QCF,2p]
type = ChangeState
value = 1080
triggerall = statetype = A
triggerall = Power >= 1000
triggerall = !NumHelper(1081) && !NumHelper(1031) && !NumHelper(1032)
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [600,800)) && MoveContact
trigger1 = command = "QCF_2p" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains after HP
trigger2 = stateno = 620

;---------------------------------------------------------------------------
; Kanoken
[State -1, QCF,p]
type = ChangeState
value = 1030
triggerall = statetype = A
triggerall = !NumHelper(1081) && !NumHelper(1031) && !NumHelper(1032)
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [600,800)) && MoveContact
trigger1 = command = "QCF_p" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.6 > random && RoundState = 2 ; AI throws out randomly
trigger2 = ctrl && (P2Dist X - Abs(P2Dist Y) = [-24,24]) && P2Dist X > 80
trigger3 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from air hp if not able to double
trigger3 = StateNo = 620 && MoveHit && !MoveReversed && !Var(12)

;---------------------------------------------------------------------------
; BLADE! EX
[State -1, QCB,2p]
type = ChangeState
value = 1050
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
triggerall = Power >= 1000
trigger1 = command = "QCB_2p" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from heavy punch
trigger2 = StateNo = 220 && MoveHit && !MoveReversed && Power < 1000

;---------------------------------------------------------------------------
; Double!
[State -1, QCB,hp]
type = ChangeState
value = 1600
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,800)) && MoveContact
trigger1 = (command = "QCB_z" || (command = "QCB_y" || command = "QCB_x") && StateType = A) && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from sweep
trigger2 = StateNo = 520 && MoveHit && !MoveReversed
trigger3 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from air hp
trigger3 = StateNo = 620 && MoveHit && !MoveReversed && Var(12)

;---------------------------------------------------------------------------
; Supercrush!
[State -1, QCB,mp]
type = ChangeState
value = 1500
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
trigger1 = command = "QCB_y" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from guarded basic
trigger2 = ((Stateno = [400,600)) && MoveGuarded) || (EnemyNear,StateNo = [120,159]) && EnemyNear,StateType = C

;---------------------------------------------------------------------------
; BLADE!
[State -1, QCB,lp]
type = ChangeState
value = 1010
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
trigger1 = command = "QCB_x" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.5 > random && RoundState = 2 ; AI chains from heavy punch
trigger2 = StateNo = 220 && MoveHit && !MoveReversed

;---------------------------------------------------------------------------
; Gunslinger EX
[State -1, QCF,2p]
type = ChangeState
value = 1801
triggerall = statetype != A
triggerall = Power >= 1000
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
trigger1 = command = "QCF_2p" && Var(15) = 0

;---------------------------------------------------------------------------
; Gunslinger
[State -1, QCF,p]
type = ChangeState
value = 1800
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
trigger1 = command = "QCF_p" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.3 > random && RoundState = 2 ; AI throws out at a distance
trigger2 = ctrl && P2Dist X > 128
trigger3 = Var(15) && (Var(15)**3)*2*0.6 > random && RoundState = 2 ; AI throws out to counter
trigger3 = ctrl && P2Dist X > 80 && P2MoveType = A

;---------------------------------------------------------------------------
;Upperkick EX
[State -1, DP,2k]
type = ChangeState
value = 1250
triggerall = statetype != A
triggerall = Power >= 1000
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
trigger1 = command = "DP_2k" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI counters close range
trigger2 = enemynear,movetype = A && inguarddist && (p2dist X = [8,72]) && abs(p2dist y < 64)
trigger2 = power < 1000
trigger3 = Var(15) && (Var(15)**3)*2*0.4 > random && RoundState = 2 ; AI counters zoning
trigger3 = P2Dist X >= 160 && (EnemyNear,StateNo = [190,5000)) && EnemyNear,MoveType != H && Power <= 3000

;---------------------------------------------------------------------------
;Upperkick
[State -1, DP,k]
type = ChangeState
value = 1200
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveContact
trigger1 = command = "DP_k" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from heavy punch
trigger2 = StateNo = 220 && MoveHit && !MoveReversed

;--------------------------------------------------------------------------
;Seether EX
[State -1, HCF,2k]
type = ChangeState
value = 1450
triggerall = statetype != A
triggerall = Power >= 1000
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveHit && !MoveReversed
trigger1 = command = "HCF_2k" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from heavy punch
trigger2 = StateNo = 220 && MoveHit && !MoveReversed && !Var(19) && Power >= 1500

;---------------------------------------------------------------------------
;Seether
[State -1, HCF,k]
type = ChangeState
value = 1400
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = [200,600)) && MoveHit && !MoveReversed
trigger1 = command = "HCF_k" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.4 > random && RoundState = 2 ; AI sometimes grabs when close
trigger2 = !var(13) && Enemy,StateNo < 5000 && EnemyNear,StateType != A && P2Dist X < 50 && EnemyNear,MoveType != H  && !Var(17)
trigger3 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI grabs after f+LK
trigger3 = StateNo = 330 && EnemyNear,StateType != A && !Var(17)

;===========================================================================
;---------------------------------------------------------------------------
[State -1, Throw HP]
type = ChangeState
value = 800
triggerall = statetype = S
triggerall = ctrl
triggerall = stateno != 100
triggerall = p2stateno != [40,52]
triggerall = p2bodydist X < 10 && p2movetype != H
triggerall = p2statetype = S || p2statetype = C
trigger1 = (command = "holdfwd" || command = "holdback") && command = "z" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI throws frequently
trigger2 = !var(13) && Enemy,StateNo < 5000 && Pos X >= 0

;---------------------------------------------------------------------------
[State -1, Throw HK]
type = ChangeState
value = 900
triggerall = statetype = S
triggerall = ctrl
triggerall = stateno != 100
triggerall = p2stateno != [40,52]
triggerall = p2bodydist X < 10 && p2movetype != H
triggerall = p2statetype = S || p2statetype = C
trigger1 = (command = "holdfwd" || command = "holdback") && command = "c" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI throws frequently
trigger2 = !var(13) && Enemy,StateNo < 5000 && Pos X < 0

;===========================================================================
;---------------------------------------------------------------------------
;Air d+MK
[State -1, Air d+MK]
type = ChangeState
value = 730
triggerall = statetype = A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 600 || StateNo = 700) && MoveContact
trigger1 = command = "holddown" && command = "b_" && Var(15) = 0

;---------------------------------------------------------------------------
;Air LK
[State -1, Air LK]
type = ChangeState
value = 700
triggerall = statetype = A
triggerall = ctrl || (StateNo = [100,101]) || (StateNo = 600) && MoveContact
trigger1 = command = "a_" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI throws out after short hop
trigger2 = stateno = 50 && var(3) = 0

;---------------------------------------------------------------------------
;Air LP
[State -1, Air LP]
type = ChangeState
value = 600
triggerall = statetype = A
triggerall = ctrl || (StateNo = [100,101]) || (StateNo = 700) && MoveContact
trigger1 = command = "x_" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI throws out after short hop
trigger2 = stateno = 50 && var(3) = 1 && Abs(P2Dist X) + Abs(P2Dist Y) < 64
trigger3 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI throws out while enemy is hurt
trigger3 = stateno = 50 && P2MoveType = H

;---------------------------------------------------------------------------
;Air MK
[State -1, Air MK]
type = ChangeState
value = 710
triggerall = statetype = A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 600 || StateNo = 700) && MoveContact
trigger1 = command = "b_" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains after LK
trigger2 = stateno = 700

;---------------------------------------------------------------------------
;Air MP
[State -1, Air MP]
type = ChangeState
value = 610
triggerall = statetype = A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 600 || StateNo = 700) && MoveContact
trigger1 = command = "y_" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains after LP
trigger2 = stateno = 600

;---------------------------------------------------------------------------
;Air HK
[State -1, Air HK]
type = ChangeState
value = 720
triggerall = statetype = A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 600 || StateNo = 610  || StateNo = 700  || StateNo = 710) && MoveContact
trigger1 = command = "c_" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains after MK
trigger2 = stateno = 710

;---------------------------------------------------------------------------
;Air HP
[State -1, Air HP]
type = ChangeState
value = 620
triggerall = statetype = A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 600 || StateNo = 610  || StateNo = 700  || StateNo = 710) && MoveContact
trigger1 = command = "z_" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI goes for the mixup
trigger2 = (P2Dist X = [-40,0])
trigger3 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains after MP
trigger3 = stateno = 610

;---------------------------------------------------------------------------
;Crouch LK
[State -1, Crouch LK]
type = ChangeState
value = 500
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200 || Stateno = 300 || Stateno = 400) && MoveContact
trigger1 = command = "a_" && command = "holddown" && Var(15) = 0

;---------------------------------------------------------------------------
;Crouch LP
[State -1, Crouch LP]
type = ChangeState
value = 400
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200 || Stateno = 300 || Stateno = 500) && MoveContact
trigger1 = command = "x_" && command = "holddown" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI tries to hit low
trigger2 = StateNo = 200 && MoveGuarded

;---------------------------------------------------------------------------
;Crouch MK
[State -1, Crouch MK]
type = ChangeState
value = 510
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200 || StateNo = 300 || StateNo = 400 || StateNo = 500) && MoveContact
trigger1 = command = "b_" && command = "holddown" && Var(15) = 0

;---------------------------------------------------------------------------
;Crouch MP
[State -1, Crouch MP]
type = ChangeState
value = 410
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200 || StateNo = 300 || StateNo = 400 || StateNo = 500) && MoveContact
trigger1 = command = "y_" && command = "holddown" && Var(15) = 0

;---------------------------------------------------------------------------
;Crouch HK
[State -1, Crouch HK]
type = ChangeState
value = 520
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200 || Stateno = 210 || StateNo = 300 || Stateno = 310 || StateNo = 400 || Stateno = 410 || StateNo = 500 || Stateno = 510) && MoveContact
trigger1 = command = "c_" && command = "holddown" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from medium punch
trigger2 = StateNo < 200 && (P2Dist X = [72,92]) && EnemyNear,StateType = S && EnemyNear,MoveType != H

;---------------------------------------------------------------------------
;Crouch HP
[State -1, Crouch HP]
type = ChangeState
value = 420
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200 || Stateno = 210 || StateNo = 300 || Stateno = 310 || StateNo = 400 || Stateno = 410 || StateNo = 500 || Stateno = 510) && MoveContact
trigger1 = command = "z_" && command = "holddown" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains onto airborne opponent
trigger2 = (StateNo < 600) && MoveHit && !MoveReversed && EnemyNear,StateType = A && Abs(P2Dist Y) > 64 && Abs(P2Dist X) < 48
trigger3 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI tries to antiair
trigger3 = EnemyNear,StateType = A && (Abs(P2Dist Y) = [24,64]) && (Abs(P2Dist X) = [0,48])

;---------------------------------------------------------------------------
;Stand f+LK
[State -1, Stand f+LK]
type = ChangeState
value = 330
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200 || Stateno = 210 || StateNo = 300 || Stateno = 310 || StateNo = 400 || Stateno = 410 || StateNo = 500 || Stateno = 510) && MoveContact
trigger1 = command = "a_" && command != "holddown" && command = "holdfwd" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from medium kick if seether is availiable
trigger2 = StateNo = 310 && !MoveReversed && EnemyNear,StateType != A && !Var(17)

;---------------------------------------------------------------------------
;Stand f+LP
[State -1, Stand f+LP]
type = ChangeState
value = 230
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200 || Stateno = 210 || StateNo = 300 || Stateno = 310 || StateNo = 400 || Stateno = 410 || StateNo = 500 || Stateno = 510) && MoveContact
trigger1 = command = "x_" && command != "holddown" && command = "holdfwd" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.4 > random && RoundState = 2 ; AI infrequently attempts to duck under
trigger2 = EnemyNear,MoveType = A && EnemyNear,StateType = S && !(enemynear,hitdefattr=SCA,NA) && P2BodyDist X < 72

;---------------------------------------------------------------------------
;Stand LK
[State -1, Stand LK]
type = ChangeState
value = 300
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200) && MoveContact
trigger1 = command = "a_" && command != "holddown" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from light punch
trigger2 = (StateNo = 200 || StateNo = 400) && !MoveReversed && EnemyNear,StateType != A

;---------------------------------------------------------------------------
;Stand LP
[State -1, Stand LP]
type = ChangeState
value = 200
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) ||  (Stateno = 200) && MoveContact
trigger1 = command = "x_" && command != "holddown" && command != "holdfwd" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.6 > random && RoundState = 2 ; AI starts the attack
trigger2 = P2BodyDist X < 32 && (abs(P2Dist Y) = [0,64]) && !Var(13)

;---------------------------------------------------------------------------
;Stand MK
[State -1, Stand MK]
type = ChangeState
value = 310
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200 || StateNo = 300 || StateNo = 400 || StateNo = 500) && MoveContact
trigger1 = command = "b_" && command != "holddown" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from light kick
trigger2 = StateNo = 300 && !MoveReversed && EnemyNear,StateType != A

;---------------------------------------------------------------------------
;Stand MP
[State -1, Stand MP]
type = ChangeState
value = 210
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200 || StateNo = 300 || StateNo = 400 || StateNo = 500) && MoveContact
trigger1 = command = "y_" && command != "holddown" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from light punch
trigger2 = StateNo = 200 && !MoveReversed && EnemyNear,StateType = A

;---------------------------------------------------------------------------
;Stand HK
[State -1, Stand HK]
type = ChangeState
value = 320
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200 || Stateno = 210 || StateNo = 300 || Stateno = 310 || StateNo = 400 || Stateno = 410 || StateNo = 500 || Stateno = 510) && MoveContact
trigger1 = command = "c_" && command != "holddown" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains from medium punch
trigger2 = StateNo = 210 && MoveHit && !MoveReversed && EnemyNear,StateType = A

;---------------------------------------------------------------------------
;Stand HP
[State -1, Stand HP]
type = ChangeState
value = 220
triggerall = statetype != A
triggerall = ctrl || (StateNo = [100,101]) || (Stateno = 200 || Stateno = 210 || StateNo = 300 || Stateno = 310 || StateNo = 400 || Stateno = 410 || StateNo = 500 || Stateno = 510) && MoveContact
trigger1 = command = "z" && command != "holddown" && Var(15) = 0
trigger2 = Var(15) && (Var(15)**3)*2*0.9 > random && RoundState = 2 ; AI chains if seether is down
trigger2 = StateNo = 310 && MoveHit && !MoveReversed && Var(17)