; 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 = "QCF_HCB_p"
	command = ~D, F, $D, B, x
	time = 30

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

	[Command]
	name = "QCF_HCB_2p"
	command = ~D, F, $D, B, x+y
	time = 20

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

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

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

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

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

	;== Reversed

	[Command]
	name = "QCB_HCF_p"
	command = ~D, B, $D, F, x
	time = 20

	[Command]
	name = "QCB_HCF_p"
	command = ~D, B, $D, F, y
	time = 20

	[Command]
	name = "QCB_HCF_2p"
	command = ~D, B, $D, F, x+y
	time = 20

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

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

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

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

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


;-| Special Motions |------------------------------------------------------
	
	;== Normal
	
	[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_a"
	command = ~B, $D, F, a
	time = 30

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

	[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_2p"
	command = ~D, DB, B, x+y
	time = 15

	[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_2k"
	command = ~D, DB, B, a+b
	time = 15

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

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

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

	;== Reversed

	[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_a"
	command = ~F, $D, B, a
	time = 30

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

	[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_2p"
	command = ~D, DF, F, x+y
	time = 15

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

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

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

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

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

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

;-| Double Tap |-----------------------------------------------------------
[Command]
name = "FF"     ;Required (do not remove)
command = ~F, F
time = 5

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

[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+a
time = 1

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

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

[Command]
name = "HD"
command = a+y
time = 1

[Command]
name = "HD"
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]

[State -1, Random Guard Disable]
type= Assertspecial
triggerall = StateNo != [120,160]
trigger1 = AILevel != 0
flag = noairguard
flag2 = nocrouchguard
flag3 = nostandguard

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

;---------------------------------------------------------------------------
[State -1, HD ON]
type = ChangeState
value = IfElse(StateType != A, 900, 901)
triggerall = var(30) = 1000
triggerall = ctrl || (stateno = [200,650]) && var(16) = 1
trigger1 = command = "HD" 
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<20*(AILevel**2/64.0)) || var(16) = 1
trigger2 = IfElse(var(17) = 1, abs(P2Bodydist X)<=75, abs(P2BodyDist X <= 50))
trigger2 = EnemyNear, StateType != A
trigger2 = var(15) = 0


;===========================================================================
;---------------------------------------------------------------------------
[State -1, Fuujin Ibuki]
type = ChangeState
value = 3015
triggerall = IfElse(Var(31) = 0, var(30) = 1000 && Power >= 3000, var(30) > 0 && Power >= 2000)
triggerall = StateType != A 
triggerall = ctrl  || Anim = 47 && ctrl = 1 || stateno = 100 || var(17) = 1 || var(17) = 2 && var(31) = 1 || var(17) = 3
;==
trigger1 = IfElse(P2Dist X >= 0, command = "2QCF_2p", command = "2QCB_2p")
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = (EnemyNear, StateNo != [120,155]) 
trigger2 = (random<10*(AILevel**2/64.0)) || var(16) = 1 && var(17) || EnemyNear, StateType = A || EnemyNear, MoveType = A
trigger2 = P2Bodydist X = [0,140]
trigger2 = IfElse(EnemyNear, StateType != A, abs(P2Bodydist Y)<=100, (abs(P2BodyDist Y) = [60,120]))
trigger2 = Var(15) < 4
;==
trigger3 = AILevel!=0 && RoundState = 2
trigger3 = Var(17) = 3
trigger3 = IfElse(StateNo = 3002, AnimElemTime(61 = 0), (AnimElemTime(94) = 0))
;---------------------------------------------------------------------------
[State -1, EX Shin Ya Otome]
type = ChangeState
value = 3005
triggerall = Power >= 2000
triggerall = StateType != A 
triggerall = ctrl  || Anim = 47 && ctrl = 1  || stateno = 100 || (var(17) = [1,2]) 
trigger1 = IfElse(P2Dist X >= 0, command = "QCB_HCF_2p", command = "QCF_HCB_2p")
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = (EnemyNear, StateNo != [120,155]) 
trigger2 = (random<5*(AILevel**2/64.0)) || var(16) = 1 && var(17) || EnemyNear, StateType = A || EnemyNear, MoveType = A
trigger2 = P2Bodydist X = [0,80]
trigger2 = IfElse(EnemyNear, HitFall = 0, abs(P2Bodydist Y)<=50, (abs(P2BodyDist Y) = [30,50]))
trigger2 = Var(15) < 4
;---------------------------------------------------------------------------
[State -1, Shin Ya Otome]
type = ChangeState
value = 3000
triggerall = Power >= 1000
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1  || stateno = 100 || (var(17) = [1,2]) 
trigger1 = IfElse(P2Dist X >= 0, command = "QCB_HCF_p", command = "QCF_HCB_p")
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = (EnemyNear, StateNo != [120,155]) 
trigger2 = (random<5*(AILevel**2/64.0)) || var(16) = 1 && var(17) || EnemyNear, StateType = A || EnemyNear, MoveType = A
trigger2 = P2Bodydist X = [0,80]
trigger2 = IfElse(EnemyNear, HitFall = 0, abs(P2Bodydist Y)<=100, EnemyNear, StateType = A && (abs(P2BodyDist Y) = [50,105]))
trigger2 = Var(15) < 4
;---------------------------------------------------------------------------
[State -1, Yami Doukoku]
type = ChangeState
value = 3010
triggerall = Power >= 1000
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1  || stateno = 100 || (var(17) = [1,2])
trigger1 = AILevel = 0
trigger1 = IfElse(P2Dist X >= 0, command = "2HCB_p", command = "2HCF_p")
;==
trigger2 = var(1) = 0
trigger2 = AILevel!=0&&RoundState=2
trigger2 = abs(P2BodyDist X) <= 30
trigger2 = EnemyNear, StateType != A
trigger2 = (random<15*(AILevel**2/64.0)) || var(17) = [1,2]
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, EX Wanpyou Tokobuse]
type = ChangeState
value = 2020
triggerall = StateType != A 
triggerall = Power >= 1000
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = 1 || var(17) = 2 && StateNo != 2020
trigger1 = IfElse((P2Dist X>=0), command = "DP_2p", command = "RDP_2p")
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = (EnemyNear,StateNo !=[120,155]) 
trigger2 = EnemyNear,MoveType!=A
trigger2 = (random<10*(AILevel**2/64.0)) || var(17) = [1,2]
trigger2 = abs(P2Bodydist X) <= 75
trigger2 = P2StateType != A
trigger2 = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
;--------------------------------------------------------------------------
[State -1, EX Shin Aoi Hana: Seiran]
type = ChangeState
value = 2005
triggerall = statetype != A
triggerall = Power >= 1000
triggerall = ctrl || Anim = 47 && ctrl = 1 || stateno = 100 || var(17) = 1 || var(17) = 2 && StateNo != [2005,2007]
trigger1 = IfElse(P2Dist X >= 0, command = "QCB_2p", command = "QCF_2p")
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = (EnemyNear,StateNo !=[120,155]) 
trigger2 = EnemyNear,MoveType!=A
trigger2 = (random<10*(AILevel**2/64.0)) || var(17) = [1,2]
trigger2 = abs(P2Bodydist X) <= 100
trigger2 = IfElse(EnemyNear, HitFall = 0, abs(P2Bodydist Y)<=50, (abs(P2BodyDist Y) = [10,60]))
trigger2 = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
;---------------------------------------------------------------------------
[State -1, Wanpyou Tokobuse]
type = ChangeState
value = 1020
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = 1 || var(17) = 2 && (StateNo != [1020,1024]) && StateNo != 2020
trigger1 = IfElse((P2Dist X>=0), command = "DP_x", command = "RDP_x")
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = (EnemyNear,StateNo !=[120,155]) 
trigger2 = EnemyNear,MoveType!=A
trigger2 = (random<10*(AILevel**2/64.0))
trigger2 = abs(P2Bodydist X) <= 75
trigger2 = (P2BodyDist Y = [0,-50])
trigger2 = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
;---------------------------------------------------------------------------
[State -1, Wanpyou Mametsu]
type = ChangeState
value = 1020
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = 1 || var(17) = 2 && (StateNo != [1020,1024]) && StateNo != 2020
trigger1 = IfElse((P2Dist X>=0), command = "DP_y", command = "RDP_y")
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = (EnemyNear,StateNo !=[120,155]) 
trigger2 = EnemyNear,MoveType!=A
trigger2 = (random<10*(AILevel**2/64.0)) 
trigger2 = abs(P2Bodydist X) <= 50
trigger2 = P2StateType = A && (P2BodyDist Y = [-30,-150])
trigger2 = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
;---------------------------------------------------------------------------
[State -1, A Yo no Kaze]
type = ChangeState
value = 1000
triggerall = var(25) = 0
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = 1 || var(17) = 2 && (StateNo != [1000,1003]) 
trigger1 = IfElse((P2Dist X>=0), command = "HCF_x", command = "HCB_x")
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = EnemyNear,MoveType!=A
trigger2 = (EnemyNear, StateNo != [120,155]) 
trigger2 = (random<25*(AILevel**2/64.0)) || var(17) = 2 || EnemyNear, StateType = L
trigger2 = abs(P2BodyDist X) <= 30
trigger2 = var(26) = 0
trigger2 = IfElse(Var(31) = 0 || EnemyNear, StateType != L, var(15) < 3, var(15) < 4)
;---------------------------------------------------------------------------
[State -1, C Yo no Kaze]
type = ChangeState
value = 1001
triggerall = var(25) = 0
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = 1 || var(17) = 2 && (StateNo != [1000,1003]) 
trigger1 = IfElse((P2Dist X>=0), command = "HCF_y", command = "HCB_y")
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = EnemyNear,MoveType!=A
trigger2 = (EnemyNear, StateNo != [120,155]) 
trigger2 = (random<25*(AILevel**2/64.0)) || var(17) = 2 || EnemyNear, StateType = L
trigger2 = abs(P2BodyDist X) = [150,200]
trigger2 = var(26) = 0
trigger2 = IfElse(Var(31) = 0 || EnemyNear, StateType != L, var(15) < 3, var(15) < 4)
;---------------------------------------------------------------------------
[State -1, B Yo no Kaze]
type = ChangeState
value = 1002
triggerall = var(25) = 0
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = 1 || var(17) = 2 && (StateNo != [1000,1003]) 
trigger1 = IfElse((P2Dist X>=0), command = "HCF_a", command = "HCB_a")
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = EnemyNear,MoveType!=A
trigger2 = (EnemyNear, StateNo != [120,155]) 
trigger2 = (random<25*(AILevel**2/64.0)) || var(17) = 2 || EnemyNear, StateType = L
trigger2 = abs(P2BodyDist X) = [100,150]
trigger2 = var(26) = 0
trigger2 = IfElse(Var(31) = 0 || EnemyNear, StateType != L, var(15) < 3, var(15) < 4)
;---------------------------------------------------------------------------
[State -1, D Yo no Kaze]
type = ChangeState
value = 1003
triggerall = var(25) = 0
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = 1 || var(17) = 2 && (StateNo != [1000,1003]) 
trigger1 = IfElse((P2Dist X>=0), command = "HCF_b", command = "HCB_b")
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = EnemyNear,MoveType!=A
trigger2 = (EnemyNear, StateNo != [120,155]) 
trigger2 = (random<25*(AILevel**2/64.0)) || var(17) = 2 || EnemyNear, StateType = L
trigger2 = abs(P2BodyDist X) = [250,300]
trigger2 = var(26) = 0
trigger2 = IfElse(Var(31) = 0 || EnemyNear, StateType != L, var(15) < 3, var(15) < 4)
;---------------------------------------------------------------------------
[State -1, A Shin Aoi Hana]
type = ChangeState
value = 1005
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = 1 || var(17) = 2 && (StateNo !=[1005,1012])  && StateNo != [2005,2009]
trigger1 = IfElse((P2Dist X>=0), command = "QCB_x", command = "QCF_x")
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = (EnemyNear,StateNo !=[120,155]) 
trigger2 = EnemyNear,MoveType!=A
trigger2 = (random<20*(AILevel**2/64.0)) || (var(17) = 1 && (var(18) > 1) || var(17) = 2)
trigger2 = abs(P2Bodydist X) <= 50
trigger2 = IfElse(EnemyNear, HitFall = 0, abs(P2Bodydist Y)<=60, (abs(P2BodyDist Y) = [50,120]))
trigger2 = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
;---------------------------------------------------------------------------
[State -1, C Shin Aoi Hana]
type = ChangeState
value = 1010
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = 1 || var(17) = 2 && (StateNo !=[1005,1012])  && StateNo != [2005,2009]
trigger1 = IfElse((P2Dist X>=0), command = "QCB_y", command = "QCF_y")
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = (EnemyNear,StateNo !=[120,155]) 
trigger2 = EnemyNear,MoveType!=A
trigger2 = (random<20*(AILevel**2/64.0)) || (var(17) = 1 && (var(18) > 1) || var(17) = 2)
trigger2 = abs(P2Bodydist X) <= 75
trigger2 = IfElse(EnemyNear, HitFall = 0, abs(P2Bodydist Y)<=60, (abs(P2BodyDist Y) = [50,120]))
trigger2 = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
;---------------------------------------------------------------------------
[State -1, B Hyouga]
type = ChangeState
value = 1015
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = 1 || var(17) = 2
trigger1 = IfElse((P2Dist X>=0), command = "QCB_a", command = "QCF_a")
trigger1 = AILevel = 0
;---------------------------------------------------------------------------
[State -1, D Hyouga]
type = ChangeState
value = 1015
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = 1 || var(17) = 2
trigger1 = IfElse((P2Dist X>=0), command = "QCB_b", command = "QCF_b")
trigger1 = AILevel = 0

;===========================================================================
;---------------------------------------------------------------------------
[State -1, Run Fwd]
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, Guard Cancel Roll Back]
type = ChangeState
value = 701
triggerall = statetype != A
triggerall = stateno = [150,151]
triggerall = Power >= 1000
trigger1 = command = "roll" || command = "z"
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" || command = "z"
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" || command = "z"
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" || command = "z"
;---------------------------------------------------------------------------
[State -1, Throw (AI)]
type = ChangeState
value = IfElse( (FrontEdgeBodyDist > 50 || BackEdgeBodyDist > 50), 800, 805)
triggerall = var(0) = 0
triggerall = AILevel!=0&&RoundState=2
triggerall = statetype = S
trigger1 = ctrl
trigger1 = abs(P2BodyDist X)<=20
trigger1 = EnemyNear,StateType!=A
trigger1 = (random<300*(AILevel**2/64.0))
;---------------------------------------------------------------------------
[State -1, Throw]
type = ChangeState
value = IfElse(command = "y", 800, 805)
triggerall = var(0) = 0
triggerall = AILevel = 0
triggerall = StateType = S
triggerall = ctrl
triggerall = command = "holdfwd" || command = "holdback"
trigger1 = command = "y"
trigger2 = command = "b"
;---------------------------------------------------------------------------
[State -1, Taunt]
type = ChangeState
value = 195
triggerall = statetype != A
triggerall = ctrl
trigger1 = command = "s"
trigger1 = AILevel = 0
;---------------------------------------------------------------------------
[State -1, Guard Cancel CD]
type = ChangeState
value = 251
triggerall = statetype != A
triggerall = stateno = [150,151]
triggerall = Power >= 1000
trigger1 = command = "cd" || command = "c"
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = (random<60*(AILevel**2/64.0))
trigger2 = abs(P2Bodydist X)<=30
trigger2 = abs(P2BodyDist Y)<=35
trigger2 = EnemyNear,StateType = S 
trigger2 = EnemyNear,MoveType != A
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, st.CD]
type = ChangeState
value = 250
triggerall = command != "holddown"
triggerall = statetype != A
triggerall = ctrl || stateno=40 || Anim = 47 && ctrl = 1 || (stateno = 100) 
trigger1 = command = "cd" || command = "c"
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = (random<60*(AILevel**2/64.0))
trigger2 = abs(P2Bodydist X)<=25
trigger2 = abs(P2BodyDist Y)<=35
trigger2 = EnemyNear,StateType = S 
trigger2 = EnemyNear,MoveType != A
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, j.CD]
type = ChangeState
value = 650
triggerall = statetype = A && ctrl
trigger1 = command = "cd" || command = "c"
trigger1 = AILevel = 0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0)) || EnemyNear, StateType = C
trigger2 = P2BodyDist X=[0,80]
trigger2 = enemynear,pos Y-pos Y=[-60,90]
trigger2 = IfElse(Var(31) = 0, var(15) <= 2, var(15) < 4)
trigger2 = EnemyNear,MoveType!=A
;---------------------------------------------------------------------------
[State -1, Uranagi]
type = ChangeState
value = 202
triggerall = command != "holddown"
triggerall = StateType !=A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) || var(17) = 1 && var(18) != 3
trigger1 = command = "fwd_x"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0)) || var(17)
trigger2 = abs(P2Bodydist X)<=45
trigger2 = EnemyNear, StateType != A
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, st.A]
type = ChangeState
value = IfElse(abs(P2BodyDist X) >= 30, 200, 201)
triggerall = command != "holddown"
triggerall = StateType !=A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) || ( (stateno = 201) || (stateno = 231) || stateno = 400 || stateno = 430 ) && Time > 6
trigger1 = command = "x"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0))
trigger2 = abs(P2Bodydist X)<=30
trigger2 = IfElse(EnemyNear, HitFall = 0, abs(P2Bodydist Y)<=45, (abs(P2BodyDist Y) = [25,45]))
trigger2 = EnemyNear, StateType = S || EnemyNear, StateType = A
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, st.C]
type = ChangeState
value = IfElse(abs(P2BodyDist X) >= 30, 210, 211)
triggerall = command != "holddown"
triggerall = StateType !=A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100)
trigger1 = command = "y"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0))
trigger2 = abs(P2Bodydist X)<=55
trigger2 = IfElse(EnemyNear, HitFall = 0, abs(P2Bodydist Y)<=45, (abs(P2BodyDist Y) = [25,45]))
trigger2 = EnemyNear, StateType = S || EnemyNear, StateType = A
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, st.B]
type = ChangeState
value = IfElse(P2BodyDist X >= 30, 230, 231)
triggerall = command != "holddown"
triggerall = StateType !=A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) || ( (stateno = 201) || (stateno = 231) || stateno = 400 || stateno = 430 ) && Time > 6
trigger1 = command = "a"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0))
trigger2 = abs(P2Bodydist X)<=50
trigger2 = IfElse(EnemyNear, HitFall = 0, abs(P2Bodydist Y)<=45, (abs(P2BodyDist Y) = [25,45]))
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, st.D]
type = ChangeState
value = IfElse(abs(P2BodyDist X) >= 30, 240, 241)
triggerall = command != "holddown"
triggerall = StateType !=A
triggerall = ctrl  || Anim = 47 && ctrl = 1 || (stateno = 100)
trigger1 = command = "b"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0))
trigger2 = abs(P2Bodydist X)<=50
trigger2 = abs(P2Bodydist Y)<=55
trigger2 = var(15) = 0
trigger2 = EnemyNear,MoveType!=A

;---------------------------------------------------------------------------
[State -1, cr.A]
type = ChangeState
value = 400
triggerall = command = "holddown"
triggerall = statetype != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) || ( (stateno = 201) || (stateno = 231) || stateno = 400 || stateno = 430 ) && Time > 6
trigger1 = command = "x"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0)) 
trigger2 = abs(P2Bodydist X)<=50
trigger2 = abs(P2Bodydist Y)<=40
trigger2 = var(15) = 0
trigger2 = EnemyNear,MoveType!=A
;---------------------------------------------------------------------------
[State -1, cr.C]
type = ChangeState
value = 410
triggerall = command = "holddown"
triggerall = statetype != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100)
trigger1 = command = "y"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0))
trigger2 = abs(P2Bodydist X)<=50
trigger2 = abs(P2Bodydist Y)<=40
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, cr.B]
type = ChangeState
value = 430
triggerall = command = "holddown"
triggerall = statetype != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) || ( (stateno = 201) || (stateno = 231) || stateno = 400 ) && Time > 6
trigger1 = command = "a"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = EnemyNear,StateType = S ;(random<350*(AILevel**2/64.0)) || EnemyNear,StateType = S || EnemyNear, StateType = S && (EnemyNear, StateNo = [120,150])
trigger2 = abs(P2Bodydist X)<=50
trigger2 = abs(P2Bodydist Y)<=40
trigger2 = var(15) = 0
trigger2 = EnemyNear,MoveType!=A

;---------------------------------------------------------------------------
[State -1, cr.D]
type = ChangeState
value = 440
triggerall = command = "holddown"
triggerall = statetype != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100)
trigger1 = command = "b"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = EnemyNear,StateType = S;
trigger2 = abs(P2Bodydist X)<=65
trigger2 = abs(P2Bodydist Y)<=40
trigger2 = var(15) = 0
trigger2 = EnemyNear,MoveType!=A

;---------------------------------------------------------------------------
[State -1, j.A]
type = ChangeState
value = 600
triggerall = statetype = A && ctrl
trigger1 = command = "x"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0)) || EnemyNear,StateType = C 
trigger2 = P2BodyDist X=[0,80]
trigger2 = enemynear,pos Y-pos Y=[-60,90]
trigger2 = IfElse(Var(31) = 0, var(15) <= 2, var(15) < 4)
trigger2 = EnemyNear,MoveType!=A
;---------------------------------------------------------------------------
[State -1, j.C]
type = ChangeState
value = 610
triggerall = statetype = A && ctrl
trigger1 = command = "y"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0)) || EnemyNear, StateType = C
trigger2 = P2BodyDist X=[0,80]
trigger2 = enemynear,pos Y-pos Y=[-60,90]
trigger2 = IfElse(Var(31) = 0, var(15) <= 2, var(15) < 4)
trigger2 = EnemyNear,MoveType!=A

;---------------------------------------------------------------------------
[State -1, j.B]
type = ChangeState
value = 630
triggerall = statetype = A && ctrl
trigger1 = command = "a"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0)) || EnemyNear, StateType = C
trigger2 = P2BodyDist X=[0,80]
trigger2 = enemynear,pos Y-pos Y=[-60,90]
trigger2 = IfElse(Var(31) = 0, var(15) <= 2, var(15) < 4)
trigger2 = EnemyNear,MoveType!=A

;---------------------------------------------------------------------------
[State -1, j.D]
type = ChangeState
value = 640
triggerall = statetype = A && ctrl
trigger1 = command = "b"
trigger1 = AILevel=0
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0)) || EnemyNear, StateType = C
trigger2 = P2BodyDist X=[0,80]
trigger2 = enemynear,pos Y-pos Y=[-60,90]
trigger2 = IfElse(Var(31) = 0, var(15) <= 2, var(15) < 4)
trigger2 = EnemyNear,MoveType!=A