;---------------------------------------------------------------------------
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0

[State -1];ﾋﾟﾁｭｰﾝ
type = DestroySelf
trigger1 = IsHelper
IgnoreHitPause = 1
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = ChangeState
trigger1 = Alive !
Value = 5050

[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
x = 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
;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type    = C
physics = C
anim = 10

[State -1]
type = ChangeState
trigger1 = (Var(56)!=0)
Value = 0

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

[State -1]
type = ChangeState
trigger1 = AnimTime = 0
value = 11

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
physics = C
anim = 11
sprpriority = 0

[State -1]
type = ChangeAnim
trigger1 = Anim=6&&AnimTime = 0
value = 11
;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S
anim = 12

[State -1]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

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

[State -1]
type = ChangeState
trigger1 = Var(35)!=0
Value = 0

[State -1]
type = VelSet
trigger1 = command = "holdfwd"
trigger1 = Var(56) = 0
x = const(velocity.walk.fwd.x)

[State -1]
type = VelSet
trigger1 = Var(56) = 0
trigger1 = command = "holdback"
trigger2 = (Var(56)>=1)*(FVar(1)<=300)*(Var(35)!=[61,65])*(Var(7)=0)
trigger3 = (Var(56)>=1)*(Var(35)=1)*(P2Dist X=[-40,40])
x = const(velocity.walk.back.x)

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

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

;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = A
physics = S
anim = 40
VelSet = 0,0
ctrl = 0
sprpriority = 1

[State -1]
type = ChangeState
triggerall = StateType=S
trigger1 = (Var(56)>=1)
Value = 0
ctrl = 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)))
y = const(velocity.jump.y)

[State -1]
type = ChangeState
trigger1 = Var(56) != 0
Value = 0
ctrl = 1

[State 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 40, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1
;----------------------------------------------------------
[Statedef 42]
type = S
physics = S
anim = 110
ctrl = 0

[State -1]
type = VelSet
trigger1 = time = 5
x = 5
y = -9

[State -1]
type = StateTypeSet
trigger1 = time = 5
StateType = A
Physics = A

[State -1]
type = helper
trigger1 = time = 5
ID = 8050
postype = p1
stateno = 8011
ownpal = 1
keyctrl = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = Nothitby
trigger1 = time >= 0
trigger1 = time <= 27
value = ,AP

[State -1]
Type = AfterImage
Trigger1 = Time = 5
Time = 20
Length = 10
PalBright = 0, 0, 0
PalContrast = 0, 0, 192
PalAdd = -60, -60, -60
PalMul = 1, 1, 1
Trans = Add
TimeGap = 1
FrameGap = 3
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = CtrlSet
trigger1 = time = 27
value = 1

;読み込み妨害回避位置

[State -1]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA, NP, SP, HP
pauseTime = 0,0
numHits = 0

[State -1,グレイズ呼び出し]
type = helper
trigger1 = movehit = 1
stateno = 9998
ID = 9997
pos = 0,-47
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 4
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999
;--------------------------------------------
[Statedef 43]
type = S
physics = S
anim = 115
ctrl = 0

[State -1]
type = VelSet
trigger1 = time = 5
x = -5
y = -9

[State -1]
type = StateTypeSet
trigger1 = time = 5
StateType = A
Physics = A

[State -1]
type = helper
trigger1 = time = 5
ID = 8050
postype = p1
stateno = 8011
ownpal = 1
keyctrl = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = Nothitby
trigger1 = time >= 0
trigger1 = time <= 26
value = ,AP

[State -1]
Type = AfterImage
Trigger1 = Time = 5
Time = 20
Length = 10
PalBright = 0, 0, 0
PalContrast = 0, 0, 192
PalAdd = -60, -60, -60
PalMul = 1, 1, 1
Trans = Add
TimeGap = 1
FrameGap = 3
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = CtrlSet
trigger1 = time = 26
value = 1

;読み込み妨害回避位置

[State -1]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA, NP, SP, HP
pauseTime = 0,0
numHits = 0

[State -1,グレイズ呼び出し]
type = helper
trigger1 = movehit = 1
stateno = 9998
ID = 9997
pos = 0,-50
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 4
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999
;---------------------------------------------------------------------------
; AirJump Start
[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)))
y = const(velocity.airjump.y)

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

;------------------------------------------
;空中ダッシュ
[Statedef 48]
type = A
physics = N
anim = 48
velset = 0,0
ctrl = 0

[State 48]
type = Varadd
trigger1 = Time = 0
var(0) = -1

[State 48]
type = PosFreeze
trigger1 = time = 0
value = 1

[State 48]
type = VelSet
trigger1 = time = 9
x = 6
y = -4

[State 48, Plysnd]
type = PlaySnd
trigger1 = time = 9
value = S400,0

[State -1]
Type        = Explod
Trigger1    = time = 9
Anim        = 8000
ID          = 8000
Postype     = P1
Pos         = 10,-50
OwnPal      = 1
Scale       = 0.6,0.4
Vel         = -0.5,0
SprPriority = 1
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State 48,波紋]
type = helper
trigger1 = time = 9
ID = 8010
pos = 50,-50
postype = p1
stateno = 8010
ownpal = 1
keyctrl = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State 48, AfterImage]
Type = AfterImage
Trigger1 = time = 9
Time = 25
Length = 10
PalBright = 0, 0, 0
PalContrast = 0, 0, 192
PalAdd = -60, -60, -60
PalMul = 1, 1, 1
Trans = Add
TimeGap = 1
FrameGap = 3
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State 48]
type = nothitby
trigger1 = Time >= 0
trigger1 = Time <= 22
value = ,AP
time = 1

[State 48]
type = CtrlSet
trigger1 = time = 22
value = 1

[State 48]
type = StateTypeSet
trigger1 = Time = 9
physics = A

[State 48, ChangeState]
type = ChangeState
Trigger1 = Vel Y > 0
Trigger1 = Pos Y >= 0
value = 52

;読み込み妨害回避位置

[State -1]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA, NP, SP, HP
pauseTime = 0,0
numHits = 0

[State -1,グレイズ呼び出し]
type = helper
trigger1 = movehit = 1
stateno = 9998
ID = 9997
pos = 0,-40
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 4
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999
;--------------------------
;空中バックダッシュ
[Statedef 60]
type = A
physics = N
anim = 108
velset = 0,0
ctrl = 0

[State 108]
type = Varadd
trigger1 = Time = 0
v = 0
value = -1

[State 108]
type = PosFreeze
trigger1 = time = 0
value = 1

[State 108]
type = VelSet
trigger1 = AnimElem = 4
x = -6
y = -3

[State 108, Plysnd]
type = PlaySnd
trigger1 = AnimElem = 4
value = S400,0

[State -1]
Type        = Explod
Trigger1    = AnimElem = 4
Anim        = 8000
ID          = 8000
Postype     = P1
Pos         = 0,-45
OwnPal      = 1
Scale       = 0.6,0.4
Vel         = -0.5,0
SprPriority = 1
facing = -1
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State 108,波紋]
type = helper
trigger1 = AnimElem = 4
ID = 8010
pos = -20,-50
postype = p1
stateno = 8010
ownpal = 1
keyctrl = 0
facing = -1
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State 108, AfterImage]
Type = AfterImage
Trigger1 = Animelem = 4
Time = 28
Length = 10
PalBright = 0, 0, 0
PalContrast = 0, 0, 192
PalAdd = -60, -60, -60
PalMul = 1, 1, 1
Trans = Add
TimeGap = 1
FrameGap = 3
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State 108, nothitby]
type = nothitby
trigger1 = Time >= 0
trigger1 = Time <= 24
value = ,AP
time = 1

[State 108]
type = CtrlSet
trigger1 = time = 24
value = 1

[State 108]
type = StateTypeSet
trigger1 = Time = 10
physics = A

[State 48, ChangeState]
type = ChangeState
Trigger1 = Vel Y > 0
Trigger1 = Pos Y >= 0
value = 52

;読み込み妨害回避位置

[State -1]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA, NP, SP, HP
pauseTime = 0,0
numHits = 0

[State -1,グレイズ呼び出し]
type = helper
trigger1 = movehit = 1
stateno = 9998
ID = 9997
pos = 0,-50
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 4
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999
;---------------------------------------------------
[StateDef 49]
Type = S
Physics = S
Ctrl = 0
Anim = 49

[State -1]
type = AfterImageTime
trigger1 = time = 0
time = 0

[State -1]
Type = VelSet
Trigger1 = Time = 0
X = 0
Y = 0

[State -1]
Type = PosSet
Trigger1 = Time = 0
Y = 0

[State -1]
Type = ChangeState
Trigger1 = AnimTime = 0
Value = 0
Ctrl = 1
;----------------------------------------------
[Statedef 704]
type = S
physics = S
ctrl = 0
Anim = 704

[State 704, VelSet]
Type = VelSet
Trigger1 = Time = 0
X = 0
Y = 0

[State 704, PosSet]
Type = PosSet
Trigger1 = Time = 0
Y = 0

[State 704, ChangeState]
Type = ChangeState
Trigger1 = AnimTime = 0
Value = 0
Ctrl = 1
;----------------------------------------------
;着地
[StateDef 52]
Type = S
Physics = S
Ctrl = 1
Anim = 47

[State -1]
type = Turn
trigger1 = time = 0 && P2Dist X<0

[State 52, VelSet]
Type = VelSet
Trigger1 = Time = 0
X = 0
Y = 0

[State 52, PosSet]
Type = PosSet
Trigger1 = Time = 0
Y = 0

[State 52, PlaySnd]
Type = PlaySnd
Trigger1 = time = 1
Value = S400, 1

[State 52, ChangeState]
Type = ChangeState
Trigger1 = AnimTime = 0
Value = 0
Ctrl = 1
;---------------------------------------------------------------------------
; Jump Up
[Statedef 50]
type    = A
physics = A

[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 Down (empty state for compatibility)
[Statedef 51]
type    = A
physics = A
ctrl = 1

[State 51, 1]
type = Null
trigger1 = 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 52, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;--------------------------------------------------------------------------
;ハイジャンプ1
[Statedef 54]
type = S
physics = S
ctrl = 0
Anim = 40

[State -1]
type = NotHitBy
trigger1 = 1
Value = ,AP
time = 1

[State 54]
type = changestate
trigger1 = Animtime = 0
value = 55
;--------------------------------------------------------------------------
;ハイジャンプ2
[Statedef 55]
type = A
physics = A
ctrl = 0
Anim = 55
VelSet = 0,0

[State 55,波紋]
type = helper
trigger1 = time = 0
ID = 8050
postype = p1
stateno = 8011
ownpal = 1
keyctrl = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State 55,velset]
type = velset
trigger1 = time = 0
x = 0
y = -12

[State 55, AfterImage]
Type = AfterImage
Trigger1 = Time = 0
Time = 24
Length = 10
PalBright = 0, 0, 0
PalContrast = 0, 0, 192
PalAdd = -60, -60, -60
PalMul = 1, 1, 1
Trans = Add
TimeGap = 1
FrameGap = 3
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State 55, nothitby]
type = nothitby
trigger1 = time >= 0
trigger1 = time <= 19
value = ,AP
time = 1

[State -1]
type = CtrlSet
trigger1 = Time = 19
Value = 1

[State 55,changestate]
type = changestate
Trigger1 = Animtime = 0
Trigger1 = Vel Y > 0
Trigger1 = Pos Y >= 0
value = 52

;読み込み妨害回避位置

[State -1]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA, NP, SP, HP
pauseTime = 0,0
numHits = 0

[State -1,グレイズ呼び出し]
type = helper
trigger1 = movehit = 1
stateno = 9998
ID = 9997
pos = 0,-50
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 4
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999
;---------------------------------------------------------------------------
;音なし着地用
[Statedef 65]
type = S
physics = S
ctrl = 0
Anim = 49

[State -1]
type = AngleDraw
trigger1 = time = 0
Value = 0

[State -1]
type = NotHitBy
trigger1 = PrevStateNo=[5121,5122]
Value = SCA
time = 9
ignorehitpause = 1
persistent = 0

[State -1]
type = Helper
trigger1 = PrevStateNo = 1000
StateNo = 1011
ID = 1011
PosType = P1
Pos = 0,-10
OwnPal = 1
KeyCtrl = 0
ignorehitpause = 1
persistent = 0

[State -1]
type = Helper
trigger1 = PrevStateNo = 1005
StateNo = 1012
ID = 1012
PosType = P1
Pos = 10,10
OwnPal = 1
KeyCtrl = 0
ignorehitpause = 1
persistent = 0

[State -1]
type = Helper
trigger1 = PrevStateNo = 1005
StateNo = 1012
ID = 1012
PosType = P1
Pos = 10,10
OwnPal = 1
facing = -1
KeyCtrl = 0
ignorehitpause = 1
persistent = 0

[State -1]
type = Helper
trigger1 = PrevStateNo = 1005
StateNo = 1013
ID = 1013
PosType = P1
Pos = 0,10
OwnPal = 1
KeyCtrl = 0
ignorehitpause = 1
persistent = 0

[State -1]
type = EnvShake
trigger1 = PrevStateNo = [1000,1005]
time = 10
freq = 120
ampl = -5
ignorehitpause = 1
persistent = 0

[State -1]
type = velset
trigger1 = time = 0
x = 0
y = 0

[State 65]
type = posset
trigger1 = time = 0
y = 0

[State 65]
type = changestate
trigger1 = Animtime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 100]
type    = S
physics = S
anim = 100
sprpriority = 1
ctrl = 0

[State -1]
type = VelSet
trigger1 = time >= 6
x = const(velocity.run.fwd.x)

[State -1]
Type = AfterImage
Trigger1 = Time = 5 && Var(59)!=10
Time = 50
Length = 10
PalBright = 0, 0, 0
PalContrast = 0, 0, 192
PalAdd = -60, -60, -60
PalMul = 1, 1, 1
Trans = Add
TimeGap = 1
FrameGap = 3
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
Type = AfterImage
Trigger1 = Time = 5 && Var(59)=10
Time = 50
Length = 10
PalBright = 0, 0, 0
PalContrast = 192,0,0
PalAdd = -60, -60, -60
PalMul = 1, 1, 1
Trans = Add
TimeGap = 1
FrameGap = 3
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = playsnd
trigger1 = time = 5
value = s400,0

[State -1]
type = AssertSpecial
trigger1 = 1
flag = NoWalk
flag2 = NoAutoTurn

[State -1]
type = nothitby
trigger1 = 1
value = ,AP
time = 1

[State -1]
Type        = Explod
Trigger1    = time = 5
Anim        = 8000
ID          = 8000
Postype     = P1
Pos         = 10,-50
OwnPal      = 1
Scale       = 0.6,0.4
Vel         = -0.5,0
SprPriority = 1
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = helper
trigger1 = time = 5
ID = 8010
pos = 50,-40
postype = p1
stateno = 8010
ownpal = 1
keyctrl = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = ChangeState
triggerall = Var(56) = 0
triggerall = Time > 10
trigger1 = command != "holdfwd"
trigger2 = time > 32
value = 101

[State -1]
type = ChangeState
triggerall = Var(56)!=0
triggerall = Time > 10
trigger1 = (Time>32)+(Random=[700,730])+(RoundState=4)+((P2BodyDist X<100)*(Enemy,NumHelper<5))
value = 101

[State -1]
Type = ChangeState
triggerall = Var(56) = 0
TriggerAll = Time > 10
Trigger1 = Command = "holdfwd"
Trigger1 = Command = "holdup"
Value = 42

[State -1]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA, NP, SP, HP
pauseTime = 0,0
numHits = 0

[State -1]
type = helper
trigger1 = movehit = 1
stateno = 9998
ID = 9997
pos = 0,-40
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 4
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999
;----------------
[StateDef 101]
Type = S
Physics = S
Anim = 101
Ctrl = 0
SprPriority = 1

[State -1]
type = VelSet
trigger1 = 1
x = 4

[State -1]
Type     = AfterImageTime
Trigger1 = Time = 0
Time     = 0

[State -1]
Type = AssertSpecial
Trigger1 = 1
Flag = NoWalk
Flag2 = NoAutoTurn

[State -1]
Type = ChangeState
TriggerAll = Var(56) = 0
TriggerAll = Time < 6
Trigger1 = Command = "holdup"
Value = 54

[State -1]
Type = ChangeState
TriggerAll = Var(59) != 10
TriggerAll = InGuardDist
Trigger1 = Command = "holdback"
Trigger2 = Command = "holdback"
Trigger2 = Command = "holddown"
Value = 120

[State -1]
Type = ChangeState
Trigger1 = AnimTime = 0
Value = 0
Ctrl = 1
;---------------------------------------------------------------------------
;バックステップ
[statedef 105]
type    = S
physics = S
ctrl = 0
anim = 105

[State -1]
type = nothitby
trigger1 = Time >= 0
trigger1 = Time <= 5
value = SCA

[State -1]
type = velset
trigger1 = time = 0
x = 0

[State -1]
type = StateTypeSet
trigger1 = time = 5
StateType = A
Physics = N

[State -1]
Type        = Explod
Trigger1    = AnimElem = 3
Anim        = 8000
ID          = 8000
Postype     = P1
Pos         = 5,-40
OwnPal      = 1
Vel         = -0.5,0
Scale       = 0.6,0.4
SprPriority = 1
facing = -1
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = helper
trigger1 = AnimElem = 3
ID = 8010
pos = 0,-40
postype = p1
stateno = 8010
ownpal = 1
keyctrl = 0
facing = -1
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = PlaySnd
trigger1 = AnimElem = 3
value = s400, 0

[State -1]
Type = AfterImage
Trigger1 = AnimElem = 3 && Var(59)=10
Time = 20
Length = 10
PalBright = 0, 0, 0
PalContrast = 0, 0, 192
PalAdd = -60, -60, -60
PalMul = 1, 1, 1
Trans = Add
TimeGap = 1
FrameGap = 3
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
Type = AfterImage
Trigger1 = AnimElem = 3 && Var(59)=10
Time = 50
Length = 10
PalBright = 0, 0, 0
PalContrast = 192,0,0
PalAdd = -60, -60, -60
PalMul = 1, 1, 1
Trans = Add
TimeGap = 1
FrameGap = 3
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = nothitby
trigger1 = 1
value = ,AP

[State 105, velset]
type = Velset
trigger1 = time = 5
x = -8
y = -1.5

[State -1]
type = VelAdd
trigger1 = Vel Y
Y = .16

[State 105, ChangeState]
type = ChangeState
trigger1 = Animtime = 0
value = 106

;読み込み妨害回避位置

[State -1]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA, NP, SP, HP
pauseTime = 0,0
numHits = 0

[State -1,グレイズ呼び出し]
type = helper
trigger1 = movehit = 1
stateno = 9998
ID = 9997
pos = 0,-60
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 4
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999
;------------------
[Statedef 106]
type = S
physics = S
ctrl = 0
anim = 106

[State 106, velset]
type = velset
trigger1 = time = 0
x = 0
y = 0

[State 106, posset]
type = posset
trigger1 = time = 0
y = 0

[State 106, changestate]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; GUARD (start)
[Statedef 120]
type = U
physics = U

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

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

[State -1]
type = StateTypeSet
triggerall = Var(56) >= 1
triggerall = StateType != A
trigger1 = P2StateType = C
StateType = C
Physics = C

[State -1]
type = StateTypeSet
triggerall = Var(56) >= 1
triggerall = StateType != A
trigger1 = P2StateType != C
StateType = S
Physics = S

[State -1]
type = StateTypeSet
triggerall = Var(56) >= 1
trigger1   = StateType = A
StateType = A

[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, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = FVar(2) = 0
value = 130 + (statetype = C) + (statetype = A)*2
;---------------------------------------------------------------------------
; STAND GUARD (guarding)
[Statedef 130]
type    = S
physics = S

[State -1]
type = ChangeAnim
trigger1 = Anim != 130
trigger1 = Anim != 133
trigger1 = FVar(2) = 1
Value = 133

[State 130, 1]
type = ChangeAnim
trigger1 = Anim != 130
trigger1 = Anim != 133
trigger1 = FVar(2) = 0
value = 130

[State -1]
type = StateTypeSet
trigger1 = (P2StateType = C)*(Var(56) >=1)
trigger2 = (Var(56) = 0)*(command = "holdback")*(command = "holddown")
StateType = C
Physics = C

[State -1]
type = StateTypeSet
triggerall = Var(56) >=1
trigger1   = (EnemyNear,HitDefAttr = C,AA)*(EnemyNear,StateType = C)
trigger2   = (EnemyNear,HitDefAttr = A,AA)*(EnemyNear,StateType = C)
trigger3   = (EnemyNear,HitDefAttr = C,AA)*(EnemyNear,StateType = A)
StateType = C
Physics = C

[State 130, モーション終了]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140
;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
type    = C
physics = C

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

[State -1]
type = StateTypeSet
trigger1 = ((P2StateType = S)+(P2StateType = A))*(Var(56) >=1)
trigger2 = (Var(56) = 0)*(command = "holdback")*(command != "holddown")
StateType = S
Physics = S

[State -1]
type = StateTypeSet
triggerall = Var(56) >=1
trigger1   = (EnemyNear,StateType = S)*(EnemyNear,HitDefAttr = S,AA)
trigger2   = (EnemyNear,HitDefAttr = S,AA)*(EnemyNear,StateType = C)
trigger3   = (EnemyNear,StateType = A)*(EnemyNear,HitDefAttr = A,AA)
trigger4   = (Enemy,NumProj > 0 || Enemy,NumHelper > 0)*(EnemyNear,HitDefAttr = A,AA || EnemyNear,HitDefAttr = A,AP)
trigger5   = (EnemyNear,StateType = A)*(EnemyNear,HitDefAttr = S,AA)
StateType = S
Physics = S

[State 132, モーション終了]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140
;---------------------------------------------------------------------------
; AIR GUARD (guarding)
[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"
value = 52

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

[State 132, モーション終了]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140
;---------------------------------------------------------------------------
; GUARD (end)
[Statedef 140]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged
ctrl = 1

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

[State 140, 1]
type = ChangeAnim
trigger1 = FVar(2) = 0
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 -1]
type = CtrlSet
trigger1 = Anim = 142 && AnimTime >= 15
Value = 1

[State -1]
type = ChangeState
trigger1 = Anim = 142 && AnimTime >= 15
Value = 51
Ctrl = 1

[State -1]
type = StateTypeSet
triggerall = Var(56) >= 1
triggerall = StateType != A
trigger1 = P2StateType = C
StateType = C
Physics = C

[State -1]
type = StateTypeSet
triggerall = Var(56) >= 1
triggerall = StateType != A
trigger1 = P2StateType = S
trigger2 = P2StateType = A
StateType = S
Physics = S

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

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

[State -1]
type = Helper
trigger1 = !NumHelper(7100)
trigger1 = FVar(2) = 0
StateNo = 7100
ID = 7100
PosType = P1
OwnPal = 1
Keyctrl = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = LifeAdd
trigger1 = Life >= 2
trigger1 = FVar(2) = 1
trigger1 = GetHitVar(Damage)!=0
Value = Floor(GetHitVar(Damage)*-2)
Kill = 0
ignorehitpause = 1
persistent = 0

[State -1]
type = LifeAdd
trigger1 = Life >= 2
trigger1 = FVar(2) = 1
trigger1 = GetHitVar(Damage)=0
Value = -3
Kill = 0
ignorehitpause = 1
persistent = 0

[State -1]
type = LifeAdd
trigger1 = FVar(2) = 0
Value = GetHitVar(Damage)
Kill = 0
ignorehitpause = 1
persistent = 0

[State -1]
type = VarAdd
trigger1 = FVar(2) = 0
FV = 1
Value = Floor(GetHitVar(Damage)*-10)
ignorehitpause = 1
persistent = 0

[State -1]
type = helper
trigger1 = FVar(4) = 1
Stateno = 14010
ID = 14010
pos = 0,-48
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = ChangeState
trigger1 = FVar(4) = 1
value = 5300
ignorehitpause = 1

[State -1]
type = VarSet
trigger1 = GetHitVar(Damage)!=0
trigger1 = FVar(2) = 0
FV = 3
Value = 60
ignorehitpause = 1
persistent = 0

[State -1]
type = StateTypeSet
trigger1 = (P2StateType = C)*(Var(56) >=1)
trigger2 = (Var(56) = 0)*(command = "holdback")*(command = "holddown")
StateType = C
Physics = C

[State -1]
type = ChangeAnim
trigger1 = 1
trigger1 = FVar(2) = 1
Value = 133

[State 150, 1]
type = ChangeAnim
trigger1 = 1
trigger1 = FVar(2) = 0
value = 150

[State 150, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 151

[State 150, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 3
;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
type    = S
movetype= H
physics = S

[State -1]
type = helper
trigger1 = FVar(4) = 1
Stateno = 14010
ID = 14010
pos = 0,-48
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = ChangeState
trigger1 = FVar(4) = 1
value = 5300
ignorehitpause = 1

[State -1]
type = ChangeAnim
trigger1 = 1
trigger1 = FVar(2) = 1
Value = 133

[State 151]
type = ChangeAnim
trigger1 = 1
trigger1 = FVar(2) = 0
value = 150

[State -1]
type = StateTypeSet
trigger1 = (P2StateType = C)*(Var(56) >=1)
trigger2 = (Var(56) = 0)*(command = "holdback")*(command = "holddown")
StateType = C
Physics = C

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

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

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

[State 151, 4]
type = ChangeState
trigger1 = Time >= GetHitVar(hittime)
value = 130
ctrl = 1

;---------------------------------------------------------------------------
; CGUARDHIT (shaking)
[Statedef 152]
type    = C
movetype= H
physics = N
velset = 0,0

[State -1]
type = Helper
trigger1 = !NumHelper(7100)
trigger1 = FVar(2) = 0
StateNo = 7100
ID = 7100
PosType = P1
OwnPal = 1
Keyctrl = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = LifeAdd
trigger1 = Life >= 2
trigger1 = FVar(2) = 1
trigger1 = GetHitVar(Damage)!=0
Value = Floor(GetHitVar(Damage)*-2)
Kill = 0
ignorehitpause = 1
persistent = 0

[State -1]
type = LifeAdd
trigger1 = Life >= 2
trigger1 = FVar(2) = 1
trigger1 = GetHitVar(Damage)=0
Value = -3
Kill = 0
ignorehitpause = 1
persistent = 0

[State -1]
type = LifeAdd
trigger1 = FVar(2) = 0
Value = GetHitVar(Damage)
Kill = 0
ignorehitpause = 1
persistent = 0

[State -1]
type = VarAdd
trigger1 = FVar(2) = 0
FV = 1
Value = Floor(GetHitVar(Damage)*-10)
ignorehitpause = 1
persistent = 0

[State -1]
type = helper
trigger1 = FVar(4) = 1
Stateno = 14010
ID = 14010
pos = 0,-48
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = ChangeState
trigger1 = FVar(4) = 1
value = 5300
ignorehitpause = 1

[State -1]
type = VarSet
trigger1 = GetHitVar(Damage)!=0
trigger1 = FVar(2) = 0
FV = 3
Value = 60
ignorehitpause = 1
persistent = 0

[State -1]
type = ChangeAnim
trigger1 = 1
trigger1 = FVar(2) = 1
Value = 134

[State 152]
type = ChangeAnim
trigger1 = 1
trigger1 = FVar(2) = 0
value = 151

[State -1]
type = StateTypeSet
trigger1 = ((P2StateType = S)+(P2StateType = A))*(Var(56) >=1)
trigger2 = (Var(56) = 0)*(command = "holdback")*(command != "holddown")
StateType = S
Physics = S

[State 152, 3]
type = ChangeState
trigger1 = HitShakeOver
value = 153

[State 152, 4]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4
;---------------------------------------------------------------------------
; CGUARDHIT2 (knocked back)
[Statedef 153]
type    = C
movetype= H
physics = C

[State -1]
type = helper
trigger1 = FVar(4) = 1
Stateno = 14010
ID = 14010
pos = 0,-48
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = ChangeState
trigger1 = FVar(4) = 1
value = 5300
ignorehitpause = 1

[State -1]
type = ChangeAnim
trigger1 = 1
trigger1 = FVar(2) = 1
Value = 134

[State 152]
type = ChangeAnim
trigger1 = 1
trigger1 = FVar(2) = 0
value = 151

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

[State -1]
type = StateTypeSet
trigger1 = ((P2StateType = S)+(P2StateType = A))*(Var(56) >=1)
trigger2 = (Var(56) = 0)*(command = "holdback")*(command != "holddown")
StateType = S
Physics = S

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

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

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

[State 153, 4]
type = ChangeState
trigger1 = Time >= GetHitVar(hittime)
value = 131
ctrl = 1

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

[State -1]
type = Helper
trigger1 = !NumHelper(7100)
trigger1 = FVar(2) = 0
StateNo = 7100
ID = 7100
PosType = P1
OwnPal = 1
Keyctrl = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = LifeAdd
trigger1 = FVar(2) = 0
Value = GetHitVar(Damage)
Kill = 0
ignorehitpause = 1
persistent = 0

[State -1]
type = VarAdd
trigger1 = FVar(2) = 0
trigger1 =  GetHitVar(Damage)!=0
FV = 1
Value = Floor(GetHitVar(Damage)*-10)
ignorehitpause = 1
persistent = 0

[State -1]
type = VarAdd
trigger1 = FVar(2) = 0
trigger1 =  GetHitVar(Damage)=0
FV = 1
Value = -125
ignorehitpause = 1
persistent = 0

[State -1]
type = helper
trigger1 = FVar(4) = 1
Stateno = 14010
ID = 14010
pos = 0,-48
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = ChangeState
trigger1 = FVar(4) = 1
value = 5301
ignorehitpause = 1

[State -1]
type = VarSet
trigger1 = FVar(2) = 0
FV = 3
Value = 60
ignorehitpause = 1
persistent = 0

[State -1]
type = ChangeAnim
trigger1 = 1
value = 152

[State -1]
type = ChangeState
trigger1 = HitShakeOver
value = 155

[State -1]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; AGUARDHIT2 (knocked away)
[Statedef 155]
type    = A
movetype= H
physics = N
anim = 152

[State -1]
type = helper
trigger1 = FVar(4) = 1
Stateno = 14010
ID = 14010
pos = 0,-48
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 0
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = ChangeState
trigger1 = FVar(4) = 1
value = 5301
ignorehitpause = 1

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

[State -1]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State -1]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

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

[State -1]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State -1]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State -1]
type = ChangeAnim
trigger1 = time = 19
Value = 142

[State -1]
type = CtrlSet
trigger1 = Anim = 142
Value = 1

[State -1]
type = ChangeState
trigger1 = Anim = 142
Value = 51
Ctrl = 1

[State -1]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command != "holdback"
value = 52

[State -1]
type = ChangeState
trigger1 = sysvar(0)
value = 130

;---------------------------------------------------------------------------
; LOSE (Time over)
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

;---------------------------------------------------------------------------
; DRAWGAME (Time over)
[Statedef 175]
type = S
ctrl = 0
velset = 0,0

[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 5000]
type    = S
movetype= H
physics = N
velset = 0,0

[State -1]
type = LifeAdd
triggerall = GetHitVar(Damage) < Life
trigger1 = time = 0
Value = Floor(GetHitVar(Damage)*(.25*(LifeMax-Life)/1000))

[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
type = a

[State 5000, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
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

;---------------------------------------------------------------------------
;地上仰け反り
[Statedef 5001]
type    = S
movetype= H
physics = S

[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

;---------------------------------------------------------------------------
;屈みヒット振動
[Statedef 5010]
type    = C
movetype= H
physics = N
velset = 0,0

[State -1]
type = LifeAdd
triggerall = GetHitVar(Damage) < Life
trigger1 = time = 0
Value = Floor(GetHitVar(Damage)*(.25*(LifeMax-Life)/1000))
IgnoreHitPause = 1

[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]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
value = 5011 ;HITC_SLIDE

[State 5010, 6]
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

;---------------------------------------------------------------------------
;屈みヒット仰け反り
[Statedef 5011]
type    = C
movetype= H
physics = C

[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


;---------------------------------------------------------------------------
;空中ヒット振動→落下まで
[Statedef 5020]
type    = A
movetype= H
physics = N
velset = 0,0

[State -1]
type = LifeAdd
triggerall = GetHitVar(Damage) < Life
trigger1 = time = 0
Value = Floor(GetHitVar(Damage)*(.25*(LifeMax-Life)/1000))
IgnoreHitPause = 1

[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

;---------------------------------------------------------------------------
;空中受身
[Statedef 5030]
type    = A
movetype= H
physics = N
ctrl = 0

[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)

;---------------------------------------------------------------------------
;落下チェンジアニメ
[Statedef 5035]
type    = A
movetype= H
physics = N

[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

;---------------------------------------------------------------------------
;空中受身2
[Statedef 5040]
type    = A
movetype= H
physics = N

[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

;---------------------------------------------------------------------------
;落下中
[Statedef 5050]
type    = A
movetype= H
physics = N

[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 = null;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 = null;ChangeState
triggerall = Vel Y > -1
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 5050];前方へ
type = ChangeState
triggerall = alive
triggerall = CanRecover
triggerall = Pos Y <= -5
trigger1 = Var(56) = 0
trigger1 = Command = "holdfwd"
trigger1 = Command = "recovery"
value = 5204

[State 5050];後方へ
type = ChangeState
triggerall = alive
triggerall = CanRecover
triggerall = Pos Y <= -5
trigger1 = Var(56) = 0
trigger1 = Command = "holdback"
trigger1 = Command = "recovery"
value = 5205

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;HIT_BOUNCE

;---------------------------------------------------------------------------
;バウンド→空中へ再打ち上げ
[Statedef 5070]
type    = A
movetype= H
physics = N
velset = 0,0

[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

;---------------------------------------------------------------------------
;同上？
[Statedef 5071]
type    = A
movetype= H
physics = N

[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 >= 0
type = ChangeState
value = 5110

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

[State 5080]
type = NotHitBy
trigger1 = 1
value = SCA

[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, 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 = NotHitBy
trigger1 = 1
value = SCA

[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, 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 = Null;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, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 5110;01

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


;---------------------------------------------------------------------------
;HIT_BOUNCE
[Statedef 5101]
type    = L
movetype= H
physics = N

[State 5101]
type = NotHitBy
trigger1 = 1
value = SCA

[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 = null;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 >= 0
type = ChangeState
value = 5110
;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 5110]
Type = L
MoveType= H
Physics = N

[State 5110]
type = NotHitBy
trigger1 = 1
value = SCA

[State 5110, ChangeAnim]
Type = ChangeAnim
TriggerAll = Time = 0
Trigger1 = Anim != 5110
Value = 5170

[State 5110, PosSet]
Type = PosSet
Trigger1 = Time = 0
Y = 0

[State 5110, VarSet]
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 = s400,2

[State -1]
type = EnvShake
trigger1 = time = 0
trigger1 = !SysVar(0)
time = 10
freq = 120
ampl = -5

[State 5110, VelSet]
Type = VelSet
Trigger1 = Time = 0
X = 0
Y = 0

[State 5110, ChangeAnim]
Type = ChangeAnim
Trigger1 = AnimTime = 0
Trigger2 = SysVar(0)
Value = 5110
Persistent = 0

[State 5110, ChangeState]
type = ChangeState
trigger1 = Alive
trigger1 = Anim = 5110
trigger1 = command = "holdfwd"
trigger1 = command = "recovery"
value = 5121
ctrl = 0

[State 5110, ChangeState]
type = ChangeState
trigger1 = Alive
trigger1 = Anim = 5110
trigger1 = command = "holdback"
trigger1 = command = "recovery"
value = 5122
ctrl = 0

[State 5110, ChangeState]
Type = ChangeState
TriggerAll = !Alive
Trigger1 = AnimTime = 0
Trigger2 = SysVar(0)
Trigger3 = Anim = 5110
Value = 5150

[State 5110, VarSet]
Type = VarSet
Trigger1 = SysVar(0)
Trigger1 = Time = 0
sysvar(0) = 0

[State 5110, VelSet]
Type = VelMul
Trigger1 = time = 0
X = 0.01

;---------------------------------------------------------------------------
;通常起き上がり
[Statedef 5120]
type    = S
movetype= I
physics = N

[State -1];ﾋﾟﾁｭｰﾝ
type = DestroySelf
trigger1 = IsHelper
IgnoreHitPause = 1
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999

[State -1]
type = ChangeState
trigger1 = (Time=0)*(Var(56)!=0)*(BackEdgeBodyDist<60)*(P2BodyDist X<50)
value = 5121
ctrl = 0

[State -1]
type = ChangeState
trigger1 = (Time=0)*(Var(56)!=0)*(FVar(1)<=300)
value = 5122
ctrl = 0

[State -1]
type = Explod
trigger1 = time = 7
anim = 6010
ID = 6010
Pos = 0,0
PosType = P1
Keyctrl = 0
ownpal = 1
SprPriority = 9

[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, 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]
Anim = 5121
ctrl = 0

[State -1]
type = Explod
trigger1 = time = 7
anim = 6010
ID = 6010
Pos = 0,0
PosType = P1
Keyctrl = 0
ownpal = 1
SprPriority = 9

[State 5121, VelSet]
type = VelSet
trigger1 = AnimElem = 7
X = 6
Y = -4.5

[State 5121, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 7
Physics = A

[State 5121, ChangeState]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -5
value = 65
ctrl = 0
;---------------------------------------------------------------------------
;後方逃げ起き上がり
[Statedef 5122]
Anim = 5122
ctrl = 0

[State -1]
type = Explod
trigger1 = time = 7
anim = 6010
ID = 6010
Pos = 0,0
PosType = P1
Keyctrl = 0
ownpal = 1
SprPriority = 9

[State 5122, VelSet]
type = VelSet
trigger1 = AnimElem = 7
X = -6
Y = -4.5

[State 5122, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 7
Physics = A

[State 5122, ChangeState]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -5
value = 65
ctrl = 0
;---------------------------------------------------------------------------
;ライフ0敗北アニメ
[Statedef 5150]
type    = L
movetype= H
physics = C
sprpriority = -3

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = Time = 0
trigger1 = SelfAnimExist(5140)
value = 5140

[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, 8]
type = NotHitBy
trigger1 = 1
value = SCA
time = 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
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 10
value = 5201

;---------------------------------------------------------------------------
; HIT_FALLRECOVER (on the ground)
[Statedef 5201]
type    = A
movetype= H
physics = A
anim = 5200

[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, 6]
type = GameMakeAnim
trigger1 = Time = 1
value = 60
pos = 0, 0
under = 1
;---------------------------------------------------------------------------
;前方受身
[Statedef 5204]
type =A
physics = A
Anim = 5200
ctrl = 0

[State -1]
type = NotHitBy
trigger1 = time >= 0
trigger1 = time <= 14
Value = SAC, NT, ST, HT ,NA, SA, HA ,NP, SP, HP
time = 1

[State -1]
type = VelSet
trigger1 = time = 0
X = 5
Y = -6

[State -1]
type = CtrlSet
trigger1 = time = 16
Value = 1

[State -1]
type = ChangeState
triggerall = InGuardDist
trigger1   = (time=15)*(FVar(2)=0)
Value = 120

[State -1]
type = changestate
value = 120
triggerall = (Var(56)>=1)*(InGuardDist)
trigger1   = (Ctrl)*(FVar(2)=0)

[State -1]
type = ChangeState
trigger1 = vel Y > 0
trigger1 = Pos Y >= 0
value = 52
ctrl = 1

;読み込み妨害回避位置

[State -1]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA,NP ,SP ,HP
pauseTime = 0,0
numHits = 0

[State -1,グレイズ呼び出し]
type = helper
trigger1 = movehit = 1
stateno = 9998
ID = 9997
pos = 0,-48
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 4
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999
;---------------------------------------------------------------------------
;後方受身
[Statedef 5205]
type = A
physics = A
Anim = 5210
ctrl = 0

[State -1]
type = NotHitBy
trigger1 = time >= 0
trigger1 = time <= 14
Value = SAC, NT, ST, HT ,NA, SA, HA ,NP, SP, HP
time = 1

[State -1]
type = VelSet
trigger1 = time = 0
X = -5
Y = -6

[State -1]
type = CtrlSet
trigger1 = time = 16
Value = 1

[State -1]
type = ChangeState
triggerall = InGuardDist
trigger1   = (time=15)*(FVar(2)=0)
Value = 120

[State -1]
type = changestate
value = 120
triggerall = (Var(56)>=1)*(InGuardDist)
trigger1   = (Ctrl)*(FVar(2)=0)

[State -1]
type = ChangeState
trigger1 = vel Y > 0
trigger1 = Pos Y >= 0
value = 52
ctrl = 1

;読み込み妨害回避位置

[State -1]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA,NP ,SP ,HP
pauseTime = 0,0
numHits = 0

[State -1,グレイズ呼び出し]
type = helper
trigger1 = movehit = 1
stateno = 9998
ID = 9997
pos = 0,-48
postype = p1
ownpal = 1
keyctrl = 0
ignorehitpause = 1
persistent = 4
PauseMoveTime = 9999999999
SuperMoveTime = 9999999999
;---------------------------------------------------------------------------
; HIT_AIRFALLRECOVER
[Statedef 5210]
type    = A
movetype= I
physics = N
anim = 5210
ctrl = 0

[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

;---------------------------------------------------------------------------
; Continue?
[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

;---------------------------------------------------------------------------
;イントロ突入前
[Statedef 5900]
type = S

[State -1]
type = Varset
trigger1 = Var(22) = 1
V = 57
Value = 1

[State -1]
type = PowerSet
trigger1 = roundno = [1,999999]
Value = 0

[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = roundno = 1
farst = 0
last  = 55
value = 0

[State 5900, 2] ;Clear all float variables
type = VarRangeSet
trigger1 = roundno = 1
fvalue = 28

[State 5900, 3] ;Intro
type = ChangeState
trigger1 = roundno = 1
value = 189