; Common state file for M.U.G.E.N beta 2003.06.14
; このファイルはMUGEN本体に入っているものと同じです。
; System variables usage
; ----------------------
; Var name    Type   Purpose
; --------    ----   -------
; sysvar(0)   Temp   Set by state 5081 (HITL_SLIDE) to 1 to prevent
;                    showing ground hit frame in state 5110 (HIT_LIEDOWN).
;                    Used by guarding states.
; sysvar(1)   Temp   Used by state 40 (Jump Start) amd 45 (Air Jump Start)
;                    to keep track of which way to jump.
;                    Used by state 5100 and 5110 to remember downward
;                    velocity of player just before hitting the ground.
;                    Used in state 5080 for storing the anim # to display.

; The following states have special handling within MUGEN, and should be
; overridden with caution:
; Jump Start (40): airjumping bookkeeping at time = 0
; All guard states (120-155): guard handling throughout state
; Hit_trip, shaking (5070): defence increases at time = 0
; Hit_bounce (5100): defence increases at time = 0, player becomes
;                    invincible if within 10 ticks of getting up
; Hit_liedown (5110): player changes to get-up state (5120) when ready
; Hit_getup (5120): player's defence is restored to normal at time = 0
; Hitfall_recover (5200): player's defence is restored at time = 0
; Hitfall_airrecover (5210): player's defence is restored at time = 0

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

[State 0, 1]
type = ChangeAnim
triggerall = Prevstateno != 195
triggerall = anim != 2220
trigger1 = Anim != 0 + var(15) && Anim != 5 + var(15) && Anim != 2
trigger2 = Anim = 5 + var(15) && AnimTime = 0
value = 0 + var(15)

[State 0, 1]
type = ChangeAnim
triggerall = Prevstateno = 195
triggerall = anim != 2220
trigger1 = Anim != 0 + var(15) && Anim != 5 + var(15) && Anim != 2
value = 2

;Prevstateno = 195

[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, Ctrl]
type = CtrlSet
trigger1 = numhelper(10013) >= 1
trigger1 = RoundState >= 3
trigger1 = time < 80
value = 0

[State 0, Ctrl]
type = CtrlSet
trigger1 = numhelper(10013) >= 1
trigger1 = RoundState >= 3
trigger1 = time >= 80
value = 1


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

[State 0,スタンド方向転換]
type = Turn
trigger1 = anim = 20000
trigger1 = ParentDist X >= 1



;[State 0, 1];分身を無理矢理消去
;type = destroyself
;trigger1 = name != "sion_TATARI"


;[State 0,スタンドから元に戻る]
;type = ChangeState
;trigger1 = anim = 20000
;trigger1 = parent,var(3) = 0
;value = 1

;---------------------------------------------------------------------------
;偽本体待機
[Statedef 1]
type = A
movetype = I
physics = N
anim = 3
ctrl = 0
sprpriority = 1


[State 1,位置固定]
type = BindToRoot
trigger1 = 1 
time = -1
pos = -15,0
supermovetime = -1
pausemovetime = -1


[State 1,偽本体方向転換]
type = Turn
trigger1 = ParentDist X <= -1


[State 1,無敵]
type = NotHitby
trigger1 = 1
time = -1
value = SCA


[State 1,偽本体出現準備]
type = ChangeState
;trigger1 = time = 0
triggerall = Parent,alive
trigger1 = parent,var(3) = 1
ctrl = 0
value = 600


[State 1,偽本体出現（緊急）]
type = ChangeState
;trigger1 = time = 0
triggerall = Parent,alive
trigger1 = parent,var(3) != 1
trigger1 = parent,var(15) = 20000
ctrl = 0
value = 20000

;---------------------------------------------------------------------------
;スタンド（実は本体）出現準備
[Statedef 2]
type = U
movetype = I
physics = N
anim = 4
ctrl = 0
sprpriority = 0


[State 2,スタンド判定設定]
type = VarSet
trigger1 = 1
var(15) = 20000
ignorehitpause = 1


[state 2,スタンド判定設定]
type = VarSet
trigger1 = time = 0
var(3) = 1
ignorehitpause = 1


[State 2, 前進]
type = PosAdd
trigger1 = Time = 0
x = 15


[State 2,レプリカ構築音]
type = PlaySnd
trigger1 = Time = 0
value = s1,8
channel = 1


[State 2, エフェクト表示（レプリカ構築）]
type = explod
trigger1 = Time = 0
anim = 10200
ownpal = 1
id = 2
sprpriority = 1
postype = p1
pos = 10,10
bindtime = -1
removeongethit = 0


[State 2,空中ジャンプ回数増]
type = VarAdd
trigger1 = statetype = A
trigger1 = Time = 0
v = 13
value = 1


[State 2,空中ダッシュ回数増]
type = VarAdd
trigger1 = statetype = A
trigger1 = Time = 0
v = 14
value = 1


[State 2,重力]
type = gravity
trigger1 = Statetype = A


[State 2,スタンド出現（空中）]
type = ChangeState
trigger1 = Pos Y <= -1
ctrl = 1
value = 50


[State 2,スタンド出現（地上）]
type = ChangeState
triggerall = Pos Y >= 0
trigger1 = time >= 8
trigger1 = Vel Y = 0
trigger2 = Vel Y > 0
ctrl = 1
value = 0
;---------------------------------------------------------------------------



;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type    = C
movetype = I
physics = C
anim = 10 + var(15)

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

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

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
movetype = I
physics = C
anim = 11 + var(15)
sprpriority = 0

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

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
movetype = I
physics = S
anim = 12 + var(15)

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

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

[State 20, 1]
type = VelSet
trigger1 = var(0) = 0
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = var(0) = 0
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

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

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


[State 20,AIは歩き禁止]
type = ChangeState
trigger1 = var(0) != 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
movetype = I
physics = S
anim = 40 + var(15)
ctrl = 0
sprpriority = 0

[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 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

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

[State 40,AIはジャンプ禁止]
type = ChangeState
triggerall = Time >= 0
trigger1 = var(0) != 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;AI Jump Start
[Statedef 41]
type    = S
movetype = I
physics = S
anim = 40 + var(15)
ctrl = 0
sprpriority = 0

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

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

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

[State 41, 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 41, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

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


;---------------------------------------------------------------------------
; AirJump Start
[Statedef 45]
type    = A
movetype = I
physics = N
ctrl = 0
velset = 0,0

[State 45, 空中ジャンプ回数制御]
type = VarAdd
trigger1 = time = 0
var(13) = -1

;[State 50, 1]
;type = VarSet
;trigger1 = var(3) = 1 || var(3) = 2
;var(3) = 3

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

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

[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
;---------------------------------------------------------------------------
;AI AirJump Start
[Statedef 46]
type    = A
movetype = I
physics = N
ctrl = 0
velset = 0,0

[State 46, 空中ジャンプ回数制御]
type = VarAdd
trigger1 = time = 0
var(13) = -1

[State 46, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(44)
value = 44 + var(15)

[State 46, 2]
type = ChangeAnim
trigger1 = !SelfAnimExist(44)
value = 41 + var(15)

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

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

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

[State 46, 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 46, 7]
type = ChangeState
trigger1 = Time = 2
value = 50
ctrl = 1

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

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


[State 50, 2]
type = VelAdd
trigger1 = anim = (41 + var(15))  && (time = [15, 18])
trigger1 = command = "holdfwd"
x = .5

[State 50, 3]
type = VelAdd
trigger1 = Anim = (41 + var(15)) && (time = [15, 18])
trigger1 = command = "holdback"
x = -.5



[State 50, 4]
type = ChangeAnim
triggerall = prevstateno != 510
triggerall = prevstateno != 511
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43)) + var(15)


;[State 50, 1]
;type = VarSet
;trigger1 = Vel y > -1
;var(3) = 2

[State 50,前後方向への加速度消去]
type = VelSet
trigger1 = NumHelper(23000) >= 1
trigger1 = helper(23000),Stateno = 33005
x = 0

[State 50, 5]
type = ChangeAnim
triggerall = prevstateno != 510
triggerall = prevstateno != 511
triggerall = Vel y > -1
trigger1 = anim = 41 + var(15)
trigger2 = anim = 42 + var(15)
trigger3 = anim = 43 + var(15)
persistent = 0
value = anim + 3



[State 50, 5]
type = ChangeAnim
triggerall = Vel y > -1
trigger1 = prevstateno = 510
trigger2 = prevstateno = 511
persistent = 0
value = 44


;[State 50, 5]
;type = ChangeAnim
;trigger1 = PrevStateno = [320,324]
;persistent = 0
;value = 46


;[State 50, ハイジャンプ時の音声]
;type = playsnd
;trigger1 = var(3) = 1 
;trigger1 = animelem = 1
;trigger1 = prevstateno != [320,322]
;value = s0,10




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

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

;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47 + var(15)

[State 52]
type = Turn
trigger1 = P2Dist X < 0

[State 52]
type = CtrlSet
trigger1 = Time = 4
value = 1

[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] ;着地音
type = PlaySnd
trigger1 = time = 1
value = s0, 20


;[State 704, varをOFFにするステート]
;type = VarSet
;trigger1 = Time = 0
;v = 3
;value = 0

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


;---------------------------------------------------------------------------
; 地上前ダッシュ
[Statedef 100]
type    = S
movetype = I
physics = S
anim = 100 + var(15)
sprpriority = 0
ctrl = 1

[State 100, 1]
type = VelSet
trigger1 = time >= 0
x = 8

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


[State 100, 「フッ！」]
type = PlaySnd
trigger1 = time = 1
value = s2, 0
channel = 0


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

[State 100, 5]
type = ChangeState
triggerall = var(0) = 0
trigger1 = time >= 100
trigger2 = command != "holdfwd"
value = 101


[State 100,AIダッシュ停止]
type = ChangeState
triggerall = var(0) != 0
trigger1 = P2BodyDist X <= 0
trigger2 = time >= 100
value = 101
;ctrl = 1
IgnoreHitPause = 1
;---------------------------------------------------------------------------
; 地上前ダッシュ終了
[Statedef 101]
type    = S
movetype = I
physics = N
anim = 101 + var(15)
ctrl = 0
sprpriority = 0

[State 101, 1];ダッシュ速度管理
type = VelSet
trigger1 = 1
x = 1


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


[State 100, 3] ;ダッシュ音
type = PlaySnd
trigger1 = time = 1
value = s0,14
channel = 1

[State 101, 4] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn


;[State 100, 6];慣性消去
;type = varset
;trigger1 = 1
;v = 6
;value = 0


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


;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = S
movetype = I
physics = S
ctrl = 0
anim = 105 + var(15)
sprpriority = 0


[State 105, 2]
type = AssertSpecial
trigger1 = 1
flag = NoWalk


[State 105, 4]
type = NotHitBy
trigger1 = time = 3
value = ,AA,AP
time = 15


[State 105, 5]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
flag2 = nostandguard


[State 105, 6]
type = ChangeState
trigger1 = animtime = 0
value = 106
;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 106]
type    = A
movetype = I
physics = A
ctrl = 0
anim = 106 + var(15)
;sprpriority = 1

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

[State 106, 1]
type = VelSet
trigger1 = Time = 0
x = const(velocity.run.back.x)
y = const(velocity.run.back.y)


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


[State 106,ガード不能]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
flag2 = noairguard


;---------------------------------------------------------------------------
; RUN_BACK2 (land)
[Statedef 107]
type    = S
movetype = I
physics = S
ctrl = 0
anim = 107 + var(15)


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


[State 107,ガード不能]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn
flag2 = nostandguard


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

;---------------------------------------------------------------------------
; RUN_UP
[Statedef 110]
type    = S
movetype = I
physics = N

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

[State 110, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 110 + var(15)

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

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

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

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

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

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

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

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

[State 115, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 110 + var(15)

[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 119]
type    = S
physics = S
anim = 40 + var(15)
ctrl = 0
sprpriority = 0


[State 119,ハイジャンプ] 
type = PlaySnd
trigger1 = AnimTime = 0
value = s0,19
channel = 1


[State 119,変数設定]
type = VarSet
trigger1 = 1
sysvar(1) = 1


[State 119,加速]
type = velset
trigger1 = AnimTime = 0
x = 8
y = -9.3


[State 119,ステート変更]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 1
;---------------------------------------------------------------------------
; GUARD (start)
[Statedef 120]
type = U    ;Leave state type unchanged
movetype = I
physics = U ;Leave physics unchanged

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

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


[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(0) != 0
TriggerAll = StateType != A
Trigger1 = EnemyNear,MoveType = A
Trigger1 = EnemyNear,HitDefAttr = SA, NA, SA, HA, NP, SP, HP
StateType = S
Physics = S
IgnoreHitPause = 1


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


[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(0) != 0
TriggerAll = StateType != A
Trigger1 = EnemyNear,MoveType = A
Trigger1 = EnemyNear,HitDefAttr = C, NA, SA, HA, NP, SP, HP
StateType = C
Physics = C
IgnoreHitPause = 1


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

[State 120, Hi to Lo]
type = StateTypeSet
triggerall = var(0) = 0
trigger1 = statetype = S && command = "holddown"
statetype = C
movetype = I
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
triggerall = var(0) = 0
trigger1 = statetype = C && command != "holddown"
statetype = S
movetype = I
physics = S

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

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

[State -1, AI]
type = ChangeState
triggerAll = Var(0) != 0
trigger1 = EnemyNear,MoveType != A
trigger1 = Enemy,MoveType != A
trigger1 = P2BodyDist X < 0
trigger1 =! InguardDist
trigger2 = P2BodyDist X >= 0
trigger2 =! InguardDist
value = 140
ignorehitpause = 1


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

[State 130, 1]
type = ChangeAnim
trigger1 = Anim != 130 + var(15)
value = 130 + var(15)

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

[State -1, AI]
type = ChangeState
TriggerAll = Var(0) != 0
Trigger1 = EnemyNear,MoveType = A
Trigger1 = EnemyNear,HitDefAttr = C, NA, SA, HA, NP, SP, HP
Value = 131

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

[State -1, AI]
type = ChangeState
triggerall = var(0) != 0
trigger1 = EnemyNear,MoveType != A
trigger1 = Enemy,MoveType != A
trigger1 = P2BodyDist X < 0
trigger1 =! InguardDist
trigger2 = P2BodyDist X >= 0
trigger2 =! InguardDist
value = 140
ignorehitpause = 1
;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
type    = C
movetype = I
physics = C

[State 131, 1]
type = ChangeAnim
trigger1 = Anim != 131 + var(15)
value = 131 + var(15)

[State 131, Lo to Hi]
type = ChangeState
TriggerAll = Var(0) = 0
trigger1 = command != "holddown"
value = 130

[State -1, AI]
type = ChangeState
TriggerAll = Var(0) != 0
Trigger1 = EnemyNear,MoveType = A
Trigger1 = EnemyNear,HitDefAttr = SA, NA, SA, HA, NP, SP, HP
Value = 130

[State 131, Stop Guarding]
type = ChangeState
TriggerAll = Var(0) = 0
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

[State -1, AI]
Type = ChangeState
TriggerAll = Var(0) != 0
Trigger1 = EnemyNear,MoveType != A
Trigger1 = Enemy,MoveType != A
Trigger1 = P2BodyDist X < 0
Trigger1 =! InguardDist
Trigger2 = P2BodyDist X >= 0
Trigger2 =! InguardDist
Value = 140
IgnoreHitPause = 1


;---------------------------------------------------------------------------
; AIR GUARD (guarding)
[Statedef 132]
type    = A
movetype = I
physics = N

[State 132, 1]
type = ChangeAnim
trigger1 = Anim != 132 + var(15)
value = 132 + var(15)

[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
TriggerAll = Var(0) = 0
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140


[State -1, AI]
Type = ChangeState
TriggerAll = Var(0) != 0
Trigger1 = EnemyNear,MoveType != A
Trigger1 = Enemy,MoveType != A
Trigger1 = P2BodyDist X < 0
Trigger1 =! InguardDist
Trigger2 = P2BodyDist X >= 0
Trigger2 =! InguardDist
Value = 140
IgnoreHitPause = 1

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

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

[State 140, 2]
type = StateTypeSet
triggerall = var(0) = 0
trigger1 = Time = 0 && statetype = S
movetype = I
physics = S

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

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

[State 140, Hi to Lo]
type = StateTypeSet
triggerall = var(0) = 0
trigger1 = statetype = S && command = "holddown"
statetype = C
movetype = I
physics = C

[State 140, Lo to Hi]
type = StateTypeSet
triggerall = var(0) = 0
trigger1 = statetype = C && command != "holddown"
statetype = S
movetype = I
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 150, 1]
type = ChangeAnim
trigger1 = 1
value = 150 + var(15)

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

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

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(0) != 0
TriggerAll = StateType != A
Trigger1 = EnemyNear,MoveType = A
Trigger1 = EnemyNear,HitDefAttr = SA, NA, SA, HA, NP, SP, HP
StateType = S
Physics = S
IgnoreHitPause = 1

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

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(0) != 0
TriggerAll = StateType != A
Trigger1 = EnemyNear,MoveType = A
Trigger1 = EnemyNear,HitDefAttr = C, NA, SA, HA, NP, SP, HP
StateType = C
Physics = C
IgnoreHitPause = 1

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

;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
type    = S
movetype= H
physics = S
anim = 150 + var(15)

[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
triggerall = var(0) = 0
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(0) != 1
TriggerAll = StateType != A
Trigger1 = EnemyNear,MoveType = A
Trigger1 = EnemyNear,HitDefAttr = C, NA, SA, HA, NP, SP, HP
StateType = C
Physics = C
IgnoreHitPause = 1

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

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

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

[State 152, 1]
type = ChangeAnim
trigger1 = 1
value = 151 + var(15)

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

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

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(0) != 0
TriggerAll = StateType != A
Trigger1 = EnemyNear,MoveType = A
Trigger1 = EnemyNear,HitDefAttr = C, NA, SA, HA, NP, SP, HP
StateType = C
Physics = C
IgnoreHitPause = 1

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

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(0) != 0
TriggerAll = StateType != A
Trigger1 = EnemyNear,MoveType = A
Trigger1 = EnemyNear,HitDefAttr = SA, NA, SA, HA, NP, SP, HP
StateType = S
Physics = S
IgnoreHitPause = 1

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

;---------------------------------------------------------------------------
; CGUARDHIT2 (knocked back)
[Statedef 153]
type    = C
movetype= H
physics = C
anim = 151 + var(15)

[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
triggerall = var(0) = 0
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(0) != 0
TriggerAll = StateType != A
Trigger1 = EnemyNear,MoveType = A
Trigger1 = EnemyNear,HitDefAttr = C, NA, SA, HA, NP, SP, HP
StateType = C
Physics = C
IgnoreHitPause = 1

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

[State -1, AI]
Type = StateTypeSet
TriggerAll = Var(0) != 0
TriggerAll = StateType != A
Trigger1 = EnemyNear,MoveType = A
Trigger1 = EnemyNear,HitDefAttr = SA, NA, SA, HA, NP, SP, HP
StateType = S
Physics = S
IgnoreHitPause = 1

[State 153, 4]
type = ChangeState
triggerall = Var(0) = 0
trigger1 = HitOver
value = 131
ctrl = 1


[State -1, AI]
Type = ChangeState
TriggerAll = Var(0) != 0
Trigger1 = HitOver
Trigger1 = EnemyNear,MoveType != A
Value = 131
Ctrl = 1
IgnoreHitPause = 1
;---------------------------------------------------------------------------
; AGUARDHIT (shaking)
[Statedef 154]
type    = A
movetype= H
physics = N
velset = 0,0

[State 154, 1]
type = ChangeAnim
trigger1 = 1
value = 152 + var(15)

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

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

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

[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 160]
type    = U
movetype= H
physics = U
velset = 0,0
sprpriority = 0

[State 160,ボイス分岐]
type = varrandom
trigger1 = time = 0
v = 9
range = 0,2


[State 160,「温い！」]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(9) = 0
value = s10, 4
channel = 0


[State 160,「軽い！」]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(9) = 1
value = s10, 5
channel = 0


[State 160,「甘い！」]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(9) = 2
value = s10, 6
channel = 0


[State 160,EFZリコイルガード]
type = PlaySnd
trigger1 = time = 0
value = s0, 25
channel = 1


[State 160,アニメ変更（立ち）]
type = ChangeAnim
trigger1 = statetype = S
value = 150 + var(15)


[State 160,アニメ変更（しゃがみ）]
type = ChangeAnim
trigger1 = statetype = C
value = 151 + var(15)


[State 160,アニメ変更（空中）]
type = ChangeAnim
trigger1 = statetype = A
value = 152 + var(15)


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


[State 160,アドバンシングガードエフェクト]
type = explod
trigger1 = time = 0
anim = 40015
id = 160
postype = p1
pos = 30,-35
ownpal = 1
sprpriority = 4
bindtime = 4
persistent = 0
scale = 1,1
ignorehitpause = 1
;supermovetime  = 9999
;pausemovetime  = 9999


[State 160,アドバンシングガード壁ヘルパー作成]
type = helper
trigger1 = time = 0
name = "ADGkabe"
id = 160
pos = 40,0
postype = p2
facing = -1
stateno = 30160
helpertype = normal
ownpal = 1
keyctrl = 0
persistent = 0
ignorehitpause = 1
size.xscale = 1
size.yscale = 1
supermovetime = 0
pausemovetime = 0
persistent = 0


[State 160,変数セット]
type = VarSet
trigger1 = statetype = A
sysvar(0) = (pos y >= 0) && (vel y > 0)


[State 160,重力リセット]
type = VelSet
trigger1 = statetype = A
trigger1 = sysvar(0)
y = 0


[State 160,位置修正]
type = PosSet
trigger1 = statetype = A
trigger1 = sysvar(0)
y = 0


[State 160,立ちガードへ]
type = ChangeState
trigger1 = statetype = S
trigger1 = time >= 5
value = 130


[State 160,しゃがみガードへ]
type = ChangeState
trigger1 = statetype = C
trigger1 = time >= 5
value = 131


[State 160,空中ガードへ]
type = ChangeState
trigger1 = statetype = A
trigger1 = !sysvar(0)
trigger1 = time >= 5
value = 132


[State 160,着地へ]
type = ChangeState
trigger1 = statetype = A
trigger1 = sysvar(0)
value = 52
;---------------------------------------------------------------------------
; LOSE (Time over)
[Statedef 170]
type = S
movetype = I
ctrl = 0
anim = 171
velset = 0,0


[State 170, 後退]
type = PosAdd
trigger1 = Time = 0
trigger1 = var(3) = [1,2]
x = -15


[state 170,スタンド判定]
type = VarSet
trigger1 = time = 0
var(3) = 0
ignorehitpause = 1


[State 170,スタンド判定設定]
type = VarSet
trigger1 = 1
v = 15
value = 0


[State 170,「よくも……ここまで……！」]
type = PlaySnd
trigger1 = AnimElemTime(3) = 0
channel = 0
volume = 255
value = s4, 8


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

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


[State 175,「よくも……ここまで……！」]
type = PlaySnd
trigger1 = AnimElemTime(3) = 0
channel = 0
volume = 255
value = s4, 8


[State 175, 後退]
type = PosAdd
trigger1 = Time = 0
trigger1 = var(3) = [1,2]
x = -15


[state 175,スタンド判定]
type = VarSet
trigger1 = time = 0
var(3) = 0
ignorehitpause = 1


[State 175,スタンド判定設定]
type = VarSet
trigger1 = 1
v = 15
value = 0


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

;---------------------------------------------------------------------------
; PREINTRO
[Statedef 190]
type = S
movetype = I
ctrl = 0
velset = 0,0

;[State 190, 1]
;type = ChangeAnim
;trigger1 = SelfAnimExist(190)
;value = 190

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

;---------------------------------------------------------------------------
; INTRO (override this state to give character an intro)
;[Statedef 191]
;type = S
;ctrl = 0

;[State 191, 1]
;type = ChangeState
;trigger1 = Time = 0
;value = 0

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

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

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

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


[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
triggerall = !alive
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
triggerall = !alive
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
triggerall = !alive
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, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

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

[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, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
triggerall = alive
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = (5020 + GetHitVar(animtype)) + var(15)

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

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


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

[State 5010, 2] ;Anim for HIT_BACK
type = ChangeAnim
triggerall = !alive
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
triggerall = !alive
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, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

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

[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, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
triggerall = alive
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = (ifelse((GetHitVar(airtype) = 1),5000,5010) + GetHitVar(animtype)) + var(15)

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

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


[State 5020, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
triggerall = !alive
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
triggerall = !alive
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
triggerall = !alive
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, 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, 1]
type = ChangeAnim
triggerall = alive
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 + var(15)


[State 5035, 1]
type = ChangeAnim
triggerall = !alive
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 || var(3) = [1,2]
triggerall = prevstateno != 5630
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 = var(3) = 0 || var(3) = 3
triggerall = HitFall || prevstateno = 5630
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, 1]
type = ChangeState
trigger1 = !Alive
value = 5050

[State 5040, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim != 5040 + var(15)
trigger2 = Time = 0
trigger2 = Anim != 5035 + var(15)
value = 5040 + var(15)

[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, 1] ;Change anim when done with transition
type = ChangeAnim
triggerall = alive
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 + var(15)

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


[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
triggerall = !alive
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
triggerall = !alive
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= ifelse(anim = 5050  + var(15), 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, 強制復帰]
type = ChangeState
triggerall = alive
trigger1 = var(3) = [1,2]
trigger1 = var(15) = 20000
value = 5040 ;HITA_RECOV


[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, 1]
type = ChangeAnim 
trigger1 = alive
value = 5070 + var(15)


[State 5070, 1]
type = ChangeAnim 
trigger1 = !alive
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, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5071, 強制復帰]
type = ChangeState
trigger1 = var(3) = [1,2]
trigger1 = var(15) = 20000
value = 5040 ;HITA_RECOV


[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, 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)  + var(15)

[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, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

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

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

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

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

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

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

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

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

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

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

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

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

[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 = NotHitBy
trigger1 = 1 ;1にするといかなる条件でも有効で、0にするといかなる条件でも無効
value = SCA  ;※
time = 1

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

[State 5110, 0] ; (from state 5070)
type = ChangeAnim
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5070,5079]
value = 5111

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[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

;---------------------------------------------------------------------------
; 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

;---------------------------------------------------------------------------
; 地上受身
[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 = 20

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

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

[State 5201, 2] ;Go fwd
type = VelSet
trigger1 = Time = 0
trigger1 = Command = "holdfwd"
x = 3.6
y = -4.6

[State 5201, 2] ;Go back
type = VelSet
trigger1 = Time = 0
trigger1 = Command = "holdback"
x = -3.6
y = -4.6

[State 5201, 7]
type = VelAdd
trigger1 = Time >= 1
y = .35

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



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

[State 5210,無敵]
type = NotHitBy
trigger1 = animelemtime(1) = 0
value = SCA,NA,ST,HP
time = 22

[State 5210,発光]
type = PalFX
trigger1 = Time = 0
time = 3
add = 256,256,256


[State 5210,上昇]
type = VelAdd
trigger1 = Time = 4
trigger1 = Command != "holdfwd"
trigger1 = Command != "holdback"
y = -4

[State 5210,前方へ上昇]
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdfwd"
x = 1.6
y = -5.5

[State 5210,後方へ上昇]
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdback"
x = -1.6
y = -5.5

[State 5210,少し前方へ]
type = VelAdd
trigger1 = anim = 41 && (time = [15, 18])
trigger1 = command = "holdfwd"
x = .5

[State 5210,少し後方へ]
type = VelAdd
trigger1 = Anim = 41 && (time = [15, 18])
trigger1 = command = "holdback"
x = -.5


[State 5210,上へ]
type = veladd
trigger1 = time >= 4
y = .35


[State 5210,ターン]
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -20

[State 5210,コントロール可否]
type = CtrlSet
trigger1 = time = 20
trigger1 = vel x = [-2.1,2.1]
trigger2 = time = 22
trigger2 = vel x != [-2.1,2.1]
value = 1


[State 5210,着地へ]
type = ChangeState
trigger1 =  pos Y >= 0
trigger1 = Vel Y > 0
value = 52
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 5600]
type    = U
movetype= H
physics = N
velset = 0,0
ctrl = 0


[State 5600,後退]
type = PosAdd
trigger1 = Time = 0
x = -15
ignorehitpause = 1
pausemovetime = -1
supermovetime = -1


[State 5600, ヘルパー生成（演出用）]
type = Helper
trigger1 = time = 0
trigger1 = numhelper(5700) = 0
stateno = 5700
ID = 5700
pos = 15,0
name = "ensyutu"
postype = p1
helpertype = normal
keyctrl = 0
ownpal = 1
size.xscale = 1.0
size.yscale = 1.0
supermovetime = 999999
pausemovetime = 999999


[State 5600,やられアニメに移行]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),5600,5610)


[State 5600,やられアニメに移行]
type = ChangeAnim
trigger1 = GetHitVar(animtype) = [3,5]
value = 5630


[State 5600,時間停止]
type = Pause
trigger1 = Time = 0
time = 20
movetime = 20
pausemovetime = -1
supermovetime = -1
IgnoreHitPause = 1


[State 5600,仰け反りへ移行]
type = ChangeState
triggerall = time > 30
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
trigger1 = statetype != A
value = 5601


[State 5600,吹き飛びへ移行]
type = ChangeState
triggerall = time > 30
trigger1 = GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2 = statetype = A
value = 5630


;---------------------------------------------------------------------------
;スタンドクラッシュ（地上仰け反り）
[Statedef 5601]
type    = S
movetype= H
physics = S
velset = 0,0
ctrl = 0


[State 5601,後退]
type = HitVelSet
trigger1 = Time = 0
x = 1; * GetHitVar(xvel)
ignorehitpause = 1


[State 5601,仰け反りアニメに移行]
type = ChangeAnim
trigger1 = prevstateno = 5600
value = 5007 + (GetHitVar(groundtype)=2)*10


[State 5601,立ち状態へ]
type = ChangeState
trigger1 = time >= 20
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;スタンドクラッシュ（吹き飛び）
[Statedef 5630]
type    = A
movetype= H
physics = N
ctrl = 0


[State 5630,重力セット]
type = Gravity
trigger1 = 1


[State 5630,吹っ飛び]
type = HitVelSet
trigger1 = Time = 0
x = 1; * GetHitVar(xvel)
y = 1;GetHitVar(yvel)


;[State 5630,空中復帰へ]
;type = ChangeState
;triggerall = !HitFall
;trigger1 = Vel Y > 0
;trigger1 = Pos Y >= 10
;value = 5040


[State 5630,落下へ]
type = ChangeState
;triggerall = HitFall
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 10
value = 5050


[State 5630,吹き飛びへ]
type = ChangeState
triggerall = AnimTime = 0
trigger1 = Vel Y <= 0
trigger1 = Pos Y < 10
value = 5035
;---------------------------------------------------------------------------
;スタンドクラッシュ演出用ヘルパーステート
[Statedef 5700]
type    = A
movetype= I
physics = N
ctrl = 0
anim = 3


[State 5700,変数取得]
type = VarSet
trigger1 = time = [20,29]
var(0) = time - 20
IgnoreHitPause = 1
pausemovetime = -1
supermovetime = -1


[State 5700, スタンドクラッシュ]
type = PlaySnd
trigger1 = Time = 0
value = S1,12
channel = 1
IgnoreHitPause = 1
pausemovetime = -1
supermovetime = -1


[State 5700, スタンドクラッシュ]
type = PlaySnd
trigger1 = Time = 20
value = S0,26
channel = 1
IgnoreHitPause = 1
pausemovetime = -1
supermovetime = -1


[State 5700,「しまっ…！」]
type = PlaySnd
trigger1 = Time = 0
value = S2,12
channel = 2
IgnoreHitPause = 1
pausemovetime = -1
supermovetime = -1


[State 5700,サイズ変更]
type = AngleDraw
trigger1 = time = [20,29]
value = 0
scale = 1.0 + (var(0) * 0.15),1.0 - (var(0) * 0.1)
IgnoreHitPause = 1
pausemovetime = -1
supermovetime = -1


[State 5700,消失アニメ]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse(Parent,anim = 5600,25500,ifelse(Parent,anim = 5610,25510,25530))
IgnoreHitPause = 1
pausemovetime = -1
supermovetime = -1


[State 5700,座標変更]
type = PosAdd
trigger1 = time = 20
x = -70
y = -30
IgnoreHitPause = 1
pausemovetime = -1
supermovetime = -1



;[State 5700,消失アニメ]
;type = ChangeAnim
;trigger1 = Time >= 10
;value = 3
;IgnoreHitPause = 1
;pausemovetime = -1
;supermovetime = -1


[State 5700,反転タタリマーク]
type = Explod
trigger1 = time = 0
anim = 40040
id = 5600
postype = back
pos = 160,120
ownpal = 1
bindtime = -1
ignorehitpause = 1
sprpriority = -7
removetime = 10
scale = 0.5,0.5
IgnoreHitPause = 1
pausemovetime = 999999
supermovetime = 999999


[State 5700,背景消去]
type = AssertSpecial
trigger1 = time <= 20
flag = GlobalNoShadow
flag2 = nofg
;flag3 = nobg
pausemovetime = -1
supermovetime = -1


[State 5700,背景変化]
type = BGPalfx
trigger1 = time <= 19
add = 256,256,256
sinadd = 0, 0, 0
invertall = 0
time = 1
pausemovetime = -1
supermovetime = -1


[State 5700,消去]
type = destroyself
trigger1 = Time >= 30
pausemovetime = -1
supermovetime = -1

;---------------------------------------------------------------------------
; 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
value = 190
;---------------------------------------------------------------------------



;---------------------------------------------------------------------------
;これより下はスタンドモード用偽コモン
;---------------------------------------------------------------------------
;偽本体
[Statedef 20000]
type     = S
movetype = I
physics  = N
juggle   = 0
velset   = 0,0
ctrl     = 0
poweradd = 0
sprpriority = 1


[State 20000, 立ち&空中上段弱やられモーション]
type = ChangeAnim
triggerall = (Parent,stateno = 5000) || (Parent,stateno = 5020)
triggerall = Parent,anim = 25000
trigger1 = Parent,time >= 0
value = 5000
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ち&空中上段中やられモーション]
type = ChangeAnim
triggerall = (Parent,stateno = 5000) || (Parent,stateno = 5020)
triggerall = Parent,anim = 25001
trigger1 = Parent,time >= 0
value = 5001
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ち&空中上段強やられモーション]
type = ChangeAnim
triggerall = (Parent,stateno = 5000) || (Parent,stateno = 5020)
triggerall = Parent,anim = 25002
trigger1 = Parent,time >= 0
value = 5002
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ち上段弱やられ回復モーション]
type = ChangeAnim
triggerall = Parent,stateno = 5001
triggerall = Parent,anim = 25005
triggerall = anim != 5005
trigger1 = Parent,time >= 0
value = 5005
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ち上段中やられ回復モーション]
type = ChangeAnim
triggerall = Parent,stateno = 5001
triggerall = Parent,anim = 25006
triggerall = anim != 5006
trigger1 = Parent,time >= 0
value = 5006
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ち上段強やられ回復モーション]
type = ChangeAnim
triggerall = Parent,stateno = 5001
triggerall = Parent,anim = 25007
triggerall = anim != 5007
trigger1 = Parent,time >= 0
value = 5007
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ち&空中下段弱やられモーション]
type = ChangeAnim
triggerall = (Parent,stateno = 5000) || (Parent,stateno = 5020)
triggerall = Parent,anim = 25010
trigger1 = Parent,time >= 0
value = 5010
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ち&空中下段中やられモーション]
type = ChangeAnim
triggerall = (Parent,stateno = 5000) || (Parent,stateno = 5020)
triggerall = Parent,anim = 25011
trigger1 = Parent,time >= 0
value = 5011
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ち&空中下段強やられモーション]
type = ChangeAnim
triggerall = (Parent,stateno = 5000) || (Parent,stateno = 5020)
triggerall = Parent,anim = 25012
trigger1 = Parent,time >= 0
value = 5012
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ち下段弱やられ回復モーション]
type = ChangeAnim
triggerall = Parent,stateno = 5001
triggerall = Parent,anim = 25015
triggerall = anim != 5015
trigger1 = Parent,time >= 0
value = 5015
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ち下段中やられ回復モーション]
type = ChangeAnim
triggerall = Parent,stateno = 5001
triggerall = Parent,anim = 25016
triggerall = anim != 5016
trigger1 = Parent,time >= 0
value = 5016
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ち下段強やられ回復モーション]
type = ChangeAnim
triggerall = Parent,stateno = 5001
triggerall = Parent,anim = 25017
triggerall = anim != 5017
trigger1 = Parent,time >= 0
value = 5017
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, しゃがみ弱やられモーション]
type = ChangeAnim
triggerall = Parent,stateno = 5010
triggerall = Parent,anim = 25020
trigger1 = Parent,time >= 0
value = 5020
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, しゃがみ中やられモーション]
type = ChangeAnim
triggerall = Parent,stateno = 5010
triggerall = Parent,anim = 25021
trigger1 = Parent,time >= 0
value = 5021
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, しゃがみ強やられモーション]
type = ChangeAnim
triggerall = Parent,stateno = 5010
triggerall = Parent,anim = 25022
trigger1 = Parent,time >= 0
value = 5022
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, しゃがみ弱やられ回復モーション]
type = ChangeAnim
triggerall = Parent,stateno = 5011
triggerall = Parent,anim = 25025
triggerall = anim != 5025
trigger1 = Parent,time >= 0
value = 5025
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, しゃがみ中やられ回復モーション]
type = ChangeAnim
triggerall = Parent,stateno = 5011
triggerall = Parent,anim = 25026
triggerall = anim != 5026
trigger1 = Parent,time >= 0
value = 5026
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, しゃがみ強やられ回復モーション]
type = ChangeAnim
triggerall = Parent,stateno = 5011
triggerall = Parent,anim = 25027
triggerall = anim != 5027
trigger1 = Parent,time >= 0
value = 5027
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 吹っ飛ばしやられモーション]
type = ChangeAnim
triggerall = (Parent,stateno = 5000) || (Parent,stateno = 5020)
triggerall = Parent,anim = 25030
triggerall = anim != 5030
trigger1 = Parent,time >= 0
value = 5030
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 落下モーション]
type = ChangeAnim
triggerall = (Parent,stateno = 5000) || (Parent,stateno = 5020)
triggerall = Parent,anim = 25030
triggerall = anim != 5030
trigger1 = Parent,time >= 0
value = 5030
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 打ち上げやられモーション]
type = ChangeAnim
triggerall = Parent,anim = 25050
triggerall = anim != 5050
trigger1 = Parent,time >= 0
value = 5050
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 足払いやられモーション]
type = ChangeAnim
triggerall = Parent,stateno = 5070
triggerall = Parent,anim = 25070
;triggerall = anim != 5070
trigger1 = Parent,time >= 0
value = 5070
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 空中やられ復帰モーション(1)]
type = ChangeAnim
triggerall = Parent,alive
triggerall = Parent,anim = 25035
triggerall = anim != 5035
trigger1 = Parent,time >= 1
value = 5035
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 空中やられ復帰モーション(2)]
type = ChangeAnim
triggerall = Parent,alive
triggerall = Parent,anim = 25040
triggerall = anim != 5040
trigger1 = Parent,time >= 1
value = 5040
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)



[State 20000, 空中やられから落下へ]
type = ChangeAnim
triggerall = Parent,alive = 0
triggerall = Parent,anim = 25035
triggerall = anim != 5035
trigger1 = Parent,time >= 1
value = 5035
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, しゃがみモーション（立ちモーションから）]
type = ChangeAnim
trigger1 = Parent,stateno = 10
trigger1 = Anim != 60010
trigger1 = Anim != 11
trigger1 = Parent,time >= 1
value = 60010
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, しゃがみモーション（最初からしゃがんでいる）]
type = ChangeAnim
triggerall = Anim != 11
triggerall = Anim != 60010
trigger1 = Parent,stateno = 11
trigger1 = Parent,PrevStateno != 10
trigger1 = Parent,time >= 1
trigger2 = Parent,stateno = 131
trigger3 = Parent,stateno = [152,153]
value = 11
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ち構えモーション]
type = ChangeAnim
triggerall = Anim != 60150
triggerall = Parent,time >= 1
trigger1 = Parent,anim = 20130
trigger2 = Parent,anim = 20150
trigger3 = Parent,stateno = 20200
trigger4 = Parent,stateno = 20210
trigger5 = Parent,stateno = 20220
trigger6 = Parent,stateno = 20230
trigger7 = Parent,stateno = 20550
trigger8 = Parent,stateno = 20560
trigger9 = Parent,stateno = 21200
trigger10 = Parent,stateno = 21210
trigger11 = Parent,stateno = 21220
trigger12 = Parent,stateno = 21400
trigger12 = Parent,animelemtime(6) < 0
trigger13 = Parent,stateno = 21410
trigger13 = Parent,animelemtime(6) < 0
trigger14 = Parent,stateno = 21420
trigger14 = Parent,animelemtime(6) < 0
trigger15 = Parent,stateno = 21450
value = 60150
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, しゃがみ構えモーション]
type = ChangeAnim
triggerall = Anim != 60151
triggerall = Parent,time >= 1
trigger1 = Parent,anim = 20131
trigger2 = Parent,anim = 20151
trigger3 = Parent,stateno = 20300
trigger4 = Parent,stateno = 20310
trigger5 = Parent,stateno = 20320
value = 60151
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 空中構えモーション]
type = ChangeAnim
triggerall = Anim != 60152
triggerall = Parent,time >= 1
trigger1 = Parent,anim = 20132
trigger2 = Parent,anim = 20152
trigger3 = Parent,stateno = 20400
trigger4 = Parent,stateno = 20410
trigger5 = Parent,stateno = 20420
trigger6 = Parent,stateno = 20431
value = 60152
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000,テラーニュース（ライ）]
type = ChangeAnim
triggerall = Anim != 60600
triggerall = Parent,time >= 1
trigger1 = Parent,stateno = 21000
trigger2 = Parent,stateno = 21010
trigger3 = Parent,stateno = 21020
trigger4 = Parent,stateno = 21030
trigger5 = Parent,stateno = 21100
trigger6 = Parent,stateno = 21110
trigger7 = Parent,stateno = 21120
trigger8 = Parent,stateno = 21130
trigger9 = Parent,stateno = 21140
trigger10 = Parent,stateno = 21150
trigger11 = Parent,stateno = 21231
trigger12 = Parent,stateno = 23000
trigger13 = Parent,stateno = 23100
value = 60600
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000,謎のアッパー]
type = ChangeAnim
triggerall = Anim != 61300
triggerall = Parent,time >= 1
trigger1 = Parent,stateno = 21400
trigger1 = Parent,animelemtime(6) >= 0
trigger2 = Parent,stateno = 21410
trigger2 = Parent,animelemtime(6) >= 0
trigger3 = Parent,stateno = 21420
trigger3 = Parent,animelemtime(6) >= 0
value = 61300
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)



[State 20000,カッティングシンク]
type = ChangeAnim
triggerall = Anim != 61700
triggerall = Parent,time >= 1
trigger1 = Parent,stateno = 22000
trigger2 = Parent,stateno = 22100
value = 61700
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


;[State 20000, カッティングシンク踏み込みモーション]
;type = ChangeAnim
;triggerall = Anim != 61200
;triggerall = Parent,time >= 1
;trigger1 = Parent,stateno = 20220
;value = 61200


[State 20000, 前進モーション]
type = ChangeAnim
triggerall = Parent,stateno = 20
triggerall = Parent,anim = 20020
trigger1 = Anim != 20
trigger1 = Parent,time >= 1
value = 20
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 後退モーション]
type = ChangeAnim
triggerall = Parent,stateno = 20
triggerall = Parent,anim = 20021
trigger1 = Anim != 21
trigger1 = Parent,time >= 1
value = 21
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 地上前ダッシュモーション]
type = ChangeAnim
triggerall = Parent,movetype != H
triggerall = Parent,anim = 20100
trigger1 = Anim != 100
trigger1 = Parent,time >= 1
value = 100
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 地上前ダッシュ終了モーション]
type = ChangeAnim
triggerall = Parent,movetype != H
triggerall = Parent,anim = 20101
trigger1 = Anim != 101
trigger1 = Parent,time >= 1
value = 101
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 地上バックダッシュ開始モーション]
type = ChangeAnim
triggerall = Parent,movetype != H
triggerall = Parent,anim = 20105
trigger1 = Anim != 105
trigger1 = Parent,time >= 1
value = 105
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 地上バックダッシュモーション]
type = ChangeAnim
triggerall = Parent,movetype != H
triggerall = Parent,anim = 20106
trigger1 = Anim != 106
trigger1 = Parent,time >= 1
value = 106
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, ジャンプ始動モーション]
type = ChangeAnim
triggerall = (Parent,stateno = 40) || (Parent,stateno = 45) || (Parent,stateno = 50040)
triggerall = Parent,anim = 20040
trigger1 = Anim != 40
trigger1 = Parent,time >= 1
value = 40
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 垂直ジャンプ上昇モーション]
type = ChangeAnim
triggerall = Parent,stateno = 50
triggerall = Parent,anim = 20041
triggerall = Parent,time = 1
trigger1 = Anim != 41
trigger1 = Parent,time >= 1
value = 41
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 前方ジャンプ上昇モーション]
type = ChangeAnim
triggerall = Anim != 42
triggerall = Parent,time >= 1
trigger1 = Parent,stateno = 50
trigger1 = Parent,anim = 20042
;trigger2 = Parent,stateno = 21400
;trigger3 = Parent,stateno = 21410
;trigger4 = Parent,stateno = 21420
value = 42
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 後方ジャンプ上昇モーション]
type = ChangeAnim
triggerall = Parent,stateno = 50
triggerall = Parent,anim = 20043
triggerall = Parent,time = 1
trigger1 = Anim != 43
trigger1 = Parent,time >= 1
value = 43
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 空中ダッシュ（前方）モーション]
type = ChangeAnim
triggerall = Parent,stateno = 103
triggerall = Parent,anim = 20110
triggerall = Parent,time = 1
trigger1 = Anim != 110
trigger1 = Parent,time >= 1
trigger2 = Parent,prevstateno = 103
value = 110
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 空中ダッシュ（後方）モーション]
type = ChangeAnim
triggerall = Parent,stateno = 108
triggerall = Parent,anim = 20115
triggerall = Parent,time = 1
trigger1 = Anim != 115
trigger1 = Parent,time >= 1
trigger2 = Parent,prevstateno = 108
value = 115
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000,各種ジャンプ下降モーション]
type = ChangeAnim
triggerall = Parent,stateno = 50
triggerall = Parent,Vel y > -1
triggerall = anim = [41,43]
trigger1 = anim = 41
trigger2 = anim = 42
trigger3 = anim = 43
value = anim + 3
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000,その他下降モーション]
type = ChangeAnim
triggerall = Parent,Vel y > -1
triggerall = anim != [41,46]
trigger1 = Parent,stateno = 50
trigger2 = Parent,stateno = 20432
value = 44
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 着地モーション]
type = ChangeAnim
triggerall = Parent,stateno = 52
triggerall = Parent,anim = 20047
trigger1 = Anim != 60047
trigger1 = Parent,time >= 1
value = 60047
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, テラーニュース（ライ）系終了モーション]
type = ChangeAnim
triggerall = Parent,anim = 20000
triggerall = Anim != 60700
triggerall = Parent,time >= 1
triggerall = Anim = 60600
trigger1 = Parent,Prevstateno = 21000
trigger2 = Parent,Prevstateno = 21010
trigger3 = Parent,Prevstateno = 21020
trigger4 = Parent,Prevstateno = 21030
trigger5 = Parent,Prevstateno = 21100
trigger6 = Parent,Prevstateno = 21110
trigger7 = Parent,Prevstateno = 21120
trigger8 = Parent,Prevstateno = 21130
trigger9 = Parent,Prevstateno = 21140
trigger10 = Parent,Prevstateno = 21150
trigger11 = Parent,Prevstateno = 21231
trigger12 = Parent,Prevstateno = 23000
trigger13 = Parent,Prevstateno = 23100
value = 60700
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000,カッティングシンク終了]
type = ChangeAnim
triggerall = Anim != 61710
triggerall = Parent,time >= 1
trigger1 = Parent,stateno = 22010
trigger2 = Parent,stateno = 22020
trigger3 = Parent,stateno = 22110
trigger4 = Parent,stateno = 22120
value = 61710
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000, 立ちモーション]
type = ChangeAnim
triggerall = Anim != 0 && Anim != 5
triggerall = anim != 60047
triggerall = anim != 60700
triggerall = anim != 61710
trigger1 = Parent,stateno = 0
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
trigger3 = Parent,stateno = 21300
trigger4 = Parent,stateno = 21301
trigger5 = Parent,stateno = 23005
value = 0
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000,一時的に消滅]
type = changeanim
trigger1 = Parent,movetype = H
trigger1 = Parent,stateno != 5000
trigger1 = Parent,stateno != 5001
trigger1 = Parent,stateno != 5010
trigger1 = Parent,stateno != 5011
trigger1 = Parent,stateno != 5020
trigger1 = Parent,stateno != 5030
trigger1 = Parent,stateno != 5035
trigger1 = Parent,stateno != 5040
trigger1 = Parent,stateno != 5050
trigger1 = Parent,stateno != 5070
trigger1 = Parent,stateno != 5071
trigger1 = Parent,stateno != 5080
trigger1 = Parent,stateno != 5081
trigger1 = Parent,stateno != 5100
trigger1 = Parent,stateno != 5101
trigger1 = Parent,stateno != 5110
;trigger1 = Parent,stateno != 5120
trigger1 = Parent,stateno != 5150
trigger1 = Parent,stateno != 5200
trigger1 = Parent,stateno != 5201
trigger1 = Parent,stateno != 5210
trigger1 = Parent,stateno != [150,155]
trigger1 = Parent,stateno != 160
value = 3
;elem = AnimElemNo(0)
;persistent = 1


[State 20000, 勝利モーション]
type = ChangeAnim
trigger1 = Parent,stateno = 182
trigger1 = anim != 182
trigger1 = Parent,time >= 1
value = 182
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000,スクリーン外への移動を禁止]
type = ScreenBound
trigger1 = Parent,Stateno != [23006,23010]
value = 1
movecamera = 0,0
supermovetime = -1
pausemovetime = -1


[State 20000,スクリーン外への移動を一時的に許可]
type = ScreenBound
triggerall = Parent,movetype != H
trigger1 = Parent,Stateno = [23006,23010]
value = 0
movecamera = 0,0
supermovetime = -1
pausemovetime = -1


[State 20000,偽本体方向転換]
type = Turn
trigger1 = Parent,Facing != Facing
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000,画像優先度変更]
type = SprPriority
trigger1 = anim = 60150
trigger2 = anim = 60151
trigger3 = anim = 60152
value = -1
supermovetime = 0
pausemovetime = ifelse(Parent,var(19)=1,999999999,0)


[State 20000,位置固定]
type = BindToRoot
trigger1 = 1 
time = -1
pos = -15,0
supermovetime = -1
pausemovetime = -1


[State 20000,画像優先度変更]
type = SprPriority
trigger1 = anim != 60150
trigger1 = anim != 60151
trigger1 = anim != 60152
value = 1
supermovetime = -1
pausemovetime = ifelse(Parent,var(19)=1,-1,0)


[State 20000,偽本体消滅]
type = ChangeState
trigger1 = parent,var(3) != [1,2]
trigger1 = parent,alive
trigger2 = !parent,alive
trigger2 = parent,anim <= 19999
ctrl = 0
value = 1
supermovetime = 99999
pausemovetime = ifelse(Parent,var(19)=1,-1,0)


[State 20000,偽本体消滅（通常）]
type = null;Destroyself
triggerall = Ishelper = 20000
trigger1 = parent,var(21) = 1
supermovetime = -1
pausemovetime = ifelse(Parent,var(19)=1,-1,0)


[State 20000,アニメ固定]
type = changeanim
;trigger1 = parent,var(35) = 1
trigger1 = parent,var(22) = 1
value = anim
elem = AnimElemNo(0)
persistent = 1


[State 20000,偽本体動作コントロール]
type = ParentVarSet
trigger1 = 1
var(22) = 1
ignorehitpause = 1
persistent = 1


;[State 20000,偽本体消滅（通常）]
;type = Destroyself
;triggerall = Ishelper(20000)
;trigger1 = parent,var(21) = 1
;supermovetime = -1
;pausemovetime = -1


;[State 20000,偽本体消滅（時止め用）]
;type = Destroyself
;triggerall = Ishelper(20001)
;trigger1 = parent,var(21) = 0
;supermovetime = -1
;pausemovetime = -1
