; 1. Command definition
; ---------------------

;-| Button Remapping |-----------------------------------------------------
; This section lets you remap the player's buttons (to easily change the
; button configuration). The format is:
;   old_button = new_button
; If new_button is left blank, the button cannot be pressed.
[Remap]
x = x
y = y
z = z
a = a
b = b
c = c
s = s

;-| Default Values |-------------------------------------------------------
[Defaults]
; Default value for the "time" parameter of a Command. Minimum 1.
command.time = 30

; Default value for the "buffer.time" parameter of a Command. Minimum 1,
; maximum 30.
command.buffer.time = 1

;-| Super Motions |--------------------------------------------------------

; Normal
[Command]
name = "2QCF_p"
command = ~D, DF, F, D, DF, F, x
time = 30

[Command]
name = "2QCF_p"
command = ~D, DF, F, D, DF, F, y
time = 30

[Command]
name = "2QCF_p"
command = ~D, DF, F, D, DF, F, z
time = 30

[Command]
name = "2QCF_k"
command = ~D, DF, F, D, DF, F, a
time = 30

[Command]
name = "2QCF_k"
command = ~D, DF, F, D, DF, F, b
time = 30

[Command]
name = "2QCF_k"
command = ~D, DF, F, D, DF, F, c
time = 30

[Command]
name = "2QCF_2k"
command = ~D, DF, F, D, DF, F, a+b
time = 30

[Command]
name = "2QCF_2k"
command = ~D, DF, F, D, DF, F, b+c
time = 30

[Command]
name = "2QCF_2k"
command = ~D, DF, F, D, DF, F, a+c
time = 30

[Command]
name = "2QCB_k"
command = ~D, DB, B, D, DB, B, a
time = 30

[Command]
name = "2QCB_k"
command = ~D, DB, B, D, DB, B, b
time = 30

[Command]
name = "2QCB_k"
command = ~D, DB, B, D, DB, B, c
time = 30

;= Reversed

	[Command]
	name = "2QCB_p"
	command = ~D, DB, B, D, DB, B, x
	time = 30

	[Command]
	name = "2QCB_p"
	command = ~D, DB, B, D, DB, B, y
	time = 30

	[Command]
	name = "2QCB_p"
	command = ~D, DB, B, D, DB, B, z
	time = 30
;-| Special Motions |------------------------------------------------------

;==|Specials, No Negative Edge|==
[Command]
name = "QCF_a"
command = ~D, DF, F, a
time = 15

[Command]
name = "QCF_b"
command = ~D, DF, F, b
time = 15

[Command]
name = "QCF_c"
command = ~D, DF, F, c
time = 15

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

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

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

[Command]
name = "HCB_x"
command = ~F, $D, B, x
time = 30

[Command]
name = "HCB_y"
command = ~F, $D, B, y
time = 30

[Command]
name = "HCB_z"
command = ~F, $D, B, z
time = 30

[Command]
name = "HCB_a"
command = ~F, $D, B, a
time = 30

[Command]
name = "HCB_b"
command = ~F, $D, B, b
time = 30

[Command]
name = "HCB_c"
command = ~F, $D, B, c
time = 30

;==|Specials, No Negative Edge, Reversed|==
[Command]
name = "QCB_a"
command = ~D, DB, B, a
time = 15

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

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

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

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

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

[Command]
name = "QCF_x"
command = ~D, DF, F, x
time = 15

[Command]
name = "QCF_y"
command = ~D, DF, F, y
time = 15

[Command]
name = "QCF_z"
command = ~D, DF, F, z
time = 15

[Command]
name = "HCF_x"
command = ~B, D, F, x
time = 30

[Command]
name = "HCF_y"
command = ~B, D, F, y
time = 30

[Command]
name = "HCF_z"
command = ~B, D, F, z
time = 30

[Command]
name = "HCF_a"
command = ~B, D, F, a
time = 30

[Command]
name = "HCF_b"
command = ~B, D, F, b
time = 30

[Command]
name = "HCF_c"
command = ~B, D, F, c
time = 30

;============================================
;Negative Edge
;============================================
[Command]
name = "QCF_a"
command = ~D, DF, F, ~a
time = 15

[Command]
name = "QCF_b"
command = ~D, DF, F, ~b
time = 15

[Command]
name = "QCF_c"
command = ~D, DF, F, ~c
time = 15

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

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

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

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

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

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

[Command]
name = "HCB_x"
command = ~F, $D, B, ~x
time = 30

[Command]
name = "HCB_y"
command = ~F, $D, B, ~y
time = 30

[Command]
name = "HCB_z"
command = ~F, $D, B, ~z
time = 30

[Command]
name = "HCB_a"
command = ~F, $D, B, ~a
time = 30

[Command]
name = "HCB_b"
command = ~F, $D, B, ~b
time = 30

[Command]
name = "HCB_c"
command = ~F, $D, B, ~c
time = 30

;==|Specials, Negative Edge, Reversed|==
[Command]
name = "QCB_a"
command = ~D, DB, B, ~a
time = 15

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

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

[Command]
name = "QCF_x"
command = ~D, DF, F, ~x
time = 15

[Command]
name = "QCF_y"
command = ~D, DF, F, ~y
time = 15

[Command]
name = "QCF_z"
command = ~D, DF, F, ~z
time = 15


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

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

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

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

[Command]
name = "highjump"
command = ~10$D, U
time = 5

[Command]
name = "highjump"
command = ~10$D, $U
time = 5

[Command]
name = "highjump"
command = ~10$D, ~U
time = 5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

;-| Single Button |---------------------------------------------------------
[Command]
name = "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 = "s"
command = s
time = 1

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

[Command]
name = "downfwd"
command = $DF
time = 1

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

[Command]
name = "downback"
command = $DB
time = 1

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

[Command]
name = "upback"
command = $UB
time = 1

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

[Command]
name = "upfwd"
command = $UF
time = 1

;-| Hold Button |--------------------------------------------------------------
[Command]
name = "hold_x"
command = /x
time = 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

;---------------------------------------------------------------------------
; 2. State entry
; --------------

[Statedef -1]

;===========================================================================
; AI Behavior
;===========================================================================

[State -1, AI Defense]
type = ChangeState
triggerall = stateno!= [120,160] 
triggerall = roundstate= 2
triggerall = AILevel != 0
triggerall = ctrl
triggerall = InGuardDist 
trigger1 = random<70*(AILevel**2/64.0)
value = 120

[State -1, AI Jump Cancel]
type = ChangeState
value = 40
triggerall = AILevel != 0 && RoundState = 2
triggerall = random<70*(AILevel**2/64.0)
triggerall = var(18) < 4
triggerall = MoveHit && P2BodyDist Y <= -40
trigger1 = StateNo = 200
trigger2 = StateNo = 230
trigger3 = StateNo = 420
trigger4 = StateNo = 440

;---------------------------------------------------------------------------
[State -1, AI Force Shield]
type = ChangeState
value = IfElse(StateType = S, 710, IfElse(StateType = C, 711, 712))
triggerall = AILevel != 0 && RoundState = 2
triggerall = Power >= 500
triggerall = abs(P2BodyDist X) <= 30
triggerall = abs(P2BodyDist Y) <= 50
triggerall = EnemyNear, MoveType = A 
triggerall = EnemyNear,HitDefAttr != SCA,AT
triggerall = IfElse(StateType != A, Pos Y = 0, Pos Y <= -30)
triggerall = Var(15) = 0
triggerall = StateNo != [710,712]
triggerall = PrevStateNo != [710,712]
trigger1 = ctrl
trigger2 = var(44)

;---------------------------------------------------------------------------
[State -1, AI Psi-Thrust]
type = ChangeState
value = 3000
triggerall = Power >= 1000
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 125
triggerall = var(15) < 5
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17)
trigger4 = var(44) && P2MoveType = A

;---------------------------------------------------------------------------
[State -1, AI Air Psi-Thrust]
type = ChangeState
value = 3000
triggerall = Power >= 1000
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 125
triggerall = var(15) < 5
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17)

;---------------------------------------------------------------------------
[State -1, AI Psi-Malestrom]
type = ChangeState
value = 3005
triggerall = Power >= 1000
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 50
triggerall = abs(P2BodyDist Y) <= 60
triggerall = var(15) < 4
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17)
trigger4 = var(44) && P2MoveType = A

;---------------------------------------------------------------------------
[State -1, AI Kochou Gakure]
type = Null
value = 3010
triggerall = Power >= 1000
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 75
triggerall = abs(P2BodyDist Y) <= 75
triggerall = var(15) < 4
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17)
trigger4 = var(44) && P2MoveType = A

;---------------------------------------------------------------------------
[State -1, AI Air Kochou Gakure]
type = Null
value = 3010
triggerall = Power >= 1000
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 50
triggerall = abs(P2BodyDist Y) <= 65
triggerall = var(15) < 4
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17)

;---------------------------------------------------------------------------
[State -1, AI LP Psi-Blast]
type = ChangeState
value = 1000
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 75
triggerall = P2StateType != A
triggerall = var(15) < 5
triggerall = var(25) = 0
triggerall = P2MoveType != A
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI MP Psi-Blast]
type = ChangeState
value = 1001
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) > 75
triggerall = abs(P2BodyDist Y) <= 60
triggerall = var(25) = 0
triggerall = P2MoveType != A
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI HP Psi-Blast]
type = ChangeState
value = 1002
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) > 60
triggerall = abs(P2BodyDist Y) > 60
triggerall = var(25) = 0
triggerall = P2MoveType != A
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI Air LP Psi-Blast]
type = ChangeState
value = 1000
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X = [0,75]
triggerall = P2BodyDist Y = [0,75]
triggerall = var(15) < 5
triggerall = var(25) = 0
triggerall = P2MoveType != A
triggerall = StateType = A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1 && var(18) < 3

;---------------------------------------------------------------------------
[State -1, AI Air MP Psi-Blast]
type = ChangeState
value = 1001
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X = [0,75]
triggerall = P2BodyDist Y = [-25,25]
triggerall = var(25) = 0
triggerall = P2MoveType != A
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI Air HP Psi-Blast]
type = ChangeState
value = 1002
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X > 60
triggerall = P2BodyDist Y < -50
triggerall = var(25) = 0
triggerall = P2MoveType != A
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI LK Psi-Blade]
type = ChangeState
value = 1005
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 75
triggerall = abs(P2BodyDist Y) <= 50
triggerall = var(15) < 3
trigger1 = var(16) = 1 && var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI MK Psi-Blade]
type = ChangeState
value = 1006
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 50
triggerall = abs(P2BodyDist Y) <= 60
triggerall = var(15) < 3
trigger1 = var(16) = 1 && var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI HK Psi-Blade]
type = ChangeState
value = 1007
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 40
triggerall = abs(P2BodyDist Y) <= 75
triggerall = var(15) < 3
trigger1 = var(16) = 1 && var(17) = 1

;---------------------------------------------------------------------------
[State -1, Air LK Psi-Blade]
type = ChangeState
value = 1005
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X = [0,75]
triggerall = P2BodyDist Y = [-25,25]
triggerall = var(15) < 3
triggerall = StateType = A
triggerall = var(26) < 2
trigger1 = var(16) = 1 && var(17) = 1
trigger2 = StateNo = 1006 && var(3) && MoveHit
trigger3 = StateNo = 1007 && var(3) && MoveHit

;---------------------------------------------------------------------------
[State -1, Air MK Psi-Blade]
type = ChangeState
value = 1006
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X = [0,50]
triggerall = P2BodyDist Y = [-80,-30]
triggerall = var(15) < 3
triggerall = StateType = A
triggerall = var(26) < 2
trigger1 = var(16) = 1 && var(17) = 1
trigger2 = StateNo = 1005 && var(3) && MoveHit
trigger3 = StateNo = 1007 && var(3) && MoveHit

;---------------------------------------------------------------------------
[State -1, Air HK Psi-Blade]
type = ChangeState
value = 1007
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X = [0,40]
triggerall = P2BodyDist Y = [-115,-30]
triggerall = var(15) < 3
triggerall = StateType = A
triggerall = var(26) < 2
trigger1 = var(16) = 1 && var(17) = 1
trigger2 = StateNo = 1005 && var(3) && MoveHit
trigger3 = StateNo = 1006 && var(3) && MoveHit

;---------------------------------------------------------------------------
[State -1, AI Ninjutsu Drill]
type = ChangeState
value = 1020
triggerall = AILevel != 0 && RoundState = 2
triggerall = var(4) != 0
triggerall = StateNo = [1010,1015]
trigger1 = Anim = 1010 && AnimTime = 0

;---------------------------------------------------------------------------
[State -1, AI LP Ninjutsu Teleport]
type = ChangeState
value = 1010
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 40 * (AILevel**2/64.0)
triggerall = StateType != A
triggerall = abs(P2BodyDist X) <= 50 || abs(P2BodyDist X) >= 100
triggerall = EnemyNear, BackEdgeBodyDist < 30
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI MP Ninjutsu Teleport]
type = ChangeState
value = 1011
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 40 * (AILevel**2/64.0)
triggerall = StateType != A
triggerall = abs(P2BodyDist X) <= 50
triggerall = BackEdgeBodyDist > 30
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI HP Ninjutsu Teleport]
type = ChangeState
value = 1012
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 40 * (AILevel**2/64.0)
triggerall = StateType != A
triggerall = abs(P2BodyDist X) <= 50 || abs(P2BodyDist X) >= 100
triggerall = EnemyNear, FrontEdgeBodyDist < 30
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI LK Ninjutsu Teleport]
type = ChangeState
value = 1013
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 40 * (AILevel**2/64.0)
triggerall = StateType != A
triggerall = abs(P2BodyDist X) <= 50 || abs(P2BodyDist X) >= 100
triggerall = EnemyNear, BackEdgeBodyDist < 30
triggerall = P2StateType = A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI MK Ninjutsu Teleport]
type = ChangeState
value = 1014
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 40 * (AILevel**2/64.0)
triggerall = StateType != A
triggerall = abs(P2BodyDist X) <= 50
triggerall = BackEdgeBodyDist > 30
triggerall = P2StateType = A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI HK Ninjutsu Teleport]
type = ChangeState
value = 1015
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 40 * (AILevel**2/64.0)
triggerall = StateType != A
triggerall = abs(P2BodyDist X) <= 50 || abs(P2BodyDist X) >= 100
triggerall = EnemyNear, FrontEdgeBodyDist < 30
triggerall = P2StateType = A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI LP Ninjutsu Teleport]
type = ChangeState
value = 1010
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 40 * (AILevel**2/64.0)
triggerall = StateType = A
triggerall = abs(P2BodyDist X) <= 50 || abs(P2BodyDist X) >= 100
triggerall = EnemyNear, BackEdgeBodyDist < 30
triggerall = P2StateType = A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI MP Ninjutsu Teleport]
type = ChangeState
value = 1011
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 40 * (AILevel**2/64.0)
triggerall = StateType = A
triggerall = abs(P2BodyDist X) <= 50
triggerall = BackEdgeBodyDist > 30
triggerall = P2StateType = A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI HP Ninjutsu Teleport]
type = ChangeState
value = 1012
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 40 * (AILevel**2/64.0)
triggerall = StateType = A
triggerall = abs(P2BodyDist X) <= 50 || abs(P2BodyDist X) >= 100
triggerall = EnemyNear, FrontEdgeBodyDist < 30
triggerall = P2StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI LK Ninjutsu Teleport]
type = ChangeState
value = 1013
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 40 * (AILevel**2/64.0)
triggerall = StateType = A
triggerall = abs(P2BodyDist X) <= 50 || abs(P2BodyDist X) >= 100
triggerall = EnemyNear, BackEdgeBodyDist < 30
triggerall = P2StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI MK Ninjutsu Teleport]
type = ChangeState
value = 1014
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 40 * (AILevel**2/64.0)
triggerall = StateType = A
triggerall = abs(P2BodyDist X) <= 50
triggerall = BackEdgeBodyDist > 30
triggerall = P2StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI HK Ninjutsu Teleport]
type = ChangeState
value = 1015
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 40 * (AILevel**2/64.0)
triggerall = StateType = A
triggerall = abs(P2BodyDist X) <= 50 || abs(P2BodyDist X) >= 100
triggerall = EnemyNear, FrontEdgeBodyDist < 30
triggerall = P2StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI st.LP]
type = ChangeState
value = 200
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 50
triggerall = abs(P2BodyDist Y) <= 60
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]
trigger3 = (Time > 3 || var(17) = 1) && (var(18) = 1) 

;---------------------------------------------------------------------------
[State -1, AI st.MP]
type = ChangeState
value = 210
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 60
triggerall = abs(P2BodyDist Y) <= 40
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, AI st.HP]
type = ChangeState
value = 220
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 75
triggerall = abs(P2BodyDist Y) <= 55
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, AI st.LK]
type = ChangeState
value = 230
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 40
triggerall = abs(P2BodyDist Y) <= 70
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]
trigger3 = (Time > 3 || var(17) = 1) && (var(18) = 1) && PrevStateNo != 230

;---------------------------------------------------------------------------
[State -1, AI fwd + MK]
type = ChangeState
value = 241
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 70
triggerall = P2StateType != A
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]
trigger3 = var(17) = 1 && var(18) < 4
trigger4 = ctrl && P2StateType = C && var(17) = 0

;---------------------------------------------------------------------------
[State -1, AI st.MK]
type = ChangeState
value = 240
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 75
triggerall = abs(P2BodyDist Y) <= 30
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, AI HK + fwd/b+HK+fwd]
type = ChangeState
value = 251
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 90 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 100
triggerall = var(16)
trigger1 = StateNo = 250
trigger2 = StateNo = 252

;---------------------------------------------------------------------------
[State -1, AI back + HK]
type = ChangeState
value = 252
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 80 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 60
triggerall = P2StateType != A
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]
trigger3 = var(17) = 1 && var(18) < 4

;---------------------------------------------------------------------------
[State -1, AI st.HK]
type = ChangeState
value = 250
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 60
triggerall = abs(P2BodyDist Y) <= 40
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, AI cr.LP]
type = ChangeState
value = 400
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 50
triggerall = abs(P2BodyDist Y) <= 30
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]
trigger3 = (Time > 3 || var(17) = 1) && (var(18) = 1) 

;---------------------------------------------------------------------------
[State -1, AI cr.MP]
type = ChangeState
value = 410
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 60
triggerall = abs(P2BodyDist Y) <= 40
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, AI cr.HP]
type = ChangeState
value = 420
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 55
triggerall = abs(P2BodyDist Y) <= 60
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, AI cr.LK]
type = ChangeState
value = 430
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 50
triggerall = P2StateType != A
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]
trigger3 = (var(17) = 1 || Time > 6) && (var(18) = 1) && stateno != 430
trigger4 = ctrl && P2StateType = S

;---------------------------------------------------------------------------
[State -1, AI cr.MK]
type = ChangeState
value = 440
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 55
triggerall = abs(P2BodyDist Y) <= 50
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, AI cr.HK]
type = ChangeState
value = 450
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = abs(P2BodyDist X) <= 70
triggerall = abs(P2BodyDist Y) <= 40
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, AI j.LP]
type = ChangeState
value = 600
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X = [0,30]
triggerall = P2BodyDist Y = [-20,20]
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) = 1
trigger2 = StateNo = 630 && PrevStateNo != 600

;---------------------------------------------------------------------------
[State -1, AI j.MP]
type = ChangeState
value = 610
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X = [0,30]
triggerall = P2BodyDist Y = [-70,10]
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl

;---------------------------------------------------------------------------
[State -1, AI j.HP]
type = ChangeState
value = 620
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X = [0,40]
triggerall = P2BodyDist Y = [-10,50]
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 3

;---------------------------------------------------------------------------
[State -1, AI j.LK]
type = ChangeState
value = 630
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X = [0,30]
triggerall = P2BodyDist Y = [-70,10]
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl 
trigger2 = var(17) = 1 && var(18) = 1
trigger2 = StateNo = 600 && PrevStateNo != 630

;---------------------------------------------------------------------------
[State -1, AI j.MK]
type = ChangeState
value = 640
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X = [0,50]
triggerall = P2BodyDist Y = [-30,30]
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl 

;---------------------------------------------------------------------------
[State -1, AI j. up + HK]
type = ChangeState
value = 651
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X = [0,50]
triggerall = P2BodyDist Y = [-30,30]
triggerall = var(15) < 3
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 4

;---------------------------------------------------------------------------
[State -1, AI j.HK]
type = ChangeState
value = 650
triggerall = AILevel != 0 && RoundState = 2
triggerall = random < 100 * (AILevel**2/64.0)
triggerall = P2BodyDist X = [0,50]
triggerall = P2BodyDist Y = [-30,40]
triggerall = var(15) < 3
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 3

;===========================================================================
; Player Behavior
;===========================================================================

[State -1, Jump Cancel]
type = ChangeState
value = 40
triggerall = var(18) < 4
triggerall = AILevel = 0
triggerall = MoveContact
triggerall = command = "up"
trigger1 = StateNo = 200
trigger2 = StateNo = 230
trigger3 = StateNo = 420
trigger4 = STateNo = 440

;---------------------------------------------------------------------------
[State -1, Psi-Thrust]
type = ChangeState
value = 3000
triggerall = Power >= 1000
triggerall = AILevel = 0
triggerall = IfElse(P2Dist X >= 0, command = "2QCF_p", command = "2QCB_p")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17)
trigger4 = var(44)

;---------------------------------------------------------------------------
[State -1, Air Psi-Thrust]
type = ChangeState
value = 3000
triggerall = Power >= 1000
triggerall = AILevel = 0
triggerall = command = "2QCF_p"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17)

;---------------------------------------------------------------------------
[State -1, Psi-Malestrom]
type = ChangeState
value = 3005
triggerall = Power >= 1000
triggerall = AILevel = 0
triggerall = IfElse(P2Dist X >= 0, command = "2QCF_k", command = "2QCB_k")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17)
trigger4 = var(44)

;---------------------------------------------------------------------------
[State -1, Kochou Gakure]
type = Null
value = 3010
triggerall = Power >= 1000
triggerall = AILevel = 0
triggerall = IfElse(P2Dist X >= 0, command = "2QCB_k", command = "2QCF_k")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17)
trigger4 = var(44)

;---------------------------------------------------------------------------
[State -1, Air Kochou Gakure]
type = Null
value = 3010
triggerall = Power >= 1000
triggerall = AILevel = 0
triggerall = command = "2QCB_k"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17)

;---------------------------------------------------------------------------
[State -1, LP Ninjutsu Teleport]
type = ChangeState
value = 1010
triggerall = AILevel = 0
triggerall = IfElse(P2Dist X >= 0, command = "HCB_x", command = "HCF_x")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1
trigger4 = var(44)

;---------------------------------------------------------------------------
[State -1, MP Ninjutsu Teleport]
type = ChangeState
value = 1011
triggerall = AILevel = 0
triggerall = IfElse(P2Dist X >= 0, command = "HCB_y", command = "HCF_y")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1
trigger4 = var(44)

;---------------------------------------------------------------------------
[State -1, HP Ninjutsu Teleport]
type = ChangeState
value = 1012
triggerall = AILevel = 0
triggerall = IfElse(P2Dist X >= 0, command = "HCB_z", command = "HCF_z")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1
trigger4 = var(44)

;---------------------------------------------------------------------------
[State -1, LK Ninjutsu Teleport]
type = ChangeState
value = 1013
triggerall = AILevel = 0
triggerall = IfElse(P2Dist X >= 0, command = "HCB_a", command = "HCF_a")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1
trigger4 = var(44)

;---------------------------------------------------------------------------
[State -1, MK Ninjutsu Teleport]
type = ChangeState
value = 1014
triggerall = AILevel = 0
triggerall = IfElse(P2Dist X >= 0, command = "HCB_b", command = "HCF_b")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1
trigger4 = var(44)

;---------------------------------------------------------------------------
[State -1, HK Ninjutsu Teleport]
type = ChangeState
value = 1015
triggerall = AILevel = 0
triggerall = IfElse(P2Dist X >= 0, command = "HCB_c", command = "HCF_c")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1
trigger4 = var(44)

;---------------------------------------------------------------------------
[State -1, Air LP Ninjutsu Teleport]
type = ChangeState
value = 1010
triggerall = AILevel = 0
triggerall = command = "HCB_x"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, Air MP Ninjutsu Teleport]
type = ChangeState
value = 1011
triggerall = AILevel = 0
triggerall = command = "HCB_y"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, Air HP Ninjutsu Teleport]
type = ChangeState
value = 1012
triggerall = AILevel = 0
triggerall = command = "HCB_z"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, Air LK Ninjutsu Teleport]
type = ChangeState
value = 1013
triggerall = AILevel = 0
triggerall = command = "HCB_a"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, Air MK Ninjutsu Teleport]
type = ChangeState
value = 1014
triggerall = AILevel = 0
triggerall = command = "HCB_b"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, Air HK Ninjutsu Teleport]
type = ChangeState
value = 1015
triggerall = AILevel = 0
triggerall = command = "HCB_c"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, Ninjutsu Drill]
type = ChangeState
value = 1020
triggerall = AILevel = 0
triggerall = var(4) != 0
triggerall = StateNo = [1010,1015]
trigger1 = Anim = 1010 && AnimTime = 0

;---------------------------------------------------------------------------
[State -1, LP Psi-Blast]
type = ChangeState
value = 1000
triggerall = AILevel = 0
triggerall = var(25) = 0
triggerall = P2MoveType != A
triggerall = IfElse(P2Dist X >= 0, command = "QCF_x", command = "QCB_x")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1
trigger4 = var(44)

;---------------------------------------------------------------------------
[State -1, MP Psi-Blast]
type = ChangeState
value = 1001
triggerall = AILevel = 0
triggerall = var(25) = 0
triggerall = P2MoveType != A
triggerall = IfElse(P2Dist X >= 0, command = "QCF_y", command = "QCB_y")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, HP Psi-Blast]
type = ChangeState
value = 1002
triggerall = AILevel = 0
triggerall = var(25) = 0
triggerall = P2MoveType != A
triggerall = IfElse(P2Dist X >= 0, command = "QCF_z", command = "QCB_z")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, LK Psi-Blade]
type = ChangeState
value = 1005
triggerall = AILevel = 0
triggerall = IfElse(P2Dist X >= 0, command = "QCF_a", command = "QCB_a")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, MK Psi-Blade]
type = ChangeState
value = 1006
triggerall = AILevel = 0
triggerall = IfElse(P2Dist X >= 0, command = "QCF_b", command = "QCB_b")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1
trigger4 = var(44)

;---------------------------------------------------------------------------
[State -1, HK Psi-Blade]
type = ChangeState
value = 1007
triggerall = AILevel = 0
triggerall = IfElse(P2Dist X >= 0, command = "QCF_c", command = "QCB_c")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1
trigger4 = var(44)

;---------------------------------------------------------------------------
[State -1, Air LK Psi-Blade]
type = ChangeState
value = 1005
triggerall = AILevel = 0
triggerall = command = "QCF_a"
triggerall = StateType = A
triggerall = var(26) < 2
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1
trigger4 = StateNo = 1006 && var(3)
trigger5 = StateNo = 1007 && var(3)

;---------------------------------------------------------------------------
[State -1, Air MK Psi-Blade]
type = ChangeState
value = 1006
triggerall = AILevel = 0
triggerall = command = "QCF_b"
triggerall = StateType = A
triggerall = var(26) < 2
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1
trigger4 = StateNo = 1005 && var(3)
trigger5 = StateNo = 1007 && var(3)

;---------------------------------------------------------------------------
[State -1, Air HK Psi-Blade]
type = ChangeState
value = 1007
triggerall = AILevel = 0
triggerall = command = "QCF_c"
triggerall = StateType = A
triggerall = var(26) < 2
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1
trigger4 = StateNo = 1005 && var(3)
trigger5 = StateNo = 1006 && var(3)

;---------------------------------------------------------------------------
[State -1, LP Psi-Blast Air]
type = ChangeState
value = 1000
triggerall = AILevel = 0
triggerall = var(25) = 0
triggerall = P2MoveType != A
triggerall = command = "QCF_x"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, MP Psi-Blast Air]
type = ChangeState
value = 1001
triggerall = AILevel = 0
triggerall = var(25) = 0
triggerall = P2MoveType != A
triggerall = command = "QCF_y"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, HP Psi-Blast Air]
type = ChangeState
value = 1002
triggerall = AILevel = 0
triggerall = var(25) = 0
triggerall = P2MoveType != A
triggerall = command = "QCF_z"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = (stateno = [100,101]) 
trigger3 = var(17) = 1

;---------------------------------------------------------------------------
[State -1, Wall Jump]
type = ChangeState
value = 45
triggerall = (StateType = A) && (Ctrl) && (Pos Y < -30)
triggerall = AILevel = 0
trigger1 = ((command = "up") && (command = "fwd") && (Vel X <= 0) && (backedgebodydist <= 10) && (backedgebodydist > -10)) 
trigger2 = ((command = "up") && (command = "back") && (Vel X >= 0) && (frontedgebodydist <= 10) && (frontedgebodydist > -10)) 

;---------------------------------------------------------------------------
[State -1, Guard Cancel]
type = ChangeState
value = 715
triggerall = AILevel = 0
triggerall = statetype != A
triggerall = Power >= 500
triggerall = command = "gc" 
trigger1 = stateno = [120,152]

;---------------------------------------------------------------------------
[State -1, AI Guard Cancel]
type = ChangeState
value = 715
triggerall = AILevel != 0 && RoundState = 2 
triggerall = statetype != A
triggerall = Power >= 500
triggerall = (random<70*(AILevel**2/64.0))
triggerall = abs(P2BodyDist X) <= 60
triggerall = abs(P2BodyDist Y) <= 50
triggerall = StateType != A
triggerall = EnemyNear,StateType != C 
triggerall = EnemyNear,MoveType != A
triggerall = var(15) = 0
trigger1 = stateno = [120,152]

;---------------------------------------------------------------------------
[State -1, Guard Cancel Roll Back]
type = ChangeState
value = 701
triggerall = statetype != A
triggerall = stateno = [150,151]
triggerall = Power >= 1000
trigger1 = command = "roll" 
trigger1 = command = "holdback"
trigger1 = AILevel = 0

;---------------------------------------------------------------------------
[State -1, Guard Cancel Roll]
type = ChangeState
value = 700
triggerall = statetype != A
triggerall = stateno = [150,151]
triggerall = Power >= 1000
trigger1 = command = "roll" 
trigger1 = AILevel = 0

;---------------------------------------------------------------------------
[State -1, Roll Back]
type = ChangeState
value = 701
triggerall = ctrl || stateno = 100 || StateNo = [150,151]
triggerall = StateType = S
trigger1 = AILevel = 0
trigger1 = command = "roll" 
trigger1 = command = "holdback"

;---------------------------------------------------------------------------
[State -1, Roll Fwd]
type = ChangeState
value = 700
triggerall = ctrl || stateno = 100 || StateNo = [150,151]
triggerall = StateType = S
trigger1 = AILevel = 0
trigger1 = command = "roll" 

;---------------------------------------------------------------------------
[State -1, Force Shield]
type = ChangeState
value = IfElse(StateType = S, 710, IfElse(StateType = C, 711, 712))
triggerall = AILevel = 0 && RoundState = 2
triggerall = Power >= 500
triggerall = command = "shield" 
triggerall = StateNo != [710,712]
triggerall = PrevStateNo != [710,712]
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, Throw]
type = ChangeState
value = IfElse(command != "holdback", 800, 805)
triggerall = AILevel = 0
triggerall = StateType != A
triggerall = ctrl
trigger1 = command = "throw"

;---------------------------------------------------------------------------
[State -1, Air Throw]
type = ChangeState
value = IfElse(command != "holdback", 810, 815)
triggerall = AILevel = 0
triggerall = StateType = A
triggerall = ctrl
trigger1 = command = "throw"

;---------------------------------------------------------------------------
[State -1, Run]
type = ChangeState
value = IfElse(P2Dist X < 0, 105, 100)
triggerall= ctrl
triggerall = StateType = S
trigger1 = AILevel = 0
trigger1 = command = "FF"

;---------------------------------------------------------------------------
[State -1, Backhop]
type = ChangeState
value = IfElse(P2Dist X < 0, 100, 105)
triggerall= ctrl
triggerall = StateType = S
trigger1 = AILevel = 0
trigger1 = command = "BB"

;---------------------------------------------------------------------------
[State -1, st.LP]
type = ChangeState
value = 200
triggerall = AILevel = 0
triggerall = command != "holddown"
triggerall = command = "x"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]
trigger3 = (Time > 3 || var(17) = 1) && (var(18) = 1) 

;---------------------------------------------------------------------------
[State -1, st.MP]
type = ChangeState
value = 210
triggerall = AILevel = 0
triggerall = command != "holddown"
triggerall = command = "y"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, st.HP]
type = ChangeState
value = 220
triggerall = AILevel = 0
triggerall = command != "holddown"
triggerall = command = "z"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, st.LK]
type = ChangeState
value = 230
triggerall = AILevel = 0
triggerall = command != "holddown"
triggerall = command = "a"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]
trigger3 = (Time > 3 || var(17) = 1) && (var(18) = 1) && PrevStateNo != 230

;---------------------------------------------------------------------------
[State -1, fwd + MK]
type = ChangeState
value = 241
triggerall = AILevel = 0
triggerall = command != "holddown"
triggerall = command = "fwd_b"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]
trigger3 = var(17) = 1 && var(18) < 4

;---------------------------------------------------------------------------
[State -1, st.MK]
type = ChangeState
value = 240
triggerall = AILevel = 0
triggerall = command != "holddown"
triggerall = command = "b"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, fwd + HK]
type = ChangeState
value = 251
triggerall = AILevel = 0
triggerall = command != "holddown"
triggerall = command = "holdfwd"
triggerall = var(16)
trigger1 = StateNo = 250
trigger2 = StateNo = 252

;---------------------------------------------------------------------------
[State -1, back + HK]
type = ChangeState
value = 252
triggerall = AILevel = 0
triggerall = command != "holddown"
triggerall = command = "back_c"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]
trigger3 = var(17) = 1 && var(18) < 4

;---------------------------------------------------------------------------
[State -1, st.HK]
type = ChangeState
value = 250
triggerall = AILevel = 0
triggerall = command != "holddown"
triggerall = command = "c"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, cr.LP]
type = ChangeState
value = 400
triggerall = AILevel = 0
triggerall = command = "holddown"
triggerall = command = "x"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]
trigger3 = (Time > 3 || var(17) = 1) && (var(18) = 1) 

;---------------------------------------------------------------------------
[State -1, cr.MP]
type = ChangeState
value = 410
triggerall = AILevel = 0
triggerall = command = "holddown"
triggerall = command = "y"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, cr.HP]
type = ChangeState
value = 420
triggerall = AILevel = 0
triggerall = command = "holddown"
triggerall = command = "z"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, cr.LK]
type = ChangeState
value = 430
triggerall = AILevel = 0
triggerall = command = "holddown"
triggerall = command = "a"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]
trigger3 = (var(17) = 1 || Time > 6) && (var(18) = 1) && stateno != 430

;---------------------------------------------------------------------------
[State -1, cr.MK]
type = ChangeState
value = 440
triggerall = AILevel = 0
triggerall = command = "holddown"
triggerall = command = "b"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, cr.HK]
type = ChangeState
value = 450
triggerall = AILevel = 0
triggerall = command = "holddown"
triggerall = command = "c"
triggerall = StateType != A
trigger1 = ctrl 
trigger2 = StateNo = [100,101]

;---------------------------------------------------------------------------
[State -1, j.LP]
type = ChangeState
value = 600
triggerall = AILevel = 0
triggerall = command = "x"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) = 1
trigger2 = StateNo = 630 && PrevStateNo != 600

;---------------------------------------------------------------------------
[State -1, j.MP]
type = ChangeState
value = 610
triggerall = AILevel = 0
triggerall = command = "y"
triggerall = StateType = A
trigger1 = ctrl

;---------------------------------------------------------------------------
[State -1, j.HP]
type = ChangeState
value = 620
triggerall = AILevel = 0
triggerall = command = "z"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 3

;---------------------------------------------------------------------------
[State -1, j.LK]
type = ChangeState
value = 630
triggerall = AILevel = 0
triggerall = command = "a"
triggerall = StateType = A
trigger1 = ctrl 
trigger2 = var(17) = 1 && var(18) = 1
trigger2 = StateNo = 600 && PrevStateNo != 630

;---------------------------------------------------------------------------
[State -1, j.MK]
type = ChangeState
value = 640
triggerall = AILevel = 0
triggerall = command = "b"
triggerall = StateType = A
trigger1 = ctrl 

;---------------------------------------------------------------------------
[State -1, j. up + HK]
type = ChangeState
value = 651
triggerall = AILevel = 0
triggerall = command = "up_c"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 4

;---------------------------------------------------------------------------
[State -1, j.HK]
type = ChangeState
value = 650
triggerall = AILevel = 0
triggerall = command = "c"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 3

;---------------------------------------------------------------------------
; Taunt
[State -1, Taunt]
type = ChangeState
value = 195
triggerall = AILevel = 0
triggerall = command != "holddown"
triggerall = command = "s"
triggerall = StateType != A
trigger1 = ctrl || anim = 101

