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

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

;----------------------------------------AIコマンド
[Command]
name = "AI0"
command = a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a
time = 0
[Command]
name = "AI1"
command = b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b
time = 0
[Command]
name = "AI2"
command = c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
time = 0
[Command]
name = "AI3"
command = x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time = 0
[Command]
name = "AI4"
command = y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time = 0
[Command]
name = "AI5"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
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 = c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
time = 0
[Command]
name = "AI13"
command = x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time = 0
[Command]
name = "AI14"
command = y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time = 0
[Command]
name = "AI15"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time = 0
[Command]
name = "AI16"
command = s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s
time = 0
[Command]
name = "AI17"
command = a,B,c,x,y,z,s,B,D,F,U,a,b,c,x,y,z,s,s
time = 0
[Command]
name = "AI18"
command = a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a
time = 0
[Command]
name = "AI19"
command = b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b
time = 0
[Command]
name = "AI20"
command = c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
time = 0
[Command]
name = "AI21"
command = x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time = 0
[Command]
name = "AI22"
command = y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time = 0
[Command]
name = "AI23"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time = 0
[Command]
name = "AI24"
command = s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s
time = 0
[Command]
name = "AI25"
command = F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F
time = 0
[Command]
name = "AI26"
command = D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D
time = 0
[Command]
name = "AI27"
command = B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B
time = 0
[Command]
name = "AI28"
command = U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U
time = 0
[Command]
name = "AI29"
command = a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a
time = 0
[Command]
name = "AI30"
command = c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c
time = 0
[Command]
name = "AI31"
command = x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
time = 0
[Command]
name = "AI32"
command = y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y,y
time = 0
[Command]
name = "AI33"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time = 0
[Command]
name = "AI34"
command = s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s
time = 0
[Command]
name = "AI35"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time = 0
[Command]
name = "AI36"
command = z,z,z,z,z,z,a,a,a,z,z,z,z,z,z,z,z,z,z
time = 0
[Command]
name = "AI37"
command = z,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,z,z,z
time = 0
[Command]
name = "AI38"
command = z,z,z,z,z,a,a,a,z,z,z,z,z,a,a,a,z,z,z
time = 0
[Command]
name = "AI39"
command = z,z,z,z,z,a,a,a,z,z,z,z,z,z,a,a,z,z,z
time = 0
[Command]
name = "AI40"
command = z,z,z,z,a,a,a,z,z,z,z,a,z,z,a,a,z,z,z
time = 0
[Command]
name = "AI41"
command = z,z,z,a,z,z,z,z,z,z,z,z,z,a,a,z,z,z,z
time = 0
[Command]
name = "AI42"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z
time = 0
[Command]
name = "AI43"
command = z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,z,a,a,z
time = 0
[Command]
name = "AI44"
command = z,z,a,a,a,a,z,z,z,z,z,z,z,z,z,a,a,a,z
time = 0
[Command]
name = "AI45"
command = z,z,z,z,z,z,a,a,z,z,z,z,z,a,a,a,a,z,z
time = 0
[Command]
name = "AI46"
command = z,z,z,z,z,z,z,z,a,a,a,a,a,a,z,z,z,z,z
time = 0
[Command]
name = "AI47"
command = z,z,z,a,a,a,a,z,z,z,z,z,z,z,z,z,z,z,z
time = 0
[Command]
name = "AI48"
command = z,z,z,z,z,a,a,a,z,z,z,a,a,a,z,z,a,z,a
time = 0
[Command]
name = "AI49"
command = z,z,z,z,a,a,a,z,z,z,z,z,a,a,a,z,z,z,z
time = 0
[Command]
name = "AI50"
command = z,z,z,a,a,z,z,z,z,z,z,z,z,z,a,a,z,z,z
time = 0

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

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

[Command]
name = "down_b"
command = /$D,b
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


; Don't remove the following line. It's required by the CMD standard.
[Statedef -1]

[State -1, ai] 
type = varset
triggerall = !Ishelper
triggerall = var(59) = 0 
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" 
trigger18 = Command = "AI17" 
trigger19 = Command = "AI18" 
trigger20 = Command = "AI19" 
trigger21 = Command = "AI20" 
trigger22 = Command = "AI21" 
trigger23 = Command = "AI22" 
trigger24 = Command = "AI23" 
trigger25 = Command = "AI24" 
trigger26 = Command = "AI25" 
trigger27 = Command = "AI26" 
trigger28 = Command = "AI27" 
trigger29 = Command = "AI28" 
trigger30 = Command = "AI29" 
trigger31 = Command = "AI30"  
trigger32 = Command = "AI31" 
trigger33 = Command = "AI32" 
trigger34 = Command = "AI33" 
trigger35 = Command = "AI34" 
trigger36 = Command = "AI35" 
trigger37 = Command = "AI36" 
trigger38 = Command = "AI37" 
trigger39 = Command = "AI38" 
trigger40 = Command = "AI39" 
trigger41 = Command = "AI40"
trigger42 = Command = "AI41" 
trigger43 = Command = "AI42" 
trigger44 = Command = "AI43" 
trigger45 = Command = "AI44"
trigger46 = Command = "AI45" 
trigger47 = Command = "AI46" 
trigger48 = Command = "AI47" 
trigger49 = Command = "AI48" 
trigger50 = Command = "AI49" 
trigger51 = Command = "AI50" 
;trigger52 = 1              
;↑「;」を取り除けば常時AI起動
var(59) = 1

;---------------------------------------------------------------------------
;ダッシュ
[State -1, Run Fwd]
type = Selfstate
value = 100
triggerall = var(59) = 0  && roundstate=2 && helper(10000),var(14)<14
trigger1 = command = "FF"
trigger1 = statetype != A
trigger1 = ctrl
[State -1, Run Fwd]
type = Selfstate
value = 110
triggerall = var(59) = 0  && roundstate=2 && helper(10000),var(14)<14
trigger1 = command = "FF"
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
;後退ダッシュ
[State -1, Run Back]
type = Selfstate
value = 105
triggerall = var(59) = 0  && roundstate=2 && helper(10000),var(14)<14
trigger1 = command = "BB"
trigger1 = statetype != A
trigger1 = ctrl
[State -1, Run Back]
type = Selfstate
value = 115
triggerall = var(59) = 0  && roundstate=2 && helper(10000),var(14)<14
trigger1 = command = "BB"
trigger1 = statetype = A
trigger1 = ctrl

;===========================================================================
;腕→腕→腕→足
;足はレバー前技
;足は必ず〆
;---------------------------------------------------------------------------

;立直
[State -1, riichi]
type = ChangeState
value = 800
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "z"
trigger1 = var(0)=0;立直まだしてない
trigger1 = helper(10000),var(0)!=0;聴牌中
trigger1 = helper(10000),var(38)=0;ポンチーなし
trigger1 = life>1000;1000点以上
trigger1 = statetype != A
trigger1 = ctrl

;チー
[State -1, chii]
type = ChangeState
value = 851
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = helper(10000),var(56)!=0 || helper(10000),var(57)!=0 || helper(10000),var(58)!=0 || helper(10000),var(59)!=0
triggerall = helper(10000),var(0)=0
triggerall = command = "z"
triggerall = life>0 && alive
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
trigger4 = stateno = 5070

;ポン
[State -1, pon]
type = ChangeState
value = 850
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = helper(10000),var(54)!=0 || helper(10000),var(55)!=0
triggerall = helper(10000),var(0)=0
triggerall = command = "z"
triggerall = life>0 && alive
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
trigger4 = stateno = 5070

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

;ダッシュ弱パンチ(肘)
[State -1, p1]
type = ChangeState
value = 500
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "a"
triggerall = command != "holddown"
trigger1 = stateno=100

;ダッシュ中パンチ(手刀)
[State -1, p1]
type = ChangeState
value = 510
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "b"
triggerall = command != "holddown"
trigger1 = stateno=100
trigger2 = stateno = 500
trigger2 = animelemtime(4)>2
trigger2 = movecontact

;ダッシュ強パンチ(両掌)
[State -1, p1]
type = ChangeState
value = 520
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "c"
triggerall = command != "holddown"
trigger1 = stateno=100
trigger2 = stateno = 500
trigger2 = animelemtime(4)>2
trigger2 = movecontact
trigger3 = stateno = 510
trigger3 = animelemtime(6)>2
trigger3 = movecontact

;ダッシュキック(凸蹴り)
[State -1, k1]
type = ChangeState
value = 550
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "a" || command = "b" || command = "c"
triggerall = command = "holdfwd"
triggerall = command != "holddown"
trigger1 = stateno = 500
trigger1 = animelemtime(4)>2
trigger1 = movecontact
trigger2 = stateno = 510
trigger2 = animelemtime(6)>2
trigger2 = movecontact
trigger3 = stateno = 520
trigger3 = animelemtime(6)>2
trigger3 = movecontact

;立ち弱パンチ(小パン)
[State -1, p1]
type = ChangeState
value = 200
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "a"
triggerall = command != "holdfwd"
triggerall = command != "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact

;立ち中パンチ(掌撃)
[State -1, p2]
type = ChangeState
value = 210
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "b"
triggerall = command != "holdfwd"
triggerall = command != "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact

;立ち強パンチ(鉄山コウ)
[State -1, p3]
type = ChangeState
value = 220
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "c"
triggerall = command != "holdfwd"
triggerall = command != "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = animelemtime(5)>2
trigger3 = movecontact

;立ちキック(蹴り上げ)
[State -1, k1]
type = ChangeState
value = 250
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "a" || command = "b" || command = "c"
triggerall = command = "holdfwd"
triggerall = command != "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = animelemtime(5)>2
trigger3 = movecontact
trigger4 = stateno = 220
trigger4 = animelemtime(8)>2
trigger4 = movecontact

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

;屈み弱パンチ(小パン)
[State -1, p1]
type = ChangeState
value = 300
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "a"
triggerall = command != "holdfwd"
triggerall = command = "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 300
trigger2 = animelemtime(3)>2
trigger2 = movecontact

;屈み中パンチ(手刀)
[State -1, p2]
type = ChangeState
value = 310
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "b"
triggerall = command != "holdfwd"
triggerall = command = "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 300
trigger2 = animelemtime(3)>2
trigger2 = movecontact

;屈み強パンチ(震脚)
[State -1, p3]
type = ChangeState
value = 320
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "c"
triggerall = command != "holdfwd"
triggerall = command = "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 300
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 310
trigger3 = animelemtime(3)>2
trigger3 = movecontact

;屈みキック(下段蹴り)
[State -1, k1]
type = ChangeState
value = 350
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "a" || command = "b" || command = "c"
triggerall = command = "holdfwd"
triggerall = command = "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 300
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 310
trigger3 = animelemtime(3)>2
trigger3 = movecontact
trigger4 = stateno = 320
trigger4 = animelemtime(6)>2
trigger4 = movecontact

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

;空中キック(拍脚)
[State -1, k3]
type = ChangeState
value = 470
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "a"
trigger1 = stateno=110

;空ダキック(前蹴り)
[State -1, k2]
type = ChangeState
value = 480
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "b"
trigger1 = stateno=110

;空ダキック(斜め上蹴り)
[State -1, k2]
type = ChangeState
value = 460
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "c"
trigger1 = stateno=110

;空中弱パンチ(連パン)
[State -1, p1]
type = ChangeState
value = 400
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "a"
triggerall = command != "holdfwd"
trigger1 = statetype = A
trigger1 = ctrl

;空中中パンチ(掌撃)
[State -1, p2]
type = ChangeState
value = 410
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "b"
triggerall = command != "holdfwd"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 400
trigger2 = animelemtime(6)>2
trigger2 = movecontact

;空中中パンチ(手刀)
[State -1, p3]
type = ChangeState
value = 420
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "c"
triggerall = command != "holdfwd"
trigger1 = statetype = A
trigger1 = ctrl

;空中キック(蹴り上げ)
[State -1, k1]
type = ChangeState
value = 450
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "a" || command = "b" || command = "c"
triggerall = command = "holdfwd"
trigger1 = statetype = A
trigger1 = ctrl


;---------------------------------------------------------------------------
;揚炮撃
[State -1, s1]
type = ChangeState
value = 1000
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "x"
triggerall = command != "holdfwd"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = animelemtime(5)>2
trigger3 = movecontact
trigger4 = stateno = 220
trigger4 = animelemtime(8)>2
trigger4 = movecontact
trigger5 = stateno = 300
trigger5 = animelemtime(3)>2
trigger5 = movecontact
trigger6 = stateno = 310
trigger6 = animelemtime(3)>2
trigger6 = movecontact
trigger7 = stateno = 320
trigger7 = animelemtime(6)>2
trigger7 = movecontact
trigger8 = stateno = 300
trigger8 = animelemtime(3)>2
trigger8 = movecontact
trigger9 = stateno = 310
trigger9 = animelemtime(3)>2
trigger9 = movecontact
trigger10 = stateno = 320
trigger10 = animelemtime(6)>2
trigger10 = movecontact
trigger11 = stateno = 500
trigger11 = animelemtime(4)>2
trigger11 = movecontact
trigger12 = stateno = 510
trigger12 = animelemtime(6)>2
trigger12 = movecontact
trigger13 = stateno = 520
trigger13 = animelemtime(6)>2
trigger13 = movecontact

;連靠撃
[State -1, s2]
type = ChangeState
value = 1010
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "y"
triggerall = command != "holdfwd"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = animelemtime(5)>2
trigger3 = movecontact
trigger4 = stateno = 220
trigger4 = animelemtime(8)>2
trigger4 = movecontact
trigger5 = stateno = 300
trigger5 = animelemtime(3)>2
trigger5 = movecontact
trigger6 = stateno = 310
trigger6 = animelemtime(3)>2
trigger6 = movecontact
trigger7 = stateno = 320
trigger7 = animelemtime(6)>2
trigger7 = movecontact
trigger8 = stateno = 300
trigger8 = animelemtime(3)>2
trigger8 = movecontact
trigger9 = stateno = 310
trigger9 = animelemtime(3)>2
trigger9 = movecontact
trigger10 = stateno = 320
trigger10 = animelemtime(6)>2
trigger10 = movecontact
trigger11 = stateno = 500
trigger11 = animelemtime(4)>2
trigger11 = movecontact
trigger12 = stateno = 510
trigger12 = animelemtime(6)>2
trigger12 = movecontact
trigger13 = stateno = 520
trigger13 = animelemtime(6)>2
trigger13 = movecontact

;寸勁撃
[State -1, s3]
type = ChangeState
value = 1020
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "x"
triggerall = command = "holdfwd"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = animelemtime(5)>2
trigger3 = movecontact
trigger4 = stateno = 220
trigger4 = animelemtime(8)>2
trigger4 = movecontact
trigger5 = stateno = 300
trigger5 = animelemtime(3)>2
trigger5 = movecontact
trigger6 = stateno = 310
trigger6 = animelemtime(3)>2
trigger6 = movecontact
trigger7 = stateno = 320
trigger7 = animelemtime(6)>2
trigger7 = movecontact
trigger8 = stateno = 300
trigger8 = animelemtime(3)>2
trigger8 = movecontact
trigger9 = stateno = 310
trigger9 = animelemtime(3)>2
trigger9 = movecontact
trigger10 = stateno = 320
trigger10 = animelemtime(6)>2
trigger10 = movecontact
trigger11 = stateno = 500
trigger11 = animelemtime(4)>2
trigger11 = movecontact
trigger12 = stateno = 510
trigger12 = animelemtime(6)>2
trigger12 = movecontact
trigger13 = stateno = 520
trigger13 = animelemtime(6)>2
trigger13 = movecontact

;冲捶撃
[State -1, s3]
type = ChangeState
value = 1030
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "y"
triggerall = command = "holdfwd"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = animelemtime(5)>2
trigger3 = movecontact
trigger4 = stateno = 220
trigger4 = animelemtime(8)>2
trigger4 = movecontact
trigger5 = stateno = 300
trigger5 = animelemtime(3)>2
trigger5 = movecontact
trigger6 = stateno = 310
trigger6 = animelemtime(3)>2
trigger6 = movecontact
trigger7 = stateno = 320
trigger7 = animelemtime(6)>2
trigger7 = movecontact
trigger8 = stateno = 300
trigger8 = animelemtime(3)>2
trigger8 = movecontact
trigger9 = stateno = 310
trigger9 = animelemtime(3)>2
trigger9 = movecontact
trigger10 = stateno = 320
trigger10 = animelemtime(6)>2
trigger10 = movecontact
trigger11 = stateno = 500
trigger11 = animelemtime(4)>2
trigger11 = movecontact
trigger12 = stateno = 510
trigger12 = animelemtime(6)>2
trigger12 = movecontact
trigger13 = stateno = 520
trigger13 = animelemtime(6)>2
trigger13 = movecontact

;大纏撃
[State -1, s3]
type = ChangeState
value = 1040
triggerall = var(59)=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = command = "z"
triggerall = stateno=[150,153]
trigger1 = statetype != A


;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------ここからAI
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;ダッシュ
[State -1, Run Fwd]
type = Selfstate
value = 100
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
;trigger1 = helper(10010),var(0)=0
trigger1 = p2bodydist x >140 || Prevstateno=1010
trigger1 = statetype != A
trigger1 = ctrl
[State -1, Run Fwd]
type = Selfstate
value = 110
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
;trigger1 = helper(10010),var(0)=0
trigger1 = p2bodydist x >140
trigger1 = statetype = A
trigger1 = ctrl

;---------------------------------------------------------------------------
;後退ダッシュ
[State -1, Run Back]
type = Selfstate
value = 105
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
trigger1 = command = "BB"
trigger1 = statetype != A
trigger1 = ctrl
[State -1, Run Back]
type = Selfstate
value = 115
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
trigger1 = command = "BB"
trigger1 = statetype = A
trigger1 = ctrl

;===========================================================================
;腕→腕→腕→足
;足はレバー前技
;足は必ず〆
;---------------------------------------------------------------------------

;立直
[State -1, riichi]
type = ChangeState
value = 800
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14
triggerall = var(0)=0;立直まだしてない
triggerall = helper(10000),var(0)!=0;聴牌中
triggerall = helper(10000),var(38)=0;ポンチーなし
triggerall = life>1000;1000点以上
triggerall = statetype != A
triggerall = helper(10000),var(1)<4
triggerall = helper(10000),var(2)<4
triggerall = helper(10000),var(3)<4
triggerall = helper(10000),var(4)<4
triggerall = helper(10000),var(5)<4
triggerall = helper(10000),var(6)<4
triggerall = helper(10000),var(7)<4
triggerall = helper(10000),var(8)<4
triggerall = helper(10000),var(9)<4
triggerall = helper(10000),var(10)<4
triggerall = helper(10000),var(11)<4
triggerall = helper(10000),var(12)<4
triggerall = helper(10000),var(13)<4
triggerall = helper(10000),var(14)<4
triggerall = helper(10000),var(15)<4
triggerall = helper(10000),var(16)<4
triggerall = helper(10000),var(17)<4
triggerall = helper(10000),var(18)<4
triggerall = helper(10000),var(19)<4
triggerall = helper(10000),var(20)<4
triggerall = helper(10000),var(21)<4
triggerall = helper(10000),var(22)<4
triggerall = helper(10000),var(23)<4
triggerall = helper(10000),var(24)<4
triggerall = helper(10000),var(25)<4
triggerall = helper(10000),var(26)<4
triggerall = helper(10000),var(27)<4
triggerall = helper(10000),var(28)<4
triggerall = helper(10000),var(29)<4
triggerall = helper(10000),var(30)<4
triggerall = helper(10000),var(31)<4
triggerall = helper(10000),var(32)<4
triggerall = helper(10000),var(33)<4
triggerall = helper(10000),var(34)<4
trigger1 = ctrl

;チー
[State -1, chii]
type = ChangeState
value = 851
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = helper(10000),var(56)!=0 || helper(10000),var(57)!=0 || helper(10000),var(58)!=0 || helper(10000),var(59)!=0
triggerall = helper(10000),var(0)=0
triggerall = life <= Gethitvar(damage) || var(58)>300
triggerall = life>0 && alive
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
trigger4 = stateno = 5070

;ポン
[State -1, pon]
type = ChangeState
value = 850
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = helper(10000),var(54)!=0 || helper(10000),var(55)!=0
triggerall = helper(10000),var(0)=0
triggerall = life <= Gethitvar(damage) || var(58)>300
triggerall = life>0 && alive
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
trigger4 = stateno = 5070

;---------------------------------------------------------------------------
;揚炮撃
[State -1, s1]
type = ChangeState
value = 1000
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = helper(10010),var(0)=1
triggerall = inguarddist || enemynear,HitDefAttr=SCA,AA,AT,AP
triggerall = P2bodydist x =[0,35]
trigger1 = P2bodydist x =[30,35]
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = animelemtime(5)>2
trigger3 = movecontact
trigger4 = stateno = 220
trigger4 = animelemtime(8)>2
trigger4 = movecontact
trigger5 = stateno = 300
trigger5 = animelemtime(3)>2
trigger5 = movecontact
trigger6 = stateno = 310
trigger6 = animelemtime(3)>2
trigger6 = movecontact
trigger7 = stateno = 320
trigger7 = animelemtime(6)>2
trigger7 = movecontact
trigger8 = stateno = 300
trigger8 = animelemtime(3)>2
trigger8 = movecontact
trigger9 = stateno = 310
trigger9 = animelemtime(3)>2
trigger9 = movecontact
trigger10 = stateno = 320
trigger10 = animelemtime(6)>2
trigger10 = movecontact
trigger11 = stateno = 500
trigger11 = animelemtime(4)>2
trigger11 = movecontact
trigger12 = stateno = 510
trigger12 = animelemtime(6)>2
trigger12 = movecontact
trigger13 = stateno = 520
trigger13 = animelemtime(6)>2
trigger13 = movecontact

;闖歩撃
[State -1, s2]
type = ChangeState
value = 1010
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist y =[-40,0]
triggerall = P2bodydist x =[40,105]
trigger1 = P2bodydist x !=[80,90]
trigger1 = !inguarddist
trigger1 = helper(10010),var(0)=0
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = animelemtime(5)>2
trigger3 = movecontact
trigger4 = stateno = 220
trigger4 = animelemtime(8)>2
trigger4 = movecontact
trigger5 = stateno = 300
trigger5 = animelemtime(3)>2
trigger5 = movecontact
trigger6 = stateno = 310
trigger6 = animelemtime(3)>2
trigger6 = movecontact
trigger7 = stateno = 320
trigger7 = animelemtime(6)>2
trigger7 = movecontact
trigger8 = stateno = 300
trigger8 = animelemtime(3)>2
trigger8 = movecontact
trigger9 = stateno = 310
trigger9 = animelemtime(3)>2
trigger9 = movecontact
trigger10 = stateno = 320
trigger10 = animelemtime(6)>2
trigger10 = movecontact
trigger11 = stateno = 500
trigger11 = animelemtime(4)>2
trigger11 = movecontact
trigger12 = stateno = 510
trigger12 = animelemtime(6)>2
trigger12 = movecontact
trigger13 = stateno = 520
trigger13 = animelemtime(6)>2
trigger13 = movecontact

;寸勁撃
[State -1, s3]
type = ChangeState
value = 1020
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x =[0,10]
triggerall = enemynear,statetype!=A
trigger1 = !numtarget
trigger1 = !inguarddist
trigger1 = statetype != A
trigger1 = helper(10010),var(0)=0
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = moveguarded
trigger3 = stateno = 210
trigger3 = animelemtime(5)>2
trigger3 = moveguarded
trigger4 = stateno = 220
trigger4 = animelemtime(8)>2
trigger4 = moveguarded
trigger5 = stateno = 300
trigger5 = animelemtime(3)>2
trigger5 = moveguarded
trigger6 = stateno = 310
trigger6 = animelemtime(3)>2
trigger6 = moveguarded
trigger7 = stateno = 320
trigger7 = animelemtime(6)>2
trigger7 = moveguarded
trigger8 = stateno = 300
trigger8 = animelemtime(3)>2
trigger8 = moveguarded
trigger9 = stateno = 310
trigger9 = animelemtime(3)>2
trigger9 = moveguarded
trigger10 = stateno = 320
trigger10 = animelemtime(6)>2
trigger10 = moveguarded
trigger11 = stateno = 500
trigger11 = animelemtime(4)>2
trigger11 = moveguarded
trigger12 = stateno = 510
trigger12 = animelemtime(6)>2
trigger12 = moveguarded
trigger13 = stateno = 520
trigger13 = animelemtime(6)>2
trigger13 = moveguarded

;冲捶撃
[State -1, s3]
type = ChangeState
value = 1030
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x =[30,130]
triggerall = enemynear,statetype!=A
trigger1 = inguarddist
trigger1 = statetype != A
trigger1 = helper(10010),var(0)=0
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = animelemtime(5)>2
trigger3 = movecontact
trigger4 = stateno = 220
trigger4 = animelemtime(8)>2
trigger4 = movecontact
trigger5 = stateno = 300
trigger5 = animelemtime(3)>2
trigger5 = movecontact
trigger6 = stateno = 310
trigger6 = animelemtime(3)>2
trigger6 = movecontact
trigger7 = stateno = 320
trigger7 = animelemtime(6)>2
trigger7 = movecontact
trigger8 = stateno = 300
trigger8 = animelemtime(3)>2
trigger8 = movecontact
trigger9 = stateno = 310
trigger9 = animelemtime(3)>2
trigger9 = movecontact
trigger10 = stateno = 320
trigger10 = animelemtime(6)>2
trigger10 = movecontact
trigger11 = stateno = 500
trigger11 = animelemtime(4)>2
trigger11 = movecontact
trigger12 = stateno = 510
trigger12 = animelemtime(6)>2
trigger12 = movecontact
trigger13 = stateno = 520
trigger13 = animelemtime(6)>2
trigger13 = movecontact

;大纏撃
[State -1, s3]
type = ChangeState
value = 1040
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = helper(10010),var(0)=1 || P2dist x =[0,50]
triggerall = enemynear,statetype!=A
triggerall = stateno=[150,153]
trigger1 = statetype != A

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

;ダッシュ弱パンチ(肘)
[State -1, p1]
type = ChangeState
value = 500
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = stateno=100
trigger1 = P2bodydist x = [-10,40]
trigger2 = helper(10010),var(0)=1

;ダッシュ中パンチ(手刀)
[State -1, p1]
type = ChangeState
value = 510
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-10,50]
trigger1 = stateno=100
trigger2 = stateno = 500
trigger2 = animelemtime(4)>2
trigger2 = movecontact

;ダッシュ強パンチ(両掌)
[State -1, p1]
type = ChangeState
value = 520
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-80,80]
trigger1 = helper(10010),var(0)=0
trigger1 = stateno=100
trigger2 = stateno = 500
trigger2 = animelemtime(4)>2
trigger2 = movecontact
trigger3 = stateno = 510
trigger3 = animelemtime(6)>2
trigger3 = movecontact

;ダッシュキック(凸蹴り)
[State -1, k1]
type = ChangeState
value = 550
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-10,65]
triggerall = command != "holddown"
trigger1 = stateno = 500
trigger1 = animelemtime(4)>2
trigger1 = movecontact
trigger2 = stateno = 510
trigger2 = animelemtime(6)>2
trigger2 = movecontact
trigger3 = stateno = 520
trigger3 = animelemtime(6)>2
trigger3 = movecontact

;立ち弱パンチ(小パン)
[State -1, p1]
type = ChangeState
value = 200
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-10,25]
triggerall = P2bodydist y = [-60,0]
triggerall = var(0)=0
trigger1 = command != "holddown" && enemynear,statetype!=C
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = P2bodydist x = [-10,5]
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact

;立ち中パンチ(掌撃)
[State -1, p2]
type = ChangeState
value = 210
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-5,35]
triggerall = enemynear,statetype!=A
trigger1 = command != "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact

;立ち強パンチ(鉄山コウ)
[State -1, p3]
type = ChangeState
value = 220
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [0,35]
triggerall = enemynear,statetype!=A
trigger1 = command != "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = animelemtime(5)>2
trigger3 = movecontact

;立ちキック(蹴り上げ)
[State -1, k1]
type = ChangeState
value = 250
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-10,35]
triggerall = P2bodydist y = [-100,0]
triggerall = enemynear,statetype=A
trigger1 = command != "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 210
trigger3 = animelemtime(5)>2
trigger3 = movecontact
trigger4 = stateno = 220
trigger4 = animelemtime(8)>2
trigger4 = movecontact

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

;屈み弱パンチ(小パン)
[State -1, p1]
type = ChangeState
value = 300
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = enemynear,statetype!=A
triggerall = var(0)=0
trigger1 = command = "holddown" || enemynear,statetype=C
trigger1 = helper(10010),var(0)=1 || P2bodydist x = [-10,25]
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = P2bodydist x = [-10,5]
trigger2 = stateno = 300
trigger2 = animelemtime(3)>2
trigger2 = movecontact

;屈み中パンチ(手刀)
[State -1, p2]
type = ChangeState
value = 310
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-10,35]
triggerall = P2bodydist y = [-70,0]
trigger1 = command = "holddown"
trigger1 = statetype != A
trigger1 = enemynear,statetype=A
trigger1 = ctrl
trigger2 = stateno = 300
trigger2 = animelemtime(3)>2
trigger2 = movecontact

;屈み強パンチ(震脚)
[State -1, p3]
type = ChangeState
value = 320
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-40,40]
triggerall = enemynear,statetype!=A
triggerall = helper(10010),var(0)=0
trigger1 = command = "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 300
trigger2 = animelemtime(3)>2
trigger2 = movecontact
trigger3 = stateno = 310
trigger3 = animelemtime(3)>2
trigger3 = movecontact

;屈みキック(下段蹴り)
[State -1, k1]
type = ChangeState
value = 350
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [40,60]
triggerall = enemynear,statetype!=A
triggerall = helper(10010),var(0)=0
trigger1 = command = "holddown"
trigger1 = statetype != A
trigger1 = ctrl
trigger2 = stateno = 300
trigger2 = animelemtime(3)>2
trigger2 = moveguarded
trigger3 = stateno = 310
trigger3 = animelemtime(3)>2
trigger3 = moveguarded
trigger4 = stateno = 320
trigger4 = animelemtime(6)>2
trigger4 = moveguarded

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

;空中キック(拍脚)
[State -1, k3]
type = ChangeState
value = 470
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-10,120]
triggerall = enemynear,statetype!=A
trigger1 = stateno=110

;空ダキック(前蹴り)
[State -1, k2]
type = ChangeState
value = 480
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-10,60]
triggerall = P2bodydist y = [-20,30]
triggerall = enemynear,statetype=A
trigger1 = stateno=110

;空ダキック(斜め上蹴り)
[State -1, k2]
type = ChangeState
value = 460
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-10,50]
triggerall = P2bodydist y <-20
triggerall = enemynear,statetype=A
trigger1 = stateno=110

;空中弱パンチ(連パン)
[State -1, p1]
type = ChangeState
value = 400
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-30,30]
triggerall = vel y <0
trigger1 = statetype = A
trigger1 = ctrl

;空中中パンチ(掌撃)
[State -1, p2]
type = ChangeState
value = 410
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-10,30]
triggerall = P2bodydist y = [-20,20]
triggerall = vel y >0
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 400
trigger2 = animelemtime(6)>2
trigger2 = movecontact

;空中中パンチ(手刀)
[State -1, p3]
type = ChangeState
value = 420
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-10,60]
triggerall = vel y >0
trigger1 = statetype = A
trigger1 = ctrl

;空中キック(蹴り上げ)
[State -1, k1]
type = ChangeState
value = 450
triggerall = var(59)!=0 && roundstate=2 && helper(10000),var(14)<14 && enemynear,statetype!=L
triggerall = P2bodydist x = [-10,35]
triggerall = P2bodydist y = [-70,20]
triggerall = vel y <0
trigger1 = statetype = A
trigger1 = ctrl


