;---------------------------------------------------------------------------
;基本データ部分
[Data]
life              = 1100    ;体力ゲージの最大値を決めます
power             = 9000    ;パワーゲージ最大値（デフォルトは 3000 = Lv.3 になります・オプション）
attack            = 60     ;攻撃力パーセンテージ（デフォルトは 100% になります）
defence           = 100     ;防御力パーセンテージ（デフォルトは 100% になります）
fall.defence_up   = 50      ;一時的に上昇するダウン時の防御力パーセンテージ
liedown.time      = 60      ;倒れてから起き上がるまでの時間
airjuggle         = 15      ;ジャグルポイント限界値　★１
sparkno           = 2       ;デフォルトのヒットスパーク番号（fightfx.airか、キャラのairから呼び出す）
guard.sparkno     = 40      ;デフォルトのガードスパーク番号（fightfx.airか、キャラのairから呼び出す）
KO.echo           = 0       ;ＫＯ時の声にエコーを掛けるかどうか（0=しない・1=する）
volume            = 0     ;キャラの音量　255が最高
intpersistindex   = 58      ;Varを次のラウンドへ持ち越しが可能 (最小=0, 最大=59)  ★２
floatpersistindex = 40      ;FVarを次のラウンドへ持ち越しが可能 (最小=0, 最大=39) ★２

;　変数持ち越しの使用例：
;　１：IntPersistIndex = 20,29　　（Var(20)〜Var(29)の変数が次のラウンドへ持ち越しが出来ます）
;　２：FloatPersistIndex = 25　　　（FVar(25)の変数が次のラウンドへ持ち越しが出来ます）
;　（間違い：4,8,12,16や[22,37]などの記述は無効になります。）
;
;　※パラメータをIntPersistIndex=60、FloatPersistIndex=40にした場合、
;　　それぞれ０〜５９・０〜３９以外の数値ならば、全ての変数の持ち越しを無効に出来ます。
;　　バグにはならないので、使用する時が来るまではそれでも構いません。
;
;　覚えておくとキャラ作りに大変役立つモノなので、ある程度慣れてきたらいろいろチャレンジしてみましょう。


;---------------------------------------------------------------------------
;サイズ設定
[Size]
xscale           = 1        ;キャラ画像の横のスケール
yscale           = 1        ;キャラ画像の縦のスケール
ground.back      = 15       ;キャラの幅（地上後方）
ground.front     = 15       ;キャラの幅（地上前方）
air.back         = 15       ;キャラの幅（空中後方）
air.front        = 15       ;キャラの幅（空中前方）
height           = 60       ;跳び越す相手のためのキャラの高さ
attack.dist      = 160      ;攻撃を出した時に相手がガード体勢に入る最低の距離
proj.attack.dist = 90       ;相手がガード体勢に入る発射物との最低の距離
proj.doscale     = 0        ;xscaleとyscaleが発射物のスケールにも影響するかどうか（0=しない・1=する）
head.pos         = 5, -70  ;BindToTargetの時に必要な頭の座標
mid.pos          = -5, -60  ;BindToTargetの時に必要な体中心の座標
shadowoffset     = 0        ;影の垂直方向の位置
draw.offset      = 0,0      ;キャラ描画表示位置（Ｘ軸,Ｙ軸）

;---------------------------------------------------------------------------
;移動速度設定
[Velocity]
walk.fwd     = 2.6         ;前進歩行速度
walk.back    = -1.7        ;後退歩行速度
run.fwd      = 6.5, 0      ;前に走る時の速度（Ｘ軸,Ｙ軸）
run.back     = -5,-4.1   ;後ろに走る時の速度（Ｘ軸,Ｙ軸）
jump.neu     = 0,-9     ;垂直ジャンプ速度（Ｘ軸,Ｙ軸）
jump.back    = -2.8,-9        ;後ジャンプ速度
jump.fwd     = 2.8,-9        ;前ジャンプ速度
;runjump.back = -2.55,-8.1  ;後ろに走りながらのジャンプ速度（オプション）
runjump.fwd  = 4,-9      ;前に走りながらのジャンプ速度（オプション）

;---------------------------------------------------------------------------
;動作設定
[Movement]
airjump.num     = 0      ;空中ジャンプが出来る回数（オプション）
airjump.height  = 35     ;空中ジャンプするために必要な最低限の高さ（オプション）
yaccel          = .565    ;重力（垂直下降加速度）
stand.friction  = .8    ;立ち状態の摩擦係数
crouch.friction = .8    ;しゃがみ状態の摩擦係数


;---------------------------------------------------------------------------
; Varの使用状況
; var(0)  - 先行入力時間
; var(1)  - 先行入力（超）必殺技
; var(2)  - 先行入力(特殊技）通常技
; var(4)  - 生存判定
; var(8)  - ジャンプ
; var(11) - スーパーキャンセル
; var(12) - ドリームキャンセル
; var(21) - Random var用
; var(59) - AI判定

; var(0)  - ダメージ補正
; var(1)  - ネバリ補正

;---------------------------------------------------------------------------
; 基本行動のステート
;---------------------------------------------------------------------------
; タイムオーバー時

[Statedef 170]
type = S
ctrl = 0     ;ここでCtrlSetを簡略化できます。　1=自由に動かせる
anim = 170
velset = 0,0 ;ここでVelSetを簡略化できます。　x方向,y方向 の順

[State 170, 無敵]
type = NotHitBy
trigger1 = 1 ;1にするといかなる条件でも有効で、0にするといかなる条件でも無効
value = SCA  ;※
time = 1



;---------------------------------------------------------------------------
; 勝利ポーズ分岐
;ここで勝利ポーズを選択する。　MatchOverは試合終了を判定するので、
;一回目と二回目勝利を別のポーズにしたい時に便利。

[Statedef 180]
type = S

[State 180, ランダムに変数を選ぶ]
type = VarRandom
trigger1 = 1
v = 21
range = 0,1  ;範囲を決定、これだと0〜1という意味

[State 180, 勝利ポーズ1]
type = ChangeState
trigger1 = Time = 1
trigger1 = var(21) = 0
value = 181

[State 180, 勝利ポーズ2]
type = ChangeState
trigger1 = Time = 1
trigger1 = var(21) = 1
value = 182

[State 180, 勝利ポーズ2 ]
type = ChangeState
triggerall = RoundState != 0
triggerall = MatchOver = 1
triggerall = Time = 0
trigger1 = Enemy, Name = "kyoXI" && EnemyNear,AuthorName = "beppu"
trigger2 = Enemy, Name = "kyo99" && EnemyNear,AuthorName = "beppu"
trigger3 = Enemy, Name = "kyonbc" && EnemyNear,AuthorName = "beppu"
trigger4 = Enemy, Name = "kyoXI_EX" && EnemyNear,AuthorName = "beppu"
trigger5 = Enemy, Name = "kyoAkof" && EnemyNear,AuthorName = "beppu"
value = 182


;---------------------------------------------------------------------------
; 勝利ポーズ1 そのまま死ね！

[Statedef 181]
type = S
ctrl = 0
anim = 182
velset = 0,0

[State 181]
type = AssertSpecial
trigger1 = time = [0,200]
flag = roundnotover

[State 181]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 181,]
type = PlaySnd
trigger1 = time = 10
value = 3,10
;channel = 0
volume = 255

;---------------------------------------------------------------------------
; 勝利ポーズ２ （京専用）どうした・・・。貴様もこれまでか？

[Statedef 182]
type = S
ctrl = 0
anim = 183
velset = 0,0

[State 181, 特殊効果]
type = AssertSpecial
trigger1 = time = [0,320]
flag = roundnotover

[State 1000, 5]
type = Explod
trigger1 = time = 95
anim = 2110
sprpriority = -1
postype = p1
pos = 0,0
bindtime = 1
supermove = 1
under = 0
ownpal = 1

[State 2000, hehe!]
type = NotHitBy
trigger1 = time < 50
value = SCA

[State 2000, bg]
type = assertspecial
trigger1 = time = [92,122]
flag = nobg
flag2 = nofg

[State 2000,]
type = PlaySnd
trigger1 = time = 92
value = 5,8
;channel = 0
volume = 255

[State 181,1]
type = PlaySnd
trigger1 = time = 1
value = 3,11
volume = 255

;---------------------------------------------------------------------------
; イントロ分岐

;イントロ選択
[Statedef 190]
type = S
ctrl = 0
anim = 0
velset = 0,0

[State 190]
type = ChangeState
trigger1 = Time = 1
value = 191

[State 190]
type = ChangeState
trigger1 = (P2Name = "kyoXI" || P4Name = "kyoXI") && EnemyNear,AuthorName = "beppu"
value = 192

;---------------------------------------------------------------------------
; イントロ  すぐ楽にしてやる

[Statedef 191]
type = S
ctrl = 0
anim = 193
velset = 0,0

[State 181,]
type = PlaySnd
trigger1 = time = 0
value = 121,100
;channel = 0
volume = 255

[State 3234]
type = Explod
trigger1 = time = 0
anim = 3546
id = 193
sprpriority = 5
postype = P1
bindtime = -1
pos = 0,0
under = 0
ownpal = 1
persistent = 0
removetime = 560


[State 191, アニメ変更] ;画面フェードインの間だけアニメーションを繰り返し、止まっているように見せています
type = ChangeAnim
trigger1 = RoundState = 0
value = 193

[State 1100]
type = Explod
trigger1 = time = 0
persistent = 1
anim = 3545
postype = P1
pos = 0,0
sprpriority = 4
removetime = 552
bindtime = -1


[State 181,]
type = PlaySnd
trigger1 = time = 462
value = 121,102
loop = 1
volume = 255

[State 0, StopSnd]
type = StopSnd
trigger1 = time = 513
channel = -1

[State 181,]
type = PlaySnd
trigger1 = time = 513
value = 121,104
volume = 255

[State 181,]
type = PlaySnd
trigger1 = time = 513
value = 121,101
volume = 255

[State 191, 特殊効果] ;「ROUND1, FIGHT!」のアナウンスが始まるまでは、このコントローラを使ってください
type = AssertSpecial
trigger1 = 1
flag = Intro ;イントロの状態になります

[State 181,]
type = PlaySnd
trigger1 = time = 365
value = 121,99
;channel = 0
volume = 255

[State 190,1]
type = Varset
triggerall = time = 0
trigger1 = (P2Name = "kyoXI" || P4Name = "kyoXI") && EnemyNear,AuthorName = "beppu"
trigger2 = (P2Name = "kyo99" || P4Name = "kyo99") && EnemyNear,AuthorName = "beppu"
trigger3 = (P2Name = "kyonbc" || P4Name = "kyonbc") && EnemyNear,AuthorName = "beppu"
trigger4 = (P2Name = "kyoXI_EX" || P4Name = "kyoXI_EX") && EnemyNear,AuthorName = "beppu"
trigger5 = (P2Name = "kyoAkof" || P4Name = "kyoAkof")  && EnemyNear,AuthorName = "beppu"
var(58) = 1

[State 191, ステート変更]
type = ChangeState
trigger1 = time = 589
value = 0

;---------------------------------------------------------------------------
; イントロ２（京専用）京・・・行くぞ！
[Statedef 1372]
type = S
ctrl = 0
anim = 1372
velset = 0,0


[State 191, アニメ変更] ;画面フェードインの間だけアニメーションを繰り返し、止まっているように見せています
type = ChangeAnim
trigger1 = RoundState = 0
value = 193


[State 191, 特殊効果] ;「ROUND1, FIGHT!」のアナウンスが始まるまでは、このコントローラを使ってください
type = AssertSpecial
trigger1 = 1
flag = Intro ;イントロの状態になります

[State 181,]
type = PlaySnd
trigger1 = AnimElem = 2
value = 3,7
;channel = 0
volume = 255

[State 191, ステート変更]
type = ChangeState
trigger1 = time = 150
value = 0


[Statedef 192]
type = S
ctrl = 0
anim = 192
velset = 0,0

[State 191, 特殊効果]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 181,]
type = PlaySnd
trigger1 = AnimElem = 1
value = 4,7
;channel = 0
volume = 255

[State 181,]
type = PlaySnd
trigger1 = AnimElem = 7
value = 4,8
;channel = 0
volume = 255

[State 190,1]
type = Varset
;triggerall = TeamMode != turns
trigger1 = time = 0
var(58) = 1

[State 191, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
;AssertSpecialは特殊なフラグを設定します。同時に三つまで設定できます。

;[State xxx, フラグ設定記述例]
;type = AssertSpecial
;trigger1 = 1
;flag  = invisible
;flag2 = noshadow
;flag3 = timerfreeze

;種類一覧
;intro　　　　　 イントロの動作をしていることを宣言します。
;invisible　　　 設定している間は、キャラクターの姿が見えなくなります。
;　　　　　　　　但し、AfterImageの残像は見えます。
;roundnotover　　キャラが勝ちポーズ中であることを宣言します。
;nobardisplay　　設定中はライフバー、パワーバーが消えます。
;noBG　　　　　　設定中は背景が綺麗に黒になります。
;noFG　　　　　　設定中はステージレイヤー１が消えます。
;nostandguard　　設定中は立ち防御不可能になります。
;nocrouchguard　 設定中はしゃがみ防御不可能になります。
;noairguard　　　設定中は空中防御不可能になります。
;noautoturn　　　設定中はキャラが自動的にターンしないようになります。
;nojugglecheck　 設定中はキャラのJuggleがカウントされなくなります。
;　　　　　　　　特殊モード時に連続ヒットさせる時等に使用します。
;nokosnd　　　 　設定中はノックアウト時に11,0(KOsnd)を再生できなくするフラグです。
;nokoslow　　　　設定中はノックアウト時にスローモーションを効かなくする。
;noshadow　　　　設定中『影』が未表示になります。
;globalnoshadow　設定中全てのキャラクター、Helper、Explodの影が消えます。
;nomusic　　　　 設定中、BGMが停止します。
;nowalk　　　　　設定中、歩く状態にならなくなります。
;　　　　　　　　ダッシュ状態が歩き状態にならないようにすることに使用するのが主。
;timerfreeze　 　設定中、時間がカウントされなくなります。
;unguardable　　 設定中、全てのHitdefのガードフラグが無視されます。
;　　　　　　　　つまり、ガード不能技になります。

;---------------------------------------------------------------------------
; 挑発分岐

;挑発選択
[Statedef 195]
type = S
ctrl = 0
anim = 0
velset = 0,0

[State 190]
type = ChangeState
trigger1 = Time = 1
value = 196

[State 190]
type = ChangeState
trigger1 = (P2Name = "kyoXI" || P4Name = "kyoXI") && EnemyNear,AuthorName = "beppu"
trigger2 = (P2Name = "kyo99" || P4Name = "kyo99") && EnemyNear,AuthorName = "beppu"
trigger3 = (P2Name = "kyonbc" || P4Name = "kyonbc") && EnemyNear,AuthorName = "beppu"
trigger4 = (P2Name = "kyoXI_EX" || P4Name = "kyoXI_EX") && EnemyNear,AuthorName = "beppu"
trigger5 = (P2Name = "kyoAkof" || P4Name = "kyoAkof")  && EnemyNear,AuthorName = "beppu"
value = 197

;---------------------------------------------------------------------------
; 挑発
[Statedef 196]
type     = S
movetype = I
physics  = S
anim     = 195
velset   = 0,0
ctrl     = 0
sprpriority = 2 ;ここで表示優先度を決定できます。　範囲は-5〜5、大きいほど手前に表示される
facep2 = 1      ;相手の方を向いてから挑発（結構重要）

[State 181,1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 3,1
channel = 4
volume = 255

[State 1100]
type = Explod
trigger1 = AnimElem = 2
persistent = 0
anim = 23
postype = P1
pos = -0,-80
sprpriority = 10
removetime = 18
bindtime = -1

[State 181,1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 5,221
channel = 4
volume = 255


[State 181,3]
type = CtrlSet
trigger1 = AnimElem = 3
value = 1

[State 195, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 挑発(京専用）
[Statedef 197]
type     = S
movetype = I
physics  = S
anim     = 196
velset   = 0,0
ctrl     = 0
sprpriority = 2
facep2 = 1

[State 181,1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 3,4
channel = 4
;channel = 5
volume = 255

[State 181,3]
type = CtrlSet
trigger1 = AnimElem = 11
value = 1

[State 195, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1




;---------------------------------------------------------------------------
; JUMP_UP START
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
velset = 0,0
facep2 = 1

[State 40, NOTHITBY]
type = nothitby
trigger1 = 1
value = , NT, ST, HT

[State 40, 4]
type = VarSet
trigger1 = Time = 0
var(8) = 0

[State 40, 5]
type = VarSet
triggerall = var(59) != 1
trigger1 = Command = "holdfwd"
trigger1 = var(8) != 2
var(8) = 1

[State 40, 6]
type = VarSet
triggerall = var(59) != 1
trigger1 = Command = "holdback"
trigger1 = var(8) != -2
var(8) = -1

[State 40, 7]
type = VarSet
triggerall = var(59) != 1
triggerall = Time = 0
triggerall = Command = "holdfwd"
trigger1 = Command = "longjump"
trigger2 = PrevStateNo = 100 ;RUN_FWD
trigger3 = Prevstateno = [10,12]
var(8) = 2

[State 40, 8]
type = VarSet
triggerall = var(59) != 1
triggerall = Time = 0
triggerall = Command = "holdback"
trigger1 = Command = "longjump"
trigger2 = Prevstateno = [10,12]
var(8) = -2

;AI小ジャンプ垂直
[State -1, AI-Nj]
Type = VarSet
Triggerall = Var(59) = 1
triggerall = PrevStateNo != 100
trigger1 = P2BodyDist X <= 60
trigger1 = Random = [0,30]
var(8)   = 0

;AI小ジャンプ前
[State -1, AI-Nj]
Type = VarSet
Triggerall = Var(59) = 1
triggerall = PrevStateNo != 100
trigger1 = P2BodyDist X <= 60
trigger1 = Random = [31,760]
trigger2 = P2BodyDist X <= 60
trigger2 = frontedgebodydist < 40
trigger2 = Random < 700
var(8)   = 1

;AI中、大ジャンプ前
[State -1, AIdaij]
Type = VarSet
Triggerall = Var(59) = 1
triggerall = Time = 0
trigger1 = P2BodyDist X >= 60
trigger1 = PrevStateNo = 100
trigger2 = P2BodyDist X >= 60
trigger2 = Random = [0,800]
trigger3 = P2BodyDist X <= 60
trigger3 = frontedgebodydist < 40
trigger3 = Random = [701,999]
var(8)   = 2

;AI小ジャンプ後ろ
[State -1, AI-Nj]
Type = VarSet
Triggerall = Var(59) = 1
triggerall = PrevStateNo != 100
trigger1 = P2BodyDist X <= 60
trigger1 = Random = [761,790]
var(8)   = -1

;AI中、大ジャンプ後ろ
[State -1, AIdaij]
Type = VarSet
Triggerall = Var(59) = 1
triggerall = Time = 0
trigger1 = P2BodyDist X >= 60
trigger1 = Random = [801,999]
trigger2 = P2BodyDist X <= 60
trigger2 = Random = [791,999]
var(8)   = -2

[State 201, 1] ; Play sound when jumping (Light)
type = PlaySnd
trigger1 = AnimElem = 1;trigger1 = Time = 0
trigger1 = var(8) != -2
trigger1 = var(8) != 2
value = 5,6
volume = 0

;make sure running snd is off
[State 40, 9]
type = StopSnd
trigger1 = Time = 0
channel = 20;running snd

[State 40, 10]
type = ChangeState
triggerall = var(59) != 1
triggerall = AnimTime = 0
trigger1 = Command != "holdup"
value = 99;44


;小、中ジャンプ
[State -1, syoJump]
type = ChangeState
TriggerAll = Var(59) = 1
triggerall = AnimTime = 0
Trigger1 = Var(8) = 1 ;&& (P2BodyDist X <= 60) && Var(8)! = 2  && Random <= 90;小ジャンプ
Trigger2 = Var(8) = 2 && P2BodyDist X <= 160; && (P2BodyDist X = [61,130]);&& Var(8)! = 1;中ジャンプ
value = 99
ctrl = 1


[State 40, 11]
type = VelSet
trigger1 = AnimTime = 0
x = IfElse(var(8)= 0, Const(velocity.jump.neu.x), IfElse(var(8)>0, Const(velocity.jump.fwd.x), Const(velocity.jump.back.x)))
y = Const(velocity.jump.y)


[State 40, 13]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

[State 40, 13]
type = null;ChangeState
triggerall = Var(59) = 1
trigger1 = AnimTime = 0
trigger2 = Var(8) = 2 && P2BodyDist X >= 131
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Jump Up
[Statedef 50]
type    = A
physics = A

[State 50, Fwd]
type = VelSet
trigger1 = Time = 0
trigger1 = Var(8) = 2
x = 4.725

[State 50, Back]
type = VelSet
trigger1 = Time = 0
trigger1 = Var(8) = -2
x = -4.725

[State 2041, 2] ; Play sound when jumping (long)
type = PlaySnd
triggerall = Time = 0
trigger1 = var(8) = 2
trigger2 = var(8) = -2
value = 5,26
volume = 30

[State 50, 3] ; Shadows
type = Afterimage
triggerall = Time = 1
triggerall = vel x != 0
trigger1 = var(8) = -2
trigger2 = var(8) = 2
time = 10
PalBright = 0, 0, 0
PalContrast =  250,250,250
PalAdd = 0, 0, 0
PalMul = 1,1,1
Length = 7
FrameGap = 3

[State 50, CTRL LIMITTER] ;Can't attack after recovery
type = ctrlset
trigger1 = Time = 0
trigger1 = prevstateno = 5040
trigger1 = prevstateno = 5210
value = 0

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 0
value =  ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43));

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

;---------------------------------------------------------------------------
; JUMP_LOW
[Statedef 99]
type    = A
physics = N
anim = 99
velset = 0,-8;8.4
ctrl = 1

[State 201, CTRL LIMITTER] ;Can't attack after recovery
type = ctrlset
trigger1 = Time = 0
trigger1 = prevstateno = 5040
trigger1 = prevstateno = 5210
value = 0

[State 201, 3] ; Shadows
type = Afterimage
triggerall = Time = 1
triggerall = vel x != 0
trigger1 = var(8) = -2
trigger2 = var(8) = 2
time = 10
PalBright = 0, 0, 0
PalContrast =  250,250,250
PalAdd = 0, 0, 0
PalMul = 1,1,1
Length = 7
FrameGap = 3

[State 201, 4] ; Shadows off
type = Afterimage
trigger1 = Time = 11
time = 0

[State 201, PUSH]
type = playerpush
triggerall = anim = 41
triggerall = p2statetype != A
triggerall = animelem = 2, >= 0
triggerall = animelem = 5, <= 0
trigger1 = var(8) = -2
trigger2 = var(8) = 2
value = 0

[State 201, 6]
type = VelSet
trigger1 = Time = 0
trigger1 = Var(8) = 1
x = 3.31

[State 201, 8]
type = VelSet
trigger1 = Time = 0
trigger1 = Var(8) = -1
x = -3.31

[State 2041, 2] ;;
type = PlaySnd
triggerall = Time = 0
trigger1 = var(8) = 2
trigger2 = var(8) = -2
value = 5,26
volume = 30

[State 201, 7]
type = VelSet
trigger1 = Time = 0
trigger1 = Var(8) = 2
x = 4.965

[State 201, 9]
type = VelSet
trigger1 = Time = 0
trigger1 = Var(8) = -2
x = -4.965

[State 201, 9]
type = Veladd
trigger1 = 1
y = .6375

[State 201, 15] ;Short
type = Changestate
trigger1 = vel y > 0 && pos y >= -11
value = 52
ctrl = 0

;---------------------------------------------------------------------------
; Jump Down (empty state for compatibility)
[Statedef 51]
type    = A
physics = A

[State 51, 1]
type = Null
trigger1 = 1

;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
anim = 47
ctrl = 0
velset = 0,0
facep2 = 1

;[State 52, 2]
;type = Ctrlset
;trigger1 = Time = 2
;value = 1

[State 52, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 52, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 52, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;---------------------------------------------------------------------------
; HIT_FALLRECOVER (still falling)
[Statedef 5200]
type    = A
movetype= H
physics = N

[State 5200, 1] ;Change anim if done with transition
type = ChangeAnim
trigger1 = Anim = 5035
trigger1 = AnimTime = 0
value = 5050

[State 5200, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5200, 3]
type = SelfState
triggerall = var(59) != 1
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 10
value = ifelse(Command !="holdfwd",5201,5202)

[State 5200, 3]
type = SelfState
triggerall = var(59) = 1
triggerall = BackEdgeBodyDist <= 40
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 10
value = ifelse(random <= 600,5202,5201)

[State 5200, 3]
type = SelfState
triggerall = var(59) = 1
triggerall = BackEdgeBodyDist > 40
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 10
value = ifelse(random <= 400,5202,5201)

;---------------------------------------------------------------------------
; 地上受身 HIT_FALLRECOVER (on the ground)
[Statedef 5201]
type    = S;A
movetype= H
physics = S;A
anim = 5200
ctrl = 0

[State 200, 2]
type = PlaySnd
trigger1 =  AnimElem = 1
value = 3,3
;channel = 4

[State 5201, 5] ;Blink white
type = PalFX
trigger1 = Time = 0
time = 3
add = 128,128,128 ;256,256,256

[State 5201, 1] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = P2Dist X < -5

[State 5201, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5201, 2.1]
type = VelSet
trigger1 = Time >= 0
trigger1 = Time <= 12
x = -4

[State 5201, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5201, 4]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 5201, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 前方受身 (on the ground)
[Statedef 5202]
type    = S
movetype= H
physics = S
anim = 5201
ctrl = 0

[State 200, 2]
type = PlaySnd
trigger1 =  AnimElem = 1
value = 3,3
;channel = 4

[State 5201, 5] ;Blink white
type = PalFX
trigger1 = Time = 0
time = 3
add = 128,128,128 ;256,256,256

[State 5201, 1] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = P2Dist X < -5

[State 5201, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5201, 2.1]
type = VelSet
trigger1 = Time >= 0
trigger1 = Time <= 12
x = 9.5

[State 5201, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5201, 4]
type = null;NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 700, 相手と重なった場合]
type = PlayerPush
trigger1 = AnimElemTime(2) > 0
value = 0

[State 5201, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; 空中受身HIT_AIRFALLRECOVER
[Statedef 5210]
type    = A
movetype= I
physics = N
anim = 5210
ctrl = 0

[State 200, 2]
type = PlaySnd
trigger1 =  AnimElem = 1
value = 3,3
channel = 4

[State 5210, 1] ;Blink white
type = PalFX
trigger1 = Time = 0
time = 3
add = 128,128,128 ;256,256,256

[State 5210, 1]
type = PosFreeze
trigger1 = Time = 0
value = 4

[State 5210, 2] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -20

[State 5210, 1] 
type = VelMul
trigger1 = Time = 4
x = .8
y = .8

[State 5210, 1]
type = VelAdd
trigger1 = Time = 4
y = -4.5

[State 5210, 1] 
type = VelMul
trigger1 = Time = 4
trigger1 = Vel Y > 0
y = .5

[State 5210, 1]
type = VelAdd
trigger1 = Time = 4
trigger1 = Vel Y > -3
y = -2

[State 5210, 1]
type = VelAdd
trigger1 = Time = 4
trigger1 = Vel Y > -2
y = -1

[State 5210, 2] ;Go up
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdup"
y = -2

[State 5210, 2] ;Go down
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holddown"
y = 1.5

[State 5210, 2] ;Go fwd
type = VelMul
trigger1 = Time = 4
trigger1 = Command = "holdfwd"
x = 1

[State 5210, 2] ;Go back
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdback"
x = -1

[State 5210, 3]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 15

[State 5210, 4]
type = CtrlSet
trigger1 = Time = 20
value = 1

[State 5210, 5]
type = VelAdd;Gravity
trigger1 = Time >= 4
y = .35

[State 5210, 5] ;Land on ground
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMP_LAND
ctrl = 1


;----------------------------------------------------------------------
:-----------------------------------------
[Statedef 9998]
type = A
movetype = I
physics = N
anim = 9998+root,var(25)
velset = 0, 17
ctrl = 0

[State 3020, 1]
type = AssertSpecial
trigger1 = 1
;flag = NoBG
;flag2 = NoFG
flag = noshadow
ignorehitpause = 1

[State 2000, 6];背景
type = helper
trigger1 = pos y >= 0;time = 15
id = 9998
persistent = 0
name = "MAX2"
pos = 0,-508-254
postype = p1
stateno = 9998
helpertype = normal
keyctrl = 0
persistent = 0

[state a]
type = posset
trigger1 = 1
x = -160

[state a];透過
type = Trans
trigger1 = 1
trans = addalpha
alpha = 306-40, 40

[State 3020, 1]
type = RemoveExplod
triggerall = Time > 0
trigger1 = root,StateNo != 2500
trigger2 = time = 60
ID = 6022

[State 3020, 1]
type = DestroySelf
triggerall = Time > 0
trigger1 = root,StateNo != 2500
trigger2 = time = 60
;------------------------------
