
;-| Button Remapping |-----------------------------------------------------
[Remap]
x = x
y = y
z = z
a = a
b = b
c = c
s = s

;-| Default Values |-------------------------------------------------------
[Defaults]
command.time = 15

command.buffer.time = 1


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

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

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

;-| Special Motions |------------------------------------------------------
[Command]
name = "623A"
command = ~F, D, DF, a

[Command]
name = "623B"
command = ~F, D, DF, b

[Command]
name = "236A"
command = ~D, DF, F, a

[Command]
name = "236B"
command = ~D, DF, F, b

[Command]
name = "214A"
command = ~D, DB, B, a

[Command]
name = "214A"
command = ~D, DB, B, b

[Command]
Name = "DU"
Command = $D, $U
Time = 8

;-| Double Tap |-----------------------------------------------------------
[Command]
name = "FF"
command = F, F
time = 10

[Command]
name = "BB"
command = B, B
time = 10

;-| 2/3 Button Combination |-----------------------------------------------
[Command]
name = "recovery"
command = a+b
time = 5

;-| Dir + Button |---------------------------------------------------------
[Command]
name = "down_a"
command = /$D,a
time = 1

[Command]
name = "down_b"
command = /$D,b
time = 1

[Command]
name = "4A"
command = /B,a
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"
command = /$F
time = 1

[Command]
name = "holdback"
command = /$B
time = 1

[Command]
name = "holdup" 
command = /$U
time = 1

[Command]
name = "holddown"
command = /$D
time = 1

;-| CPUアルゴリズム用コマンド |------------------------------

[Command]
name = "AI0"
command = ~F, D, DF, a
time = 0
[Command]
name = "AI1"
command = ~F, D, DF, b
time = 0
[Command]
name = "AI2"
command = ~D, DF, F, a
time = 0
[Command]
name = "AI3"
command = ~D, DF, F, b
time = 0
[Command]
name = "AI4"
command = ~D, DB, B, a
time = 0
[Command]
name = "AI5"
command = ~D, DB, B, b
time = 0
[Command]
name = "AI6"
command = s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s
time = 0
[Command]
name = "AI7"
command = F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F
time = 0
[Command]
name = "AI8"
command = D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D
time = 0
[Command]
name = "AI9"
command = B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B
time = 0
[Command]
name = "AI10"
command = U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U
time = 0
[Command]
name = "AI11"
command = a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a
time = 0
[Command]
name = "AI12"
command = b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b
time = 0
[Command]
name = "AI13"
command = c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
[Command]
name = "AI14"
command = x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time = 0
[Command]
name = "AI15"
command = y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time = 0
[Command]
name = "AI16"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time = 0

;---------------------------------------------------------------------------
; 2. State entry

[Statedef -1]

;===========================================================================
;---------------------------------------------------------------------------
;フラッシングシャワー
[State -1, hadou_l]
type = ChangeState
value = 2000
triggerall = var(59) = 0
triggerall = command = "214214A"
triggerall = power >= 1000
trigger1 = statetype != A
trigger1 = ctrl = 1
trigger2 = (stateno = 200)||(stateno = [230,231])||(stateno = 400)||(stateno = 430)||(stateno = 210) || (stateno = 410)
trigger2 = movecontact

;---------------------------------------------------------------------------
;対空弱
[State -1, taikuu_l]
type = ChangeState
value = 1100
triggerall = var(59) = 0
triggerall = command = "623A"
trigger1 = ctrl = 1
trigger2 = (stateno = 200)||(stateno = [230,231])||(stateno = 400)||(stateno = 430)||(stateno = 210) || (stateno = 410)|| (stateno = 600)|| (stateno = 610)
trigger2 = movecontact
;---------------------------------------------------------------------------
;対空強
[State -1, taikuu_s]
type = ChangeState
value = 1110
triggerall = var(59) = 0
triggerall = command = "623B"
trigger1 = ctrl = 1
trigger2 = (stateno = 200)||(stateno = [230,231])||(stateno = 400)||(stateno = 430)||(stateno = 210) || (stateno = 410)|| (stateno = 600)|| (stateno = 610)
trigger2 = movecontact

;---------------------------------------------------------------------------
;波動弱
[State -1, hadou_l]
type = ChangeState
value = 1000
triggerall = var(59) = 0
triggerall = command = "236A"
trigger1 = statetype != A
trigger1 = ctrl = 1
trigger2 = (stateno = 200)||(stateno = [230,231])||(stateno = 400)||(stateno = 430)||(stateno = 210) || (stateno = 410)
trigger2 = movecontact
;---------------------------------------------------------------------------
;波動強
[State -1, hadou_s]
type = ChangeState
value = 1010
triggerall = var(59) = 0
triggerall = command = "236B"
trigger1 = ctrl = 1
trigger1 = statetype != A
trigger2 = (stateno = 200)||(stateno = [230,231])||(stateno = 400)||(stateno = 430)||(stateno = 210) || (stateno = 410)
trigger2 = movecontact

;---------------------------------------------------------------------------
;引き込み鎖
[State -1, Standing Strong Kick]
type = ChangeState
value = 240
triggerall = var(59) = 0
triggerall = command = "214A"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = (stateno = 200)||(stateno = [230,231])||(stateno = 400)||(stateno = 430)||(stateno = 210) || (stateno = 410)
trigger2 = movecontact

;===========================================================================
;---------------------------------------------------------------------------
;ダッシュ
[State -1, Run Fwd]
type = ChangeState
value = 100
triggerall = var(59) = 0
trigger1 = command = "FF"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;後退ダッシュ
[State -1, Run Back]
type = ChangeState
value = 105
triggerall = var(59) = 0
trigger1 = command = "BB"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;投げ
[State -1, Kung Fu Throw]
type = null;ChangeState
value = 800
triggerall = var(59) = 0
triggerall = command = "y"
triggerall = statetype = S
triggerall = ctrl
triggerall = stateno != 100
trigger1 = command = "holdfwd"
trigger1 = p2bodydist X < 3
trigger1 = (p2statetype = S) || (p2statetype = C)
trigger1 = p2movetype != H
trigger2 = command = "holdback"
trigger2 = p2bodydist X < 5
trigger2 = (p2statetype = S) || (p2statetype = C)
trigger2 = p2movetype != H


;===========================================================================
;---------------------------------------------------------------------------
;キャンセル立下段
[State -1, Stand Light Kick]
type = ChangeState
value = 231
triggerall = var(59) = 0
triggerall = command = "4A"
triggerall = command != "holddown"
trigger1 = stateno = 210
trigger1 = movecontact

;---------------------------------------------------------------------------
;立下段
[State -1, Stand Light Kick]
type = ChangeState
value = 230
triggerall = var(59) = 0
triggerall = command = "4A"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;立弱P
[State -1, Stand Light Punch]
type = ChangeState
value = 200
triggerall = var(59) = 0
triggerall = command = "a"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = time >= 6
trigger3 = stateno = 400
trigger3 = movecontact

;---------------------------------------------------------------------------
;立強P
[State -1, Stand Strong Punch]
type = ChangeState
value = 210
triggerall = var(59) = 0
triggerall = command = "b"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;---------------------------------------------------------------------------
;挑発
[State -1, Taunt]
type = null;ChangeState
value = 195
triggerall = command = "start"
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
;屈弱P
[State -1, Crouching Light Punch]
type = ChangeState
value = 400
triggerall = var(59) = 0
triggerall = command = "a"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = stateno = 400
trigger2 = time > 7
trigger3 = stateno = 200
trigger3 = movecontact

;---------------------------------------------------------------------------
;屈強P
[State -1, Crouching Strong Punch]
type = ChangeState
value = 410
triggerall = var(59) = 0
triggerall = command = "b"
triggerall = command = "holddown"
trigger1 = statetype = C
trigger1 = ctrl
trigger2 = stateno = 210
trigger2 = (time > 8) && time < 16

;---------------------------------------------------------------------------
;飛び弱P
[State -1, Jump Light Punch]
type = ChangeState
value = 600
triggerall = var(59) = 0
triggerall = command = "a"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 600
trigger2 = statetime >= 7

;---------------------------------------------------------------------------
;飛び強P
[State -1, Jump Strong Punch]
type = ChangeState
value = 610
triggerall = var(59) = 0
triggerall = command = "b"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 600
trigger2 = movecontact

;---------------------------------------------------------------------------
[State -1, recover]
type = ChangeState
triggerall = var(59) = 0
triggerall = command = "recovery"
triggerall = alive
trigger1 = (stateno = 5110) && time > 5
trigger2 = stateno = 5081
trigger3 = (stateno = 5100) && time > 3
trigger4 = stateno = 5101
value = 5211 

;---------------------------------------------------------------------------
[State -1, airG]
type = ChangeState
triggerall = var(59) = 0
triggerall = command = "holdback"
triggerall = alive
trigger1 = stateno = 5040
value = 120









;--------------------------------------------------------------------------------------
[State -1]
type = VarSet
triggerall = var(59) = 0
triggerall = RoundState = [1,2]
trigger1 = Command = "AI0"
trigger2 = Command = "AI1"
trigger3 = Command = "AI2"
trigger4 = Command = "AI3"
trigger5 = Command = "AI4"
trigger6 = Command = "AI5"
trigger7 = Command = "AI6"
trigger8 = Command = "AI7"
trigger9 = Command = "AI8"
trigger10 = Command = "AI9"
trigger11 = Command = "AI10"
trigger12 = Command = "AI11"
trigger13 = Command = "AI12"
trigger14 = Command = "AI13"
trigger15 = Command = "AI14"
trigger16 = Command = "AI15"
trigger17 = Command = "AI16"
V = 59
Value = 10

;===========================================================================
;---------------------------------------------------------------------------
;ガード
[State -3]
Type = ChangeState
Value = 120
TriggerAll = var(59) != 0
TriggerAll = RoundState = 2
TriggerAll = stateno != [120,155]
TriggerAll = Ctrl
TriggerAll = inguarddist
Trigger1 = P2BodyDist X <= 300
Trigger1 = Random = [0,100*var(59)]
Trigger2 = P2BodyDist X > 300
Trigger2 = stateno = [120,155] 
Trigger2 = EnemyNear,time <= 60
Trigger2 = Random = [0,100*var(59)]

;---------------------------------------------------------------------------
;フラッシングシャワー
[State -1, hadou_l]
type = ChangeState
value = 2000
triggerall = RoundState = 2
triggerall = var(59) != 0
triggerall = power >= 1000
trigger1 = statetype != A
trigger1 = ctrl
trigger1 = P2statetype = L || P2movetype != A
trigger1 = P2bodydist X = [170,260]
trigger1 = Random = [79*var(59),89*var(59)]

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

;対空弱
[State -1, taikuu_l]
type = ChangeState
value = 1100
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = var(59) != 0
trigger1 = Random = [0*var(59),40*var(59)]
trigger1 = ctrl
trigger1 = P2bodydist Y = [0,-50]
trigger1 = P2bodydist X = [10,40]
trigger1 = P2movetype != I
trigger1 = P2statetype = A
trigger2 = Random = [16*var(59),30*var(59)]
trigger2 = ctrl
trigger2 = P2bodydist X = [0,40]
trigger2 = P2movetype = A
trigger2 = P2statetype != A
trigger2 = statetype != A
trigger3 = Random = [0*var(59),100*var(59)]
trigger3 = P2bodydist X = [15,25]
trigger3 = (stateno = 200)||(stateno = 400)
trigger3 = movehit
trigger4 = Random = [0*var(59),30*var(59)]
trigger4 = stateno = 410
trigger4 = animelemtime(5) > 0
trigger4 = movehit
trigger4 = P2bodydist X = [0,40]
trigger5 = Random = [0*var(59),50*var(59)]
trigger5 = stateno = 610
trigger5 = animelemtime(5) > 0
trigger5 = movehit
trigger5 = P2statetype = A
trigger5 = P2bodydist X = [0,30]

;---------------------------------------------------------------------------
;対空強
[State -1, taikuu_s]
type = ChangeState
value = 1110
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = var(59) != 0
trigger1 = Random = [0*var(59),60*var(59)]
trigger1 = ctrl
trigger1 = P2bodydist Y = [-10,-40]
trigger1 = P2bodydist X = [10,40]
trigger1 = P2movetype != I
trigger1 = P2statetype = A
trigger2 = Random = [0*var(59),15*var(59)]
trigger2 = ctrl
trigger2 = P2bodydist X = [0,50]
trigger2 = P2movetype = A
trigger2 = P2statetype != A
trigger2 = statetype != A
trigger3 = Random = [51*var(59),100*var(59)]
trigger3 = stateno = 610
trigger3 = animelemtime(5) > 0
trigger3 = movehit
trigger3 = P2statetype = A
trigger3 = P2bodydist X = [0,20]

;---------------------------------------------------------------------------
;引き込み鎖
[State -1, Standing Strong Kick]
type = ChangeState
value = 240
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = P2statetype != A
triggerall = var(59) != 0
trigger1 = P2bodydist X = [100,150]
trigger1 = Random = [90*var(59),100*var(59)]
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = [230,231]
trigger2 = movehit
trigger2 = P2bodydist X = [70,150]
trigger2 = Random = [0*var(59),60*var(59)]

;---------------------------------------------------------------------------
;波動弱
[State -1, hadou_l]
type = ChangeState
value = 1000
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = var(59) != 0
trigger1 = ctrl
trigger1 = Random = [0*var(59),10*var(59)]
trigger1 = statetype != A
trigger1 = P2bodydist X = [70,150]
trigger1 = P2movetype != A
trigger1 = P2statetype != L
trigger2 = Random = [0*var(59),80*var(59)]
trigger2 = stateno = [230,231]
trigger2 = movehit
trigger3 = Random = [0*var(59),50*var(59)]
trigger3 = stateno = 410
trigger3 = P2bodydist Y = [0,-40]
trigger3 = animelemtime(5) > 0
trigger3 = movehit

;---------------------------------------------------------------------------
;波動強
[State -1, hadou_s]
type = ChangeState
value = 1010
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = var(59) != 0
trigger1 = ctrl
trigger1 = Random = [0*var(59),6*var(59)]
trigger1 = statetype != A
trigger1 = P2bodydist X = [180,220]
trigger1 = P2movetype != A
trigger1 = P2statetype != L
trigger2 = Random = [49*var(59),100*var(59)]
trigger2 = stateno = 410
trigger2 = animelemtime(5) > 0
trigger2 = movehit


;===========================================================================
;---------------------------------------------------------------------------
;ジャンプ
[State -1, Run Back]
type = ChangeState
value = 40
triggerall = RoundState = 2
triggerall = var(59) != 0
triggerall = stateno != [120,155]
triggerall = statetype != A
triggerall = ctrl
trigger1 = Random = [0*var(59),100*var(59)]
trigger1 = P2bodydist Y = [-30,-140]
trigger1 = P2movetype = H
trigger2 = Random = [11*var(59),15*var(59)]
trigger2 = P2movetype != A
trigger3 = ctrl
trigger3 = Random = [7*var(59),12*var(59)]
trigger3 = statetype != A
trigger3 = P2bodydist X = [180,220]
trigger3 = P2movetype != A
trigger3 = P2statetype != L

;---------------------------------------------------------------------------
;ダッシュ
[State -1, Run Fwd]
type = ChangeState
value = 100
Triggerall != inguarddist
triggerall = RoundState = 2
triggerall = var(59) != 0
triggerall = stateno != [120,155]
triggerall = Random = [31*var(59),70*var(59)]
triggerall = statetype != A
triggerall = ctrl
triggerall = stateno != 100
triggerall = stateno != [10,12]
trigger1 = P2bodydist X = [0,255]
trigger1 = P2movetype != A
trigger1 = P2statetype != L

;---------------------------------------------------------------------------
;後退ダッシュ
[State -1, Run Back]
type = ChangeState
value = 105
triggerall = RoundState = 2
triggerall = var(59) != 0
triggerall = stateno != [120,155]
triggerall = Random = [0*var(59),10*var(59)]
triggerall = statetype != A
triggerall = ctrl
trigger1 = P2bodydist X = [70,150]
trigger1 = P2movetype = A
trigger2 = P2statetype = A
trigger3 = P2stateno = [5100,5110]

;---------------------------------------------------------------------------
;キャンセル立下段
[State -1, Stand Light Kick]
type = ChangeState
value = 231
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = var(59) != 0
triggerall = Random = [0*var(59),60*var(59)]
trigger1 = P2bodydist X = [0,90]
trigger1 = stateno = 210
trigger1 = animelemtime(5) > 0
trigger1 = movecontact

;---------------------------------------------------------------------------
;立下段
[State -1, Stand Light Kick]
type = ChangeState
value = 230
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = var(59) != 0
triggerall = Random = [0*var(59),40*var(59)]
trigger1 = P2statetype != A
trigger1 = P2bodydist X = [41,90]
trigger1 = statetype != A
trigger1 = ctrl

;---------------------------------------------------------------------------
;立強P
[State -1, Stand Strong Punch]
type = ChangeState
value = 210
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = var(59) != 0
triggerall = P2bodydist X = [0,60]
triggerall = statetype != A
trigger1 = P2bodydist Y = [0,-30]
trigger1 = P2stateno != [5100,5110]
trigger1 = Random = [0*var(59),60*var(59)]
trigger1 = ctrl
trigger1 = P2statetype != A
trigger1 = P2movetype != H
trigger2 = Random = [0*var(59),100*var(59)]
trigger2 = stateno = 240
trigger2 = animtime = 0
trigger2 = movehit

;---------------------------------------------------------------------------
;立弱P
[State -1, Stand Light Punch]
type = ChangeState
value = 200
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = var(59) != 0
trigger1 = P2statetype != A
trigger1 = Random = [0*var(59),60*var(59)]
trigger1 = P2bodydist X = [0,30]
trigger1 = P2stateno != [5100,5110]
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = Random = [0*var(59),50*var(59)]
trigger2 = stateno = 200
trigger2 = time >= 6
trigger2 = movecontact
trigger3 = Random = [51*var(59),100*var(59)]
trigger3 = stateno = 400
trigger3 = movecontact

;---------------------------------------------------------------------------
;屈弱P
[State -1, Crouching Light Punch]
type = ChangeState
value = 400
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = var(59) != 0
triggerall = P2bodydist X = [0,30]
trigger1 = P2statetype != A
trigger1 = Random = [0*var(59),40*var(59)]
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = Random = [0*var(59),50*var(59)]
trigger2 = stateno = 400
trigger2 = time > 7
trigger2 = movecontact
trigger3 = Random = [51*var(59),100*var(59)]
trigger3 = stateno = 200
trigger3 = movecontact

;---------------------------------------------------------------------------
;屈強P
[State -1, Crouching Strong Punch]
type = ChangeState
value = 410
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = var(59) != 0
triggerall = statetype != A
triggerall = P2bodydist X = [0,25]
trigger1 = Random = [0*var(59),70*var(59)]
trigger1 = ctrl
trigger1 = P2stateno != [5100,5110]
trigger2 = stateno = 210
trigger2 = animelemtime(5) > 0
trigger2 = movecontact
trigger3 = Random = [0*var(59),30*var(59)]
trigger3 = P2statetype = A
trigger3 = ctrl

;---------------------------------------------------------------------------
;飛び弱P
[State -1, Jump Light Punch]
type = ChangeState
value = 600
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = var(59) != 0
triggerall = Random = [51*var(59),100*var(59)]
trigger1 = P2bodydist X = [0,35]
trigger1 = stateno = 600
trigger1 = statetime >= 7
trigger2 = statetype = A
trigger2 = ctrl
trigger2 = P2statetype = A
trigger2 = P2bodydist X = [40,100]
trigger3 = statetype = A
trigger3 = stateno = 600
trigger3 = statetime >= 7
trigger3 = P2bodydist X = [15,150]

;---------------------------------------------------------------------------
;飛び強P
[State -1, Jump Strong Punch]
type = ChangeState
value = 610
triggerall = RoundState = 2
triggerall = P2statetype != L
triggerall = var(59) != 0
triggerall = Random = [0*var(59),50*var(59)]
trigger1 = statetype = A
trigger1 = ctrl
trigger1 = vel Y >= 0
trigger1 = P2bodydist X = [20,100]
trigger2 = Random = [0*var(59),100*var(59)]
trigger2 = P2bodydist X = [0,40]
trigger2 = stateno = 600
trigger2 = movecontact
trigger3 = statetype = A
trigger3 = ctrl
trigger3 = P2statetype = A
trigger3 = P2bodydist X = [0,60]
trigger3 = P2bodydist Y = [-20,30]

;---------------------------------------------------------------------------
[State -1, recover]
type = ChangeState
triggerall = RoundState = 2
triggerall = var(59) != 0
triggerall = Random = [0*var(59),80*var(59)]
triggerall = alive
trigger1 = (stateno = 5110) && time > 5
trigger2 = stateno = 5081
trigger3 = (stateno = 5100) && time > 3
trigger4 = stateno = 5101
value = 5211 

;---------------------------------------------------------------------------
[State -1, airG]
type = ChangeState
triggerall = RoundState = 2
triggerall = var(59) != 0
triggerall = Random = [0*var(59),100*var(59)]
triggerall = alive
trigger1 = stateno = 5040
value = 120