;-------------------------------------------------------------------------------
;_________________________________
;
;ヘルパー真ん中
;_________________________________

[statedef 40000]
ctrl=0
anim = 8009
;var(0) 相手のfall時最低空高さ学習
;fvar(0)-fvar(1) 相手のfall時最低空高さ学習

[State 40000,間違いで本体が来たら立ちへ移行]
type=selfstate
trigger1=!ishelper
value=0

[state 40000,一応無敵]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 40000,一応無敵]
type = width
trigger1 = 1
value = 0,0
ignorehitpause = 1

[state 40000]
type = parentvarset
trigger1 = frontedgedist + 15 > root,fvar(36)
fvar(36) = frontedgedist + 15
ignorehitpause = 1

[state 40000]
type = parentvarset
trigger1 = backedgedist + 15  > root,fvar(35)
fvar(35) = backedgedist + 15
ignorehitpause = 1

[state 40000,見えなくしとく 振り向かせない]
type = AssertSpecial
trigger1 = 1
flag = invisible


[state 40000]
type = varset
trigger1 = enemynear,stateno = 5050
fvar(0) = enemynear,pos y
ignorehitpause = 1

[state 40000]
type = varset
trigger1 = time = 0
fvar(1) = ifelse((parent,var(42) = 0),25,ifelse((parent,var(42) = 1),19,ifelse((parent,var(42) = 2),9,1)))
ignorehitpause = 1
persistent = 0

[state 40000]
type = varset
trigger1 = enemynear,stateno = [5100,5120]
trigger1 = enemynear,prevstateno = 5050
trigger1 = fvar(0) < fvar(1)
fvar(1) = fvar(0)
ignorehitpause = 1

[state 40000]
type = null
triggerall = time > 0
trigger1 = fvar(1) <= 20
trigger1 = var(0) := 0
trigger2 = fvar(1) = [10,20)
trigger2 = var(0) := 1
trigger3 = fvar(1) = [0,10)
trigger3 = var(0) := 2
trigger4 = fvar(1) < 0
trigger4 = var(0) := 3
ignorehitpause = 1

[state 40000]
type = parentvarset
trigger1 = numenemy = 1
var(42) = var(0)

;================
;さーて学習学習♪
;================
[state 20000]
type = Null
triggerall = parent,var(41)
triggerall = enemynear,movetype = A || enemynear,stateno = [50,119]
triggerall = numenemy = 1
trigger1 = var(59) = 0 && var(58) = 0
trigger1 = var(59) := enemynear,stateno
trigger1 = var(58) := enemynear,numhelper + enemynear,numproj
ignorehitpause = 1
;-------------------------

[state 20000];屈中
type = Null
triggerall = parent,var(41) = 1
triggerall = parent,movetype = H
triggerall = parent,time > 0 && parent,stateno != 6000
triggerall = var(59)
trigger1 = var(40) = 0 && var(39) = 0
trigger1 = var(40) := var(59)
trigger1 = var(39) := var(58)
trigger2 = var(40)
trigger2 = var(40) != var(59)
trigger2 = var(38) = 0 && var(37) = 0
trigger2 = var(38) := var(59)
trigger2 = var(37) := var(58)
ignorehitpause = 1

[state 20000];屈中
type = Null
triggerall = parent,var(41) = 1
triggerall = parent,movetype = H
triggerall = parent,time > 0 && parent,stateno != 6000
triggerall = var(59)
trigger1 = var(40)
trigger1 = var(39) > var(58)
trigger1 = var(39) := var(58)
trigger2 = var(38)
trigger2 = var(37) > var(58)
trigger2 = var(37) := var(58)
ignorehitpause = 1

;-----------------------------
[state 20000]
type = Varset
triggerall = var(59)
trigger1 = !parent,var(41)
var(59) = 0
ignorehitpause = 1

[state 20000]
type = Varset
triggerall = var(58)
trigger1 = !parent,var(41)
var(58) = 0
ignorehitpause = 1


;----------------------------------------------------------
;落下してくるやつ測定
[state 20000]
type = varset
triggerall = root,var(59)>0
triggerall = var(22) >=0
trigger1 = enemy,movetype = A || enemy,ctrl = 0
trigger1 = !enemy,hitdefattr = SCA,AA,AT,AP
trigger1 = enemy,animelemno(0)<var(22)
var(22) = -2

[state 20000]
type = varset
triggerall = root,var(59)>0
triggerall = var(22)>=0
trigger1 = enemy,movetype = A || enemy,ctrl = 0
trigger1 = !enemy,hitdefattr = SCA,AA,AT,AP
trigger1 = enemy,animelemno(0)>var(22)
var(22) = enemy,animelemno(0)

[state 20000]
type = varset
triggerall = root,var(59)>0
triggerall = var(22) = 1
trigger1 = enemy,hitdefattr = SCA,AA,AT,AP
trigger2 = enemy,time = 0
var(22) = 0


[State -2];デバッグ表示
type = null;DisplayToClipBoard
trigger1 = 1
text = " fv0 = %f , fv1 = %f ,v0 = %d\n"
params =  fvar(0),fvar(1),var(0)
ignorehitpause = 1
[State -2];デバッグ表示
type = DisplayToClipBoard
trigger1 = 1
text = " v40 = %d , v39 = %d ,v38 = %d , v37=%d\n"
params =  var(40),var(39),var(38),var(37)
ignorehitpause = 1



;______________________________

;ヘルパーめくり
;______________________________
[statedef 40001]
ctrl=0
anim=8009
;var(40)-var(59) 対人用めくり記憶


[state 20000]
type = assertspecial
trigger1 = ishelper
flag = invisible

[state 20000]
type = nothitby
trigger1 = 1
value = SCA

[State 20000,間違いで本体が来たら立ちへ移行]
type=selfstate
trigger1=!ishelper
value=0

[state 20000]
type = turn
trigger1 = facing = enemynear,facing

[state 20000]
type = posset
trigger1 = root,alive
x = root,pos x + (enemynear,facing)*80
y = root,pos y - 60

;------------------------------------------------------------------------------
;なんかいっぱい変数使ってるけど正直ここから下の記述は変数６つで事足りるんだよね
;------------------------------------------------------------------------------
;対人用めくり
[state 40001]
type = varset
trigger1 = 1
var(59) = var(58)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(58) = var(57)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(57) = var(56)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(56) = var(55)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(55) = var(54)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(54) = var(53)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(53) = var(52)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(52) = var(51)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(51) = var(50)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(50) = var(49)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(49) = var(48)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(48) = var(47)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(47) = var(46)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(46) = var(45)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(45) = var(44)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(44) = var(43)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(43) = var(42)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(42) = var(41)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(41) = var(40)
ignorehitpause = 1
[state 40001]
type = varset
trigger1 = 1
var(40) = ifelse((root,pos x < enemynear,pos x), 1 , -1)
ignorehitpause = 1

;----------------------------------------------------------------------
;投げ学習
[state 40001]
type = null
triggerall = enemynear,stateno >= 900
trigger1 = !var(0)
trigger1 = enemynear,hitdefattr = SC,AT
trigger1 = var(0) := enemynear,stateno
trigger2 = var(0)
trigger2 = enemynear,stateno !=var(0) 
trigger2 = !var(1)
trigger2 = enemynear,hitdefattr = SC,AT
trigger2 = var(1) := enemynear,stateno
trigger3 = var(0) && var(1)
trigger3 = enemynear,stateno !=var(0) 
trigger3 = enemynear,stateno !=var(1) 
trigger3 = !var(2)
trigger3 = enemynear,hitdefattr = SC,AT
trigger3 = var(2) := enemynear,stateno
trigger4 = var(0) && var(1) && var(2)
trigger4 = enemynear,stateno !=var(0) 
trigger4 = enemynear,stateno !=var(1) 
trigger4 = enemynear,stateno !=var(2) 
trigger4 = !var(3)
trigger4 = enemynear,hitdefattr = SC,AT
trigger4 = var(3) := enemynear,stateno
trigger5 = var(0) && var(1) && var(2) && var(3)
trigger5 = enemynear,stateno !=var(0) 
trigger5 = enemynear,stateno !=var(1) 
trigger5 = enemynear,stateno !=var(2) 
trigger5 = enemynear,stateno !=var(3) 
trigger5 = !var(4)
trigger5 = enemynear,hitdefattr = SC,AT
trigger5 = var(4) := enemynear,stateno
ignorehitpause = 1


[State -2];デバッグ表示
type = DisplayToClipBoard
trigger1 = 1
text = " v0=%d ,v1=%d ,v2=%d ,v3=%d,v4=%d \n"
params =  var(0),var(1),var(2),var(3),var(4)
ignorehitpause = 1
supermovetime = 9999
pausemovetime = 9999

[State -2];デバッグ表示
type = AppendToClipBoard
trigger1 = 0
text = " v10 = %d , v11 = %d , v12=%d"
params = var(10) , var(11) ,var(12)
ignorehitpause = 1












;______________________________

;ヘルパー飛び道具
;______________________________
[statedef 40002]
ctrl=0
anim=8009
;var(0) attackdist設定把握用

[state 20000]
type = assertspecial
trigger1 = ishelper
flag = invisible

[state 20000]
type = nothitby
trigger1 = 1
value = SCA

[State 20000,間違いで本体が来たら立ちへ移行]
type=selfstate
trigger1=!ishelper
value=0

[state 20000]
type = turn
trigger1 = facing != root,facing

[state 20000]
type = posset
trigger1 = root,alive
x = root,pos x + 90
y = root,pos y - 60

;-----------------------------------------------------------------------------------------------------
;attackdist
;-----------------------------------------------------------------------------------------------------

;興味本位で見てる方へattackdistの説明
;攻撃する側(以下甲とする)の各種攻撃にはattackdistというパラメータが設けられています
;このパラメータは攻撃される側(以下乙)と甲との中心軸距離がattackdistで設定された値よりも近い場合、
;乙のinguarddistというトリガーが成立します。
;基本的にAIにガードをさせる場合、inguarddistをトリガーとして用いることが多く、このトリガーが成立しなければガードできないとも言えます。
;デフォルトでは、本体およびヘルパーの攻撃の場合のattackdistは160ドット、projectileの場合は90ドットです。
;つまりこの距離より離れた位置から攻撃した場合、AIはガードできないと考えてほぼ差し支えありません。
;ビーム系の攻撃がやたらとAIに対して有効なのは発生の早さよりもattackdistの設定が短いのがほとんどなわけです。
;人操作の場合は後ろ方向に入力しておくとattackdist外でもガードできるんですけどね。
;と、ここまで読めばわかるとおりattackdistはAI用のパラメータのようなもので人操作では設定されていなくても問題ありません。
;なのでAI戦前提で作っていない限りはガードするに十分な値に設定されていないことの方が普通であるようです。

;attackdistが十分な値に設定されているかされていないかはトレーニングモードで簡単に分かります
;まず相手をAutoでガードさせるようにします。あとは少しづつ離れながら攻撃して行き、攻撃が届かなくなるところまでやって終了です。
;attackdistが十分な値に設定されていれば全てガードしますが設定されていない攻撃の場合、ある距離を超えたところでガードしなくなります。


;attackdistの設定の仕方
;[state 1000]
;type = attackdist
;trigger1 = 1
;value = 320
;該当するステートにコピペでおｋ。ちなみにこれだと全画面ガード可、全部これだと相手がAIならガッチガチに固まる可能性あり、適量をセットしましょう。


[state -3]
type = varset
var(0) = 0
trigger1 = enemynear,time <= 1 || enemynear,animtime >= 0
trigger2 = gametime%25 = 0

[state -3]
type = varset
var(0) = 1
triggerall = !var(0)
trigger1 = enemynear,authorname = "muteki"&&  p2name = "sol"
trigger1 = (p2stateno = [235,236]) ;10立6HS
trigger2 = enemynear,authorname = "muteki"&& p2name = "justice"
trigger2 = (p2stateno = [225,236])|| p2stateno = 450 || p2stateno = 610  ;20立S,20立HS,50立6HS,15屈D,20空K
trigger3 = enemynear,authorname = "muteki"&& p2name = "justice"
trigger3 = (p2stateno = [1000,1012]) || p2stateno = 3100 || p2stateno = 3200 ;40ミカエルソード,160インペリアルレイ,160ミカエルブレード
trigger4 = enemynear,authorname = "muteki"&& p2name = "testament"
trigger4 = p2stateno = 225 || p2stateno = 235 ||p2stateno = 3100 ;40立遠S,50立6HS,30マスターオブなんとか
trigger5 = enemynear,authorname = "muteki"&& p2name = "eddie"
trigger5 = (p2stateno = [225,228]) || p2stateno = 420 ;15立遠S,20屈S
trigger6 = enemynear,authorname = "muteki"&& p2name = "axl"
trigger6 = p2stateno = 400 || p2stateno = 430 || p2stateno = 1500;
trigger7 = enemynear,authorname = "muteki"&& p2name = "Faust"
trigger7 = p2stateno = 225 || p2stateno = 430 ;

trigger8 = enemynear,authorname = "Sander71113"&& p2name = "Goro Daimon"
trigger8 = p2stateno = [1000,1005]

[state -3]
type = varset
var(0) = 1
triggerall = !var(0)
trigger1 = enemynear,authorname = "MGMURROW" && p2name = "Hulk"
trigger1 = p2stateno = 200 || p2stateno = 3500 ;弱P,160ガンマアースシェイク
trigger2 = enemynear,authorname = "Hulk" && p2name = "Hulk"|| enemynear,authorname = "One Winged Angel" && p2name = "hulk"
trigger2 = p2stateno = 210 || p2stateno = 220;20中P,100強P
trigger3 = enemynear,authorname = "Magneto" && p2name = "Magneto"
trigger3 = p2stateno = [1260,1270];160E-Mディスラプター
trigger4 = enemynear,authorname = "Ironman" && p2name = "Ironman"
trigger4 = p2stateno = [1240,1260];160Uniビーム
trigger5 = enemynear,authorname = "Iceman" && p2name = "Iceman"
trigger5 = p2stateno = [1240,1260];140アイスビーム
trigger6 = enemynear,authorname = "BlackHeart" && p2name = "BlackHeart"
trigger6 = p2stateno = 300 || p2stateno = 500;立弱K、屈弱K
trigger7 = enemynear,authorname = "Cable" && p2name = "Cable"
trigger7 = p2stateno = 220 || (p2stateno = [1450,1470])||p2stateno = [3000,3001];立強P,バイパー,ハイパーバイパー
trigger8 = enemynear,authorname = "Cloudius" && p2name = "Marvel vs Capcom 2 Cable"
trigger8 =  (p2stateno = [1000,1021])||p2stateno = [3000,3001];バイパー,ハイパーバイパー
trigger9 = enemynear,authorname = "Cyclops" && p2name = "Cyclops"
trigger9 = (p2stateno = [1450,1470])||p2stateno = [3000,3001];オプティックブラストとか
trigger10 = enemynear,authorname = "Reza" && p2name = "Scott Summers MVC2 + MSHVSF + MUA + XML2"
trigger10 = (p2stateno = [1000,1010])|| p2stateno = 1044 || p2stateno = 3000;オプティックブラストとか


;大体ビームと全地面ってとこですね。あとは地味にリーチ長いやつとか。続きはまた今度追加します。


;test対人用直前状態記憶
[state 40001];２８〜３６桁目
type = varset
trigger1 = 1
var(5) = 10*(var(5)%(10**8)) + (var(4) - var(4)%(10**8))/10**8
ignorehitpause = 1

[state 40001];１９〜２７桁目
type = varset
trigger1 = 1
var(4) = 10*(var(4)%(10**8)) + (var(3) - var(3)%(10**8))/10**8
ignorehitpause = 1

[state 40001];１０〜１８桁目
type = varset
trigger1 = 1
var(3) = 10*(var(3)%(10**8)) + (var(2) - var(2)%(10**8))/10**8
ignorehitpause = 1

[state 40001];１〜９桁目
type = varset
trigger1 = 1
var(2) = 10*(var(2)%(10**8)) + var(1)
ignorehitpause = 1

[state 40001]
type = null
trigger1 = p2statetype = C && p2movetype = I
trigger1 = var(1) := 0
trigger2 = p2statetype = C && p2movetype = A
trigger2 = var(1) := 1
trigger3 = p2statetype = C && p2movetype = H
trigger3 = var(1) := 2
trigger4 = p2statetype = S && p2movetype = I
trigger4 = var(1) := 3
trigger5 = p2statetype = S && p2movetype = A
trigger5 = var(1) := 4
trigger6 = p2statetype = S && p2movetype = H
trigger6 = var(1) := 5
trigger7 = p2statetype = A && p2movetype = I
trigger7 = var(1) := 6
trigger8 = p2statetype = A && p2movetype = A
trigger8 = var(1) := 7
trigger9 = p2statetype = A && p2movetype = H
trigger9 = var(1) := 8
trigger10 = p2statetype = L
trigger10 = var(1) := 9
ignorehitpause = 1



;データ読み込み
[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*60) <= 1
trigger1 = var(10) := var(2)%10
trigger2 = ceil(parent,fvar(31)*60) = 2
trigger2 = var(10) := (var(2)%100 - var(2)%10)/10
trigger3 = ceil(parent,fvar(31)*60) = 3
trigger3 = var(10) := (var(2)%1000 - var(2)%100)/100
trigger4 = ceil(parent,fvar(31)*60) = 4
trigger4 = var(10) := (var(2)%10000 - var(2)%1000)/1000
trigger5 = ceil(parent,fvar(31)*60) = 5
trigger5 = var(10) := (var(2)%100000 - var(2)%10000)/10000
trigger6 = ceil(parent,fvar(31)*60) = 6
trigger6 = var(10) := (var(2)%1000000 - var(2)%100000)/100000
trigger7 = ceil(parent,fvar(31)*60) = 7
trigger7 = var(10) := (var(2)%10000000 - var(2)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*60) = 8
trigger8 = var(10) := (var(2)%100000000 - var(2)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*60) = 9
trigger9 = var(10) := (var(2) - var(2)%100000000)/100000000
ignorehitpause = 1

[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*60) = 10
trigger1 = var(10) := var(3)%10
trigger2 = ceil(parent,fvar(31)*60) = 11
trigger2 = var(10) := (var(3)%100 - var(3)%10)/10
trigger3 = ceil(parent,fvar(31)*60) = 12
trigger3 = var(10) := (var(3)%1000 - var(3)%100)/100
trigger4 = ceil(parent,fvar(31)*60) = 13
trigger4 = var(10) := (var(3)%10000 - var(3)%1000)/1000
trigger5 = ceil(parent,fvar(31)*60) = 14
trigger5 = var(10) := (var(3)%100000 - var(3)%10000)/10000
trigger6 = ceil(parent,fvar(31)*60) = 15
trigger6 = var(10) := (var(3)%1000000 - var(3)%100000)/100000
trigger7 = ceil(parent,fvar(31)*60) = 16
trigger7 = var(10) := (var(3)%10000000 - var(3)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*60) = 17
trigger8 = var(10) := (var(3)%100000000 - var(3)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*60) = 18
trigger9 = var(10) := (var(3) - var(3)%100000000)/100000000
ignorehitpause = 1

[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*60) = 19
trigger1 = var(10) := var(4)%10
trigger2 = ceil(parent,fvar(31)*60) = 20
trigger2 = var(10) := (var(4)%100 - var(4)%10)/10
trigger3 = ceil(parent,fvar(31)*60) = 21
trigger3 = var(10) := (var(4)%1000 - var(4)%100)/100
trigger4 = ceil(parent,fvar(31)*60) = 22
trigger4 = var(10) := (var(4)%10000 - var(4)%1000)/1000
trigger5 = ceil(parent,fvar(31)*60) = 23
trigger5 = var(10) := (var(4)%100000 - var(4)%10000)/10000
trigger6 = ceil(parent,fvar(31)*60) = 24
trigger6 = var(10) := (var(4)%1000000 - var(4)%100000)/100000
trigger7 = ceil(parent,fvar(31)*60) = 25
trigger7 = var(10) := (var(4)%10000000 - var(4)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*60) = 26
trigger8 = var(10) := (var(4)%100000000 - var(4)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*60) = 27
trigger9 = var(10) := (var(4) - var(4)%100000000)/100000000
ignorehitpause = 1

[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*60) = 28
trigger1 = var(10) := var(5)%10
trigger2 = ceil(parent,fvar(31)*60) = 29
trigger2 = var(10) := (var(5)%100 - var(5)%10)/10
trigger3 = ceil(parent,fvar(31)*60) = 30
trigger3 = var(10) := (var(5)%1000 - var(5)%100)/100
trigger4 = ceil(parent,fvar(31)*60) = 31
trigger4 = var(10) := (var(5)%10000 - var(5)%1000)/1000
trigger5 = ceil(parent,fvar(31)*60) = 32
trigger5 = var(10) := (var(5)%100000 - var(5)%10000)/10000
trigger6 = ceil(parent,fvar(31)*60) = 33
trigger6 = var(10) := (var(5)%1000000 - var(5)%100000)/100000
trigger7 = ceil(parent,fvar(31)*60) = 34
trigger7 = var(10) := (var(5)%10000000 - var(5)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*60) = 35
trigger8 = var(10) := (var(5)%100000000 - var(5)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*60) >= 36
trigger9 = var(10) := (var(5) - var(5)%100000000)/100000000
ignorehitpause = 1

;ガードステート用1
[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*30) <= 1
trigger1 = var(11) := var(2)%10
trigger2 = ceil(parent,fvar(31)*30) = 2
trigger2 = var(11) := (var(2)%100 - var(2)%10)/10
trigger3 = ceil(parent,fvar(31)*30) = 3
trigger3 = var(11) := (var(2)%1000 - var(2)%100)/100
trigger4 = ceil(parent,fvar(31)*30) = 4
trigger4 = var(11) := (var(2)%10000 - var(2)%1000)/1000
trigger5 = ceil(parent,fvar(31)*30) = 5
trigger5 = var(11) := (var(2)%100000 - var(2)%10000)/10000
trigger6 = ceil(parent,fvar(31)*30) = 6
trigger6 = var(11) := (var(2)%1000000 - var(2)%100000)/100000
trigger7 = ceil(parent,fvar(31)*30) = 7
trigger7 = var(11) := (var(2)%10000000 - var(2)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*30) = 8
trigger8 = var(11) := (var(2)%100000000 - var(2)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*30) = 9
trigger9 = var(11) := (var(2) - var(2)%100000000)/100000000
ignorehitpause = 1

[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*30) = 10
trigger1 = var(11) := var(3)%10
trigger2 = ceil(parent,fvar(31)*30) = 11
trigger2 = var(11) := (var(3)%100 - var(3)%10)/10
trigger3 = ceil(parent,fvar(31)*30) = 12
trigger3 = var(11) := (var(3)%1000 - var(3)%100)/100
trigger4 = ceil(parent,fvar(31)*30) = 13
trigger4 = var(11) := (var(3)%10000 - var(3)%1000)/1000
trigger5 = ceil(parent,fvar(31)*30) = 14
trigger5 = var(11) := (var(3)%100000 - var(3)%10000)/10000
trigger6 = ceil(parent,fvar(31)*30) = 15
trigger6 = var(11) := (var(3)%1000000 - var(3)%100000)/100000
trigger7 = ceil(parent,fvar(31)*30) = 16
trigger7 = var(11) := (var(3)%10000000 - var(3)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*30) = 17
trigger8 = var(11) := (var(3)%100000000 - var(3)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*30) = 18
trigger9 = var(11) := (var(3) - var(3)%100000000)/100000000
ignorehitpause = 1

[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*30) = 19
trigger1 = var(11) := var(4)%10
trigger2 = ceil(parent,fvar(31)*30) = 20
trigger2 = var(11) := (var(4)%100 - var(4)%10)/10
trigger3 = ceil(parent,fvar(31)*30) = 21
trigger3 = var(11) := (var(4)%1000 - var(4)%100)/100
trigger4 = ceil(parent,fvar(31)*30) = 22
trigger4 = var(11) := (var(4)%10000 - var(4)%1000)/1000
trigger5 = ceil(parent,fvar(31)*30) = 23
trigger5 = var(11) := (var(4)%100000 - var(4)%10000)/10000
trigger6 = ceil(parent,fvar(31)*30) = 24
trigger6 = var(11) := (var(4)%1000000 - var(4)%100000)/100000
trigger7 = ceil(parent,fvar(31)*30) = 25
trigger7 = var(11) := (var(4)%10000000 - var(4)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*30) = 26
trigger8 = var(11) := (var(4)%100000000 - var(4)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*30) = 27
trigger9 = var(11) := (var(4) - var(4)%100000000)/100000000
ignorehitpause = 1

[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*30) = 28
trigger1 = var(11) := var(5)%10
trigger2 = ceil(parent,fvar(31)*30) = 29
trigger2 = var(11) := (var(5)%100 - var(5)%10)/10
trigger3 = ceil(parent,fvar(31)*30) = 30
trigger3 = var(11) := (var(5)%1000 - var(5)%100)/100
trigger4 = ceil(parent,fvar(31)*30) = 31
trigger4 = var(11) := (var(5)%10000 - var(5)%1000)/1000
trigger5 = ceil(parent,fvar(31)*30) = 32
trigger5 = var(11) := (var(5)%100000 - var(5)%10000)/10000
trigger6 = ceil(parent,fvar(31)*30) = 33
trigger6 = var(11) := (var(5)%1000000 - var(5)%100000)/100000
trigger7 = ceil(parent,fvar(31)*30) = 34
trigger7 = var(11) := (var(5)%10000000 - var(5)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*30) = 35
trigger8 = var(11) := (var(5)%100000000 - var(5)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*30) >= 36
trigger9 = var(11) := (var(5) - var(5)%100000000)/100000000
ignorehitpause = 1

;ガードステート用2(透かさない下段など用)
[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*20) <= 1
trigger1 = var(12) := var(2)%10
trigger2 = ceil(parent,fvar(31)*20) = 2
trigger2 = var(12) := (var(2)%100 - var(2)%10)/10
trigger3 = ceil(parent,fvar(31)*20) = 3
trigger3 = var(12) := (var(2)%1000 - var(2)%100)/100
trigger4 = ceil(parent,fvar(31)*20) = 4
trigger4 = var(12) := (var(2)%10000 - var(2)%1000)/1000
trigger5 = ceil(parent,fvar(31)*20) = 5
trigger5 = var(12) := (var(2)%100000 - var(2)%10000)/10000
trigger6 = ceil(parent,fvar(31)*20) = 6
trigger6 = var(12) := (var(2)%1000000 - var(2)%100000)/100000
trigger7 = ceil(parent,fvar(31)*20) = 7
trigger7 = var(12) := (var(2)%10000000 - var(2)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*20) = 8
trigger8 = var(12) := (var(2)%100000000 - var(2)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*20) = 9
trigger9 = var(12) := (var(2) - var(2)%100000000)/100000000
ignorehitpause = 1

[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*20) = 10
trigger1 = var(12) := var(3)%10
trigger2 = ceil(parent,fvar(31)*20) = 11
trigger2 = var(12) := (var(3)%100 - var(3)%10)/10
trigger3 = ceil(parent,fvar(31)*20) = 12
trigger3 = var(12) := (var(3)%1000 - var(3)%100)/100
trigger4 = ceil(parent,fvar(31)*20) = 13
trigger4 = var(12) := (var(3)%10000 - var(3)%1000)/1000
trigger5 = ceil(parent,fvar(31)*20) = 14
trigger5 = var(12) := (var(3)%100000 - var(3)%10000)/10000
trigger6 = ceil(parent,fvar(31)*20) = 15
trigger6 = var(12) := (var(3)%1000000 - var(3)%100000)/100000
trigger7 = ceil(parent,fvar(31)*20) = 16
trigger7 = var(12) := (var(3)%10000000 - var(3)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*20) = 17
trigger8 = var(12) := (var(3)%100000000 - var(3)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*20) = 18
trigger9 = var(12) := (var(3) - var(3)%100000000)/100000000
ignorehitpause = 1

[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*20) = 19
trigger1 = var(12) := var(4)%10
trigger2 = ceil(parent,fvar(31)*20) = 20
trigger2 = var(12) := (var(4)%100 - var(4)%10)/10
trigger3 = ceil(parent,fvar(31)*20) = 21
trigger3 = var(12) := (var(4)%1000 - var(4)%100)/100
trigger4 = ceil(parent,fvar(31)*20) = 22
trigger4 = var(12) := (var(4)%10000 - var(4)%1000)/1000
trigger5 = ceil(parent,fvar(31)*20) = 23
trigger5 = var(12) := (var(4)%100000 - var(4)%10000)/10000
trigger6 = ceil(parent,fvar(31)*20) = 24
trigger6 = var(12) := (var(4)%1000000 - var(4)%100000)/100000
trigger7 = ceil(parent,fvar(31)*20) = 25
trigger7 = var(12) := (var(4)%10000000 - var(4)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*20) = 26
trigger8 = var(12) := (var(4)%100000000 - var(4)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*20) = 27
trigger9 = var(12) := (var(4) - var(4)%100000000)/100000000
ignorehitpause = 1

[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*20) = 28
trigger1 = var(12) := var(5)%10
trigger2 = ceil(parent,fvar(31)*20) = 29
trigger2 = var(12) := (var(5)%100 - var(5)%10)/10
trigger3 = ceil(parent,fvar(31)*20) = 30
trigger3 = var(12) := (var(5)%1000 - var(5)%100)/100
trigger4 = ceil(parent,fvar(31)*20) = 31
trigger4 = var(12) := (var(5)%10000 - var(5)%1000)/1000
trigger5 = ceil(parent,fvar(31)*20) = 32
trigger5 = var(12) := (var(5)%100000 - var(5)%10000)/10000
trigger6 = ceil(parent,fvar(31)*20) = 33
trigger6 = var(12) := (var(5)%1000000 - var(5)%100000)/100000
trigger7 = ceil(parent,fvar(31)*20) = 34
trigger7 = var(12) := (var(5)%10000000 - var(5)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*20) = 35
trigger8 = var(12) := (var(5)%100000000 - var(5)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*20) >= 36
trigger9 = var(12) := (var(5) - var(5)%100000000)/100000000
ignorehitpause = 1

;前記憶用
[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*60 + 10) <= 1
trigger1 = var(13) := var(2)%10
trigger2 = ceil(parent,fvar(31)*60 + 10) = 2
trigger2 = var(13) := (var(2)%100 - var(2)%10)/10
trigger3 = ceil(parent,fvar(31)*60 + 10) = 3
trigger3 = var(13) := (var(2)%1000 - var(2)%100)/100
trigger4 = ceil(parent,fvar(31)*60 + 10) = 4
trigger4 = var(13) := (var(2)%10000 - var(2)%1000)/1000
trigger5 = ceil(parent,fvar(31)*60 + 10) = 5
trigger5 = var(13) := (var(2)%100000 - var(2)%10000)/10000
trigger6 = ceil(parent,fvar(31)*60 + 10) = 6
trigger6 = var(13) := (var(2)%1000000 - var(2)%100000)/100000
trigger7 = ceil(parent,fvar(31)*60 + 10) = 7
trigger7 = var(13) := (var(2)%10000000 - var(2)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*60 + 10) = 8
trigger8 = var(13) := (var(2)%100000000 - var(2)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*60 + 10) = 9
trigger9 = var(13) := (var(2) - var(2)%100000000)/100000000
ignorehitpause = 1

[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*60 + 10) = 10
trigger1 = var(13) := var(3)%10
trigger2 = ceil(parent,fvar(31)*60 + 10) = 11
trigger2 = var(13) := (var(3)%100 - var(3)%10)/10
trigger3 = ceil(parent,fvar(31)*60 + 10) = 12
trigger3 = var(13) := (var(3)%1000 - var(3)%100)/100
trigger4 = ceil(parent,fvar(31)*60 + 10) = 13
trigger4 = var(13) := (var(3)%10000 - var(3)%1000)/1000
trigger5 = ceil(parent,fvar(31)*60 + 10) = 14
trigger5 = var(13) := (var(3)%100000 - var(3)%10000)/10000
trigger6 = ceil(parent,fvar(31)*60 + 10) = 15
trigger6 = var(13) := (var(3)%1000000 - var(3)%100000)/100000
trigger7 = ceil(parent,fvar(31)*60 + 10) = 16
trigger7 = var(13) := (var(3)%10000000 - var(3)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*60 + 10) = 17
trigger8 = var(13) := (var(3)%100000000 - var(3)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*60 + 10) = 18
trigger9 = var(13) := (var(3) - var(3)%100000000)/100000000
ignorehitpause = 1

[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*60 + 10) = 19
trigger1 = var(13) := var(4)%10
trigger2 = ceil(parent,fvar(31)*60 + 10) = 20
trigger2 = var(13) := (var(4)%100 - var(4)%10)/10
trigger3 = ceil(parent,fvar(31)*60 + 10) = 21
trigger3 = var(13) := (var(4)%1000 - var(4)%100)/100
trigger4 = ceil(parent,fvar(31)*60 + 10) = 22
trigger4 = var(13) := (var(4)%10000 - var(4)%1000)/1000
trigger5 = ceil(parent,fvar(31)*60 + 10) = 23
trigger5 = var(13) := (var(4)%100000 - var(4)%10000)/10000
trigger6 = ceil(parent,fvar(31)*60 + 10) = 24
trigger6 = var(13) := (var(4)%1000000 - var(4)%100000)/100000
trigger7 = ceil(parent,fvar(31)*60 + 10) = 25
trigger7 = var(13) := (var(4)%10000000 - var(4)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*60 + 10) = 26
trigger8 = var(13) := (var(4)%100000000 - var(4)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*60 + 10) = 27
trigger9 = var(13) := (var(4) - var(4)%100000000)/100000000
ignorehitpause = 1

[state 40001]
type = Null
trigger1 = ceil(parent,fvar(31)*60 + 10) = 28
trigger1 = var(13) := var(5)%10
trigger2 = ceil(parent,fvar(31)*60 + 10) = 29
trigger2 = var(13) := (var(5)%100 - var(5)%10)/10
trigger3 = ceil(parent,fvar(31)*60 + 10) = 30
trigger3 = var(13) := (var(5)%1000 - var(5)%100)/100
trigger4 = ceil(parent,fvar(31)*60 + 10) = 31
trigger4 = var(13) := (var(5)%10000 - var(5)%1000)/1000
trigger5 = ceil(parent,fvar(31)*60 + 10) = 32
trigger5 = var(13) := (var(5)%100000 - var(5)%10000)/10000
trigger6 = ceil(parent,fvar(31)*60 + 10) = 33
trigger6 = var(13) := (var(5)%1000000 - var(5)%100000)/100000
trigger7 = ceil(parent,fvar(31)*60 + 10) = 34
trigger7 = var(13) := (var(5)%10000000 - var(5)%1000000)/1000000
trigger8 = ceil(parent,fvar(31)*60 + 10) = 35
trigger8 = var(13) := (var(5)%100000000 - var(5)%10000000)/10000000
trigger9 = ceil(parent,fvar(31)*60 + 10) >= 36
trigger9 = var(13) := (var(5) - var(5)%100000000)/100000000
ignorehitpause = 1

[State -2];デバッグ表示
type = DisplayToClipBoard
trigger1 = 1
text = " v1=%d ,v5=%d ,v4=%d ,v3=%d,v2=%d \n"
params =  var(1),var(5),var(4),var(3),var(2)
ignorehitpause = 1
supermovetime = 9999
pausemovetime = 9999

[State -2];デバッグ表示
type = AppendToClipBoard
trigger1 = 1
text = " v10 = %d , v11 = %d , v12=%d"
params = var(10) , var(11) ,var(12)
ignorehitpause = 1












;________________

;AI起動用ヘルパー
;________________

[Statedef 10000]
ctrl=0

[State 10000,間違いで本体が来たら立ちへ移行]
type=selfstate
trigger1=!ishelper
value=0

[State 10000,プレイヤー判定]
type=varset
trigger1=command="up"&&root,command="up"
trigger2=command="down"&&root,command="down"
trigger3=command="back"&&root,command="back"
trigger4=command="fwd"&&root,command="fwd"
trigger5=command="a"&&root,command="a"
trigger6=command="b"&&root,command="b"
trigger7=command="c"&&root,command="c"
trigger8=command="x"&&root,command="x"
trigger9=command="y"&&root,command="y"
trigger10=command="z"&&root,command="z"
var(59)=-1

[State 10000,立ったら消失]
Type = DestroySelf
triggerAll = isHelper
trigger1=command="up"&&root,command="up"
trigger2=command="down"&&root,command="down"
trigger3=command="back"&&root,command="back"
trigger4=command="fwd"&&root,command="fwd"
trigger5=command="a"&&root,command="a"
trigger6=command="b"&&root,command="b"
trigger7=command="c"&&root,command="c"
trigger8=command="x"&&root,command="x"
trigger9=command="y"&&root,command="y"
trigger10=command="z"&&root,command="z"
Trigger11 = root,var(59)||var(59)=-1

[State 10000,ﾌﾗｸﾞON]
type=varset
triggerall = ishelper
triggerall=var(59)!=-1
trigger1 = root,command="up"||root,command="down"||root,command="back"||root,command="fwd"||root,command="a"
trigger2 = root,command="b"||root,command="c"||root,command="x"||root,command="y"||root,command="z"
trigger3 = root,command="IC"||root,command="FF" || root,command="BB"||root,command="dd"||root,command="recovery"
trigger4 = root,command="fwd_a"||root,command="fwd_b"||root,command="fwd_c"
trigger5 = root,command="kimuchi"||root,command="kimuchi2"||root,command="sakura_c"||root,command="sakura_b"||root,command="sakura_a"
trigger6 = root,command="kobushi_a"||root,command="kobushi_b"||root,command="kobushi_c"||root,command="chokomaka_a"||root,command="chokomaka_b"
trigger7 = root,command="chokomaka_c"||root,command="fugaku_a"||root,command="fugaku_b"||root,command="fugaku_c"||root,command="guren_a"
trigger8 = root,command="guren_b"||root,command="guren_c"||root,command="gatotsu_a"||root,command="gatotsu_b"||root,command="gatotsu_c"
trigger9 = root,command="bakusai_a"||root,command="bakusai_b"||root,command="bakusai_c"
var(59)=1

