; Common state file
; 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.
; sysvar(2)   Temp   Set by state 5080 or state 5090
; sysvar(3) no trial
; sysvar(4) no trial
; fvar(31) enemy(0),screenpos x
; fvar(32) enemy(0),screenpos y
; fvar(33) enemy(1),screenpos x
; fvar(34) enemy(1),screenpos y
; var(40) Valiable Attack
; var(48) P2orP4 ;no trial
; var(49) Target,ID ;no trial
; var(50) Win
; var(59) CPU

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

[State 0]
type = ChangeAnim
trigger1 = anim!= 0+var(10)*10000 && anim!= 5+var(10)*10000
trigger2 = anim = 5+var(10)*10000 && animtime = 0 ;Turn anim over
value = 0+var(10)*10000

[State vel]
type = velset
trigger1 = time = 0
y = 0

[State Stop moving if low velocity or 4 ticks pass]
type = velset
trigger1 = abs(vel x) < 2
trigger2 = time = 4
x = 0

;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type = C
physics = C
anim = 10+var(10)*10000
facep2 = 1

[State 10]
type = velmul
trigger1 = time = 0
x = .75

[State 10]
type = ChangeState
trigger1 = animtime = 0
value = 11

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type = C
physics = C
anim = 11+var(10)*10000
sprpriority = 0

[State Change from turning animation]
type = ChangeAnim
trigger1 = anim = 6+var(10)*10000 && animtime = 0
value = 11+var(10)*10000

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type = S
physics = S
anim = 12+var(10)*10000

[State end]
type = ChangeState
trigger1 = animtime = 0
value = 0

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

[State vel]
type = velset
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State vel]
type = velset
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = anim!= 20+var(10)*10000 && anim!= 5+var(10)*10000
trigger2 = anim = 5+var(10)*10000 && animtime = 0
value = 20+var(10)*10000

[State 20]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = anim!= 21+var(10)*10000 && anim!= 5+var(10)*10000
trigger2 = anim = 5+var(10)*10000 && animtime = 0
value = 21+var(10)*10000

;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type = S
physics = S
anim = 40+var(10)*10000
ctrl = 0
sprpriority = 1

[State 40]
type = varset
trigger1 = time = 0
sysvar(1) = 0
[State 40]
type = varset
trigger1 = command = "holdfwd"
sysvar(1) = 1
[State 40]
type = varset
trigger1 = command = "holdback"
sysvar(1) = -1

[State vel]
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 vel]
type = velset
trigger1 = animtime = 0
trigger1 = prevstateno = 100
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State end]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 1

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

[State 45]
type = ChangeAnim
trigger1 = selfanimexist(44+var(10)*10000)
value = 44+var(10)*10000

[State 45]
type = ChangeAnim
trigger1 =!selfanimexist(44+var(10)*10000)
value = 41+var(10)*10000

[State 45]
type = varset
trigger1 = time = 0
sysvar(1) = 0
[State 45]
type = varset
trigger1 = command = "holdfwd"
sysvar(1) = 1
[State 45]
type = varset
trigger1 = command = "holdback"
sysvar(1) = -1

[State vel]
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 end]
type = ChangeState
trigger1 = time = 2
value = 50
ctrl = 1

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

[State 50]
type = varset
trigger1 = time = 0
sysvar(1) = 0

[State 50]
type = ChangeAnim
trigger1 = time = 0
value = ifelse((vel x)=0,41,ifelse((vel x)>0,42,43))+var(10)*10000

[State 50]
type = ChangeAnim
trigger1 = vel y > -2
trigger1 = selfanimexist(anim+3)
value = anim+3
persistent = 0

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

[State 51]
type = Null
trigger1 = 1

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

[State vel]
type = velset
trigger1 = time = 0
y = 0

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

[State ctrl]
type = ctrlset
trigger1 = time = 3
value = 1

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

;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 100]
type = S
physics = S
anim = 100+var(10)*10000
sprpriority = 1

[State vel]
type = velset
trigger1 = 1
x = const(velocity.run.fwd.x)

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

[State Prevent from turning]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

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

;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type = A
physics = A
anim = 105+var(10)*10000
ctrl = 0
sprpriority = 1

[State vel]
type = velset
trigger1 = time = 0
x = const(velocity.run.back.x)
y = const(velocity.run.back.y)

[State ctrl]
type = ctrlset
trigger1 = time = 2
value = 1

[State 105]
type = ChangeState
trigger1 = vel y > 0
trigger1 = pos y >= 0
value = 106

;---------------------------------------------------------------------------
; RUN_BACK2 (land)
[Statedef 106]
type = S
physics = S
anim = 47+var(10)*10000
ctrl = 0

[State vel]
type = velset
trigger1 = time = 0
y = 0

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

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

[State end]
type = ChangeState
trigger1 = time = 7
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; RUN_UP
[Statedef 110]
type = S
physics = N
anim = 110+var(10)*10000
velset = 0
ctrl = 0

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

[State vel]
type = velset
trigger1 = time = 0
z = -7

[State 110]
type = velmul
trigger1 = 1
z = 0.8

[State vel]
type = velset
trigger1 = animtime = -8
z = 0

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

;---------------------------------------------------------------------------
; RUN_DOWN
[Statedef 115]
type = S
physics = N
anim = 110+var(10)*10000
velset = 0
ctrl = 0

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

[State vel]
type = VelSet
trigger1 = time = 0
z = 7

[State 115]
type = velmul
trigger1 = 1
z = 0.8

[State vel]
type = velset
trigger1 = animtime = -8
z = 0

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

;---------------------------------------------------------------------------
; GUARD (start)
[Statedef 120]
type = U
physics = U

[State anim]
type = ChangeAnim
trigger1 = time = 0
value = 120+(statetype=C)+(statetype=A)*2+var(10)*10000

[State type]
type = StateTypeSet
trigger1 = time = 0 && statetype = S
physics = S
[State type]
type = StateTypeSet
trigger1 = time = 0 && statetype = C
physics = C
[State type]
type = StateTypeSet
trigger1 = time = 0 && statetype = A
physics = A

[State 120]
type = ChangeState
trigger1 = animtime = 0
value = 130+(statetype=C)+(statetype=A)*2

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

[State anim]
type = ChangeAnim
trigger1 = anim!= 130+var(10)*10000
value = 130+var(10)*10000

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

[State anim]
type = ChangeAnim
trigger1 = anim!= 131+var(10)*10000
value = 131+var(10)*10000

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

[State anim]
type = ChangeAnim
trigger1 = anim!= 132+var(10)*10000
value = 132+var(10)*10000

[State vel]
type = veladd
trigger1 = 1
y = const(movement.yaccel)

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

[State vel]
type = velset
trigger1 = sysvar(0)
y = 0

[State pos]
type = posset
trigger1 = sysvar(0)
y = 0

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

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

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

[State anim]
type = ChangeAnim
trigger1 = time = 0
value = 140+(statetype=C)+(statetype=A)*2+var(10)*10000

[State type]
type = StateTypeSet
trigger1 = time = 0 && statetype = S
physics = S
[State type]
type = StateTypeSet
trigger1 = time = 0 && statetype = C
physics = C
[State type]
type = StateTypeSet
trigger1 = time = 0 && statetype = A
physics = A

;[State 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 anim]
type = ChangeAnim
trigger1 = 1
value = 150+var(10)*10000

[State 150]
type = ChangeState
trigger1 = hitshakeover
value = 151

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

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

[State vel]
type = HitVelSet
trigger1 = time = 0
x = 1

[State vel]
type = velset
trigger1 = time = gethitvar(slidetime)
trigger2 = time >= gethitvar(hittime)
x = 0

[State ctrl]
type = ctrlset
trigger1 = time = gethitvar(ctrltime)
value = 1

[State 151]
type = ChangeState
trigger1 = time >= gethitvar(hittime)
value = 130
ctrl = 1

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

[State anim]
type = ChangeAnim
trigger1 = 1
value = 151+var(10)*10000

[State 152]
type = ChangeState
trigger1 = hitshakeover
value = 153

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

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

[State vel]
type = HitVelSet
trigger1 = time = 0
x = 1

[State vel]
type = velset
trigger1 = time = gethitvar(slidetime)
trigger2 = time >= gethitvar(hittime)
x = 0

[State ctrl]
type = ctrlset
trigger1 = time = gethitvar(ctrltime)
value = 1

[State 153]
type = ChangeState
trigger1 = time >= gethitvar(hittime)
value = 131
ctrl = 1

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

[State anim]
type = ChangeAnim
trigger1 = 1
value = 152+var(10)*10000

[State 154]
type = ChangeState
trigger1 = hitshakeover
value = 155 ;AGUARDHIT2

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

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

[State vel]
type = HitVelSet
trigger1 = time = 0
x = 1
y = 1

[State vel]
type = veladd
trigger1 = 1
y = const(movement.yaccel)

[State ctrl]
type = ctrlset
trigger1 = time = gethitvar(ctrltime)
value = 1

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

[State vel]
type = velset
trigger1 = sysvar(0)
y = 0

[State pos]
type = posset
trigger1 = sysvar(0)
y = 0

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

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

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

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

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

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

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

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

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

;---------------------------------------------------------------------------
; 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 Anim for HIT_LIGHT to HIT_HARD]
type = ChangeAnim
trigger1 = time = 0
trigger1 = gethitvar(animtype)!= [3,5]
value = ifelse((gethitvar(groundtype)=1),5000,5010)+gethitvar(animtype)+var(10)*10000

[State Anim for HIT_BACK]
type = ChangeAnim
trigger1 = time = 0
trigger1 = gethitvar(animtype) = [3,5]
value = 5030+var(10)*10000

[State Anim for HIT_UP/HIT_DIAGUP (only if it exists)]
type = ChangeAnim
trigger1 = time = 0
trigger1 =(gethitvar(animtype)=[4,5])&&(selfanimexist(5047+gethitvar(animtype)))
value = 5047+gethitvar(animtype)+var(10)*10000

[State Freeze anim]
type = ChangeAnim
trigger1 = time > 0
value = anim

[State State type gets set to aerial if getting hit up]
type = StateTypeSet
trigger1 = time = 0
trigger1 = gethitvar(yvel)!= 0 && gethitvar(fall)
trigger2 = pos y!= 0
type = A

[State 5000]
type = ChangeState
trigger1 = hitshakeover
trigger1 = gethitvar(yvel) = 0
value = 5001

[State 5000]
type = ChangeState
trigger1 = hitshakeover
value = 5030

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

[State vel]
type = HitVelSet
trigger1 = time = 0
x = 1

[State anim]
type = ChangeAnim
trigger1 = animtime = 0
value = 5005+gethitvar(animtype)+(gethitvar(groundtype)=2)*10+var(10)*10000

[State Stop sliding back]
type = velmul
trigger1 = time >= gethitvar(slidetime)
x = .6

[State vel]
type = velset
trigger1 = hitover
x = 0

[State defence]
type = DefenceMulSet
trigger1 = hitover
value = 1

[State end]
type = ChangeState
trigger1 = hitover
value = 0
ctrl = 1

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

[State Anim for HIT_LIGHT to HIT_HARD]
type = ChangeAnim
trigger1 = time = 0
trigger1 = gethitvar(animtype)!= [3,5]
value = 5020+gethitvar(animtype)+var(10)*10000

[State Anim for HIT_BACK]
type = ChangeAnim
trigger1 = time = 0
trigger1 = gethitvar(animtype) = [3,5]
value = 5030+var(10)*10000

[State Anim for HIT_UP/HIT_DIAGUP (only if it exists)]
type = ChangeAnim
trigger1 = time = 0
trigger1 =(gethitvar(animtype)=[4,5])&&(selfanimexist(5047+gethitvar(animtype)))
value = 5047+gethitvar(animtype)+var(10)*10000

[State Freeze anim]
type = ChangeAnim
trigger1 = time > 0
value = anim

[State 5010]
type = ChangeState
trigger1 = hitshakeover
trigger1 = gethitvar(yvel) = 0
value = 5011

[State 5010]
type = ChangeState
trigger1 = hitshakeover
value = 5030

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

[State vel]
type = HitVelSet
trigger1 = time = 0
x = 1

[State 5011]
type = ChangeAnim
trigger1 = animtime = 0
value = 5025+gethitvar(animtype)+var(10)*10000

[State Stop sliding back]
type = velmul
trigger1 = time >= gethitvar(slidetime)
x = .6

[State vel]
type = velset
trigger1 = hitover
x = 0

[State defence]
type = DefenceMulSet
trigger1 = hitover
value = 1

[State end]
type = ChangeState
trigger1 = hitover
value = 11
ctrl = 1

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

[State Anim for HIT_LIGHT to HIT_HARD]
type = ChangeAnim
trigger1 = time = 0
trigger1 = gethitvar(animtype)!= [3,5]
value = ifelse((gethitvar(airtype)=1),5000,5010)+gethitvar(animtype)+var(10)*10000

[State Anim for HIT_BACK]
type = ChangeAnim
trigger1 = time = 0
trigger1 = gethitvar(animtype) = [3,5]
value = 5030+var(10)*10000

[State Anim for HIT_UP/HIT_DIAGUP (only if it exists)]
type = ChangeAnim
trigger1 = time = 0
trigger1 =(gethitvar(animtype)=[4,5])&&(selfanimexist(5047+var(10)*10000+gethitvar(animtype)))
value = 5047+gethitvar(animtype)+var(10)*10000

[State Freeze anim]
type = ChangeAnim
trigger1 = time > 0
value = anim

[State 5020]
type = ChangeState
trigger1 = hitshakeover
value = 5030

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

[State vel]
type = veladd
trigger1 = 1
y = gethitvar(yaccel)

[State hit]
type = HitVelSet
trigger1 = time = 0
x = 1
y = 1

[State HITA_RECOV]
type = ChangeState
triggerall =!hitfall
trigger1 = hitover
trigger2 = vel y > 0 && pos y >= 10
value = 5040

[State HITA_FALL]
type = ChangeState
triggerall = hitfall
trigger1 = hitover
trigger2 = vel y > 0 && pos y >= 10
value = 5050

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

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

[State 5035]
type = ChangeAnim
trigger1 = time = 0
trigger1 = selfanimexist(5035+var(10)*10000)
trigger1 = anim!=[5051+var(10)*10000,5059+var(10)*10000] ;Not if in hit up anim
trigger1 = anim!= 5090+var(10)*10000 ;Not if hit off ground anim
value = 5035+var(10)*10000

[State vel]
type = veladd
trigger1 = 1
y = gethitvar(yaccel)

[State HITA_RECOV]
type = ChangeState
triggerall =!HitFall
trigger1 = hitover
trigger2 = animtime = 0
trigger3 = vel y > 0 && pos y >= 10
trigger4 = time = 0    ;No transition anim
trigger4 = anim!= 5035+var(10)*10000
value = 5040

[State HITA_FALL]
type = ChangeState
triggerall = HitFall
trigger1 = hitover
trigger2 = animtime = 0
trigger3 = vel y > 0 && pos y >= 10
trigger4 = time = 0    ;No transition anim
trigger4 = anim!= 5035+var(10)*10000
value = 5050

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

[State 5040]
type = ChangeState
trigger1 =!alive
value = 5050

[State 5040]
type = ChangeAnim
trigger1 = animtime = 0
trigger1 = anim!= 5040+var(10)*10000
trigger2 = time = 0
trigger2 = anim!= 5035+var(10)*10000
value = 5040+var(10)*10000

[State ctrl]
type = ctrlset
trigger1 = hitover
value = 1

[State 5040]
type = StateTypeSet
trigger1 = hitover
movetype = I

[State vel]
type = veladd
trigger1 = 1
y = gethitvar(yaccel)

[State land]
type = ChangeState
trigger1 = vel y > 0 && pos y >= 0
value = 52

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

[State Change anim when done with transition]
type = ChangeAnim
trigger1 = animtime = 0
trigger1 = anim = 5035+var(10)*10000
trigger2 = time = 0 ;If no transition anim
trigger2 = anim!= 5035+var(10)*10000
trigger2 =(anim!=[5051+var(10)*10000,5059+var(10)*10000])&&(anim!=[5061+var(10)*10000,5069+var(10)*10000])
trigger2 = anim!= 5090+var(10)*10000 ;Not if hit off ground anim
value = 5050+var(10)*10000

[State Coming down anim]
type = ChangeAnim
trigger1 = anim = [5050+var(10)*10000,5059+var(10)*10000]
trigger1 = vel y >= ifelse(anim=5050+var(10)*10000,1,-2)
trigger1 = selfanimexist(anim+10)
value = anim+10
persistent = 0

[State vel]
type = veladd
trigger1 = 1
y = gethitvar(yaccel)

[State Recover]
type = ChangeState
triggerall = vel y > -1
triggerall = alive && canrecover
trigger1 = command = "recovery"
value = 5200

[State 5050]
type = ChangeState
trigger1 = vel y > 0
trigger1 = pos y >= ifelse((anim=[5051+var(10)*10000,5059+var(10)*10000])||(anim=[5061+var(10)*10000,5069+var(10)*10000]),0,25)
value = 5100

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

[State anim]
type = ChangeAnim
trigger1 =!selfanimexist(5071)
value = 5070+var(10)*10000

[State anim]
type = ChangeAnim
trigger1 = selfanimexist(5071)
value = ifelse((gethitvar(animtype)=4),5071,5070)+var(10)*10000

[State 5070]
type = ChangeState
trigger1 = hitshakeover
value = 5071

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

[State vel]
type = HitVelSet
trigger1 = time = 0
x = 1
y = 1

[State Acceleration]
type = veladd
trigger1 = 1
y = gethitvar(yaccel)

[State anim]
type = ChangeAnim
trigger1 = anim = 5071+var(10)*10000
trigger1 = selfanimexist(5071)
trigger1 = pos y >= 15 && vel y > 0
value = 5161+var(10)*10000

[State Hit ground]
type = ChangeState
trigger1 = pos y >= 15 && vel y > 0
value = 5110

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

[State Set default anim]
type = varset
trigger1 = time = 0
sysvar(2) = ifelse(gethitvar(yvel)=0,5080,5090)

[State var]
type = varadd
trigger1 = time = 0
trigger1 =(anim = [5081,5089])||(anim = [5111,5119])
trigger1 = selfanimexist(sysvar(2)+(anim%10))
sysvar(2) = anim%10

[State If 5090 doesn't exist, default to 5030]
type = varset
trigger1 = time = 0
trigger1 = sysvar(2) = 5090
trigger1 = !selfanimexist(5090)
sysvar(2) = 5030

[State Freeze]
type = ChangeAnim
trigger1 = 1
value = sysvar(2)+var(10)*10000

[State HITL_SLIDE]
type = ChangeState
trigger1 = hitshakeover
trigger1 = gethitvar(yvel) = 0
value = 5081

[State HITA_UP]
type = ChangeState
trigger1 = hitshakeover
trigger1 = gethitvar(yvel)!= 0
value = 5090

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

[State vel]
type = hitvelset
trigger1 = time = 0
x = 1

[State vel]
type = velset
trigger1 = hitover
x = 0

[State Don't show hit ground frame]
type = varset
trigger1 = time = 0
sysvar(0) = 1

[State HIT_LIEDOWN]
type = ChangeState
trigger1 = hitover
value = 5110

;---------------------------------------------------------------------------
; LieDown Hit (hit up into air)
[Statedef 5090]
type = A
movetype = H
physics = N
ctrl = 0

[State vel]
type = veladd
trigger1 = 1
y = gethitvar(yaccel)

[State hit]
type = HitVelSet
trigger1 = time = 0
x = 1
y = 1

[State Recover]
type = null;ChangeState
triggerall = vel y > -1
triggerall = alive && canrecover
trigger1 = command = "recovery"
value = 5200

[State 5090]
type = ChangeState
trigger1 = pos y >= 25 && vel y > 0
value = 5100

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

[State vel]
type = velset
trigger1 = time = 0
trigger1 = gethitvar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State EnvShake]
type = FallEnvShake
trigger1 = time = 0

[State Save fall velocity]
type = varset
trigger1 = time = 0
;trigger1 = gethitvar(fall.yvel) = 0
sysvar(1) = floor(vel y)

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

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

[State pos]
type = posset
trigger1 = time = 0
y = 0
[State vel]
type = velset
trigger1 = time = 0
y = 0

[State Reduce speed]
type = velmul
trigger1 = time = 0
x = .75

[State 5100]
type = ChangeState
trigger1 = time = 0
trigger1 = gethitvar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

[State explod]
type = Explod
trigger1 = time = 1
anim = f60+(sysvar(1)>5)+(sysvar(1)>14)
sprpriority = -6+(sysvar(1)>14)*12
ownpal = 1

[State 5100]
type = HitFallDamage
trigger1 = time = 3

[State snd]
type = PlaySnd
trigger1 = time = 1
value = f7,(sysvar(1)>5)+(sysvar(1)>14)

[State pos]
type = PosFreeze
trigger1 = 1

[State 5100]
type = ChangeState
trigger1 = animtime = 0
value = 5101

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

[State Coming hit ground anim (normal)]
type = ChangeAnim
triggerall = time = 0
trigger1 = anim!= [5101+var(10)*10000,5109+var(10)*10000]
trigger2 =!selfanimexist(5160+(anim%10)+var(10)*10000)
value = 5160+var(10)*10000

[State Coming hit ground anim (for hit up)]
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101+var(10)*10000,5109+var(10)*10000]
trigger1 = selfanimexist(5160+(anim%10)+var(10)*10000)
value = 5160+(anim%10)+var(10)*10000

[State 5101]
type = HitFallVel
trigger1 = time = 0

[State pos]
type = posset
trigger1 = time = 0
y = 20

[State Acceleration]
type = veladd
trigger1 = 1
y = .5

[State Hit ground]
type = ChangeState
trigger1 = vel y > 0 && pos y >= 10
value = 5110

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

[State EnvShake]
type = FallEnvShake
trigger1 = time = 0

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

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

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

[State 5110]
type = HitFallDamage
trigger1 = time = 0

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

[State Get fall velocity]
type = varset
trigger1 = time = 0
trigger1 = gethitvar(fall.yvel)!= 0
sysvar(1) = floor(vel y)

[State explod]
type = Explod
trigger1 = time = 0
trigger1 =!sysvar(0)
anim = f60+(sysvar(1)>5)+(sysvar(1)>14)
sprpriority = -6+(sysvar(1)>14)*12
ownpal = 1

[State snd]
type = PlaySnd
trigger1 = time = 0
trigger1 =!sysvar(0)
value = f7,(sysvar(1)>5)+(sysvar(1)>14)

[State vel]
type = velset
trigger1 = time = 0
y = 0

[State For hit up type]
type = ChangeAnim
triggerall = anim = [5171+var(10)*10000,5179+var(10)*10000]
triggerall = selfanimexist(5110+(anim%10)+var(10)*10000)
trigger1 = animtime = 0
trigger2 = sysvar(0) ;sysvar(0) = 1 avoids hit ground anim
value = 5110+(anim%10)+var(10)*10000
persistent = 0

[State For normal]
type = ChangeAnim
triggerall = anim!= [5111+var(10)*10000,5119+var(10)*10000]
trigger1 = animtime = 0
trigger2 = sysvar(0) ;sysvar(0) = 1 avoids hit ground frame
value = 5110+var(10)*10000
persistent = 0

[State If just died]
type = ChangeState
triggerall =!alive
trigger1 = animtime = 0
trigger2 = sysvar(0) ;sysvar(0) = 1 avoids hit ground frame
trigger3 = anim = [5110+var(10)*10000,5119+var(10)*10000]
value = 5150

[State var]
type = varset
trigger1 = sysvar(0)
trigger1 = time = 0
sysvar(0) = 0

[State Friction]
type = velmul
trigger1 = 1
x = .85

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

[State Get up anim (normal)]
type = ChangeAnim
triggerall = time = 0
trigger1 = anim!= [5111+var(10)*10000,5119+var(10)*10000]
trigger2 =!selfanimexist(5120+(anim%10)+var(10)*10000)
value = 5120+var(10)*10000

[State Get up anim (for hit up/diag-up)]
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111+var(10)*10000,5119+var(10)*10000]
trigger1 = selfanimexist(5120+(anim%10)+var(10)*10000)
value = 5120+(anim%10)+var(10)*10000

[State vel]
type = velset
trigger1 = time = 0
x = 0

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

[State 5120]
type = HitFallSet
trigger1 = animtime = 0
value = 1

[State Can't be thrown right after getting up]
type = NotHitBy
trigger1 = animtime = 0
value = ,NT,ST
time = 1
[State Can't be hit right after getting up (short time)]
type = NotHitBy
trigger1 = animtime = 0
value2 = SCA
time = 1

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

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

[State Normal anim]
type = null;ChangeAnim
triggerall = enemy,var(50) = 0
triggerall = time = 0
triggerall = selfanimexist(5140+var(10)*10000)
trigger1 =(anim!=[5111+var(10)*10000,5119+var(10)*10000])&&(anim!=[5171+var(10)*10000,5179+var(10)*10000])
trigger2 =!selfanimexist(5140+(anim%10)+var(10)*10000)
value = 5140+var(10)*10000

[State Hit up type anim]
type = ChangeAnim
trigger1 = enemy,var(50) = 0
trigger1 = time = 0
;trigger1 =(anim=[5111+var(10)*10000,5119+var(10)*10000])||(anim=[5171+var(10)*10000,5179+var(10)*10000])
trigger1 = selfanimexist(5140+(anim%10)+var(10)*10000)
value = 5140+(anim%10)+var(10)*10000

[State Match over anim]
type = ChangeAnim
trigger1 = enemy,var(50) >= 1
trigger1 = time = 0
;trigger1 = matchover = 1
trigger1 = anim = [5140+var(10)*10000,5149+var(10)*10000]
trigger1 = selfanimexist(anim+10)
value = anim+10
persistent = 0

[State Switch to 5110 if liedead anim does not exist]
type = null;ChangeAnim
trigger1 = time = 0
trigger1 = anim!= [5140+var(10)*10000,5159+var(10)*10000]
trigger1 = anim!= [5110+var(10)*10000,5119+var(10)*10000]
value = 5110+var(10)*10000

[State Friction]
type = velmul
trigger1 = 1
x = .85

[State Friction]
type = velset
trigger1 = vel x < .05
x = 0
persistent = 0

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

;---------------------------------------------------------------------------
; Hit_fallrecover (still falling)
[Statedef 5200]
type = A
movetype = H
physics = N

[State Recover in mid air]
type = ChangeState
trigger1 = pos y < -10;&& vel y > -1
value = 5210

[State Change anim if done with transition]
type = ChangeAnim
trigger1 = anim = 5035+var(10)*10000
trigger1 = animtime = 0
value = 5050+var(10)*10000

[State vel]
type = veladd
trigger1 = 1
y = gethitvar(yaccel)

[State Recover near ground]
type = SelfState
trigger1 = selfanimexist(5200)
trigger1 = pos y >= 10 && vel y > 0
value = 5201

;---------------------------------------------------------------------------
; Hit_fallrecover (on the ground)
[Statedef 5201]
type = S
movetype = I
physics = S
anim = 5200+var(10)*10000
facep2 = 1

[State Turn if not facing opponent]
type = turn
trigger1 = time = 0
trigger1 = p2dist x < -5

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

[State pos]
type = posset
trigger1 = 1
y = 0

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

[State Blink white]
type = PalFX
trigger1 = time = 0
time = 8
add = 128,128,128
sinadd = -128,-128,-128,32

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

;---------------------------------------------------------------------------
; Hit_Airfallrecover
[Statedef 5210]
type = A
movetype = I
physics = N
anim = 5210+var(10)*10000
ctrl = 0

[State Blink white]
type = PalFX
trigger1 = time = 0
time = 8
add = 128,128,128
sinadd = -128,-128,-128,32

[State pos]
type = PosFreeze
trigger1 = time = 0
value = 4

[State Turn if not facing opponent]
type = turn
trigger1 = time = 0
trigger1 = p2dist x < -20

[State vel]
type = velset
trigger1 = time = 4
y = const(velocity.jump.y)*.25

[State vel]
type = velmul
trigger1 = time = 4
x = .8
y = .8

[State vel]
type = veladd
trigger1 = time = 4
y = -4.5

[State vel]
type = velmul
trigger1 = time = 4
trigger1 = vel y > 0
y = .5

[State vel]
type = veladd
trigger1 = time = 4
trigger1 = vel y > -3
y = -2

[State vel]
type = veladd
trigger1 = time = 4
trigger1 = vel y > -2
y = -1

[State Go up]
type = veladd
trigger1 = time = 4
trigger1 = command = "holdup"
y = -2
[State Go down]
type = veladd
trigger1 = time = 4
trigger1 = command = "holddown"
y = 1.5
[State Go fwd]
type = velmul
trigger1 = time = 4
trigger1 = command = "holdfwd"
x = 1
[State Go back]
type = veladd
trigger1 = time = 4
trigger1 = command = "holdback"
x = -1

[State hit]
type = NotHitBy
trigger1 = time = 0
value = SCA
time = 8

[State ctrl]
type = ctrlset
trigger1 = time = 20
value = 1

[State vel]
type = veladd
trigger1 = time >= 4
y = const(movement.yaccel)

[State Land on ground]
type = ChangeState
trigger1 = time >= 4
trigger1 = pos y >= 0 && vel y > 0
value = 52
ctrl = 1

;---------------------------------------------------------------------------
; Continue?
[Statedef 5500]
type = S
anim = 5300
velset = 0,0
ctrl = 0

[State 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 Clear all int variables]
type = null;VarRangeSet
trigger1 = roundno = 1
value = 0
[State Clear all float variables]
type = null;VarRangeSet
trigger1 = roundno = 1
fvalue = 0

[State 5900]
type = ChangeState
trigger1 = roundsexisted = 0
trigger1 = teammode = turns
trigger1 = roundno >= 2
value = 5901
[State Intro]
type = ChangeState
trigger1 = roundno = 1
value = 190

[Statedef 5901]
type = S
physics = N
anim = 42+var(10)*10000
velset = 6,-4

[State 5901]
type = AssertSpecial
trigger1 = 1
flag = intro
[State 5901]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State pos]
type = posadd
trigger1 = time = 0
x = -150
y = -60

[State snd]
type = PlaySnd
trigger1 = time = 0
value = 40,0

[State anim]
type = ChangeAnim
trigger1 = time < 25
trigger1 = vel y > -2
trigger1 = selfanimexist(anim+3)
value = anim+3
persistent = 0
[State vel]
type = veladd
trigger1 = time < 25
y = .50

[State anim]
type = ChangeAnim
trigger1 = time = 25
value = 47+var(10)*10000
[State vel]
type = velset
trigger1 = time = 25
x = 0
y = 0
[State pos]
type = posset
trigger1 = time = 25
y = 0

[State end]
type = null;ChangeState
trigger1 = animtime = 0
value = 190


;------------------------------------------------------------------
; Valiable Attack (start)
[Statedef 5600]
type = S
movetype = I
physics = S
anim = 195+var(10)*10000
velset = 0,0
ctrl = 0

[State hit]
type = NotHitBy
trigger1 = 1
value = SCA
[State 5601]
type = PlayerPush
trigger1 = 1
value = 0

[State end]
type = ChangeState
trigger1 = animtime = 0
value = 5601

; Valiable Attack (backwards)
[Statedef 5601]
type = A
movetype = I
physics = N
anim = 40+var(10)*10000
velset = 0,0
ctrl = 0

[State hit]
type = NotHitBy
trigger1 = 1
value = SCA
[State 5601]
type = PlayerPush
trigger1 = 1
value = 0
[State 5601]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
ignorehitpause = 1

[State 5601]
type = ChangeAnim
trigger1 = anim = 40+var(10)*10000 && animtime = 0
value = ifelse(BackEdgeBodyDist<160,43,42)+var(10)*10000

[State vel]
type = velset
trigger1 = anim = [41+var(10)*10000,43+var(10)*10000]
x = ifelse(anim=43+var(10)*10000,-16,16)
y = -7.6
persistent = 0

[State vel]
type = veladd
trigger1 = anim = [41+var(10)*10000,43+var(10)*10000]
y = .45

[State snd]
type = PlaySnd
trigger1 = anim = [41+var(10)*10000,43+var(10)*10000]
value = 40,0
persistent = 0

[State end]
type = ChangeState
trigger1 = time = 50
value = 5602

; Valiable Attack (wait)
[Statedef 5602]
type = A
physics = N
velset = 0,0
ctrl = 0

[State hit]
type = NotHitBy
trigger1 = 1
value = SCA
[State 5602]
type = PlayerPush
trigger1 = 1
value = 0
[State 5602]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
ignorehitpause = 1

[State 5602]
type = AssertSpecial
trigger1 = 1
flag = invisible

[State pos]
type = posset
trigger1 = 1
x = -160+partner,screenpos x
y = -220+partner,screenpos y

[State turn]
type = turn
trigger1 = facing!= partner,facing

[State life]
type = lifeadd
trigger1 = timemod = 10,0
value = 1

[State 5602]
type = ChangeState
trigger1 = partner,alive = 0
trigger1 = partner,stateno = [5110,5150]
trigger2 = roundstate >= 3
trigger3 = partner,stateno = [5600,5601]

trigger4 = command = "qcf_s"
trigger4 =(partner,stateno = [2000,2999])|| partner,stateno = [2000+var(10)*10000,2999+var(10)*10000]
trigger5 = command = "qcb_s"
trigger5 = partner,stateno = [150,155]
value = 5603

; Valiable Attack (forwards)
[Statedef 5603]
type = A
physics = N
anim = 42+var(10)*10000
velset = ifelse((partner,stateno=[5600,5602]),6,4),-4
ctrl = 0

[State 5603]
type = varset
trigger1 = roundstate < 3
var(40) = 1

[State hit]
type = NotHitBy
trigger1 = roundstate >= 3
value = SCA
[State 5603]
type = PlayerPush
trigger1 = 1
value = 0
[State 5603]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
ignorehitpause = 1

[State pos]
type = posset
trigger1 = time = 0
x = ifelse(facing=-1,180,-180)
y = -60

[State snd]
type = PlaySnd
trigger1 = time = 0
value = 40,0
persistent = 0

[State 5603]
type = ChangeAnim
trigger1 = anim = 42+var(10)*10000
trigger1 = vel y > -2
value = anim+3
persistent = 0

[State vel]
type = veladd
trigger1 = anim = [41+var(10)*10000,46+var(10)*10000]
y = .45

[State land]
type = ChangeState
trigger1 = pos y >= 0 && vel y > 0
value = ifelse((partner,stateno=[5600,5601]),5604,52)

; Valiable Attack (end)
[Statedef 5604]
type = S
movetype = I
physics = S
anim = 47+var(10)*10000
velset = 0,0
ctrl = 0

[State pos]
type = posset
trigger1 = 1
y = 0

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

;------------------------------------------------------------------
[Statedef -3]

;------------------------------------------------------------------
; Valiable Attack
[State 5900]
type = varset
trigger1 = stateno = 5900 && roundsexisted = 0
var(40) = 0
persistent = 0
[State -3]
type = varset
trigger1 = command = "s"
trigger1 = numpartner = 1 && roundstate = [0,1]
var(40) = 1
[State -3]
type = varset
trigger1 = numpartner = 1
trigger1 = partner,var(40) = 1
var(40) = 2
ignorehitpause = 1

[State Partner]
type = ChangeState
trigger1 = var(40) = 1
trigger1 = command = "s"
trigger1 = numpartner = 1 && roundstate < 3
trigger1 = alive = 1 && partner,alive = 1
trigger1 = partner,stateno = 5602
trigger1 = statetype!= A && ctrl
value = 5600

[State -3]
type = ChangeState
trigger1 = var(40) = 2
trigger1 = numpartner = 1 && roundstate < 3
trigger1 = alive = 1 && partner,alive = 1
trigger1 = stateno!= [5600,5609]
trigger1 = partner,stateno!= [5600,5609]
trigger1 = statetype!= A && ctrl
value = 5601

;------------------------------------------------------------------
[State P2orP4]
type = null;varset
trigger1 = roundstate = [0,1]
var(48) = ifelse(BackEdgeBodyDist<75,1,0)

[State target]
type = null;varset
trigger1 = numtarget >= 1
var(49) = target,ID
ignorehitpause = 1

[State var]
type = varset
trigger1 = teammode = turns
trigger2 = enemy,teammode = turns
var(50) = -1

[State var]
type = varset
trigger1 = var(50) >= 0
trigger1 = roundsexisted = 0
var(50) = 0
[State var]
type = null;varadd
trigger1 = var(50) = 0 && win = 1
trigger1 = numpartner = 0 && numenemy = 1
trigger1 = roundstate = 4
trigger2 = var(50) >= 1 && win = 1
trigger2 = roundstate = 3
var(50) = 1
persistent = 0
ignorehitpause = 1

[State CPU]
type = varset
trigger1 = ishometeam = 1 && teamside = 2
var(59) = 1

;------------------------------------------------------------------
[State -3]
type = AssertSpecial
trigger1 = roundstate!= 2
flag = nobardisplay
ignorehitpause = 1

[State image]
type = AfterImageTime
trigger1 = movetype = H
time = 0

[State snd]
type = null;StopSnd
trigger1 = movetype = H && stateno!= [120,155]
channel = 0

[State hit]
type = MoveHitReset
trigger1 = movetype!= A
