[Statedef 30000]
type=A
movetype=I
physics=N
ctrl=0
anim=9999
sprpriority=0


;【コンフィング】_____________________________________________________________________________________________________________________________________________________________________________________________
;近くに似たような変数セットがありますが、絶対に触らないようにしてください。
;
;
;【AIレベル】_________________________________________________________________________________________________________________________________________________________________________________________________
[State -2]
type=varset
Trigger1=!var(51)
var(51)=3

;________________________________________________________________________________________________________________________________________________________________________________________________________________
;1-どちらかと言えばガン攻め
;2-どちらかと言えばガン待ち
;3-走るキャップ

;レベル1
;他の設定を下げることで、ギリギリ対人AIになるように調整しています。
;そのため、レベル2以上と比べると無駄な行動が多く、対空で死にやすくなってます。
また、レベル2以上では使用しないコンボも狙います。
;レベル2
;レベル1に比べ、自分から行動することは少なくなり、自身の投げの間合いを維持する立ち回りをします。
;ジリジリ詰め寄るキャップがお好きな方はコチラ。
;また、対AIを想定しているため、ガードや切り返しのレベルは最大であることが望ましいです。
;レベル3
;レベル2が元気になるだけです(多分)。
;元気になった結果、激しい相性ゲーにもなります。

;【AI常時起動】_____________________________________________________________________________________________________________________________________________________________________________________________

[State -2]
type=varset
Trigger1=!var(52)
var(52)=1
;_________________________________________________________________________________________________________________________________________________________________________________________________________________
;0- しない
;1- する

;特定カラーのみONにしたい場合はroot,palno=nで設定してください。

;【初期1ゲージ】___________________________________________________________________________________________________________________________________________________________________________________________

[State -2]
type=varset
Trigger1=!var(50)
var(50)=1
;_________________________________________________________________________________________________________________________________________________________________________________________________________________
;0- 無し(改変)
;1- 有り

;書くことがない。

;【ダメージレベル】_______________________________________________________________________________________________________________________________________________________________________________________

[State -2]
type=parentvarset
Trigger1=!(root,fvar(4))
fvar(4)=4
;_________________________________________________________________________________________________________________________________________________________________________________________________________________
;1-8で設定
;
;デフォルトは4です。
;まさかの与ダメが増えるというトンデモ解釈。
;最大8で約1.5倍になります。

;【遊びコンボ、無駄遣いなど】_______________________________________________________________________________________________________________________________________________________________________

[State -2]
type=varset
Trigger1=!var(53)
var(53)=2

;_________________________________________________________________________________________________________________________________________________________________________________________________________________
;0- 無し
;1- ちょっと贅沢な使い方
;2- ちょっと特殊なコンボをいくつか
;
;一部のコンボがオシャレになったり、切り返しにゲージを使ったりするようになります。
;永久コンボを使用しない場合、2にすることで画面端での火力を維持できます。
;というより永久コンボの完走率がかなりアレなので、遊びコンボに回したほうが安定だったりします。

;【NJループ】____________________________________________________________________________________________________________________________________________________________________________________________

[State -2]
type=varset
Trigger1=!fvar(29)
fvar(29)=0
;_________________________________________________________________________________________________________________________________________________________________________________________________________________
;0- しない。
;1- する。

;端でのNJループの使用可否設定です。
;完走率はそこまで高くないのでレベル2から分離しました。
;また、ごく稀に画面端限定でチャージングループをすることがありますが、非常に低頻度なため、このスイッチに関わらず狙っていきます。
;見れたらラッキー。

;【学習前の対飛び道具行動】________________________________________________________________________________________________________________________________________________________________________

[State -2]
type=varset
Trigger1=!var(54)
var(54)=11

;___________________________________________________________________________________________________________________________________________________________________________________________________________________
;0-  無し
;1-  昇龍で抜ける
;2-  側転で抜ける
;3-  盾を投げる
;4-  盾で突撃
;5-  昇龍と側転
;6-  昇龍と盾投げ
;7-  昇龍と突撃
;8-  側転と盾投げ
;9-  側転と突撃
;10- 盾投げと突撃
;11- 全部
;
;基本的にネタ行動に近い項目ですが、相手によってはそこそこ機能します。
;もちろん全部入れた方が強いってのは大間違いです。
;この他に飛び道具に対してジャンプで避ける行動が有りますが、それはデフォ行動です。
;昇龍以外はリスクが高く、昇龍自体も確実に安全とは言えないので何もしない方が安定だったりします。
;そもそも盾投げなんかは完全に対人ネタで入れているので、高ランクでは足を引っ張るだけの要素だったり。
;それも含めての項目だったり。

;【切り返し能力設定】____________________________________________________________________________________________________________________________________________________________________________________________
[State -2]
type=varset
Trigger1=!var(55)
var(55)=10
;____________________________________________________________________________________________________________________________________________________________________________________________________________________________
;1〜10で調整できます

;主に投げや昇竜の発生頻度が変わります。
;レベル1ではガードレベルとの平均値で全体的な強さが変わります。

;【ガードレベル】_____________________________________________________________________________________________________________________________________________________________________________________________________

[State -2]
type=varset
Trigger1=!var(57)
var(57)=10
;____________________________________________________________________________________________________________________________________________________________________________________________________________________________
;1〜10で調整できます

;主にガードの頻度が変わります。
;主に。
;レベル1では切り返し能力レベルとの平均値で全体的な強さが変わります。

;【根性値の初段適用(改変)】____________________________________________________________________________________________________________________________________________________________________________________________

[State -2]
type=varset
Trigger1=!fvar(30)
fvar(30)=1
;____________________________________________________________________________________________________________________________________________________________________________________________________________________________
;0- しない
;1- する

;MUGENの仕様上、DefenceMulSetでは1HIT目のダメージに補正を掛けることができないのでLifeaddで擬似的に根性値を再現します。
;AI限定ではないので、操作する際にも有効です。
;また、それ以外の被ダメ補正にも使用されます。
;_____________________________________________________________________________________________________________________________________________________________________________________________________________________________________









;
;ここからは対AI向けの若干細かい設定です。
;試合の見た目が大きく変わるわけでもないので、上部の項目だけで十分という方は基本的に弄る必要はありません。
;
;
;
;
;というか自分用の遊び項目です。ただ単に通常立ち回りに組み込むか悩んでいる部分だったりします。
;
;
;以下の項目のデフォルト値は個人的なオススメ設定です。
;全ての項目で0でも十分に戦うことはできます。
;
;
;______________________________________________________________________________________________________________________________
[State -2];超反応対空昇龍タイプ
type=varset
Trigger1=!var(56)
var(56)=1
;______________________________________________________________________________________________________________________________
;0- 前verまでの対空昇龍で距離計算無し。対応間合いは狭い
;1- 攻撃判定消失までのフレーム中の速度をすべて計算に入れる。対応間合いが広い

;基本的に計算はしっかりしましたが、例外というものは必ず存在するもので
;設定0に比べ設定1の方が超反応を利用する釣り行動に引っかかりやすくなります。
;______________________________________________________________________________________________________________________________

[State -2];地対地超反応昇龍タイプ
type=varset
Trigger1=!fvar(25)
fvar(25)=1
;______________________________________________________________________________________________________________________________
;0- 前verまでの超反応昇龍と同条件で距離計算無し。
;1- 通常時と空キャン時で条件を変え、初段までの距離計算をする。

;通常時と空キャン時で距離条件を変えるので設定0に比べ設定1の方が精度は高くなります。
;しかし、設定1の方が発動条件が若干厳しいため、対応間合い自体は設定0の方が広いのかもしれません。
;______________________________________________________________________________________________________________________________

[State -2];遅らせ空キャン昇龍
type=varset
Trigger1=!fvar(26)
fvar(26)=0
;______________________________________________________________________________________________________________________________
;0- 使用する。
;1- 使用しない。

;対通常技の空キャンのタイミングの設定です。
;設定0の場合、相手の通常技を学習するまでは即空キャン、学習後は相手の攻撃発生まで残り2F以下になると空キャンします。
;また、残り3+2F以上の場合、通常技で差し込み、コンボをします。
;設定1の場合、常に即空キャンで切り返します。
;通常技差し込みは行いません。
;学習内容にミスがあった場合、設定0の場合ではフォローが効きませんが設定1の場合では常に即昇龍なので問題ありません。
;しかし、通常技差し込みが行えないのでコンボ始動が減ります。
;(ここは他項目と違い使用することがデフォルトです)
;_______________________________________________________________________________________________________________________________

[State -2];K投げからノーゲージエリアルの内容
type=varset
Trigger1=!fvar(27)
fvar(27)=0
;______________________________________________________________________________________________________________________________
;0- 中P始動。
;1- 屈大P始動。

;そこまで内容は変わらないので中P始動に飽きたらどうぞ。
;判定的には屈大P始動の方が信頼できます。
;ダメージ自体も屈大P始動の方が若干高いらしいです。
;_______________________________________________________________________________________________________________________________

[State -2];連続アドバ回避
type=varset
Trigger1=!fvar(28)
fvar(28)=1
;______________________________________________________________________________________________________________________________
;0- しない。
;1- する。

;私の公開しているAIに共通しておきる、端に追い詰めた状況で自分のアドバンシングガードでハマってしまう現象を防ぐことが出来ます。
;相手の打撃系必殺技の発生Fを保存し、発生猶予Fに余裕を見つけ次第ダッシュで突っ込むというものです。
;ただし、発生記憶にミスがあった場合フォローが効かないのでリスクも高いです。
;(発生記憶ミスは持続を当てられたときに起きやすく、実際の初段の判定発生Fよりも多めの数値で保存してしまいます。)
;_______________________________________________________________________________________________________________________________


;【コンフィング】はここまで




[State 9741, Safety]
type=selfstate
Trigger1=!ishelper
value=0


[State 30000]
type=velset
Trigger1=time=0
Trigger1=prevstateno!=30002
x=10
y=0

[State -2]
type=Nothitby
Trigger1=1
value=SCA


[State 30000]
type=ScreenBound
Trigger1=1
value=0
movecamera=0,0

[State 30000]
type=Projectile
Trigger1=time=0
Trigger1=prevstateno!=30002
projID=30001
projanim=9999
velocity=10, 0
projpriority=4
projsprpriority=2
projstagebound=0
projedgebound=99999
offset=0, 0
postype=right
supermovetime=99999
pausemovetime=99999
projremovetime=-1

[State -2]
type=assertspecial
Trigger1=1
flag=noshadow
flag2=invisible
ignorehitpause=1

[State -2]
type=velset
Trigger1=!(root,NumprojID(30001))
x=0
y=0


;var(0)-var(3)敵飛び道具保存(旧)---------------------------------------------------------
[State -2];ビーム
type=varset
Triggerall=!var(0)
Triggerall=Numhelper(30020+root,id)
Triggerall=helper(30020+root,id),var(58)>0
Trigger1=PlayerID(root,var(56)),ctrl=0
Trigger1=PlayerID(root,var(56)),stateno<2000
var(0)=PlayerID(root,var(56)),stateno

[State -2];ビーム
type=varset
Triggerall=var(0)
Triggerall=Numhelper(30020+root,id)
Triggerall=helper(30020+root,id),var(58)>0
Trigger1=PlayerID(root,var(56)),ctrl=0
Trigger1=PlayerID(root,var(56)),stateno<2000
Trigger1=PlayerID(root,var(56)),stateno!=var(0)
var(1)=PlayerID(root,var(56)),stateno

[State -2];ビーム
type=varset
Triggerall=var(1)
Triggerall=Numhelper(30020+root,id)
Triggerall=helper(30020+root,id),var(58)>0
Trigger1=PlayerID(root,var(56)),ctrl=0
Trigger1=PlayerID(root,var(56)),stateno<2000
Trigger1=PlayerID(root,var(56)),stateno!=var(0)
Trigger1=PlayerID(root,var(56)),stateno!=var(1)
var(2)=PlayerID(root,var(56)),stateno

[State -2];ビーム
type=varset
Triggerall=var(2)
Triggerall=Numhelper(30020+root,id)
Triggerall=helper(30020+root,id),var(58)>0
Trigger1=PlayerID(root,var(56)),ctrl=0
Trigger1=PlayerID(root,var(56)),stateno<2000
Trigger1=PlayerID(root,var(56)),stateno!=var(0)
Trigger1=PlayerID(root,var(56)),stateno!=var(1)
Trigger1=PlayerID(root,var(56)),stateno!=var(2)
var(3)=PlayerID(root,var(56)),stateno

;当身警戒--------------------------------
[State -2]
Type = Varset
var(4) = PlayerID(root,var(56)),stateno
Trigger1 = !root,MoveReversed && root,MoveType = A

[State -2]
Type = Varset
var(4) = 0
Trigger1 = !root,MoveReversed && root,MoveType != A

[State -2];
Type = Varset
var(5) = var(4)
TriggerAll = !Var(5)
Trigger1 = root,MoveReversed
ignorehitpause = 1
[State -2];
Type = Varset
var(6) = var(4)
TriggerAll = Var(5) && !var(6)
Trigger1 = var(5)!=var(4)
Trigger1 = root,MoveReversed
ignorehitpause = 1
[State -2];
Type = Varset
var(7) = var(4)
TriggerAll = Var(5) && var(6) && !var(7)
Trigger1 = var(5)!=var(4) && var(6)!=var(4)
Trigger1 = root,MoveReversed
ignorehitpause = 1
[State -2];
Type = Varset
var(8) = var(4)
TriggerAll = Var(5) && var(6) && var(7) && !var(8)
Trigger1 = var(5)!=var(4) && var(6)!=var(4) && var(7)!=var(4)
Trigger1 = root,MoveReversed
ignorehitpause = 1

;超必判定var(9)〜(10)-------------------------------------------------------
[STATE 超必殺判定]
type = VarSet
Triggerall = Time
Trigger1 = var(9)>PlayerID(root,var(56)),power
var(10) = floor((var(9)-PlayerID(root,var(56)),power)*0.001)

[STATE 超必殺判定(リセット)]
type = VarSet
Triggerall = Time
Trigger1 = PlayerID(root,var(56)),movetype=H
Trigger2 = PlayerID(root,var(56)),stateno=[0,105]
Trigger3 = PlayerID(root,var(56)),stateno=[120,155]
Trigger4 = PlayerID(root,var(56)),stateno=[5000,5210]
var(10) = 0

[STATE ENEMY,POWER]
type = VarSet
Trigger1 = Time
var(9) = PlayerID(root,var(56)),power

;中段学習var(11)〜(14)-------------------------------------------------------
[State -2];地上中段学習用
type=varset
Trigger1=root,fvar(34)=1
Trigger1=!var(13)
Trigger1=root,movetype=H
Trigger1=root,stateno > 200
Trigger1=PlayerID(root,var(56)),Statetype !=A
Trigger1=PlayerID(root,var(56)),Movetype=A
var(13)=PlayerID(root,var(56)),stateno
ignorehitpause=1

[State -2];地上中段学習用
type=varset
Trigger1=root,fvar(34)=1
Trigger1=!var(14)
Trigger1=PlayerID(root,var(56)),stateno!=var(13)
Trigger1=root,movetype=H
Trigger1=root,stateno > 200
Trigger1=PlayerID(root,var(56)),Statetype !=A
Trigger1=PlayerID(root,var(56)),Movetype=A
var(14)=PlayerID(root,var(56)),stateno
ignorehitpause=1

;アメリカ用飛び道具の発生F保存とステート記憶:helperタイプは検出にかかったものを保存------------
[State -2];
type=varset
Triggerall=!var(15)
Triggerall=Numhelper(30020+root,id)
Triggerall=var(10) = 0
Triggerall=PlayerID(root,var(56)),stateno>500
Triggerall=PlayerID(root,var(56)),movetype!=H
Triggerall=PlayerID(root,var(56)),statetype!=L
Triggerall=helper(30020+root,id),var(58)>0
TriggerAll =!(PlayerID(root,var(56)),hitdefattr=SCA,AA,AT,AP)
Trigger1=PlayerID(root,var(56)),ctrl=0
Trigger1=PlayerID(root,var(56)),stateno<2000
var(15)=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*10000

[State -2];
type=varset
Triggerall=var(15)
Triggerall=!var(16)
Triggerall=Numhelper(30020+root,id)
Triggerall=var(10) = 0
Triggerall=PlayerID(root,var(56)),stateno>500
Triggerall=PlayerID(root,var(56)),movetype!=H
Triggerall=PlayerID(root,var(56)),statetype!=L
Triggerall=helper(30020+root,id),var(58)>0
TriggerAll =!(PlayerID(root,var(56)),hitdefattr=SCA,AA,AT,AP)
Trigger1=PlayerID(root,var(56)),ctrl=0
Trigger1=PlayerID(root,var(56)),stateno<2000
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(15)%10000)
var(16)=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*10000

[State -2];
type=varset
Triggerall=var(15)
Triggerall=var(16)
Triggerall=!var(17)
Triggerall=Numhelper(30020+root,id)
Triggerall=var(10) = 0
Triggerall=PlayerID(root,var(56)),stateno>500
Triggerall=PlayerID(root,var(56)),movetype!=H
Triggerall=PlayerID(root,var(56)),statetype!=L
Triggerall=helper(30020+root,id),var(58)>0
TriggerAll =!(PlayerID(root,var(56)),hitdefattr=SCA,AA,AT,AP)
Trigger1=PlayerID(root,var(56)),ctrl=0
Trigger1=PlayerID(root,var(56)),stateno<2000
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(15)%10000)
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(16)%10000)
var(17)=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*10000


;【自分用メモ】
;本体では結果から/10000したものを発生F、%10000したものをステートとして扱える
;保存の番号が進むごとに%10000とかぶらないようにする
;相手のstatenoの2000まで扱えないので例外には全く対処できない
;というかしない
;アメリカ用飛び道具の発生F保存とステート記憶:projectileタイプは調べようがないので出現したステートを保存------------
[State -2];
type=varset
Triggerall=!var(18)
Triggerall=Numhelper(30020+root,id)
Triggerall=var(10) = 0
Triggerall=PlayerID(root,var(56)),stateno>500
Triggerall=PlayerID(root,var(56)),movetype!=H
Triggerall=PlayerID(root,var(56)),statetype!=L
Triggerall=helper(30020+root,id),var(58)=0
Triggerall=PlayerID(root,var(56)),Numproj>0
TriggerAll=!(PlayerID(root,var(56)),hitdefattr=SCA,AA)
Trigger1=PlayerID(root,var(56)),ctrl=0
Trigger1=PlayerID(root,var(56)),stateno<2000
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(15)%10000)
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(16)%10000)
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(17)%10000)
var(18)=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*10000

[State -2];
type=varset
Triggerall=var(18)
Triggerall=!var(19)
Triggerall=Numhelper(30020+root,id)
Triggerall=var(10) = 0
Triggerall=PlayerID(root,var(56)),stateno>500
Triggerall=PlayerID(root,var(56)),movetype!=H
Triggerall=PlayerID(root,var(56)),statetype!=L
Triggerall=helper(30020+root,id),var(58)=0
Triggerall=PlayerID(root,var(56)),Numproj>0
TriggerAll=!(PlayerID(root,var(56)),hitdefattr=SCA,AA)
Trigger1=PlayerID(root,var(56)),ctrl=0
Trigger1=PlayerID(root,var(56)),stateno<2000
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(15)%10000)
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(16)%10000)
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(17)%10000)
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(18)%10000)
var(19)=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*10000

[State -2];
type=varset
Triggerall=var(18)
Triggerall=var(19)
Triggerall=!var(20)
Triggerall=Numhelper(30020+root,id)
Triggerall=var(10) = 0
Triggerall=PlayerID(root,var(56)),stateno>500
Triggerall=PlayerID(root,var(56)),movetype!=H
Triggerall=PlayerID(root,var(56)),statetype!=L
Triggerall=helper(30020+root,id),var(58)=0
Triggerall=PlayerID(root,var(56)),Numproj>0
TriggerAll=!(PlayerID(root,var(56)),hitdefattr=SCA,AA)
Trigger1=PlayerID(root,var(56)),ctrl=0
Trigger1=PlayerID(root,var(56)),stateno<2000
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(15)%10000)
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(16)%10000)
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(17)%10000)
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(18)%10000)
Trigger1=PlayerID(root,var(56)),stateno%10000!=floor(var(19)%10000)
var(20)=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*10000

;【自分用メモ】
;本体では結果から/10000したものを発生F、%10000したものをステートとして扱える
;保存の番号が進むごとに%10000とかぶらないようにする
;仕様がよく分からんので取り敢えず!(PlayerID(root,var(56)),hitdefattr=SCA,AA)を入れてみる
;相手のstatenoの2000まで扱えないので例外には全く対処できない
;空ガ不可学習------------------------------------------
[State -2];空ガ不可学習用
type=varset
Trigger1=root,fvar(35)
Trigger1=!var(21)
Trigger1=root,movetype=H
Trigger1=var(24)=1
Trigger1=root,stateno > 200
Trigger1=PlayerID(root,var(56)),Statetype !=A
Trigger1=PlayerID(root,var(56)),Movetype=A
var(21)=PlayerID(root,var(56)),stateno
ignorehitpause=1

[State -2];空ガ不可学習用
type=varset
Trigger1=root,fvar(35)
Trigger1=var(21)
Trigger1=!var(22)
Trigger1=root,movetype=H
Trigger1=var(24)=1
Trigger1=root,stateno > 200
Trigger1=PlayerID(root,var(56)),stateno!=var(21)
Trigger1=PlayerID(root,var(56)),Statetype !=A
Trigger1=PlayerID(root,var(56)),Movetype=A
var(22)=PlayerID(root,var(56)),stateno
ignorehitpause=1


;空ガ不可用---------------------------------

[State -2, 寸前にガードステートだったかどうか]
Type = VarSet
TriggerAll = GameTime%2 = 0
Trigger1 = root,stateno = 120
Trigger2 = root,stateno = 140
Trigger3 = root,stateno = 130
Trigger4 = root,stateno = 131
Trigger5 = root,stateno = [150,151]
Trigger6 = root,stateno = [152,153]
var(24)=1
IgnoreHitPause = 1
[State -2, 違う場合は0に戻す]
Type = VarSet
TriggerAll = Var(24) > 0
Trigger1 = root,stateno != 120
Trigger1 = root,stateno != [130,131]
Trigger1 = root,stateno != 131
Trigger1 = root,stateno != 140
Trigger1 = root,stateno != [150,153]
var(24)=0
IgnoreHitPause = 1
;var(25)暗転感知------------------------------------------------------

[State -2, リセット]
Type = Varset
Trigger1 = Numhelper(30010+root,id)
Trigger1 = gametime-helper(30010+root,id),var(21)<=1
var(25)=0
IgnoreHitPause = 1


[State -2, ポーズ];ポーズを受け付けるヘルパーのgametimeを使用
Type = Varadd
Trigger1 = roundstate=2
Trigger1 = Numhelper(30010+root,id)
Trigger1 = gametime-helper(30010+root,id),var(21)>1
var(25)=1
IgnoreHitPause = 1

;【メモ】
;一般的には本体の整数変数でやるものなので不具合あるかも
;ポーズを受け付けるヘルパー(30010+root,id)のvar(25)をgametimeとして利用
;ポーズを受け付けないヘルパー(30000+root,id)、つまりコレとの誤差が2以上で暗転感知開始
;1だとタイミング的に常時加算してしまうので誤差は2にする

;var(26)空キャン当身記憶---------------------------------------------------

[State -2];
Type = Varset
Trigger1 = !var(26)
Trigger1 = root,MoveReversed
Trigger1 = root,prevstateno=1400||root,prevstateno=1410||prevstateno=2100
Trigger1 = PlayerID(root,var(56)),statetype=S
Trigger1 = PlayerID(root,var(56)),movetype!=A
var(26)=1
ignorehitpause = 1

;var(27)-var(28)中昇龍狩られ学習---------------------------------------------------

[State -2,原因ステート記憶]
Type = Varset
Trigger1 = !var(27)
Trigger1 = root,prevstateno=1410
var(27)=PlayerID(root,var(56)),stateno
ignorehitpause = 1


[State -2,記憶実行]
Type = Varset
Triggerall = !var(28)
Triggerall = PlayerID(root,var(56)),stateno<99999
Trigger1 =root,anim=[5000,5110]
var(28)=var(27)
ignorehitpause = 1


[State -2,原因ステート記憶:リセット]
Type = Varset
Triggerall = var(27)
Triggerall = root,stateno!=[1410,1411]
Trigger1 = !(root,stateno=1402&&root,prevstateno=1411)
var(27)=0
ignorehitpause = 1

;ちょっと実験ガー不学習------------------------------------------------
[STATE -2,ガード不可記憶]
type = VarSet
trigger1 = ifelse(PlayerID(root,var(56)),time,PlayerID(root,var(56)),stateno,PlayerID(root,var(56)),prevstateno)<=32767
trigger1 = !(root,time)
trigger1 = PlayerID(root,var(56)),movehit||(PlayerID(root,var(56)),Numtarget&&PlayerID(root,var(56)),projhit=0)
trigger1 = root,movetype=H&&!root,gethitvar(guarded)
trigger1 = var(24)
var(31) =ifelse(PlayerID(root,var(56)),time,PlayerID(root,var(56)),stateno,PlayerID(root,var(56)),prevstateno)
;ちょっと実験投げ学習----------------------------------------
[State -2, 投げ判定(地上―地上)]
Type = VarSet
TriggerAll = PlayerID(root,var(56)),HitDefAttr =A,NT
Trigger1 = Var(33) = 0
var(33)=PlayerID(root,var(56)),stateno
;投げ学習----------------------------------------
[State -2, 投げ判定(地上―地上)]
Type = VarSet
TriggerAll = root,stateno != [120,155]
TriggerAll = root,GetHitVar(Damage) = 0
TriggerAll = root,MoveType = H
Trigger1 = Var(34) = 0
var(34)=PlayerID(root,var(56)),prevstateno


[State -2, 投げ判定(地上―地上)]
Type = null;VarSet
TriggerAll = root,stateno != [120,155]
TriggerAll = root,GetHitVar(Damage) = 0
TriggerAll = root,MoveType = H
Trigger1 = Var(35) = 0
Trigger1 = var(34)>0
Trigger1 = PlayerID(root,var(56)),prevstateno!=var(34)
var(35)=PlayerID(root,var(56)),Prevstateno

;コンボミス判断用var(36)〜var(39)----------------------------------------
[State -2];var(39)保存:通常エリアル
type=varset
Trigger1=root,var(39)=1
var(36)=50

[State -2];var(39)保存
type=varadd
Trigger1=var(36)>0
var(36)=-1

[State -2];var(39)保存:ダウン追撃からのエリアル
type=varset
Trigger1=root,var(39)=11
var(37)=20

[State -2];var(39)保存
type=varadd
Trigger1=var(37)>0
var(37)=-1

[State -2];var(39)保存:投げからのエリアル
type=varset
Trigger1=root,var(39)=21
var(38)=20

[State -2];var(39)保存
type=varadd
Trigger1=var(38)>0
var(38)=-1

[State bit];var(39)保存:ビット式
type=null
Trigger1 = !(var(40)&1)
Trigger1 = var(36)>0
Trigger1 = root,var(39)=0
Trigger1 = var(40):=var(40)+1||1
Trigger2 = !(var(40)&2)
Trigger2 = var(37)>0
Trigger2 = root,var(39)=0
Trigger2 = root,var(43)=0
Trigger2 = var(40):=var(40)+2||1
Trigger3 = !(var(40)&4)
Trigger3 = var(38)>0
Trigger3 = root,var(39)=0
Trigger3 = root,var(43)=0
Trigger3 = var(40):=var(40)+4||1
Trigger4 = !(var(40)&8)
Trigger4 = root,var(39)=27||root,var(39)=28
Trigger4 = var(40):=var(40)+8||1
Trigger5 = !(var(40)&16)
Trigger5 = root,var(39)=41;||root,var(39)=28
Trigger5 = var(40):=var(40)+16||1
Trigger6 = !(var(40)&32)
Trigger6 = root,var(39)=31
Trigger6 = var(40):=var(40)+32||1
Trigger7 = !(var(40)&64)
Trigger7 = root,var(39)=0
Trigger7 = root,stateno=420
Trigger7 = root,time>=12
Trigger7 = root,movehit=0
Trigger7 = root,prevstateno=400||prevstateno=430
Trigger7 = var(40):=var(40)+64||1
Trigger8 = !(var(40)&128)
Trigger8 = root,var(39)=81
Trigger8 = var(40):=var(40)+128||1
Trigger9 = !(var(40)&256)
Trigger9 = root,var(39)=101
Trigger9 = var(40):=var(40)+256||1
Trigger10= !(var(40)&512)
Trigger10= root,var(39)=111
Trigger10= var(40):=var(40)+512||1


;(var(40)&1)=通常エリアル封印
;(var(40)&2)=ダウン追撃からのエリアル封印
;(var(40)&4)=投げからのエリアル封印
;(var(40)&8)=レベル1用遊びコンボ封印:ラウンド一回の制限なのでこちらで変数は特に用意しない
;(var(40)&16)=レベル1用遊びコンボ2封印:こちらもラウンド一回制限
;(var(40)&32)=レベル1用止めコンボ封印:他の遊びコンボからの流用なのでラウンド一回制限
;(var(40)&64)=エリアル始動技のチェーンしゃが大Pを封印:摩擦や食らい判定の関係でスカるタイミングのあるキャラもいるので
;(var(40)&128)=遊びダッシュジャンプコンボ封印:こちらもラウンド一回制限
;(var(40)&256)=遊びダブルハパチャーコンボ封印:こちらもラウンド一回制限
;(var(40)&512)=遊び投げ始動屈大エリアル封印:こちらもラウンド一回制限

;今後もここの記述はかなり増える予定なのでbit式で場所を空けとくことに
;基本的にvar(40)をスイッチとして使いそれ以外の変数は一つ一つが本体のコンボ変数を参照
;設定F経過からスイッチが機能する
;----------------------------------------

[State -2];NJ 判定
type=varset
Trigger1=root,stateno=40
var(42)=1

[State -2];NJ 判定
type=varset
Trigger1=var(42)=1
Trigger1=root,statetype=A
var(42)=2

[State -2];NJ 判定
type=varset
Trigger1=var(42)=2
Trigger1=root,statetype!=A
var(42)=0


[State -2];敵特殊食らい学習
type=null;varset
Trigger1=root,stateno=615
Trigger1=root,movehit = 0
Trigger1=root,time>=11
Trigger1=var(39)>0
var(41)=1

[State -2];敵特殊食らい学習
type=varset
Trigger1=PlayerID(root,var(56)),movetype!=H
Trigger1=var(39)>0
var(41)=1


;敵の仕様上の無敵時間------------------------------------------------------------------------------------
[State -2];敵仕様無敵時間
type=varset
Triggerall=var(44)=0
Triggerall=PlayerID(root,var(56)),stateno=0||PlayerID(root,var(56)),ctrl=1
Trigger1  =PlayerID(root,var(56)),time=1
Trigger1  =PlayerID(root,var(56)),prevstateno=5120
var(44)=12

[State -2];敵仕様無敵時間
type=varadd
Trigger1=var(44)>0
var(44)=-1

;常にコレが正解と言う訳では決してない
;
;処理順補正------------------------------------------------------------------------------------

[State -2];超簡易処理順補正
type=null;
triggerall= playeridexist(root,var(56))
trigger1  = PlayerID(root,var(56)),id<root,id&&!(PlayerID(root,var(56)),movetype!=A&&root,movetype=A||PlayerID(root,var(56)),movetype=A&&root,movetype!=A)
trigger1  = var(45):=1||1
trigger2  = !(PlayerID(root,var(56)),id<root,id&&!(PlayerID(root,var(56)),movetype!=A&&root,movetype=A||PlayerID(root,var(56)),movetype=A&&root,movetype!=A))
trigger2  = var(45):=0||1


[State -2];超簡易処理順補正
type=null;
triggerall= playeridexist(root,var(56))
trigger1  = PlayerID(root,var(56)),id<root,id
;trigger1  =var(45):=1||1
trigger2  = PlayerID(root,var(56)),id>root,id
;trigger2  =var(45):=0||1


;【自分用メモ】
;本体のvar(38):=n-helper(30000+id),var(45)||1のこと
;相手の情報にのみ補正をかけるようにする
;重力の割り出し-------------------------------------------------------------------------------------------
[state ];重力独自出力:敵が空中の場合
type=null
Triggerall=PlayerID(root,var(56)),statetype=A
Trigger1=1||fvar(0):=ceil((PlayerID(root,var(56)),pos y-fvar(1)-fvar(2))*1000.0)*(PlayerID(root,var(56)),pos y<0)/1000.0 ;少数四桁切り上げ
Trigger1=1||fvar(1):=PlayerID(root,var(56)),pos y-fvar(2)
Trigger1=1||fvar(2):=PlayerID(root,var(56)),pos y
ignorehitpause = 1

[state ];重力独自出力:敵が地上の場合
type=null
Triggerall=PlayerID(root,var(56)),statetype!=A
Trigger1=1||fvar(0):=0
ignorehitpause = 1


[State -2];重力独自出力:hitpause後の計算ミス対策に仰け反り中はhitpause終了後3F経過後、計算結果が正の場合
type=parentvarset
Triggerall=PlayerID(root,var(56)),statetype=A
Trigger1=fvar(0)>=0
Trigger1=Numhelper(30010+root,id)
Trigger1=(helper(30010+root,id),var(10)-helper(30010+root,id),var(0))>3||(helper(30010+root,id),var(0)<=0)
fvar(39)=fvar(0)
ignorehitpause =1

[State -2];重力独自出力:hitpause後の計算ミス対策に仰け反り中はhitpause終了後3F経過後、計算結果が負になった場合はCNSから
type=parentvarset
Triggerall=PlayerID(root,var(56)),statetype=A
Trigger1=fvar(0)<0
Trigger1=Numhelper(30010+root,id)
Trigger1=(helper(30010+root,id),var(10)-helper(30010+root,id),var(0))>3||(helper(30010+root,id),var(0)<=0)
fvar(39)=PlayerID(root,var(56)),const(movement.yaccel)
ignorehitpause =1

[State -2];重力独自出力:hitpause終了後3F以内
type=parentvarset
Triggerall=PlayerID(root,var(56)),statetype=A
Trigger1=Numhelper(30010+root,id)
Trigger1=helper(30010+root,id),var(0)>0
Trigger1=helper(30010+root,id),var(10)-helper(30010+root,id),var(0)<=3
fvar(39)=PlayerID(root,var(56)),gethitvar(yaccel)
ignorehitpause =1



;【自分用メモ】
;相手にhitpause終了3F以内は計算結果がおかしくなったり負の値がでたりするので
;(helper(30010+root,id),var(10)-helper(30010+root,id),var(0))で相手のhitpause終了後の時間を計算して
;3以内ではgethitvar(yaccel)を代入して対処してある。
;相手がジャンプした瞬間などにも計算結果がずれるが負の値ならばconst(movement.yaccel)で代用する。
;hitpause終了3F以内もそれでいいんじゃね?とか言わない。
;そもそもメンドクサイvar(10)にhitpause足す必要もない気がする。

;ステージ端でのvel Xの表示対策-------------------------------------------------------------
[State -2];X速度画面端
type = parentVarSet
Trigger1 =1
fvar(14) =PlayerID(root,var(56)),vel X*fvar(13)
ignorehitpause = 1

[State -2];X速度画面端
type = parentVarSet
Trigger1 =1
fvar(13) =PlayerID(root,var(56)),GetHitVar(XVel)*fvar(13)*ifelse(root,fvar(16) <=80,0,1)
ignorehitpause = 1

[State -2];X速度画面端
type =VarSet
Trigger1 = 1
fvar(13) = 1
ignorehitpause = 1


[State -2];X速度画面端
type = VarSet
Trigger1 = root,fvar(16) <=80 && PlayerID(root,var(56)),Vel X < 0
Trigger2 = root,fvar(15) <=80 && PlayerID(root,var(56)),Vel X > 0
fvar(13) = 0
ignorehitpause = 1

;【自分用メモ】
;本体のfvar(13)にはキャンセルコンボ用の数値が入る
;摩擦関連------------------------------------------------------------------------------------------------------------------
[state 即屈大P]
type = null;
TriggerAll=1||fvar(19):=0&&fvar(16):=PlayerID(root,var(56)),GetHitVar(XVel)*PlayerID(root,var(56)),Facing
TriggerAll=1||fvar(19):=fvar(19)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(19));1
TriggerAll=1||fvar(19):=fvar(19)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(19));2
TriggerAll=1||fvar(19):=fvar(19)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(19));3
TriggerAll=1||fvar(19):=fvar(19)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(19));4
TriggerAll=1||fvar(19):=fvar(19)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(19));5
TriggerAll=1||fvar(19):=fvar(19)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(19));6
TriggerAll=1||fvar(19):=fvar(19)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(19));7
TriggerAll=1||fvar(19):=fvar(19)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(19));8
TriggerAll=1||fvar(19):=fvar(19)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(19));9
TriggerAll=1||fvar(19):=fvar(19)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(19));10
TriggerAll=1||fvar(19):=fvar(19)*ifelse(PlayerID(root,var(56)),statetype=A,0,ifelse(PlayerID(root,var(56)),movetype=H,1,0))
Trigger1 =1|| fvar(17):= 1
Trigger1 = PlayerID(root,var(56)),StateType != A 
Trigger1 =1|| fvar(17) := IfElse((PlayerID(root,var(56)),StateType = S), (PlayerID(root,var(56)),Const(Movement.Stand.Friction)),(PlayerID(root,var(56)),Const(Movement.Crouch.Friction)))


[state 歩屈大P]
type = null;
TriggerAll=1||fvar(20):=0&&fvar(16):=PlayerID(root,var(56)),vel X*PlayerID(root,var(56)),Facing
TriggerAll=1||fvar(20):=fvar(20)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(20));1
TriggerAll=1||fvar(20):=fvar(20)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(20));2
TriggerAll=1||fvar(20):=fvar(20)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(20));3
TriggerAll=1||fvar(20):=fvar(20)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(20));4
TriggerAll=1||fvar(20):=fvar(20)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(20));5
TriggerAll=1||fvar(20):=fvar(20)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(20));6
TriggerAll=1||fvar(20):=fvar(20)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(20));7
TriggerAll=1||fvar(20):=fvar(20)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(20));8
TriggerAll=1||fvar(20):=fvar(20)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(20));9
TriggerAll=1||fvar(20):=fvar(20)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(20));10
TriggerAll=1||fvar(20):=fvar(20)*ifelse(PlayerID(root,var(56)),statetype=A,0,ifelse(PlayerID(root,var(56)),movetype=H,1,0))
Trigger1 =1|| fvar(17) := 1
Trigger1 = PlayerID(root,var(56)),StateType != A
Trigger1 =1|| fvar(17) := IfElse((PlayerID(root,var(56)),StateType = S), (PlayerID(root,var(56)),Const(Movement.Stand.Friction)),(PlayerID(root,var(56)),Const(Movement.Crouch.Friction)))


[state 歩き屈小P]
type = null;
TriggerAll=1||fvar(21):=0&&fvar(16):=PlayerID(root,var(56)),vel X*PlayerID(root,var(56)),Facing
TriggerAll=1||fvar(21):=fvar(21)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(21));1
TriggerAll=1||fvar(21):=fvar(21)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(21));2
TriggerAll=1||fvar(21):=fvar(21)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(21));3
TriggerAll=1||fvar(21):=fvar(21)*ifelse(PlayerID(root,var(56)),statetype=A,0,ifelse(PlayerID(root,var(56)),movetype=H,1,0))
Trigger1 =1|| fvar(17) := 1
Trigger1 = PlayerID(root,var(56)),StateType != A
Trigger1 =1|| fvar(17) := IfElse((PlayerID(root,var(56)),StateType = S), (PlayerID(root,var(56)),Const(Movement.Stand.Friction)),(PlayerID(root,var(56)),Const(Movement.Crouch.Friction)))

[state 即屈中P]
type = null;
TriggerAll=1||fvar(22):=0&&fvar(16):=PlayerID(root,var(56)),GetHitVar(XVel)*PlayerID(root,var(56)),Facing
TriggerAll=1||fvar(22):=fvar(22)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(22));1
TriggerAll=1||fvar(22):=fvar(22)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(22));2
TriggerAll=1||fvar(22):=fvar(22)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(22));3
TriggerAll=1||fvar(22):=fvar(22)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(22));4
TriggerAll=1||fvar(22):=fvar(22)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(22));5
TriggerAll=1||fvar(22):=fvar(22)*ifelse(PlayerID(root,var(56)),statetype=A,0,ifelse(PlayerID(root,var(56)),movetype=H,1,0))
Trigger1 =1|| fvar(17) := 1
Trigger1 = PlayerID(root,var(56)),StateType != A
Trigger1 =1|| fvar(17) := IfElse((PlayerID(root,var(56)),StateType = S), (PlayerID(root,var(56)),Const(Movement.Stand.Friction)),(PlayerID(root,var(56)),Const(Movement.Crouch.Friction)))

[state キャンセルチャージングリーチ最高時のフレーム]
type = null;
TriggerAll=1||fvar(23):=0&&fvar(16):=PlayerID(root,var(56)),GetHitVar(XVel)*PlayerID(root,var(56)),Facing
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));1
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));2
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));3
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));4
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));5
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));6
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));7
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));8
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));9
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));10
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));11
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));12
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));13
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));14
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));15
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));16
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));17
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));18
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));19
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));20
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));21
TriggerAll=1||fvar(23):=fvar(23)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(23));22
TriggerAll=1||fvar(23):=fvar(23)*ifelse(PlayerID(root,var(56)),statetype=A,0,ifelse(PlayerID(root,var(56)),movetype=H,1,0))
Trigger1 =1|| fvar(17) := 1
Trigger1 = PlayerID(root,var(56)),StateType != A
Trigger1 =1|| fvar(17) := IfElse((PlayerID(root,var(56)),StateType = S), (PlayerID(root,var(56)),Const(Movement.Stand.Friction)),(PlayerID(root,var(56)),Const(Movement.Crouch.Friction)))

[state 歩き屈中P];盾無し
type = null;
TriggerAll=1||fvar(24):=0&&fvar(16):=PlayerID(root,var(56)),vel X*PlayerID(root,var(56)),Facing
TriggerAll=1||fvar(24):=fvar(24)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(24));1
TriggerAll=1||fvar(24):=fvar(24)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(24));2
TriggerAll=1||fvar(24):=fvar(24)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(24));3
TriggerAll=1||fvar(24):=fvar(24)+(fvar(16):=fvar(16)*fvar(17))*(PlayerID(root,var(56)),BackEdgeDist>10+fvar(24));4
TriggerAll=1||fvar(24):=fvar(24)*ifelse(PlayerID(root,var(56)),statetype=A,0,ifelse(PlayerID(root,var(56)),movetype=H,1,0))
Trigger1 =1|| fvar(17) := 1
Trigger1 = PlayerID(root,var(56)),StateType != A
Trigger1 =1|| fvar(17) := IfElse((PlayerID(root,var(56)),StateType = S), (PlayerID(root,var(56)),Const(Movement.Stand.Friction)),(PlayerID(root,var(56)),Const(Movement.Crouch.Friction)))







;【自分用メモ】fvar(25)以上はスイッチ利用化
;確認:いじらないこと-----------------------------------------------------------------------------

[State -2];かならず切ること
type=parentvarset
Trigger1=!(root,var(55))
var(55)=0;

[State -2];かならず切ること
type=parentvarset
Trigger1=!(root,var(58))
var(58)=0;

;---------------------------------------------------------------------------------------
[State -2, デバック(変数確認)]
Type = DisplayToClipBoard
Trigger1 = 1
Text = "var(26)=%d,var(14)=%d,game=%d\n"
Params = var(26),var(14),gametime
IgnoreHitPause = 1


[State -2, 距離確認デバック]
type = AppendToClipboard
Trigger1 = 1
Text = "(var(40)&1)=%d,(var(40)&2)=%d,(var(40)&4)=%d,(var(40)&256)=%d,(var(40)&2)=%d\n"
Params = (var(40)&1),(var(40)&2),(var(40)&4),(var(40)&256),(var(40)&2)
IgnoreHitPause = 1

[Statedef 30010]
type=A
movetype=I
physics=N
ctrl=0
anim=9999
sprpriority=0

[State 30010]
type=velset
Trigger1=time=0
Trigger1=prevstateno!=30012
x=10
y=0

[State 9741, Safety]
type=selfstate
Trigger1=!ishelper
value=0



[State 30000]
type=ScreenBound
Trigger1=1
value=0
movecamera=0,0

[State 30000]
type=Projectile
Trigger1=time=0
Trigger1=prevstateno!=30012
projID=30011
projanim=9999
velocity=10, 0
projpriority=4
projsprpriority=2
projedgebound=99999
projstagebound=0
offset=0, 0
postype=left
supermovetime=99999
pausemovetime=99999
projremovetime=-1

[State -2]
type=assertspecial
Trigger1=1
flag=noshadow
flag2=invisible
ignorehitpause=1

[State -2]
type=Nothitby
Trigger1=1
value=SCA


[State -2]
type=velset
Trigger1=!(root,NumprojID(30011))
x=0
y=0


[State -2];受身不能時間
type=varadd
Trigger1=var(0) > 0
var(0)=-1
ignorehitpause=1


[State -2];受身不能時間
type=varset
Triggerall=PlayerID(root,var(56)),stateno > 199
Triggerall=PlayerID(root,var(56)),Movetype=H
Triggerall=PlayerID(root,var(56)),statetype!=L
Trigger1=PlayerID(root,var(56)),gethitvar(fall)
Trigger1=!(PlayerID(root,var(56)),hitshakeover)
Trigger1=PlayerID(root,var(56)),time=1
var(0)=PlayerID(root,var(56)),gethitvar(fall.recovertime)-1
ignorehitpause=1

[State -2];のけぞり時間
type=varset
Triggerall=PlayerID(root,var(56)),Movetype=H
Triggerall=PlayerID(root,var(56)),stateno > 199
Trigger1=!PlayerID(root,var(56)),gethitvar(fall)
Trigger1=!(PlayerID(root,var(56)),hitshakeover)
Trigger1=PlayerID(root,var(56)),time=1
var(0)=PlayerID(root,var(56)),gethitvar(hittime)+PlayerID(root,var(56)),gethitvar(hitshaketime)+1
ignorehitpause=1

[State -2];のけぞり時間
type=varset
Trigger1 =PlayerID(root,var(56)),Movetype!=H
Trigger2 =PlayerID(root,var(56)),stateno <199
Trigger3 =PlayerID(root,var(56)),ctrl=1
var(0)=0
ignorehitpause=1

[State -2];ガード硬直
type=varset
Triggerall=root,Movetype=H
Triggerall=root,stateno<200
Triggerall=root,Statetype!=A
Trigger1=!root,gethitvar(fall)
Trigger1=!(root,hitshakeover)
Trigger1=PlayerID(root,var(56)),time=1 || var(1)=0
var(1)=ifelse(root,gethitvar(ctrltime)<root,gethitvar(hittime),root,gethitvar(ctrltime),root,gethitvar(hittime))+root,gethitvar(hitshaketime)+1
ignorehitpause=1
[State -2];ガード硬直
type=varset
Triggerall=PlayerID(root,var(56)),Movetype=H
Triggerall=PlayerID(root,var(56)),stateno < 200
Triggerall=PlayerID(root,var(56)),Statetype=A
Trigger1=!PlayerID(root,var(56)),gethitvar(fall)
Trigger1=!(PlayerID(root,var(56)),hitshakeover)
Trigger1=PlayerID(root,var(56)),time=1 || var(0)=0
var(2)=PlayerID(root,var(56)),gethitvar(ctrltime)+PlayerID(root,var(56)),gethitvar(hitshaketime)+1
ignorehitpause=1

[State -2];ガード硬直
type=varset
Triggerall=PlayerID(root,var(56)),Movetype=H
Triggerall=PlayerID(root,var(56)),stateno < 200
Triggerall=PlayerID(root,var(56)),Statetype!=A
Trigger1=!PlayerID(root,var(56)),gethitvar(fall)
Trigger1=!(PlayerID(root,var(56)),hitshakeover)
Trigger1=PlayerID(root,var(56)),time=1 || var(0)=0
var(2)=ifelse(PlayerID(root,var(56)),gethitvar(ctrltime)<PlayerID(root,var(56)),gethitvar(hittime),PlayerID(root,var(56)),gethitvar(ctrltime),PlayerID(root,var(56)),gethitvar(hittime))+PlayerID(root,var(56)),gethitvar(hitshaketime)+1
ignorehitpause=1

[State -2];自分
type=varadd
Trigger1=var(1) > 0
var(1)=-1
ignorehitpause=1

[State -2];敵
type=varadd
Trigger1=var(2) > 0
var(2)=-1
ignorehitpause=1


;(30000+id)での重力用に最大値を保存---------------------------------------------------------------------------------
[State -2];受身不能時間
type=varset
Triggerall=PlayerID(root,var(56)),stateno > 199
Triggerall=PlayerID(root,var(56)),Movetype=H
Triggerall=PlayerID(root,var(56)),statetype!=L
Trigger1=PlayerID(root,var(56)),gethitvar(fall)
Trigger1=!(PlayerID(root,var(56)),hitshakeover)
Trigger1=PlayerID(root,var(56)),time=1
var(10)=PlayerID(root,var(56)),gethitvar(fall.recovertime)-1
ignorehitpause=1

[State -2];のけぞり時間
type=varset
Triggerall=PlayerID(root,var(56)),Movetype=H
Triggerall=PlayerID(root,var(56)),stateno > 199
Trigger1=!PlayerID(root,var(56)),gethitvar(fall)
Trigger1=!(PlayerID(root,var(56)),hitshakeover)
Trigger1=PlayerID(root,var(56)),time=1
var(10)=PlayerID(root,var(56)),gethitvar(hittime)+PlayerID(root,var(56)),gethitvar(hitshaketime)+1
ignorehitpause=1

[State -2];のけぞり時間
type=varset
Trigger1 =PlayerID(root,var(56)),Movetype!=H
Trigger2 =PlayerID(root,var(56)),stateno <199
Trigger3 =PlayerID(root,var(56)),ctrl=1
var(10)=0
ignorehitpause=1

[State -2];受身不能時間
type=varadd
Triggerall=PlayerID(root,var(56)),gethitvar(hitshaketime)-2>0
Trigger1=var(10) > 0
var(10)=-1
ignorehitpause=1

;無駄に記述量増やしてある
;暗転検知用gametime---------------------------------------------------------------------------------

[State -3]
type = varset
Trigger1 =1
var(21) = gametime
IgnoreHitPause = 1

;このヘルパーは本体と同じステータスなので本体変数を使わなくても検知可能
;ただ何故かhelper(30000+root,id)のgametimeと毎F1のズレがある
;謎

;投げ無敵学習---------------------------------------------------------------------------------

[State -3,投げ無敵学習]
type = varset
Trigger1 =root,stateno=840||root,stateno=800
var(31) = PlayerID(root,var(56)),stateno
IgnoreHitPause = 1


[State -3,投げ無敵学習]
type = varset
Triggerall = var(31)!=0
Trigger1   = PlayerID(root,var(56)),movetype = H
Trigger2   = PlayerID(root,var(56)),ctrl=1
Trigger3   = PlayerID(root,var(56)),stateno<200
Trigger4   = PlayerID(root,var(56)),statetype=L
Trigger5   = root,stateno=800||root,stateno=840
Trigger5   = root,movecontact
var(31) = 0
IgnoreHitPause = 1

[State -3,投げ無敵学習]
type = varset
Trigger1 =var(32)=0
Trigger1 =var(31)>199
var(32) = var(31)
IgnoreHitPause = 1

[State -3,投げ無敵学習]
type = varset
Trigger1 =var(33)=0
Trigger1 =var(31)!=var(32)
Trigger1 =var(31)>199
var(33) = var(31)
IgnoreHitPause = 1

[State -3,投げ無敵学習]
type = varset
Trigger1 =var(34)=0
Trigger1 =var(31)!=var(32)
Trigger1 =var(31)!=var(33)
Trigger1 =var(31)>199
var(34) = var(31)
IgnoreHitPause = 1

[State -3,投げ無敵学習]
type = varset
Triggerall =PlayerID(root,var(56)),stateno>199
Trigger1 =PlayerID(root,var(56)),stateno=var(32)
Trigger2 =PlayerID(root,var(56)),stateno=var(33)
Trigger3 =PlayerID(root,var(56)),stateno=var(34)
var(35) = 1
IgnoreHitPause = 1

[State -3,投げ無敵学習]
type = varset
Trigger1 =PlayerID(root,var(56)),stateno!=var(32)
Trigger1 =PlayerID(root,var(56)),stateno!=var(33)
Trigger1 =PlayerID(root,var(56)),stateno!=var(34)
var(35) = 0
IgnoreHitPause = 1


[State -3,投げ無敵学習]
type = null;varset
Triggerall =var(31)>199
Trigger1 =var(31)=var(32)
Trigger2 =var(31)=var(33)
Trigger3 =var(31)=var(34)
var(35) = 1
IgnoreHitPause = 1

[State -3,投げ無敵学習]
type = null;varset
Trigger1 =var(31)!=var(32)
Trigger1 =var(31)!=var(33)
Trigger1 =var(31)!=var(34)
var(35) = 0
IgnoreHitPause = 1


[State -3,投げ無敵学習予備]
type = varset
Trigger1   = PlayerID(root,var(56)),movetype = H
Trigger2   = PlayerID(root,var(56)),ctrl=1
Trigger3   = PlayerID(root,var(56)),stateno<200
Trigger4   = PlayerID(root,var(56)),statetype=L
Trigger5   = root,stateno=800||root,stateno=840
Trigger5   = root,movecontact
var(35) = 0
IgnoreHitPause = 1
;受け身狩り学習----------------------------------------------------------------------
[State -2, 空中受身判定]
Type = varset
TriggerAll = var(41) = 0
TriggerAll = root,StateType = A
Trigger1 = root,stateno = [5200,5299]
var(41) = 1
IgnoreHitPause = 1



[State -2]
Type = varset
Trigger1 = var(41) = 1
Trigger1 = root,StateType != A
var(41) = 0
IgnoreHitPause = 1



[State -2, 受身狩り判定(空中受身限定)]
Type = varset
;TriggerAll = root,stateno != [120,155]
TriggerAll = root,movetype=H
TriggerAll = var(42) = 0
Trigger1 =var(41)=1
var(42) =PlayerID(root,var(56)),stateno+floor(abs(root,p2dist y))*10000
IgnoreHitPause = 1

;DANGER補正------------------------------------------------------------------

[State DefenceMulSetの値]
type=varset
trigger1 = root,life>250
fvar(1) = 0+(root,var(59)>0)*0.75
ignorehitpause=1

[State DefenceMulSetの値]
type=varset
trigger1 = root,life=[125,250]
fvar(1) = (1-(root,var(59)>0)*0.25)*0.6
ignorehitpause=1

[State DefenceMulSetの値]
type=varset
trigger1 = root,life=[0,124]
fvar(1) = (1-(root,var(59)>0)*0.25)*0.5
ignorehitpause=1

[State 後回復flag1]
type=varset
trigger1 =fvar(1)>0&&fvar(1)<1
trigger1 =root,anim!=[120,159]
trigger1 =root,GetHitVar(hitcount)=1
trigger1 =root,life>=root,lifemax-ceil(root,gethitvar(damage)-(root,gethitvar(damage)*fvar(1)))
var(50) = 1-(root,gethitvar(damage)=root,life)
ignorehitpause=1

[State 後回復flag2]
type=varset
trigger1 =fvar(1)>0&&fvar(1)<1
trigger1 =root,anim!=[120,159]
trigger1 =root,GetHitVar(hitcount)=1
trigger1 =var(50)
trigger1 =root,life>=root,lifemax-ceil(root,gethitvar(damage)-(root,gethitvar(damage)*fvar(1)))
var(52) = root,life
ignorehitpause=1

[State 疑似防御up-後回復1-回復値格納]
type=varset
trigger1 =fvar(1)>0&&fvar(1)<1
trigger1 =var(50)
trigger1 =var(52)=root,life
trigger1 =root,anim!=[120,159]
trigger1 =root,gethitvar(damage)
trigger1 =root,GetHitVar(hitcount)=1
var(51) = ceil(root,gethitvar(damage)-(root,gethitvar(damage)*fvar(1)))
ignorehitpause=1

[State flag解除]
type=varrangeset
trigger1 =var(52)>root,life
trigger2 =fvar(1)=0||fvar(1)>=1
trigger3 =root,GetHitVar(hitcount)!=1
trigger4 =root,anim=[120,159]
first = 50
last = 52
value = 0
ignorehitpause=1
;------------------------------------------------------------------------------------
[State -2, デバック(変数確認)]
Type = DisplayToClipBoard
Trigger1 = 1
Text = "var(0)=%d,var(31)=%d,var(32)=%d,var(41)=%d,var(42)=%d\n"
Params = var(0),var(31),var(32),var(41),var(42)
IgnoreHitPause = 1

[State -2, デバック(変数確認)]
Type = AppendToClipBoard
Trigger1 = 1
Text = "var(21)=%d\n"
Params = var(21)
IgnoreHitPause = 1

;-------------------------------------------------------------------------------------
[Statedef 40000];
Type = A 
MoveType = I
Physics = N
Ctrl = 0
Anim = 0
SprPriority = -5

[State -2, AssertSpecial];特殊処理
Type = AssertSpecial
Trigger1 = 1
flag = Invisible
flag2 = Noshadow
ignorehitpause=1

[State -2, NotHitBy]
Type = NotHitBy
Value = SCA
Trigger1 = 1
IgnoreHitPause = 1

[State 40000, Turn];振り向き
Type = turn
Trigger1 = Facing != root,Facing ;本体と異なる向きなら

[State 40000, Posset in Parent];座標Xを本体にあわせる
Type = Posset
Trigger1 = 1
X = root,Pos X

[State 40000, Posadd 100];座標+100（本体から+100へずらす）
Type = Posadd
Trigger1 = 1
X =100
[State 40000, Front GuardDist varset];前側のInGuardDistを代入
Type = Varset
var(58) = InGuardDist
Trigger1 = 1

[State 40000, Posadd -200];座標-200（本体から-100へずらす）
Type = Posadd
Trigger1 = 1
X = -200

[State 40000, Back GuardDist varset];後ろ側のInGuardDistを代入
Type = Varset
var(59) = InGuardDist
Trigger1 = 1

[State 40000, Posadd 100];座標+100（本体と同座標にもどす）
Type = Posadd
Trigger1 = 1
X = 100



[State -3];null式発生学習:初回
Type = null
Triggerall = var(57) < 57
Triggerall = PlayerID(root,var(56)),stateno=[200,99999]
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(0)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(1)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(2)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(3)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(4)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(5)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(6)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(7)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(8)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(9)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(10)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(11)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(12)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(13)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(14)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(15)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(16)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(17)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(18)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(19)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(20)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(21)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(22)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(23)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(24)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(25)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(26)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(27)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(28)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(29)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(30)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(31)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(32)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(33)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(34)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(35)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(36)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(37)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(38)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(39)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(40)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(41)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(42)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(43)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(44)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(45)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(46)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(47)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(48)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(49)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(50)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(51)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(52)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(53)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(54)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(55)%100000)
Triggerall = PlayerID(root,var(56)),stateno!=floor(var(56)%100000)
Triggerall = fvar(0):=-1||1																		;一応
Triggerall = PlayerID(root,var(56)),movetype = A
Triggerall = !(var(var(57)))
Trigger1 = root,stateno = 150 || root,stateno = 152 || root,stateno = 154
Trigger1 = root,time = 1
Trigger1 = var(var(57)):=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*100000||1
Trigger1 = var(57):=var(57)+1||1
Trigger2 = PlayerID(root,var(56)),movecontact
Trigger2 = PlayerID(root,var(56)),hitcount = 1
Trigger2 = var(var(57)):=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*100000||1
Trigger2 = var(57):=var(57)+1||1
Trigger3 = root,stateno = 2222
Trigger3 = root,time = 1
Trigger3 = var(var(57)):=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*100000||1
Trigger3 = var(57):=var(57)+1||1

[State -3];null式発生学習:time更新用判断変数セット
Type = null
Triggerall = var(57) < 57
Triggerall = PlayerID(root,var(56)),movetype = A
Triggerall = PlayerID(root,var(56)),stateno=[200,99999]
;//不具合ありそうなので、fvar(0)=0は代入だけで計算は手動。ホントに一応ってだけの話
Trigger1   = PlayerID(root,var(56)),stateno=floor(var(0)%100000)
Trigger1   = fvar(0):=0||1
Trigger2   = PlayerID(root,var(56)),stateno=floor(var(1)%100000)
Trigger2   = fvar(0):=1||1
Trigger3   = PlayerID(root,var(56)),stateno=floor(var(2)%100000)
Trigger3   = fvar(0):=2||1
Trigger4   = PlayerID(root,var(56)),stateno=floor(var(3)%100000)
Trigger4   = fvar(0):=3||1
Trigger5   = PlayerID(root,var(56)),stateno=floor(var(4)%100000)
Trigger5   = fvar(0):=4||1
Trigger6   = PlayerID(root,var(56)),stateno=floor(var(5)%100000)
Trigger6   = fvar(0):=5||1
Trigger7   = PlayerID(root,var(56)),stateno=floor(var(6)%100000)
Trigger7   = fvar(0):=6||1
Trigger8   = PlayerID(root,var(56)),stateno=floor(var(7)%100000)
Trigger8   = fvar(0):=7||1
Trigger9   = PlayerID(root,var(56)),stateno=floor(var(8)%100000)
Trigger9   = fvar(0):=8||1
Trigger10  = PlayerID(root,var(56)),stateno=floor(var(9)%100000)
Trigger10  = fvar(0):=9||1
Trigger11  = PlayerID(root,var(56)),stateno=floor(var(10)%100000)
Trigger11  = fvar(0):=10||1
Trigger12  = PlayerID(root,var(56)),stateno=floor(var(11)%100000)
Trigger12  = fvar(0):=11||1
Trigger13  = PlayerID(root,var(56)),stateno=floor(var(12)%100000)
Trigger13  = fvar(0):=12||1
Trigger14  = PlayerID(root,var(56)),stateno=floor(var(13)%100000)
Trigger14  = fvar(0):=13||1
Trigger15  = PlayerID(root,var(56)),stateno=floor(var(14)%100000)
Trigger15  = fvar(0):=14||1
Trigger16  = PlayerID(root,var(56)),stateno=floor(var(15)%100000)
Trigger16  = fvar(0):=15||1
Trigger17  = PlayerID(root,var(56)),stateno=floor(var(16)%100000)
Trigger17  = fvar(0):=16||1
Trigger18  = PlayerID(root,var(56)),stateno=floor(var(17)%100000)
Trigger18  = fvar(0):=17||1
Trigger19  = PlayerID(root,var(56)),stateno=floor(var(18)%100000)
Trigger19  = fvar(0):=18||1
Trigger20  = PlayerID(root,var(56)),stateno=floor(var(19)%100000)
Trigger20  = fvar(0):=19||1
Trigger21  = PlayerID(root,var(56)),stateno=floor(var(20)%100000)
Trigger21  = fvar(0):=20||1
Trigger22  = PlayerID(root,var(56)),stateno=floor(var(21)%100000)
Trigger22  = fvar(0):=21||1
Trigger23  = PlayerID(root,var(56)),stateno=floor(var(22)%100000)
Trigger23  = fvar(0):=22||1
Trigger24  = PlayerID(root,var(56)),stateno=floor(var(23)%100000)
Trigger24  = fvar(0):=23||1
Trigger25  = PlayerID(root,var(56)),stateno=floor(var(24)%100000)
Trigger25  = fvar(0):=24||1
Trigger26  = PlayerID(root,var(56)),stateno=floor(var(25)%100000)
Trigger26  = fvar(0):=25||1
Trigger27  = PlayerID(root,var(56)),stateno=floor(var(26)%100000)
Trigger27  = fvar(0):=26||1
Trigger28  = PlayerID(root,var(56)),stateno=floor(var(27)%100000)
Trigger28  = fvar(0):=27||1
Trigger29  = PlayerID(root,var(56)),stateno=floor(var(28)%100000)
Trigger29  = fvar(0):=28||1
Trigger30  = PlayerID(root,var(56)),stateno=floor(var(29)%100000)
Trigger30  = fvar(0):=29||1
Trigger31  = PlayerID(root,var(56)),stateno=floor(var(30)%100000)
Trigger31  = fvar(0):=30||1
Trigger32  = PlayerID(root,var(56)),stateno=floor(var(31)%100000)
Trigger32  = fvar(0):=31||1
Trigger33  = PlayerID(root,var(56)),stateno=floor(var(32)%100000)
Trigger33  = fvar(0):=32||1
Trigger34  = PlayerID(root,var(56)),stateno=floor(var(33)%100000)
Trigger34  = fvar(0):=33||1
Trigger35  = PlayerID(root,var(56)),stateno=floor(var(34)%100000)
Trigger35  = fvar(0):=34||1
Trigger36  = PlayerID(root,var(56)),stateno=floor(var(35)%100000)
Trigger36  = fvar(0):=35||1
Trigger37  = PlayerID(root,var(56)),stateno=floor(var(36)%100000)
Trigger37  = fvar(0):=36||1
Trigger38  = PlayerID(root,var(56)),stateno=floor(var(37)%100000)
Trigger38  = fvar(0):=37||1
Trigger39  = PlayerID(root,var(56)),stateno=floor(var(38)%100000)
Trigger39  = fvar(0):=38||1
Trigger40  = PlayerID(root,var(56)),stateno=floor(var(39)%100000)
Trigger40  = fvar(0):=39||1
Trigger41  = PlayerID(root,var(56)),stateno=floor(var(40)%100000)
Trigger41  = fvar(0):=40||1
Trigger42  = PlayerID(root,var(56)),stateno=floor(var(41)%100000)
Trigger42  = fvar(0):=41||1
Trigger43  = PlayerID(root,var(56)),stateno=floor(var(42)%100000)
Trigger43  = fvar(0):=42||1
Trigger44  = PlayerID(root,var(56)),stateno=floor(var(43)%100000)
Trigger44  = fvar(0):=43||1
Trigger45  = PlayerID(root,var(56)),stateno=floor(var(44)%100000)
Trigger45  = fvar(0):=44||1
Trigger46  = PlayerID(root,var(56)),stateno=floor(var(45)%100000)
Trigger46  = fvar(0):=45||1
Trigger47  = PlayerID(root,var(56)),stateno=floor(var(46)%100000)
Trigger47  = fvar(0):=46||1
Trigger48  = PlayerID(root,var(56)),stateno=floor(var(47)%100000)
Trigger48  = fvar(0):=47||1
Trigger49  = PlayerID(root,var(56)),stateno=floor(var(48)%100000)
Trigger49  = fvar(0):=48||1
Trigger50  = PlayerID(root,var(56)),stateno=floor(var(49)%100000)
Trigger50  = fvar(0):=49||1
Trigger51  = PlayerID(root,var(56)),stateno=floor(var(50)%100000)
Trigger51  = fvar(0):=50||1
Trigger52  = PlayerID(root,var(56)),stateno=floor(var(51)%100000)
Trigger52  = fvar(0):=51||1
Trigger53  = PlayerID(root,var(56)),stateno=floor(var(52)%100000)
Trigger53  = fvar(0):=52||1
Trigger54  = PlayerID(root,var(56)),stateno=floor(var(53)%100000)
Trigger54  = fvar(0):=53||1
Trigger55  = PlayerID(root,var(56)),stateno=floor(var(54)%100000)
Trigger55  = fvar(0):=54||1
Trigger56  = PlayerID(root,var(56)),stateno=floor(var(55)%100000)
Trigger56  = fvar(0):=55||1
Trigger57  = PlayerID(root,var(56)),stateno=floor(var(56)%100000)
Trigger57  = fvar(0):=56||1


[State -3];null式発生学習:time更新実行:(0)以上の場合
Type = null
Triggerall = fvar(0)>0
Triggerall = var(57) >0
Triggerall = PlayerID(root,var(56)),movetype = A
Triggerall = PlayerID(root,var(56)),stateno=[200,99999]
Trigger1 = root,stateno = 150 || root,stateno = 152 || root,stateno = 154
Trigger1 = root,time = 1
Trigger1 = var(floor(fvar(0)))/100000>PlayerID(root,var(56)),time
Trigger1 = var(floor(fvar(0))):=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*100000||1
Trigger2 = PlayerID(root,var(56)),movecontact
Trigger2 = PlayerID(root,var(56)),hitcount = 1
Trigger2 = var(floor(fvar(0)))/100000>PlayerID(root,var(56)),time
Trigger2 = var(floor(fvar(0))):=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*100000||1
Trigger3 = root,stateno = 2222
Trigger3 = root,time = 1
Trigger3 = var(floor(fvar(0)))/100000>PlayerID(root,var(56)),time
Trigger3 = var(floor(fvar(0))):=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*100000||1

[State -3];null式発生学習:time更新実行:(0)の場合
Type = null
Triggerall = var(0)!=0
Triggerall = var(57) >0
Triggerall = PlayerID(root,var(56)),movetype = A
Triggerall = PlayerID(root,var(56)),stateno=[200,99999]
Triggerall = PlayerID(root,var(56)),stateno=floor(var(0)%100000)
Trigger1 = root,stateno = 150 || root,stateno = 152 || root,stateno = 154
Trigger1 = root,time = 1
Trigger1 = var(0)/100000>PlayerID(root,var(56)),time
Trigger1 = var(0):=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*100000||1
Trigger2 = PlayerID(root,var(56)),movecontact
Trigger2 = PlayerID(root,var(56)),hitcount = 1
Trigger2 = var(0)/100000>PlayerID(root,var(56)),time
Trigger2 = var(0):=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*100000||1
Trigger3 = root,stateno = 2222
Trigger3 = root,time = 1
Trigger3 = var(0)/100000>PlayerID(root,var(56)),time
Trigger3 = var(0):=PlayerID(root,var(56)),stateno+PlayerID(root,var(56)),time*100000||1

;【自分用メモ】
;ここで学習できる相手statenoは200から99999の間の打撃攻撃のみ
;本体では結果から/100000したものを発生F、%100000したものをステートとして扱える
;更新判断作ってる最中に「ループ文にしたほう楽なんじゃね?」とか思ったけど、ちゃんと動いてるっぽいんで問題なし
;
;使用変数
;var(0) - var(56):発生F*100000+stateno
;var(57)         :カウンタ
;fvar(0)         :更新用判断変数(過去にvar(57)に入ってた数字が入る。この辺はもっと工夫出来るハズ)



[State -2, 距離確認デバック]
type = null;DisplayToClipboard
Trigger1 = 1
Text = "fvar(0)=%d,(var(40)&2)=%d,(var(40)&4)=%d,(var(40)&256)=%d,(var(40)&2)=%d\n"
Params = floor(fvar(0)),(var(40)&2),(var(40)&4),(var(40)&256),(var(40)&2)
IgnoreHitPause = 1


[State -2, 距離確認デバック]
type = DisplayToClipboard
Trigger1 = 1
Text = "var(0)=%d\n"
Params = var(0)
IgnoreHitPause = 1


;--------------------------------------------------
;var(0):飛び道具対策変数１　相手攻撃判断＆カウントダウン用
;var(1):飛び道具対策変数２　反応までのカウントアップ用
;var(2):飛び道具の後ろ側をガードするための変数
;var(3)~var(53):ヘルパーリダイレクト用
;var(54):最大ループ回数設定
;var(55):30020,30029ループカウント用
;var(56):30022ループカウント用
;var(57):リダイレクト変数のうち、現在の最高の値
;var(58):結果から状況判断
;var(59):対策テスト用

;fvar(0)~fvar(x):ｘ速度など。確率変動に使う

;※var(3+var(55))が、「現在調査中のＩＤ用変数」

;全員共通のループステート１
[Statedef 30020]
type=A
movetype=I
physics=N
ctrl=0
anim=9999
sprpriority=0
velset=0,0

[State -2];ループ回数設定
type=varset
Trigger1=!var(54)
var(54)=40

;ＩＤ探索ステートへ
[State -2]
type=ChangeState
Triggerall=!Numhelper(30021+root,id);このＦの中でまだＩＤ予測をしていない（失敗していない）
Trigger1=var(56)!=-1||prevstateno=30029;このＦの中でまだＩＤ探索に失敗していない
Trigger1=!PlayerIDexist(var(3+var(55)));変数が現在使用中ではない
value=30022

;透明化
[State -2]
type=assertspecial
Trigger1=1
flag=noshadow
flag2=invisible
ignorehitpause=1

;無敵化
[State -2]
type=Nothitby
Trigger1=1
value=SCA

;本体と敵との中間に配置
[State -2]
type=posset
Trigger1=1
x=(root,pos x+PlayerID(root,var(56)),pos x)/2.0

;本体と同じ向き
[State -2]
type=turn
Trigger1=facing!=root,facing

;本体の近くに飛び道具があるなら警戒
[State 30020]
type=varset
Trigger1=PlayerIDExist(var(3+var(55)))
Trigger1=PlayerID(var(3+var(55))),movetype=A
Trigger1=abs(root,pos y-PlayerID(var(3+var(55))),pos y)<200
Trigger1=abs(PlayerID(var(3+var(55))),pos x-root,pos x)<=200
var(2)=5


;ＩＤ用変数の最高値記録
[State 30020]
type=varset
Trigger1=var(57)<var(3+var(55))
var(57)=var(3+var(55))

;ループバック
[State 30020]
type=Changestate
Trigger1=!Numhelper(30021+root,id)	;何か見つかった１
Trigger1=var(56)!=-1	;何か見つかった２
Trigger1=var(55)<var(54)	;ループが指定回数未満
Trigger1=var(55):=var(55)+1||1	;インクリメント（ループカウンタ増加処理）
value=30020


[State -2];カウンタ初期化
type=VarSet
Trigger1=1
var(55)=0

;inguarddist系反応判断用
[State -2]
type=VarAdd
Trigger1=var(0)>0
var(0)=-1

;inguarddist系反応判断用
[State -2]
type=VarSet
Trigger1=!PlayerID(root,var(56)),ctrl&&PlayerID(root,var(56)),stateno>=200
Trigger2=inguarddist
Trigger3=root,inguarddist
var(0)=15

;inguarddist系反応判断用
[State -2]
type=VarAdd
Trigger1=var(0)
var(1)=1

;inguarddist系反応判断用
[State -2]
type=Varset
Trigger1=!var(0)
var(1)=0


;飛び道具の裏側対策
[State -2]
type=Varadd
Trigger1=var(2)>0
var(2)=-1

;飛び道具の裏側対策
[State -2]
type=varset
Triggerall=root,inguarddist
Trigger1=PlayerID(root,var(56)),movetype!=A
Trigger2=P2Dist x>PlayerID(root,var(56)),Const(size.attack.dist)
var(2)=20


;飛び道具の裏側対策。一時的に裏側に配置
[State -2]
type=posset
Trigger1=1
x=root,pos x-facing*80

;飛び道具の裏側対策
[State -2]
type=varset
Trigger1=inguarddist
var(2)=5

;コンボ用変数みたいなもの
[State 30020 対策テスト]
type=varset
Trigger1=1
var(59)=0

;終了したらキャラ別対策判断用のステートへ
[State -2]
type=ChangeState
Trigger1=1
value=30029






;ＩＤ予測ヘルパー用ステート
[Statedef 30021]
anim=9999
ctrl=0

;即消える
[State 30021]
type=destroyself
Trigger1=1





;ループステート
[Statedef 30022]
anim=9999
ctrl=0


;開始値を最高値に合わせる
[State -2]
type=varset
Trigger1=prevstateno!=30022;
var(3+var(55))=var(57)+1

;ループカウンタ増加
[State -2]
type=varadd
var(56)=1
Trigger1=var(56)!=-1

;ループカウンタ初期化
[State -2]
type=Varset
Trigger1=prevstateno!=30022
var(56)=0

;ふるいにかける。１つでも該当するなら次へ
[State -2]
type=varadd
Trigger1=!PlayerIDExist(var(3+var(55)))
Trigger2=PlayerID(var(3+var(55))),movetype!=A||!(PlayerID(var(3+var(55))),hitdefattr=SCA,AA,AP,AT)
Trigger2=PlayerID(var(3+var(55))),time>200-var(55)*10
Trigger3=abs(PlayerID(var(3+var(55))),Screenpos x)>500
Trigger4=abs(PlayerID(var(3+var(55))),pos y)>500
Trigger5=teamside=PlayerID(var(3+var(55))),teamside
var(3+var(55))=1

[state -2];id確認用。１０回繰り返して当たりがこなかったら、中止して次に備える
type=Helper
Trigger1=var(56)>10
Trigger1=var(56):=-1
Trigger1=!Numhelper(30021+root,id)
helpertype=normal
name="id_check"
ID=30021+root,id
pos=0, 0
postype=right
facing=1
stateno=30021
ownpal=1
supermovetime=99999
pausemovetime=99999

;変数の値を今出したばかりのヘルパーのものに
[State -2]
type=varset
Trigger1=var(56)=-1
Trigger1=Numhelper(30021+root,id)
var(3+var(55))=helper(30021+root,id),id

;ループバック
[State -2]
type=ChangeState
value=30022
Triggerall=var(56)!=-1
Trigger1=!PlayerIDExist(var(3+var(55)))
Trigger2=PlayerID(var(3+var(55))),movetype!=A||!(PlayerID(var(3+var(55))),hitdefattr=SCA,AA,AP,AT)
Trigger2=PlayerID(var(3+var(55))),time>200-var(55)*10
Trigger3=abs(PlayerID(var(3+var(55))),Screenpos x)>500
Trigger4=abs(PlayerID(var(3+var(55))),pos y)>500
Trigger5=teamside=PlayerID(var(3+var(55))),teamside

;終わったら戻る
[State -2]
type=ChangeState
value=30020
Trigger1=1


;飛び道具対策、キャラ別ステート（伊達政宗）
[Statedef 30029]
anim=9999
ctrl=0

;１Ｆ経ったらまたＩＤ取得から
[State 30029]
type=CHangeState
Trigger1=time>0
value=30020

;変数の値に該当するヘルパーが存在しないならここでループカウンタ増加させてまた初めから
[State 30029]
type=CHangeState
Trigger1=!PlayerIDExist(var(3+var(55)))
Trigger1=var(55)<var(54)-1
Trigger1=var(55):=var(55)+1
value=30029

;判断用変数初期化
[State 30020]
type=varset
Trigger1=prevstateno!=30029
var(58)=0



[State 30020 地上波動]
type=varadd
Trigger1=PlayerIDExist(var(3+var(55)))
Trigger1=!((var(58))%10)
Trigger1=PlayerID(var(3+var(55))),movetype=A
Trigger1=PlayerID(var(3+var(55))),pos y+PlayerID(var(3+var(55))),vel y*10>=-70
Trigger1=abs(PlayerID(var(3+var(55))),vel x)>1
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)>0
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)-PlayerID(var(3+var(55))),vel x*10>70
Trigger1=fvar(0):=PlayerID(var(3+var(55))),vel x
var(58)=1

[State 30020 地上波動]
type=varadd
Trigger1=PlayerIDExist(var(3+var(55)))
Trigger1=!((var(58))%10)
Trigger1=PlayerID(var(3+var(55))),movetype=A
Trigger1=PlayerID(var(3+var(55))),pos y+PlayerID(var(3+var(55))),vel y*10=[-120,-70]
Trigger1=abs(PlayerID(var(3+var(55))),vel x)>1
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)>0
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)-PlayerID(var(3+var(55))),vel x*10>70
Trigger1=fvar(0):=PlayerID(var(3+var(55))),vel x
var(58)=2



[State 30020 地上波動近すぎ]
type=varadd
Trigger1=!((var(58)/1000)%10)
Trigger1=PlayerIDExist(var(3+var(55)))
Trigger1=PlayerID(var(3+var(55))),movetype=A
Trigger1=PlayerID(var(3+var(55))),pos y+PlayerID(var(3+var(55))),vel y*10>=-70
Trigger1=abs(PlayerID(var(3+var(55))),vel x)>1
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)-PlayerID(var(3+var(55))),vel x*10=[-70,70]
var(58)=1000

[State 30020 地上波動後ろに]
type=varadd
Trigger1=PlayerIDExist(var(3+var(55)))
Trigger1=!((var(58))%10)
Trigger1=PlayerID(var(3+var(55))),movetype=A
Trigger1=PlayerID(var(3+var(55))),pos y+PlayerID(var(3+var(55))),vel y*10=[-120,-70]
Trigger1=abs(PlayerID(var(3+var(55))),vel x)>1
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)<0
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)-PlayerID(var(3+var(55))),vel x*10<-100
Trigger1=fvar(0):=PlayerID(var(3+var(55))),vel x
var(58)=2000

[State 30020 空中波動]
type=varadd
Trigger1=PlayerIDExist(var(3+var(55)))
Trigger1=!((var(58)/10)%10)
Trigger1=PlayerID(var(3+var(55))),movetype=A
Trigger1=PlayerID(var(3+var(55))),pos y+PlayerID(var(3+var(55))),vel y*20<-130
Trigger1=abs(PlayerID(var(3+var(55))),vel x)>1
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)>-70
Trigger1=fvar(1):=PlayerID(var(3+var(55))),vel y
var(58)=10

[State 30020 空中波動後ろ]
type=varadd
Trigger1=PlayerIDExist(var(3+var(55)))
Trigger1=!((var(58)/10)%10)
Trigger1=PlayerID(var(3+var(55))),movetype=A
;Trigger1=PlayerID(var(3+var(55))),pos y+PlayerID(var(3+var(55))),vel y*20<-130
Trigger1=abs(PlayerID(var(3+var(55))),vel x)>1
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)<-50
Trigger1=fvar(1):=PlayerID(var(3+var(55))),vel y
var(58)=20


[State 30020 空中波動近すぎ]
type=varadd
Trigger1=PlayerIDExist(var(3+var(55)))
Trigger1=!((var(58)/10000)%10)
Trigger1=PlayerID(var(3+var(55))),movetype=A
Trigger1=PlayerID(var(3+var(55))),pos y+PlayerID(var(3+var(55))),vel y*10>=-130
Trigger1=abs(PlayerID(var(3+var(55))),vel x)>1
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)>-70
Trigger1=fvar(1):=PlayerID(var(3+var(55))),vel y
var(58)=10000


[State 30020 近すぎ]
type=varadd
Trigger1=PlayerIDExist(var(3+var(55)))
Trigger1=!((var(58)/100000)%10)
Trigger1=PlayerID(var(3+var(55))),movetype=A
Trigger1=PlayerID(var(3+var(55))),pos y-root,pos y=[-80,80]
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)=[-100,120]
var(58)=100000



[State 30020 RE-BITE対地]
type=varadd
Trigger1=PlayerIDExist(var(3+var(55)))
Trigger1=!((var(58)/1000000)%10)
Trigger1=PlayerID(var(3+var(55))),movetype=A&&(PlayerID(var(3+var(55))),hitdefattr=SCA,AP||PlayerID(var(3+var(55))),hitdefattr=SA,AA)
Trigger1=PlayerID(var(3+var(55))),pos y+PlayerID(var(3+var(55))),vel y*10=[-100,60]
Trigger1=abs(PlayerID(var(3+var(55))),vel x)>1
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)-PlayerID(var(3+var(55))),vel x*10>70
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)-PlayerID(var(3+var(55))),vel x*10<=20
Trigger1=fvar(2):=PlayerID(var(3+var(55))),vel x||1
var(58)=1000000


[State 30020 RE-BITE対空]
type=varadd
Trigger1=PlayerIDExist(var(3+var(55)))
Trigger1=!((var(58)/10000000)%10)
Trigger1=PlayerID(var(3+var(55))),movetype=A&&(PlayerID(var(3+var(55))),hitdefattr=SCA,AP||PlayerID(var(3+var(55))),hitdefattr=SA,AA)
Trigger1=PlayerID(var(3+var(55))),pos y+PlayerID(var(3+var(55))),vel y*6<-105
Trigger1=PlayerID(var(3+var(55))),pos y+PlayerID(var(3+var(55))),vel y*18>=-95
Trigger1=abs(PlayerID(var(3+var(55))),vel y)>1
Trigger1=PlayerID(var(3+var(55))),facing*(root,pos x-PlayerID(var(3+var(55))),pos x)-PlayerID(var(3+var(55))),vel x*18=[-80,80]
Trigger1=fvar(3):=PlayerID(var(3+var(55))),vel y||1
var(58)=10000000


[State 30020];設置
type=varadd
Trigger1=!((var(58)/100)%10)
Trigger1=PlayerIDExist(var(3+var(55)))
Trigger1=PlayerID(var(3+var(55))),movetype=A
Trigger1=PlayerID(var(3+var(55))),pos y>-140
Trigger1=PlayerID(var(3+var(55))),vel x<3
Trigger1=PlayerID(var(3+var(55))),time>=40
Trigger1=(root,pos x-PlayerID(var(3+var(55))),pos x)>80
var(58)=100



[State 30020 データ代入]
type=null;
trigger1=var(58)>0
trigger1=playerIDExist(var(3+var(55)))
trigger1=playerID(var(3+var(55))),movetype=A
trigger1=fvar(10):=playerID(var(3+var(55))),vel x||1
trigger1=fvar(11):=playerID(var(3+var(55))),vel y||1
trigger1=fvar(12):=playerID(var(3+var(55))),facing*(root,pos x-playerID(var(3+var(55))),pos x)||1
trigger1=fvar(13):=playerID(var(3+var(55))),pos y||1


[State 30020 到達時間計測]
type=null;
trigger1=var(58)>0
trigger1=playerIDExist(var(3+var(55)))
trigger1=playerID(var(3+var(55))),movetype=A
trigger1=fvar(10)!=0
trigger1=fvar(12)!=0
trigger1=fvar(14):=(fvar(12)-65)/fvar(10)||1

[State 30020 加速度算出];何故か上手く処理できない例外があるので保留
type=null;
trigger1=var(58)>0
trigger1=playerIDExist(var(3+var(55)))
trigger1=playerID(var(3+var(55))),movetype=A
trigger1=fvar(16):=ceil((playerID(var(3+var(55))),vel x-fvar(15))*1000.0)/1000.0||1
trigger1=fvar(15):=playerID(var(3+var(55))),vel x||1


[State 30020 データ初期化]
type=null;
trigger1=var(58)=0
trigger1=fvar(10):=0||1
trigger1=fvar(11):=0||1
trigger1=fvar(12):=0||1
trigger1=fvar(13):=0||1
trigger1=fvar(14):=0||1
trigger1=fvar(15):=0||1
trigger1=fvar(16):=0||1





;ループカウンタ増加、初めに戻る
[State 30029]
type=CHangeState
Trigger1=var(55)<var(54)
Trigger1=var(55):=var(55)+1||1
value=30029


[State -2 デバッグ用]
type=displayToClipboard
Trigger1=1
ignorehitpause=1
text=" fvar(10)=%f fvar(11)=%f fvar(12)=%f fvar(13)=%f fvar(14)=%f\n"
params=fvar(10),fvar(11),fvar(12),fvar(13),fvar(14)


[State -2 デバッグ用]
type=null;displayToClipboard;AppendToClipboard
Trigger1=1
ignorehitpause=1
text=" fvar(16)=%f,fvar(15)=%f,fvar(10)=%f,var(58)=%d"
params=fvar(16),fvar(15),fvar(10),playerIDExist(var(3+var(55)))


[State 30020];カウンタ初期化
type=varset
Trigger1=1
var(55)=0

[State 30020];カウンタ初期化
type=varset
Trigger1=1
var(56)=0





;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Statedef 50000]
anim=0;なにも表示しないｱﾆﾒでもいいけど入れなくても全然問題ない
ctrl=0

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

[State 50000, Turn];振り向き
Type = turn
Trigger1 = Facing != root,Facing ;本体と異なる向きなら


[State -2]
type=Nothitby
Trigger1=1
value=SCA

[State -2]
type=assertspecial
Trigger1=1
flag=noshadow
flag2=invisible
ignorehitpause=1

[State 50000,プレイヤー判定]
type=varset
Triggerall=time>1
Trigger1=command="holdup"&&root,command="holdup"
Trigger2=command="holddown"&&root,command="holddown"
Trigger3=command="holdback"&&root,command="holdback"
Trigger4=command="holdfwd"&&root,command="holdfwd"
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=command="start"&&root,command="start"
var(59)=-1

[State 10000,プレイヤー判定]
type=parentvarset
Triggerall=time>1
Trigger1=command="a"&&root,command="a"
Trigger2=command="b"&&root,command="b"
Trigger3=command="c"&&root,command="c"
Trigger4=command="x"&&root,command="x"
Trigger5=command="y"&&root,command="y"
Trigger6=command="z"&&root,command="z"
Trigger7=command="start"&&root,command="start"
Trigger8=command="fwd"&&root,command="fwd"
Trigger9=command="back"&&root,command="back"
Trigger10=command="up"&&root,command="up"
Trigger11=command="down"&&root,command="down"
var(59)=-1

[State 50000,立ったら消失]
Type = DestroySelf
TriggerAll = isHelper
Trigger1 = root,var(59)||var(59)=-1
Trigger2=command="holdup"&&root,command="holdup"
Trigger3=command="holddown"&&root,command="holddown"
Trigger4=command="holdback"&&root,command="holdback"
Trigger5=command="holdfwd"&&root,command="holdfwd"
Trigger6=command="a"&&root,command="a"
Trigger7=command="b"&&root,command="b"
Trigger8=command="c"&&root,command="c"
Trigger9=command="x"&&root,command="x"
Trigger10=command="y"&&root,command="y"
Trigger11=command="z"&&root,command="z"
;Trigger12=command="start"&&root,command="start"

[State 50000,AIﾌﾗｸﾞON]
Type=varset
TriggerAll=var(59)!=-1
Triggerall=time>1
Trigger1=root,command="a"
Trigger2=root,command="b"
Trigger3=root,command="c"
Trigger4=root,command="x"
Trigger5=root,command="y"
Trigger6=root,command="z"
Trigger7=root,command="start"
Trigger8=root,command="fwd"&&(roundstate=2&&root,ctrl)
Trigger9=root,command="back"&&(roundstate=2&&root,ctrl)
Trigger10=root,command="up"&&(roundstate=2&&root,ctrl)
Trigger11=root,command="down"&&(roundstate=2&&root,ctrl)
var(59)=1

;-------------------------------------------------------------------------------------
[Statedef 60000];
Type = A 
MoveType = A
Physics = N
Ctrl = 0
Anim = 800
SprPriority = -5

;//【メモ】
;//記述流用は歓迎ですが、面倒ごとが嫌いなら以下の記述は使用しないほうが身のためです。
;//AIの扱っていい範囲を大きく出ていますし、叩かれること請け合いですので。

[State -2, AssertSpecial]
Type = AssertSpecial
Trigger1 = 1
flag = Invisible
flag2 = Noshadow
ignorehitpause=1

[State -2, NotHitBy]
Type = NotHitBy
Value = SCA
Trigger1 = 1
IgnoreHitPause = 1

[state -2]
type = AttackDist
trigger1 = 1
value = 0

;//へんなの対策
;//攻撃中にも出しっぱなしにするとターゲット関連がエラいおかしくなる

[state -2,無効化]
Type = StateTypeSet
Trigger1=root,movetype=A
Trigger2=PlayerID(root,var(56)),movetype=H
Trigger3=NumPartner
Trigger3=Partner,movetype=A
movetype=I

[state -2,復帰]
Type = StateTypeSet
Trigger1=NumPartner=0
Trigger1=root,movetype!=A
Trigger1=PlayerID(root,var(56)),movetype!=H
Trigger2=NumPartner
Trigger2=Partner,movetype=A
Trigger2=root,movetype!=A
Trigger2=PlayerID(root,var(56)),movetype!=H
movetype=A

;//相手の位置に合わせる
[state -2,posset]
Type = posset
Trigger1=1
x=PlayerID(root,var(56)),pos X-(facing*20)
y=PlayerID(root,var(56)),pos Y


;//打撃属性のみ
;//ってのも勿体ない気がする

[State -2, HitDef]
type = HitDef
trigger1 = movetype=A
attr = ,AA
animtype = Light
damage    = 0,0
pausetime =0,0
sparkno = -1
sparkxy = 999, 999
hitsound = -1
ground.type = none
p1stateno =60001
hitflag =MAFD-
hitonce =1
numhits=0
guard.dist = 0

;//相手の打撃攻撃の無敵時間を学習
;//昇竜拳などの軽い無敵技を対象とする
;//細かい動作検証はしていない
;//本体が攻撃中の場合は検出が行われないため、学習がうまくいかないことがある(この辺は条件分けすれば対処できるはず)
;//綺麗に保存するのが難しいので現状では相手が行動を開始して間もないうちに留める

[state -2,無敵保存]
Type = varset
Triggerall=var(9)<12
Triggerall=PlayerIDExist(root,var(56))
Triggerall = PlayerID(root,var(56)),stateno != floor(var(10)%10000)
Triggerall = PlayerID(root,var(56)),stateno != floor(var(14)%10000)
Triggerall = PlayerID(root,var(56)),stateno != floor(var(18)%10000)
Triggerall=PlayerID(root,var(56)),movetype=A
Triggerall=PlayerID(root,var(56)),hitdefattr = SCA,AA
Triggerall=PlayerID(root,var(56)),stateno<10000
Triggerall=PlayerID(root,var(56)),time=[1,3]
Triggerall=root,movetype!=A
Triggerall=time>0
Trigger1=var(10+var(9))=0
var(10+var(9)) = PlayerID(root,var(56)),stateno

;//浮動小数もったいない病
[state -2,無敵保存]
Type = varset
Trigger1=PlayerIDExist(root,var(56))
Trigger1=PlayerID(root,var(56)),movetype=A
Trigger1=PlayerID(root,var(56)),stateno<10000
Trigger1=time>0
Trigger1=var(10+var(9))>0
Trigger1=PlayerID(root,var(56)),vel X>var(10+var(9)+1)
var(10+var(9)+1) = floor(PlayerID(root,var(56)),vel X*1000)

;//浮動小数もったいない病
[state -2,無敵保存]
Type = varset
Trigger1=PlayerIDExist(root,var(56))
Trigger1=PlayerID(root,var(56)),movetype=A
Trigger1=PlayerID(root,var(56)),stateno<10000
Trigger1=time>0
Trigger1=var(10+var(9))>0
Trigger1=PlayerID(root,var(56)),vel Y<var(10+var(9)+3)
var(10+var(9)+3) = floor(PlayerID(root,var(56)),vel Y*1000)

[state -2,無敵保存]
Type = varadd
Trigger1=PlayerIDExist(root,var(56))
Trigger1=PlayerID(root,var(56)),movetype=A
Trigger1=PlayerID(root,var(56)),stateno<10000
Trigger1=time>0
Trigger1=var(10+var(9))>0
Trigger1=PlayerID(root,var(56)),HitPauseTime = 0
var(8) = 1

;//無敵保存が中断されたのでその時点での状況を保存してカウンタを4進める
[state -2,無敵保存]
Type = varadd
Triggerall=PlayerIDExist(root,var(56))
Triggerall=time>0
Triggerall=var(10+var(9))>0
Trigger1=root,movetype=A
Trigger1=!(root,stateno=[800,900])
Trigger1=!(root,stateno=[7610,7620])
Trigger1=var(10+var(9)):=var(10+var(9))+var(8)*10000||1
Trigger1=var(10+var(9)+2):=floor(PlayerID(root,var(56)),vel X*1000)||1
Trigger1=var(8):=0||1
Trigger2=PlayerID(root,var(56)),movetype=H
Trigger2=var(10+var(9)):=var(10+var(9))+var(8)*10000||1
Trigger2=var(10+var(9)+2):=floor(PlayerID(root,var(56)),vel X*1000)||1
Trigger2=var(8):=0||1
var(9) = 4

;//内訳
;//var(10+var(9)) 相手stateno及び無敵時間
;//var(10+var(9)+1) 相手X最大速度
;//var(10+var(9)+2) 相手終了時X速度
;//var(10+var(9)+3) 相手Y最大速度




[State -3]
type = DisplayToClipboard
text = "DAMAGE=%d,var(9)=%d,var(9)=%d,var(9)=%d,var(9)=%d"
params = var(10),var(14),var(18),var(21),var(9)
trigger1 = 1
IgnoreHitPause = 1

;-------------------------------------------------------------------------------------
[Statedef 60001]
Type = A 
MoveType = I
Physics = N
Ctrl = 0
Anim = 800
SprPriority = -5

[State -2, AssertSpecial];特殊処理
Type = AssertSpecial
Trigger1 = 1
flag = Invisible
flag2 = Noshadow
ignorehitpause=1

;//すぐに戻す(表示上は常に60001になる)
[State -2, NotHitBy]
Type = NotHitBy
Value = SCA
Trigger1 = 1
IgnoreHitPause = 1

;//無敵保存で取得したフレームを格納する(誤差1〜2F)
[State -2, NotHitBy]
Type = varadd
trigger1 = time>0
trigger1 = var(10+var(9))>0
var(10+var(9))=var(8)*10000
IgnoreHitPause = 1

;//終了時点での速度を保存
[State -2, NotHitBy]
Type = varset
trigger1 = time>0
trigger1 = var(10+var(9))>0
var(10+var(9)+2) = floor(PlayerID(root,var(56)),vel X*1000)
IgnoreHitPause = 1

;//無敵保存カウンタを3進める
[State -2, NotHitBy]
Type = varadd
trigger1 = time>0
trigger1 = var(10+var(9))>0
trigger1 = var(8):=0||1
var(9)=4
IgnoreHitPause = 1

;//1Fくらいは気にしない覚悟
;//改良の余地あり
[state -2]
type = changestate
trigger1 = time>0
value = 60000

[State -3]
type = DisplayToClipboard
text = "DAMAGE=%d,var(9)=%d,var(9)=%d,var(9)=%d,var(9)=%d"
params = var(10),var(14),var(18),var(21),var(9)
trigger1 = 1
IgnoreHitPause = 1


;-------------------------------------------------------------------------------------
[Statedef 70000];
Type = A 
MoveType = A
Physics = N
Ctrl = 0
Anim = 800
SprPriority = -5


[State -2, AssertSpecial]
Type = AssertSpecial
Trigger1 = 1
flag = Invisible
flag2 = Noshadow
ignorehitpause=1

[State -2, NotHitBy]
Type = NotHitBy
Value = SCA
Trigger1 = 1
IgnoreHitPause = 1

[state -2]
type = AttackDist
trigger1 = 1
value = 0

;//へんなの対策
;//攻撃中にも出しっぱなしにするとターゲット関連がエラいおかしくなる

[state -2,無効化]
Type = StateTypeSet
Trigger1=root,movetype=A
Trigger2=PlayerID(root,var(56)),movetype=H
Trigger3=NumPartner
Trigger3=Partner,movetype=A
movetype=I

[state -2,復帰]
Type = StateTypeSet
Trigger1=NumPartner=0
Trigger1=root,movetype!=A
Trigger1=PlayerID(root,var(56)),movetype!=H
Trigger2=NumPartner
Trigger2=Partner,movetype=A
Trigger2=root,movetype!=A
Trigger2=PlayerID(root,var(56)),movetype!=H
movetype=A

;//相手の位置に合わせる
[state -2,posset]
Type = posset
Trigger1=1
x=PlayerID(root,var(56)),pos X-(facing*20)
y=PlayerID(root,var(56)),pos Y


[State -2, HitDef]
type = HitDef
trigger1 = movetype=A
attr = ,AT
animtype = Light
damage    = 0,0
pausetime =0,0
sparkno = -1
sparkxy = 999, 999
hitsound = -1
ground.type = none
p1stateno =70001
hitflag =MAFD-
hitonce =1
numhits=0
guard.dist = 0

[State -3]
type = DisplayToClipboard
text = "DAMAGE=%d"
params = movereversed
trigger1 = 1
IgnoreHitPause = 1

;-------------------------------------------------------------------------------------
[Statedef 70001];
Type = A 
MoveType = I
Physics = N
Ctrl = 0
Anim = 800
SprPriority = -5

[State -2, AssertSpecial];特殊処理
Type = AssertSpecial
Trigger1 = 1
flag = Invisible
flag2 = Noshadow
ignorehitpause=1

;//すぐに戻す(表示上は常に60001になる)
[State -2, NotHitBy]
Type = NotHitBy
Value = SCA
Trigger1 = 1
IgnoreHitPause = 1

;//1Fくらいは気にしない覚悟
;//改良の余地あり
[state -2]
type = changestate
trigger1 = time>0
value = 70000

[State -3]
type = DisplayToClipboard
text = "DAMAGE=%d"
params = movereversed
trigger1 = 1
IgnoreHitPause = 1

