;===================================
;　基本設定・基本動作・通常技 の設定
;  ===================================
[Data]
life = 1000          ;スタート時の体力総計
attack = 100         ;攻撃力パーセンテージ （多いほど強くなります Def:100%）
defence = 100        ;防御力パーセンテージ （多いほど強くなります Def:100%）
fall.defence_up = 50 ;ダウン時に攻撃された時に一時的に上がる防御力のパーセンテージ
liedown.time = 60    ;ダウンしてから起き上がるまでの時間
airjuggle = 30       ;ジャグルポイント数
sparkno = 2        ;ディフォルトのスパーク番号
guard.sparkno = 40 ;ガード時のディフォルトスパーク番
KO.echo = 0          ;1にするとKOされた時に声にエコーがかかります
volume = 0           ;ボリュームオフセット (negative for softer)

[Size]
xscale = 1           ;水平方向の縮尺
yscale = 1           ;垂直方向の縮尺
ground.back = 14.5     ;キャラクターの幅（後方、地上）
ground.front = 14.5     ;キャラクターの幅（前方、地上）
air.back = 10        ;キャラクターの幅（後方、空中）
air.front = 10       ;キャラクターの幅（前方、空中）
z.width = 3          ;Player width (into and out)（現在使用されていないと思われます）
height = 70	     ;キャラクターの高さ
attack.width = 4,4   ;Default attack width: back, front（現在使用されていないと思われます）
attack.dist = 160    ;攻撃時に相手がガード体勢に入る最低距離（最大320）
proj.attack.dist = 90 ;相手がガード体勢に入る発射物との最低距離（最大320）
proj.doscale = 0     ;xscale, yscaleの設定が発射物にも適用するかどうか（1で有効）
head.pos = -10, -70  ;頭の大体の座標（BindToTarget使用時に必要です。）
mid.pos = -10, -50    ;体中心の大体の座標（BindToTarget使用時に必要です。）
shadowoffset = 0     ;影の垂直方向オフセット

[Movement]
airjump.num = 0      ;空中ジャンプの回数 （オプション）
airjump.height = 5  ;空中ジャンプに必要な最低限の高さ （オプション）
yaccel = .43         ;垂直方向にかかる加速度（重力）
stand.friction = .85  ;立ち状態での摩擦係数
crouch.friction = .82 ;しゃがみ状態での摩擦係数

[Velocity]
walk.fwd  = 0.8      ;前に歩く時の速度
walk.back = -0.8     ;後ろに歩く時の速度
run.fwd  =  6.5,0 ;前に走る時の速度 (x, y) ホップさせる時はyを0以下にします
run.back = -6.5,0 ;後ろに走る時の速度 (x, y) 走らせる時はyを0にします
jump.neu = 0,-9.5    ;ジャンプ時の垂直移動速度 (x, y)
jump.back = -4.0    ;後ろにジャンプした時の水平移動速度
jump.fwd = 4.0       ;前にジャンプした時の水平移動速度
runjump.back = -3.55,-9.5 ;後ろに走りながらのジャンプ時の速度指定 (オプション)
runjump.fwd = 5,-10.6      ;前に走りながらのジャンプ時の速度指定 (オプション)
airjump.neu = 0,-10.6      ;空中ジャンプ時の垂直移動速度  (オプション)
airjump.back = -4.55,-8.6 ;空中で後ろにジャンプした時の水平移動速度
airjump.fwd = 3.5,-8.6    ;空中で前にジャンプした時の水平移動速度

;---------------------------------------------------------------------------
; RUN_BACK2 (land)
[Statedef 106]
type    = S
physics = S
ctrl = 0
anim = 105

[State 520]
type = statetypeset
trigger1 = time = 0
trigger1 = var(40) > 0
statetype = A
physics = A

[State 100, 1]
type = VelSet
trigger1 = 1
x = -const(velocity.run.fwd.x)
y = 0

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 106, 4]
type = ChangeState
trigger1 = command != "holdback"
value = 0
ctrl = 1

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

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

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

[State 52, 3]
type = CtrlSet
trigger1 = Time = 3
value = 1

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
value = s0, 7

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

;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 98]
type    = S
physics = S
anim = 100
ctrl = 0

[State 100, 1]
type = VelSet
trigger1 = AnimElemtime(2) >= 0
x = const(velocity.run.fwd.x)

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 106, 4]
type = ChangeState
triggerall = var(40) <= 0
trigger1 = command != "hold_c"
trigger1 = facing = 1
trigger2 = command != "hold_z"
trigger2 = facing = -1
value = 0
ctrl = 1

[State 106, 4]
type = ChangeState
triggerall = var(40) > 0
trigger1 = power <= 0
;trigger2 = Var(59) = 1
value = 3002
ctrl = 0

[State -3]
type = VelSET
trigger1 = time = 0
y = 0

[State -3]
type = poweradd
triggerall = var(40) > 0
trigger1 = time%2 = 0
value = -3

[State 106, 4]
type = ChangeState
triggerall = var(40) > 0
trigger1 = command != "hold_c"
trigger1 = facing = 1
trigger2 = command != "hold_z"
trigger2 = facing = -1
value = 3001
ctrl = 0

;---------------------------------------------------------------------------
; RUN_BACK2 (land)
[Statedef 99]
type    = S
physics = S
ctrl = 0
anim = 105

[State 100, 1]
type = VelSet
trigger1 = AnimElemtime(2) >= 0
x = -const(velocity.run.fwd.x)

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 106, 4]
type = ChangeState
triggerall = var(40) <= 0
trigger1 = command != "hold_z"
trigger1 = facing = 1
trigger2 = command != "hold_c"
trigger2 = facing = -1
value = 0
ctrl = 1

[State 106, 4]
type = ChangeState
triggerall = var(40) > 0
trigger1 = power <= 0
;trigger2 = Var(59) = 1
value = 3002
ctrl = 0

[State -3]
type = VelSET
trigger1 = time = 0
y = 0

[State -3]
type = poweradd
triggerall = var(40) > 0
trigger1 = time%2 = 0
value = -3

[State 106, 4]
type = ChangeState
triggerall = var(40) > 0
trigger1 = command != "hold_z"
trigger1 = facing = 1
trigger2 = command != "hold_c"
trigger2 = facing = -1
value = 3001
ctrl = 0

;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 100]
type    = S
physics = S
anim = 100
sprpriority = 1

[State 100, 1]
type = VelSet
trigger1 = AnimElemtime(2) >= 0
x = const(velocity.run.fwd.x)

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
trigger1 = command != "holdfwd"
value = 0

;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = A
physics = A
ctrl = 0
anim = 105
sprpriority = 1

[State 105, 1]
type = VelSet
trigger1 = AnimElemtime(2) >= 0
x = const(velocity.run.back.x)

[State 105, 2]
type = CtrlSet
trigger1 = Time = 2
value = 1

[State 105, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 106

;---------------------------------------------------------------------------
; GUARD (start)
[Statedef 120]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged

[State 120, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 120 + (statetype = C) + (statetype = A)*2

[State 120, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 120, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 120, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 120, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 120, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = var(40) <= 0
value = 130 + (statetype = C) + (statetype = A)*2

[State 120, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = var(40) > 0
value = 130

[State 100, 1]
type = VelSet
trigger1 = var(40) > 0
y = 0

[State 100, 1]
type = VelSet
trigger1 = time = 0
trigger1 = var(40) > 0
x = 0

[State 120, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; STAND GUARD (guarding)
[Statedef 130]
type    = S
physics = S

[State 130, 1]
type = ChangeAnim
trigger1 = Anim != 130
value = 130

[State 130, Hi to Lo]
type = ChangeState
triggerall = var(40) <= 0
trigger1 = command = "holddown"
value = 131

[State 130, Stop Guarding]
type = ChangeState
triggerall = var(40) <= 0
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

[State 130, Stop Guarding]
type = ChangeState
triggerall = var(40) > 0
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 3001

[State 100, 1]
type = VelSet
trigger1 = var(40) > 0
y = 0

;---------------------------------------------------------------------------
; SGUARDHIT (shaking)
[Statedef 150]
type    = S
movetype= H
physics = N
velset = 0,0

[State 150, 1]
type = ChangeAnim
trigger1 = 1
value = 150

[State 150, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(command = "holddown")

[State 150, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 150, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 150, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 3

;---------------------------------------------------------------------------
; GUARD (end)
[Statedef 140]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged
ctrl = 1

[State 100, 1]
type = VelSet
trigger1 = var(40) > 0
y = 0

[State 140, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 140 + (statetype = C) + (statetype = A)*2

[State 140, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 140, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 140, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 140, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 140, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 140, 5] ;Implemented within engine
type = ChangeState
trigger1 = AnimTime = 0
value = (statetype = C)*11 + (statetype = A)*51

;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 5100]
type    = L
movetype= H
physics = N

[State 5100, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State 5100, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

[State 5100, 8]
type = GameMakeAnim
trigger1 = Time = 1
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5100, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
value = s0, 6

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 5101

[State 5100, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 5110]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = s0, 6

[State 5110, 7]
type = GameMakeAnim
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 14

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 11] ;If just died
type = ChangeState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 15]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

;---------------------------------------------------------------------------
; HIT_GETUP
[Statedef 5120]
type    = L
movetype= I
physics = N

[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5120, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, 2]
type = VelSet
trigger1 = Time = 0
x = 0

[State 520]
type = statetypeset
trigger1 = AnimElem = 2
statetype = A

[State 5120, 2]
type = VelSet
trigger1 = AnimElem = 2
y = -2

[State 520]
type = statetypeset
trigger1 = AnimElem = 3
statetype = S

[State 5120, 2]
type = VelSet
trigger1 = AnimElem = 3
y = 0

[State 1000, 0]
type = PosSet
trigger1 = AnimElem = 3
y = 0

[State 5110, 6]
type = PlaySnd
trigger1 = AnimElem = 3
value = s0, 7

[State 5120, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 5120, 4]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5120, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5120, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

[State 5120, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
[Statedef -3]
;---------------------------------------------------------------------------
[State -3, AI]
Type = VarSet
TriggerAll = Var(59) = 0
TriggerAll = RoundState = [1,2]
Trigger1 = Command = "AI1"
Trigger2 = Command = "AI2"
Trigger3 = Command = "AI3"
Trigger4 = Command = "AI4"
Trigger5 = Command = "AI5"
Trigger6 = Command = "AI6"
Trigger7 = Command = "AI7"
Trigger8 = Command = "AI8"
Trigger9 = Command = "AI9"
Trigger10 = Command = "AI10"
Trigger11 = Command = "AI11"
Trigger12 = Command = "AI12"
Trigger13 = Command = "AI13"
Trigger14 = Command = "AI14"
Trigger15 = Command = "AI15"
Trigger16 = Command = "AI16"
Trigger17 = Command = "AI17"
Trigger18 = Command = "AI18"
Trigger19 = Command = "AI19"
Trigger20 = Command = "AI20"
Trigger21 = Command = "AI11"
Trigger22 = Command = "AI12"
Trigger23 = Command = "AI13"
Trigger24 = Command = "AI14"
Trigger25 = Command = "AI15"
Trigger26 = Command = "AI16"
Trigger27 = Command = "AI17"
Trigger28 = Command = "AI18"
Trigger29 = Command = "AI19"
Trigger30 = Command = "AI20"
V = 59
Value = 1

[State -3 終了]
type = VarSet
triggerall = Var(59) = 1
trigger1 = Alive = 0
trigger2 = Life <= 0
trigger3 = P2Life <= 0
trigger4 = RoundState = [3,4]
trigger5 = Win >= 1
var(59) = 0

[State -3]
type = VarSet
var(1) = 0
trigger1 = var(1) > 0
trigger1 = Pos Y = 0

[State -3];連続
type = VarSet
var(2) = 0
trigger1 = var(2) > 0
trigger1 = stateno != 610

[State -3];切れ
type = VarSet
var(4) = 0
triggerall = var(4) > 0
trigger1 = stateno != 610
trigger1 = stateno != 620
trigger1 = stateno != 630

[State -3]
type = VarSet
var(7) = 0
trigger1 = movetype != A
trigger1 = var(7) > 0

[State -3]
type = VarSet
var(8) = 0
trigger1 = movetype != A
trigger1 = var(8) > 0

[State -3]
type = VarSet
var(9) = 0
trigger1 = movetype != A
trigger1 = var(9) > 0

[State -3]
type = Varset
var(40) = 0
trigger1 = var(40) > 0
trigger1 = Pos Y = 0

[State -3]
type = VelSET
trigger1 = var(40) > 0
trigger1 = Anim = [120,152]
y = 0

[State 1000, 3]
type = removeexplod
trigger1 = movetype = H
id = 512

[State 1000, 3]
type = removeexplod
trigger1 = movetype = H
id = 513

[State -3]
type = ChangeState
trigger1 = var(40) > 0
trigger1 = movetype != H 
trigger1 = Pos Y >= -10
value = 50

[State -3]
type = ChangeState
triggerall = var(40) > 0
triggerall = movetype != A
triggerall = movetype != H
triggerall = stateno != 300
triggerall = stateno != [98,99]
triggerall = stateno != [700,702]
trigger1 = statetype != A
trigger1 = var(40) > 0
trigger1 = !inguarddist
trigger2 = Anim = [120,152]
trigger2 = !inguarddist
value = 3001
ctrl = 0

[State -3]
type = poweradd
trigger1 = time%3 = 0
trigger1 = var(40) <= 0
value = 1

[State -3]
type = RemoveExplod
trigger1 = stateno != 300
id = 300

[State 1000, 0]
type = StopSnd
trigger1 = stateno = [1,179]
channel = 0

;ファイナルフラッシュ
[State -1]
type = ChangeState
value = 1100
triggerall = Var(59) = 1
triggerall = power >= 2000
triggerall = Random = [800,1000]
triggerall = p2bodydist Y = [-30,30]
triggerall = ctrl = 1
triggerall = statetype != A
trigger1 = p2bodydist X >= 200
trigger2 = p2bodydist X = [0,100]
trigger2 = P2stateno = [5000,5030]

;ビックバンアタック
[State -1]
type = ChangeState
value = 1000
triggerall = Var(59) = 1
triggerall = power >= 1000
triggerall = Random = [800,1000]
triggerall = p2bodydist Y = [-30,30]
triggerall = ctrl = 1
triggerall = statetype != A
trigger1 = p2bodydist X = [0,100]
trigger1 = P2stateno = [5000,5030]

;溜め
[State -3]
Type = ChangeState
Value = 300
triggerall = Var(59) = 1
triggerall = StateType != A
triggerall = Power < 300
triggerall = p2bodydist X > 150
trigger1 = P2MoveType != A
trigger1 = ctrl = 1
trigger2 = stateno = 100

;通常攻撃1
[State -3]
Type = ChangeState
Value = IfElse(random<333,200,IfElse(random<666,210,220))
triggerall = Var(59) = 1
triggerall = StateType != A
triggerall = P2MoveType != A
triggerall = P2stateType != A
triggerall = p2bodydist X = [0,20]
trigger1 = ctrl = 1
trigger2 = stateno = 100

;通常攻撃2
[State -3]
Type = ChangeState
Value = IfElse(random<333,201,IfElse(random<666,211,230))
triggerall = Var(59) = 1
triggerall = StateType != A
triggerall = P2MoveType != A
triggerall = P2stateType != A
triggerall = p2bodydist X = [21,30]
trigger1 = ctrl = 1
trigger2 = stateno = 100

;通常攻撃3
[State -3]
Type = ChangeState
Value = IfElse(random<500,202,212)
triggerall = Var(59) = 1
triggerall = StateType != A
triggerall = P2MoveType != A
triggerall = P2stateType = A
triggerall = p2bodydist X = [3,20]
triggerall = p2bodydist Y < 0
trigger1 = ctrl = 1
trigger2 = stateno = 100

;爆発波
[State -3]
Type = ChangeState
Value = 630
triggerall = Var(59) = 1
triggerall = StateType != A
triggerall = Power >= 500
triggerall = p2bodydist X = [70,90]
trigger1 = P2MoveType != A
trigger1 = ctrl = 1
trigger2 = stateno = 100

;ドライビングエルボー、スラッシュアロー
[State -3]
Type = ChangeState
Value = IfElse(random<500,500,510)
triggerall = Var(59) = 1
triggerall = StateType != A
trigger1 = P2MoveType != A
triggerall = p2bodydist X <= 50
triggerall = p2bodydist X > 20
trigger1 = ctrl = 1
trigger2 = stateno = 100

;スーパーダッシュ
[State -3]
Type = ChangeState
Value = 520
triggerall = Var(59) = 1
triggerall = StateType != A
trigger1 = P2MoveType != A
trigger1 = p2bodydist X <= 150
trigger1 = p2bodydist X > 20
trigger1 = ctrl = 1

;ジャンプ通常攻撃
[State -3]
Type = ChangeState
value = IfElse(random<500,240,250)
triggerall = Var(59) = 1
triggerall = StateType = A
triggerall = p2bodydist X <= 25
triggerall = p2bodydist X >= 0
trigger1 = ctrl = 1

;連続エネルギー弾、気円斬
[State -3]
Type = ChangeState
value = IfElse(random<800,610,650)
triggerall = Var(59) = 1
triggerall = StateType != A
triggerall = Power >= 500
triggerall = p2bodydist X < 200
triggerall = p2bodydist X >= 100
triggerall = Random = [701,900]
trigger1 = P2MoveType != A
trigger1 = ctrl = 1
trigger2 = stateno = 100

;エネルギー弾
[State -3]
Type = ChangeState
Value = 600
triggerall = Var(59) = 1
triggerall = StateType != A
triggerall = Power >= 100
triggerall = p2bodydist X < 150
triggerall = p2bodydist X >= 100
triggerall = Random = [251,500]
trigger1 = P2MoveType != A
trigger1 = ctrl = 1
trigger2 = stateno = 100

;超メテオスマッシュ
[State -1]
type = ChangeState
value = 1200
triggerall = statetype = S
triggerall = ctrl
triggerall = stateno != 100
triggerall = Var(59) = 1
triggerall = Random = [800,1000]
trigger1 = p2bodydist X = [2,3]
trigger1 = (p2statetype = S) || (p2statetype = C)
trigger1 = p2movetype != H
trigger2 = p2bodydist X = [3,5]
trigger2 = (p2statetype = S) || (p2statetype = C)
trigger2 = p2movetype != H

;投げ
[State -1]
type = ChangeState
value = 400
triggerall = statetype = S
triggerall = ctrl
triggerall = stateno != 100
triggerall = Var(59) = 1
triggerall = Random = [0,800]
trigger1 = p2bodydist X = [2,3]
trigger1 = (p2statetype = S) || (p2statetype = C)
trigger1 = p2movetype != H
trigger2 = p2bodydist X = [3,5]
trigger2 = (p2statetype = S) || (p2statetype = C)
trigger2 = p2movetype != H

;立ちガード
[State -3]
Type = ChangeState
Value = 130
TriggerAll = Var(59) = 1
TriggerAll = StateType != A
TriggerAll = Ctrl
TriggerAll = P2StateType != C
Trigger1 = P2MoveType = A 

;しゃがみガード
[State -3]
Type = ChangeState
Value = 131
TriggerAll = Var(59) = 1
TriggerAll = StateType != A
TriggerAll = Ctrl
TriggerAll = P2StateType = C
Trigger1 = EnemyNear,HitDefAttr = SCA,NA,SA,HA
Trigger1 = P2MoveType = A 

;空中ガード
[State -3]
Type = ChangeState
Value = 132
TriggerAll = Var(59) = 1
TriggerAll = StateType = A
TriggerAll = Ctrl
TriggerAll = P2StateType != C
Trigger1 = EnemyNear,HitDefAttr = SCA,NA,SA,HA
Trigger1 = P2MoveType = A 

;空中復帰
[State -3]
Type = ChangeState
Value = 5210
TriggerAll = Var(59) = 1
TriggerAll = Vel Y > -1
TriggerAll = Alive
TriggerAll = StateNo = 5050
Trigger1 = CanRecover
Trigger1 = Random = [0,700]

;ジャンプ
[Statedef 39]
type = S
physics = S
ctrl = 0
sprpriority = 1

[State -1, AI]
Type = ChangeState
Triggerall = Var(59) = 1
Trigger1 = Time = 0
Value = 0
Ctrl = 1
IgnoreHitPause = 1

[State -3]
Type = ChangeState
Value = 40
TriggerAll = Var(59) = 1
TriggerAll = StateType != A
Trigger1 = Ctrl
Trigger1 = P2StateType != A
Trigger1 = P2MoveType != A 
Trigger1 = P2BodyDist X >= 50
Trigger1 = Random = [501,700]
Trigger2 = StateNo = 220
Trigger2 = MoveHit
Trigger2 = Random = [500,999]


;-----------------------
;敗北
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0,0

[State 170 , 1]
type = NotHitBy
trigger1 = Time >= 0
value = SCA
time = 1

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

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

[State 191, 2] 
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 420, Effect]
type = Explod
trigger1 = AnimElem = 2
anim = 191
postype = p1
pos = 1,0
sprpriority = 0
bindtime = -1
removetime = 50
removeongethit = 1

[State 200]
type = PlaySnd
trigger1 = AnimElem = 2
value = s0, 11
channel = 0

[State 1000, 0]
type = StopSnd
trigger1 = AnimTime = 0
channel = 0

[State 191, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; 勝利ポーズ分岐
[Statedef 180]
type = S
ctrl = 0
anim = 180
velset = 0,0

[state 181]
type     = assertspecial
trigger1 = time = [0, 100]
flag     = roundnotover

[State 180, 2]
type = ChangeState
trigger1 = life > 666
trigger1 = Time = 0
value = 181

[State 180, 2]
type = ChangeState
trigger1 = life <= 666
trigger1 = life > 333
trigger1 = Time = 0
value = 182

[State 180, 2]
type = ChangeState
trigger1 = life <= 333
trigger1 = Time = 0
value = 183

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

;勝利ポーズ1
[Statedef 181]
type = S
ctrl = 0
anim = 180
velset = 0,0

[state 181]
type     = assertspecial
trigger1 = time = [0, 200]
flag     = roundnotover

[State 1000, 0]
type = PosSet
trigger1 = AnimElem = 1
y = 0

[State 420, Effect]
type = Explod
trigger1 = AnimElem = 2
anim = 191
postype = p1
pos = 1,0
sprpriority = 0
bindtime = -1
removetime = -1
removeongethit = 1

[State 200]
type = PlaySnd
trigger1 = AnimElem= 2
value = s0, 11
channel = 0

[State 200]
type = PlaySnd
trigger1 = AnimElemtime(2) >= 0
trigger1 = time%60 = 0
value = s0, 11
channel = 0

;勝利ポーズ2
[Statedef 182]
type = S
ctrl = 0
anim = 181
velset = 0,0

[state 181]
type     = assertspecial
trigger1 = time = [0, 200]
flag     = roundnotover

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

[State 191, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;勝利ポーズ3
[Statedef 183]
type = S
ctrl = 0
anim = 182
velset = 0,0

[state 181]
type     = assertspecial
trigger1 = time = [0, 300]
flag     = roundnotover

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

[State 191, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
