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

	[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 = "2HCB_p"
	command = ~F, D, B, F, D, B, x
	time = 45

	[Command]
	name = "2HCB_p"
	command = ~F, D, B, F, D, B, y
	time = 45

	[Command]
	name = "2QCF_bd"
	command = ~D, DF, F, D, DF, F, y+b
	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 = "2HCF_p"
	command = ~B, D, F, B, D, F, x
	time = 45

	[Command]
	name = "2HCF_p"
	command = ~B, D, F, B, D, F, y
	time = 45

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

;-| Special Motions |------------------------------------------------------

	[Command]
	name = "B_F_x"
	command = ~30$B, $F, x
	time = 20

	[Command]
	name = "B_F_y"
	command = ~30$B, $F, y
	time = 20

	[Command]
	name = "QCF_a"
	command = ~D, DF, F, a
	time = 20

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

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

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

	;= Reversed commands ==

	[Command]
	name = "F_B_x"
	command = ~30$F, $B, x
	time = 20

	[Command]
	name = "F_B_y"
	command = ~30$F, $B, y
	time = 20

	[Command]
	name = "QCB_a"
	command = ~D, DB, B, a
	time = 20

	[Command]
	name = "QCB_b"
	command = ~D, DB, B, b
	time = 20
	
	[Command]
	name = "HCB_x"
	command = ~F, D, B, x
	time = 30

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

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

;-| 2/3 Button Combination |-----------------------------------------------

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

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

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

;-| 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 Forward Hop]
type = ChangeState
value = 100
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = StateType = S
triggerall = abs(P2BodyDist Y) > 60  
triggerall = AILevel != 0 && RoundState = 2
triggerall = P2MoveType != A
trigger1 = ctrl 
trigger2 = stateno = 101 
trigger3 = stateno = 106

;---------------------------------------------------------------------------
[State -1, AI Defense]
type = ChangeState
triggerall = stateno!= [120,160] 
triggerall = roundstate = 2
triggerall = AILevel != 0
triggerall = ctrl
triggerall = StateType != A
trigger1 = InGuardDist 
trigger1 = (random<100*(AILevel**2/64.0))
value = 120
;---------------------------------------------------------------------------
[State -1, AI All In]
type = ChangeState
value = 3010
triggerall = Power = 3000
triggerall = Random < 40 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 50
triggerall = IfElse(P2StateType != A, abs(P2BodyDist Y) <= 70, abs(P2BodyDist Y) = [10,80]) 
triggerall = StateType != A
triggerall = P2StateType != C
triggerall = var(15) < 4
trigger1 = ctrl
trigger2 = var(16) = 1 && (var(17) = [1,2]) 

;---------------------------------------------------------------------------
[State -1, AI Two Pair]
type = ChangeState
value = 3005
triggerall = random < 45 *(AILevel**2/64.0)
triggerall = Power >= 1000
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 50
triggerall = EnemyNear, StateType != A
triggerall = Var(0) = 0
triggerall = EnemyNear, StateType != A
triggerall = StateType != A
trigger1 = ctrl 

;---------------------------------------------------------------------------
[State -1, AI Three of A Kind]
type = ChangeState
value = 3000
triggerall = Power >= 1000
triggerall = Random < 40 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 150
triggerall = IfElse(P2StateType != A, abs(P2BodyDist Y) <= 50, abs(P2BodyDist Y) = [10,60]) 
triggerall = StateType != A
triggerall = P2StateType != C
triggerall = var(15) < 4
trigger1 = ctrl
trigger2 = var(16) = 1 && (var(17) = [1,2]) 

;---------------------------------------------------------------------------
[State -1, AI C Jack Juke (fwd)]
type = ChangeState
value = 1005
triggerall = Random < 60*(AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 60
triggerall = P2StateType != A
triggerall = StateType != A
triggerall = Var(15) < 3
triggerall = P2MoveType != A
trigger1 = ctrl

;---------------------------------------------------------------------------
[State -1, AI D Jack Juke (fwd)]
type = ChangeState
value = 1006
triggerall = Random < 60*(AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 80
triggerall = P2StateType != A
triggerall = StateType != A
triggerall = Var(15) < 3
triggerall = P2MoveType != A
trigger1 = ctrl

;---------------------------------------------------------------------------
[State -1, AI C Jack Juke (back)]
type = ChangeState
value = 1007
triggerall = Random < 60*(AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 80
triggerall = P2StateType != A
triggerall = StateType != A
triggerall = Var(15) < 3
trigger1 = ctrl && P2MoveType = A

;---------------------------------------------------------------------------
[State -1, AI D Jack Juke (back)]
type = ChangeState
value = 1008
triggerall = Random < 60*(AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 60
triggerall = P2StateType != A
triggerall = StateType != A
triggerall = Var(15) < 3
trigger1 = ctrl && P2MoveType = A

;---------------------------------------------------------------------------
[State -1, AI Queen Straight]
type = ChangeState
value = 1000
triggerall = Random < 100*(AILevel**2/64.0) 
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 100
triggerall = P2StateType != A
triggerall = StateType != A
triggerall = P2StateType != C
triggerall = P2MoveType != A
triggerall = var(15) < 3
triggerall = var(41) > 16
trigger1 = ctrl
trigger2 = var(16) = 1 && var(17) = 1 && var(18) > 1 

;---------------------------------------------------------------------------
[State -1, AI Queen Upper]
type = ChangeState
value = 1001
triggerall = Random < 100*(AILevel**2/64.0) 
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 100
triggerall = IfElse(P2StateType != A, abs(P2BodyDist Y) <= 80, abs(P2BodyDist Y) = [20,80]) 
triggerall = StateType != A
triggerall = P2MoveType != A
triggerall = var(15) < 3
triggerall = var(41) > 16
trigger1 = ctrl
trigger2 = var(16) = 1 && var(17) = 1 && var(18) > 1 

;---------------------------------------------------------------------------
[State -1, AI Ace Clinch]
type = ChangeState
value = 1015
triggerall = random < 100*(AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 50
triggerall = EnemyNear, StateType != A
triggerall = EnemyNear, MoveType != A
triggerall = StateType != A
triggerall = Var(0) = 0
trigger1 = ctrl 
trigger2 = var(44) && MoveType != A

;---------------------------------------------------------------------------
[State -1, AI Fold]
type = ChangeState
value = 800
triggerall = AILevel != 0 && RoundState = 2
triggerall = StateType != A
triggerall = Var(0) = 0
triggerall = EnemyNear, StateType != A
trigger1 = ctrl && random<60*(AILevel**2/64.0)

;---------------------------------------------------------------------------
[State -1, AI G. Cancel]
type = ChangeState
value = 702
triggerall = AILevel != 0 && RoundState = 2
triggerall = P2BodyDist X = [0,40]
triggerall = StateType != A
triggerall = StateNo = [150,152]
triggerall = var(30) >= 50
trigger1 = ctrl && random<60*(AILevel**2/64.0)

;---------------------------------------------------------------------------
[State -1, AI S. Cancel]
type = ChangeState
value = 700
triggerall = AILevel != 0 && RoundState = 2
triggerall = StateType != A && MoveType = A
triggerall = (StateNo = [200,1999]) && StateNo != 440 && (StateNo != [700,799])
triggerall = var(30) >= IfElse(StateNo < 1000, 25, 50)
triggerall = Var(16) = 1
triggerall = P2BodyDist X = [0,20]
trigger1 = stateno = 230
trigger2 = stateno = [240,241] 
trigger3 = Anim = 1000
ignorehitpause = 1

;---------------------------------------------------------------------------
[State -1, AI Fwd. S. Cancel]
type = ChangeState
value = 701
triggerall = AILevel != 0 && RoundState = 2
triggerall = StateType != A && MoveType = A
triggerall = (StateNo = [200,1999]) && StateNo != 440 && (StateNo != [700,799])
triggerall = var(30) >= IfElse(StateNo < 1000, 25, 50)
triggerall = Var(16) = 1
triggerall = P2BodyDist X = (20,50]
trigger1 = stateno = 230
trigger2 = stateno = [240,241]
trigger3 = Anim = 1000 
ignorehitpause = 1

;---------------------------------------------------------------------------
[State -1, AI st.A]
type = ChangeState
value = 200 + IfElse(abs(P2BodyDist X) > 20, 0, 1)
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 40
triggerall = IfElse(P2StateType != A, abs(P2BodyDist Y) <= 50, abs(P2BodyDist Y) = [10,60]) 
triggerall = StateType != A
triggerall = P2StateType != C
triggerall = var(15) = 0
trigger1 = ctrl
trigger2 = (var(17) = 1 || Time > 6) && (var(18) = 1) 

;---------------------------------------------------------------------------
[State -1, AI King Dart]
type = ChangeState
value = 212
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 60
triggerall = P2StateType != A && P2MoveType != A
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl
trigger2 = ctrl && P2StateType = C
trigger3 = var(17) = 1 && var(18) < 2

;---------------------------------------------------------------------------
[State -1, AI st.B]
type = ChangeState
value = 210 + IfElse(abs(P2BodyDist X) > 20, 0, 1)
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 60
triggerall = IfElse(P2StateType != A, abs(P2BodyDist Y) <= 50, abs(P2BodyDist Y) = [10, 60])
triggerall = var(15) = 0
triggerall = StateType != A
triggerall = P2StateType != C
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 2

;---------------------------------------------------------------------------
[State -1, AI st.C]
type = ChangeState
value = 230 + IfElse(abs(P2BodyDist X) > 30, 0, 1)
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 50
triggerall = IfElse(P2StateType != A, abs(P2BodyDist Y) <= 50, abs(P2BodyDist Y) = [10, 60])
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl
trigger2 = StateNo = 231 && (var(17) = 1 || Time > 6) && (var(18) = 1) 

;---------------------------------------------------------------------------
[State -1, AI st.D]
type = ChangeState
value = 240 + IfElse(abs(P2BodyDist X) > 20, 0, 1)
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 60
triggerall = IfElse(P2BodyDist X > 20, (abs(P2BodyDist Y) = [0,60]), abs(P2BodyDist Y = 0))
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 2

;---------------------------------------------------------------------------
[State -1, AI cr.A]
type = ChangeState
value = 400
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 40
triggerall = IfElse(P2StateType != A, abs(P2BodyDist Y) <= 30, abs(P2BodyDist Y) = [10,40])
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (var(17) = 1 || Time > 6) && (var(18) = 1) 

;---------------------------------------------------------------------------
[State -1, AI cr.B]
type = ChangeState
value = 410
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 50
triggerall = P2StateType != A
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 2

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

;---------------------------------------------------------------------------
[State -1, AI cr.D]
type = ChangeState
value = 440
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 70
triggerall = P2StateType != A
triggerall = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 2

;---------------------------------------------------------------------------
[State -1, AI j.A]
type = ChangeState
value = 600
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = P2BodyDist X = [0,40]
triggerall = P2BodyDist Y = [-25,25]
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl
trigger2 = StateNo = 100 && Pos Y <= -5

;---------------------------------------------------------------------------
[State -1, AI j.B]
type = ChangeState
value = 610
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = P2BodyDist X = [0,60]
triggerall = P2BodyDist Y = [-40,0]
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl
trigger2 = StateNo = 100 && Pos Y <= -5

;---------------------------------------------------------------------------
[State -1, AI j.C]
type = ChangeState
value = 630
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = P2BodyDist X = [0,40]
triggerall = P2BodyDist Y = [-60,-10]
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl
trigger2 = StateNo = 100 && Pos Y <= -5 

;---------------------------------------------------------------------------
[State -1, AI j.D]
type = ChangeState
value = 640
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = P2BodyDist X = [0,40]
triggerall = P2BodyDist Y = [0,60]
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl
trigger2 = StateNo = 100 && Pos Y <= -5 

;===========================================================================
; Player Behavior
;===========================================================================
;---------------------------------------------------------------------------
[State -1, High Jump Cancel]
type = ChangeState
value = 40
triggerall = var(16) = 1
triggerall = StateType != A
triggerall = AILevel = 0 && RoundState = 2
triggerall = command = "highjump"
trigger1 = NumTarget(1001) && MoveType = A ; Cancel From Queen Upper
;---------------------------------------------------------------------------

[State -1, Royal Flush]
type = ChangeState
value = 3010
triggerall = Power = 3000
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "2QCF_bd", command = "2QCB_bd")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = [1,2]
trigger3 = var(44) && MoveType != A

;---------------------------------------------------------------------------
[State -1, Three of a Kind]
type = ChangeState
value = 3000
triggerall = Power >= 1000
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "2QCF_p", command = "2QCB_p")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = [1,2]
trigger3 = var(44) && MoveType != A

;---------------------------------------------------------------------------
[State -1, Two Pair]
type = ChangeState
value = 3005
triggerall = AILevel = 0 && RoundState = 2
triggerall = Power >= 1000
triggerall = IfElse(P2Dist X >=0, command = "2HCB_p", command = "2HCF_p")
triggerall = StateType != A
trigger1 = ctrl
trigger3 = var(44) && MoveType != A

;---------------------------------------------------------------------------
[State -1, Queen Straight]
type = ChangeState
value = 1000
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "B_F_x", command = "F_B_x")
triggerall = StateType != A
triggerall = var(41) > 16
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = var(44) && MoveType != A

;---------------------------------------------------------------------------
[State -1, Queen Upper]
type = ChangeState
value = 1001
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "B_F_y", command = "F_B_y")
triggerall = StateType != A
triggerall = var(41) > 16
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 =  var(44) && MoveType != A

;---------------------------------------------------------------------------
[State -1, C Jack Juke (Fwd)]
type = ChangeState
value = 1005
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "QCF_a", command = "QCB_a")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = var(44) && MoveType != A

;---------------------------------------------------------------------------
[State -1, D Jack Juke (Fwd)]
type = ChangeState
value = 1006
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "QCF_b", command = "QCB_b")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = var(44) && MoveType != A

;---------------------------------------------------------------------------
[State -1, C Jack Juke (Back)]
type = ChangeState
value = 1007
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "QCB_a", command = "QCF_a")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 =  var(44) && MoveType != A

;---------------------------------------------------------------------------
[State -1, D Jack Juke (Back)]
type = ChangeState
value = 1008
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "QCB_b", command = "QCF_b")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 =  var(44) && MoveType != A

;---------------------------------------------------------------------------
[State -1, A Ace Clinch]
type = ChangeState
value = 1015
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "HCB_x", command = "HCF_x")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(44) && MoveType != A

;---------------------------------------------------------------------------
[State -1, B Ace Clinch]
type = ChangeState
value = 1015
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "HCB_y", command = "HCF_y")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(44) && MoveType != A

;---------------------------------------------------------------------------
[State -1, Forward Hop]
type = ChangeState
value = IfElse(P2Dist X < 0, 105, 100)
triggerall = command = "FF"
triggerall = StateType = S
triggerall = AILevel = 0 && RoundState = 2
trigger1 = ctrl 
trigger2 = stateno = 101 
trigger3 = stateno = 106

;---------------------------------------------------------------------------
[State -1, Backhop]
type = ChangeState
value = IfElse(P2Dist X < 0, 100, 105)
triggerall = command = "BB"
triggerall = StateType = S
triggerall = AILevel = 0 && RoundState = 2
trigger1 = ctrl 
trigger2 = stateno = 101 
trigger3 = stateno = 106

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

;---------------------------------------------------------------------------
[State -1, st.A]
type = ChangeState
value = 200 + IfElse(abs(P2BodyDist X) > 20, 0, 1)
triggerall = AILevel = 0 && RoundState = 2
triggerall = command != "holddown"
triggerall = command = "x"
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (var(17) = 1 || Time > 6) && (var(18) = 1) 

;---------------------------------------------------------------------------
[State -1, King Dart]
type = ChangeState
value = 212
triggerall = AILevel = 0 && RoundState = 2
triggerall = command != "holddown"
triggerall = command = "holdfwd" 
triggerall = command = "y"
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 2

;---------------------------------------------------------------------------
[State -1, st.B]
type = ChangeState
value = 210 + IfElse(abs(P2BodyDist X) > 20, 0, 1)
triggerall = AILevel = 0 && RoundState = 2
triggerall = command != "holddown"
triggerall = command = "y"
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 2

;---------------------------------------------------------------------------
[State -1, st.C]
type = ChangeState
value = 230 + IfElse(abs(P2BodyDist X) > 30, 0, 1)
triggerall = AILevel = 0 && RoundState = 2
triggerall = command != "holddown"
triggerall = command = "a"
triggerall = StateType != A
trigger1 = ctrl
trigger2 = StateNo = 231 && (var(17) = 1 || Time > 6) && (var(18) = 1) 

;---------------------------------------------------------------------------
[State -1, st.D]
type = ChangeState
value = 240 + IfElse(abs(P2BodyDist X) > 20, 0, 1)
triggerall = AILevel = 0 && RoundState = 2
triggerall = command != "holddown"
triggerall = command = "b"
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 2

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

;---------------------------------------------------------------------------
[State -1, cr.B]
type = ChangeState
value = 410
triggerall = AILevel = 0 && RoundState = 2
triggerall = command = "holddown"
triggerall = command = "y"
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 2

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

;---------------------------------------------------------------------------
[State -1, cr.D]
type = ChangeState
value = 440
triggerall = AILevel = 0 && RoundState = 2
triggerall = command = "holddown"
triggerall = command = "b"
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 2

;---------------------------------------------------------------------------
[State -1, j.A]
type = ChangeState
value = 600
triggerall = AILevel = 0 && RoundState = 2
triggerall = command = "x"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = StateNo = 100 && Pos Y <= -5

;---------------------------------------------------------------------------
[State -1, j.B]
type = ChangeState
value = 610
triggerall = AILevel = 0 && RoundState = 2
triggerall = command = "y"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = StateNo = 100 && Pos Y <= -5

;---------------------------------------------------------------------------
[State -1, j.C]
type = ChangeState
value = 630
triggerall = AILevel = 0 && RoundState = 2
triggerall = command = "a"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = StateNo = 100 && Pos Y <= -5 

;---------------------------------------------------------------------------
[State -1, j.D]
type = ChangeState
value = 640
triggerall = AILevel = 0 && RoundState = 2
triggerall = command = "b"
triggerall = StateType = A
trigger1 = ctrl
trigger2 = StateNo = 100 && Pos Y <= -5 

;---------------------------------------------------------------------------
[State -1, T. Charge]
type = ChangeState
value = 703
triggerall = AILevel = 0 && RoundState = 2
triggerall = command = "z"
triggerall = StateType != A
triggerall = MoveType = I
triggerall = Power >= 1000 && var(30) = [0,100)
triggerall = StateNo < 200
trigger1 = ctrl

;---------------------------------------------------------------------------
[State -1, G. Cancel]
type = ChangeState
value = 702
triggerall = AILevel = 0 && RoundState = 2
triggerall = StateType != A
triggerall = StateNo = [150,152]
triggerall = var(30) >= 50
trigger1 = command = "z"

;---------------------------------------------------------------------------
[State -1, S. Cancel]
type = ChangeState
value = IfElse(command != "holdfwd" && command != "fwd", 700, 701)
triggerall = AILevel = 0 && RoundState = 2
triggerall = StateType != A && MoveType = A
triggerall = (StateNo = [200,1999]) && StateNo != 440 && (StateNo != [700,799])
triggerall = var(30) >= IfElse(StateNo < 1000, 25, 50)
triggerall = var(16) = 1
trigger1 = command = "z" || command = "fwd_z"
ignorehitpause = 1

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