;---------------------------------------------------------------------------
; Stand
[Statedef 0]
movehitpersist = 1
hitdefpersist = 1

[state ]
type = changestate
trigger1 = name != "Unconscious"
value = 5150
persistent = 256
ignorehitpause = 1

[state ]
type = changestate
trigger1 = ishelper
value = 999999999
persistent = 256
ignorehitpause = 1

[state ]
type = statetypeset
trigger1 = !ishelper
statetype = s
movetype = a
physics = n
ignorehitpause = 1

[state ]
type = ChangeAnim
trigger1 = Anim != 0
value = 0

[state ]
type = velset
trigger1 = !ishelper
x = 0
y = 0
ignorehitpause = 1

[state ]
type = changestate
triggerall = !ishelper
trigger1 = alive
value = 120
ignorehitpause = 1

;---------------------------------------------------------------------------
; Walk
[Statedef 20]
movehitpersist = 1
hitdefpersist = 1

[state ]
type = changestate
trigger1 = name != "Unconscious"
value = 5150
persistent = 256
ignorehitpause = 1

[state ]
type = changestate
trigger1 = ishelper
value = 999999999
persistent = 256
ignorehitpause = 1

[state ]
type = statetypeset
trigger1 = !ishelper
statetype = s
movetype = a
physics = n
ignorehitpause = 1

[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 && animelemtime(1) = 0
value = 20

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

[state ]
type = changestate
triggerall = command != "holdfwd"
triggerall = command != "holdback"
trigger1 = 1
value = 0
ctrl = 1
ignorehitpause = 1

[state ]
type = changestate
triggerall = !ishelper
trigger1 = alive
value = 120
ignorehitpause = 1

;---------------------------------------------------------------------------
;本体準ステ固定先

[Statedef 120]
type = U
movetype = U
phisics = U
movehitpersist = 1
hitdefpersist = 1

[state ]
type = changestate
trigger1 = name != "Unconscious"
value = 5150
persistent = 256
ignorehitpause = 1

[state ]
type = changestate
trigger1 = ishelper
value = 999999999
persistent = 256
ignorehitpause = 1

;---------------------------------------------------------------------------
;
[Statedef 130]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; GUARD (end)
[Statedef 140]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; CGUARDHIT (shaking)
[Statedef 152]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; CGUARDHIT2 (knocked back)
[Statedef 153]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; AGUARDHIT (shaking)
[Statedef 154]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; AGUARDHIT2 (knocked away)
[Statedef 155]
hitdefpersist = 1
movehitpersist = 1
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;-------------------------------------------------------------------------------
;タイムオーバー（負けた時)

[statedef 170]

[state ]
type = changestate
trigger1 = ishelper
trigger2 = name != "Unconscious"
value = 5150
ignorehitpause = 1

[state ]
type = changeanim
triggerall = !ishelper
trigger1 = anim != 170
value = 170
ignorehitpause = 1

[state ]
type = statetypeset
trigger1 = !ishelper
statetype = s
ignorehitpause = 1

[state ]
type = velset
trigger1 = !ishelper
x = 0
y = 0
ignorehitpause = 1

[state ]
type = ctrlset
trigger1 = !ishelper
value = 0
ignorehitpause = 1

[state ]
type = assertspecial
triggerall = !ishelper
trigger1 = animelemtime(1) <= 100
flag = roundnotover
ignorehitpause = 1

;-------------------------------------------------------------------------------
:タイムオーバー（引き分けた時）

[statedef 175]

[state ]
type = changestate
trigger1 = ishelper
trigger2 = name != "Unconscious"
value = 5150
ignorehitpause = 1

[state ]
type = changeanim
triggerall = !ishelper
trigger1 = anim != 175
value = 175
ignorehitpause = 1

[state ]
type = statetypeset
trigger1 = !ishelper
statetype = s
ignorehitpause = 1

[state ]
type = velset
trigger1 = !ishelper
x = 0
y = 0
ignorehitpause = 1

[state ]
type = ctrlset
trigger1 = !ishelper
value = 0
ignorehitpause = 1

[state ]
type = assertspecial
triggerall = !ishelper
trigger1 = animelemtime(1) <= 100
flag = roundnotover
ignorehitpause = 1

;-------------------------------------------------------------------------------
;勝利

[statedef 180]

[state ]
type = changestate
trigger1 = ishelper
trigger2 = name != "Unconscious"
value = 5150
ignorehitpause = 1

[state ]
type = changeanim
triggerall = !ishelper
trigger1 = anim != 183
value = 183
ignorehitpause = 1

[state ]
type = statetypeset
trigger1 = !ishelper
statetype = s
movetype = a
physics = s
ignorehitpause = 1

[state ]
type = velset
trigger1 = !ishelper
x = 0
y = 0
ignorehitpause = 1

[state ]
type = ctrlset
trigger1 = !ishelper
value = 0
ignorehitpause = 1

[state ]
type = playsnd
triggerall = !ishelper
trigger1 = animelemtime(7) = 0
value = 190,1
freqmul = 1.0 - 0.1 * (random%3)
ignorehitpause = 1

[state ]
type = playsnd
triggerall = !ishelper
trigger1 = animelemtime(57) = 12
value = 5000,27
channel = 0
volume = 300
freqmul = 1.0 - 0.1 * (random%3)
ignorehitpause = 1

[state ]
type = assertspecial
triggerall = !ishelper
trigger1 = animelemtime(1) <= 220
flag = roundnotover
ignorehitpause = 1

;-------------------------------------------------------------------------------
;イントロ

[statedef 190]

[state ]
type = changestate
trigger1 = ishelper
trigger2 = name != "Unconscious"
value = 5150
ignorehitpause = 1

[state ]
type = statetypeset
trigger1 = !ishelper
statetype = s
ignorehitpause = 1

[state ]
type = velset
trigger1 = !ishelper
x = 0
y = 0
ignorehitpause = 1

[state ]
type = ctrlset
trigger1 = !ishelper
value = 0
ignorehitpause = 1

[state ]
type = changeanim
triggerall = !ishelper
trigger1 = anim != 190
value = 190
ignorehitpause = 1

[state ]
type = playsnd
triggerall = !ishelper
trigger1 = animelemtime(11) = 0
value = 5000,31
channel = 0
volume = 300
freqmul = 1.0 - 0.1 * (random%3)
ignorehitpause = 1

[state ]
type = playsnd
triggerall = !ishelper
trigger1 = animelemtime(13) = 0
value = 190,1
freqmul = 1.0 - 0.1 * (random%3)
ignorehitpause = 1

[state ]
type = playsnd
triggerall = !ishelper
trigger1 = animelemtime(14) = 0
value = 190,2
freqmul = 1.0 - 0.1 * (random%3)
ignorehitpause = 1

[state ]
type = explod
triggerall = !ishelper
trigger1 = animelemtime(11) = 1
anim = 191
id = 191
sprpriority = 5
postype = p1
pos = 0,0
bindtime = 1
supermove = 1
under = 0
supermovetime = 2147483648
pausemovetime = 2147483648
ignorehitpause = 1

[state ]
type = assertspecial
triggerall = !ishelper
trigger1 = 1
flag = intro
ignorehitpause = 1

[state ]
type = selfstate
triggerall = !ishelper
trigger1 = animtime = 0
value = 0
ctrl = 1
persistent = 256
ignorehitpause = 1

[state ]
type = changestate
triggerall = !ishelper
trigger1 = alive
value = 120
ignorehitpause = 1

;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HITG_SLIDE
[Statedef 5001]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HITC_SHAKE
[Statedef 5010]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HITC_SLIDE
[Statedef 5011]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HITA_SHAKE
[Statedef 5020]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 5030]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HITA_UP_T (transition)
[Statedef 5035]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HITA_RECOV (recovering in air, not falling)
[Statedef 5040]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HITA_FALL (knocked up, falling)
[Statedef 5050]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HIT_TRIP (shaking)
[Statedef 5070]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HIT_TRIP2 (fall through air)
[Statedef 5071]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HITL_SHAKE
[Statedef 5080]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HITL_SLIDE
[Statedef 5081]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 5100]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 5101]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 5110]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HIT_GETUP
[Statedef 5120]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HIT_LIEDEAD
[Statedef 5150]
type = U
movetype = U
phisics = U
hitdefpersist = 1
movehitpersist = 1

[state ]
type = lifeset
trigger1 = name != "Unconscious"
value = 0
ignorehitpause = 1

[state ]
type = selfstate
triggerall = name != "Unconscious"
trigger1 = time >= 20
value = 0
persistent = 256
ignorehitpause = 1

;---------------------------------------------------------------------------
; HIT_FALLRECOVER (still falling)
[Statedef 5200]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HIT_FALLRECOVER (on the ground)
[Statedef 5201]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; HIT_AIRFALLRECOVER
[Statedef 5210]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; Continue?
[Statedef 5500]
[state ]
type = null
trigger1 = 1
ignorehitpause = 1
;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 5900]

[state ]
type = changestate
trigger1 = name != "Unconscious"
value = 5150
persistent = 256
ignorehitpause = 1

[state ]
type = changestate
trigger1 = ishelper
value = 999999999
persistent = 256
ignorehitpause = 1

[state ]
type = changestate
trigger1 = roundno = 1
value = 190
ignorehitpause = 1

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