; The CMD file.
[Remap]
x = x
y = y
z = z
a = a
b = b
c = c
s = s

;-| Default Values |-------------------------------------------------------
[Defaults]
command.time = 30
command.buffer.time = 1

;-| Super Motions |------------------------------------------------------
[Command]
name = "SGS"
command = x, x, F, a, z
time = 45

[Command]
name = "SGS"
command = x, x, F, a, ~z
time = 45

[command]
name = "misogi"
command = ~F, DF, D, DB, B, F, DF, D, DB, B, a
time = 25

[command]
name = "misogi"
command = ~F, DF, D, DB, B, F, DF, D, DB, B, ~a
time = 25

[command]
name = "misogi"
command = ~F, DF, D, DB, B, F, DF, D, DB, B, b
time = 25

[command]
name = "misogi"
command = ~F, DF, D, DB, B, F, DF, D, DB, B, ~b
time = 25

[command]
name = "misogi"
command = ~F, DF, D, DB, B, F, DF, D, DB, B, c
time = 25

[command]
name = "misogi"
command = ~F, DF, D, DB, B, F, DF, D, DB, B, ~c
time = 25

[command]
name = "misogi"
command = ~F, D, B, F, D, B, a
time = 25

[command]
name = "misogi"
command = ~F, D, B, F, D, B, ~a
time = 25

[command]
name = "misogi"
command = ~F, D, B, F, D, B, b
time = 25

[command]
name = "misogi"
command = ~F, D, B, F, D, B, ~b
time = 25

[command]
name = "misogi"
command = ~F, D, B, F, D, B, c
time = 25

[command]
name = "misogi"
command = ~F, D, B, F, D, B, ~c
time = 25

[command]
name = "Shinku1"
command = ~F, DF, D, DB, B, F, DF, D, DB, B, x
time = 25

[command]
name = "Shinku1"
command = ~F, DF, D, DB, B, F, DF, D, DB, B, ~x
time = 25

[command]
name = "Shinku2"
command = ~F, DF, D, DB, B, F, DF, D, DB, B, y
time = 25

[command]
name = "Shinku2"
command = ~F, DF, D, DB, B, F, DF, D, DB, B, ~y
time = 25

[command]
name = "Shinku3"
command = ~F, DF, D, DB, B, F, DF, D, DB, B, z
time = 25

[command]
name = "Shinku3"
command = ~F, DF, D, DB, B, F, DF, D, DB, B, ~z
time = 25

[command]
name = "Shinku1"
command = ~F, D, B, F, D, B, x
time = 25

[command]
name = "Shinku1"
command = ~F, D, B, F, D, B, ~x
time = 25

[command]
name = "Shinku2"
command = ~F, D, B, F, D, B, y
time = 25

[command]
name = "Shinku2"
command = ~F, D, B, F, D, B, ~y
time = 25

[command]
name = "Shinku3"
command = ~F, D, B, F, D, B, z
time = 25

[command]
name = "Shinku3"
command = ~F, D, B, F, D, B, ~z
time = 25

[command]
name = "Shoryureppaz"
command = ~D, DF, F, D, DF, F, z
time = 20

[command]
name = "Shoryureppay"
command = ~D, DF, F. D, DF, F, y
time = 20

[command]
name = "Shoryureppax"
command = ~D, DF, F, D, DF, F, x
time = 20

[command]
name = "Shoryureppaz"
command = ~D, DF, F, D, DF, F, ~z
time = 20

[command]
name = "Shoryureppay"
command = ~D, DF, F. D, DF, F, ~y
time = 20

[command]
name = "Shoryureppax"
command = ~D, DF, F, D, DF, F, ~x
time = 20

[command]
name = "Pcounter"
command = ~D, D, x+y+z
time = 20

[command]
name = "Kcounter"
command = ~D, D, a+b+c
time = 20

;-| EX Specials |---------------------------------------------------------
[command]
name = "exsHado"
command = ~F, D, B, x+y
time = 20

[command]
name = "exsHado"
command = ~F, D, B, y+z
time = 20

[command]
name = "exsHado"
command = ~F, D, B, x+z
time = 20

[command]
name = "exsHado"
command = ~F, DF, D, DB, B, y+z
time = 20

[command]
name = "exsHado"
command = ~F, DF, D, DB, B, x+y
time = 20

[command]
name = "exsHado"
command = ~F, DF, D, DB, B, x+z
time = 20

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

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

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

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

[command]
name = "EX Shoryuken"
command = ~F, D, DF, y+z
time = 15

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

[command]
name = "EX Shoryuken"
command = ~F, D, DF, x+y
time = 15

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

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

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

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

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

[command]
name = "EX Hadouken"
command = ~D, DF, F, x+z
time = 15

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

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

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

;-| Special Motions |------------------------------------------------------
[command]
name = "sHado"
command = ~F, D, B, x
time = 20

[command]
name = "sHado2"
command = ~F, D, B, y
time = 20

[command]
name = "sHado3"
command = ~F, D, B, z
time = 20

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

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

[command]
name = "sHado3"
command = ~F, DF, D, DB, B, z
time = 20

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

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

[command]
name = "sHado3"
command = ~F, DF, D, DB, B, ~z
time = 20

[command]
name = "Heavy Shoryuken"
command = ~F, D, DF, z
time = 15

[command]
name = "Medium Shoryuken"
command = ~F, D, DF, y
time = 15

[command]
name = "Light Shoryuken"
command = ~F, D, DF, x
time = 15

[command]
name = "Heavy Shoryuken"
command = ~F, D, DF, ~z
time = 15

[command]
name = "Medium Shoryuken"
command = ~F, D, DF, ~y
time = 15

[command]
name = "Light Shoryuken"
command = ~F, D, DF, ~x
time = 15

[Command]
name = "Alpha_p"
command = ~B, DB, D, x
time = 16

[Command]
name = "Alpha_p"
command = ~B, DB, D, y
time = 16

[Command]
name = "Alpha_p"
command = ~B, DB, D, z
time = 16

[Command]
name = "Alpha_k"
command = ~B, DB, D, a
time = 16

[Command]
name = "Alpha_k"
command = ~B, DB, D, b
time = 16

[Command]
name = "Alpha_k"
command = ~B, DB, D, c
time = 16

[Command]
name = "tatsu heavy"
command = ~D, DB, B, c
time = 15

[Command]
name = "tatsu medium"
command = ~D, DB, B, b
time = 15

[Command]
name = "tatsu light"
command = ~D, DB, B, a
time = 15

[Command]
name = "tatsu heavy"
command = ~D, DB, B, ~c
time = 15

[Command]
name = "tatsu medium"
command = ~D, DB, B, ~b
time = 15

[Command]
name = "tatsu light"
command = ~D, DB, B, ~a
time = 15

[command]
name = "Heavy Hadouken"
command = ~D, DF, F, z
time = 15

[command]
name = "Medium Hadouken"
command = ~D, DF, F, y
time = 15

[command]
name = "Light Hadouken"
command = ~D, DF, F, x
time = 15

[command]
name = "Heavy Hadouken"
command = ~D, DF, F, ~z
time = 15

[command]
name = "Medium Hadouken"
command = ~D, DF, F, ~y
time = 15

[command]
name = "Light Hadouken"
command = ~D, DF, F, ~x
time = 15

[Command]
name = "light roll"
command = ~D, DB, B, x
time = 15

[Command]
name = "medium roll"
command = ~D, DB, B, y
time = 15

[Command]
name = "heavy roll"
command = ~D, DB, B, z
time = 15

[Command]
name = "light roll"
command = ~D, DB, B, ~x
time = 15

[Command]
name = "medium roll"
command = ~D, DB, B, ~y
time = 15

[Command]
name = "heavy roll"
command = ~D, DB, B, ~z
time = 15

[Command]
name = "longjump"
command = D,$U
time = 18

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

;-| 2/3 Button Combination |-----------------------------------------------
[Command]
name = "recovery";Required (do not remove)
command = x+y
time = 1

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

;-| Parry stuff | ----------------------------------------------------------------
[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 = "rlsfwd"
command = ~$F
time = 1

[Command]
name = "rlsback"
command = ~$B
time = 1

[Command]
name = "rlsup"
command = ~$U
time = 1

[Command]
name = "rlsdown"
command = ~$D
time = 1

;-| Dir + Button |---------------------------------------------------------
[Command]
name = "fwd_b"
command = /$F,b
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 = "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

;-| 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 = "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 = "holda"
command = /$a
time = 1

[Command]
name = "holdb"
command = /$b
time = 1

[Command]
name = "holdc"
command = /$c
time = 1


[Statedef -1]

;----------------
;====[Supers]====
;----------------
[State -1, ShunGokuSatsu]
type = ChangeState
value = 3300
triggerall = !var(15)
triggerall = !AILevel && roundstate = 2 && statetype != A && power >= 3000
triggerall = ctrl || var(7)
trigger1 = command = "SGS"

[State -1, Misogi]
type = ChangeState
value = 3400
triggerall = !var(15)
triggerall = !AILevel && roundstate = 2 && statetype != A && power >= 3000
triggerall = ctrl || var(7)
trigger1 = command = "misogi"

[State -1, Shoryureppa]
type = ChangeState
value = 3100
triggerall = !AILevel && roundstate = 2 && statetype != A
triggerall = power >= 1000 || var(15)
triggerall = ctrl || var(7)
trigger1 = command = "Shoryureppax" || command = "Shoryureppay" || command = "Shoryureppaz"

[State -1, Shinkuu Hadouken]
type = changestate
value = 3050
triggerall = !AILevel && roundstate = 2 && statetype = A
triggerall = !numhelper(3000) && (!numhelper(1000) || stateno = 1050)
triggerall = ctrl || var(7)
triggerall = power >= 1000 || var(15)
trigger1 = command = "Shoryureppax" || command = "Shoryureppay" || command = "Shoryureppaz"
trigger2 = AILevel && (p2bodydist x = [0, 50]) && p2dist y >= -20 && random < 550

[State -1, Shinkuu Hadouken]
type = changestate
value = 3000
triggerall = !AILevel && roundstate = 2 && statetype != A
triggerall = !numhelper(3000) && (!numhelper(1000) || (stateno = 1000 && (AnimElemtime(5) = [2, 8])))
triggerall = ctrl || var(7)
triggerall = power >= 1000 || var(15)
trigger1 = command = "Shinku1" || command = "Shinku2" || command = "Shinku3"

;-----------------------------
;=========[EX moves]==========
;-----------------------------
[State -1, ashurasenkuu]
type = changestate
value = 1400
triggerall = AIlevel && numenemy
triggerall = statetype != A && roundstate = 2 && ctrl
trigger1 = enemynear, movetype = A && (p2bodydist x = [-90, 90])
trigger1 = (enemynear, p2bodydist x > 0) && (enemynear, facing != facing)
trigger1 = random < (ifelse((enemy, hitdefattr = SC, AT), 500, 250) * (AIlevel ** 2 / 64.0))
trigger1 = var(19) := 2

[State -1, ashurasenkuu]
type = changestate
value = 1400
triggerall = !AIlevel && roundstate = 2 && statetype != A
triggerall = command = "df3p" || command = "db3p" || command = "df3k" || command = "db3k"
trigger1 = ctrl || var(6)

[State -1, Shakunetsu hadouken]
type = ChangeState
value = 2600
triggerall = !AILevel && roundstate = 2 && Statetype != A && power >= 500
triggerall = !numhelper(1000) && !numhelper(1500) && !numhelper(3000)
triggerall = ctrl || var(6)
trigger1 = command = "exsHado"

[State -1, EX shoryuken]
type = ChangeState
value = 2100
triggerall = !var(15) && roundstate = 2 && statetype != A && power >= 500
triggerall = ctrl || var(6)
trigger1 = !AILevel && command = "EX Shoryuken"
trigger2 = AILevel && enemy,movetype = A && p2bodydist x < 30 && enemy,statetype != L && enemy,statetype != A && random < 400
trigger2 = (p2stateno != [5200, 5210]) && (p2stateno != [5120, 5122])
trigger3 = numtarget(1200) && enemy,statetype = A && random < 550 && p2bodydist x < 25 && (p2bodydist y = [-25, 0])
trigger3 = enemy, statetype != L

[State -1, EX Tatsumaki]
type = changestate
value = 2200
triggerall = !var(15) && roundstate = 2 && statetype != A && power >= 500
triggerall = ctrl || var(6)
trigger1 = !AILevel && command = "ex tatsu"
trigger2 = AILevel && p2statetype != L && random < 45
trigger2 = p2bodydist x < 25 && numtarget && enemy, statetype = S
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, EX Air Tatsumaki]
type = changestate
value = 2300
triggerall = !var(15) && roundstate = 2 && power >= 500 && statetype = A
triggerall = ctrl || var(6)
trigger1 = !AIlevel && command = "ex tatsu"
trigger2 = AILevel && p2bodydist x < 25 && p2bodydist y = [-20, 20]
trigger2 = random < ifelse(enemy, statetype = C, 225, 45)
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Hadouken]
type = ChangeState
value = 2050
triggerall = statetype = A && roundstate = 2 && power >= 500
triggerall = !numhelper(1000) && !numhelper(1055)
triggerall = ctrl || var(6)
trigger1 = !AILevel && command = "EX Hadouken"
trigger2 = AILevel && (p2bodydist x = [55, 125]) && p2bodydist y > -55 && vel y > 0 && p2statetype != A && random < 125
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, EX Hadouken]
type = Changestate
value = 2000
triggerall = !var(15) && roundstate = 2 && statetype != A && power >= 500 && !numhelper(1000)
triggerall = ctrl || var(6)
trigger1 = !AILevel && command = "EX Hadouken"
trigger2 = AILevel && (p2bodydist x = [85, 220]) && enemy,statetype != A && random<(ifelse((AILevel >= 4), 40, 30))
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, EX Zenpou Tenshin]
type = null;ChangeState
value = 2500
triggerall = !var(15) && statetype != A && power >= 500 && roundstate = 2
triggerall = ctrl || var(6)
trigger1 = !AILevel && command = "ex roll"
trigger2 = AILevel && (p2bodydist x = [75, 120]) && random < 125
trigger2 = enemy, statetype = S || enemy, statetype = L
trigger2 = (p2movetype = I && !enemy, ctrl) || p2movetype = A
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])
trigger3 = AILevel && random < 400
trigger3 = var(25) = 1 && (p2stateno = 1000 || p2stateno = 2000) && (p2bodydist x = [35, 85]) && (enemy, animelemtime(8) < 0)

;-----------------------------------
;---------|Specials|----------------
;-----------------------------------
[State -1, Counter]
type = ChangeState
value = 1700
triggerall = !AILevel && roundstate = 2 && Statetype != A
triggerall = ctrl || var(6)
trigger1 = (command = "Pcounter" || command = "Kcounter")
trigger2 = AILevel && (p2bodydist x = [0, 55]) && (enemynear, facing) != facing && enemy, movetype = A && random < 450
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Shakunetsu hadouken]
type = ChangeState
value = 1600
triggerall = !AILevel && roundstate = 2 && Statetype != A
triggerall = !numhelper(1000) && !numhelper(1500) && !numhelper(3000)
triggerall = ctrl || var(6)
trigger1 = (command = "sHado" || command = "sHado2" || command = "sHado3")

[State -1, Shoryuken]
type = ChangeState
value = 1100
triggerall = roundstate = 2 && statetype != A
triggerall = ctrl || var(6)
trigger1 = !AILevel && (command = "Light Shoryuken" || command = "Medium Shoryuken" || command = "Heavy Shoryuken")
trigger2 = AILevel && enemy,statetype != L && !var(4) && var(2) < 1
trigger2 = p2bodydist x < 30 && (p2bodydist y = [-35, 0]) && enemy,statetype = A && random < ifelse(numtarget(1200), 750, 500)
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])
trigger3 = AILevel && stateno = 5120 && !Animtime && p2bodydist x < 35 && !enemy, ctrl

[State -1, Tatsumaki Senpuu Kyaku]
type = ChangeState
value = 1200
triggerall = roundstate = 2 && statetype != A
triggerall = ctrl || var(6)
trigger1 = !AILevel && (command = "tatsu light" || command = "tatsu medium" || command = "tatsu heavy")
trigger2 = AILevel
trigger2 = (p2bodydist x = [65, 100]) && enemy,movetype = I && !enemy, ctrl && random < 45
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])
trigger3 = AILevel && random < 500
trigger3 = var(25) && (p2stateno = 1000 || p2stateno = 2000) && (p2bodydist x = [45, 120]) && p2statetype != L
trigger4 = AILevel && random < 750 && numtarget && enemy, statetype != A && p2bodydist x < 45 && enemy, statetype != L

[State -1, Air Tatsumaki]
type = Changestate
value = 1300
triggerall = ctrl || var(6)
triggerall = roundstate = 2 && Statetype = A
trigger1 = !AIlevel && (command = "tatsu light" || command = "tatsu medium" || command = "tatsu heavy")
trigger2 = AILevel && (p2bodydist y = [-20, 25]) && p2bodydist x < 25
trigger2 = random < ifelse(Enemy, statetype = C, 250, 120)
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Hadouken]
type = ChangeState
value = 1050
triggerall = statetype = A && roundstate = 2
triggerall = !numhelper(1000) && !numhelper(1055)
triggerall = ctrl || var(6)
trigger1 = !AILevel && command = "Light Hadouken" || command = "Medium Hadouken" || command = "Heavy Hadouken"
trigger2 = AILevel && (p2bodydist x = [55, 125]) && p2bodydist y > -55 && vel y > 0 && enemy, statetype != A && random < 125
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Hadouken]
type = ChangeState
value = 1000
triggerall = statetype != A && roundstate = 2 && !numhelper(1000)
triggerall = ctrl || var(6)
trigger1 = !AILevel && command = "Light Hadouken" || command = "Medium Hadouken" || command = "Heavy Hadouken"
trigger2 = AILevel && (p2bodydist x = [95, 225]) && enemy,statetype != A && random<(ifelse((AILevel >= 4), 70, 50))
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Zenpou Tenshin]
type = null;ChangeState
value = 1500
triggerall = statetype != A && roundstate = 2
triggerall = ctrl || var(6)
trigger1 = !AiLevel && (command = "light roll" || command = "medium roll" || command = "heavy roll")
trigger2 = AILevel && p2bodydist x = [75, 125]
trigger2 = p2statetype = S || p2statetype = L
trigger2 = (p2movetype = I && !enemy, ctrl) || p2movetype = A
trigger2 = random < 45
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])
trigger3 = AILevel && random < 400
trigger3 = var(25) = 1 && (p2stateno = 1000 || p2stateno = 2000) && (p2bodydist x = [45, 85]) && (enemy, animelemtime(8) < 0)

;--------------------------
;=========[throws]=========
;--------------------------
[State -1, Shoulder Throw]
type = ChangeState
value = 800
triggerall = roundstate = 2 && statetype != A && ctrl
trigger1 = !AILevel && command != "holdback" && ((command = "a" && command = "x") || (command = "holdfwd" && command = "x" && command = "a"))
trigger2 = AILevel && p2bodydist x < 20 && p2statetype != A && p2movetype != A && random < 250
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

;-----------------------------
[State -1, Spinning Leg Throw]
type = ChangeState
value = 820
triggerall = roundstate = 2 && statetype != A && ctrl
trigger1 = !AILevel && (command = "x" && command = "a" && command = "holdback")
trigger2 = AILevel && p2bodydist x < 20 && p2movetype != H && p2statetype != A && random < 350
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Alpha Counter]
type = changestate
value = 950
trigger1 = !AIlevel
trigger1 = stateno = 150 || stateno = 152
trigger1 = command = "Alpha_p" || command = "Alpha_k"
trigger1 = roundstate = 2 && statetype != A
trigger1 = power >= 1000 && !var(15)

[State -1, Custom Combo]
type = changestate
value = ifelse(statetype = A, 915, 910)
triggerall = !AIlevel && (command = "c" && command = "z")
triggerall = roundstate = 2
triggerall = power >= 3000 && !var(15)
trigger1 = ctrl ;|| (stateno = [100, 101])

[State -1, Run Fwd]
type = ChangeState
value = 100
triggerall = !AILevel && roundstate = 2 && movetype != A && statetype != A && ctrl
trigger1 = command = "FF" && command != "holddown"

[State -1, Run Back]
type = ChangeState
value = 105
triggerall = !AILevel && roundstate = 2 && movetype != A && statetype != A && ctrl
trigger1 = command = "BB" && command != "holddown"

[State -1, Taunt]
type = ChangeState
value = 195
triggerall = !AILevel && Statetype != A && movetype != A && movetype != H && ctrl
trigger1 = command = "start"

;-basics
[State -1, Light Punch Close] ;+7
type = ChangeState
value = 205
triggerall = p2bodydist X < 10 && Statetype != A && roundstate = 2
triggerall = ctrl || ((stateno = 205 || stateno = 400 || stateno = 430) && time > 3) || var(8)
trigger1 = (command != "holddown" && command = "x") && !AILevel

[State -1, Light Punch]
type = ChangeState
value = 200
triggerall = roundstate = 2 && p2bodydist X >= 10 && statetype != A
triggerall = ctrl || (((stateno = [200, 205]) || stateno = 400 || stateno = 430) && time > 3) || var(8)
trigger1 = !AILevel && (command = "x" && command != "holddown")

[State -1, Medium Punch]
type = ChangeState
value = 210
triggerall = roundstate = 2 && p2bodydist x >= 15 && statetype != A
triggerall = ctrl || var(8)
trigger1 = (command = "y" && command != "holddown" && command != "holdfwd") && !AILevel
trigger2 = AILevel && random < 120 && enemy, statetype != C && p2bodydist x < 55 && p2bodydist y >= -25
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Medium Punch close]
type = ChangeState
value = 215
triggerall = roundstate = 2 && p2bodydist x < 15 && Statetype != A
triggerall = ctrl || var(8)
trigger1 = !AILevel && (command != "holddown" && command = "y" && command != "holdfwd")
trigger2 = AILevel && random < 125 && p2bodydist y >= -25
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Medium Punch + fwd]
type = ChangeState
value = 217
triggerall = roundstate = 2 && statetype != A
triggerall = ctrl || var(8)
trigger1 = (command = "y" && command != "holddown" && command = "holdfwd") && !AILevel
trigger2 = AILevel && random < 115 && enemy,statetype = C && (p2bodydist x = [35, 65]) && p2bodydist y >= -25 && enemy, vel x < 2 && enemy, movetype = I && !enemy, ctrl
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Strong Punch Close]
type = ChangeState
value = 225
triggerall = roundstate = 2 && p2bodydist x < 25 && statetype != A
triggerall = ctrl || var(8)
trigger1 = !AILevel && (command = "z" && command != "holddown")
trigger2 = AILevel && p2bodydist y >= -25 && random < 145
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Strong Punch]
type = ChangeState
value = 220
triggerall = roundstate = 2 && p2bodydist x >= 25 && statetype != A
triggerall = ctrl || var(8)
trigger1 = !AILevel && (command != "holddown" && command = "z")
trigger2 = AILevel && (p2bodydist x = [25, 65]) && enemy,statetype = S && random < 125 && !enemy, ctrl && enemy, movetype = I
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Light Kick]
type = ChangeState
value = 230
triggerall = !AILevel && roundstate = 2 && Statetype != A
triggerall = ctrl || ((stateno = 400 || stateno = 430) && time > 3) || var(8)
trigger1 = command != "holddown" && command = "a"

[State -1, Standing MK Close]
type = ChangeState
value = 245
triggerall = roundstate = 2 && statetype != A && p2bodydist x < 15
triggerall = ctrl || var(8)
trigger1 = !AILevel && (command = "b" && command != "holddown")
trigger2 = AILevel && enemy,statetype != A && (enemy,movetype = A || numtarget) && random < 350
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Standing Medium Kick]
type = ChangeState
value = 240
triggerall = roundstate = 2 && statetype != A && p2bodydist x >= 15
triggerall = ctrl || var(8)
trigger1 = !AILevel && (command = "b" && command != "holddown")
trigger2 = AILevel && p2bodydist x < 35 && (p2bodydist y = [-35, 0]) && enemy,statetype != C && random < 75
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Standing Strong Kick Close]
type = ChangeState
value = 255
triggerall = ctrl || var(8)
triggerall = roundstate = 2 && statetype != A && p2bodydist x < 25
trigger1 = !AIlevel && (command = "c" && command != "holddown")
trigger2 = AILevel && enemy,statetype != A && random < 125
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Standing Strong Kick]
type = ChangeState
value = 250
triggerall = ctrl || var(8)
triggerall = roundstate = 2 && statetype != A && p2bodydist x >= 25
trigger1 = !AILevel && (command = "c" && command != "holddown")
trigger2 = AILevel && (p2bodydist x = [35, 65]) && enemy,statetype != A && random < 25
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Crouching Light Punch] ;+6, max range 48ish
type = ChangeState
value = 400
triggerall = statetype != A && roundstate = 2
triggerall = ctrl || (((stateno = [200, 205]) || stateno = 400 || stateno = 430) && time > 3) || var(8)
trigger1 = !AILevel && (command = "x" && command = "holddown")

[State -1, Crouching Medium Punch] ;+4, max range 50ish
type = ChangeState
value = 410
triggerall = roundstate = 2 && statetype != A
triggerall = ctrl || var(8)
trigger1 = !AiLevel && (command = "y" && command = "holddown")

[State -1, Crouching Strong Punch] ;-11, max range 35ish
type = ChangeState
value = 420
triggerall = roundstate = 2 && statetype != A
triggerall = ctrl || var(8)
trigger1 = !AILevel && (command = "z" && command = "holddown")

[State -1, Crouching Light Kick] ;+4, max range 50ish
type = ChangeState
value = 430
triggerall = roundstate = 2 && statetype != A
triggerall = ctrl || (((stateno = [200, 205]) || stateno = 400 || stateno = 430) && time > 3) || var(8)
trigger1 = !AILevel && (command = "a" && command = "holddown")

[State -1, Crouching Medium Kick] ;-1, max range 68ish
type = ChangeState
value = 440
triggerall = roundstate = 2 && statetype != A
triggerall = ctrl || var(8)
trigger1 = !AILevel && (command = "b" && command = "holddown")

[State -1, Crouching Strong Kick] ;max range 65ish
type = ChangeState
value = 450
triggerall = roundstate = 2 && statetype != A
triggerall = ctrl || var(8)
trigger1 = !AILevel && (command = "c" && command = "holddown")

[State -1, Jump Light Punch]
type = ChangeState
value = 600
triggerall = roundstate = 2 && statetype = A
triggerall = ctrl || var(8)
trigger1 = !AiLevel && command = "x"
trigger2 = AILevel && p2bodydist x < 25 && random < 55 && p2bodydist y = [-15, 15]
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Jump Medium Punch]
type = ChangeState
value = 610
triggerall = roundstate = 2 && statetype = A
triggerall = ctrl || var(8)
trigger1 = !AiLevel && command = "y"
trigger2 = AILevel && p2bodydist x < 25 && random < 120 && p2bodydist y = [-20, 20]
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Jump Strong Punch]
type = ChangeState
value = 620
triggerall = roundstate = 2 && statetype = A
triggerall = ctrl || var(8)
trigger1 = !AiLevel && command = "z"
trigger2 = AILevel && p2bodydist x < 35 && random < 350 && enemy, statetype = A && p2bodydist y = [-20, 20]
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Jump Medium Kick]
type = ChangeState
value = 645
triggerall = (Vel Y = [-2,2]) && Vel X > 0 && roundstate = 2 && statetype = A
triggerall = ctrl || var(8)
trigger1 = !AiLevel && command = "b" && command = "holddown"
trigger2 = AILevel && (p2bodydist x = [-35, 35]) && (p2bodydist y = [10, 55]) && vel y > 0 && p2statetype != A && random < 65
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Jump Light Kick]
type = ChangeState
value = 631
triggerall = roundstate = 2 && statetype = A && vel x
triggerall = ctrl || var(8)
trigger1 = !AiLevel && command = "a"
trigger2 = AILevel && p2bodydist x < 20 && random < 45 && p2bodydist y = [-15, 15]
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Jump Medium Kick]
type = ChangeState
value = 641
triggerall = roundstate = 2 && statetype = A && vel x
triggerall = ctrl || var(8)
trigger1 = !AiLevel && command = "b"
trigger2 = AILevel && (p2bodydist x = [-35, 35]) && (p2bodydist y = [-55, 55])
trigger2 = vel y > 0 && enemy, statetype != A && random < 350
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Jump Strong Kick]
type = ChangeState
value = 651
triggerall = roundstate = 2 && statetype = A && vel x
triggerall = ctrl || var(8)
trigger1 = !AiLevel && command = "c"
trigger2 = AILevel && p2bodydist x < 25 && random < 250 && vel y > 0 && p2bodydist y = [-25, 25]
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Jump Neutral Light Kick]
type = ChangeState
value = 630
triggerall = roundstate = 2 && statetype = A && !vel x 
triggerall = ctrl || var(8)
trigger1 = !AiLevel && command = "a"
trigger2 = AILevel && p2bodydist x < 20 && random < 175 && p2bodydist y = [-25, 20]
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Jump Neutral Medium Kick]
type = ChangeState
value = 640
triggerall = roundstate = 2 && statetype = A && !vel x
triggerall = ctrl || var(8)
trigger1 = !AiLevel && command = "b"
trigger2 = AILevel && p2bodydist x < 20 && random < 145 && p2bodydist y = [-25, 15]
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

[State -1, Jump Neutral Strong Kick]
type = ChangeState
value = 650
triggerall = roundstate = 2 && statetype = A && !vel x 
triggerall = ctrl || var(8)
trigger1 = !AiLevel && command = "c"
trigger2 = AILevel && p2bodydist x < 25 && random < 195 && p2bodydist y = [-15, 15]
trigger2 = (enemynear,stateno != [5100, 5101]) && (enemynear,stateno != [5110, 5112]) && (enemynear,stateno != [5120, 5122])

;AI stuff

[State -1, Fall Recovery]
type = changestate
value = 5210
triggerall = roundstate = 2
trigger1 = AIlevel && numenemy && roundstate = 2 && alive && stateno = 5050 && canrecover
trigger1 = vel y > 0 && pos y < -20
trigger1 = random < 500

[State -1, Fall Recovery]
type = changestate
value = 5200
triggerall = roundstate = 2
trigger1 = AIlevel && numenemy && roundstate = 2 && alive
trigger1 = stateno = 5050 && gethitvar(fall.recover)
trigger1 = vel y > 0 && pos y >= -20
trigger1 = random < 500

[State -1, Jump]
type = changestate
value = 40
triggerall = AIlevel && numenemy && roundstate = 2 && statetype != A && ctrl
trigger1 = enemynear, movetype = A && p2bodydist x < 160 && enemynear, hitdefattr = SC, AT

[State -1, Dash Backward] ;Pots Honda
type = changestate
value = 105
triggerall = AIlevel && numenemy && roundstate = 2 && statetype = S
triggerall = ctrl && (stateno != [100, 106])
trigger1 = (enemynear, movetype = A) && backedgedist >= 80 && (p2bodydist x = [80, 120]) && (enemynear, vel x = [ -12, 2])
trigger1 = random < (ifelse((enemynear, hitdefattr = SC, AT), 150, 50) * (AIlevel ** 2 / 64.0))
trigger2 = p2statetype = L && p2bodydist x < 80 && random < 100

[State -1, Guard]
type = changestate
value = 120
trigger1 = AIlevel && numenemy
trigger1 = roundstate = 2 && inguarddist
trigger1 = ctrl && (stateno != [120, 155])
trigger1 = p2bodydist x >= 40
trigger1 = !(enemynear, hitdefattr = SCA, AT) && (enemynear, time < 120)
trigger1 = statetype != A || p2statetype = A
trigger1 = random < (ifelse((p2stateno = [200, 699]), 100, ifelse((p2stateno = [1000, 2999]), 333, 500)) * (AIlevel ** 2 / 64.0))

[State -1, Alpha Counter]
type = changestate
value = 950
trigger1 = AIlevel && numenemy
trigger1 = stateno = 150 || stateno = 152
trigger1 = roundstate = 2 && statetype != A
trigger1 = power >= 1000
trigger1 = random < (25 * (AIlevel ** 2 / 64.0))
trigger1 = (p2bodydist x = [0, 50]) && (life < 0.5 * lifemax)

[State -1, Custom Combo]
type = changestate
value = ifelse(statetype = A, 915, 910)
trigger1 = AIlevel && numenemy
trigger1 = roundstate = 2 && (statetype != A || (vel x > 0 && vel y >= 0))
trigger1 = power >= 1000 && !var(15)
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101]))
trigger1 = (enemynear, movetype = A) && (p2bodydist x = [0, 40]) && (p2dist y = [ -60, 60]) && (enemynear, vel y >= 0)
trigger1 = (enemynear, stateno = [200, 699]) && random < (250 * (AIlevel ** 2 / 64.0))
trigger1 = (enemynear, backedgebodydist <= 32 || enemynear, frontedgebodydist <= 32)

[State -1, Run Fwd]
type = ChangeState
value = 100
triggerall = AILevel && roundstate = 2 && movetype != A && statetype != A && ctrl && stateno != 101
trigger1 = (p2bodydist x = [140, 480]) && random < 150 && !enemy, ctrl && enemy, movetype = I
trigger2 = p2bodydist x > 45 && enemy,statetype = L && random < 500

[State -1, Crouching Light Kick] ;+4, max range 50ish
type = ChangeState
value = 430
triggerall = roundstate = 2 && statetype != A && AILevel && enemy, statetype != A && ctrl
triggerall = p2statetype != L || (p2stateno != [5120, 5122]) || (p2stateno != [5200, 5210])
trigger1 = p2bodydist x < 45 && random < 350 && (p2movetype = I || !(enemy, ctrl))
trigger2 = (enemy, stateno = [200, 3999]) && enemy, statetype != A && !enemy, ctrl && enemy, movetype = I && p2bodydist x < 45

[State -1, Crouching Strong Punch AI] ;-11, max range 35ish
type = ChangeState
value = 420
triggerall = AILevel && roundstate = 2 && statetype != A && ctrl
triggerall = p2statetype != L && (p2stateno != [5120, 5122]) && (p2stateno != [5200, 5210])
trigger1 = (((stateno = [200, 205]) || stateno = 400) && !Animtime) && numtarget && p2bodydist x < 35 && random < 750
trigger2 = (p2bodydist x < 30 && (p2bodydist y = [-25, 0])) && random < 200 && p2statetype = A;(random<var(58)-7)

[State -1, Crouching Light Punch AI] ;+6, max range 48ish
type = ChangeState
value = 400
triggerall = AILevel && statetype != A && roundstate = 2 && ctrl && enemy, statetype != A
triggerall = p2statetype != L || (p2stateno != [5120, 5122]) || (p2stateno != [5200, 5210])
trigger1 = p2bodydist x < 48 && numtarget && ((stateno = [200, 205]) || stateno = 400 || stateno = 430) && time > 3 && random < 750
trigger2 = p2bodydist x < 45 && random < 400 && p2movetype = I

[State -1, Crouching Medium Punch AI] ;+4, max range 50ish
type = ChangeState
value = 410
triggerall = AILevel && roundstate = 2 && statetype != A && enemy,statetype != A && ctrl
triggerall = p2statetype != L || (p2stateno != [5120, 5122]) || (p2stateno != [5200, 5210])
trigger1 = (stateno = 400 || stateno = 410 || stateno = 430) && numtarget && !animtime && p2bodydist x < 50
trigger2 = p2bodydist x < 45 && random < 200 && p2movetype = I;(random<var(58)+6)

[State -1, Crouching Medium Kick] ;-1, max range 68ish
type = ChangeState
value = 440
triggerall = AILevel && roundstate = 2 && statetype != A && ctrl && enemy,statetype != A
triggerall = p2statetype != L || (p2stateno != [5120, 5122]) || (p2stateno != [5200, 5210])
trigger1 = (stateno = 200 || stateno = 400 || stateno = 430) && !Animtime && random < 750 && p2bodydist x = [10, 68]
trigger2 = p2bodydist x < 60 && random < 200 && p2movetype = I;(random<var(58)+1)
trigger3 = p2movetype = A && p2statetype = S && random < 450 && (p2bodydist x = [20, 65])

[State -1, Crouching Strong Kick] ;max range 65ish
type = ChangeState
value = 450
triggerall = AILevel && roundstate = 2 && statetype != A && ctrl && enemy,statetype != A
triggerall = p2statetype != L || (p2stateno != [5120, 5122]) || (p2stateno != [5200, 5210])
trigger1 = (stateno = [200, 205]) && p2bodydist x < 65 && !Animtime && random < 850
trigger2 = p2bodydist x < 60 && random < 45 && p2movetype = I

[State -1, Light Punch]
type = ChangeState
value = 200
triggerall = AILevel && roundstate = 2 && statetype != A && ctrl && enemy, statetype = S && p2bodydist x = [10,45]
trigger1 = (stateno = [200, 205]) && time > 3 && numtarget && random < 200
trigger2 = !enemy, ctrl && enemy,movetype = I && random < 350
trigger3 = random < 400

[State -1, Light Punch Close]
type = ChangeState
value = 205
triggerall = AILevel && p2bodydist X < 10 && Statetype != A && roundstate = 2 && enemy,statetype != A
triggerall = p2statetype != L || (p2stateno != [5120, 5122]) || (p2stateno != [5200, 5210])
triggerall = ctrl
trigger1 = stateno = 205 || stateno = 430 && numtarget && time > 2 && random < 150

[State -1, Light Kick]
type = ChangeState
value = 230
triggerall = AILevel && ctrl && roundstate = 2 && Statetype != A
triggerall = p2statetype != L || (p2stateno != [5120, 5122]) || (p2stateno != [5200, 5210])
trigger1 = p2bodydist x < 55 && enemy,statetype != A && random < 45

[State -1, shungokusatsu]
type = changestate
value = 3300
triggerall = AIlevel && numenemy && roundstate = 2 && statetype != A
triggerall = power >= 3000 && !var(15)
triggerall = !(enemynear, ctrl) && (p2stateno != 40) && (p2stateno != [5030, 5119])
triggerall = (p2bodydist x = [-160, 160]) && (p2dist y = [-120, 0]) && p2statetype != L
triggerall = (enemynear, vel y = 0) || (enemynear, vel y > 0 && enemynear, vel x < 0)
trigger1 = ctrl && (p2bodydist x = [0, 60]) && (enemynear, statetype != A) && random < (200 * (AIlevel ** 2 / 64.0))
trigger2 = stateno = 1400 && animelemtime(6) >= 0 && (p2bodydist x = [0, 50]) && p2statetype != A && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, Shoryureppa AI]
type = ChangeState
value = 3100
triggerall = roundstate = 2 && AILevel && statetype != A && p2bodydist x < 30
triggerall = power >= 1000 || (var(15) = [1, 5])
triggerall = p2statetype != L || (p2stateno != [5120, 5122]) || (p2stateno != [5200, 5210])
trigger1 = var(7) && numtarget && enemy,statetype != A && random < 500
trigger2 = (p2movetype = A || (p2movetype = I && (!enemy, ctrl))) && p2bodydist x < 35 && ctrl && random < 500 && p2statetype = S

[State -1, shinkuuhadouken]
type = ChangeState
value = 3000
triggerall = roundstate = 2 && AILevel && statetype != A && p2bodydist x = [45, 75]
triggerall = power >= 1000 || var(15) = [1, 5]
triggerall = ctrl || var(7)
triggerall = p2statetype != L || (p2stateno != [5120, 5122]) || (p2stateno != [5200, 5210])
trigger1 = numtarget && enemy,statetype != A && random < ifelse(stateno = 440, 10, 120)
trigger2 = (p2movetype = A || (p2movetype = I && (!enemy, ctrl))) && random < 500 && p2statetype = S

[State -1, Taunt]
type = changestate
value = 195
triggerall = AIlevel && numenemy
triggerall = statetype != A && life >= 0.5 * lifemax
triggerall = (enemynear, life) <= 0.5 * (enemynear, lifemax)
trigger1 = ctrl && p2dist x >= 160 && !(enemynear, ctrl)
trigger1 = (enemynear, movetype = H) && (enemynear, hitfall) && random < (100 * (AIlevel ** 2 / 64.0))