; 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 = "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_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 = "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_bd"
	command = ~D, DB, B, D, DB, B, y+b
	time = 30

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

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

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

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

	[Command]
	name = "QCB_y"
	command = ~D, DB, B, 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 = "DP_a"
	command = F, D, DF, a
	time = 20

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

	;= Reversed commands ==

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

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

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

	[Command]
	name = "RDP_b"
	command = B, D, DB, b
	time = 20

;-| Double Tap |-----------------------------------------------------------

	[Command]
	name = "FF"     ;Required (do not remove)
	command = F, F
	time = 10

	[Command]
	name = "BB"     ;Required (do not remove)
	command = B, B
	time = 10

	[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 Swift and Quiet]
type = ChangeState
value = 3000
triggerall = Power >= 1000
triggerall = Random < 60 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 80
triggerall = P2StateType != A
triggerall = var(15) < 4
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (var(16) = 1 && (var(17) = [1,2]) || EnemyNear, MoveType = A && ctrl)

;---------------------------------------------------------------------------
[State -1, AI Fierce and Immovable]
type = ChangeState
value = 3005
triggerall = Power >= 1000
triggerall = Random < 60 * (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) = [15,70])
triggerall = var(15) < 4
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (var(16) = 1 && (var(17) = [1,2]) || EnemyNear, MoveType = A && ctrl)

;---------------------------------------------------------------------------
[State -1, AI The Art of War]
type = ChangeState
value = 3010
triggerall = Power = 3000
triggerall = Random < 60 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 80
triggerall = IfElse(P2StateType != A, abs(P2BodyDist Y) <= 50, abs(P2BodyDist Y) = [15,70])
triggerall = var(15) < 4
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (var(16) = 1 && (var(17) = [1,2]) || EnemyNear, MoveType = A && ctrl)

;---------------------------------------------------------------------------
[State -1, AI High Jump Cancel]
type = ChangeState
value = 40
triggerall = Random < 80 * (AILevel**2/64.0)
triggerall = StateType != A
triggerall = AILevel != 0 && RoundState = 2
trigger1 = NumTarget(1021) && MoveType = A && var(17)

;---------------------------------------------------------------------------
[State -1, AI Wind Blast]
type = ChangeState
value = 1000
triggerall = Random < 80 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 60
triggerall = P2StateType != A;IfElse(P2StateType != A, abs(P2BodyDist Y) <= 50, abs(P2BodyDist Y) = [10,50])
triggerall = var(15) < 3
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = ctrl && Enemy, Name = "Ai" && Enemy, StateNo = 1001

;---------------------------------------------------------------------------
[State -1, AI Wind Thrust]
type = ChangeState
value = 1001
triggerall = Random < 60 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 80
triggerall = P2StateType != A
triggerall = var(15) < 3
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = ctrl && Enemy, Name = "Ai" && Enemy, StateNo = 1001

;---------------------------------------------------------------------------
[State -1, AI A Forest Storm]
type = ChangeState
value = 1005
triggerall = Random < 80 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 80
triggerall = P2StateType != A
triggerall = IfElse(var(25) = 0, EnemyNear, StateNo != 5120, var(15) < 3)
triggerall = StateType != A
triggerall = EnemyNear, MoveType != A
trigger1 = ctrl 
trigger2 = var(16) = 1 && var(17) = 1 && var(18) > 1
trigger3 = ctrl && EnemyNear, StateType = L && var(25) = 0 && (EnemyNear, StateNo != [50800,50899])

;---------------------------------------------------------------------------
[State -1, AI B Forest Storm]
type = ChangeState
value = 1006
triggerall = Random < 60 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 80
triggerall = IfElse(P2StateType != A, abs(P2BodyDist Y) <= 50, abs(P2BodyDist Y) = [20,60])
triggerall = IfElse(var(25) = 0, EnemyNear, StateNo != 5120, var(15) < 3)
triggerall = StateType != A
triggerall = EnemyNear, MoveType = A
trigger1 = ctrl 
trigger2 = var(16) = 1 && var(17) = 1 && var(18) > 1
trigger3 = ctrl && EnemyNear, StateType = L && var(25) = 0 && (EnemyNear, StateNo != [50800,50899])

;---------------------------------------------------------------------------
[State -1, AI C Mountain Crush]
type = ChangeState
value = 1020
triggerall = Random < 80 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 30
triggerall = IfElse(P2StateType != A, abs(P2BodyDist Y) <= 75, abs(P2BodyDist Y) = [20,75])
triggerall = var(15) < 3
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(16) = 1 && var(17) = 1 

;---------------------------------------------------------------------------
[State -1, AI D Mountain Crush]
type = ChangeState
value = 1021
triggerall = Random < 60 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 30
triggerall = IfElse(P2StateType != A, abs(P2BodyDist Y) <= 75, abs(P2BodyDist Y) = [25,100])
triggerall = var(15) < 3
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(16) = 1 && var(17) = 1 && var(18) > 1

;---------------------------------------------------------------------------
[State -1, AI C Fire Step]
type = ChangeState
value = 1010
triggerall = Random < 80 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 60
triggerall = P2StateType != A
triggerall = var(15) < 3
triggerall = StateType != A
triggerall = EnemyNear, MoveType != A
trigger1 = ctrl
trigger2 = var(16) = 1 && var(17) = 1

;---------------------------------------------------------------------------
[State -1, AI D Fire Step]
type = ChangeState
value = 1015
triggerall = Random < 80 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 80
triggerall = P2StateType != A
triggerall = var(15) < 3
triggerall = StateType != A
triggerall = EnemyNear, MoveType != A
trigger1 = ctrl
trigger2 = var(16) = 1 && var(17) = 1 && var(18) > 1

;---------------------------------------------------------------------------
[State -1, AI Shoulder Throw]
type = ChangeState
value = IfElse(EnemyNear, BackEdgeDist >= 50, 805, 800)
triggerall = random<70*(AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = StateType = S
triggerall = EnemyNear, StateType != A
triggerall = var(0) = 0
triggerall = P2BodyDist X = [0,50]
trigger1 = ctrl 

;---------------------------------------------------------------------------
[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 = var(15) = 0
triggerall = StateType != A
trigger1 = ctrl
trigger2 = (var(17) = 1 || Time > 6) && (var(18) = 1) 

;---------------------------------------------------------------------------
[State -1, AI st.B]
type = ChangeState
value = 210 + IfElse(abs(P2BodyDist X) > 10, 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, IfElse(P2BodyDist X > 10, 60, 80)])
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, P2BodyDist X > 30 && 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 Kurosawa Axe]
type = ChangeState
value = 242
triggerall = Random < 100 * (AILevel**2/64.0)
triggerall = AILevel != 0 && RoundState = 2
triggerall = abs(P2BodyDist X) <= 40
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.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(P2StateType != A, abs(P2BodyDist Y) <= 50, abs(P2BodyDist Y) = [10, IfElse(P2BodyDist X > 20, 40, 50)])
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) <= 45
triggerall = IfElse(P2StateType != A, abs(P2BodyDist Y) <= 50, abs(P2BodyDist Y) = [20,60])
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) <= 40
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) <= 50
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 = [-10,30]
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,50]
triggerall = P2BodyDist Y = [-10,30]
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 = [-10,50]
triggerall = P2BodyDist Y = [-10,20]
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl
trigger2 = StateNo = 100 && Pos Y <= -5
;trigger2 = Anim = 100 

;---------------------------------------------------------------------------
[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 = [-60,10]
triggerall = var(15) < 3
triggerall = StateType = A
trigger1 = ctrl
trigger2 = StateNo = 100 && Pos Y <= -5
;trigger2 = Anim = 100 

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

;---------------------------------------------------------------------------
[State -1, AI S. Cancel]
type = ChangeState
value = 700
triggerall = Random < 100*(AILevel**2/64.0)
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 = 1001
trigger4 = Anim = 1005
trigger4 = EnemyNear, HitFall != 1
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 = 1001
trigger4 = Anim = 1005
trigger4 = EnemyNear, HitFall != 1
ignorehitpause = 1

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

;---------------------------------------------------------------------------
[State -1, High Jump Cancel]
type = ChangeState
value = 40
triggerall = StateType != A
triggerall = AILevel = 0 && RoundState = 2
triggerall = command = "highjump"
trigger1 = NumTarget(232) && MoveType = A
trigger2 = NumTarget(1020) && MoveType = A ; Cancel From C Mountain Crush
trigger3 = NumTarget(1021) && MoveType = A ; Cancel From D Mountain Crush

;---------------------------------------------------------------------------
[State -1, The Art of War]
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 = 1

;---------------------------------------------------------------------------
[State -1, Swift and Quiet]
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 = 1

;---------------------------------------------------------------------------
[State -1, Fierce and Immovable]
type = ChangeState
value = 3005
triggerall = Power >= 1000
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "2QCB_k", command = "2QCF_k")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = [1,2]
trigger3 = var(44) && MoveType != A = 1

;---------------------------------------------------------------------------
[State -1, Wind Blast]
type = ChangeState
value = 1000
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "QCF_x", command = "QCB_x")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = var(44) && MoveType != A = 1

;---------------------------------------------------------------------------
[State -1, Wind Thrust]
type = ChangeState
value = 1001
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "QCF_y", command = "QCB_y")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = var(44) && MoveType != A = 1

;---------------------------------------------------------------------------
[State -1, A Forest Storm]
type = ChangeState
value = 1005
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "QCB_x", command = "QCF_x")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = var(44) && MoveType != A = 1

;---------------------------------------------------------------------------
[State -1, B Forest Storm]
type = ChangeState
value = 1006
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "QCB_y", command = "QCF_y")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = var(44) && MoveType != A = 1

;---------------------------------------------------------------------------
[State -1, C Mountain Crush]
type = ChangeState
value = 1020
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "DP_a", command = "RDP_a")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = var(44) && MoveType != A = 1

;---------------------------------------------------------------------------
[State -1, D Mountain Crush]
type = ChangeState
value = 1021
triggerall = AILevel = 0 && RoundState = 2
triggerall = IfElse(P2Dist X >= 0, command = "DP_b", command = "RDP_b")
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = var(44) && MoveType != A = 1

;---------------------------------------------------------------------------
[State -1, C Mountain Break]
type = ChangeState
value = 1025
triggerall = AILevel = 0 && RoundState = 2
triggerall = command = "QCB_a"
triggerall = StateType = A
triggerall = Pos Y <= -10
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = var(44) && MoveType != A = 1

;---------------------------------------------------------------------------
[State -1, D Mountain Break]
type = ChangeState
value = 1026
triggerall = AILevel = 0 && RoundState = 2
triggerall = command = "QCB_b"
triggerall = StateType = A
triggerall = Pos Y <= -10
trigger1 = ctrl
trigger2 = var(17) = 1
trigger3 = var(44) && MoveType != A = 1

;---------------------------------------------------------------------------
[State -1, C Fire Step]
type = ChangeState
value = 1010
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 = 1

;---------------------------------------------------------------------------
[State -1, D Fire Step]
type = ChangeState
value = 1015
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 = 1

;---------------------------------------------------------------------------
[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, Shoulder Throw]
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, st.B]
type = ChangeState
value = 210 + IfElse(abs(P2BodyDist X) > 10, 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, Kurosawa Axe]
type = ChangeState
value = 242
triggerall = AILevel = 0 && RoundState = 2
triggerall = command != "holddown"
triggerall = command = "holdfwd"
triggerall = command = "b"
triggerall = StateType != A
trigger1 = ctrl
trigger2 = var(17) = 1 && var(18) < 2

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