; ________________________________
;| Cammy by Phantom.of.the.Server |
; ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
;==============================================================================================
;=======================================< COMMAND FILE >=======================================
;==============================================================================================

;====================< BUTTON REMAPPING >====================

[Remap]
x = x
y = y
z = z
a = a
b = b
c = c
s = s


;====================< DEFAULT VALUES >====================

[Defaults]
command.time = 15
command.buffer.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"
command = /$F
time = 1
[Command]
name = "holdback"
command = /$B
time = 1
[Command]
name = "holdup"
command = /$U
time = 1
[Command]
name = "holddown"
command = /$D
time = 1


;====================< HOLD BUTTON >====================

[Command]
name = "holda"
command = /a
time = 1
[Command]
name = "holdb"
command = /b
time = 1
[Command]
name = "holdc"
command = /c
time = 1
[Command]
name = "holdx"
command = /x
time = 1
[Command]
name = "holdy"
command = /y
time = 1
[Command]
name = "holdz"
command = /z
time = 1
[Command]
name = "holdstart"
command = /s
time = 1


;====================< DIR >====================

[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


;====================< RELEASE DIR >====================

[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


;====================< RELEASE BUTTON >====================

[Command]
name = "rlsx"
command = ~x
time = 1
[Command]
name = "rlsy"
command = ~y
time = 1
[Command]
name = "rlsz"
command = ~z
time = 1
[Command]
name = "rlsa"
command = ~a
time = 1
[Command]
name = "rlsb"
command = ~b
time = 1
[Command]
name = "rlsc"
command = ~c
time = 1


;====================< SUPER MOTIONS >====================

[Command]
name = "236236pp"
command = ~D, DF, F, D, DF, x+y
time = 32
[Command]
name = "236236pp"
command = ~D, DF, F, D, DF, x+z
time = 32
[Command]
name = "236236pp"
command = ~D, DF, F, D, DF, y+z
time = 32

[Command]
name = "236236p"
command = ~D, DF, F, D, DF, x
time = 32
[Command]
name = "236236p"
command = ~D, DF, F, D, DF, y
time = 32
[Command]
name = "236236p"
command = ~D, DF, F, D, DF, z
time = 32
[Command]
name = "236236p"
command = ~D, DF, F, D, DF, ~x
time = 32
[Command]
name = "236236p"
command = ~D, DF, F, D, DF, ~y
time = 32
[Command]
name = "236236p"
command = ~D, DF, F, D, DF, ~z
time = 32

[Command]
name = "236236kk"
command = ~D, DF, F, D, DF, a+b
time = 32
[Command]
name = "236236kk"
command = ~D, DF, F, D, DF, a+c
time = 32
[Command]
name = "236236kk"
command = ~D, DF, F, D, DF, b+c
time = 32

[Command]
name = "236236k"
command = ~D, DF, F, D, DF, a
time = 32
[Command]
name = "236236k"
command = ~D, DF, F, D, DF, b
time = 32
[Command]
name = "236236k"
command = ~D, DF, F, D, DF, c
time = 32
[Command]
name = "236236k"
command = ~D, DF, F, D, DF, ~a
time = 32
[Command]
name = "236236k"
command = ~D, DF, F, D, DF, ~b
time = 32
[Command]
name = "236236k"
command = ~D, DF, F, D, DF, ~c
time = 32

[Command]
name = "214214pp"
command = ~D, DB, B, D, DB, x+y
time = 32
[Command]
name = "214214pp"
command = ~D, DB, B, D, DB, x+z
time = 32
[Command]
name = "214214pp"
command = ~D, DB, B, D, DB, y+z
time = 32

[Command]
name = "214214p"
command = ~D, DB, B, D, DB, x
time = 32
[Command]
name = "214214p"
command = ~D, DB, B, D, DB, y
time = 32
[Command]
name = "214214p"
command = ~D, DB, B, D, DB, z
time = 32
[Command]
name = "214214p"
command = ~D, DB, B, D, DB, ~x
time = 32
[Command]
name = "214214p"
command = ~D, DB, B, D, DB, ~y
time = 32
[Command]
name = "214214p"
command = ~D, DB, B, D, DB, ~z
time = 32

[Command]
name = "214214kk"
command = ~D, DB, B, D, DB, a+b
time = 32
[Command]
name = "214214kk"
command = ~D, DB, B, D, DB, a+c
time = 32
[Command]
name = "214214kk"
command = ~D, DB, B, D, DB, b+c
time = 32

[Command]
name = "214214k"
command = ~D, DB, B, D, DB, a
time = 32
[Command]
name = "214214k"
command = ~D, DB, B, D, DB, b
time = 32
[Command]
name = "214214k"
command = ~D, DB, B, D, DB, c
time = 32
[Command]
name = "214214k"
command = ~D, DB, B, D, DB, ~a
time = 32
[Command]
name = "214214k"
command = ~D, DB, B, D, DB, ~b
time = 32
[Command]
name = "214214k"
command = ~D, DB, B, D, DB, ~c
time = 32


;====================< SPECIAL MOTIONS >====================

[Command]
name = "360pp"
command = ~$B, $D, $F, $U, x+y
time = 32
[Command]
name = "360pp"
command = ~$D, $F, $U, $B, x+y
time = 32
[Command]
name = "360pp"
command = ~$F, $U, $B, $D, x+y
time = 32
[Command]
name = "360pp"
command = ~$U, $B, $D, $F, x+y
time = 32
[Command]
name = "360pp"
command = ~$F, $D, $B, $U, x+y
time = 32
[Command]
name = "360pp"
command = ~$D, $B, $U, $F, x+y
time = 32
[Command]
name = "360pp"
command = ~$B, $U, $F, $D, x+y
time = 32
[Command]
name = "360pp"
command = ~$U, $F, $D, $B, x+y
time = 32

[Command]
name = "360pp"
command = ~$B, $D, $F, $U, x+z
time = 32
[Command]
name = "360pp"
command = ~$D, $F, $U, $B, x+z
time = 32
[Command]
name = "360pp"
command = ~$F, $U, $B, $D, x+z
time = 32
[Command]
name = "360pp"
command = ~$U, $B, $D, $F, x+z
time = 32
[Command]
name = "360pp"
command = ~$F, $D, $B, $U, x+z
time = 32
[Command]
name = "360pp"
command = ~$D, $B, $U, $F, x+z
time = 32
[Command]
name = "360pp"
command = ~$B, $U, $F, $D, x+z
time = 32
[Command]
name = "360pp"
command = ~$U, $F, $D, $B, x+z
time = 32

[Command]
name = "360pp"
command = ~$B, $D, $F, $U, y+z
time = 32
[Command]
name = "360pp"
command = ~$D, $F, $U, $B, y+z
time = 32
[Command]
name = "360pp"
command = ~$F, $U, $B, $D, y+z
time = 32
[Command]
name = "360pp"
command = ~$U, $B, $D, $F, y+z
time = 32
[Command]
name = "360pp"
command = ~$F, $D, $B, $U, y+z
time = 32
[Command]
name = "360pp"
command = ~$D, $B, $U, $F, y+z
time = 32
[Command]
name = "360pp"
command = ~$B, $U, $F, $D, y+z
time = 32
[Command]
name = "360pp"
command = ~$U, $F, $D, $B, y+z
time = 32

[Command]
name = "360p"
command = ~$B, $D, $F, $U, x
time = 32
[Command]
name = "360p"
command = ~$D, $F, $U, $B, x
time = 32
[Command]
name = "360p"
command = ~$F, $U, $B, $D, x
time = 32
[Command]
name = "360p"
command = ~$U, $B, $D, $F, x
time = 32
[Command]
name = "360p"
command = ~$F, $D, $B, $U, x
time = 32
[Command]
name = "360p"
command = ~$D, $B, $U, $F, x
time = 32
[Command]
name = "360p"
command = ~$B, $U, $F, $D, x
time = 32
[Command]
name = "360p"
command = ~$U, $F, $D, $B, x
time = 32

[Command]
name = "360p"
command = ~$B, $D, $F, $U, y
time = 32
[Command]
name = "360p"
command = ~$D, $F, $U, $B, y
time = 32
[Command]
name = "360p"
command = ~$F, $U, $B, $D, y
time = 32
[Command]
name = "360p"
command = ~$U, $B, $D, $F, y
time = 32
[Command]
name = "360p"
command = ~$F, $D, $B, $U, y
time = 32
[Command]
name = "360p"
command = ~$D, $B, $U, $F, y
time = 32
[Command]
name = "360p"
command = ~$B, $U, $F, $D, y
time = 32
[Command]
name = "360p"
command = ~$U, $F, $D, $B, y
time = 32

[Command]
name = "360p"
command = ~$B, $D, $F, $U, z
time = 32
[Command]
name = "360p"
command = ~$D, $F, $U, $B, z
time = 32
[Command]
name = "360p"
command = ~$F, $U, $B, $D, z
time = 32
[Command]
name = "360p"
command = ~$U, $B, $D, $F, z
time = 32
[Command]
name = "360p"
command = ~$F, $D, $B, $U, z
time = 32
[Command]
name = "360p"
command = ~$D, $B, $U, $F, z
time = 32
[Command]
name = "360p"
command = ~$B, $U, $F, $D, z
time = 32
[Command]
name = "360p"
command = ~$U, $F, $D, $B, z
time = 32

[Command]
name = "360p"
command = ~$B, $D, $F, $U, ~x
time = 32
[Command]
name = "360p"
command = ~$D, $F, $U, $B, ~x
time = 32
[Command]
name = "360p"
command = ~$F, $U, $B, $D, ~x
time = 32
[Command]
name = "360p"
command = ~$U, $B, $D, $F, ~x
time = 32
[Command]
name = "360p"
command = ~$F, $D, $B, $U, ~x
time = 32
[Command]
name = "360p"
command = ~$D, $B, $U, $F, ~x
time = 32
[Command]
name = "360p"
command = ~$B, $U, $F, $D, ~x
time = 32
[Command]
name = "360p"
command = ~$U, $F, $D, $B, ~x
time = 32

[Command]
name = "360p"
command = ~$B, $D, $F, $U, ~y
time = 32
[Command]
name = "360p"
command = ~$D, $F, $U, $B, ~y
time = 32
[Command]
name = "360p"
command = ~$F, $U, $B, $D, ~y
time = 32
[Command]
name = "360p"
command = ~$U, $B, $D, $F, ~y
time = 32
[Command]
name = "360p"
command = ~$F, $D, $B, $U, ~y
time = 32
[Command]
name = "360p"
command = ~$D, $B, $U, $F, ~y
time = 32
[Command]
name = "360p"
command = ~$B, $U, $F, $D, ~y
time = 32
[Command]
name = "360p"
command = ~$U, $F, $D, $B, ~y
time = 32

[Command]
name = "360p"
command = ~$B, $D, $F, $U, ~z
time = 32
[Command]
name = "360p"
command = ~$D, $F, $U, $B, ~z
time = 32
[Command]
name = "360p"
command = ~$F, $U, $B, $D, ~z
time = 32
[Command]
name = "360p"
command = ~$U, $B, $D, $F, ~z
time = 32
[Command]
name = "360p"
command = ~$F, $D, $B, $U, ~z
time = 32
[Command]
name = "360p"
command = ~$D, $B, $U, $F, ~z
time = 32
[Command]
name = "360p"
command = ~$B, $U, $F, $D, ~z
time = 32
[Command]
name = "360p"
command = ~$U, $F, $D, $B, ~z
time = 32

[Command]
name = "63214pp"
command = ~F, DF, D, DB, B, x+y
time = 32
[Command]
name = "63214pp"
command = ~F, DF, D, DB, B, x+z
time = 32
[Command]
name = "63214pp"
command = ~F, DF, D, DB, B, y+z
time = 32

[Command]
name = "63214p"
command = ~F, DF, D, DB, B, x
time = 32
[Command]
name = "63214p"
command = ~F, DF, D, DB, B, y
time = 32
[Command]
name = "63214p"
command = ~F, DF, D, DB, B, z
time = 32
[Command]
name = "63214p"
command = ~F, DF, D, DB, B, ~x
time = 32
[Command]
name = "63214p"
command = ~F, DF, D, DB, B, ~y
time = 32
[Command]
name = "63214p"
command = ~F, DF, D, DB, B, ~z
time = 32

[Command]
name = "63214kk"
command = ~F, DF, D, DB, B, a+b
time = 32
[Command]
name = "63214kk"
command = ~F, DF, D, DB, B, a+c
time = 32
[Command]
name = "63214kk"
command = ~F, DF, D, DB, B, b+c
time = 32

[Command]
name = "63214k"
command = ~F, DF, D, DB, B, a
time = 32
[Command]
name = "63214k"
command = ~F, DF, D, DB, B, b
time = 32
[Command]
name = "63214k"
command = ~F, DF, D, DB, B, c
time = 32
[Command]
name = "63214k"
command = ~F, DF, D, DB, B, ~a
time = 32
[Command]
name = "63214k"
command = ~F, DF, D, DB, B, ~b
time = 32
[Command]
name = "63214k"
command = ~F, DF, D, DB, B, ~c
time = 32

[Command]
name = "623pp"
command = ~F, D, DF, x+y
time = 16
[Command]
name = "623pp"
command = ~F, D, DF, x+z
time = 16
[Command]
name = "623pp"
command = ~F, D, DF, y+z
time = 16

[Command]
name = "623p"
command = ~F, D, DF, x
time = 16
[Command]
name = "623p"
command = ~F, D, DF, y
time = 16
[Command]
name = "623p"
command = ~F, D, DF, z
time = 16
[Command]
name = "623p"
command = ~F, D, DF, ~x
time = 16
[Command]
name = "623p"
command = ~F, D, DF, ~y
time = 16
[Command]
name = "623p"
command = ~F, D, DF, ~z
time = 16

[Command]
name = "623kk"
command = ~F, D, DF, a+b
time = 16
[Command]
name = "623kk"
command = ~F, D, DF, a+c
time = 16
[Command]
name = "623kk"
command = ~F, D, DF, b+c
time = 16

[Command]
name = "623k"
command = ~F, D, DF, a
time = 16
[Command]
name = "623k"
command = ~F, D, DF, b
time = 16
[Command]
name = "623k"
command = ~F, D, DF, c
time = 16
[Command]
name = "623k"
command = ~F, D, DF, ~a
time = 16
[Command]
name = "623k"
command = ~F, D, DF, ~b
time = 16
[Command]
name = "623k"
command = ~F, D, DF, ~c
time = 16

[Command]
name = "236kk"
command = ~D, DF, F, a+b
time = 16
[Command]
name = "236kk"
command = ~D, DF, F, a+c
time = 16
[Command]
name = "236kk"
command = ~D, DF, F, b+c
time = 16

[Command]
name = "236k"
command = ~D, DF, F, a
time = 16
[Command]
name = "236k"
command = ~D, DF, F, b
time = 16
[Command]
name = "236k"
command = ~D, DF, F, c
time = 16
[Command]
name = "236k"
command = ~D, DF, F, ~a
time = 16
[Command]
name = "236k"
command = ~D, DF, F, ~b
time = 16
[Command]
name = "236k"
command = ~D, DF, F, ~c
time = 16

[Command]
name = "214p"
command = ~D, DB, B, x
time = 16
[Command]
name = "214p"
command = ~D, DB, B, y
time = 16
[Command]
name = "214p"
command = ~D, DB, B, z
time = 16
[Command]
name = "214p"
command = ~D, DB, B, ~x
time = 16
[Command]
name = "214p"
command = ~D, DB, B, ~y
time = 16
[Command]
name = "214p"
command = ~D, DB, B, ~z
time = 16

[Command]
name = "214kk"
command = ~D, DB, B, a+b
time = 16
[Command]
name = "214kk"
command = ~D, DB, B, a+c
time = 16
[Command]
name = "214kk"
command = ~D, DB, B, b+c
time = 16

[Command]
name = "214k"
command = ~D, DB, B, a
time = 16
[Command]
name = "214k"
command = ~D, DB, B, b
time = 16
[Command]
name = "214k"
command = ~D, DB, B, c
time = 16
[Command]
name = "214k"
command = ~D, DB, B, ~a
time = 16
[Command]
name = "214k"
command = ~D, DB, B, ~b
time = 16
[Command]
name = "214k"
command = ~D, DB, B, ~c
time = 16

[Command]
name = "412p"
command = ~B, DB, D, x
time = 16
[Command]
name = "412p"
command = ~B, DB, D, y
time = 16
[Command]
name = "412p"
command = ~B, DB, D, z
time = 16

[Command]
name = "412k"
command = ~B, DB, D, a
time = 16
[Command]
name = "412k"
command = ~B, DB, D, b
time = 16
[Command]
name = "412k"
command = ~B, DB, D, c
time = 16


;====================< OTHER >====================

[Command]
name = "highjump"
command = $D, $U
time = 15


;====================< 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 = x+z
time = 1
[Command]
name = "recovery"
command = y+z
time = 1
[Command]
name = "recovery"
command = a+x
time = 1

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

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

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

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

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


;==============================================================================================
;========================================< -1 STATES >===========================================
;==============================================================================================

[Statedef -1]

[State -1, Tick Fix]
type = ctrlset
triggerall = !ctrl
trigger1 = (stateno = 52 || stateno = 101 || stateno = 5120) && !animtime
trigger2 = (stateno = [200, 499]) && !animtime
trigger3 = ((stateno = [760, 762]) || (stateno = [700, 715]) || (stateno = [900, 905])) && !animtime
trigger4 = stateno = 810 && !animtime
trigger5 = (stateno = 5001 || stateno = 5011 || stateno = 151 || stateno = 153) && hitover
value = 1

[State -1, Roll Forward]
type = changestate
value = 710
triggerall = !AIlevel
triggerall = command = "a+x"
triggerall = roundstate = 2 && statetype != A
trigger1 = (ctrl || (stateno = [100, 101])) && command = "holdfwd"
trigger2 = var(20) && var(4)

[State -1, Roll Backward]
type = changestate
value = 715
triggerall = !AIlevel
triggerall = command = "a+x"
triggerall = roundstate = 2 && statetype != A
trigger1 = (ctrl || (stateno = [100, 101])) && command = "holdback"

[State -1, Dodge]
type = changestate
value = 700
triggerall = !AIlevel
triggerall = command = "a+x"
triggerall = roundstate = 2 && statetype != A
trigger1 = (ctrl || (stateno = [100, 101]))

[State -1, Killer Bee Assault]
type = changestate
value = ifelse((pos y - screenpos y) >= -250 && palno <= 6, 3200, 3205)
triggerall = !AIlevel
triggerall = command = "214214pp"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 3000 && !var(20)
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(7)

[State -1, MAX Reverse Shaft Breaker]
type = changestate
value = 3150
triggerall = !AIlevel
triggerall = command = "214214kk"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 2000 && var(20) <= 60
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(7) || var(8)

[State -1, MAX Psycho Streak]
type = changestate
value = 3350
triggerall = !AIlevel && palno >= 7
triggerall = command = "236236pp"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 2000 && var(20) <= 60 && !var(44)
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(7) || var(8)

[State -1, MAX Sniping Heel]
type = changestate
value = 3450
triggerall = !AIlevel && palno <= 6
triggerall = command = "236236pp"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 2000 && var(20) <= 60
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(7) || var(8)

[State -1, MAX Spin Drive Smasher]
type = changestate
value = 3050
triggerall = !AIlevel
triggerall = command = "236236kk"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 2000 && var(20) <= 60
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(7) || var(8)

[State -1, Reverse Shaft Breaker]
type = changestate
value = 3100
triggerall = !AIlevel
triggerall = command = "214214k"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 1000 && var(20) <= 60
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(7)

[State -1, Psycho Streak]
type = changestate
value = 3300
triggerall = !AIlevel && palno >= 7
triggerall = command = "236236p"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 1000 && var(20) <= 60 && !var(44)
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(7)

[State -1, Sniping Heel]
type = changestate
value = 3400
triggerall = !AIlevel && palno <= 6
triggerall = command = "236236p"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 1000 && var(20) <= 60
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(7)

[State -1, Spin Drive Smasher]
type = changestate
value = 3000
triggerall = !AIlevel
triggerall = command = "236236k"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 1000 && var(20) <= 60
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(7)

[State -1, EX Earth Direct]
type = changestate
value = 1730
triggerall = !AIlevel && palno >= 7
triggerall = command = "360pp"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 500 && var(20) <= 60
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, EX Axle Spin Knuckle]
type = changestate
value = 1220
triggerall = !AIlevel && palno <= 6
triggerall = command = "63214pp"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 500 && var(20) <= 60
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, EX Cannon Spike]
type = changestate
value = 1120
triggerall = !AIlevel
triggerall = command = "623kk"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 500 && var(20) <= 60
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, EX Cannon Strike]
type = changestate
value = 1420
triggerall = !AIlevel && palno <= 6
triggerall = command = "214kk"
triggerall = roundstate = 2 && statetype = A
triggerall = (var(3) != [1, 2]) && pos y <= -64
triggerall = power >= 500 && var(20) <= 60
trigger1 = ctrl
trigger2 = var(6)

[State -1, EX Air Cannon Drill]
type = changestate
value = 1060
triggerall = !AIlevel && palno >= 7
triggerall = command = "236kk"
triggerall = roundstate = 2 && statetype = A
triggerall = (var(3) != [1, 2]) && pos y <= -64
triggerall = power >= 500 && var(20) <= 60
trigger1 = ctrl
trigger2 = var(6)

[State -1, EX Sniping Arrow]
type = changestate
value = 1620
triggerall = !AIlevel && palno >= 7
triggerall = command = "236kk"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 500 && var(20) <= 60
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, EX Cannon Drill]
type = changestate
value = 1020
triggerall = !AIlevel && palno <= 6
triggerall = command = "236kk"
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 500 && var(20) <= 60
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, Earth Direct]
type = changestate
value = 1700
triggerall = !AIlevel && palno >= 7
triggerall = command = "360p"
triggerall = roundstate = 2 && statetype != A
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, Hooligan Combination]
type = changestate
value = 1300
triggerall = !AIlevel && palno <= 6
triggerall = command = "623p"
triggerall = roundstate = 2 && statetype != A
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, Cannon Revenge High]
type = changestate
value = 1500
triggerall = !AIlevel && palno >= 7
triggerall = command = "214p"
triggerall = roundstate = 2 && statetype != A
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, Cannon Revenge Low]
type = changestate
value = 1510
triggerall = !AIlevel && palno >= 7
triggerall = command = "214k"
triggerall = roundstate = 2 && statetype != A
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, Axle Spin Knuckle]
type = changestate
value = 1200
triggerall = !AIlevel && palno <= 6
triggerall = command = "63214p"
triggerall = roundstate = 2 && statetype != A
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, Cannon Spike]
type = changestate
value = 1100
triggerall = !AIlevel
triggerall = command = "623k"
triggerall = roundstate = 2 && statetype != A
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, Cannon Strike]
type = changestate
value = 1400
triggerall = !AIlevel && palno <= 6
triggerall = command = "214k"
triggerall = roundstate = 2 && statetype = A
triggerall = (var(3) != [1, 2]) && pos y <= -80
trigger1 = ctrl
trigger2 = var(6)

[State -1, Air Cannon Drill]
type = changestate
value = 1050
triggerall = !AIlevel && palno >= 7
triggerall = command = "236k"
triggerall = roundstate = 2 && statetype = A
triggerall = (var(3) != [1, 2]) && pos y <= -64
trigger1 = ctrl
trigger2 = var(6)

[State -1, Sniping Arrow]
type = changestate
value = 1600
triggerall = !AIlevel && palno >= 7
triggerall = command = "236k"
triggerall = roundstate = 2 && statetype != A
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, Cannon Drill]
type = changestate
value = 1000
triggerall = !AIlevel && palno <= 6
triggerall = command = "236k"
triggerall = roundstate = 2 && statetype != A
trigger1 = ctrl || stateno = 40 || stateno = 52 || (stateno = [100, 101])
trigger2 = var(6)

[State -1, Zero Counter]
type = changestate
value = 750
trigger1 = !AIlevel
trigger1 = stateno = 150 || stateno = 152
trigger1 = command = "412p" || command = "412k"
trigger1 = roundstate = 2 && statetype != A
trigger1 = power >= 1000 && !var(20)

[State -1, Custom Combo]
type = changestate
value = ifelse(statetype = A, 905, 900)
trigger1 = !AIlevel
trigger1 = command = "c+z"
trigger1 = roundstate = 2
trigger1 = power >= 1000 && !var(20)
trigger1 = ctrl || stateno = 52 || (stateno = [100, 101])

[State -1, Power Charge]
type = changestate
value = 730
trigger1 = !AIlevel
trigger1 = command = "holdb" && command = "holdy"
trigger1 = roundstate = 2 && statetype != A
trigger1 = power < const(data.power) && power < powermax && !var(20)
trigger1 = ctrl || (stateno = [100, 101])

[State -1, Dash / Run]
type = changestate
value = 102
trigger1 = !AIlevel
trigger1 = command = "FF"
trigger1 = roundstate = 2 && statetype = S
trigger1 = ctrl

[State -1, Dash Backward]
type = changestate
value = 105
trigger1 = !AIlevel
trigger1 = command = "BB"
trigger1 = roundstate = 2 && statetype = S
trigger1 = ctrl

[State -1, Air Throw]
type = changestate
value = 850
trigger1 = !AIlevel
trigger1 = (command = "holdfwd" || command = "holdback") && (command = "pp" || command = "kk")
trigger1 = roundstate = 2 && statetype = A
trigger1 = ctrl && pos y <= -32

[State -1, Throw]
type = changestate
value = 800
trigger1 = !AIlevel
trigger1 = (command = "holdfwd" || command = "holdback") && (command = "pp" || command = "kk")
trigger1 = roundstate = 2 && statetype = S
trigger1 = ctrl

[State -1, ScHP]
type = changestate
value = 221
triggerall = !AIlevel
triggerall = command != "holddown" && command = "z"
triggerall = statetype != A
triggerall = p2bodydist x <= (const(size.xscale) * 20)
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(4)

[State -1, SfHP]
type = changestate
value = 220
triggerall = !AIlevel
triggerall = command != "holddown" && command = "z"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(4)

[State -1, ScHK]
type = changestate
value = 251
triggerall = !AIlevel
triggerall = command != "holddown" && command = "c"
triggerall = statetype != A
triggerall = p2bodydist x <= (const(size.xscale) * 32)
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(4)

[State -1, SfHK]
type = changestate
value = 250
triggerall = !AIlevel
triggerall = command != "holddown" && command = "c"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(4)

[State -1, ScMP]
type = changestate
value = 211
triggerall = !AIlevel
triggerall = command != "holddown" && command = "y"
triggerall = statetype != A
triggerall = p2bodydist x <= (const(size.xscale) * 24)
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(4)

[State -1, SfMP]
type = changestate
value = 210
triggerall = !AIlevel
triggerall = command != "holddown" && command = "y"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(4)

[State -1, ScMK]
type = changestate
value = 241
triggerall = !AIlevel
triggerall = command != "holddown" && command = "b"
triggerall = statetype != A
triggerall = p2bodydist x <= (const(size.xscale) * 20)
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(4)

[State -1, SfMK]
type = changestate
value = 240
triggerall = !AIlevel
triggerall = command != "holddown" && command = "b"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(4)

[State -1, ScLP]
type = changestate
value = 201
triggerall = !AIlevel
triggerall = command != "holddown" && command = "x"
triggerall = statetype != A
triggerall = p2bodydist x <= (const(size.xscale) * 28)
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = (stateno = 200 || stateno = 201 || stateno = 400 || stateno = 430) && time >= 5
trigger3 = var(4)

[State -1, SfLP]
type = changestate
value = 200
triggerall = !AIlevel
triggerall = command != "holddown" && command = "x"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = (stateno = 200 || stateno = 201 || stateno = 400 || stateno = 430) && time >= 5
trigger3 = var(4)

[State -1, ScLK]
type = changestate
value = 231
triggerall = !AIlevel
triggerall = command != "holddown" && command = "a"
triggerall = statetype != A
triggerall = p2bodydist x <= (const(size.xscale) * 20)
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = (stateno = 200 || stateno = 201 || stateno = 400 || stateno = 430) && time >= 5
trigger3 = var(4)

[State -1, SfLK]
type = changestate
value = 230
triggerall = !AIlevel
triggerall = command != "holddown" && command = "a"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = (stateno = 200 || stateno = 201 || stateno = 400 || stateno = 430) && time >= 5
trigger3 = var(4)

[State -1, CHP]
type = changestate
value = 420
triggerall = !AIlevel
triggerall = command = "holddown" && command = "z"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(4)

[State -1, CHK]
type = changestate
value = 450
triggerall = !AIlevel
triggerall = command = "holddown" && command = "c"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(4)

[State -1, CMP]
type = changestate
value = 410
triggerall = !AIlevel
triggerall = command = "holddown" && command = "y"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(4)

[State -1, CMK]
type = changestate
value = 440
triggerall = !AIlevel
triggerall = command = "holddown" && command = "b"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(4)

[State -1, CLP]
type = changestate
value = 400
triggerall = !AIlevel
triggerall = command = "holddown" && command = "x"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = (stateno = 200 || stateno = 201 || stateno = 400 || stateno = 430) && time >= 5
trigger3 = var(4)

[State -1, CLK]
type = changestate
value = 430
triggerall = !AIlevel
triggerall = command = "holddown" && command = "a"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = (stateno = 200 || stateno = 201 || stateno = 400 || stateno = 430) && time >= 5
trigger3 = var(4)

[State -1, AHP]
type = changestate
value = 620
triggerall = !AIlevel
triggerall = command = "z"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = var(4)

[State -1, AHK]
type = changestate
value = 650
triggerall = !AIlevel
triggerall = command = "c"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = var(4)

[State -1, AMP]
type = changestate
value = 610
triggerall = !AIlevel
triggerall = command = "y"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = var(4)

[State -1, AMK]
type = changestate
value = 640
triggerall = !AIlevel
triggerall = command = "b"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = var(4)

[State -1, ALP]
type = changestate
value = 600
triggerall = !AIlevel
triggerall = command = "x"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = var(4)

[State -1, ALK]
type = changestate
value = 630
triggerall = !AIlevel
triggerall = command = "a"
triggerall = statetype = A
trigger1 = ctrl
trigger2 = var(4)

[State -1, Taunt]
type = changestate
value = 195
triggerall = !AIlevel
triggerall = command = "start"
triggerall = statetype != A
trigger1 = ctrl || (stateno = [100, 101])
trigger2 = var(6)


;==============================================================================================
;===========================================< A.I >==============================================
;==============================================================================================

[State -1, Fall Recovery]
type = changestate
value = 5210
trigger1 = AIlevel && numenemy
trigger1 = roundstate = 2 && alive
trigger1 = stateno = 5050 && canrecover
trigger1 = vel y > 0 && pos y < -20
trigger1 = random < (25 * (AIlevel ** 2 / 64.0))

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

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

[State -1, Roll Forward]
type = changestate
value = 710
trigger1 = AIlevel && numenemy
trigger1 = roundstate = 2 && statetype != A
trigger1 = random < (50 * (AIlevel ** 2 / 64.0))
trigger1 = (ctrl || (stateno = [100, 101])) && var(20) <= 164 && !var(26)
trigger1 = (enemynear, movetype = A) && !(enemynear, hitdefattr = SCA, AT) && (p2bodydist x = [92, 122])

[State -1, Dodge]
type = changestate
value = 700
trigger1 = AIlevel && numenemy
trigger1 = roundstate = 2 && statetype != A
trigger1 = random < (50 * (AIlevel ** 2 / 64.0))
trigger1 = (ctrl || (stateno = [100, 101])) && var(20) <= 164 && !var(26)
trigger1 = (enemynear, movetype = A) && !(enemynear, hitdefattr = SCA, AT) && (p2bodydist x = [0, 60])

[State -1, Cannon Revenge High]
type = changestate
value = 1500
triggerall = AIlevel && numenemy && palno >= 7
triggerall = roundstate = 2 && statetype != A && !var(20)
triggerall = (p2bodydist x = [0, 64]) && inguarddist && !var(26)
triggerall = p2statetype != A && p2statetype != L
triggerall = (enemynear, stateno = [200, 499]) || (enemynear, hitdefattr = SC, NA)
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, Cannon Revenge Low]
type = changestate
value = 1510
triggerall = AIlevel && numenemy && palno >= 7
triggerall = roundstate = 2 && statetype != A && !var(20)
triggerall = (p2bodydist x = [0, 64]) && inguarddist && !var(26)
triggerall = p2statetype != A && p2statetype != L
triggerall = (enemynear, stateno = [200, 499]) || (enemynear, hitdefattr = SC, NA)
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, Dash Backward]
type = changestate
value = 105
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype = S
triggerall = ctrl && (stateno != [100, 106]) && var(20) <= 150 && !var(26)
trigger1 = (enemynear, movetype = A) && backedgedist >= 80 && (p2bodydist x = [80, 120]) && (enemynear, vel x)
trigger1 = random < (ifelse((enemynear, hitdefattr = SC, AT), 150, 50) * (AIlevel ** 2 / 64.0))
trigger2 = (p2bodydist x = [0, 80]) && backedgebodydist >= 80
trigger2 = enemynear, stateno = 5120 && enemynear, animtime = -4 && random < (750 * (AIlevel ** 2 / 64.0))

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

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

[State -1, Power Charge]
type = changestate
value = 730
triggerall = AIlevel && numenemy
trigger1 = roundstate = 2 && statetype != A
trigger1 = power < const(data.power) && !var(20)
trigger1 = ctrl && power < const(data.power) && power < powermax && !var(20)
trigger1 = !inguarddist && p2bodydist x >= 160 && random < (50 * (AIlevel ** 2 / 64.0))

[State -1, Custom Combo]
type = changestate
value = ifelse(statetype = A, 905, 900)
trigger1 = AIlevel && numenemy
trigger1 = roundstate = 2 && (statetype != A || (vel x > 0 && vel y >= 0))
trigger1 = power >= 1000 && !var(20)
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))

[State -1, Cannon Drill CC]
type = changestate
value = 1000
triggerall = AIlevel && numenemy && palno <= 6
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && var(20) > 30
triggerall = (enemynear, movetype != A) || (enemynear, stateno = [200, 499])
triggerall = p2statetype != L && (enemynear, backedgebodydist > 8 && enemynear, frontedgebodydist > 8)
triggerall = (p2bodydist x = [ -196, 196]) && (p2statetype != A || p2movetype = H)
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])) && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = stateno = 900 && !animtime && ctrl
trigger3 = var(6) && movehit && random < (100 * (AIlevel ** 2 / 64.0))
trigger4 = stateno = 1005 && var(6)

[State -1, Cannon Spike CC]
type = changestate
value = 1100
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && var(20) > 30
triggerall = p2statetype != L && (p2dist y = [ -80, 32])
triggerall = (enemynear, backedgebodydist <= 8 || enemynear, frontedgebodydist <= 8) || palno >= 7
triggerall = ((p2bodydist x = [ -48, 48]) && p2statetype != A) || ((p2bodydist x = [ -140, 140]) && p2statetype = A)
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])); && random < (ifelse(p2statetype = A, 750, 100) * (AIlevel ** 2 / 64.0))
trigger2 = stateno = 900 && !animtime && ctrl
trigger3 = var(6) && movehit && random < (100 * (AIlevel ** 2 / 64.0))
trigger4 = (stateno = 1005 || stateno = 1403) && var(6)

[State -1, Air Cannon Drill CC]
type = changestate
value = 1050
triggerall = AIlevel && numenemy && palno >= 7
triggerall = roundstate = 2 && statetype = A
triggerall = (var(3) != [1, 2]) && pos y <= -64
triggerall = !var(16) && var(20) > 30
triggerall = p2statetype != C && p2statetype != L
triggerall = (p2bodydist x = [ -20, 200]) && p2dist y >= -8
trigger1 = ctrl && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = stateno = 905 && !animtime && ctrl
trigger3 = var(6)
trigger3 = (stateno = 1106 && vel y >= 0) || (stateno = 1050 && animelemtime(3) >= 0)

[State -1, Cannon Strike CC]
type = changestate
value = 1400
triggerall = AIlevel && numenemy && palno <= 6
triggerall = roundstate = 2 && statetype = A
triggerall = (var(3) != [1, 2]) && pos y <= -80
triggerall = !var(16) && var(20) > 30
triggerall = (p2bodydist x = [ -20, 80]) && p2stateno != 5120
trigger1 = ctrl && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = stateno = 905 && !animtime && ctrl
trigger3 = stateno = 1106 && var(6)
trigger3 = vel y >= 0

[State -1, Air Throw]
type = changestate
value = 850
trigger1 = AIlevel && numenemy
trigger1 = roundstate = 2 && statetype = A
trigger1 = !var(16) && (var(15) < 1 || var(20))
trigger1 = ctrl && pos y <= -32
trigger1 = p2statetype = A && random < (200 * (AIlevel ** 2 / 64.0))
trigger1 = (p2dist x = [ -20, 4]) && (p2dist y = [ -118, 48])

[State -1, Throw]
type = changestate
value = 800
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype = S
triggerall = p2statetype != A && p2statetype != L && p2movetype != H
triggerall = (p2dist x = [ -20, 24]) && p2dist y = 0 
trigger1 = ctrl && random < (125 * (AIlevel ** 2 / 64.0))
trigger2 = ctrl && (p2stateno = [120, 140]) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, Run]
type = changestate
value = 100
trigger1 = AIlevel && numenemy
trigger1 = roundstate = 2 && statetype = S
trigger1 = ctrl && (stateno != [100, 106])
trigger1 = (enemynear, movetype != A) && p2bodydist x >= 160 && random < (25 * (AIlevel ** 2 / 64.0))

[State -1, ScHP]
type = changestate
value = 221
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x = [ -20, ceil(const(size.xscale) * 20)]
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 59]) && (p2dist y = [ -41, 0]) && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, SfHP]
type = changestate
value = 220
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x > ceil(const(size.xscale) * 20)
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 68]) && (p2dist y = [ -37, 0]) && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, ScHK]
type = changestate
value = 251
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x = [ -20, ceil(const(size.xscale) * 32)]
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 32]) && (p2dist y = [ -78, 0]) && p2statetype != C && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (ifelse(p2statetype = A, 200, 25) * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 5) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, SfHK]
type = changestate
value = 250
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x > ceil(const(size.xscale) * 32)
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [70, 86]) && (p2dist y = [ -35, 0]) && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 4) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, CHP]
type = changestate
value = 420
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 72]) && (p2dist y = [ -53, 0]) && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 4) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, CHK]
type = changestate
value = 450
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [48, 80]) && (p2dist y = [ -12, 60]) && p2statetype != A && p2statetype != L
triggerall = (p2statetype = S || (p2statetype = C && p2movetype = H))
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 6) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, AHP]
type = changestate
value = 620
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype = A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 58]) && (p2dist y = [ -34, 50]) && p2statetype = S
trigger1 = ctrl
trigger1 = vel y > 0 && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = var(4) && random < (50 * (AIlevel ** 2 / 64.0))

[State -1, AHK]
type = changestate
value = 650
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype = A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 54]) && (p2dist y = [ -22, 58]) && p2statetype = S
trigger1 = ctrl && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = var(4) && random < (50 * (AIlevel ** 2 / 64.0))

[State -1, ScMP]
type = changestate
value = 211
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x = [ -20, ceil(const(size.xscale) * 24)]
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 32]) && (p2dist y = [ -78, 0]) && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, SfMP]
type = changestate
value = 210
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x > ceil(const(size.xscale) * 24)
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 74]) && (p2dist y = [ -62, 0]) && p2statetype != C && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, ScMK]
type = changestate
value = 241
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x = [ -20, ceil(const(size.xscale) * 20)]
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 20]) && (p2dist y = [ -38, 0]) && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, SfMK]
type = changestate
value = 240
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x > ceil(const(size.xscale) * 20)
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [64, 80]) && (p2dist y = [ -45, 0]) && p2statetype != C && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 5) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, CMP]
type = changestate
value = 410
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 58]) && (p2dist y = [ -5, 60]) && p2statetype != A && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, CMK]
type = changestate
value = 440
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [56, 88]) && (p2dist y = [ -12, 60]) && p2statetype != A && p2statetype != L
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, AMP]
type = changestate
value = 610
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype = A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = p2statetype != A || palno >= 7
triggerall = (p2bodydist x = [0, 25]) && (p2dist y = [ -35, 42]) && p2statetype != L
trigger1 = ctrl
trigger1 = vel y > 0 && random < (100 * (AIlevel ** 2 / 64.0))

[State -1, AMK]
type = changestate
value = 640
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype = A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 52]) && (p2dist y = [ -42, 44]) && p2statetype = A
trigger1 = ctrl
trigger1 = vel y <= 0 && random < (100 * (AIlevel ** 2 / 64.0))

[State -1, ScLP]
type = changestate
value = 201
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x = [ -20, ceil(const(size.xscale) * 28)]
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 36]) && (p2dist y = [ -57, 0]) && p2statetype != C && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, SfLP]
type = changestate
value = 200
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x > ceil(const(size.xscale) * 28)
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 60]) && (p2dist y = [ -48, 0]) && p2statetype != C && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, ScLK]
type = changestate
value = 231
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x = [ -20, ceil(const(size.xscale) * 20)]
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 20]) && (p2dist y = [ -40, 0]) && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 2) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, SfLK]
type = changestate
value = 230
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = p2bodydist x > ceil(const(size.xscale) * 20)
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [28, 44]) && (p2dist y = [ -54, 0]) && p2statetype != C && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, CLP]
type = changestate
value = 400
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 52]) && (p2dist y = [ -7, 60]) && p2statetype != A && p2statetype != L
triggerall = (enemynear, const(size.head.pos.y) <= -40) || (enemynear, statetype = A)
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 2) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, CLK]
type = changestate
value = 430
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 50]) && (p2dist y = [ -12, 60]) && p2statetype != A && p2statetype != L
trigger1 = (ctrl || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = (stateno = [200, 499]) && !animtime && ctrl
trigger2 = movehit && (enemynear, gethitvar(hittime) >= 3) && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, ALP]
type = changestate
value = 600
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype = A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [0, 30]) && (p2dist y = [ -35, 56]) && p2statetype = S
trigger1 = ctrl
trigger1 = vel y > 0 && random < (100 * (AIlevel ** 2 / 64.0))

[State -1, ALK]
type = changestate
value = 630
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype = A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [ -40, 72]) && (p2dist y = [ -28, 56]) && p2statetype != L
trigger1 = ctrl
trigger1 = vel y > 0 && random < (ifelse(p2dist x < 0, 250, 50) * (AIlevel ** 2 / 64.0))

[State -1, Cannon Spike]
type = changestate
value = 1100
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = p2statetype != L && (p2dist y = [ -80, 32])
triggerall = ((p2bodydist x = [ -48, 48]) && p2statetype != A) || ((p2bodydist x = [ -140, 140]) && p2statetype = A)
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = var(6) && movehit && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = enemynear, gethitvar(hittime) >= 3
trigger3 = (stateno = 5120 || stateno = 5201) && !animtime && random < (50 * (AIlevel ** 2 / 64.0))

[State -1, Earth Direct]
type = changestate
value = 1700
triggerall = AIlevel && numenemy && palno >= 7
triggerall = roundstate = 2 && statetype != A
triggerall = p2statetype != A && p2statetype != L
triggerall = p2dist x >= 0 && p2bodydist x <= 32 && p2dist y = 0 
triggerall = (enemynear, hitshakeover || var(20)) && !(enemynear, stateno = [150, 155])
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101]))
trigger1 = random < (ifelse((p2stateno = [120, 140]), 500, 250) * (AIlevel ** 2 / 64.0))

[State -1, Air Cannon Drill]
type = changestate
value = 1050
triggerall = AIlevel && numenemy && palno >= 7
triggerall = roundstate = 2 && statetype = A
triggerall = (var(3) != [1, 2]) && pos y <= -64
triggerall = !var(16) && (var(15) < 2 || var(20))
triggerall = p2statetype = A
triggerall = (p2bodydist x = [ -8, 200]) && p2dist y >= -8
trigger1 = ctrl && random < (50 * (AIlevel ** 2 / 64.0))
trigger2 = var(6) && movehit && p2statetype = A

[State -1, Cannon Strike]
type = changestate
value = 1400
triggerall = AIlevel && numenemy && palno <= 6
triggerall = roundstate = 2 && statetype = A
triggerall = (var(3) != [1, 2]) && pos y <= -80
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (p2bodydist x = [ -8, 80]) && p2statetype != A && p2stateno != 5120
trigger1 = ctrl
trigger1 = random < (ifelse(p2stateno = 40, 200, ifelse(p2statetype = C, 100, 50)) * (AIlevel ** 2 / 64.0))

[State -1, Sniping Arrow]
type = changestate
value = 1600
triggerall = AIlevel && numenemy && palno >= 7
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (enemynear, movetype != A) || (enemynear, stateno = [200, 499])
triggerall = (p2bodydist x = [ -8, 250]) && p2bodydist y >= -90 && p2statetype != L
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101]))
trigger1 = p2bodydist x >= 170 && random < (33 * (AIlevel ** 2 / 64.0))
trigger2 = var(6) && movehit && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = enemynear, gethitvar(hittime) >= 15

[State -1, Cannon Drill]
type = changestate
value = 1000
triggerall = AIlevel && numenemy && palno <= 6
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = (enemynear, movetype != A) || (enemynear, stateno = [200, 499])
triggerall = (p2bodydist x = [ -8, 196]) && p2statetype != A && (p2statetype != L || p2stateno = 5120)
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101]))
trigger1 = p2bodydist x >= 160 && random < (50 * (AIlevel ** 2 / 64.0))
trigger2 = (ctrl || stateno = 52 || (stateno = [100, 101]))
trigger2 = (enemynear, stateno = 5120 || enemynear, stateno = 5201) && (enemynear, animtime = -18) && random < (250 * (AIlevel ** 2 / 64.0))
trigger3 = var(6) && movehit && random < (100 * (AIlevel ** 2 / 64.0))
trigger3 = enemynear, gethitvar(hittime) >= 6

[State -1, Hooligan Combination]
type = changestate
value = 1300
triggerall = AIlevel && numenemy && palno <= 6
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = p2bodydist x >= 10 && (p2statetype != L || p2stateno = 5120)
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101]))
trigger1 = (enemynear, stateno = 5120 || enemynear, stateno = 5201) && (enemynear, time = 1) && random < (333 * (AIlevel ** 2 / 64.0))

[State -1, Axle Spin Knuckle]
type = changestate
value = 1200
triggerall = AIlevel && numenemy && palno <= 6
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = !(enemynear, ctrl) && !inguarddist
triggerall = (p2bodydist x = [90, 196]) && p2statetype = S
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101]))
trigger1 = (enemynear, animtime <= -32) && random < (50 * (AIlevel ** 2 / 64.0))

[State -1, Killer Bee Assault]
type = changestate
value = ifelse((pos y - screenpos y) >= -250 && palno <= 6, 3200, 3205)
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 3000 && var(20) <= 60
triggerall = !var(16)
triggerall = (enemynear, pos y = [ -280, 32]) && p2statetype != L
triggerall = (enemynear, movetype != A) || (enemynear, stateno = [200, 1999])
triggerall = !(enemynear, ctrl) && ((enemynear, stateno != [120, 155]) || enemynear, statetype = A)
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101]))
trigger1 = (enemynear, statetype = S || enemynear, statetype = C) && (enemynear, animtime <= -32) && random < (250 * (AIlevel ** 2 / 64.0))
trigger2 = (ctrl || stateno = 52 || (stateno = [100, 101]))
trigger2 = (enemynear, stateno = 40) || (enemynear, pos y < -32 && enemynear, vel y < 0)
trigger2 = (p2dist x = [ -160, 160]) && random < (250 * (AIlevel ** 2 / 64.0))
trigger3 = stateno = 1100 && var(7) && movehit
trigger3 = p2statetype = A && random < (250 * (AIlevel ** 2 / 64.0))

[State -1, MAX Spin Drive Smasher]
type = changestate
value = 3050
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 2000 && var(20) <= 60
triggerall = !var(16) && (var(15) < 1 || var(20) || (stateno = [1000, 4999]))
triggerall = !(enemynear, ctrl) && ((enemynear, stateno != [120, 155]) || enemynear, statetype = A)
triggerall = (p2bodydist x = [ -120, 120]) && (p2dist y = [ -32, 32])
triggerall = p2statetype != A && p2statetype != L
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])) && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = var(7) && movehit && random < (ifelse((var(20) = [1, 30]), 200, 50) * (AIlevel ** 2 / 64.0))
trigger2 = enemynear, gethitvar(hittime) >= 4

[State -1, MAX Psycho Streak]
type = changestate
value = 3350
triggerall = AIlevel && numenemy && palno >= 7
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 2000 && var(20) <= 60 && !var(44)
triggerall = !var(16) && (var(15) < 1 || var(20) || (stateno = [1000, 4999]))
triggerall = !(enemynear, ctrl) && ((enemynear, stateno != [120, 155]) || enemynear, statetype = A)
triggerall = (enemynear, movetype != A) || (enemynear, stateno = [200, 1999])
triggerall = p2statetype != L && p2bodydist x >= 8 && p2dist y >= -64
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])) && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = var(7) && movehit && random < (ifelse((var(20) = [1, 30]), 200, 50) * (AIlevel ** 2 / 64.0))
trigger2 = enemynear, gethitvar(hittime) >= 9
trigger3 = var(8) && random < (100 * (AIlevel ** 2 / 64.0))
trigger3 = stateno = 3001 && animelemtime(9) < 0
trigger3 = enemynear, gethitvar(hittime) >= 9

[State -1, MAX Sniping Heel]
type = changestate
value = 3450
triggerall = AIlevel && numenemy && palno <= 6
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 2000 && var(20) <= 60
triggerall = !var(16) && (var(15) < 1 || var(20) || (stateno = [1000, 4999]))
triggerall = (enemynear, movetype != A) || (enemynear, stateno = [200, 499])
triggerall = !(enemynear, ctrl) && p2statetype != A && p2statetype != L
triggerall = (p2bodydist x = [ -128, 128]) && (p2dist y = [ -32, 32])
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])) && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = var(7) && movehit && random < (ifelse((var(20) = [1, 30]), 200, 50) * (AIlevel ** 2 / 64.0))
trigger2 = enemynear, gethitvar(hittime) >= 11

[State -1, MAX Reverse Shaft Breaker]
type = changestate
value = 3150
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 2000 && var(20) <= 60
triggerall = !var(16) && (var(15) < 3 || var(20) || (stateno = [1000, 4999]))
triggerall = !(enemynear, ctrl) && ((enemynear, stateno != [120, 155]) || enemynear, statetype = A)
triggerall = (p2bodydist x = [ -46, 46]) && (p2dist y = [ -69, 0])
triggerall = (enemynear, vel x = [ -5, 5]) && p2statetype != L
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])) && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = var(7) && movehit && (enemynear, hitfall)
trigger2 = random < (ifelse((var(20) = [1, 30]), 200, 50) * (AIlevel ** 2 / 64.0))
trigger3 = var(8) && random < (100 * (AIlevel ** 2 / 64.0))
trigger3 = stateno = 3001 && animelemtime(9) < 0
trigger3 = enemynear, gethitvar(hittime) >= 3

[State -1, Spin Drive Smasher]
type = changestate
value = 3000
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 1000 && var(20) <= 60
triggerall = !var(16) && (var(15) < 1 || var(20) || (stateno = [1000, 4999]))
triggerall = !(enemynear, ctrl) && ((enemynear, stateno != [120, 155]) || enemynear, statetype = A)
triggerall = (p2bodydist x = [ -60, 60]) && (p2dist y = [ -32, 32])
triggerall = p2statetype != A && p2statetype != L && p2movetype != A
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])) && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = var(7) && movehit && random < (ifelse((var(20) = [1, 30]), 200, 50) * (AIlevel ** 2 / 64.0))
trigger2 = enemynear, gethitvar(hittime) >= 4

[State -1, Psycho Streak]
type = changestate
value = 3300
triggerall = AIlevel && numenemy && palno >= 7
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 1000 && var(20) <= 60 && !var(44)
triggerall = !var(16) && (var(15) < 1 || var(20) || (stateno = [1000, 4999]))
triggerall = !(enemynear, ctrl) && ((enemynear, stateno != [120, 155]) || enemynear, statetype = A)
triggerall = (enemynear, movetype != A) || (enemynear, stateno = [200, 1999])
triggerall = p2statetype != L && p2bodydist x >= 8 && p2dist y >= -64
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])) && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = var(7) && movehit && random < (ifelse((var(20) = [1, 30]), 200, 50) * (AIlevel ** 2 / 64.0))
trigger2 = enemynear, gethitvar(hittime) >= 9

[State -1, Sniping Heel]
type = changestate
value = 3400
triggerall = AIlevel && numenemy && palno <= 6
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 1000 && var(20) <= 60
triggerall = !var(16) && (var(15) < 1 || var(20) || (stateno = [1000, 4999]))
triggerall = !(enemynear, ctrl) && p2statetype != A && p2statetype != L
triggerall = (p2bodydist x = [ -128, 128]) && (p2dist y = [ -32, 32])
trigger1 = var(7) && movehit && random < (ifelse((var(20) = [1, 30]), 200, 50) * (AIlevel ** 2 / 64.0))
trigger1 = enemynear, gethitvar(hittime) >= 11

[State -1, Reverse Shaft Breaker]
type = changestate
value = 3100
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 1000 && var(20) <= 60
triggerall = !var(16) && (var(15) < 3 || var(20) || (stateno = [1000, 4999]))
triggerall = !(enemynear, ctrl) && ((enemynear, stateno != [120, 155]) || enemynear, statetype = A)
triggerall = (enemynear, movetype != A) || (enemynear, statetype = A)
triggerall = (p2bodydist x = [ -46, 46]) && (p2dist y = [ -69, 0])
triggerall = (enemynear, vel x = [ -5, 5]) && p2statetype != L
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])) && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = var(7) && movehit && (enemynear, hitfall)
trigger2 = random < (ifelse((var(20) = [1, 30]), 200, 50) * (AIlevel ** 2 / 64.0))
trigger2 = enemynear, gethitvar(hittime) >= 3

[State -1, EX Cannon Spike]
type = changestate
value = 1120
triggerall = AIlevel && numenemy
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = power >= 500 && var(20) <= 60
triggerall = !(enemynear, ctrl) && (enemynear, stateno != [120, 155])
triggerall = p2statetype != L
triggerall = ((p2bodydist x = [ -8, 48]) && p2statetype != A) || ((p2bodydist x = [ -8, 140]) && p2statetype = A)
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101])) && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = var(6) && movehit && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = enemynear, gethitvar(hittime) >= 3

[State -1, EX Earth Direct]
type = changestate
value = 1730
triggerall = AIlevel && numenemy && palno >= 7
triggerall = roundstate = 2 && statetype != A
triggerall = power >= 500 && var(20) <= 60
triggerall = p2statetype != A && p2statetype != L
triggerall = p2dist x >= 0 && p2bodydist x <= 32 && p2dist y = 0 
triggerall = (enemynear, hitshakeover || var(20)) && !(enemynear, stateno = [150, 155])
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101]))
trigger1 = random < (ifelse((p2stateno = [120, 140]), 500, 250) * (AIlevel ** 2 / 64.0))

[State -1, EX Air Cannon Drill]
type = changestate
value = 1060
triggerall = AIlevel && numenemy && palno >= 7
triggerall = roundstate = 2 && statetype = A
triggerall = (var(3) != [1, 2]) && pos y <= -64
triggerall = !var(16) && (var(15) < 2 || var(20))
triggerall = p2statetype = A
triggerall = power >= 500 && var(20) <= 60
triggerall = !(enemynear, ctrl) && (enemynear, stateno != [120, 155])
triggerall = (p2bodydist x = [ -8, 240]) && p2dist y >= -8
trigger1 = ctrl && random < (50 * (AIlevel ** 2 / 64.0))
trigger2 = var(6) && movehit && p2statetype = A

[State -1, EX Cannon Strike]
type = changestate
value = 1420
triggerall = AIlevel && numenemy && palno <= 6
triggerall = roundstate = 2 && statetype = A
triggerall = (var(3) != [1, 2]) && pos y <= -80
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = power >= 500 && var(20) <= 60
triggerall = !(enemynear, ctrl) && (enemynear, stateno != [120, 155])
triggerall = (p2bodydist x = [ -8, 96]) && p2statetype != A && p2statetype != L
trigger1 = ctrl
trigger1 = random < (ifelse(p2stateno = 40, 200, ifelse(p2statetype = C, 100, 50)) * (AIlevel ** 2 / 64.0))

[State -1, EX Sniping Arrow]
type = changestate
value = 1620
triggerall = AIlevel && numenemy && palno >= 7
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = power >= 500 && var(20) <= 60
triggerall = !(enemynear, ctrl) && (enemynear, stateno != [120, 155])
triggerall = (enemynear, movetype != A) || (enemynear, stateno = [200, 499])
triggerall = (p2bodydist x = [ -8, 250]) && p2bodydist y >= -90 && p2statetype != L
trigger1 = var(6) && movehit && random < (100 * (AIlevel ** 2 / 64.0))
trigger1 = enemynear, gethitvar(hittime) >= 10

[State -1, EX Cannon Drill]
type = changestate
value = 1020
triggerall = AIlevel && numenemy && palno <= 6
triggerall = roundstate = 2 && statetype != A
triggerall = !var(16) && (var(15) < 1 || var(20))
triggerall = power >= 500 && var(20) <= 60
triggerall = !(enemynear, ctrl) && (enemynear, stateno != [120, 155])
triggerall = (enemynear, movetype != A) || (enemynear, stateno = [200, 499])
triggerall = (p2bodydist x = [ -8, 240]) && p2statetype != A && p2statetype != L
trigger1 = (ctrl || stateno = 52 || (stateno = [100, 101]))
trigger1 = p2bodydist x >= 160 && random < (25 * (AIlevel ** 2 / 64.0))
trigger2 = var(6) && movehit && random < (100 * (AIlevel ** 2 / 64.0))
trigger2 = enemynear, gethitvar(hittime) >= 6

[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
trigger1 = p2dist x >= 160 && !(enemynear, ctrl)
trigger1 = (enemynear, movetype = H) && (enemynear, hitfall) && random < (50 * (AIlevel ** 2 / 64.0))
