; Common state file for M.U.G.E.N beta 2002.04.14
;
; 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
physics = S
sprpriority = 0

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

[State 0]
type = ChangeState
trigger1 = roundstate = 2
trigger1 = palno = 12
trigger1 = var(35) = 1
value = 2010

[State 0]
type = ChangeState
trigger1 = roundstate = 2
trigger1 = palno = [2,12]
trigger1 = var(39) != 1
trigger1 = time = 30
value = 2010

[State 0]
type = ChangeState
trigger1 = roundstate = 2
trigger1 = palno = 1
trigger1 = time = 30
value = 210

[State 0]
type = AssertSpecial
trigger1 = Ishelper
flag = noshadow 
flag2 = invisible
ignorehitpause = 1

[state 0]
type = destroyself
trigger1 = Ishelper
trigger1 = roundstate = 2
trigger1 = Root,StateNo != 2000
trigger1 = Root,StateNo != 2010
ignorehitpause = 1
pausemovetime = 99999999
supermovetime = 99999999
;---------------------------------------------------------------------------
[State ]
type = VarSet
trigger1 = 1
var(0) = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
[State ]
type = VarRandom
trigger1 = 1
v = 58
range = 1000
IgnoreHitPause = 1
Persistent = 1
;---------------------------------------------------------------------------
[State ]
type = VarRandom
trigger1 = 1
v = 59
range = 1000
IgnoreHitPause = 1
Persistent = 1
;---------------------------------------------------------------------------
[State ]
type = ChangeState
triggerall = Alive
triggerall = NumEnemy
triggerall = StateType = S
triggerall = Ctrl
triggerall = RoundState = 2
triggerall = Power < 5000
trigger1 = var(44) != 1
trigger1 = var(35) != 1
trigger1 = var(59) =  [0,200]
trigger1 = p2BodyDist X >= 50
value = 200
IgnoreHitPause = 1
;---------------------------------------------------------------------------
[State ]
type = ChangeState
triggerall = Alive
triggerall = NumEnemy
triggerall = StateType = S
triggerall = Ctrl
triggerall = RoundState = 2
triggerall = Power < 5000
trigger1 = var(44) != 1
trigger1 = var(35) != 1
trigger1 = var(59) =  [201,400]
trigger1 = p2BodyDist X >= 50
value = 205
IgnoreHitPause = 1
;---------------------------------------------------------------------------
[State ]
type = ChangeState
triggerall = Alive
triggerall = NumEnemy
triggerall = StateType = S
triggerall = Ctrl
triggerall = RoundState = 2
triggerall = Power < 5000
trigger1 = var(44) != 1
trigger1 = var(35) != 1
trigger1 = var(59) =  [401,600]
value = 300
IgnoreHitPause = 1
;---------------------------------------------------------------------------
[State ]
type = ChangeState
triggerall = Alive
triggerall = NumEnemy
triggerall = StateType = S
triggerall = Ctrl
triggerall = RoundState = 2
triggerall = Power < 5000
trigger1 = var(44) != 1
trigger1 = var(35) != 1
trigger1 = p2BodyDist X < 50
value = 400
IgnoreHitPause = 1
;---------------------------------------------------------------------------
[State ]
type = ChangeState
triggerall = Alive
triggerall = NumEnemy
triggerall = StateType = S
triggerall = Ctrl
triggerall = RoundState = 2
triggerall = Power < 5000
trigger1 = var(44) != 1
trigger1 = var(35) != 1
trigger1 = var(59) =  [601,800]
trigger1 = p2BodyDist X >= 50
value = 2100
IgnoreHitPause = S
;---------------------------------------------------------------------------
[State ]
type = ChangeState
triggerall = Alive
triggerall = NumEnemy
triggerall = Ctrl
triggerall = RoundState = 2
triggerall = enemy,name != "mechhisuiex"
triggerall = enemy,name != "Poltergeist"
trigger1 = var(44) != 1
trigger1 = var(35) != 1
trigger1 = Power >= 5000
trigger1 = var(59) =  [751,1000]
value = 2000
IgnoreHitPause = S
;---------------------------------------------------------------------------
[State ]
type = ChangeState
triggerall = Alive
triggerall = NumEnemy
triggerall = Ctrl
triggerall = RoundState = 2
triggerall = enemy,name != "mechhisuiex"
triggerall = enemy,name != "Chu-goku"
trigger1 = var(44) != 1
trigger1 = var(35) != 1
trigger1 = Power >= 5000
trigger1 = var(59) =  [250,500]
value = 2010
IgnoreHitPause = S
;---------------------------------------------------------------------------
[State ]
type = ChangeState
triggerall = Alive
triggerall = NumEnemy
triggerall = StateType = S
triggerall = Ctrl
triggerall = RoundState = 2
trigger1 = var(44) != 1
trigger1 = var(35) != 1
trigger1 = Power < 5000
trigger1 = var(59) =  [801,1000]
trigger1 = p2BodyDist X >= 50
value = 210
IgnoreHitPause = 1
;---------------------------------------------------------------------------
[State ]
type = ChangeState
triggerall = Alive
triggerall = NumEnemy
triggerall = Ctrl
triggerall = Power >= 5000
triggerall = enemy,name != "mechhisuiex"
trigger1 = var(44) != 1
trigger1 = var(35) != 1
trigger1 = RoundState = 2
trigger1 = var(59) =  [501,750]
value = 3000
IgnoreHitPause = S
;---------------------------------------------------------------------------
[State ]
type = ChangeState
triggerall = Alive
triggerall = NumEnemy
triggerall = Ctrl
triggerall = Power >= 5000
trigger1 = palno = [7,12]
trigger1 = RoundState = 2
trigger1 = var(59) =  [0,249]
trigger1 = var(44) != 1
trigger1 = var(35) != 1
value = 5000
IgnoreHitPause = S
;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type = S
movetype= I
physics = N

[State 10]
type = changestate
trigger1 = 1
value = 0
ctrl = 1

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

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

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S
anim = 12

[State ]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x) / 2
y = 0

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

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

;---------------------------------------------------------------------------
[Statedef 15]
type = C
physics = C 
ctrl = 1

[State 15, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x) / 3
y = 0

[State 15, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x) / 3
y = 0

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

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

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

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

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

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

[State 40]
type = ChangeState
trigger1 = roundstate = 2
trigger1 = time = 30
value = 2000

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

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

[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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[State 110]
type = ChangeState
trigger1 = Name = "ignis"
value = 0

[State 110]
type = HitBy
trigger1 = Name != "ignis"
value = SCA, AA, AT, AP

[State 110]
type = LifeSet
trigger1 = Name != "ignis"
value = 0
ignorehitpause = 1

[State 110]
type = ChangeState
trigger1 = Time >= 20
value = 0

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

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

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

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

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


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


;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
type    = C
physics = C

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

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

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

;---------------------------------------------------------------------------
; 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"
trigger1 = inguarddist
value = 130

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

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

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

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

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

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

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

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

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

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

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

[State 140, 1]
type = ChangeState
trigger1 = Time = 0
value = 2000

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



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


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


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



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


;===========================================================================
;タイムオーバー（負けた時）
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 170, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 1
value = 9999, 9999
volume = 255

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

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

[State 175, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 1
value = 9999, 9999
volume = 255

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

;---------------------------------------------------------------------------
;勝利ポーズ分岐（common1.cnsには無いけど、これもコモンステート）
[Statedef 180]
type = S

[State 180, ステート変更]
type = ChangeState
trigger1 = win
value = 181

;---------------------------------------------------------------------------
;勝利ポーズ（礼をする）
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181,エフェクト] 
type = Explod
trigger1 = time = 0
anim = 182
ID = 182
pos = 0,0
vel = 0,0
postype = p1
sprpriority = 7
bindtime = 1
pausemovetime = 0
supermovetime = 0
scale = 1,1
removetime = 9999
facing = 1

[State 181, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 0
trigger1 = var(59) = [0,200]
value = 180, 0

[State 181, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 0
trigger1 = var(59) = [201,400]
value = 180, 1

[State 181, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 0
trigger1 = var(59) = [401,600]
value = 180, 2

[State 181, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 0
trigger1 = var(59) = [601,800]
value = 180, 3

[State 181, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 0
trigger1 = var(59) = [801,1000]
value = 180, 4

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

;---------------------------------------------------------------------------
; PREINTRO
[Statedef 190]
type = S
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

;---------------------------------------------------------------------------
;イントロ（試合開始前の登場演出アクション）
[Statedef 191]
type = S
ctrl = 0
anim = 191
velset = 0,0

[State 191, 特殊効果];試合が開始するまではこのコントローラを使おう（※２）
type = AssertSpecial
trigger1 = 1
flag = Intro ;イントロの状態

[State 191, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 1
value = 2000, 1
volume = 255

[State 191, 音を鳴らす2]
type = PlaySnd
trigger1 = Time = 70
value = 191, 1
volume = 255

[State 191, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 130
value = 191, 2
volume = 255

[State 191, 音を鳴らす2]
type = PlaySnd
trigger1 = Time = 130
value = 191, 3
volume = 255

[State 191,エフェクト] 
type = Explod
trigger1 = time = 130
anim = 193
ID = 193
pos = 0,10
vel = 0,0
postype = p1
sprpriority = 99
bindtime = -1
pausemovetime = 0
supermovetime = 0
scale = 1,1
removetime = 23
facing = 1

[State 191, ステート変更];アニメーションが終われば「通常立ち」のステートに変更する
type = ChangeState
trigger1 = AnimTime = 0
value = 0

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

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1

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

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1
;---------------------------------------------------------------------------
; HITC_SHAKE
[Statedef 5010]
type    = C
movetype= H
physics = N
velset = 0,0

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1

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

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1


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

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 5030]
type    = A
movetype= H
physics = N
ctrl = 0

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1

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

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1

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

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1

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

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1

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

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1

;---------------------------------------------------------------------------
; HIT_TRIP2 (fall through air)
[Statedef 5071]
type    = A
movetype= H
physics = N
[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1

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

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1

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

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1

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

[State 5100]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1

;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 5101]
type    = L
movetype= H
physics = N

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

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

[State 5110]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1
;---------------------------------------------------------------------------
; HIT_GETUP
[Statedef 5120]
type    = L
movetype= I
physics = N

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

[State 5120]
type = ChangeState
trigger1 = numhelper(1)
trigger1 = ishelper
value = 4214
ctrl = 1

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

[State 175, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 1
value = 9999, 9999
volume = 255

[State 140, 1]
type = ChangeState
trigger1 = Name = "ignis"
trigger1 = life > 0
value = 0

[State 5150]
type = LifeSet
trigger1 = Name != "ignis"
value = 0
ignorehitpause = 1

[State 5150]
type = LifeSet
trigger1 = Name = "ignis"
trigger1 = life > 0
value = 1000
ignorehitpause = 1

[State 5150]
type = Assertspecial
trigger1 = Name != "ignis"
flag = invisible
flag2 = noshadow
ignorehitpause = 1

[State 5150]
type = Selfstate
triggerall = !ishelper
triggerall = alive
trigger1 = time >= 300
value = 50
ignorehitpause = 1

[State 5150]
type = Destroyself
trigger1 = ishelper
ignorehitpause = 1

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

[State 5150]
type = ChangeState
trigger1 = numhelper(1)
trigger1 = ishelper
value = 4214
ctrl = 1

[State 5150]
type = ChangeState
trigger1 = numhelper(2001)
trigger1 = ishelper
value = 2001
ctrl = 1

[State 5150]
type = ChangeState
trigger1 = numhelper(2002)
trigger1 = ishelper
value = 2002
ctrl = 1

[State 5150]
type = ChangeState
trigger1 = numhelper(5001)
trigger1 = ishelper
value = 5001
ctrl = 1
;---------------------------------------------------------------------------
; HIT_FALLRECOVER (still falling)
[Statedef 5200]
type    = A
movetype= H
physics = N

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1

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

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
ctrl = 1
;---------------------------------------------------------------------------
; HIT_AIRFALLRECOVER
[Statedef 5210]
type    = A
movetype= I
physics = N
anim = 5210
ctrl = 0

[State ]
type = ChangeState
trigger1 = AnimTime = 0
value = 5150
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

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