;-| CPU |------------------------------------------------------
[Command]
name = "cpu"
command = x,x,x,x,x,x
time = 0

[Command]
name = "cpu"
command = y,y,y,y,y,y
time = 0

[Command]
name = "cpu"
command = z,z,z,z,z,z
time = 0

[Command]
name = "cpu"
command = a,a,a,a,a,a
time = 0

[Command]
name = "cpu"
command = b,b,b,b,b,b
time = 0

[Command]
name = "cpu"
command = c,c,c,c,c,c
time = 0

;-| Special Motions |------------------------------------------------------
[Command]
name = "SP1"
command = b+c

[Command]
name = "SP2"
command = x+y

[Command]
name = "SP3"
command = y+z

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

;-| 2/3 Button Combination |-----------------------------------------------
[Command]
name = "recovery";Required (do not remove)
command = x+y
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 = "start"
command = s
time = 1

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

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

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

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

[Statedef -1]

;---------------------------------------------------------------------------
;Special
[State -1,0]
type = ChangeState
value = 8500
triggerall = var(1) = 0
triggerall = palno > 6
triggerall = Command = "start"
triggerall = Statetype = S || Statetype = C
trigger1 = Ctrl && var(44) = 0

;Warp
[State -1,1]
type = ChangeState
value = 1000
triggerall = Command = "SP1"
triggerall = StateType = S || StateType = C
trigger1 = Ctrl

;1Way
[State -1,2]
type = ChangeState
value = 1100
triggerall = NumProjId(1100) = 0
triggerall = Command = "SP2"
triggerall = StateType = S || StateType = C
trigger1 = Ctrl

;3Way
[State -1,3]
type = ChangeState
value = 1200
triggerall = NumProjId(1100) = 0
triggerall = Command = "SP3"
triggerall = StateType = S || StateType = C
trigger1 = Ctrl

;---------------------------------------------------------------------------
;Throw
[State -1, Throw]
type = ChangeState
value = 800
triggerall = P2BodyDist X < 30
triggerall = (Command = "y" || Command = "z") && Command = "holdfwd"
triggerall = StateType = S
trigger1 = Ctrl

[State -1, Throw]
type = ChangeState
value = 805
triggerall = P2BodyDist X < 30
triggerall = (Command = "y" || Command = "z") && Command = "holdback"
triggerall = StateType = S
trigger1 = Ctrl

[State -1, Throw]
type = ChangeState
value = 850
triggerall = P2BodyDist X < 30
triggerall = (Command = "a" || Command = "b") && (Command = "holdfwd" || Command = "holdback")
triggerall = StateType = S
trigger1 = Ctrl

;---------------------------------------------------------------------------
;Stand Light Punch
[State -1, Stand Light Punch]
type = ChangeState
value = IfElse(P2BodyDist X < 20,205,200)
triggerall = Command = "x"
triggerall = Command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;Stand Strong Punch
[State -1, Stand Strong Punch]
type = ChangeState
value = IfElse(P2BodyDist X < 30,215,210)
triggerall = Command = "y" || Command = "z"
triggerall = Command != "holddown"
trigger1 = StateType = S
trigger1 = Ctrl

;---------------------------------------------------------------------------
;Stand Light Kick
[State -1, Stand Light Kick]
type = ChangeState
value = 220
triggerall = Command = "a"
triggerall = Command != "holddown"
trigger1 = StateType = S
trigger1 = Ctrl

;---------------------------------------------------------------------------
;Standing Strong Kick
[State -1, Standing Strong Kick]
type = ChangeState
value = IfElse(P2BodyDist X < 30,235,230)
triggerall = Command = "b" || Command = "c"
triggerall = Command != "holddown"
trigger1 = StateType = S
trigger1 = Ctrl

;---------------------------------------------------------------------------
;Crouching Punch
[State -1, Crouching Punch]
type = ChangeState
value = 400
triggerall = Command = "x" || Command = "y" || Command = "z"
triggerall = Command = "holddown"
trigger1 = StateType = C
trigger1 = ctrl

;---------------------------------------------------------------------------
;Crouching Light Kick
[State -1, Crouching Light Kick]
type = ChangeState
value = 410
triggerall = Command = "a"
triggerall = Command = "holddown"
trigger1 = StateType = C
trigger1 = Ctrl

;---------------------------------------------------------------------------
;Crouching Medium Kick
[State -1, Crouching Medium Kick]
type = ChangeState
value = 420
triggerall = Command = "b"
triggerall = Command = "holddown"
trigger1 = StateType = C
trigger1 = Ctrl

;---------------------------------------------------------------------------
;Crouching Strong Kick
[State -1, Crouching Strong Kick]
type = ChangeState
value = 430
triggerall = Command = "c"
triggerall = Command = "holddown"
trigger1 = StateType = C
trigger1 = ctrl

;---------------------------------------------------------------------------
;Jump Punch
[State -1, Jump Punch]
type = ChangeState
value = 600
triggerall = Command = "x" || Command = "y" || Command = "z"
trigger1 = StateType = A
trigger1 = Ctrl

;---------------------------------------------------------------------------
;Jump Light Kick
[State -1, Jump Light Kick]
type = ChangeState
value = IfElse(Vel X = 0,620,610)
triggerall = Command = "a"
trigger1 = StateType = A
trigger1 = Ctrl

;---------------------------------------------------------------------------
;Jump Strong Kick
[State -1, Jump Strong Kick]
type = ChangeState
value = 630
triggerall = Command = "b" || Command = "c"
trigger1 = statetype = A
trigger1 = ctrl


;//////////////////////////////////AI動作
[State -1]
type = varset
triggerall = var(1) = 0
trigger1 = command = "cpu"
var(1) = 1

[State -1]
type = varset
triggerall = var(1) = 0
triggerall = palno = 12
trigger1 = RoundState != 2
var(1) = 1

[State -1]
type = varset
triggerall = var(1) = 0
triggerall = palno = 12
trigger1 = RoundState = 2
var(1) = 1

[State -1]
type = varrandom
trigger1 = var(1)
v = 23
range = 2000
ignorehitpause = 1

;------------------------------------------
;立ち動作時
;//////////////////////相手が攻撃
;Warp
[State -1,1]
type = ChangeState
value = 1000
triggerall = Roundstate = 2
triggerall = var(1)
triggerall = statetype != A && ctrl
triggerall = movetype = I && enemy,movetype = A && stateno != 1000
trigger1 = (var(23) = [0,1200])
trigger1 = p2bodydist X = [0,300]

[State -1,0]
type = ChangeState
value = 8500
triggerall = Roundstate = 2
triggerall = var(1)
triggerall = palno > 6
triggerall = Statetype = S || Statetype = C
trigger1 = Ctrl&&var(44) = 0&&Life<=ifelse(palno=12,(LifeMax/2),LifeMax)&&var(23) = [800,1000]
trigger2 = Ctrl && var(44) = 0 && var(34) = 1 && var(23) = [500,800]
;---------------------------------------------------------------------------
;ジャンプ
[State -1,]
type = ChangeState
value = 40
triggerall = P2BodyDist X = [35,70]
triggerall = Roundstate = 2
triggerall = var(1)
triggerall = statetype != A && ctrl
triggerall = movetype = I && enemy,statetype != A
trigger1 = var(23) = [0,500]

[State -1]
type = velset
triggerall = Roundstate = 2
triggerall = var(1)
trigger1 = stateno = 50 && time = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))



;Crouching Strong Kick
[State -1, Crouching Strong Kick]
type = ChangeState
value = 430
triggerall = Roundstate = 2
triggerall = var(1)
triggerall = statetype != A && ctrl
triggerall = movetype = I && enemy,statetype != A && enemy,statetype != L
trigger1 = var(23) = [400,800]
trigger1 = p2bodydist X = [0,150]
trigger2 = prevstateno = 1200 || (prevstateno = 430 && (enemy,stateno = [152,153]) && random < 666) || prevstateno = 210
trigger3 = palno = 12 && p2bodydist X = [100,300]
trigger4 = palno != 12 && p2bodydist X = [0,150]

;Warp
[State -1,1]
type = ChangeState
value = 1000
triggerall = Roundstate = 2
triggerall = var(1)
triggerall = statetype != A && ctrl
triggerall = movetype = I && stateno != 1000
trigger1 = (var(23) = [0,500]) && random < 333
trigger1 = p2stateno = [5100,5120]

;1Way
[State -1,2]
type = ChangeState
value = 1100
triggerall = Roundstate = 2
triggerall = var(1)
triggerall = statetype != A && ctrl
trigger1 = var(23) = [0,300]
trigger1 = p2bodydist X = [0,250]
trigger1 = numprojID(1100) = 0
trigger2 = stateno = [1100,1300]
trigger2 = time = 10 && random < 300
trigger3 = palno = 12 && var(23) = [500,1200]

;3Way
[State -1,3]
type = ChangeState
value = 1200
triggerall = Roundstate = 2
triggerall = var(1)
triggerall = statetype != A && ctrl
trigger1 = var(23) = [0,300]
trigger1 = p2bodydist X = [0,250]
trigger2 = numprojID(1200) = 0
trigger3 = stateno = [1100,1300]
trigger3 = time = 10 && random = [300,600]

;5Way
[State -1,3]
type = ChangeState
value = 1300
triggerall = Roundstate = 2 && palno = 12
triggerall = statetype != A && ctrl
triggerall = var(1)
trigger1 = var(23) = [0,300]
trigger1 = p2bodydist X = [0,250]
trigger2 = numprojID(1200) = 0
trigger3 = stateno = [1100,1200]
trigger3 = time = 10 && random > 600
trigger4 = FrontEdgeDist = [0,50]

;AirWay
[State -1,3]
type = ChangeState
value = 1400
triggerall = var(1)
triggerall = Roundstate = 2 && palno = 12
triggerall = statetype = A && ctrl
trigger1 = random = [300,777]
;---------------------------------------------------------------------------
[State -1]
type = ChangeState
value = 630
triggerall = P2BodyDist X = [-10,25]
triggerall = Roundstate = 2
triggerall = var(1)
trigger1 = stateno = 50 && p2bodydist Y < 70
trigger1 = Ctrl
;---------------------------------------------------------------------------
;Stand Strong Punch
[State -1, Stand Strong Punch]
type = ChangeState
value = IfElse(P2BodyDist X < 30,215,210)
triggerall = Roundstate = 2
triggerall = var(1) && prevstateno = 215
triggerall = statetype != A && ctrl
triggerall = movetype = I && p2bodydist X = [0,60]
trigger1 = var(23) = [0,1000]

;---------------------------------------------------------------------------
;Throw
[State -1, Throw]
type = ChangeState
value = 800
triggerall = P2BodyDist X < 30
triggerall = Roundstate = 2
triggerall = var(1)
triggerall = statetype != A && ctrl
triggerall = movetype = I && enemy,statetype != A
trigger1 = var(23) = [0,777]

[State -1, Throw]
type = ChangeState
value = 805
triggerall = P2BodyDist X < 30
triggerall = Roundstate = 2
triggerall = var(1)
triggerall = statetype != A && ctrl
triggerall = movetype = I && enemy,statetype != A
trigger1 = var(23) = [778,1444]

[State -1, Throw]
type = ChangeState
value = 850
triggerall = P2BodyDist X < 30
triggerall = Roundstate = 2
triggerall = var(1)
triggerall = statetype != A && ctrl
triggerall = movetype = I && enemy,statetype != A
trigger1 = var(23) = [1444,2000]


;---------------------------------------------------------------------------

