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

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

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

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

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

	;== Normal

	[Command]
	name = "2QCF_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_2k"
	command = ~D, DF, F, D, DF, F, a+b
	time = 30

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

	
	;== Reversed

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

	[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_2p"
	command = ~D, DB, B, D, DB, B, x+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_2p"
	command = ~B, $D, F, x+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 = "HCB_2k"
	command = ~F, $D, B, a+b
	time = 30

	[Command]
	name = "mash_a"
	command = ~a, a, a
	time = 30

	[Command]
	name = "mash_b"
	command = ~b, b, b
	time = 30

	[Command]
	name = "down_up_a"
	command = ~30$D, U, a
	time = 30
	
	[Command]
	name = "down_up_b"
	command = ~30$D, U, b
	time = 30

	[Command]
	name = "down_up_2k"
	command = ~30$D, U, a+b
	time = 30

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

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

	[Command]
	name = "DP_2k"
	command = ~F, D, DF, a+b
	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_2p"
	command = ~F, $D, B, x+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 = "HCF_2k"
	command = ~B, $D, F, a+b
	time = 30

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

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

	[Command]
	name = "RDP_2k"
	command = ~B, D, DB, 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, 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<15*(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, Hazan Tenshou Senka]
type = ChangeState
value = 3010
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 = "2QCB_2k", command = "2QCF_2k")
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState = 2
trigger2 = (random<15*(AILevel**2/64.0)) || (var(17) = [1,2]) && var(16) = 1 || EnemyNear, MoveType = A
trigger2 = abs(P2BodyDist X) <= 150
trigger2 = EnemyNear, StateType != A
trigger2 = Var(15) < 4
;---------------------------------------------------------------------------
[State -1, EX Houyoku Sen]
type = ChangeState
value = 3001
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = [1,2]
triggerall = Power >= 2000
trigger1 = IfElse((Anim != [5,6]), command = "2QCF_2k", command = "2QCB_2k")
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState = 2
trigger2 = (random<5*(AILevel**2/64.0)) || (var(17) = [1,2]) && var(16) = 1 || EnemyNear, MoveType = A
trigger2 = abs(P2BodyDist X) <= 100
trigger2 = EnemyNear, StateType != A
trigger2 = Var(15) < 4
;---------------------------------------------------------------------------
[State -1, Houyoku Sen]
type = ChangeState
value = 3000
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = [1,2]
triggerall = Power >= 1000
trigger1 = IfElse((Anim != [5,6]), command = "2QCF_k", command = "2QCB_k")
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState = 2
trigger2 = (random<5*(AILevel**2/64.0)) || (var(17) = [1,2]) && var(16) = 1 || EnemyNear, MoveType = A
trigger2 = abs(P2BodyDist X) <= 75
trigger2 = EnemyNear, StateType != A
trigger2 = Var(15) < 4
;---------------------------------------------------------------------------
[State -1, Kikoushou]
type = ChangeState
value = 3005
triggerall = StateType != A 
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) && ctrl || var(17) = [1,2]
triggerall = Power >= 1000
trigger1 = IfElse((Anim != [5,6]), command = "2QCF_p", command = "2QCB_p")
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState = 2
trigger2 = (random<5*(AILevel**2/64.0)) || (var(17) = [1,2]) && var(16) = 1 || EnemyNear, MoveType = A
trigger2 = abs(P2BodyDist X) <= 50
trigger2 = IfElse(EnemyNear, StateType != A, (abs(P2BodyDist Y) =[0,200]), (EnemyNear, Pos Y = [0,-250]))
trigger2 = Var(15) < 4
;===========================================================================
[State -1, EX Tenshou Kyaku]
type = ChangeState
value = 2020
triggerall = Power >= 1000
triggerall = StateType != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2]) && stateno != 2020
;==
trigger1 = AILevel = 0
trigger1 = IfElse(P2Dist X >= 0, command = "DP_2k", command = "RDP_2k")
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = random<15*(AILevel**2/64.0) || var(17) = 1 || var(17) = 2
trigger2 = abs(P2Bodydist X) = [10,30]
trigger2 = EnemyNear, StateType = A && abs(P2BodyDist Y) <= 220
trigger2 = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger2 = EnemyNear, StateType != C
;---------------------------------------------------------------------------
[State -1, EX Kikouken]
type = ChangeState
value = 2000
triggerall = var(25) = 0
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 = "HCF_2p", command = "HCB_2p")
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = EnemyNear, MoveType != A
trigger2 = random<20*(AILevel**2/64.0) || (var(17) = [1,2]) && MoveHit && random<20*(AILevel**2/64.0) 
trigger2 = abs(P2BodyDist X) = [125,300]
trigger2 = IfElse(EnemyNear, StateType != A, EnemyNear,StateType = S, (abs(P2BodyDist Y) = [45,105]))
trigger2 = EnemyNear, StateType != C
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, EX Hyakuretsu Kyaku]
type = ChangeState
value = 2005
triggerall = Power >= 1000
triggerall = StateType != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2]) && (StateNo != [2005,2007])
;==
trigger1 = AILevel = 0
trigger1 = command = "mash_a"
trigger1 = command = "mash_b"
;==
trigger2 = AILevel != 0 && RoundState = 2
trigger2 = EnemyNear, MoveType != A
trigger2 = (random<15*(AILevel**2/64.0)) || var(17) = 1 && random<40*(AILevel**2/64.0) || var(17) = 2
trigger2 = abs(P2BodyDist X) <= 10
trigger2 = IfElse(EnemyNear, StateType != A, (abs(P2BodyDist Y) = [0,50]), (EnemyNear, Pos Y = [0,-50]))
trigger2 = Var(15) < (IfElse(Var(31) = 0, 3, 4))
;---------------------------------------------------------------------------
[State -1, EX Spinning Bird Kick]
type = ChangeState
value = 2010
triggerall = Power >= 1000
triggerall = StateType != A
triggerall = ctrl || stateno = 40 || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2]) && StateNo != 2010
;==
trigger1 = AILevel = 0
trigger1 = command = "down_up_2k"
;==
trigger2 = AILevel != 0 && RoundState = 2
trigger2 = EnemyNear, MoveType != A
trigger2 = (random<15*(AILevel**2/64.0)) || var(17) = 1 && random<40*(AILevel**2/64.0) || var(17) = 2
trigger2 = abs(P2BodyDist X) <=100
trigger2 = IfElse(EnemyNear, StateType != A, (abs(P2BodyDist Y) = [0,30]), (EnemyNear, Pos Y = [0,-50]))
trigger2 = EnemyNear, StateType != C
trigger2 = Var(15) < (IfElse(Var(31) = 0, 3, 4))
;---------------------------------------------------------------------------
[State -1, EX Hazanshu]
type = ChangeState
value = 2015
triggerall = Power >= 1000
triggerall = StateType != A
triggerall = ctrl || stateno = 40 || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2]) && StateNo != 2015
;==
trigger1 = AILevel = 0
trigger1 = IfElse(P2Dist X >= 0, command = "HCB_2k", command = "HCF_2k")
;==
trigger2 = AILevel != 0 && RoundState = 2
trigger2 = (random<25*(AILevel**2/64.0)) || var(17) = 1 && random<40*(AILevel**2/64.0) || var(17) = 2 
trigger2 = abs(P2BodyDist X) <= 100
trigger2 = EnemyNear, StateType != A || EnemyNear, StateType = C
trigger2 = Var(15) = 0
;---------------------------------------------------------------------------
[State -1, B Tenshou Kyaku]
type = ChangeState
value = 1020
triggerall = StateType != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2]) && (StateNo != 1020) && StateNo != 2020
;==
trigger1 = AILevel = 0
trigger1 = IfElse(P2Dist X >= 0, command = "DP_a", command = "RDP_a")
;==
trigger2 = AILevel!=0 && RoundState = 2  
trigger2 = (random<10*(AILevel**2/64.0)) || var(17) = 1 || var(17) = 2
trigger2 = abs(P2Bodydist X) = [0,20]
trigger2 = EnemyNear, StateType = A && abs(P2BodyDist Y) <= 150
trigger2 = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger2 = EnemyNear, StateType != C
;---------------------------------------------------------------------------
[State -1, D Tenshou Kyaku]
type = ChangeState
value = 1020
triggerall = StateType != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2]) && (StateNo != 1020) && StateNo != 2020
;==
trigger1 = AILevel = 0
trigger1 = IfElse(P2Dist X >= 0, command = "DP_b", command = "RDP_b")
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = (random<10*(AILevel**2/64.0)) || var(17) = 1 || var(17) = 2
trigger2 = abs(P2Bodydist X) = [0,30]
trigger2 = EnemyNear, StateType = A && abs(P2BodyDist Y) <= 200
trigger2 = IfElse(Var(31) = 0, var(15) < 3, var(15) < 4)
trigger2 = EnemyNear, StateType != C
;---------------------------------------------------------------------------
[State -1, A Kikouken]
type = ChangeState
value = 1000
triggerall = var(25) = 0
triggerall = StateType != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2])
;==
trigger1 = AILevel = 0
trigger1 = IfElse(P2Dist X >= 0, command = "HCF_x", command = "HCB_x")
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = EnemyNear, MoveType != A
trigger2 = random<20*(AILevel**2/64.0) || (var(17) = [1,2]) && MoveHit && random<20*(AILevel**2/64.0) 
trigger2 = abs(P2BodyDist X) = [125,300]
trigger2 = IfElse(EnemyNear, StateType != A, EnemyNear,StateType = S, (abs(P2BodyDist Y) = [45,105]))
trigger2 = EnemyNear, StateType != C
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, C Kikouken]
type = ChangeState
value = 1000
triggerall = var(25) = 0
triggerall = StateType != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2])
;==
trigger1 = AILevel = 0
trigger1 = IfElse(P2Dist X >= 0, command = "HCF_y", command = "HCB_y")
;==
trigger2 = AILevel!=0 && RoundState = 2 
trigger2 = EnemyNear, MoveType != A
trigger2 = random<20*(AILevel**2/64.0) || (var(17) = [1,2]) && MoveHit && random<20*(AILevel**2/64.0) 
trigger2 = abs(P2BodyDist X) = [125,250]
trigger2 = IfElse(EnemyNear, StateType != A, EnemyNear,StateType = S, (abs(P2BodyDist Y) = [45,105]))
trigger2 = EnemyNear, StateType != C
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, A Tenshin Enbu]
type = ChangeState
value = 1025
triggerall = StateType != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || StateNo = 100 
;==
trigger1 = AILevel = 0
trigger1 = IfElse(P2Dist X >= 0, command = "HCB_x", command = "HCF_x")
;==
trigger2 = AILevel != 0 && RoundState = 2
trigger2 = PrevStateNo != 1025
trigger2 = abs(P2BodyDist X)<=20
trigger2 = EnemyNear,StateType!=A
trigger2 = EnemyNear,MoveType!=A
trigger2 = (random<20*(AILevel**2/64.0))
trigger2 = var(0) = 0
;---------------------------------------------------------------------------
[State -1, C Tenshin Enbu]
type = ChangeState
value = 1025
triggerall = StateType != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || StateNo = 100 
;==
trigger1 = AILevel = 0
trigger1 = IfElse(P2Dist X >= 0, command = "HCB_y", command = "HCF_y")
;==
trigger2 = AILevel != 0 && RoundState = 2
trigger2 = PrevStateNo != 1025
trigger2 = abs(P2BodyDist X)<=20
trigger2 = EnemyNear,StateType!=A
trigger2 = EnemyNear,MoveType!=A
trigger2 = (random<20*(AILevel**2/64.0))
trigger2 = var(0) = 0
;---------------------------------------------------------------------------
[State -1, B Hyakuretsu Kyaku]
type = ChangeState
value = 1005
triggerall = StateType != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2]) && (StateNo != 1006 && StateNo != 2006)
;==
trigger1 = AILevel = 0
trigger1 = command = "mash_a"
;==
trigger2 = AILevel != 0 && RoundState = 2
trigger2 = EnemyNear, MoveType != A
trigger2 = (random<5*(AILevel**2/64.0)) || var(17) = 1 && random<40*(AILevel**2/64.0) || var(17) = 2
trigger2 = abs(P2BodyDist X) <= 10
trigger2 = IfElse(EnemyNear, StateType != A, (abs(P2BodyDist Y) = [0,50]), (EnemyNear, Pos Y = [0,-50]))
trigger2 = Var(15) < (IfElse(Var(31) = 0, 3, 4))
;---------------------------------------------------------------------------
[State -1, D Hyakuretsu Kyaku]
type = ChangeState
value = 1005
triggerall = StateType != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2]) && (StateNo != 1006 && StateNo != 2006)
;==
trigger1 = AILevel = 0
trigger1 = command = "mash_b"
;==
trigger2 = AILevel != 0 && RoundState = 2
trigger2 = EnemyNear, MoveType != A
trigger2 = (random<5*(AILevel**2/64.0)) || var(17) = 1 && random<40*(AILevel**2/64.0) || var(17) = 2
trigger2 = abs(P2BodyDist X) <= 10
trigger2 = IfElse(EnemyNear, StateType != A, (abs(P2BodyDist Y) = [0,50]), (EnemyNear, Pos Y = [0,-50]))
trigger2 = Var(15) < (IfElse(Var(31) = 0, 3, 4))
;---------------------------------------------------------------------------
[State -1, B Spinning Bird Kick]
type = ChangeState
value = 1010
triggerall = StateType != A
triggerall = ctrl || stateno = 40 || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2]) && (StateNo != [1010,1012]) && (StateNo != [2010,2012])
;==
trigger1 = AILevel = 0
trigger1 = command = "down_up_a"
;==
trigger2 = AILevel != 0 && RoundState = 2
trigger2 = EnemyNear, MoveType != A
trigger2 = (random<20*(AILevel**2/64.0)) || (var(17) = 1 && var(18) = [2,3]) || var(17) = 2
trigger2 = abs(P2BodyDist X) <=60
trigger2 = IfElse(EnemyNear, StateType != A, (abs(P2BodyDist Y) = [0,30]), (EnemyNear, Pos Y = [0,-50]))
trigger2 = EnemyNear, StateType != C
trigger2 = Var(15) < (IfElse(Var(31) = 0, 3, 4))
;---------------------------------------------------------------------------
[State -1, D Spinning Bird Kick]
type = ChangeState
value = 1010
triggerall = StateType != A
triggerall = ctrl || stateno = 40 || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2]) && (StateNo != [1010,1012]) && (StateNo != [2010,2012])
;==
trigger1 = AILevel = 0
trigger1 = command = "down_up_b"
;==
trigger2 = AILevel != 0 && RoundState = 2
trigger2 = EnemyNear, MoveType != A
trigger2 = (random<20*(AILevel**2/64.0)) || (var(17) = 1 && var(18) = [2,3]) || var(17) = 2
trigger2 = abs(P2BodyDist X) <=75
trigger2 = IfElse(EnemyNear, StateType != A, (abs(P2BodyDist Y) = [0,30]), (EnemyNear, Pos Y = [0,-50]))
trigger2 = EnemyNear, StateType != C
trigger2 = Var(15) < (IfElse(Var(31) = 0, 3, 4))
;---------------------------------------------------------------------------
[State -1, B Hazanshu]
type = ChangeState
value = 1015
triggerall = StateType != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2]) && stateno != 1015 && StateNo != 2015
;==
trigger1 = AILevel = 0
trigger1 = IfElse(P2Dist X >= 0, command = "HCB_a", command = "HCF_a")
;==
trigger2 = AILevel != 0 && RoundState = 2
trigger2 = EnemyNear, MoveType != A
trigger2 = random<15*(AILevel**2/64.0) || var(17) = 1 && random<40*(AILevel**2/64.0) || var(17) = 2 
trigger2 = abs(P2BodyDist X) <=75
trigger2 = EnemyNear, StateType != A || EnemyNear, StateType = C
trigger2 = Var(15) < (IfElse(Var(31) = 0, 3, 4))
;---------------------------------------------------------------------------
[State -1, D Hazanshu]
type = ChangeState
value = 1015
triggerall = StateType != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || StateNo = 100 || (var(17) = [1,2]) && stateno != 1015 && StateNo != 2015
;==
trigger1 = AILevel = 0
trigger1 = IfElse(P2Dist X >= 0, command = "HCB_b", command = "HCF_b")
;==
trigger2 = AILevel != 0 && RoundState = 2
trigger2 = EnemyNear, MoveType != A
trigger2 = (random<10*(AILevel**2/64.0)) || (var(17) = 1 && var(18) = [2,3]) || var(17) = 2 
trigger2 = abs(P2BodyDist X) <=100
trigger2 = EnemyNear, StateType != A || EnemyNear, StateType = C
trigger2 = Var(15) < (IfElse(Var(31) = 0, 3, 4))

;---------------------------------------------------------------------------
[State -1, AI Defense]
type = ChangeState
triggerall = stateno!= [120,160] 
triggerall = roundstate= 2
triggerall = AILevel != 0
triggerall = InGuardDist
triggerall = StateType != A
trigger1 = ctrl = 1
value = 120
;===========================================================================
;---------------------------------------------------------------------------
[State -1, Wall Jump]
type = ChangeState
value = 45
triggerall = (StateType = A) && (Ctrl) && (Pos Y < -30)
triggerall = AILevel = 0
trigger1 = ((command = "up") && (command = "fwd") && (Vel X <= 0) && (backedgebodydist <= 10) && (backedgebodydist > -10)) 
trigger2 = ((command = "up") && (command = "back") && (Vel X >= 0) && (frontedgebodydist <= 10) && (frontedgebodydist > -10)) 
;---------------------------------------------------------------------------
[State -1, 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<20*(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, Ten Raku Tou (AI)]
type = ChangeState
value = 810
triggerall = var(1) = 0
triggerall = AILevel!=0&&RoundState=2
triggerall = statetype = A
trigger1 = ctrl
trigger1 = P2BodyDist X = [0,20]
trigger1 = EnemyNear,StateType != A
trigger1 = EnemyNear, MoveType != A
trigger1 = (random<20*(AILevel**2/64.0))
trigger1 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, Ten Raku Tou]
type = ChangeState
value = 810
triggerall = var(1) = 0
triggerall = AILevel = 0
triggerall = StateType = A
triggerall = ctrl
triggerall = command = "holddown" || command = "holdback" || command = "holdfwd"
trigger1 = command = "y" 
;---------------------------------------------------------------------------
[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)<=70
trigger2 = EnemyNear,StateType != C 
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)<=30
trigger2 = abs(P2BodyDist Y)<=70
trigger2 = EnemyNear,StateType != C 
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<40*(AILevel**2/64.0)) || EnemyNear, StateType = C
trigger2 = P2BodyDist X=[0,40]
trigger2 = enemynear,pos Y-pos Y=[-30,45]
trigger2 = IfElse(Var(31) = 0, var(15) <= 2, var(15) < 4)
trigger2 = EnemyNear,MoveType!=A
;---------------------------------------------------------------------------
[State -1, st.A]
type = ChangeState
value = IfElse(abs(P2BodyDist X) >= 20, 200, 201)
triggerall = command != "holddown"
triggerall = StateType !=A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) || ( (stateno = [200,201]) || stateno = 400 || stateno = 430 ) && Time > 5
trigger1 = command = "x"
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0))
trigger2 = abs(P2Bodydist X)<=30
trigger2 = abs(P2Bodydist Y)<=40
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, st.C]
type = ChangeState
value = IfElse(abs(P2BodyDist X) >= 20, 210, 211)
triggerall = command != "holddown"
triggerall = StateType !=A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100)
trigger1 = command = "y"
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0))
trigger2 = abs(P2Bodydist X)<=60
trigger2 = abs(P2Bodydist Y)<=40
trigger2 = var(15) = 0
;---------------------------------------------------------------------------
[State -1, Kakusen Kyaku]
type = ChangeState
value = 232
triggerall = command != "holddown"
triggerall = StateType !=A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) || var(17) = 1 && var(18) < 3
trigger1 = command = "holdfwd" && command = "a"
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<50*(AILevel**2/64.0)) || (random<75*(AILevel**2/64.0)) && var(17) = 1
trigger2 = abs(P2Bodydist X)<=55
trigger2 = IfElse(EnemyNear, StateType != A, abs(P2Bodydist Y)<=45, (EnemyNear, Pos Y = [-15,-45]))
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 = [200,201]) || stateno = 400 || stateno = 430 ) && Time > 5
trigger1 = command = "a"
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<40*(AILevel**2/64.0)) 		
trigger2 = abs(P2Bodydist X)<=50
trigger2 = IfElse(EnemyNear, StateType != A, abs(P2Bodydist Y)<=45, (EnemyNear, Pos Y = [-25,-45]))
trigger2 = var(15) = 0

;---------------------------------------------------------------------------
[State -1, Kakusen Rakushuu]
type = ChangeState
value = 242
triggerall = Var(18) = [0,2]
triggerall = command != "holddown"
triggerall = StateType !=A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) || var(17) = 1 && var(18) < 3
trigger1 = command = "holdfwd" && command = "b"
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<40*(AILevel**2/64.0)) || (random<75*(AILevel**2/64.0)) && var(17) = 1
trigger2 = EnemyNear, StateType = S
trigger2 = abs(P2Bodydist X) = [10,60]
trigger2 = EnemyNear, StateType != A && abs(P2Bodydist Y)<=25
trigger2 = var(15) = 0

;---------------------------------------------------------------------------
[State -1, st.D]
type = ChangeState
value = IfElse(abs(P2BodyDist X) >= 20, 240, 241)
triggerall = command != "holddown"
triggerall = StateType !=A
triggerall = ctrl  || Anim = 47 && ctrl = 1 || (stateno = 100)
trigger1 = command = "b"
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<60*(AILevel**2/64.0))
trigger2 = abs(P2Bodydist X)<=60
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 = [200,201]) || stateno = 400 || stateno = 430 ) && Time > 5
trigger1 = command = "x"
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<40*(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 && RoundState = 2
;==
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, Zensou Sentai]
type = ChangeState
value = 431
triggerall = command = "holddown"
triggerall = statetype != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) || var(17) = 1 && var(18) < 3
trigger1 = command = "holdfwd" && command = "a"
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<50*(AILevel**2/64.0)) || (random<75*(AILevel**2/64.0)) && var(17) = 1
trigger2 = abs(P2Bodydist X)<=65
trigger2 = EnemyNear, StateType != A
trigger2 = var(15) = 0
trigger2 = EnemyNear,MoveType!=A

;---------------------------------------------------------------------------
[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 > 5
trigger1 = command = "a"
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = EnemyNear,StateType = S
trigger2 = abs(P2Bodydist X)<=60
trigger2 = abs(P2Bodydist Y)<=40
trigger2 = var(15) = 0
trigger2 = EnemyNear,MoveType!=A

;---------------------------------------------------------------------------
[State -1, Kaku Kyaku Raku]
type = ChangeState
value = 441
triggerall = command = "holddown"
triggerall = statetype != A
triggerall = ctrl || Anim = 47 && ctrl = 1 || (stateno = 100) || var(17) = 1 && var(18) < 3
trigger1 = command = "holdfwd" && command = "b"
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = EnemyNear,StateType = C
trigger2 = abs(P2Bodydist X)<=65
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 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = EnemyNear,StateType = S;(random<350*(AILevel**2/64.0)) || (EnemyNear, StateNo = [120,152]) && EnemyNear,StateType = S  
trigger2 = abs(P2Bodydist X)<=70
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 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<40*(AILevel**2/64.0)) || EnemyNear,StateType = S || EnemyNear, StateType = S && (EnemyNear, StateNo = [120,150])
trigger2 = P2BodyDist X=[0,40]
trigger2 = enemynear,pos Y-pos Y=[-30,45]
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 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<40*(AILevel**2/64.0)) || EnemyNear, StateType = C
trigger2 = P2BodyDist X=[0,40]
trigger2 = enemynear,pos Y-pos Y=[-30,45]
trigger2 = IfElse(Var(31) = 0, var(15) <= 2, var(15) < 4)
trigger2 = EnemyNear,MoveType!=A

;---------------------------------------------------------------------------
[State -1, Yousou Kyaku]
type = ChangeState
value = 632
triggerall = statetype = A 
triggerall = ctrl || var(17) = 1 && var(18) < 3
trigger1 = command = "holddown"
trigger1 = command = "a"
trigger1 = AILevel = 0 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<40*(AILevel**2/64.0)) || EnemyNear, StateType = C
trigger2 = P2BodyDist X=[0,20]
trigger2 = enemynear,pos Y-pos Y=[0,75]
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 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<40*(AILevel**2/64.0)) || EnemyNear, StateType = C
trigger2 = P2BodyDist X=[0,40]
trigger2 = enemynear,pos Y-pos Y=[-30,45]
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 && RoundState = 2
;==
trigger2 = AILevel!=0&&RoundState=2
trigger2 = (random<40*(AILevel**2/64.0)) || EnemyNear, StateType = C
trigger2 = P2BodyDist X=[0,80]
trigger2 = enemynear,pos Y-pos Y=[-30,45]
trigger2 = IfElse(Var(31) = 0, var(15) <= 2, var(15) < 4)
trigger2 = EnemyNear,MoveType!=A
