
;---------------------------------------------------------------------------
;立ち
[Statedef 0]
type = S
physics = S
sprpriority = 0

[state 191, ]
type = null;modifyexplod
trigger1 = time = 0
ID = 10191
removetime = 1

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

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

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050

;---------------------------------------------------------------------------
;しゃがみ始動
[Statedef 10]
type    = C
physics = C
anim = 10

[State 10, 1]
type = VelMul
trigger1 = Time = 0
x = .75

[State 10, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11

;---------------------------------------------------------------------------
;しゃがみ
[Statedef 11]
type    = C
physics = C
anim = 11
sprpriority = 0

[State 11, 1] ;Change from turning animation
type = ChangeAnim
trigger1 = Anim = 6 && AnimTime = 0
value = 11

;---------------------------------------------------------------------------
;立ち上がり
[Statedef 12]
type    = S
physics = S
anim = 12

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

;---------------------------------------------------------------------------
;歩き
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

;---------------------------------------------------------------------------
;ジャンプ開始
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

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

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))
y = const(velocity.jump.y)*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[State 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

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

;---------------------------------------------------------------------------
;空中ジャンプ開始
[Statedef 45]
type    = A
physics = N
ctrl = 0
velset = 0,0

[State 45, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(44)
value = 44

[State 45, 2]
type = ChangeAnim
trigger1 = !SelfAnimExist(44)
value = 41

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

[State 45, 4]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 45, 5]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 45, 6]
type = VelSet
trigger1 = Time = 2
x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x), const(velocity.airjump.back.x)))*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))
y = const(velocity.airjump.y)*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[State 45, 7]
type = ChangeState
trigger1 = Time = 2
value = 50
ctrl = 1

;---------------------------------------------------------------------------
;ジャンプ中
[Statedef 50]
type    = A
physics = A

[state 50, グレイズ多重化]
type = varset
trigger1 = (var(14) & (1073741824)) = (1073741824)
trigger1 = time = 0
var(3) = stateno

[state 50, グレイズ多重化]
type = changestate
trigger1 = (var(14) & (1073741824)) = (1073741824)
trigger1 = time = 0
value = 119

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

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

[state 50, ]
type = changeanim
triggerall = time = 0
trigger1 = prevstateno = 700 || prevstateno = 701
trigger2 = prevstateno = 710 || prevstateno = 711
trigger3 = prevstateno = 2001
trigger4 = prevstateno = 2053
value = 48

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

;---------------------------------------------------------------------------
;ジャンプ下降(empty state for compatibility)
[Statedef 51]
type    = A
physics = A

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

;---------------------------------------------------------------------------
;ジャンプ着地
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47
;Facep2  = 1

[state 52, test]
type = turn
trigger1 = time = 0
trigger1 = p2dist x < 0

[state 116, 回避結界off]
type = varset
trigger1 = time = 0
trigger1 = (var(14) & (1073741824)) = (1073741824)
var(14) = (var(14) | (1073741824)) - (1073741824)

[state 52, ]
type = playsnd
trigger1 = time = 0
value = 3,0

[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 52, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;上ハイジャンプ前
[statedef 60]
type = S
movetype = I
physics = S
anim = 40
ctrl = 0

[state 60, 回避結界]
type = helper
triggerall = time = 0
trigger1 = prevstateno = 151
trigger2 = prevstateno = 153
name = "use_card"
stateno = 13010
ID = 13010
pos = 0,-50
ownpal = 1
ignorehitpause = 1

[state 60, hjeffect]
type = explod
trigger1 = time = 0
anim = 20050
ID = 20050
postype = p1
pos = 0,0
ownpal = 1
scale = 1.5,1.5
sprpriority = 3
removetime = 11
pausemovetime = 1000

[state 60, hjeffect2]
type = helper
trigger1 = animelem = 2
name = "hj_effect2"
stateno = 20025
postype = p1
pos = 0,0
facing = 1
ownpal = 1
ID = 20025
pausemovetime = 1000

[state 60, ステート変更後の速度]
type = velset
trigger1 = animtime = 0
y = -10*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[state 60, ステート変更]
type = changestate
trigger1 = animtime = 0
value = 116
ctrl = 1


;---------------------------------------------------------------------------
;前ハイジャンプ前
[statedef 62]
type = S
movetype = I
physics = S
anim = 40
ctrl = 0

[state 62, hjeffect]
type = explod
trigger1 = time = 0
anim = 20050
ID = 20050
postype = p1
pos = 0,0
ownpal = 1
scale = 1.5,1.5
sprpriority = 3
removetime = 11
pausemovetime = 1000

[state 62, hjeffect2]
type = helper
trigger1 = animelem = 2
name = "hj_effect2"
stateno = 20025
postype = p1
pos = 0,0
facing = 1
ownpal = 1
ID = 20025
pausemovetime = 1000

[state 62, ステート変更後の速度]
type = velset
trigger1 = animtime = 0
x = (const(velocity.run.fwd.x)-1)*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))
y = -9*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[state 62, ステート変更]
type = changestate
trigger1 = animtime = 0
value = 116
ctrl = 1


;---------------------------------------------------------------------------
;後ろハイジャンプ前
[statedef 64]
type = S
movetype = I
physics = S
anim = 40
ctrl = 0

[state 64, 回避結界]
type = helper
triggerall = time = 0
trigger1 = prevstateno = 151
trigger2 = prevstateno = 153
name = "use_card"
stateno = 13010
ID = 13010
pos = 0,-50
ownpal = 1
ignorehitpause = 1

[state 64, hjeffect]
type = explod
trigger1 = time = 0
anim = 20050
ID = 20050
postype = p1
pos = 0,0
ownpal = 1
scale = 1.5,1.5
sprpriority = 3
removetime = 11
pausemovetime = 1000

[state 64, hjeffect2]
type = helper
trigger1 = animelem = 2
name = "hj_effect2"
stateno = 20025
postype = p1
pos = 0,0
facing = 1
ownpal = 1
ID = 20025
pausemovetime = 1000

[state 64, ステート変更後の速度]
type = velset
trigger1 = animtime = 0
x = (-const(velocity.run.fwd.x)+1)*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))
y = -9*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[state 64, ステート変更]
type = changestate
trigger1 = animtime = 0
value = 116
ctrl = 1


;---------------------------------------------------------------------------
;ハイジャンプ
[statedef 116]
type = A
movetype = I
physics = A

[state 116, 回避結界]
type = ctrlset
trigger1 = (var(14) & (1073741824)) = (1073741824)
value = 0

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

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

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

[state 116, ]
type = changestate
trigger1 = vel y >= 0
value = 50


;---------------------------------------------------------------------------
;飛翔===================================================================================
[statedef 80];飛翔終わり
type = A
physics = A
ctrl = 0

[state 80, アニメ変更]
type = changeanim
trigger1 = time = 0
value = 89

[state 80, 座標移動]
type = posadd
trigger1 = time = 0
x = -2
y = 40

[state 80, 回転]
type = angleset
trigger1 = time = 0
value = 0

[state 80, 回転実行]
type = angledraw
trigger1 = 1

[state 80, 振り向き]
type = turn
trigger1 = time = 0
trigger1 = p2dist x < 0

[state 80, ]
type = ctrlset
trigger1 = time = 0
value = 1


[statedef 81];前6
type = A
physics = N
velset = 0, 0
ctrl = 0
anim = 87

[state 81, 角度設定]
type = varset
trigger1 = time = 0
fvar(11) = 0

[state 81, ]
type = changestate
trigger1 = animtime = 0
value = 117


[statedef 82];前上9
type = A
physics = N
velset = 0, 0
ctrl = 0
anim = 87

[state 82, 角度設定]
type = varset
trigger1 = time = 0
fvar(11) = 45

[state 82, ]
type = changestate
trigger1 = animtime = 0
value = 117


[statedef 83];上8
type = A
phtsics = N
velset = 0, 0
ctrl = 0
anim = 87

[state 83, 角度設定]
type = varset
trigger1 = time = 0
fvar(11) = 90

[state 83, ]
type = changestate
trigger1 = animtime = 0
value = 117


[statedef 84];後ろ上7
type = A
physics = N
velset = 0, 0
ctrl = 0
anim = 88

[state 84, 角度設定]
type = varset
trigger1 = time = 0
fvar(11) = 135

[state 84, ]
type = changestate
trigger1 = animtime = 0
value = 117


[statedef 85];後ろ4
type = A
physics = N
velset = 0, 0
ctrl = 0
anim = 88

[state 85, 角度設定]
type = varset
trigger1 = time = 0
fvar(11) = 180

[state 85, ]
type = changestate
trigger1 = animtime = 0
value = 117


[statedef 86];後ろ下1
type = A
physics = N
velset = 0, 0
ctrl = 0
anim = 88

[state 86, 角度設定]
type = varset
trigger1 = time = 0
fvar(11) = -135

[state 86, ]
type = changestate
trigger1 = animtime = 0
value = 117


[statedef 87];下2
type = A
physics = N
velset = 0, 0
ctrl = 0
anim = 87

[state 87, 角度設定]
type = varset
trigger1 = time = 0
fvar(11) = -90

[state 87, ]
type = changestate
trigger1 = animtime = 0
value = 117


[statedef 88];前下3
type = A
physics = N
velset = 0, 0
ctrl = 0
anim = 87

[state 88, 角度設定]
type = varset
trigger1 = time = 0
fvar(11) = -45

[state 88, ]
type = changestate
trigger1 = animtime = 0
value = 117


[statedef 117];飛翔
type = A
physics = N
ctrl = 0
anim = 80

[state 117, ダッシュ回数]
type = varadd
trigger1 = time = 0
var(0) = 1

[state 117, 霊力消費]
type = varadd
trigger1 = time 
var(10) = -12

[state 117, エフェクト]
type = helper
trigger1 = time > 0
trigger1 = time%5 = 0
;trigger1 = (fvar(11) != 90) || (fvar(11) != -90)
stateno = 20030
ID = 20030
name = "hisyou_effect"
pos = ceil(38*cos(fvar(11) * pi/180)), ceil(-38*sin(fvar(11) * pi/180))
postype = p1
facing = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 1000

[state 117, エフェクト]
type = null;helper
trigger1 = time > 0
trigger1 = time%4 = 0
trigger1 = (fvar(11) = 90) || (fvar(11) = -90)
stateno = 20030
ID = 20030
name = "hisyou_effect"
pos = 0, ifelse(fvar(11) = 90, 38, -38)
postype = p1
facing = 1
ownpal = 1
ignorehitpause = 1
pausemovetime = 1000

[state 117, ]
type = playsnd
trigger1 = time = 0
value = 3, 1

[state 117, 座標移動]
type = posadd
trigger1 = time = 0
x = 2
y = -40

[state 117, 反時計回り]
type = varadd
triggerall = time > 10
trigger1 = command = "holdfwd" ;6
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1 = ((fvar(11) < 0) && (fvar(11) > -180)) || ((fvar(11) > 180) && (fvar(11) < 360))
trigger2 = command = "holdfwd" ;9
trigger2 = command = "holdup"
trigger2 = ((fvar(11) < 45) && (fvar(11) > -135)) || ((fvar(11) > 225) && (fvar(11) < 405))
trigger3 = command = "holdup" ;8
trigger3 = command != "holdfwd"
trigger3 = command != "holdback"
trigger3 = (fvar(11) < 90) && (fvar(11) > -90)
trigger4 = command = "holdback" ;7
trigger4 = command = "holdup"
trigger4 = ((fvar(11) < 135) && (fvar(11) > -45)) || ((fvar(11) > -405) && (fvar(11) < -225))
trigger5 = command = "holdback" ;4
trigger5 = command != "holdup"
trigger5 = command != "holddown"
trigger5 = ((fvar(11) < 180) && (fvar(11) > 0)) || ((fvar(11) > -360) && (fvar(11) < -180))
trigger6 = command = "holdback" ;1
trigger6 = command = "holddown"
trigger6 = ((fvar(11) < 225) && (fvar(11) > 45)) ||((fvar(11) > -315) && (fvar(11) < -135))
trigger7 = command = "holddown" ;2
trigger7 = command != "holdfwd"
trigger7 = command != "holdback"
trigger7 = ((fvar(11) < 275) && (fvar(11) > 90)) || ((fvar(11) > -275) && (fvar(11) < -90))
trigger8 = command = "holdfwd" ;3
trigger8 = command = "holddown"
trigger8 = ((fvar(11) < 315) && (fvar(11) > 135)) || ((fvar(11) > -225) && (fvar(11) < -45))
fvar(11) = 1


[state 117, 時計回り]
type = varadd
triggerall = time > 10
trigger1 = command = "holdfwd" ;6
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1 = ((fvar(11) < 180) && (fvar(11) > 0)) || ((fvar(11) > -360) && (fvar(11) < -180))
trigger2 = command = "holdfwd" ;9
trigger2 = command = "holdup"
trigger2 = ((fvar(11) < 225) && (fvar(11) > 45)) ||((fvar(11) > -315) && (fvar(11) < -135))
trigger3 = command = "holdup" ;8
trigger3 = command != "holdfwd"
trigger3 = command != "holdback"
trigger3 = ((fvar(11) < 275) && (fvar(11) > 90)) || ((fvar(11) > -275) && (fvar(11) < -90))
trigger4 = command = "holdback" ;7
trigger4 = command = "holdup"
trigger4 = ((fvar(11) < 315) && (fvar(11) > 135)) || ((fvar(11) > -225) && (fvar(11) < -45))
trigger5 = command = "holdback" ;4
trigger5 = command != "holdup"
trigger5 = command != "holddown"
trigger5 = ((fvar(11) < 0) && (fvar(11) > -180)) || ((fvar(11) > 180) && (fvar(11) < 360))
trigger6 = command = "holdback" ;1
trigger6 = command = "holddown"
trigger6 = ((fvar(11) < 45) && (fvar(11) > -135)) || ((fvar(11) > 225) && (fvar(11) < 405))
trigger7 = command = "holddown" ;2
trigger7 = command != "holdfwd"
trigger7 = command != "holdback"
trigger7 = (fvar(11) < 90) && (fvar(11) > -90)
trigger8 = command = "holdfwd" ;3
trigger8 = command = "holddown"
trigger8 = ((fvar(11) < 135) && (fvar(11) > -45)) || ((fvar(11) > -405) && (fvar(11) < -225))
fvar(11) = -1

[state 117, 速度設定]
type = velset
trigger1 = time = 0
trigger2 = time > 10
x = 4 * cos(fvar(11) * pi/180)*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))
y = 4 * -sin(fvar(11) * pi/180)*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[state 117, 回転]
type = angleset
trigger1 = time >= 0
trigger1 = (fvar(11) != 90) || (fvar(11) != -90)
value = atan(sin(fvar(11) * pi/180)/cos(fvar(11) * pi/180))*180/pi

[state 117, 回転2]
type = angleset
trigger1 = time >= 0
trigger1 = (fvar(11) = 90) || (fvar(11) = -90)
value = fvar(11)

[state 117, 回転実行]
type = angledraw
trigger1 = 1

[state 117, ]
type = changeanim
triggerall = anim != 80
trigger1 = (fvar(11) < 90) && (fvar(11) > -90)
trigger2 = (fvar(11) > 270) && (fvar(11) < 450)
trigger3 = (fvar(11) < -270) && (fvar(11) > 450)
value = 80

[state 117, ]
type = changeanim
triggerall = anim != 85
trigger1 = (fvar(11) > 90) && (fvar(11) < 270)
trigger2 = (fvar(11) < -90) && (fvar(11) > -270)
value = 85

[state 117, 終わり]
type = changestate
trigger1 = command != "hold_z"
trigger1 = time > 10
trigger2 = var(10) <= 0
trigger3 = vel Y > 0
trigger3 = pos Y >= -50
value = 80
ctrl = 1

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

[state 100, 回避結界]
type = helper
triggerall = time = 0
trigger1 = prevstateno = 151
trigger2 = prevstateno = 153
name = "use_card"
stateno = 13010
ID = 13010
pos = 0,-50
ownpal = 1
ignorehitpause = 1

[State 100, 1]
type = VelSet
trigger1 = time >= 6
x = const(velocity.run.fwd.x)*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

;[state 100, ]
;type = veladd
;trigger1 = time >= 30
;x = -0.1*(time -30)

[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 = prevstateno != 150
trigger1 = command != "holdfwd"
trigger1 = time > 11
trigger1 = time < 60
value = 52
ctrl = 1

[state 100, ステート変更]
type = changestate
trigger1 = prevstateno != 150
trigger1 = time = 60
value = 52
ctrl = 1

[state 100, 回避結界移行]
type = ctrlset
trigger1 = prevstateno = 150
value = 0

[state 100, ステート変更]
type = changestate
trigger1 = prevstateno = 150
trigger1 = time = 30
value = 52
ctrl = 1

[state 100, effect]
type = helper
trigger1 = animelem = 2
name = "dash_effect"
stateno = 20020
postype = p1
pos = 17,-44
facing = 1
ownpal = 1
ID = 20020
pausemovetime = 1000

[state 100, effect_線]
type = explod
trigger1 = time >= 4
anim = 20047
ID = 20047
postype = p1
pos = 0,ceil(random*-0.09+10)
facing = 1
scale = 1,1
vel = -4
ownpal = 1
sprpriority = 3
persistent = 6
pausemovetime = 1000

;---------------------------------------------------------------------------
;バックステップ
[Statedef 105]
type    = A
physics = A
ctrl = 0
anim = 105
sprpriority = 1

[state 105, 回避結界]
type = helper
triggerall = time = 0
trigger1 = prevstateno = 151
trigger2 = prevstateno = 153
name = "use_card"
stateno = 13010
ID = 13010
pos = 0,-50
ownpal = 1
ignorehitpause = 1

[State 105, 1]
type = VelSet
trigger1 = Time = 0
x = const(velocity.run.back.x)*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))
y = const(velocity.run.back.y)*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

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

[state 105, effect]
type = helper
trigger1 = animelem = 2
name = "dash_effect"
stateno = 20020
postype = p1
pos = 2,-44
facing = -1
ownpal = 1
ID = 20020
pausemovetime = 1000

[state 105, effect_線]
type = explod
trigger1 = time >= 4
anim = 20047
ID = 20047
postype = p1
pos = 0,ceil(random*-0.09+10)
facing = -1
scale = 1,1
vel = 4
ownpal = 1
sprpriority = 3
persistent = 6
pausemovetime = 1000

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

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

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

[State 106, 3]
type = MakeDust
trigger1 = Time = 2
pos = -5,-2
spacing = 1

[State 106, 4]
type = ChangeState
trigger1 = Time = 7
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;空中ダッシュ前
[Statedef 110]
type    = A
movetype = I
physics = A
anim = 110
ctrl = 0

[state 110, 回避結界]
type = helper
triggerall = time = 0
trigger1 = prevstateno = 155
name = "use_card"
stateno = 13010
ID = 13010
pos = 0,-50
ownpal = 1
ignorehitpause = 1

[state 110, ]
type = varadd
trigger1 = time = 0
var(0) = 1

[state 110, 速度]
type = velset
trigger1 = time >= 5
trigger1 = time < 12
y = -1*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[state 110, 速度]
type = velset
trigger1 = time = 6
y = -1*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[state 110, 速度]
type = velset
trigger1 = time > 6
x = 6*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[state 110, effect]
type = helper
trigger1 = animelem = 2
name = "dash_effect"
stateno = 20020
postype = p1
pos = 17,-44
facing = 1
ownpal = 1
ID = 20020
pausemovetime = 1000

[state 110, effect_線]
type = explod
trigger1 = time >= 4
anim = 20047
ID = 20047
postype = p1
pos = 0,ceil(random*-0.09+10)
facing = 1
scale = 1,1
vel = -4
ownpal = 1
sprpriority = 3
persistent = 6
pausemovetime = 1000

[state 110, ]
type = ctrlset
trigger1 = prevstateno != 155
trigger1 = time = 10
value = 1

[state 110, 回避結界]
type = ctrlset
trigger1 = prevstateno = 155
value = 0

[State 110, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52


;---------------------------------------------------------------------------
;空中ダッシュ後ろ
[Statedef 115]
type    = A
movetype = I
physics = A
anim = 115
ctrl = 0

[state 100, 回避結界]
type = helper
triggerall = time = 0
trigger1 = prevstateno = 155
name = "use_card"
stateno = 13010
ID = 13010
pos = 0,-50
ownpal = 1
ignorehitpause = 1

[state 115, ]
type = varadd
trigger1 = time = 0
var(0) = 1

[state 115, 速度]
type = velset
trigger1 = time < 6
x = 0
y = 0

[state 115, 速度]
type = velset
trigger1 = time >= 6
trigger1 = time < 12
y = -1*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[state 115, 速度]
type = velset
trigger1 = time > 6
x = -6*(1.00+0.05*ifelse((var(14) & (61440))/(4096) = 0, 0, log(2,(var(14) & (61440))/(4096) +1)))

[state 115, effect]
type = helper
trigger1 = animelem = 2
name = "dash_effect"
stateno = 20020
postype = p1
pos = 17,-44
facing = 1
ownpal = 1
ID = 20020
pausemovetime = 1000

[state 115, effect_線]
type = explod
trigger1 = time >= 4
anim = 20047
ID = 20047
postype = p1
pos = 0,ceil(random*-0.09+10)
facing = -1
scale = 1,1
vel = 4
ownpal = 1
sprpriority = 3
persistent = 6
pausemovetime = 1000

[state 115, ]
type = ctrlset
trigger1 = prevstateno != 155
trigger1 = time = 10
value = 1

[state 110, 回避結界]
type = ctrlset
trigger1 = prevstateno = 155
value = 0

[State 115, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52


;---------------------------------------------------------------------------
; RUN_DOWN
[Statedef 115]
type    = S
physics = N

[State 115, 0]
type = CtrlSet
trigger1 = Time = 0
value = 0

[State 115, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 110

[State 115, 2]
type = HitBy
trigger1 = Time = 0
value = SCA, NT, ST, HT
time = 30

[State 115, 3]
type = VelSet
trigger1 = Time = 0
x = 0
z = 7

[State 115, 4]
type = VelMul
trigger1 = 1
z = 0.8

[State 115, 5]
type = VelSet
trigger1 = AnimTime = -8
z = 0

[State 115, 7]
type = CtrlSet
trigger1 = AnimTime = 0
value = 1

[State 115, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
;立ちガード(開始)
[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
value = 130 + (statetype = C) + (statetype = A)*2

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

;---------------------------------------------------------------------------
;立ちガード(受付)
[Statedef 130]
type    = S
physics = S

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

[State 130, Hi to Lo]
type = ChangeState
trigger1 = command = "holddown"
value = 131

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

;---------------------------------------------------------------------------
;しゃがみガード(受付)
[Statedef 131]
type    = C
physics = C

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

[State 131, Lo to Hi]
type = ChangeState
trigger1 = command != "holddown"
value = 130

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

;---------------------------------------------------------------------------
;空中ガード(受付)
[Statedef 132]
type    = A
physics = N

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

[State 132, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 132, 3]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 132, 4]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 132, 5]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 132, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback"
trigger1 = inguarddist
value = 130

[State 132, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

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

;---------------------------------------------------------------------------
;立ちガード(終わり)
[Statedef 140]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged
ctrl = 1

[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

;---------------------------------------------------------------------------
;立ちガード(硬直)
[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

;ガードエフェクト-------------------------------------
[state 150]
type = Helper
trigger1 = time = 1
trigger1 = numhelper(150) = 0
name = "guard_effect"
ID = 150
pos = 15,-50
postype = p1
stateno = 20010
ownpal = 1

;---------------------------------------------------------------------------
;立ちガード(ノックバック)
[Statedef 151]
type    = S
movetype= H
physics = S
anim = 150

[State 151, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 151, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
x = 0

[State 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

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

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

[State 151, 4]
type = ChangeState
trigger1 = HitOver
value = 130
ctrl = 1

;---------------------------------------------------------------------------
;しゃがみガード(硬直)
[Statedef 152]
type    = C
movetype= H
physics = N
velset = 0,0

[State 152, 1]
type = ChangeAnim
trigger1 = 1
value = 151

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

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

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

[State 152, 4]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;ガードエフェクト----------------------------------------------------------------------------
[state 152]
type = Helper
trigger1 = time = 1
trigger1 = numhelper(150) = 0
name = "guard_effect"
ID = 150
pos = 15,-18
postype = p1
stateno = 20010
ownpal = 1

;---------------------------------------------------------------------------
;しゃがみガード(ノックバック)
[Statedef 153]
type    = C
movetype= H
physics = C
anim = 151

[State 153, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 153, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
x = 0

[State 153, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

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

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

[State 153, 4]
type = ChangeState
trigger1 = HitOver
value = 131
ctrl = 1

;---------------------------------------------------------------------------
;空中ガード(硬直)
[Statedef 154]
type    = A
movetype= H
physics = N
velset = 0,0

[State 154, 1]
type = ChangeAnim
trigger1 = 1
value = 152

[State 154, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 155 ;AGUARDHIT2

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

;ガードエフェクト----------------------------------------------------------------------------
[state 154]
type = Helper
trigger1 = time = 1
trigger1 = numhelper(150) = 0
name = "guard_effect"
ID = 150
pos = 9,-50
postype = p1
stateno = 20010
ownpal = 1

;---------------------------------------------------------------------------
;空中ガード(ノックバック)
[Statedef 155]
type    = A
movetype= H
physics = N
anim = 152

[State 155, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 155, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 155, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 155, 4]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 155, 5]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 155, 6]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 155, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback"
trigger1 = inguarddist
value = 130

[State 155, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

;---------------------------------------------------------------------------
;負け(タイムオーバー)
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[state 170, ]
type = playsnd
trigger1 = animelem = 4
value = 1,4

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

;---------------------------------------------------------------------------
;ドロー(タイムオーバー)
[Statedef 175]
type = S
ctrl = 0
anim = 170
velset = 0,0

[state 175, ]
type = playsnd
trigger1 = animelem = 4
value = 1,4

[State 175, 1] ; If no anim, use go to lose state.
type = ChangeState
trigger1 = Time = 0
trigger1 = !SelfAnimExist(175)
value = 170

;[State 175, 2]
;type = ChangeAnim
;trigger1 = Time = 0
;value = 175

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

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

[state 190, ]
type = assertspecial
trigger1 = 1
flag = intro

[state 190, ]
type = varrandom
trigger1 = time = 0
v = 26
range = 1,100

[state 190, ]
type = null;varset
trigger1 = time = 0
var(26) = 90

[state 190, ]
type = changestate
trigger1 = time = 0
trigger1 = var(26) != [1,60]
value = ifelse((var(26) = [61,80]),191,192)

[state 190, ]
type = playsnd
trigger1 = time = 20
value = 1,4

[state 190, ]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 190, 1]
type = ChangeAnim
trigger1 = roundstate = 0
value = 190

[State 190, 2] ;Go straight to intro.
type = ChangeState
trigger1 = animtime = 0
value = 0


;---------------------------------------------------------------------------
;イントロ・フラン
[Statedef 191]
type = S
ctrl = 0
anim = 191

[state 191, ]
type = assertspecial
trigger1 = 1
flag = intro

[state 191, ]
type = explod
trigger1 = time = 0
anim = 10191
ID = 10191
postype = p1
pos = 50,0
scale = 1,1
removetime = -2
sprpriority = -2

[state 191, ]
type = playsnd
trigger1 = time = 20
value = 1,4

[state 191, ]
type = playsnd
trigger1 = animelem = 33,<0
value = 1,0
channel = 1
persistent = 5

[state 191, ]
type = playsnd
trigger1 = animelem = 33
value = 0,0

[state 191, ]
type = null;modifyexplod
trigger1 = animelem = 33
anim = 10192
ID = 10191
postype = p1
pos = 50,0
scale = 1,1
removetime = -2
sprpriority = -2

[State 191, 1]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1


;---------------------------------------------------------------------------
;イントロ・ぬえ
[Statedef 192]
type = S
ctrl = 0
anim = 192

[state 192, ]
type = assertspecial
trigger1 = 1
flag = intro

[state 192, ]
type = null;explod
trigger1 = time = 0
anim = 10192
ID = 10192
vel = 0,0
postype = p1
pos = 0,-120
scale = 1,1
removetime = -1

[state 192, ぬえ]
type = helper
trigger1 = time = 0
name = "nue"
stateno = 10192
postype = p1
pos = 0,-120
ownpal = 1
ID = 10192

[state 192, ビーム]
type = helper
trigger1 = time = 30
name = "light"
stateno = 10193
postype = p1
pos = 0,-120
ownpal = 1
ID = 10193

[state 190, ]
type = playsnd
trigger1 = time = 60
value = 1,4

[state 192, ]
type = trans
trigger1 = time < 30
trans = addalpha
alpha = 0,256
ignorehitpause = 1

[state 192, ]
type = trans
trigger1 = time = [30,150]
trans = addalpha
alpha = ceil((time -30)*2.13),ceil(256-(time -30)*2.13)
ignorehitpause = 1

[state 192, ]
type = trans
trigger1 = time > 150
trans = addalpha
alpha = 256,0
ignorehitpause = 1

[state 191, ]
type = modifyexplod
trigger1 = time > 180
ID = 10192
vel = 0,-5
scale = 1,1
removetime = 120
sprpriority = 5

[state 192, ]
type = changeanim
trigger1 = time = 240
value = 193
ctrl = 0

[state 192, ]
type = changestate
trigger1 = anim = 193
trigger1 = animtime = 0
value = 0
ctrl = 1



;---------------------------------------
;ぬえ
[statedef 10192]
type = A
movetype = I
physics = N
anim = 10192
ctrl = 0
sprpriority = 5

[state 10192, ]
type = playsnd
trigger1 = time >= 0
value = 4,8
persistent = 30

[state 10192, ]
type = playsnd
trigger1 = time = 30
value = 4,9

[state 10192, ]
type = velset
trigger1 = time = 180
x = 0
y = -2

[state 10192, ]
type = destroyself
trigger1 = time = 260
trigger2 = roundstate > 1



;---------------------------------------
;ビーム
[statedef 10193]
type = A
movetype = I
physics = N
anim = 10193
ctrl = 0
sprpriority = -2

[state 10193, ]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 10193, ]
type = trans
trigger1 = time < 120
trans = addalpha
alpha = 256,256

[state 10193, ]
type = angledraw
trigger1 = 1
scale = 2.5,1

[state 10193, ]
type = trans
trigger1 = time >= 120
trans = addalpha
alpha = ceil(256-(time -120)*12.8),256

[state 10193, ]
type = destroyself
trigger1 = time = 150
trigger2 = roundstate > 1




;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
type    = S
movetype= H
physics = N
velset = 0,0

[state 5000, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5000, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5000, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
trigger1 = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5000, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 5001 ;HITG_SLIDE

[State 5000, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITG_SLIDE
[Statedef 5001]
type    = S
movetype= H
physics = S

[state 5001, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5001, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5001, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 5005 + GetHitVar(animtype) + (GetHitVar(groundtype)=2)*10

[State 5001, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5001, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5001, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 5001, 6]
type = ChangeState
trigger1 = HitOver
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; HITC_SHAKE
[Statedef 5010]
type    = C
movetype= H
physics = N
velset = 0,0

[state 5010, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5010, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = 5020 + GetHitVar(animtype)

[State 5010, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5010, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5010, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5010, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
triggerall = Time = 0
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = Pos Y != 0
statetype = a

[State 5010, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 5011 ;HITC_SLIDE

[State 5010, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5010, FFB Light]
type = ForceFeedback
trigger1 = anim = 5020
persistent = 0
time = 6
waveform = square

[State 5010, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5021
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5010, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5022
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITC_SLIDE
[Statedef 5011]
type    = C
movetype= H
physics = C

[state 5011, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5011, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5011, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
value = 5025 + GetHitVar(animtype)

[State 5011, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5011, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5011, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 5011, 6]
type = ChangeState
trigger1 = HitOver
value = 11
ctrl = 1


;---------------------------------------------------------------------------
; HITA_SHAKE
[Statedef 5020]
type    = A
movetype= H
physics = N
velset = 0,0

[state 5020, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5020, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(airtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5020, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5020, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5020, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5020, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
trigger4 = anim = [5051,5059]
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 5030]
type    = A
movetype= H
physics = N
ctrl = 0

[state 5030, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5030, 1]
type = VelAdd;Gravity
trigger1 = 1
y = GetHitVar(yaccel)

[State 5030, 2]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5030, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5040 ;HITA_RECOV

[State 5030, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5050 ;HITA_FALL

[State 5030, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 5035 ;HITA_UP (transition)

;---------------------------------------------------------------------------
; HITA_UP_T (transition)
[Statedef 5035]
type    = A
movetype= H
physics = N

[state 5035, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5035, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5035)
trigger1 = Anim != [5051,5059] ;Not if in hit up anim
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 5035

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

[State 5035, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Animation over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5040 ;HITA_RECOV

[State 5035, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Anim is over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5050 ;HITA_FALL

;---------------------------------------------------------------------------
; HITA_RECOV (recovering in air, not falling)
[Statedef 5040]
type    = A
movetype= H
physics = N

[state 5040, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5040, 1]
type = ChangeState
trigger1 = !Alive
value = 5050

[State 5040, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim != 5040
trigger2 = Time = 0
trigger2 = Anim != 5035
value = 5040

[State 5040, 3]
type = CtrlSet
trigger1 = HitOver
value = 1

[State 5040, 4]
type = StateTypeSet
trigger1 = HitOver
movetype = I

[State 5040, 5]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5040, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMPLAND

;---------------------------------------------------------------------------
; HITA_FALL (knocked up, falling)
[Statedef 5050]
type    = A
movetype= H
physics = N

[state 5050, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
value = 5050

[State 5050, 2] ;Coming down anim
type = ChangeAnim
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= ifelse(anim = 5050, 1, -2)
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

[State 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5050, 4] ;Recover near ground
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 5050, 5]; Recover in mid air
type = ChangeState
triggerall = Vel Y > -1
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, 25)
value = 5100 ;HIT_BOUNCE

;---------------------------------------------------------------------------
; HIT_TRIP (shaking)
[Statedef 5070]
type    = A
movetype= H
physics = N
velset = 0,0

[state 5070, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

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

[State 5070, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 5071

[State 5070, 3]
type = ForceFeedback
trigger1 = time = 0
time = 12
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HIT_TRIP2 (fall through air)
[Statedef 5071]
type    = A
movetype= H
physics = N

[state 5071, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5071, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5071, 2] ;Acceleration
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5071, 3] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 15
type = ChangeState
value = 5110

;---------------------------------------------------------------------------
; HITL_SHAKE
[Statedef 5080]
type    = L
movetype= H
physics = N
velset = 0,0

[state 5080, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5080, 1] ;Set default anim
type = VarSet
trigger1 = time = 0
sysvar(2) = ifelse (GetHitVar(yvel) = 0, 5080, 5090)

[State 5080, 2]
type = VarAdd
trigger1 = time = 0
trigger1 = (anim = [5081,5089]) || (anim = [5111,5119])
trigger1 = SelfAnimExist(sysvar(2) + (anim % 10))
sysvar(2) = anim % 10

[State 5080, 3] ;If 5090 doesn't exist, default to 5030
type = VarSet
trigger1 = time = 0
trigger1 = sysvar(2) = 5090
trigger1 = !SelfAnimExist(5090)
sysvar(2) = 5030

[State 5080, 3] ;Freeze
type = ChangeAnim
trigger1 = 1
value = sysvar(2)

[State 5080, 4]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
value = 5081 ;HITL_SLIDE

[State 5080, 5]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) != 0
value = 5030 ;HITA_UP

;---------------------------------------------------------------------------
; HITL_SLIDE
[Statedef 5081]
type    = L
movetype= H
physics = C

[state 5081, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5081, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5081, 2]
type = VelSet
trigger1 = HitOver
x = 0

[State 5081, 3] ;Don't show hit ground frame
type = VarSet
trigger1 = Time = 0
sysvar(0) = 1

[State 5081, 4]
type = ChangeState
trigger1 = HitOver
value = 5110 ;HIT_LIEDOWN

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

[state 5100, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[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 = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[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_BOUNCE (bounce into air)
[Statedef 5101]
type    = L
movetype= H
physics = N

[state 5101, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

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

[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = 1
y = .4

[State 5101, 6] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 12
type = ChangeState
value = 5110

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

[state 5110, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[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 = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[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

;---------------------------------------------------------------------------
;起き上がり
[Statedef 5120]
type    = L
movetype= I
physics = N
anim = 5120

[state 5120, 前移動]
type = changestate
trigger1 = time = 0
trigger1 = command = "holdfwd"
value = 5121

[state 5120, 後ろ移動]
type = changestate
trigger1 = time = 0
trigger1 = command = "holdback"
value = 5122

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

[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 5121]
type = L
movetype = I
physics = N
anim = 5121

[state 5121, スライド]
type = velset
trigger1 = time =0
x = 1

[state 5121, ]
type = velset
trigger1 = time = 21
x = 0

[state 5121, ワープ]
type = posadd
trigger1 = time = 24
x = 115

[state 5121, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 5121, ]
type = playerpush
trigger1 = 1
value = 0

[state 5121, ]
type = nothitby
trigger1 = 1
value = SCA

[State 5121, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 5123
ctrl = 0



;-------------------------------------------------------------------------------
;後ろ起き上がり
[statedef 5122]
type = L
movetype = I
physics = N
anim = 5121

[state 5122, スライド]
type = velset
trigger1 = time =0
x = -1

[state 5122, ]
type = velset
trigger1 = time = 21
x = 0

[state 5122, ワープ]
type = posadd
trigger1 = time = 24
x = -115

[state 5122, ]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 5122, ]
type = playerpush
trigger1 = 1
value = 0

[state 5122, ]
type = nothitby
trigger1 = 1
value = SCA

[State 5122, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 5123
ctrl = 0



;-------------------------------------------------------------------------------
;移動起き上がり・起き上がり
[statedef 5123]
type = L
movetype = I
physics = N
anim = 5123
ctrl = 0

[state 5121, ]
type = turn
trigger1 = p2bodydist x < 0

[state 5121, ]
type = nothitby
trigger1 = 1
value = SCA

[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


;---------------------------------------------------------------------------
; HIT_LIEDEAD
[Statedef 5150]
type    = L
movetype= H
physics = N
sprpriority = -3

[state 5150, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = Time = 0
triggerall = SelfAnimExist(5140)
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(5140 + (anim % 10))
value = 5140

[State 5150, 3] ;Hit up type anim
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = 5110

[State 5150, 6] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5150, 7] ;Friction
type = VelSet
trigger1 = Vel x < .05
persistent = 0
x = 0

[State 5150, 8]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
;吹っ飛び(still falling)
[Statedef 5200]
type    = A
movetype= H
physics = N

[state 5200, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[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
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 10
value = 5201

;---------------------------------------------------------------------------
;空中受け身(地上に近い時)
[Statedef 5201]
type    = A
movetype= H
physics = A
anim = 5200

[state 5201, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[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
x = -.15
y = -3.5

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

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

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

[State 5201, 6]
type = GameMakeAnim
trigger1 = Time = 1
value = 60
pos = 0, 0
under = 1

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

[state 5210, ヘルパー分身回避]
type = destroyself
trigger1 = time = 0
trigger1 = ishelper

[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 5500]
type = S
ctrl = 0
anim = 5300
velset = 0,0

[State 5500, 1] ;Use continue animation if available
type = ChangeAnim
trigger1 = time = 0
trigger1 = SelfAnimExist(5500)
value = 5500

;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 5900]
type = S

[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = roundsexisted = 0
value = 0

[State 5900, 2] ;Clear all float variables
type = VarRangeSet
trigger1 = roundsexisted = 0
fvalue = 0

[State 5900, 3] ;Intro for round 1
type = ChangeState
trigger1 = roundno = 1
trigger2 = roundsexisted = 0
trigger2 = teammode = turns
trigger2 = roundno > 0
value = 190

