; Common State file for M.U.G.E.N beta 2002.04.14
;===========================================================================
;计分系统20070602
;===========================================================================
;---------------------------------------------------------------------------
; Stand 站立基本姿势
;---------------------------------------------------------------------------
[Statedef 0]
type = S
physics = S
sprpriority = 0

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

[State 0, 2]
type = VelSet
trigger1 = Time = 0
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, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050
;---------------------------------------------------------------------------
; Stand to Crouch
;---------------------------------------------------------------------------
[Statedef 10]
type = C
physics = C
anim = 10

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

[State 0]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
;---------------------------------------------------------------------------
; Crouching
;---------------------------------------------------------------------------
[Statedef 11]
type = C
physics = C
anim = 11
sprpriority = 0

[State 0] ;Change from turning animation
type = ChangeAnim
trigger1 = Anim = 6 && AnimTime = 0
value = 11

[State 0]
type = CtrlSet
trigger1 = var(51) = 1 && !Ctrl
trigger1 = time > 20
value = 1
;---------------------------------------------------------------------------
; Crouch to Stand
;---------------------------------------------------------------------------
[Statedef 12]
type = S
physics = S
anim = 12

[State 0]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
;---------------------------------------------------------------------------
; Walk
;---------------------------------------------------------------------------
[Statedef 20]
type = S
physics = S
sprpriority = 0

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

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

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

[State 0]
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, 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
;---------------------------------------------------------------------------
; AirJump Start
;---------------------------------------------------------------------------
[Statedef 45]
type    = A
physics = N
ctrl = 3
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 0]
type = VelSet
trigger1 = Time = 0
x = const(velocity.run.back.x)
y = const(velocity.run.back.y)

[State 0]
type = PlaySnd
trigger1 = Time = 0
value = F50, 0
channel = 1

[State 0]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52
;--------------------------------------------------------------
; 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
ctrl = 0

[State 0]
	type = ChangeAnim
	trigger1 = Time = 0
	value = 110

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

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

[State 0]
	type = VelMul
	trigger1 = 1
	z = 0.8

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

[State 0]
	type = ChangeState
	trigger1 = AnimTime = 0
	value = 0
	ctrl = 1
;---------------------------------------------------------------------------
; RUN_DOWN
;---------------------------------------------------------------------------
[Statedef 115]
type = S
physics = N
ctrl = 0

[State 0]
	type = ChangeAnim
	trigger1 = Time = 0
	value = 110

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

[State 0]
	type = VelSet
	trigger1 = Time = 0
	x = 0
	z = 7

[State 0]
	type = VelMul
	trigger1 = 1
	z = 0.8

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

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

[State 0]
	type = ChangeAnim
	trigger1 = Time = 0
	value = 120 + (Statetype = C) + (Statetype = A) * 2

[State 0]
	type = StateTypeSet
	trigger1 = Time = 0 && Statetype = S
	physics = S

[State 0]
	type = StateTypeSet
	trigger1 = Time = 0 && Statetype = C
	physics = C

[State 0]
	type = StateTypeSet
	trigger1 = Time = 0 && Statetype = A
	physics = A

[State 0]
	type = StateTypeSet
	trigger1 = Statetype = S && command = "holddown"
	Statetype = C
	physics = C

[State 0]
	type = StateTypeSet
	trigger1 = Statetype = C && command != "holddown"
	Statetype = S
	physics = S

[State 0]
	type = ChangeState
	trigger1 = AnimTime = 0
	value = 130 + (Statetype = C) + (Statetype = A)*2

[State 0]
	type = ChangeState
	trigger1 = command != "holdback"
	trigger2 = !inguarddist
	value = 140

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

[State 0]
	type = ChangeAnim
	trigger1 = Anim != 130
	value = 130

[State 0]
	type = ChangeState
	trigger1 = command = "holddown"
	value = 131

[State 0]
	type = ChangeState
	trigger1 = command != "holdback"
	trigger2 = !inguarddist
	value = 140

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

[State 0]
	type = ChangeAnim
	trigger1 = Anim != 131
	value = 131

[State 0]
	type = ChangeState
	trigger1 = command != "holddown"
	value = 130

[State 0]
	type = ChangeState
	trigger1 = command != "holdback"
	trigger2 = !inguarddist
	value = 140

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

[State 0]
	type = ChangeAnim
	trigger1 = Anim != 132
	value = 132

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

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

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

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

[State 0]
	type = ChangeState
	trigger1 = sysvar(0)
	trigger1 = command = "holdback"
	trigger1 = inguarddist
	value = 130

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

[State 0]
	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 0]
	type = ChangeAnim
	trigger1 = Time = 0
	value = 140 + (Statetype = C) + (Statetype = A) * 2

[State 0]
	type = StateTypeSet
	trigger1 = Time = 0 && Statetype = S
	physics = S

[State 0]
	type = StateTypeSet
	trigger1 = Time = 0 && Statetype = C
	physics = C

[State 0]
	type = StateTypeSet
	trigger1 = Time = 0 && Statetype = A
	physics = A

[State 0]
	type = StateTypeSet
	trigger1 = Statetype = S && command = "holddown"
	Statetype = C
	physics = C

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

;---------------------------------------------------------------------------
; STAND GUARD HIT (shaking/get hit)
[Statedef 150]
type = S
movetype = H
physics = N
velset = 0,0

[State 0]
	type = ChangeAnim
	trigger1 = 1
	value = 150

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

[State 0]
	type = StateTypeSet
	trigger1 = Statetype = S && command = "holddown"
	Statetype = C
	physics = C

[State 0]
	type = StateTypeSet
	trigger1 = Statetype = C && command != "holddown"
	Statetype = S
	physics = S

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


;options
;-------------------------------------
;防御破坏 (GUARD CRUSH)
;-------------------------------------
[State 0]
type = PalFx
triggerall = GameTime%10 = 1
trigger1 = NumHelper(90900)
trigger1 = Helper(90900),var(36) >= 25
trigger2 = NumHelper(90901)
trigger2 = Helper(90901),var(36) >= 25
trigger3 = NumHelper(90902)
trigger3 = Helper(90902),var(36) >= 25
time = 2
add = 200, 0, 0

[State 0]
type = ChangeState
triggerall = Alive
trigger1 = NumHelper(90900)
trigger1 = Helper(90900), var(36) >= 31
trigger2 = NumHelper(90901)
trigger2 = Helper(90901), var(36) >= 31
trigger3 = NumHelper(90902)
trigger3 = Helper(90902), var(36) >= 31
IgnoreHitPause = 1
value = 190010
;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
type = S
movetype = H
physics = S
anim = 150

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

[State 0]
	type = VelSet
	trigger1 = Time = GetHitVar(slidetime)
	trigger2 = HitOver
	x = 0

[State 0]
	type = VelSet
	trigger1 = NumExplod(1196150)
	x = 0

[State 0]
	type = CtrlSet
	trigger1 = Time >= GetHitVar(CtrlTime) * Ifelse(NumExplod(1196150), 0.50, 1)
	value = 1

[State 0]
	type = StateTypeSet
	trigger1 = Statetype = S && command = "holddown"
	Statetype = C
	physics = C

[State 0]
	type = StateTypeSet
	trigger1 = Statetype = C && command != "holddown"
	Statetype = S
	physics = S

[State 0]
	type = ChangeState
	trigger1 = HitOver
	value = 130
	ctrl = 1


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

[State 0]
	type = ChangeAnim
	trigger1 = 1
	value = 151

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

[State 0]
	type = StateTypeSet
	trigger1 = Statetype = S && command = "holddown"
	Statetype = C
	physics = C

[State 0]
	type = StateTypeSet
	trigger1 = Statetype = C && command != "holddown"
	Statetype = S
	physics = S

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

;options
;-------------------------------------
;防御破坏 (GUARD CRUSH)
;-------------------------------------
[State 0]
type = PalFx
triggerall = GameTime%10 = 1
trigger1 = NumHelper(90900)
trigger1 = Helper(90900),var(36) >= 25
trigger2 = NumHelper(90901)
trigger2 = Helper(90901),var(36) >= 25
trigger3 = NumHelper(90902)
trigger3 = Helper(90902),var(36) >= 25
time = 2
add = 200, 0, 0

[State 0]
type = ChangeState
triggerall = Alive
trigger1 = NumHelper(90900)
trigger1 = Helper(90900), var(36) >= 31
trigger2 = NumHelper(90901)
trigger2 = Helper(90901), var(36) >= 31
trigger3 = NumHelper(90902)
trigger3 = Helper(90902), var(36) >= 31
IgnoreHitPause = 1
value = 190010

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

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

[State 0]
	type = VelSet
	trigger1 = Time = GetHitVar(slidetime)
	trigger2 = HitOver
	x = 0

[State 0]
	type = CtrlSet
	trigger1 = Time >= GetHitVar(CtrlTime)
	value = 1

[State 0]
	type = StateTypeSet
	trigger1 = Statetype = S && command = "holddown"
	Statetype = C
	physics = C

[State 0]
	type = StateTypeSet
	trigger1 = Statetype = C && command != "holddown"
	Statetype = S
	physics = S

[State 0]
	type = ChangeState
	trigger1 = HitOver
	value = 131
	ctrl = 1
;---------------------------------------------------------------------------
; AGUARDHIT (shaking)
[Statedef 154]
type = A
movetype = H
physics = N
velset = 0,0

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

[State 0]
	type = ChangeState
	trigger1 = HitShakeOver
	value = 155 ;AGUARDHIT2

[State 0]
	type = ForceFeedback
	trigger1 = time = 0
	waveform = square
	time = 4
;---------------------------------------------------------------------------
; AGUARDHIT2 (knocked away)
[Statedef 155]
type = A
movetype = H
physics = N
anim = 152

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

[State 0]
	type = VelAdd
	trigger1 = !NumExplod(1196150)
	y = Const(movement.yaccel)

[State 0]
	type = NotHitBy
	trigger1 = NumExplod(1196150)
	value = SCA

[State 0]
	type = velset
	trigger1 = NumExplod(1196150)
	trigger1 = Time >= GetHitVar(CtrlTime) * 0.5
	x = -2
	y = -4

[State 0]
	type = PosFreeze
	trigger1 = NumExplod(1196150)
	trigger1 = Time <= GetHitVar(CtrlTime) * 0.5

[State 0]
	type = ChangeState
	trigger1 = NumExplod(1196150)
	trigger1 = Time >= GetHitVar(CtrlTime) * 0.5
	value = 140
	IgnoreHitPause = 1

[State 0]
	type = CtrlSet
	trigger1 = Time >= GetHitVar(CtrlTime)
	value = 1

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

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

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

[State 0]
	type = ChangeState
	trigger1 = sysvar(0)
	trigger1 = command = "holdback"
	trigger1 = inguarddist
	value = 130

[State 0]
	type = ChangeState
	trigger1 = sysvar(0)
	value = 52
;---------------------------------------------------------------------------
; LOSE (Time over)
;---------------------------------------------------------------------------
[Statedef 170]
type = S
ctrl = 0
anim = Ifelse(SelfAnimExist(170), 170, 175)
velset = 0,0

[State 0]
	type = NotHitBy
	trigger1 = 1
	value = SCA
	time = 1
;---------------------------------------------------------------------------
; DRAWGAME (Time over)
;---------------------------------------------------------------------------
[Statedef 175]
type = S
ctrl = 0
velset = 0,0

[State 0]
	type = ChangeState
	trigger1 = Time = 0
	trigger1 = !SelfAnimExist(175)
	value = 170

[State 0]
	type = ChangeAnim
	trigger1 = Time = 0
	value = 175

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

[State 0] ;Anim for HIT_BACK
	type = ChangeAnim
	trigger1 = Time = 0
	trigger1 = GetHitVar(animtype) = [3,5]
	value = 5030

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

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

[State 0] ;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 0]
	type = ChangeState
	trigger1 = HitShakeOver
	trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
	value = 5001 ;HITG_SLIDE

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

;----------------
; 夋柺怳摦
[State 0]
	Type = EnvShake
	trigger1 = time = 0
	time = 3
	freq = 90
	ampl = Ifelse((Enemy,HitDefAttr=SCA,HA,HP,HT), 3, Ifelse((Enemy,HitDefAttr=SCA,NA,NP,NT), 0, 2))
	phase = 4
;---------------------------------------------------------------------------
; 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

[State 5001, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5001, 4]
type = VelSet
trigger1 = HitOver
x = 0

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

[State 0] ;Anim for HIT_BACK
	type = ChangeAnim
	trigger1 = Time = 0
	trigger1 = GetHitVar(animtype) = [3,5]
	value = 5030

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

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

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

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

;----------------
;----------------
; 夋柺怳摦
[State 0]
	Type = EnvShake
	trigger1 = time = 0
	time = 3
	freq = 90 ;; << shake_speed (0-180)
	ampl = Ifelse((Enemy,HitDefAttr=SCA,HA,HP,HT), 3, Ifelse((Enemy,HitDefAttr=SCA,NA,NP,NT), 0, 2))
	phase = 4 ;; << phase_offset

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

[State 5011, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5011, 4]
type = VelSet
trigger1 = HitOver
x = 0

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

[State 0] ;Anim for HIT_BACK
	type = ChangeAnim
	trigger1 = Time = 0
	trigger1 = GetHitVar(animtype) = [3,5]
	value = 5030

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

[State 0]
	type = ChangeAnim
	trigger1 = Time > 0
	value = anim

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

;----------------
; 夋柺怳摦
[State 0]
	Type = EnvShake
	trigger1 = time = 0
	time = 3
	freq = 90 ;; << shake_speed (0-180)
	ampl = Ifelse((Enemy,HitDefAttr=SCA,HA,HP,HT), 3, Ifelse((Enemy,HitDefAttr=SCA,NA,NP,NT), 0, 2))
	phase = 4 ;; << phase_offset

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

;----------------
; 夋柺怳摦
[State 0]
	Type = EnvShake
	trigger1 = time = 0
	time = 3
	freq = 90 ;; << shake_speed (0-180)
	ampl = Ifelse((Enemy,HitDefAttr=SCA,HA,HP,HT), 3, Ifelse((Enemy,HitDefAttr=SCA,NA,NP,NT), 0, 2))
	phase = 4 ;; << phase_offset
;---------------------------------------------------------------------------
; HITA_UP_T (transition)
[Statedef 5035]
type    = A
movetype= H
physics = N

[State 5035, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5035)
trigger1 = Anim != [5051,5059] ;Not if in hit up anim
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 5035

[State 5035, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5035, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Animation over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5040 ;HITA_RECOV

[State 5035, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Anim is over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5050 ;HITA_FALL

;---------------------------------------------------------------------------
; 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
trigger2 = Time = 0
trigger2 = Anim != 5035
value = 5040

[State 5040, 3]
type = CtrlSet
trigger1 = HitOver
value = 1

[State 5040, 4]
type = StateTypeSet
trigger1 = HitOver
movetype = I

[State 5040, 5]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5040, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMPLAND

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

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
value = 5050

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

[State 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5050, 4] ;Recover near ground
type = 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, 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 = 1
value = 5070

[State 5070, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 5071

[State 5070, 3]
type = ForceFeedback
trigger1 = time = 0
time = 12
waveform = sinesquare
ampl = 140

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

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

[State 0]
	type = FallEnvShake
	trigger1 = Time = 0

[State 0]
	type = VarSet
	trigger1 = Time = 0
	sysvar(1) = floor(vel y)

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

[State 0]
	type = ChangeAnim
	trigger1 = time = 0
	trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
	trigger1 = SelfAnimExist(5100 + (anim % 10))
	value = 5100 + (anim % 10)

[State 0]
	type = PosSet
	trigger1 = Time = 0
	y = 0

[State 0]
	type = VelSet
	trigger1 = Time = 0
	y = 0

[State 0]
	type = VelMul
	trigger1 = Time = 0
	x = 0.75

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

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

[State 0]
	type = HitFallDamage
	trigger1 = Time = 3

;--------
[State 0]
	type = PlaySnd
	trigger1 = Time = 1
;win.;	value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)
	value = F5000, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 183, 3]
type = EnvShake
trigger1 = time = 1
persistent = 0
ignorehitpause = 1
freq = 180
ampl = 4
phase = 160
time = 15

;[State 0]
;	type = EnvShake
;	trigger1 = Time = 1
;	time = 4
;	ampl = 3

[State 0]
	type = PosFreeze
	trigger1 = 1

[State 0]
	type = ChangeState
	trigger1 = AnimTime = 0
	value = 5101

[State 0]
	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 + (anim % 10)

[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, EnvShake]
	type = FallEnvShake
	trigger1 = Time = 0

[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)
;win.;	value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)
	value = F5000, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5110, addtion]
	type = EnvShake
	trigger1 = Time = 0
	time = 5
	ampl = 2

[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 0] ;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 0] ;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 0] ;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 0] ;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 0] ;Friction
	type = VelMul
	trigger1 = 1
	x = 0.85
[State 0] ;Friction
	type = VelSet
	trigger1 = Vel x < .05
	persistent = 0
	x = 0
[State 0]
	type = NotHitBy
	trigger1 = 1
	value = SCA
	time = 1

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

[State 5200, 1] ;Change anim if done with transition
type = ChangeAnim
trigger1 = Anim = 5035
trigger1 = AnimTime = 0
value = 5050

[State 5200, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5200, 3]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 10
value = 5201

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

[State 5201, 1] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -5

[State 5201, 2]
type = VelSet
trigger1 = Time = 0
x = -.15
y = -3.5

[State 5201, 3]
type = PosSet
trigger1 = Time = 0
y = 0

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

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

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

;---------------------------------------------------------------------------
; HIT_AIRFALLRECOVER
[Statedef 5210]
type    = A
movetype= I
physics = N
anim = 5210
ctrl = 0

[State 5210, 1] ;Blink white
type = PalFX
trigger1 = Time = 0
time = 3
add = 128,128,128 ;256,256,256

[State 5210, 1]
type = PosFreeze
trigger1 = Time = 0
value = 4

[State 5210, 2] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -20

[State 5210, 1] 
type = VelMul
trigger1 = Time = 4
x = .8
y = .8

[State 5210, 1]
type = VelAdd
trigger1 = Time = 4
y = -4.5

[State 5210, 1] 
type = VelMul
trigger1 = Time = 4
trigger1 = Vel Y > 0
y = .5

[State 5210, 1]
type = VelAdd
trigger1 = Time = 4
trigger1 = Vel Y > -3
y = -2

[State 5210, 1]
type = VelAdd
trigger1 = Time = 4
trigger1 = Vel Y > -2
y = -1

[State 5210, 2] ;Go up
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdup"
y = -2

[State 5210, 2] ;Go down
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holddown"
y = 1.5

[State 5210, 2] ;Go fwd
type = VelMul
trigger1 = Time = 4
trigger1 = Command = "holdfwd"
x = 1

[State 5210, 2] ;Go back
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdback"
x = -1

[State 5210, 3]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 15

[State 5210, 4]
type = CtrlSet
trigger1 = Time = 20
value = 1

[State 5210, 5]
type = VelAdd;Gravity
trigger1 = Time >= 4
y = .35

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

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

[State 0] ;Use continue animation if available
type = ChangeAnim
trigger1 = time = 0
trigger1 = SelfAnimExist(5300)
value = 5300
;==============================================================
; 僨僼僅?僩丒奐巒僗僥乕僩
;==============================================================
[Statedef 5900]
Type = S

; 僗僐傾丒儃乕僫僗側偳?偺僗僥乕僕偵?墇偟
[State 0]
	type = VarRangeSet
	trigger1 = RoundNo = 1
	last = 51
	value = 0

[State 0]
	type = VarRangeSet
	trigger1 = RoundNo = 1
	fvalue = 0


;***************************************************************
;***************************************************************

;get stage info 僗僥乕僕忣曬庢摼
; 亂?亃
[State 0, water]
	type = varset
	triggerall = !IsHelper
	triggerall = StateNo = 5900 && Time = 0
	trigger1 = Abs(Pos X) = 73
	trigger2 = NumPartner
	trigger2 = Abs(Partner,Pos X) = 73
	sysvar(0) = 1073

;********************************
[State 0]
	type = ChangeState
	trigger1 = RoundNo = 1
	value = 190
;==============================================================
;(var(59)
;==============================================================
[Statedef 195900]
type = S

[State 0]
	type = VarSet
	trigger1 = var(59) = 0 ;偦傟偱傕嬻?偺応?
	var(59) = 1000         ;枹搊榐偺僉??偼堦?偵1000傪戙擖
;---------------
[State 0]                      ;戜?僀?僩?僗僥乕僩傊
	type = ChangeState
	trigger1 = var(59) != 0
	trigger1 = RoundNo = 1
	value = 190000
;==============================================================
;戜?側偳偺?弌梡
;==============================================================
[Statedef 190000]
ctrl = 0

[State 0]
	type = AssertSpecial
	trigger1 = 1
	flag = Intro

[State 0]
	type = ChangeState
	trigger1 = Time = 0
	value = 190
;--------------------------------------------------------------
; add004 working...
;--------------------------------------------------------------
;--------------------------------------------------------------
; (shaving KO.)
;--------------------------------------------------------------
[Statedef 195200]
type = S
movetype = H
physics = N
velset = IsHelper * -2, 0

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

[State 0] 
	type = ChangeAnim
	Trigger1 = time = 0
	value = Ifelse(Statetype=S,5002,5022)

[State 0] 
	type = ChangeAnim
	Trigger1 = Anim = 5002
	Trigger1 = (AnimTime=0)||(Time>18)
	value = 5022

[State 0] 
	type = ChangeAnim
	Trigger1 = Anim = 5022
	Trigger1 = (AnimTime=0)||(Time>36)
	value = 5080

[State 0] 
	type = ChangeAnim
	Trigger1 = Anim = 5080
	Trigger1 = (AnimTime=0)||(Time>52)
	value = 5110

[State 0]
	type = SelfState
	Trigger1 = Anim = 5110
	Trigger1 = (AnimTime=0)||(Time>42)
	value = 5110
;--------------------------------------------------------------
;--------------------------------------------------------------
;P1 GUARD CRUSH 防御破坏
;--------------------------------------------------------------
;--------------------------------------------------------------

[Statedef 190010]
type = U
physics = U
velset = 0, 0

[State 0]
	type = AssertSpecial
	trigger1 = time <= 10
	flag = NoFG
	flag2 = NoBG
	flag3 = NoBarDisplay
	IgnoreHitPause = 1
	supermovetime = 999999999
	pausemovetime = 999999999

; BG
[State 0]
	type = Explod
	trigger1 = time = 0
	anim = F3501
	pos = 0, 0
	ID = 203531
	Sprpriority = -7
	scale = 32, 1
	postype = Left
	bindtime = -1
	IgnoreHitPause = 1
	removetime = 18
	supermovetime = 999999999
	pausemovetime = 999999999

; BG2 LINE
[State 0]
	type = Explod
	trigger1 = time = 0
	anim = F3513
	sprpriority = -6
	postype = Left
	facing = facing
	pos = Floor(ScreenPos X), Floor(ScreenPos Y + const(size.mid.pos.y))
	bindtime = -1
	IgnoreHitPause = 1
	supermovetime = 999999999
	pausemovetime = 999999999

[State 0]
	type = varset
	trigger1 = Time <= 10
	sysvar(3) = 0

[State 0]
	Type = EnvShake
	trigger1 = Time = 1
	Time = 1
	Ampl = 1

[State 0]
	type = SuperPause
	trigger1 = Time = 0
	Time = 10
	movetime = 10
	anim = 18;玻璃破碎效果，原来是210100
	sound = 10010, 0
	pos = const(size.mid.pos.x) ,const(size.mid.pos.y)
	darken = 0

[State 5250, 1];STUN晕眩字幕
type = Explod
trigger1 = time = 0
anim = f6021
scale = 0.5,0.5
pos = 160,70
postype = left
bindtime = -1
sprpriority = 999999999999999
facing = 1
ontop = 0
ownpal = 1
ignorehitpause = 1 
;persistent = 0

[State 0, warning sound]
	type = PlaySnd
	trigger1 = time = 0
	value = F10200, 4

[State 0]
	type = StateTypeSet
	trigger1 = Time = 0
	physics = Statetype

[State 0, Anim]
	type = ChangeAnim
	Trigger1 = time = 0
	value = Ifelse(Statetype=S,5002,Ifelse(Statetype=C,5022,5012))

[State 0, To190011]
	type = selfState
	Trigger1 = (AnimTime =0)||(Time>28)
	value = 190011
;--------------------------------------------------------------
;faint(^^;
;--------------------------------------------------------------
[Statedef 190011]
type = U
physics = U
velset = 0,0

[State 0, physic]
	type = StateTypeSet
	trigger1 = Time = 0
	physics = Statetype

[State 0, Anim]
	type = ChangeAnim
	Trigger1 = Time = 0
	value = Ifelse(Statetype=S,5007,Ifelse(Statetype=C,5027,5017))

[State 0, Blink]
	type = PalFX
	trigger1 = GameTime%10 = 1
	time = 2
	add = 90,65,160

[State 0, Freeze]
	type = ChangeAnim
	trigger1 = Time <= 80
	value = anim	
	
[State 0, VelSet]
	type = velset
	Trigger1 = AnimTime
	x = GameTime%3-1

[State 0, END]
	type = selfState
	Trigger1 = (AnimTime =0) || (Time > 99)
	value = Ifelse(Statetype=S,0,11)
	ctrl = 1

;--------------------------------------------------------------
;--------------------------------------------------------------
;DIZZY code (P1)昏迷代码，无用
;--------------------------------------------------------------
;--------------------------------------------------------------
[Statedef 190110]
type = U
physics = U
movetype = H
movehitpersist = 1
;hitdefpersist = 1
ctrl = 0

[State 0]
	type = Nothitby
	trigger1 = 1
	value = SCA

[State 0]
	type = helper
	trigger1 = time = 0
	trigger1 = !NumHelper(403000)
	name = "dizzy birds"
	ID = Ifelse(Life < 200, 403003, 403000 + Random%3)
	Stateno = 190140
	IgnoreHitPause = 1
	type = Helper

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

[State 0]
	type = SelfState
	trigger1 = HitShakeOver
	value = StateNo + 1
;--------------------------------------------------------------
;--------------------------------------------------------------
;Guard Breaking (P2State)
;--------------------------------------------------------------
;--------------------------------------------------------------

[Statedef 190120]
type = U
movetype = I
physics = N
velset = Ifelse(StateType = A, -4, -8), 9
ctrl = 0

[State 0]
	type = Nothitby
	trigger1 = 1
	value = SCA
	time = 1

[State 0]
	type = ChangeAnim
	trigger1 = time = 0
	value = Ifelse(Statetype = S, 5002, Ifelse(Statetype = C, 5022, 5012))
[State 0]
	type = ChangeAnim
	trigger1 = Anim = 5002 || Anim = 5012 || Anim = 5022
	trigger1 = AnimTime = 0 && Pos Y >= 0
	value = Ifelse(Anim = 5002, 5007, Ifelse(Anim = 5012, 5017, 5027))

[State 0]
	type = velset
	trigger1 = pos y >= 0
	y = 0
[State 0]
	type = posset
	trigger1 = pos y > 0
	y = 0

[State 0]
	type = VelMul
	trigger1 = pos y >= 0
	x = 0.9

[State 0]
	type = EnvShake
	trigger1 = Time = 1
	time = 6
	ampl = 3
	IgnoreHitPause = 1


[State 0]
	type = LifeAdd
	trigger1 = Time = 1
	value = -150
	kill = 0
	IgnoreHitPause = 1

[State 0]
	type = StateTypeSet
	trigger1 = time = 1
	movetype = H
	IgnoreHitPause = 1
[State 0]
	type = StateTypeSet
	trigger1 = time > 0 && pos y >= 0
	Statetype = S
	movetype = H
	physics = N
	IgnoreHitPause = 1

[State 0]
	type = StateTypeSet
	trigger1 = Anim = 5007 || Anim = 5017 || Anim = 5027
	trigger1 = AnimElem = 1, > 12
	movetype = I
	IgnoreHitPause = 1

[State 0]
	type = SelfState
	triggerall = !win && RoundState != 2
	trigger1 = Anim = 5007 || Anim = 5017 || Anim = 5027
	trigger1 = AnimElem = 1, > 12
	value = 195200

[State 0]
	type = SelfState
	trigger1 = Anim = 5007 || Anim = 5017 || Anim = 5027
	trigger1 = AnimElem = 1, > 12
	value = 190116
	ctrl = 0

;--------
[State 0]
	type = PlaySnd
	trigger1 = time = 0
	value = F10010, 0
	IgnoreHitPause = 1
[State 0]
	type = BGPalFX
	trigger1 = time = 0
	add = 200, 200, 200
	invertall = 0
	time = 1
	IgnoreHitPause = 1
[State 0]
	type = PalFx
	trigger1 = time < 10 && time%2 = 1
	time = 1
	add = 150,150,150
	mul = 180,180,180
	sinadd = 50,50,50,25
	color = 0
	invertall = 1
	IgnoreHitPause = 1
[State 0]
	type = Explod
	triggerall = NumExplod(505000) < 10
	trigger1 = GameTime%3 < 2
	ID = 505000
	anim = F210520 + Random%4
	postype = p1
	pos = 0, Ifelse(StateType = C, -30, -50)
	random = 80, Ifelse(StateType = C, 80, 160)
	scale = 0.5, 0.5
	facing = Ifelse(Random < 500, 1, -1)
	ownpal = 1
	bindtime = 1
	sprpriority = 4
	IgnoreHitPause = 1


;--------------------------------------------------------------
[Statedef 190111]	;down
type = A
movetype = H
physics = N
velset = -4, -7
movehitpersist = 1
ctrl = 0

[State 0]
	type = Nothitby
	trigger1 = 1
	value = SCA

[State 0]
	type = ChangeAnim
	trigger1 = AnimTime = 0
	trigger1 = Anim = 5035
	trigger2 = Time = 0     ;If no transition anim
	trigger2 = Anim != 5035
	trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
	trigger2 = Anim != 5090 ;Not if hit off ground anim
	value = 5050

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

[State 0] ;Gravity
	type = VelAdd
	trigger1 = 1
	y = GetHitVar(yaccel)

[State 0]
	type = Pause
	trigger1 = Time%2 = 0
	trigger1 = Time <= 16
	time = 2

[State 0]
	type = SelfState
	trigger1 = Vel Y > 0
	trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, 25)
	value = StateNo + 1 ;HIT_BOUNCE

;--------------------------------------------------------------
[Statedef 190112]	;hit bounce-1
type = L
movetype = H
physics = N
movehitpersist = 1
ctrl = 0

[State 0]
	type = Nothitby
	trigger1 = 1
	value = SCA

[State 0]
	type = VelSet
	trigger1 = Time = 0
	trigger1 = GetHitVar(fall.yvel) = 0
	trigger1 = vel x > 1
	x = 1

[State 0]
	type = FallEnvShake
	trigger1 = Time = 0

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

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

[State 0] ;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 0]
	type = PosSet
	trigger1 = Time = 0
	y = 0

[State 0]
	type = VelSet
	trigger1 = Time = 0
	y = 0

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

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

[State 0]
	type = PlaySnd
	trigger1 = Time = 1
	value = F5000, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 0]
	type = PosFreeze
	trigger1 = 1

[State 0]
	type = SelfState
	trigger1 = AnimTime = 0
	value = StateNo + 1

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


;--------------------------------------------------------------
[Statedef 190113]; HIT_BOUNCE (bounce into air)
type = L
movetype = H
physics = N
movehitpersist = 1
ctrl = 0

[State 0]
	type = Nothitby
	trigger1 = 1
	value = SCA

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

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

[State 0]
	type = HitFallVel
	trigger1 = Time = 0

[State 0]
	type = PosSet
	trigger1 = Time = 0
	y = 20

[State 0] ;Acceleration
	type = VelAdd
	trigger1 = 1
	y = .4

[State 0] ;Hit ground
	type = SelfState
	trigger1 = Vel Y > 0
	trigger1 = Pos Y >= 12
	value = StateNo + 1


;--------------------------------------------------------------
[Statedef 190114]	;HIT_LIEDOWN 2nd time
type = L
movetype = H
physics = N
movehitpersist = 1
ctrl = 0

[State 0]
	type = Nothitby
	trigger1 = 1
	value = SCA

[State 0]
	type = FallEnvShake
	trigger1 = Time = 0

[State 0] ;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 0] ;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 0] ;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 0]
	type = PosSet
	trigger1 = Time = 0
	y = 0

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

[State 0]
	type = PlaySnd
	trigger1 = Time = 0
	trigger1 = !SysVar(0)
	;value = F5000, 0 ;Hit ground
	value = F5000, (sysvar(1) > 5) + (sysvar(1) > 14)

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

[State 0]
	type = VelSet
	trigger1 = Time = 0
	y = 0

[State 0] ;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 0] ;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 0]
	type = SelfState
	triggerall = !alive
	trigger1 = AnimTime = 0
	trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
	trigger3 = Anim = [5110,5119]
	value = 5150

[State 0]
	type = SelfState
	triggerall = alive
	trigger1 = AnimTime = 0
	trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
	trigger3 = Anim = [5110,5119]
	value = StateNo + 1

;-------------------
[State 0]
	type = VarSet
	trigger1 = SysVar(0)
	trigger1 = Time = 0
	sysvar(0) = 0

[State 0] ;Friction
	type = VelMul
	trigger1 = 1
	x = 0.85

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

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

;--------------------------------------------------------------
[Statedef 190115]	;getup
type = L
movetype = H
physics = N
anim = 5120
velset = 0, 0
movehitpersist = 1
ctrl = 0

[State 0]
	type = Nothitby
	trigger1 = 1
	value = SCA

[State 0]
	type = PosSet
	trigger1 = Time = 0
	y = 0

[State 0]
	type = SelfState
	trigger1 = AnimTime = 0
	value = StateNo + 1
	ctrl = 0

;--------------------------------------------------------------
[Statedef 190116]	;dizzy
type = S
movetype = U
physics = S
anim = 5300
movehitpersist = 1
ctrl = 0
velset = 0, 0, 0

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

[State 0]
	type = helper
	trigger1 = time = 0
	trigger1 = !NumHelper(403000)
	trigger1 = !NumHelper(403001)
	trigger1 = !NumHelper(403002)
	trigger1 = !NumHelper(403003)
	name = "dizzy birds"
	ID = Ifelse(Life < 200, 403003, 403000 + Random%3)
	Stateno = 190140
	IgnoreHitPause = 1
	type = Helper

[State 0, dizzy sound]
	type = playsnd
	trigger1 = Time%42 = 0
	value = F10400, 0
	channel = 2

[State 0]
	type = PalFx
	trigger1 = NumHelper(90900)
	trigger1 = Helper(90900), var(52)%4 = 1
	trigger1 = PrevStateNo != 190120
	time = 1
	add = 120, 120, 120

[State 0]
	type = SelfState

	trigger1 = Time >= 300

	trigger2 = NumHelper(90900)
	trigger2 = Helper(90900), var(52) > 36
	trigger2 = PrevStateNo != 190120

	trigger3 = PrevStateNo = 190120
	trigger3 = time >= 90

	value = 0
	ctrl = 1
;--------------------------------------------------------------
; birds (helper)

[Statedef 190140]
type = A
physics = N
ctrl = 0

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

[State 0]
	type = PlayerPush
	trigger1 = 1
	value = 0

[State 0]
	type = BindToParent
	trigger1 = 1
	pos = 0,  Parent,Const(Size.Head.Pos.Y) - 5
	IgnoreHitPause = 1

[State 0]
	type = NotHitBy
	trigger1 = 1
	value = SCA
	IgnoreHitPause = 1

;--------
[State 0]
	type = varset
	trigger1 = time = 0
	var(10) = IsHelper(403000)*0 + IsHelper(403001) + IsHelper(403002)*2 + IsHelper(403003)*3


[State 0]
	type = varset
	trigger1 = !var(2)
	var(2) = Ceil((Parent,Const(Size.ground.back) + Parent,Const(Size.ground.front)) * (Parent,Const(Size.Xscale)))

[State 0]
	type = varadd
	trigger1 = 1
	var(1) = 1

[State 0]
	type = varset
	trigger1 = 1
	fvar(7) = var(1) / 180.00 * 3.14 * 4
[State 0]
	type = varset
	trigger1 = 1
	fvar(8) = (var(1) + 120) / 180.00 * 3.14 * 4
[State 0]
	type = varset
	trigger1 = 1
	fvar(9) = (var(1) + 240) / 180.00 * 3.14 * 4


[State 0]
	type = varset
	trigger1 = 1
	fvar(1) = sin(fvar(7)) * var(2)
[State 0]
	type = varset
	trigger1 = 1
	fvar(2) = sin(fvar(8)) * var(2)
[State 0]
	type = varset
	trigger1 = 1
	fvar(3) = sin(fvar(9)) * var(2)
[State 0]
	type = varset
	trigger1 = 1
	fvar(4) = cos(fvar(7)) * var(2)/4
[State 0]
	type = varset
	trigger1 = 1
	fvar(5) = cos(fvar(8)) * var(2)/4
[State 0]
	type = varset
	trigger1 = 1
	fvar(6) = cos(fvar(9)) * var(2)/4


;--------
[State 0] ;birds
	type = Explod
	trigger1 = !var(0)
	anim = F403000 + var(10)
	pos = Floor(fvar(1)), Floor(fvar(4))
	ID = 0
	Sprpriority = Ifelse(fvar(4) > 0, 4, -4)
	scale = 0.5, 0.5
	facing = -1
	bindtime = -1
	removetime = 1
	IgnoreHitPause = 1
[State 0] ;birds
	type = Explod
	trigger1 = !var(0)
	anim = F403000 + var(10)
	pos = Floor(fvar(2)), Floor(fvar(5))
	ID = 0
	Sprpriority = Ifelse(fvar(5) > 0, 4, -4)
	scale = 0.5, 0.5
	facing = -1
	bindtime = -1
	removetime = 1
	IgnoreHitPause = 1
[State 0] ;birds
	type = Explod
	trigger1 = !var(0)
	anim = F403000 + var(10)
	pos = Floor(fvar(3)), Floor(fvar(6))
	ID = 0
	Sprpriority = Ifelse(fvar(6) > 0, 4, -4)
	scale = 0.5, 0.5
	facing = -1
	bindtime = -1
	removetime = 1
	IgnoreHitPause = 1


;--------
[State 0]
	type = varset
	trigger1 = Parent,StateNo != [190111,190120]
	var(0) = 1
	IgnoreHitPause = 1

[State 0]
	type = RemoveExplod
	trigger1 = var(0) && NumExplod(0)
	ID = 0
	IgnoreHitPause = 1

[State 0]
	type = DestroySelf
	trigger1 = var(0)
	IgnoreHitPause = 1

;---------------------------------------------------------------------------
; HIT_GETUP for survival mode
;---------------------------------------------------------------------------
[Statedef 190220]
type = L
movetype = I
physics = N
sprpriority = 5

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

[State 0]
	type = ChangeAnim
	triggerall = time = 0
	trigger1 = anim = [5111,5119]
	trigger1 = SelfAnimExist(5120 + (anim % 10))
	value = 5120 + (anim % 10)

[State 0]
	type = VelSet
	trigger1 = Time = 0
	x = 0

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

[State 0]
	type = HitFallSet
	trigger1 = AnimTime = 0
	value = 1

[State 0]
	type = ChangeState
	trigger1 = AnimTime = 0
	value = 180
	ctrl = 0
;--------------------------------------------------------------
; STRIKER
;--------------------------------------------------------------
[Statedef 190190]
type = S
physics = S
anim = 40
ctrl = 0
sprpriority = -2

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

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

[State 0]
	type = screenbound
	trigger1 = 1
	value = 0
		
[State 0]
	type = VelSet
	trigger1 = AnimTime = 0
	x = -6.666 ;const(velocity.runjump.back.x)
	y = -9.999 ;const(velocity.runjump.y)

[State 0]
	type = ChangeState
	trigger1 = AnimTime = 0
	value = 190191
;--------------------------------------------------------------
[Statedef 190191]
type = A
physics = A
sprpriority = -2

[State 0]
	type = screenbound
	trigger1 = 1
	value = 0

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

[State 0]
	type = PlaySnd
	trigger1 = Time = 0
	value = F50, 0
	channel = 1

;--------
[State 0]
	type = ChangeAnim
	trigger1 = Time = 0
	value = Ifelse((Vel X)=0, 41, Ifelse((Vel X)>0, 42, 43))

[State 0]
	type = ChangeAnim
	trigger1 = Vel Y > -2
	trigger1 = SelfAnimExist(Anim + 3)
	persistent = 0
	value = Anim + 3

[State 0]
	type = AssertSpecial
	Trigger1 = 1
	Flag = NoShadow

[State 0]
	type = SelfState	
	trigger1 = (ScreenPos X != [-60, 380]) || (ScreenPos Y >= 300)
	Value = 190192
;--------------------------------------------------------------
[Statedef 190192]
type = S
movetype = H 
physics = S
velset = 0, 0
sprpriority = -2
ctrl = 0

[State 0]
	trigger1 = 1
	type = NotHitBy
	value = SCA
[State 0]
	type = AssertSpecial
	trigger1 = 1
	flag = invisible
[State 0]
	type = screenbound
	trigger1 = 1
	value = 0
[State 0]
	type = PlayerPush
	trigger1 = 1
	value = 0
[State 0, Freeze]
	type = ChangeAnim
	trigger1 = 1
	value = anim
[State 0]
	type = PosSet
	Trigger1 = 1
	x = Partner,Pos X
	y = -800

[State 0, LifeSetP2]
	type = LifeSet
	Trigger1 = Partner,Life <= 0
	Value  = - 1000 ;Const(Data.Life)

[State 0, SPE]
	type = AssertSpecial
	Trigger1 = 1
	flag = noshadow
	flag2 = nokosnd

[State 0]
	type = ChangeState
	trigger1 = RoundState = 2
	trigger1 = Partner, MoveType != H
	trigger1 = Partner, NumExplod(800000)
	trigger2 = sysfvar(4) = 1
	trigger3 = RoundState > 2
	value = 190193
;--------------------------------------------------------------
; 搊応/[190193-190195]
;--------------------------------------------------------------
[Statedef 190193]
type = S
movetype = I
physics = S
velset = 0, 0
sprpriority = -2
ctrl = 0	

[State 0]
	type = ScreenBound
	trigger1 = 1
	value = 0	

[State 0]
	type = AssertSpecial
	Trigger1 = Pos Y < 0
	flag = noshadow

[State 0]
	type = Turn
	triggerall = Partner, facing != facing
	Trigger1 = Time = 0 && RoundState = 2
	Trigger2 = RoundState > 2

[State 0]	;僾?乕?偵?傢偣(#1)
	type = PosSet
	triggerall = Time = 0
	Trigger1 = RoundState = 2 
	x = (Partner,BackEdgeBodyDist + 30) * (-facing) + Partner,Pos X
	y = -180

[State 0]	;僾?乕?偵?傢偣(#2)
	type = PosSet
	Trigger1 = RoundState > 2
	x = Partner, Pos X - Win*facing*40
	y = -280 ;尒偊偰偟傑偆応?偼傕偭偲忋曽廋惓偟偰偔偩偝偄

[State 0]
	type = VelSet
	Trigger1 = RoundState = 2 && Time = 0
	Trigger2 = RoundState > 2 && Time > (!Win) * 100
	x = abs(Pos X - Partner,Pos X) / 16 * (RoundState=2)
	y = abs(Pos Y / 16)

[State 0]
	type = ChangeState		
	trigger1 = RoundState = 2 && Time = 0
	trigger2 = RoundState > 2 && Time > (!Win) * 100
	value = Ifelse( sysfvar(4) = 1, 190194, 190196)
	Ctrl = 0
;--------------------------------------------------------------
; empty states for override
;--------------------------------------------------------------

[Statedef 190196]
type = U
movetype = U

[State 0]
	type = ChangeState
	trigger1 = Time = 0
	value = 190194
	ctrl = 0

;--------------------------------------------------------------
; (striker appears)
;--------------------------------------------------------------
[Statedef 190194]
type = A
movetype = I
physics = N
sprpriority = -2
anim = Ifelse(SelfAnimExist(44), 44, 41)
ctrl = Ifelse(sysvar(4), 1, 0)

[State 0] ;昗婰
	type = Explod
	triggerall = !NumExplod(296000)
	triggerall = RoundState = 2
	trigger1 = NumPartner
	trigger1 = sysvar(4) = 0
	ID = 296000
	anim = F296000 + !(Partner,NumExplod(510000))*TeamSide
	sprpriority = 5
	postype = P1
	pos = 0, Const(Size.Head.Pos.Y) - 20
	facing = Ifelse(facing = 1, 1, -1)
	scale = 0.5, 0.5
	ontop = 1
	ownpal = 1
	bindtime = -1
	IgnoreHitPause = 1
	removetime = Ifelse(sysfvar(4) = 1, 30, 99)
	supermovetime = 999999999

[State 0]
	type = ScreenBound
	trigger1 = 1
	value = 0

[State 0]
	type = ChangeState
	trigger1 = Pos Y >= 0
	value = 190195
	ctrl = 0
;--------------------------------------------------------------
;?抧 > ?僂?僪廔椆 (land > roundover)
;--------------------------------------------------------------

[Statedef 190195]
type = S
movetype = H
physics = S
anim = 47
velset = 0, 0
sprpriority = -2
ctrl = 0

[State 0]
	type = ScreenBound
	trigger1 = 1
	value = 0

[State 0, jump land]
	type = Helper
	trigger1 = Time = 0
	ID = 152000
	Stateno = 152000

[State 0]
	type = PosSet
	trigger1 = Time = 0
	Y = 0
;--------------------------
[State 0]
	type = ChangeState
	triggerall = RoundState > 2 
	trigger1 = AnimTime = 0
;;	trigger1 = Win
	value = 0
	Ctrl = 1
;--------------------------

[State 0] ;?偗梡僿?僷乕
	type = ChangeState
	triggerall = RoundState > 2
	trigger1 = AnimTime = 0
	trigger1 = Lose || DrawGame
	value = 170
;;	Ctrl = 1
;--------------------------

[State 0]
	type = ChangeState
	trigger1 = sysfvar(4) = 0
	trigger1 = RoundState = 2
	trigger1 = AnimTime = 0
	value = Ifelse(!var(59), 1000, var(59))
	Ctrl = 0


[State 0]
	type = ChangeState
	trigger1 = sysfvar(4) = 1
	trigger1 = AnimTime = 0
	value = 0
	Ctrl = 1

;==============================================================
;超杀结局特效 (helper State of "hyper combo finish")
;==============================================================
[Statedef 99999]
ctrl = 0

[State 0]
	type = PosSet
	trigger1 = Time = 0
	x = 99999
	y = 99999

[State 0]
	type = varset
	trigger1 = Root,NumExplod(120505) = 0
	var(0) = 1

[State 0]
	type = AssertSpecial
	trigger1 = NumExplod(99999)
	flag = nobg
	flag2 = nofg
	flag3 = invisible
	IgnoreHitPause = 1

[State 0]
	Type = EnvShake
	trigger1 = 1
	Time = 1
	Ampl = 0
;-------------------KOF的红白闪光--------------------AH的代码

[State 0]
type = PlaySnd
trigger1 = time = 0
value = f5200,0
channel = 10
volume = 255

[State 0]
type = PlaySnd
trigger1 = time = 1
value = f5200,1
channel = 11
volume = 255

[State 0]
type = PlaySnd
trigger1 = time = 2
value = f5200,2
channel = 12
volume = 255

[State 3040, 7]
type = EnvColor
trigger1 = var(0) && !var(1)
trigger1 = time % 9 = 0
trigger1 = time <= 33
;persistent = 0
;ignorehitpause = 1
time = 3
value = 0,0,0
under = 1

[State 3040, 7]
type = EnvColor
trigger1 = var(0) && !var(1)
trigger1 = time % 9 = 3
trigger1 = time <= 33
;persistent = 0
;ignorehitpause = 1
time = 3
value = 255,0,0
under = 1

[State 3040, 7]
type = EnvColor
trigger1 = var(0) && !var(1)
trigger1 = time % 9 = 6
trigger1 = time <= 33
;persistent = 0
;ignorehitpause = 1
time = 3
value = 255,255,255
under = 1
;-------------------以上--------------------

[State 0]
	type = varset
	trigger1 = NumExplod(99999)
	var(1) = 1
	IgnoreHitPause = 1

;==============================================================
;MAX2特效，无用
;==============================================================
;TYPE 1
[Statedef 88870]
ctrl = 0
anim = 99999

[State 0]
type = DestroySelf
trigger1 = time = 0
;--------------------------------------
;TYPE 2
[Statedef 88871]
ctrl = 0
anim = 99999

[State 0]
type = DestroySelf
trigger1 = time = 0
;--------------------------------------
;TYPE 3
[Statedef 88872]
ctrl = 0
anim = 99999

[State 0]
type = DestroySelf
trigger1 = time = 0
;==============================================================
;(Breaking Helper)
;==============================================================
;Level 1
[Statedef 88890]
ctrl = 0
anim = 99999

[State 0]
type = DestroySelf
trigger1 = time = 0

;==============================================================
; (helper of BLOCKING/JD)
;==============================================================
[Statedef 99997]
type = A
movetype = H ; memo damage
physics = N
ctrl = 0
poweradd = 0
anim = (Root,Statetype = C) * 11 + (Root,Statetype = A) * 41

;----------------傾僯?愝掕
[State 0]
	type = ChangeAnim
	trigger1 = Time = 0
	trigger1 = Root,Statetype = A
	trigger1 = Root,sysfvar(1) < 2  ;; << N,L僕??僾
	value = Ifelse((Root,vel x) = 0, 41, Ifelse((Root,vel x) > 0, 42, 43))

[State 0]
	type = ChangeAnim
	trigger1 = Time = 0
	trigger1 = Root,Statetype = A
	trigger1 = Root,sysfvar(1) >= 2  ;; << M,S僕??僾
	value = 41

; ?壓傾僯?偑?傟偽...
[State 0]
	type = ChangeAnim
	trigger1 = Root,Statetype = A
	trigger1 = Root,vel y > -2
	trigger1 = Root,SelfAnimExist(Anim + 3)
	persistent = 0
	value = Anim + 3

;----------------
[State 0]
	type = AssertSpecial
	trigger1 = 1
	flag = invisible
;op;	flag = NoAutoTurn

[State 0]
	type = PlayerPush
	trigger1 = 1
	value = 0

[State 0]
	type = posset
	trigger1 = 1
	X = Root, pos X - 420
	Y = Root, Pos Y - 240
	IgnoreHitPause = 1

[State 0]
	type = offset
	trigger1 = 1
	x = 420
	y = 240
	IgnoreHitPause = 1

[State 0]
	type = HitOverride
	trigger1 = 1
;op;	attr = SCA, AA, AT, AP
	attr = SCA, NA, SA, HA, NP, SP, HP
	time = -1
	slot = 0 ;7
	Stateno = 99996
;op;	forceair = 1  ;; << ?偐偡(昁梫側偄)
	IgnoreHitPause = 1
	sparkno = -1 ;; << 岠壥側偟

[State 0]
	type = NotHitBy
	trigger1 = 1
	value = , AT
	IgnoreHitPause = 1


; 廔椆/幐攕
[State 0]
	type = ChangeState
;or;	trigger1 = Root,sysvar(4) = 2
	trigger1 = IsHelper(99997)
	trigger1 = Time > 5 ;; << 庴晅?娫偺挿偝
;or;	trigger2 = Root,sysvar(4) = 3
	trigger2 = IsHelper(99998)
	trigger2 = Time > 9 ;; << 庴晅?娫偺挿偝
	trigger3 = Root,Ctrl = 0
	trigger4 = Root,StateNo = 195500
	value = 99995
;-----------------
; 惉岟
[Statedef 99996]
type = A
movetype = H ; <<忣曬庢摼偺偨傔偺"H"
physics = N
ctrl = 0
poweradd = 0

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

[State 0]
	type = PosSet
	trigger1 = Time = 0
	x = 99999
	y = 99999

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

; 峝捈?娫庢摼
;;  * GetHitVar(hitshaketime)
[State 0]
	type = varset
	trigger1 = time = 0
	var(0) = EnemyNear,HitPauseTime + 1

[State 0]
	type = ChangeState
	triggerall = time > 3
	trigger1 = time > var(0) + 3
	value = 99995
	IgnoreHitPause = 1
;-----------------
; 幐攕/廔椆
[Statedef 99995]
ctrl = 0

[State 0]
	type = AssertSpecial
	trigger1 = 1 
	flag = invisible
[State 0]
	type = NotHitBy
	trigger1 = 1
	value = SCA

[State 0]
	type = DestroySelf

;or;	trigger1 = Root,sysvar(4) = 2
	trigger1 = IsHelper(99997)
	trigger1 = Root,StateNo != 195500
	trigger1 = Root,Command != "holdfwd"

;or;	trigger2 = Root,sysvar(4) = 3
	trigger2 = IsHelper(99998)
	trigger2 = Root,StateNo != 195500
	trigger2 = Root,Command != "holdback"

;or;	trigger3 = Root,sysvar(4) = 3
	trigger3 = IsHelper(99998)
	trigger3 = Root,StateNo = 195500
	trigger3 = Root,Command = "holdback"

	IgnoreHitPause = 1
;==============================================================
;[RANKING] ??僉?僌(?昞帵)梡僿?僷乕/ranking helper State
;==============================================================

[Statedef 99980]
ctrl = 0

[State 0]
	type = AssertSpecial
	trigger1 = 1
	flag = invisible
	flag2 = NoBarDisplay

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

; reset hits combo
[State 0]
	type = HitAdd
	trigger1 = time > 0
	value = -999

;------------------------------
; drawing flag
[State 0]
	type = varset
	triggerall = time = 0 && Win
	trigger1 = Root,Alive
	trigger1 = !NumPartner
	trigger2 = NumPartner
	trigger2 = Root,Alive || Partner,Alive
	var(9) = 1



;------------------------------
; var(31):	lifebar draw x
; var(32):	lifebar draw y
; var(33):	powerbar draw x
; var(34):	powerbar draw y
; fvar(3-5):	bar scale(w or h)

; pos init
;[State 0]
;	type = varset
;	trigger1 = time = 0
;	var(31) = Ifelse(TeamSide = 1, 26, 292)
[State 0]
	type = varset
	trigger1 = time = 0
	var(32) = 62

[State 0]
	type = varset
	trigger1 = time = 0
	var(31) = Ifelse(TeamSide = 1, -196, 502)

[State 0]
	type = varadd
	trigger1 = time = [100,110]
	var(31) = Ifelse(TeamSide = 1, 20, -20)
[State 0]
	type = varadd
	trigger1 = time%5 = 0 && time = [110,300]
	var(31) = Ifelse(TeamSide = 1, 1, -1)
[State 0]
	type = varadd
	trigger1 = time > 300
	var(31) = Ifelse(TeamSide = 1, 1, -1) * (time-300)*3

;------------------------------
;------------------------------
; get hit bonus
[State 0]
	type = varset
	trigger1 = time = 0 && var(9)
	fvar(13) = Ifelse(fvar(3) = 0, 30, Floor(fvar(13) / (fvar(3) + fvar(13) + 0.001) * 30))

; get guard bonus
[State 0]
	type = varset
	trigger1 = time = 0 && var(9)
	fvar(14) = 30 - Ifelse(fvar(4) / 12 >= 1, 30, Floor(fvar(4) / 12.00 * 30))

; get life bonus
[State 0]
	type = varset
	trigger1 = time = 0 && var(9)
	trigger1 = !NumPartner
	var(1) = Ifelse(Root,Life >= Const(Data.Life)-1, 30, Floor(Root,Life/1.00/Const(Data.Life)*30))
[State 0]
	type = varset
	trigger1 = time = 0 && var(9)
	trigger1 = NumPartner
	var(1) = Ifelse((Root,Life + Partner,Life) >= Const(Data.Life)*2-1, 30, Floor((Root,Life + Partner,Life)/2.00/Const(Data.Life)*30))

; hp finish helper
[State 0]
	type = varset
	trigger1 = time = 0 && var(45) < 2
	trigger1 = Root,NumHelper(99999)
	var(45) = 2
; get tech bonus
[State 0]
	type = varset
	trigger1 = time = 0 && var(9)
	fvar(15) = (var(48)=2)*5 + var(45)*5 + Floor(fvar(4) + fvar(5) + fvar(6) + fvar(7))
[State 0]
	type = varset
	trigger1 = time = 0 && var(9)
	trigger1 = fvar(15) > 30
	fvar(15) = 30

; Rank
[State 0]
	type = varset
	trigger1 = time = 0 && var(9)
	var(2) = Floor(fvar(13) + fvar(14) + fvar(15)) + var(1)
[State 0]
	type = varset
	trigger1 = time = 0 && var(9)
	var(2) = Ifelse(var(2) < 20, 0, Ifelse(var(2) > 99, 14, var(2) / 8))


;--------------------------------
; 攝抲傪惍偊傞
[State 0]
	type = varset
	trigger1 = time = 0
	var(33) = (28 - var(2) * 2) * Ifelse(TeamSide = 1, 1, -1)
[State 0]
	type = varset
	trigger1 = time = 0
	var(34) = (var(48) != 2)*6 + (var(1) != 30)*6 + (var(45) = 0)*6


; 摼揰摦懺昞帵
[State 0]
	type = varset
	trigger1 = time = 1
	var(57) = var(58)
[State 0]
	type = varset
	trigger1 = time = 1
	var(58) = 0
[State 0]
	type = varadd
	trigger1 = time > 120 && var(58) < var(57)
	trigger1 = var(51) < 1
	var(58) = 1 + (var(58)<var(57)-20)*(Random%9) + (var(58)<var(57)-200)*(Random%9*10) + (var(58)<var(57)-2000)*(Random%99*10) + (var(58)<var(57)-20000)*(Random%999*10)


; 僶乕弅広
;------------
[State 0]
	type = varset
	trigger1 = time = 1
	fvar(2) = 0.40
[State 0]
	type = varadd
	trigger1 = time > 110
	fvar(2) = 0.01
[State 0]
	type = varset
	trigger1 = fvar(2) > 0.5
	fvar(2) = 0.5
;------------
[State 0]
	type = varset
	trigger1 = time = 1
	fvar(3) = 0
[State 0]
	type = varadd
	trigger1 = time > 120 && fvar(3) < 0.5
	fvar(3) = 0.1
;------------
[State 0]
	type = varset
	trigger1 = time = 1
	fvar(4) = 0
[State 0]
	type = varadd
	trigger1 = time > 130 && fvar(4) < 0.5
	fvar(4) = 0.1
;------------
[State 0]
	type = varset
	trigger1 = time = 1
	fvar(5) = 0
[State 0]
	type = varadd
	trigger1 = time > 140 && fvar(5) < 0.5
	fvar(5) = 0.1
;--------------------------------
;(drawing)
;--------------------------------
[State 0]
	type = RemoveExplod
	trigger1 = time = 0

;=======================================================
;计分板的内容
;=======================================================
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	anim = F160200
	postype = Left
	facing = Ifelse(TeamSide = 1, 1, -1)
	pos = var(31) + Ifelse(TeamSide = 1, 58, -58), var(32) + 22
	scale = fvar(2), fvar(2)
	sprpriority = -4
	bindtime = -1
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	anim = F160201
	postype = Left
	facing = Ifelse(TeamSide = 1, 1, -1)
	pos = var(31) + Ifelse(TeamSide = 1, 58, -58), var(32) + 22
	scale = fvar(2), fvar(2)
	sprpriority = -4
	bindtime = -1



;--------------------------------
;大底板
;--------------------------------
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	trigger1 = var(48) = 2
	id = 11
	anim = F160020
	postype = Left
	pos = var(31) + Ifelse(TeamSide = 1, 56, -56), var(32) + 22 + var(34)
	facing = Ifelse(TeamSide = 1, 1, -1)
	scale = 0.5, fvar(3)
	sprpriority = -1
	bindtime = -1
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	trigger1 = var(48) = 2
	id = 10
	anim = F160030
	postype = Left
	pos = var(31) + Ifelse(TeamSide = 1, 56, -56), var(32) + 22 + var(34)
	scale = 0.5, fvar(3)
	sprpriority = 0
	bindtime = -1

;--------------------------------
; (perfect match)
;--------------------------------
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	trigger1 = var(1) = 30
	id = 11
	anim = F160021
	postype = Left
	pos = var(31) + Ifelse(TeamSide = 1, 56, -56), var(32) + 22 + (var(48) = 2) * 12 + var(34)
	facing = Ifelse(TeamSide = 1, 1, -1)
	scale = 0.5, fvar(3)
	sprpriority = -1
	bindtime = -1
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	trigger1 = var(1) = 30
	id = 10
	anim = F160033
	postype = Left
	pos = var(31) + Ifelse(TeamSide = 1, 56, -56), var(32) + 22 + (var(48) = 2) * 12 + var(34)
	scale = 0.5, fvar(3)
	sprpriority = 0
	bindtime = -1

;--------------------------------
; (super/hyper finish message)
;--------------------------------
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	trigger1 = var(45) > 0
	id = 11
	anim = F160022
	postype = Left
	pos = var(31) + Ifelse(TeamSide = 1, 56, -56), var(32) + 22 + ((var(48) = 2) + (var(1) = 30)) * 12 + var(34)
	facing = Ifelse(TeamSide = 1, 1, -1)
	scale = 0.5, fvar(3)
	sprpriority = -1
	bindtime = -1
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	trigger1 = var(45) > 0
	id = 10
	anim = F160030 + var(45)
	postype = Left
	pos = var(31) + Ifelse(TeamSide = 1, 56, -56), var(32) + 22 + ((var(48) = 2) + (var(1) = 30)) * 12 + var(34)
	scale = 0.5, fvar(3)
	sprpriority = 0
	bindtime = -1

;--------------------------------
;BAR们
;--------------------------------
; lights----
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	anim = F160005
	sprpriority = -1
	postype = Left
	pos = var(31) + var(33) + Ifelse(TeamSide = 1, 0, - Floor(fvar(15) + fvar(13) + fvar(14)) - var(1)), var(32) + var(34)
	scale = Floor(fvar(13) + fvar(14) + fvar(15)) + var(1) + 2, fvar(4)
	bindtime = -1

; leftbar
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	anim = F160000
	postype = Left
	pos = var(31) + var(33), var(32) + var(34)
	sprpriority = 0
	bindtime = -1
	scale = 0.5, fvar(4)

; tech
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	anim = F160004
	postype = Left
	pos = var(31) + var(33) + Ifelse(TeamSide = 1, 2, - Floor(fvar(15))), var(32) + var(34)
	sprpriority = 0
	bindtime = -1
	scale = fvar(15), fvar(4)

; hit
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	anim = F160001
	postype = Left
	pos = var(31) + var(33) + Ifelse(TeamSide = 1, 2 + Floor(fvar(15)), - Floor(fvar(15) + fvar(13))), var(32) + var(34)
	sprpriority = 0
	bindtime = -1
	scale = fvar(13), fvar(4)

; guard
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	anim = F160002
	postype = Left
	pos = var(31) + var(33) + Ifelse(TeamSide = 1, 2 + Floor(fvar(15) + fvar(13)), - Floor(fvar(15) + fvar(13) + fvar(14))), var(32) + var(34)
	sprpriority = 0
	bindtime = -1
	scale = fvar(14), fvar(4)

; life
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	anim = F160003
	postype = Left
	pos = var(31) + var(33) + Ifelse(TeamSide = 1, 2 + Floor(fvar(15) + fvar(13) + fvar(14)), - Floor(fvar(15) + fvar(13) + fvar(14)) - var(1)), var(32) + var(34)
	sprpriority = 0
	bindtime = -1
	scale = var(1), fvar(4)


;------------------------------
; tech
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	trigger1 = fvar(15) > 10
	anim = F160013
	postype = Left
	pos = var(31) + var(33) + Ifelse(TeamSide = 1, 2 + Floor(fvar(15)/2), - 5 - Floor(fvar(15)/2) ), var(32) + 8 + var(34)
	scale = 0.5, fvar(4)
	sprpriority = 0
	bindtime = -1

; hit
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	trigger1 = fvar(13) > 1
	anim = F160011
	postype = Left
	pos = var(31) + var(33) + Ifelse(TeamSide = 1, 2 + Floor(fvar(15) + fvar(13)/2), - Floor(fvar(15) + fvar(13)/2) ), var(32) + 4 + var(34)
	scale = 0.5, fvar(4)
	sprpriority = 0
	bindtime = -1

; guard
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	trigger1 = fvar(14) > 1
	anim = F160010
	postype = Left
	pos = var(31) + var(33) + Ifelse(TeamSide = 1, 2 + Floor(fvar(15) + fvar(13) + fvar(14)/2), - Floor(fvar(15) + fvar(13) + fvar(14)/2) ), var(32) + 8 + var(34)
	scale = 0.5, fvar(4)
	sprpriority = 0
	bindtime = -1

; life
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	trigger1 = var(1) > 1
	anim = F160012
	postype = Left
	pos = var(31) + var(33) + Ifelse(TeamSide = 1, 2 + Floor(fvar(15) + fvar(13) + fvar(14) + var(1)/2), - Floor(fvar(15) + fvar(13) + fvar(14) + var(1)/2) ), var(32) + 4 + var(34)
	scale = 0.5, fvar(4)
	sprpriority = 0
	bindtime = -1
;--------------------------------------------------------------
; Rank
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	anim = F160150
	postype = Left
	pos = var(31) + Ifelse(TeamSide = 1, 22, -20), var(32) - 28
	sprpriority = -2
	scale = 0.5, fvar(5)
	bindtime = -1
;--;	trans = sub ; add1
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	anim = F160150
	postype = Left
	pos = var(31) + Ifelse(TeamSide = 1, 22, -20), var(32) - 28
	sprpriority = -1
	scale = 0.5, fvar(5)
	bindtime = -1
	trans = add
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9)
	anim = F160100 + var(2)
	postype = Left
	pos = var(31) + Ifelse(TeamSide = 1, 22, -20), var(32) - 28
	sprpriority = 0
	scale = 0.5, fvar(5)
	bindtime = -1
	trans = add
;--------------------------------
; win sound胜利声音
;--------------------------------
[State 0]
	type = PlaySnd
	triggerall = var(9)
	trigger1 = time = 120
	value = F10300, Ifelse(var(51) > 0, 1, 0)

; perfect sound
[State 0]
	type = PlaySnd
	triggerall = var(9)
	trigger1 = time = 160 && var(51) < 1
	trigger1 = var(1) = 30
	value = F10300, 2
;--------------------------------------------------------------
; (scores and bonus)分数什么的。
;--------------------------------------------------------------
; score
[State 0]
	type = varadd
	trigger1 = time = 0 && var(9)
	var(58) = var(2) * 250

[State 0]
	type = ParentVarSet
	trigger1 = time = 0
	trigger1 = Root,sysvar(4)
	trigger1 = var(58) > Root,var(58)
	var(58) = var(58)
;-----------------
; (score)
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9) && var(58) > 0
	anim = F300000 + var(58)%10
	postype = Left
	pos = var(31) + Ifelse(TeamSide=1,0,-70) + Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9 + 54, -9), var(32) - 20
	sprpriority = -1
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	removetime = 1
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9) && var(58) > 9
	anim = F300000 + var(58)/10%10
	postype = Left
	pos = var(31) + Ifelse(TeamSide=1,0,-70) + Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9 + 45, -18), var(32) - 20
	sprpriority = -1
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	removetime = 1
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9) && var(58) > 99
	anim = F300000 + var(58)/100%10
	postype = Left
	pos = var(31) + Ifelse(TeamSide=1,0,-70) + Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9 + 36, -27), var(32) - 20
	sprpriority = -1
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	removetime = 1
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9) && var(58) > 999
	anim = F300000 + var(58)/1000%10
	postype = Left
	pos = var(31) + Ifelse(TeamSide=1,0,-70) + Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9 + 27, -36), var(32) - 20
	sprpriority = -1
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	removetime = 1
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9) && var(58) > 9999
	anim = F300000 + var(58)/10000%10
	postype = Left
	pos = var(31) + Ifelse(TeamSide=1,0,-70) + Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9 + 18, -45), var(32) - 20
	sprpriority = -1
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	removetime = 1
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9) && var(58) > 99999
	anim = F300000 + var(58)/100000%10
	postype = Left
	pos = var(31) + Ifelse(TeamSide=1,0,-70) + Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9 + 9, -54), var(32) - 20
	sprpriority = -1
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	removetime = 1
[State 0]
	type = Explod
	trigger1 = time > 11 && var(9) && var(58) > 999999
	anim = F300000 + var(58)/1000000%10
	postype = Left
	pos = var(31) + Ifelse(TeamSide=1,0,-70) + Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9, -63), var(32) - 20
	sprpriority = -1
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	removetime = 1

;==============================================================
;[RANKING] ranking helper State
;for survival mode(team mode)
;==============================================================
;var(0)  ranking/grade
;var(5)  draw pos Y
;var(10) scores
;var(11) wins

[Statedef 99985]
ctrl = 0

[State 0]
	type = PosSet
	trigger1 = Time = 0
	x = 99999999
	y = 99999999

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

[State 0]
	type = AssertSpecial
	trigger1 = time < 9000
	flag = RoundNotOver

;------------------------------
;INIT
[State 0]
	type = varset
	trigger1 = Time = 0
	var(5) = 52
;------------------------------
[State 0]	;get players scores
	type = varset
	triggerall = Time = 0
	trigger1 = NumEnemy
	trigger1 = Enemy,sysvar(4)
	var(10) = Enemy,var(58)
;--------------------------------------------------------------
;(drawing)

[State 0, bar]
	type = Explod
	trigger1 = time = 50
	id = 0
	anim = F5600
	sprpriority = 2
	postype = Left
	pos = 0, var(5)
	scale = 0.5, 0.5
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999
	bindtime = -1
	ontop = 1
	IgnoreHitPause = 1
;--------------------------------------------------------------
;ranking
;--------------------------------------------------------------
[State 0, rank]
	type = VarSet
	trigger1 = Time = 0
	trigger1 = NumEnemy
	trigger1 = Enemy,sysvar(4)
	var(0) = Enemy,var(58)%100

;--------------
[State 0, rank]
	type = Explod
	trigger1 = time = 100
	id = 1
	anim = F160100 + var(0)
	sprpriority = 6
	postype = Left
	pos = 120, var(5) + 30
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999
	bindtime = -1
	ontop = 1
	IgnoreHitPause = 1
;--------------------------------------------------------------
;(wins)
;--------------------------------------------------------------
[State 0, wins]
	type = VarSet
	trigger1 = Time = 0
	var(11) = RoundNo - 1

[State 0, scr]
	type = Explod
	triggerall = time > 100
	triggerall = var(11) > 0
	trigger1 = NumExplod(11) < Floor(Log(10, var(11))) + 1
	id = 11
	anim = F300000 + var(11)/(10**Ifelse(NumExplod(11)=5, 6, Ifelse(NumExplod(11)=6, 5, NumExplod(11)))) % 10
	postype = Left
	pos = 155 + Floor(Log(10, var(11))) * 9 - NumExplod(11) * 9 , var(5) + 70
	sprpriority = 7
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999
	bindtime = -1
	ontop = 1
	IgnoreHitPause = 1
	scale = 0.5, 0.5
;--------------------------------------------------------------
;(scores and bonus)
;--------------------------------------------------------------
[State 0, score]
	type = Explod
	triggerall = Time > 100
	trigger1 = NumExplod(10) < Floor(Log(10, var(10))) + 1
	id = 10
	anim = F300000 + var(10)/(10**Ifelse(NumExplod(10)=5, 6, Ifelse(NumExplod(10)=6, 5, NumExplod(10)))) % 10
	postype = Left
	pos = 180 + Floor(Log(10, var(10))) * 9 - NumExplod(10) * 9 , var(5) + 98
	sprpriority = 7
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999
	bindtime = -1
	ontop = 1
	IgnoreHitPause = 1
	scale = 0.5, 0.5
;==============================================================
;[BARS] 各种各样的BAR来了。
;==============================================================
; var(0):	life
; var(1):	players life
; var(2):	damage
; var(3):	sound index
; var(4):	1/3 life switch
; var(10):	max life
; var(11-12):	just defence & block system
; var(15):	player change
; var(20):	power
; var(21):	players power
; var(22):	players type
; var(23-29):	max mode
; var(30):	max power
; var(31):	lifebar draw x
; var(32):	lifebar draw y
; var(33):	powerbar draw x
; var(34):	powerbar draw y
; var(35):	guardcrush
; var(36):	guardcrush 2
; var(40):	display all bars [0/2]
; var(41):	display power bars
; var(44):      jump type
; var(45):      *** finish
; var(46):	system sound of navigation
; var(47):	K.O. countdown
; var(48):	first attack
; var(49):	counter attack
; var(50):	dizzy
; var(51):	AI(def:-/player:-1/cpu:1)
; var(55):	stage infomation [2-99]
; var(57):	score
; var(58):	score
; var(59):	striker combo Stateno
;------------
; fvar(3-7):	bonus
; fvar(13):
;--------------------------------------------------------------
[Statedef 90900]
ctrl = 0
vel = 0, 0
poweadd = 0
;; anim = 0

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

[State 0]
	type = AssertSpecial
	trigger1 = RoundState != 2
	flag = NoBarDisplay

[State 0]
	type = NotHitBy
	trigger1 = 1
	value = SCA
;==============================================================
; init draw pos x y

; lifebar x
[State 0]
	type = varset
	trigger1 = time = 0
	var(31) = 1

; lifebar y
[State 0]
	type = varset
	trigger1 = time = 0
	var(32) = 18

; powerbar x
[State 0]
	type = varset
	trigger1 = time = 0
	var(33) = Ifelse(TeamSide = 1, 6, 314)

; powerbar y
[State 0]
	type = varset
	trigger1 = time = 0
	var(34) = 223
;--------------------------------------------------------------
; get score from parent
[State 0]
	type = varset
	trigger1 = time = 0
	trigger1 = Root,sysvar(4)
	var(57) = Root,var(58)
;==============================================================
;switch of all bars displaying

;; all bars ON
[State 0]
	type = varset
	triggerall = RoundState = 2
	triggerall = var(40) != 1
;;	trigger1 = Root,sysvar(3) = 2
	trigger1 = IsHelper(90900)
	var(40) = 1
	IgnoreHitPause = 1

;; only power bars OFF (self)
[State 0]
	type = varset
	triggerall = RoundState = 2
	triggerall = var(40) != 2
;;	trigger1 = Root,sysvar(3) > 2
;;	trigger2 = NumEnemy
;;	trigger2 = Enemy,sysvar(4)
;;	trigger2 = Enemy,sysvar(3) < 2
	trigger1 = IsHelper(90901)
	trigger2 = var(22) = 4 && !NumPartner
	var(40) = 2
	IgnoreHitPause = 1

; all bars OFF
[State 0]
	type = varset
	triggerall = var(40)
;;	trigger1 = Root,sysvar(3) < 2
;;	trigger2 = NumEnemy
;;	trigger2 = Enemy,sysvar(4)
;;	trigger2 = Enemy,sysvar(3) < 2
;;	trigger3 = NumPartner
;;	trigger3 = Root,sysvar(4) = 0
;;	trigger4 = Root,Alive = 0
	trigger1 = RoundState != 2
	var(40) = 0
	IgnoreHitPause = 1


;--------------------------------------------------------------
; player change
;--------------------------------------------------------------

[State 0]
	type = varset
	trigger1 = var(15)
	trigger1 = !NumPartner
	var(15) = 0

[State 0]
	type = varset
	trigger1 = !var(15)
	trigger1 = Root,Alive = 0
	trigger1 = NumPartner
	trigger1 = Partner,Alive
	var(15) = 1

;==============================================================
; get parents parameters

; (MaxLife)
[State 0]
	type = varset
	trigger1 = var(15) = 0
	trigger1 = var(10) != Root,LifeMax
	var(10) = Root,LifeMax
	IgnoreHitPause = 1

[State 0]
	type = varset
	trigger1 = var(15) = 1
	trigger1 = NumPartner
	trigger1 = var(10) != Partner,LifeMax
	var(10) = Partner,LifeMax
	IgnoreHitPause = 1

; (Life)
[State 0]
	type = varset
	trigger1 = var(15) = 0
	trigger1 = var(1) != Root,Life
	var(1) = Root,Life
	IgnoreHitPause = 1

[State 0]
	type = varset
	trigger1 = var(15) = 1
	trigger1 = NumPartner
	trigger1 = var(1) != Partner,Life
	var(1) = Partner,Life
	IgnoreHitPause = 1

;------------------------------
; set player mode
;------------------------------
; normal mode
[State 0]
	type = varset
	triggerall = time = 0
	trigger1 = Root,NumPartner = 0
	var(22) = 1;Ifelse(!(Root,PalNo%3), 3, Root,PalNo%3)只保留了SNK模式

; team mode
[State 0]
	type = varset
	triggerall = time = 0
	trigger1 = Root,NumPartner
	trigger1 = Root,ID < Partner,ID
 	trigger2 = IsHelper(90901)
	var(22) = 4

;------------------------------
[State 0, is red life];只剩下四分之一血时
	type = varset
	trigger1 = var(22) = 1 && !var(4)
	trigger1 = var(1) <= var(10)/4
	var(4) = 1
	IgnoreHitPause = 1
;==============================================================
; (life bar) [ID: 490###]
;==============================================================
; using var(0) to keeping heigh fps.
[State 0]
	type = RemoveExplod
	trigger1 = var(0) != var(1)
	trigger2 = !var(40)
	trigger3 = var(15) = 0
	trigger3 = var(2) != var(1)
	trigger3 = Root,MoveType != H || Root,Alive = 0 || RoundState != 2
	trigger4 = var(15) = 1
	trigger4 = NumPartner
	trigger4 = var(2) != var(1)
	trigger4 = Partner,MoveType != H || Partner,Alive = 0 || RoundState != 2
	ID = 490000
	IgnoreHitPause = 1

; 奜榞
[State 0]
	type = RemoveExplod
	trigger1 = NumExplod(490100)
	trigger1 = !NumExplod(490000)
	ID = 490100
	IgnoreHitPause = 1

[State 0]
	type = RemoveExplod
	trigger1 = NumExplod(490200)
	trigger1 = !NumExplod(490000)
	ID = 490200
	IgnoreHitPause = 1
[State 0]
	type = RemoveExplod
	trigger1 = NumExplod(490201)
	trigger1 = !NumExplod(490000)
	ID = 490201
	IgnoreHitPause = 1

; face
[State 0]
	type = RemoveExplod
	trigger1 = NumExplod(490600)
	trigger1 = !NumExplod(490000)
	ID = 490600
	IgnoreHitPause = 1

; lights
[State 0]
	type = RemoveExplod
	trigger1 = NumExplod(490500)
	trigger1 = !NumExplod(490000)
	ID = 490500
	IgnoreHitPause = 1
[State 0]
	type = RemoveExplod
	trigger1 = NumExplod(490510)
	trigger1 = !NumExplod(490000)
	ID = 490510
	IgnoreHitPause = 1

[State 0, warnning sound]
type = PlaySnd
triggerall = var(22) = 1 && RoundState = 2
trigger1 = var(4) && (var(0) > var(10)/4)
value = F10200, 1
IgnoreHitPause = 1
persistent = 0

[State 5250, 1];DANGER危险字幕
type = Explod
triggerall = var(22) = 1 && RoundState = 2
trigger1 = var(4) && (var(0) > var(10)/4)
ID = 401000
anim = f2522
sprpriority = 99999
postype = Left
pos = Ifelse(TeamSide = 1, 60, 260), 200
scale = .5,.5
ownpal = 1
ontop = 1
bindtime = -1
Supermovetime = 999999999
Pausemovetime = 999999999
IgnoreHitPause = 1
persistent = 0

;--------------------------------------------------------------
;防御BAR的代码
;--------------------------------------------------------------
[State 0, LifeBarshadow]
	type = Explod
	triggerall = !NumExplod(490000)
	trigger1 = var(40)
	ID = 490000
	anim = F200100 + var(22)
	sprpriority = -1
	postype = Left
	pos = Ifelse(TeamSide = 1, 160, 159), var(32)
	scale = 0.5, 0.5
	facing = Ifelse(TeamSide = 1, 1, -1)
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999
	bindtime = -1
	ownpal = 1
	ontop = 1
	IgnoreHitPause = 1
;---------------------------------------;奜榞
[State 0, LifeBarWindowFrame]
	type = Explod
	triggerall = !NumExplod(490100)
	trigger1 = var(40)
	ID = 490100
	anim = F200200 + TeamSide - 1
	sprpriority = -1
	postype = Left
	pos = Ifelse(TeamSide = 1, 160, 160), var(32)
;;	facing = Ifelse(TeamSide = 1, 1, -1)
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	ontop = 1
	IgnoreHitPause = 1
;---------------------------------------; ?僀僩
[State 0]
	type = Explod
	triggerall = !NumExplod(490500)
	trigger1 = var(0) > var(1)
	trigger1 = var(40)
	ID = 490500
	anim = F200500
	sprpriority = 2
	postype = Left
	pos = Ifelse(TeamSide=1,141,179) + Ifelse(TeamSide=1,-1,1) * Floor(var(1)/1.00/var(10)*108), var(32) + 1
	facing = Ifelse(TeamSide = 1, 1, -1)
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	ontop = 1
	supermovetime = 999999999
	pausemovetime = 999999999
	IgnoreHitPause = 1

[State 0]
	type = Explod
	triggerall = !NumExplod(490510)
	trigger1 = var(40)
	ID = 490510
	anim = F200510
	sprpriority = 3
	postype = Left
	pos = Ifelse(TeamSide = 1, 160, 160), var(32)
	facing = Ifelse(TeamSide = 1, 1, -1)
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	ontop = 1
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999
	IgnoreHitPause = 1
;--------------------------------------------------------------
; big damage sound
;--------------------------------------------------------------
[State 0]
type = PlaySnd
triggerall = RoundState = 2
triggerall = var(0) - var(1) > 200	;more then 200 damage!!!
trigger1 = var(15) = 0
trigger1 = Root,MoveType = H
trigger1 = Root,GetHitVar(Guarded) = 0
trigger2 = var(15) = 1 && NumPartner
trigger2 = Partner,MoveType = H
trigger2 = Partner,GetHitVar(Guarded) = 0
value = F10100, 2
channel = 20
IgnoreHitPause = 1

[State 9000, 5]
type = Explod
triggerall = RoundState = 2
triggerall = var(0) - var(1) > 200	;more then 200 damage!!!
trigger1 = var(15) = 0
trigger1 = Root,MoveType = H
trigger1 = Root,GetHitVar(Guarded) = 0
trigger2 = var(15) = 1 && NumPartner
trigger2 = Partner,MoveType = H
trigger2 = Partner,GetHitVar(Guarded) = 0
anim = f6020
scale = 0.5,0.5
pos = 160,70
postype = left
bindtime = -1
sprpriority = 99999999999999999999
facing = 1
ontop = 0
ownpal = 1
ignorehitpause = 1 

;新追加的CRUSH火花
[State 183, 3]
type = EnvShake
triggerall = RoundState = 2
triggerall = var(0) - var(1) > 200	
trigger1 = var(15) = 0
trigger1 = Root,MoveType = H
trigger1 = Root,GetHitVar(Guarded) = 0
trigger2 = var(15) = 1 && NumPartner
trigger2 = Partner,MoveType = H
trigger2 = Partner,GetHitVar(Guarded) = 0
ignorehitpause = 1
freq = 160
ampl = 6
phase = 160
time = 30

[State -2, Sp Finish]
type = Explod
triggerall = RoundState = 2
triggerall = var(0) - var(1) > 200	
trigger1 = var(15) = 0
trigger1 = Root,MoveType = H
trigger1 = Root,GetHitVar(Guarded) = 0
trigger2 = var(15) = 1 && NumPartner
trigger2 = Partner,MoveType = H
trigger2 = Partner,GetHitVar(Guarded) = 0
anim = f9910
removetime = -2
sprpriority = -1
pos = 0,0
postype = left
bindtime = -1
ignorehitpause = 1
ownpal = 1
;--------------------------------------------------------------
; memo life to var
[State 0]
	type = varset
	trigger1 = var(0) != var(1)
	var(0) = var(1)
	IgnoreHitPause = 1

; memo damage to var
[State 0]
	type = varset
	triggerall = var(2) != var(1)
	trigger1 = var(15) = 0
	trigger1 = Root,MoveType != H
	trigger2 = var(15) = 1 && NumPartner
	trigger2 = Partner,MoveType != H
	var(2) = var(1)
	IgnoreHitPause = 1

;==============================================================
;(power bar) [ID: 492###]
;==============================================================
; using var(22) to keep heigh fps.
; type 1 : sysvar(4) = 1 and Team mode
; type 2 : sysvar(4) = 2
; type 3 : sysvar(4) = 3
; type 4 : sysvar(4) = 4
[State 0]
	type = varset
	trigger1 = var(30) != Root,Const(Data.Power)
	var(30) = Root,Const(Data.Power)
	IgnoreHitPause = 1

[State 0]
	type = poweradd
	trigger1 = time = 0 && var(48) != 2
	trigger1 = RoundNo = 1 && Power < 1000
	value = 1000

;--------------------------------------------------------------
; memo power to var
[State 0]
	type = varset
	triggerall = RoundState = 2
	trigger1 = var(20) - Power != 0
	var(20) = Power
	IgnoreHitPause = 1

;==============================================================
;(GUARD CRUSH)
;==============================================================
[State 0]
	type = varset
	triggerall = var(35)
	trigger1 = !var(36)
	trigger2 = var(15) = 0
	trigger2 = var(36) && (Root,MoveType = H)
	trigger3 = var(15) = 1 && NumPartner
	trigger3 = var(36) && (Partner,MoveType = H)
	var(35) = 0

[State 0]
	type = varset
	triggerall = var(35) < 1
	trigger1 = NumEnemy
	trigger1 = Enemy,MoveType = H
	var(35) = 1

[State 0]
	type = varset
	triggerall = var(35) < 2
	trigger1 = var(15) = 0
	trigger1 = Root,StateNo = 190010
	trigger2 = var(15) = 1 && NumPartner
	trigger2 = Partner,StateNo = 190010
	var(35) = 2

[State 0]
	type = varadd
	triggerall = !var(12)
	trigger1 = var(15) = 0
	trigger1 = Root,StateNo = 150 || Root,StateNo = 152 ;|| Root,StateNo = 154 ;air
	trigger1 = Root,Time = 1
	var(36) = 1 + (Root,GetHitVar(Damage) + Root,GetHitVar(HitShakeTime))/20

;(Partner)
[State 0]
	type = varadd
	triggerall = !var(12)
	trigger1 = var(15) = 1 && NumPartner
	trigger1 = Partner,StateNo = 150 || Partner,StateNo = 152 ;|| Partner,StateNo = 154 ;air
	trigger1 = Partner,Time = 1
	var(36) = 1 + (Partner,GetHitVar(Damage) + Partner,GetHitVar(HitShakeTime))/20

[State 0]
	type = varset
	trigger1 = var(36) > 31
	var(36) = 31

[State 0]
	type = varadd
	triggerall = var(35) && var(36)
	trigger1 = var(35) = 1 && GameTime%50 = 0
	trigger2 = var(35) = 2 && GameTime%5 = 0
	var(36) = -1

[State 0]
	type = varset
	triggerall = var(36)
	trigger1 = var(15) = 0
	trigger1 = Root,StateNo = 190010
	trigger2 = var(15) = 1 && NumPartner
	trigger2 = Partner,StateNo = 190010
	var(36) = var(36) / 2
;-------------------------------------------------------------
[State 0, GCB]
	type = RemoveExplod
	triggerall = NumExplod(493000)
	trigger1 = !var(40)
	trigger2 = var(37) != var(36)
;--;	trigger3 = var(35) || Root,StateNo = 190010
	ID = 493000
	IgnoreHitPause = 1

[State 0, GuardBar-Frame0]
	type = Explod
	triggerall = NumExplod(490000) && NumExplod(490100)
	triggerall = NumExplod(493000) < 1
	trigger1 = var(40)
	ID = 493000
	anim = F210010
	sprpriority = 3
	postype = Left
	pos = 160, var(32)
	facing = Ifelse(TeamSide = 1, 1, -1)
	scale = 0.3, 0.8
	bindtime = -1
	ownpal = 1
	ontop = 1
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999
	IgnoreHitPause = 1

[State 0, GuardBar-1];防御槽能量
	type = Explod
	triggerall = NumExplod(490000) && NumExplod(490100)
	triggerall = NumExplod(493000) < 2
	trigger1 = var(40)
	ID = 493000
	Anim = F210000
	Sprpriority = 4
	Postype = Left
	pos = Ifelse(TeamSide = 1, 28 + var(36), 262), var(32) + 14
	scale = Ifelse((var(36) = [1, 31]), 31 - var(36), 31), 0.7
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999
	bindtime = -1
	ownpal = 1
	ontop = 1
	IgnoreHitPause = 1

[State 0, GuardBar-2]
	type = Explod
	triggerall = NumExplod(490000) && NumExplod(490100)
	triggerall = NumExplod(493000) < 3
	trigger1 = var(40)
	ID = 493000
	anim = F210005
	sprpriority = 4
	postype = Left
	pos = Ifelse(TeamSide = 1, 92 + var(36), 178 + 50 - var(36)), var(32) + 12
	Facing = Ifelse(TeamSide = 1, 1, -1)
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	ontop = 1
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999
	IgnoreHitPause = 1

; 防御巴的外框
[State 0, GuardBar-Frame2]
	type = Explod
	triggerall = NumExplod(490000) && NumExplod(490100)
	triggerall = NumExplod(493000) < 4
	trigger1 = var(40)
	ID = 493000
	anim = F210011 + (var(36)>=25)
	sprpriority = 7
	postype = Left
	pos = 160, var(32)
	facing = Ifelse(TeamSide = 1, 1, -1)
	scale = 0.3, 0.8
	bindtime = -1
	ownpal = 1
	ontop = 1
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999
	IgnoreHitPause = 1

; memo guardpoint
[State 0]
	type = varset
	trigger1 = var(37) != var(36)
	var(37) = var(36)

;==============================================================
; long jump
;==============================================================
[State 0]
	type = varset
	triggerall = var(44) < 2
	triggerall = var(15) = 0
	triggerall = Root,StateType != A
	trigger1 = Root,Command = "holddown"
	trigger2 = Root,Command = "holddown" && (Root,Command = "holdfwd" || Root,Command = "holdback")
	var(44) = 16
	IgnoreHitPause = 1
[State 0]
	type = varset
	triggerall = var(44) < 2
	triggerall = var(15) = 1 && NumPartner
	triggerall = Partner,StateType != A
	trigger1 = Partner,Command = "holddown"
	trigger2 = Partner,Command = "holddown" && (Partner,Command = "holdfwd" || Partner,Command = "holdback")
	var(44) = 16
	IgnoreHitPause = 1

[State 0]
	type = varadd
	trigger1 = var(44) > 0
	var(44) = -1

;==============================================================
; (State 5210recovery!)
;==============================================================
; recovery message
[State 0];天蓝色底板
	type = null;Explod
	triggerall = RoundState = 2
	triggerall = !NumExplod(402001)
	trigger1 = var(15) = 0
	trigger1 = Root,StateNo = 5210 && Root,Time = 1 ;air rec
	trigger2 = var(15) = 1 && NumPartner
	trigger2 = Partner,StateNo = 5210 && Partner,Time = 1 ;air rec
	ID = 402001
	anim = F400007
	sprpriority = -1
	postype = Left
	pos = Ifelse(TeamSide = 1, 65, 255), 100 + (NumExplod(400000) + NumExplod(401000) + NumExplod(1195500)) * 14
	facing = Ifelse(TeamSide = 1, 1, -1)
	scale = 0.5, 0.5
	ownpal = 1
	ontop = 1
	bindtime = -1
	Supermovetime = 999999999
	Pausemovetime = 999999999
[State 0]
	type = Explod
	triggerall = RoundState = 2
	triggerall = !NumExplod(402000)
	trigger1 = var(15) = 0
	trigger1 = Root,StateNo = 5210 && Root,Time = 1 ;air rec
	trigger2 = var(15) = 1 && NumPartner
	trigger2 = Partner,StateNo = 5210 && Partner,Time = 1 ;air rec
	ID = 402000
	anim = F402000 + (TeamSide-1)
	sprpriority = 5
	postype = left
	pos = Ifelse(TeamSide = 1, 45, 275), 100 + (NumExplod(400000) + NumExplod(401000) + NumExplod(1195500)) * 14
	scale = 0.5, 0.5
	ownpal = 1
	ontop = 1
	bindtime = -1
	Supermovetime = 999999999
	Pausemovetime = 999999999

;==============================================================
; FA
;==============================================================
; var(48)
[State 0]
	type = varset
	triggerall = RoundState = 2
	triggerall = var(48) = 0
	trigger1 = NumEnemy
	trigger1 = Enemy,sysvar(4)
	trigger1 = Enemy,NumExplod(920000)
	trigger2 = Root,sysvar(4)
	trigger2 = Root,NumExplod(920000)
	var(48) = -9
	IgnoreHitPause = 1

[State 0]
	type = varset
	triggerall = RoundState = 2
	triggerall = var(48) = 0
	trigger1 = Root,MoveType = H && Root,GetHitVar(Guarded) = 0
	trigger2 = NumPartner
	trigger2 = Partner,MoveType = H && Partner,GetHitVar(Guarded) = 0
	var(48) = -1
	IgnoreHitPause = 1
; enemy
[State 0]
	type = varset
	triggerall = RoundState = 2
	triggerall = var(48) = 0
	trigger1 = NumEnemy
	trigger1 = Enemy,MoveType = H && (Enemy,GetHitVar(Guarded)) = 0
	var(48) = 1
	IgnoreHitPause = 1

; first attact sound
[State 0, fa sound]
	type = PlaySnd
	trigger1 = RoundState = 2
	trigger1 = var(48) = 1
	value = F10100, 1
	channel = 20

; first attack get bonus
[State 0]
	type = varadd
	trigger1 = RoundState = 2
	trigger1 = var(48) = 1
	var(57) = 100

;-----------------------
; first attact message
[State 0];红色底板
	type = null;Explod
	trigger1 = RoundState = 2
	trigger1 = var(48) = 1 && !NumExplod(400001)
	ID = 400001
	anim = F400005
	sprpriority = -1
	postype = Left
	pos = Ifelse(TeamSide = 1, 65, 255), 100 + (NumExplod(401000) + NumExplod(1195500)) * 14
	facing = Ifelse(TeamSide = 1, 1, -1)
	scale = 0.5, 0.5
	ownpal = 1
	ontop = 1
	bindtime = -1
	Supermovetime = 999999999
	Pausemovetime = 999999999
[State 0]
	type = Explod
	trigger1 = RoundState = 2
	trigger1 = var(48) = 1 && !NumExplod(400000)
	ID = 400000
	anim = F400000 + (TeamSide-1)
	sprpriority = 1
	postype = Left
	pos = Ifelse(TeamSide = 1, 55, 265), 100 + (NumExplod(401000) + NumExplod(1195500)) * 14
	scale = 0.5, 0.5
	ownpal = 1
	ontop = 1
	bindtime = -1
	Supermovetime = 999999999
	Pausemovetime = 999999999


; first attack var
[State 0]
	type = varset
	trigger1 = var(48) = 1
	var(48) = 2

; first attack icon
[State 0]
	type = Explod
	triggerall = !NumExplod(400010)
	trigger1 = var(40) ;display all bars
	trigger1 = var(48) = 2
	ID = 400010
	anim = F400010
	sprpriority = 2
	postype = Left
	pos = Ifelse(TeamSide = 1, 40, 280), var(32) - 14
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	ontop = 1
	scale = 0.5, 0.5
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999

; RemoveFA
[State 0]
	type = RemoveExplod
	trigger1 = NumExplod(400010)
	trigger1 = var(40) = 0
	ID = 400010

;--------------------------------------------------------------
;COUNTER
;--------------------------------------------------------------
;var(49)
; counter hit set
[State 0]
	type = varset
	triggerall = RoundState = 2
	triggerall = !var(49)
	triggerall = NumEnemy
;;;	triggerall = Enemy,NumHelper(90900) || Enemy,NumHelper(90901) || Enemy,NumHelper(90902)
	triggerall = Enemy,MoveType = A
	triggerall = Enemy,StateNo != 195500
	trigger1 = var(15) = 0
	trigger1 = Root,MoveType != A
	trigger2 = var(15) = 1 && NumPartner
	trigger2 = Partner,MoveType != A
	var(49) = 1
	IgnoreHitPause = 1

; counter hit
[State 0]
	type = varset
	triggerall = RoundState = 2
	triggerall = var(49) = 1
	triggerall = NumEnemy
;;;	triggerall = Enemy,NumHelper(90900) || Enemy,NumHelper(90901) || Enemy,NumHelper(90902)
	triggerall = Enemy,MoveType = H
	trigger1 = var(15) = 0
	trigger1 = Root,MoveHit
	trigger2 = var(15) = 1 && NumPartner
	trigger2 = Partner,MoveHit
	var(49) = 2
	IgnoreHitPause = 1

; sound of counter
[State 0]
	type = PlaySnd
	triggerall = RoundState = 2
	trigger1 = var(49) = 2 && !NumExplod(401000)
	value = F10200, 0
       volume = 250
	channel = 20
	IgnoreHitPause = 1

;-------------------
; get bonus - score
[State 0]
	type = VarAdd
	triggerall = var(51) = -1
	triggerall = RoundState = 2
	trigger1 = var(49) = 2 && !NumExplod(401000)
	var(57) = 110
	IgnoreHitPause = 1

; get bonus - ranking
[State 0]
	type = varadd
	triggerall = RoundState = 2
	trigger1 = var(49) = 2 && !NumExplod(401000)
	fvar(5) = 1
	IgnoreHitPause = 1

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

[State -2]
type = EnvColor
triggerall = RoundState = 2
;triggerall = !NumExplod(401002)
trigger1 = var(49) = 2
value = 255,255,255
time = 1
under = 1
ignorehitpause = 1
persistent = 1

[State -2]
type = AssertSpecial
triggerall = RoundState = 2
trigger1 = var(49) = 2
flag = nojugglecheck

[State 0]
type = null;Explod
triggerall = RoundState = 2
trigger1 = var(49) = 2
anim = F20+(random&1);13+(random%4)
sprpriority = 45
postype = Left
pos = Floor(enemy,ScreenPos X + Const(Size.mid.Pos.X)), Floor(enemy,ScreenPos Y + Const(Size.mid.Pos.Y))
facing = facing;enemy,facing
velocity = 0,0
ownpal = 1
IgnoreHitPause = 1

[State 5100, EnvShake]
type = EnvShake
triggerall = RoundState = 2
trigger1 = var(49) = 2
;trigger1 = Time = 0
time = 20
ampl = 6
freq = 130

[State 0, Pause]
type = Pause
triggerall = RoundState = 2
trigger1 = var(49) = 2
;trigger1 = Time = 0
time = 6
movetime = 0

; counter hit message
[State 0];蓝色底板
	type = null;Explod
	triggerall = RoundState = 2
	triggerall = !NumExplod(401000)
	trigger1 = var(49) = 2
;;	trigger2 = Root,StateNo = 8200
;;	trigger3 = NumPartner
;;	trigger3 = Partner,StateNo = 8200
	ID = 401001
	anim = F400006
	sprpriority = -1
	postype = Left
	pos = Ifelse(TeamSide = 1, 65, 255), 100 + (NumExplod(400000) + NumExplod(1195500)) * 14
	facing = Ifelse(TeamSide = 1, 1, -1)
	scale = 0.5, 0.5
	ownpal = 1
	ontop = 1
	bindtime = -1
	Supermovetime = 999999999
	Pausemovetime = 999999999
	IgnoreHitPause = 1
[State 0]
	type = Explod
	triggerall = RoundState = 2
	triggerall = !NumExplod(401000)
	trigger1 = var(49) = 2
;;	trigger2 = Root,StateNo = 8200
;;	trigger3 = NumPartner
;;	trigger3 = Partner,StateNo = 8200
	ID = 401000
	anim = F401000 + TeamSide - 1
	sprpriority = 2
	postype = Left
	pos = Ifelse(TeamSide = 1, 45, 275), 100 + (NumExplod(400000) + NumExplod(1195500)) * 14
	scale = 0.5, 0.5
	ownpal = 1
	ontop = 1
	bindtime = -1
	Supermovetime = 999999999
	Pausemovetime = 999999999
	IgnoreHitPause = 1


; counter hit reset
[State 0]
	type = varset
	triggerall = var(49)
	triggerall = NumEnemy
;;;	trigger1 = Enemy,NumHelper(90900) || Enemy,NumHelper(90901) || Enemy,NumHelper(90902)
	trigger1 = Enemy,MoveType != A
	trigger2 = Enemy,StateNo = 195500
	var(49) = 0
	IgnoreHitPause = 1
;--------------------------------------------------------------
; 无用 blocking/JD mark
;--------------------------------------------------------------
[State 0]
	type = RemoveExplod
	triggerall = RoundState = 2
	triggerall = NumExplod(1195501)
	trigger1 = Root,StateNo = 195500 && Root,Time = 1
	trigger2 = NumPartner
	trigger2 = Partner,StateNo = 195500 && Partner,Time = 1
	ID = 1195501
[State 0]
	type = RemoveExplod
	triggerall = RoundState = 2
	triggerall = NumExplod(1195500)
	trigger1 = Root,StateNo = 195500 && Root,Time = 1
	trigger2 = NumPartner
	trigger2 = Partner,StateNo = 195500 && Partner,Time = 1
	ID = 1195500

[State 0]
	type = Explod
	triggerall = RoundState = 2
	triggerall = !NumExplod(1195501)
	trigger1 = Root,StateNo = 195500 && Root,Time = 1
	trigger2 = NumPartner
	trigger2 = Partner,StateNo = 195500 && Partner,Time = 1
	ID = 1195501
	anim = F400006 - (var(22) = 3)
	sprpriority = -1
	postype = Left
	pos = Ifelse(TeamSide = 1, 65, 255), 100 ;;+ (NumExplod(400000) + NumExplod(401000)) * 14
	facing = Ifelse(TeamSide = 1, 1, -1)
	scale = 0.5, 0.5
	ownpal = 1
	ontop = 1
	bindtime = -1
	Supermovetime = 999999999
	Pausemovetime = 999999999
	IgnoreHitPause = 1
[State 0]
	type = Explod
	triggerall = RoundState = 2
	triggerall = !NumExplod(1195500)
	trigger1 = Root,StateNo = 195500 && Root,Time = 1
	trigger2 = NumPartner
	trigger2 = Partner,StateNo = 195500 && Partner,Time = 1
	ID = 1195500
	anim = F195500 + (TeamSide-1)*10 + (var(22)=3)*100 ;; + NumExplod(1195509)
	sprpriority = 2
	postype = Left
	pos = Ifelse(TeamSide = 1, 65, 255), 100 ;;+ (NumExplod(400000) + NumExplod(401000)) * 14
	scale = 0.5, 0.5
	ownpal = 1
	ontop = 1
	bindtime = -1
	Supermovetime = 999999999
	Pausemovetime = 999999999
	IgnoreHitPause = 1

;==============================================================
;打得多HITS的评分，原本 from CVS2
;==============================================================
; var(46)
; sound of rush hits
[State 0]
	type = VarSet
	triggerall = RoundState = 2 ;;&& Root,sysvar(4)
	triggerall = !var(46) || var(46) = 3
	trigger1 = var(15) = 0
	trigger1 = Root,MoveType = H && Root,GetHitVar(Guarded) = 0
	trigger1 = Root,StateNo != [120,155]
	trigger1 = (Root,GetHitVar(HitCount)) >= 5		;more then 5 hits
	var(46) = Ifelse((Root,GetHitVar(HitCount)) > 9, 4, 3)
	IgnoreHitPause = 1
[State 0]
	type = VarSet
	triggerall = RoundState = 2 ;;&& Root,sysvar(4)
	triggerall = !var(46) || var(46) = 3
	trigger1 = var(15) = 1 && NumPartner
	trigger1 = Partner,MoveType = H && Partner,GetHitVar(Guarded) = 0
	trigger1 = Partner,StateNo != [120,155]
	trigger1 = (Partner,GetHitVar(HitCount)) >= 5		;more then 5 hits
	var(46) = Ifelse((Partner,GetHitVar(HitCount)) > 9, 4, 3)
	IgnoreHitPause = 1

; system sound
[State 0]
	type = PlaySnd
	triggerall = RoundState = 2 ;;&& Root,sysvar(4)
	triggerall = var(46)
	trigger1 = var(15) = 0
	trigger1 = Root,MoveType != H 
	trigger2 = var(15) = 1 && NumPartner
	trigger2 = Partner,MoveType != H 
	value = F10100, var(46)
	channel = 20
	IgnoreHitPause = 1

[State 0]
	type = Explod
	triggerall = RoundState = 2 ;;&& Root,sysvar(4)
	triggerall = var(46) = 3
	trigger1 = var(15) = 0
	trigger1 = Root,MoveType != H 
	trigger2 = var(15) = 1 && NumPartner
	trigger2 = Partner,MoveType != H 
	anim = f6022
	sprpriority = -1
	postype = Left
	pos = Ifelse(TeamSide = 2, 50, 270), 205;105(原先在COMBO下的设定)
	facing = 1
	scale = .5,.5;0.4, 0.4
	ownpal = 1
	ontop = 1
	bindtime = -1
	Supermovetime = 999999999
	Pausemovetime = 999999999

[State 0]
	type = Explod
	triggerall = RoundState = 2 ;;&& Root,sysvar(4)
	triggerall = var(46) = 4
	trigger1 = var(15) = 0
	trigger1 = Root,MoveType != H 
	trigger2 = var(15) = 1 && NumPartner
	trigger2 = Partner,MoveType != H 
	anim = f6023
	sprpriority = -1
	postype = Left
	pos = Ifelse(TeamSide = 2, 60, 260),205;105(原先在COMBO下的设定)
	facing = 1
	scale = .4,.4;0.35, 0.35
	ownpal = 1
	ontop = 1
	bindtime = -1
	Supermovetime = 999999999
	Pausemovetime = 999999999

[State 9000, 5]
type = null;Explod   以前在屏幕中间的写法
	triggerall = RoundState = 2 ;;&& Root,sysvar(4)
	triggerall = var(46) = 4
	trigger1 = var(15) = 0
	trigger1 = Root,MoveType != H 
	trigger2 = var(15) = 1 && NumPartner
	trigger2 = Partner,MoveType != H 
anim = f6023
scale = 0.5,0.5
pos = 160,70
postype = left
bindtime = -1
sprpriority = 99999999999999999999
facing = 1
ontop = 0
ownpal = 1
ignorehitpause = 1 

; reset
[State 0]
	type = VarSet
	triggerall = RoundState = 2 ;;&& Root,sysvar(4)
	triggerall = var(46)
	trigger1 = var(15) = 0
	trigger1 = Root,MoveType != H
	trigger2 = var(15) = 0
	trigger2 = Root,MoveType = H && (Root,GetHitVar(HitCount)) < 4
	trigger3 = var(15) = 0
	trigger3 = Root,StateNo = [120,155]

	trigger4 = var(15) = 1 && NumPartner
	trigger4 = Partner,MoveType != H
	trigger5 = var(15) = 1 && NumPartner
	trigger5 = Partner,MoveType = H && (Partner,GetHitVar(HitCount)) < 4
	trigger6 = var(15) = 1 && NumPartner
	trigger6 = Partner,StateNo = [120,155]
	var(46) = 0
	IgnoreHitPause = 1

;--------------------------------------------------------------
; 僸僢僩僗僷乕僋丒棻
;--------------------------------------------------------------
; (Root)
[State 0]
	type = Explod
	triggerall = NumExplod(505000) < 5
	triggerall = Root,StateNo = 5000 || Root,StateNo = 5010 || Root,StateNo = 5020 || Root,StateNo = 5070 || Root,StateNo = 5100
	triggerall = Root,Time < 5
	trigger1 = Root,Anim = 5002 || Root,Anim = 5012 || Root,Anim = 5022 || Root,Anim = 5030
	trigger2 = Root,Anim = 5001 || Root,Anim = 5011 || Root,Anim = 5021
	ID = 505000
	anim = F80 + Random%5
	sprpriority = -5
	postype = Left
	pos = Floor(Root,ScreenPos X + Const(Size.mid.Pos.X)), Floor(Root,ScreenPos Y + Const(Size.mid.Pos.Y))
;--;	facing = Root,facing
	velocity = (-1 - (Random%80)/10.00) * Root,facing, 1 + ((Random%100)-50)/10.00
	ownpal = 1
	IgnoreHitPause = 1

; (Partner)
[State 0]
	type = Explod
	triggerall = NumExplod(505001) < 5
	triggerall = NumPartner
	triggerall = Partner,StateNo = 5000 || Partner,StateNo = 5010 || Partner,StateNo = 5020 || Partner,StateNo = 5070 || Partner,StateNo = 5100
	triggerall = Partner,Time < 5
	trigger1 = Partner,Anim = 5002 || Partner,Anim = 5012 || Partner,Anim = 5022 || Partner,Anim = 5030
	trigger2 = Partner,Anim = 5001 || Partner,Anim = 5011 || Partner,Anim = 5021
	ID = 505001
	anim = F80 + Random%5
	sprpriority = -5
	postype = Left
	pos = Floor(Partner,ScreenPos X + Partner,Const(Size.mid.Pos.X)), Floor(Partner,ScreenPos Y + Partner,Const(Size.mid.Pos.Y))
;--;	facing = Partner,facing
	velocity = (-1 - (Random%80)/10.00) * Root,facing, 1 + ((Random%100)-50)/10.00
	ownpal = 1
	IgnoreHitPause = 1

;==============================================================
;var(58),var(57)
; get bonus
;==============================================================
[State 0]
	type = VarAdd
	triggerall = var(51) < 1
	triggerall = RoundState = 2
	trigger1 = NumEnemy
	trigger1 = Enemy,GetHitVar(HitShakeTime) > 0
	trigger1 = Enemy,MoveType = H && Enemy,GetHitVar(Guarded) = 0
	var(57) = 2
	IgnoreHitPause = 1
[State 0]
	type = VarAdd
	triggerall = var(51) < 1
	triggerall = RoundState = 2
	triggerall = NumEnemy
	triggerall = Enemy,GetHitVar(HitShakeTime) > 0
	triggerall = Enemy,MoveType = H && Enemy,GetHitVar(Guarded) = 0
	trigger1 = Root,HitDefAttr = SCA, SA, ST, SP
	trigger2 = NumPartner
	trigger2 = Partner,HitDefAttr = SCA, SA, ST, SP
	var(57) = 15
	IgnoreHitPause = 1
[State 0]
	type = VarAdd
	triggerall = var(51) < 1
	triggerall = RoundState = 2
	triggerall = NumEnemy
	triggerall = Enemy,GetHitVar(HitShakeTime) > 0
	triggerall = Enemy,MoveType = H && Enemy,GetHitVar(Guarded) = 0
	trigger1 = Root,HitDefAttr = SCA, SA, ST, SP
	trigger2 = NumPartner
	trigger2 = Partner,HitDefAttr = SCA, HA, HT, HP
	var(57) = 55
	IgnoreHitPause = 1

[State 0, get bonus proj]
	type = varadd
	triggerall = var(51) < 1
	triggerall = RoundState = 2
	trigger1 = Root,ProjHitTime(0) != -1 && Root,ProjHitTime(0) = 1
	trigger2 = NumPartner
	trigger2 = Partner,ProjHitTime(0) != -1 && Partner,ProjHitTime(0) = 1
	var(57) = 100
	IgnoreHitPause = 1

[State 0, get tec sbonus]
	type = varadd
	triggerall = var(51) < 1
	triggerall = RoundState = 2
	trigger1 = Root,StateNo = 195500
	trigger1 = Root,Time = 1
	var(57) = 100
	IgnoreHitPause = 1


;--------------------------------------------------------------
;; 计分	[ID:98###]
;--------------------------------------------------------------
[State 0]
	type = RemoveExplod
	triggerall = NumExplod(98000)
	trigger1 = var(57)%10 != var(58)%10
	trigger2 = var(40) = 0
	trigger3 = TeamSide = 1 && Floor(Log(10,var(57))) != Floor(Log(10,(var(58))))
	id = 98000
	IgnoreHitPause = 1
[State 0]
	type = RemoveExplod
	triggerall = NumExplod(98001)
	trigger1 = var(57)/10%10 != var(58)/10%10
	trigger2 = var(40) = 0
	trigger3 = TeamSide = 1 && Floor(Log(10,var(57))) != Floor(Log(10,(var(58))))
	id = 98001
	IgnoreHitPause = 1
[State 0]
	type = RemoveExplod
	triggerall = NumExplod(98002)
	trigger1 = var(57)/100%10 != var(58)/100%10
	trigger2 = var(40) = 0
	trigger3 = TeamSide = 1 && Floor(Log(10,var(57))) != Floor(Log(10,(var(58))))
	id = 98002
	IgnoreHitPause = 1
[State 0]
	type = RemoveExplod
	triggerall = NumExplod(98003)
	trigger1 = var(57)/1000%10 != var(58)/1000%10
	trigger2 = var(40) = 0
	trigger3 = TeamSide = 1 && Floor(Log(10,var(57))) != Floor(Log(10,(var(58))))
	id = 98003
	IgnoreHitPause = 1
[State 0]
	type = RemoveExplod
	triggerall = NumExplod(98004)
	trigger1 = var(57)/10000%10 != var(58)/10000%10
	trigger2 = var(40) = 0
	trigger3 = TeamSide = 1 && Floor(Log(10,var(57))) != Floor(Log(10,(var(58))))
	id = 98004
	IgnoreHitPause = 1
[State 0]
	type = RemoveExplod
	triggerall = NumExplod(98005)
	trigger1 = var(57)/100000%10 != var(58)/100000%10
	trigger2 = var(40) = 0
	trigger3 = TeamSide = 1 && Floor(Log(10,var(57))) != Floor(Log(10,(var(58))))
	id = 98005
	IgnoreHitPause = 1
[State 0]
	type = RemoveExplod
	triggerall = NumExplod(98006)
	trigger1 = var(57)/1000000%10 != var(58)/1000000%10
	trigger2 = var(40) = 0
	trigger3 = TeamSide = 1 && Floor(Log(10,var(57))) != Floor(Log(10,(var(58))))
	id = 98006
	IgnoreHitPause = 1

; 嶲徠曄?
[State 0]
	type = varset
	trigger1 = var(58) != var(57)
	var(58) = var(57)
	IgnoreHitPause = 1


; 揰?昤夋
[State 0]
	type = Explod
	id = 98000
	triggerall = !NumExplod(98000)
	triggerall = var(40) && RoundState = 2
	triggerall = var(51) < 1
	trigger1 = var(58) > 0
	anim = F300000 + var(58)%10
	postype = Left
	pos = Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9 + 54, 258), var(32) - 15
	sprpriority = 0
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	ontop = 1
	removetime = -1
	supermovetime = 999999
	pausemovetime = 999999
	IgnoreHitPause = 1
[State 0]
	type = Explod
	id = 98001
	triggerall = !NumExplod(98001)
	triggerall = var(40) && RoundState = 2
	triggerall = var(51) < 1
	trigger1 = var(58) > 9
	anim = F300000 + var(58)/10%10
	postype = Left
	pos = Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9 + 45, 249), var(32) - 15
	sprpriority = 0
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	ontop = 1
	removetime = -1
	supermovetime = 999999
	pausemovetime = 999999
	IgnoreHitPause = 1
[State 0]
	type = Explod
	id = 98002
	triggerall = !NumExplod(98002)
	triggerall = var(40) && RoundState = 2
	triggerall = var(51) < 1
	trigger1 = var(58) > 99
	anim = F300000 + var(58)/100%10
	postype = Left
	pos = Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9 + 36, 240), var(32) - 15
	sprpriority = 0
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	ontop = 1
	removetime = -1
	supermovetime = 999999
	pausemovetime = 999999
	IgnoreHitPause = 1
[State 0]
	type = Explod
	id = 98003
	triggerall = !NumExplod(98003)
	triggerall = var(40) && RoundState = 2
	triggerall = var(51) < 1
	trigger1 = var(58) > 999
	anim = F300000 + var(58)/1000%10
	postype = Left
	pos = Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9 + 27, 231), var(32) - 15
	sprpriority = 0
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	ontop = 1
	removetime = -1
	supermovetime = 999999
	pausemovetime = 999999
	IgnoreHitPause = 1
[State 0]
	type = Explod
	id = 98004
	triggerall = !NumExplod(98004)
	triggerall = var(40) && RoundState = 2
	triggerall = var(51) < 1
	trigger1 = var(58) > 9999
	anim = F300000 + var(58)/10000%10
	postype = Left
	pos = Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9 + 18, 222), var(32) - 15
	sprpriority = 0
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	ontop = 1
	removetime = -1
	supermovetime = 999999
	pausemovetime = 999999
	IgnoreHitPause = 1
[State 0]
	type = Explod
	id = 98005
	triggerall = !NumExplod(98005)
	triggerall = var(40) && RoundState = 2
	triggerall = var(51) < 1
	trigger1 = var(58) > 99999
	anim = F300000 + var(58)/100000%10
	postype = Left
	pos = Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9 + 9, 213), var(32) - 15
	sprpriority = 0
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	ontop = 1
	removetime = -1
	supermovetime = 999999
	pausemovetime = 999999
	IgnoreHitPause = 1
[State 0]
	type = Explod
	id = 98006
	triggerall = !NumExplod(98006)
	triggerall = var(40) && RoundState = 2
	triggerall = var(51) < 1
	trigger1 = var(58) > 999999
	anim = F300000 + var(58)/1000000%10
	postype = Left
	pos = Ifelse(TeamSide=1, Floor(Log(10,var(58))) * 9, 204), var(32) - 15
	sprpriority = 0
	scale = 0.5, 0.5
	bindtime = -1
	ownpal = 1
	ontop = 1
	removetime = -1
	supermovetime = 999999
	pausemovetime = 999999
	IgnoreHitPause = 1
;--------------------------------------------------------------
;; "CPU"
;--------------------------------------------------------------
[State 0, CPU-mark]
	type = Explod
	triggerall = var(51) = 1	;isAI
	triggerall = var(40)
	trigger1 = !NumExplod(297000)
	ID = 297000
	anim = F297000
	postype = Left
	pos = Ifelse(TeamSide = 1, 62, 230), 3
	sprpriority = 5
	removetime = -1
	supermovetime = 999999999
	pausemovetime = 999999999
	bindtime = -1
	ownpal = 1
	ontop = 1
	IgnoreHitPause = 1
	scale = 0.5, 0.5

[State 0, Remove CPU]
	type = RemoveExplod
	triggerall = NumExplod(297000)
	trigger1 = !var(40)
	ID = 297000
	IgnoreHitPause = 1
;==============================================================
;(dizzy process)
;==============================================================
[State 0]
	type = Varadd
	trigger1 = var(50) > 0
	var(50) = -1
;nor;	IgnoreHitPause = 1

[State 0]
	type = Varadd
	triggerall = Root,UniqHitCount <= 1
	triggerall = Root,GetHitVar(hitcount) < 3
	triggerall = Root,Time <= 1
	trigger1 = Root,Stateno = 5001 && Root,Anim = 5000 ;S
	trigger2 = Root,Stateno = 5001 && Root,Anim = 5010 ;C
	trigger3 = Root,Stateno = 5011 && Root,Anim = 5020 ;A
	var(50) = 50
	IgnoreHitPause = 1

[State 0]
	type = Varadd
	triggerall = Root,UniqHitCount <= 1
	triggerall = Root,GetHitVar(hitcount) < 3
	triggerall = Root,Time <= 1
	trigger1 = Root,Stateno = 5001 && Root,Anim = 5001
	trigger2 = Root,Stateno = 5001 && Root,Anim = 5011
	trigger3 = Root,Stateno = 5011 && Root,Anim = 5021
	var(50) = 100
	IgnoreHitPause = 1

[State 0]
	type = Varadd
	triggerall = Root,UniqHitCount <= 1
	triggerall = Root,GetHitVar(hitcount) < 3
	triggerall = Root,Time <= 1
	trigger1 = Root,Stateno = 5001 && Root,Anim = 5002
	trigger2 = Root,Stateno = 5001 && Root,Anim = 5012
	trigger3 = Root,Stateno = 5011 && Root,Anim = 5022
	var(50) = 200
	IgnoreHitPause = 1

[State 0]
	type = VarSet
	trigger1 = Root,StateNo = 190111
	var(50) = 0
	IgnoreHitPause = 1

;-------------------
; spinning the controll buttons!!!?

[State 0]
	type = VarSet
	trigger1 = Root,StateNo = 190111
	var(52) = 0
	IgnoreHitPause = 1

[State 0]
	type = varadd
	triggerall = Root,StateNo = 190116
	trigger1 = Root,command = "holdfwd"
	trigger1 = GameTime%8 = [0,1]
	trigger2 = Root,command = "holdback"
	trigger2 = GameTime%8 = [2,3]
	trigger3 = Root,command = "holdup"
	trigger3 = GameTime%8 = [4,5]
	trigger4 = Root,command = "holddown"
	trigger4 = GameTime%8 = [6,7]
	var(52) = 1
	IgnoreHitPause = 1
;==============================================================
; MaxHitCombo
;==============================================================
; MaxHitCombo bonus p1
[State 0]
	type = varset
	triggerall = RoundState = 2
	trigger1 = Root,GetHitVar(HitCount)
	trigger1 = Root,GetHitVar(HitCount) > fvar(3)
	fvar(3) = Root,GetHitVar(HitCount)
[State 0]
	type = varset
	triggerall = RoundState = 2
	triggerall = NumPartner
	trigger1 = Partner,GetHitVar(HitCount)
	trigger1 = Partner,GetHitVar(HitCount) > fvar(3)
	fvar(3) = Partner,GetHitVar(HitCount)

; MaxHitCombo bonus p2
[State 0]
	type = varset
	triggerall = RoundState = 2
	trigger1 = NumEnemy
	trigger1 = Enemy,GetHitVar(HitCount)
	trigger1 = Enemy,GetHitVar(HitCount) > fvar(13)
	fvar(13) = Enemy,GetHitVar(HitCount)

; Guard point
[State 0]
	type = varadd
	triggerall = RoundState = 2
	triggerall = !var(12)     ;; << not in 'just defence' mode!
	triggerall = NumEnemy
	triggerall = !(Enemy, HitDefAttr = SCA, NA, NP)
	trigger1 = Root,StateNo = 150 || Root,StateNo = 152 || Root,StateNo = 154 ;air
	trigger1 = Root,Time = 1
	fvar(4) = (Root,GetHitVar(Damage) + Root,GetHitVar(HitShakeTime))/20.00
[State 0]
	type = varadd
	triggerall = RoundState = 2
	triggerall = !var(12)     ;; << not in 'just defence' mode!
	triggerall = NumEnemy
	triggerall = !(Enemy, HitDefAttr = SCA, NA, NP)
	trigger1 = NumPartner
	trigger1 = Partner,StateNo = 150 || Partner,StateNo = 152 || Partner,StateNo = 154 ;air
	trigger1 = Partner,Time = 1
	fvar(4) = (Partner,GetHitVar(Damage) + Partner,GetHitVar(HitShakeTime))/20.00
;---------------
; blocking / just defence bonus
[State 0]
	type = varadd
	triggerall = RoundState = 2
	trigger1 = Root,StateNo = 195500
	trigger1 = Root,Time = 1
	fvar(6) = 0.5
	IgnoreHitPause = 1

; guard bonus
[State 0]
	type = varadd
	triggerall = RoundState = 2
	triggerall = var(12)      ;; << in just defence mode!
	trigger1 = Root,StateNo = 150 || Root,StateNo = 152 || Root,StateNo = 154 ;air
	trigger1 = Root,Time = 1
	fvar(7) = 0.25
	IgnoreHitPause = 1

[State 0]
	type = varadd
	triggerall = var(47) < 10
	trigger1 = Win
	trigger2 = NumEnemy
	trigger2 = Enemy,Win
	var(47) = 1
	IgnoreHitPause = 1


;==============================================================
;(special finish message)
;==============================================================
[State 0]
	type = varset
	triggerall = var(47) < 2
	triggerall = var(45) = 0
	trigger1 = Root,WinKO
	trigger1 = Root,MoveHit
;or;	trigger1 = Root,HitDefAttr = SCA, SA, SP, ST
	trigger1 = !(Root,HitDefAttr = SCA, HA, HP, HT || Root,HitDefAttr = SCA, NA, NP, NT)
	trigger2 = NumPartner
	trigger2 = Partner,WinKO
	trigger2 = Partner,MoveHit
	trigger2 = !(Partner,HitDefAttr = SCA, HA, HP, HT || Partner,HitDefAttr = SCA, NA, NP, NT)
	var(45) = 1
	supermovetime = 999999999
	pausemovetime = 999999999
	IgnoreHitPause = 1

;(super / hyper finish)
[State 0]
	type = varset
	triggerall = var(47) < 2
	triggerall = var(45) = 0
	trigger1 = Root,WinKO
	trigger1 = Root,MoveHit
	trigger1 = Root,HitDefAttr = SCA, HA, HP, HT
	trigger2 = NumPartner
	trigger2 = Partner,WinKO
	trigger2 = Partner,MoveHit
	trigger2 = Partner,HitDefAttr = SCA, HA, HP, HT
	var(45) = 2
	supermovetime = 999999999
	pausemovetime = 999999999
	IgnoreHitPause = 1

[State 0]
	type = Helper
	triggerall = var(45) = 2
	triggerall = var(47) = 1
	triggerall = !NumHelper(99999)
	trigger1 = Root,WinKO
	trigger2 = NumPartner
	trigger2 = Partner,WinKO
	id = 99999
	StateNo = 99999
	supermovetime = 999999999
	pausemovetime = 999999999
	IgnoreHitPause = 1


;---------------------------------
[State 0]
	type = ChangeState
	trigger1 = var(47) = 1
	value = 99980
	IgnoreHitPause = 1

;--------------------------------------------------------------
;--------------------------------------------------------------
;Level: ID = [9005-9]

[StateDef 9005]
type = CF
physics = N
ctrl = 0

[State 0]
	type = AssertSpecial
	trigger1 = 1
	flag = invisible
	flag2 = noshadow
[State 0]
	type = NotHitBy
	trigger1 = 1
	value = SCA

[State 0]
	type = varset
	trigger1 = time = 0
	var(0) = IsHelper(9005)*0 + IsHelper(9006)*1 + IsHelper(9007)*2 + IsHelper(9008)*3 + IsHelper(9009)*4

[State 0]
	type = EnvShake
	trigger1 = time = 0
	time = Ifelse(var(0), 12, 6)
	ampl = Ifelse(var(0), 4, 3)
	IgnoreHitPause = 1

[State 0]
	type = Explod
	trigger1 = Time = 0
	anim = F62
	id = 1
	pos = 0, 0
	scale = Ifelse(!var(0), 1, 1.5), Ifelse(!var(0), 1, 1.5)
	postype = P1
	sprpriority = -2
	bindtime = 1
	ownpal = 1
	persistent = 0
	IgnoreHitPause = 1

;--------
[State 0]
	type = Explod
	triggerall = Root,NumExplod(990100)
	trigger1 = Time = 0
	id = 990101
	anim = F127
	sprpriority = 7
	postype = p1
	pos = 0, -8
	ownpal = 1
[State 0]
	type = Explod
	triggerall = Root,NumExplod(990100)
	trigger1 = Time = 0
	id = 990102
	anim = F128
	sprpriority = 7
	postype = p1
	pos = 0, -8
	ownpal = 1

[State 0]
	type = PlaySnd
	triggerall = Root,NumExplod(990100)
	trigger1 = Time = 0
	value = F127, 0

[State 0]
	type = PlaySnd
	trigger1 = Time = 0
	value = F5000, 0
[State 0]
	type = PlaySnd
	trigger1 = Time = 0 && var(0)
	value = F5000, 1
[State 0]
	type = PlaySnd
	trigger1 = Time = 0 && var(0)
	value = F5000, 2

;--------
[State 0]
	type = VarRangeSet
	trigger1 = time = 0
	first = 0
	last = 6
	fvalue = 1.00 + (Random%10)/10.0

;--------
[State 0]
	type = Explod
	trigger1 = Time = 0
	anim = F80 + (Random%5)
	sprpriority = 7
	postype = P1
	pos = 0, 0
	velocity = ((Random%100)-50)/10.00, -(1+(Random%100)/20.00)
	bindtime = 1
	scale = fvar(0), fvar(0)
	ownpal = 1
	IgnoreHitPause = 1
[State 0]
	type = Explod
	trigger1 = Time = 0
	anim = F80 + (Random%5)
	sprpriority = 7
	postype = P1
	pos = 0, 0
	velocity = ((Random%100)-50)/10.00, -(1+(Random%100)/20.00)
	bindtime = 1
	scale = fvar(1), fvar(1)
	ownpal = 1
	IgnoreHitPause = 1
[State 0]
	type = Explod
	trigger1 = Time = 0
	anim = F80 + (Random%5)
	sprpriority = 7
	postype = P1
	pos = 0, 0
	velocity = ((Random%100)-50)/10.00, -(1+(Random%100)/20.00)
	bindtime = 1
	scale = fvar(2), fvar(2)
	ownpal = 1
	IgnoreHitPause = 1
[State 0]
	type = Explod
	trigger1 = Time = 0
	anim = F80 + (Random%5)
	sprpriority = 7
	postype = P1
	pos = 0, 0
	velocity = ((Random%100)-50)/10.00, -(1+(Random%100)/20.00)
	bindtime = 1
	scale = fvar(3), fvar(3)
	ownpal = 1
	IgnoreHitPause = 1
[State 0]
	type = Explod
	trigger1 = Time = 0
	anim = F80 + (Random%5)
	sprpriority = 7
	postype = P1
	pos = 0, 0
	velocity = ((Random%100)-50)/10.00, -(1+(Random%100)/20.00)
	bindtime = 1
	scale = fvar(4), fvar(4)
	ownpal = 1
	IgnoreHitPause = 1
[State 0]
	type = Explod
	trigger1 = Time = 0
	anim = F80 + (Random%5)
	sprpriority = 7
	postype = P1
	pos = 0, 0
	velocity = ((Random%100)-50)/10.00, -(1+(Random%100)/20.00)
	bindtime = 1
	scale = fvar(5), fvar(5)
	ownpal = 1
	IgnoreHitPause = 1
[State 0]
	type = Explod
	trigger1 = Time = 0
	anim = F80 + (Random%5)
	sprpriority = 7
	postype = P1
	pos = 0, 0
	velocity = ((Random%100)-50)/10.00, -(1+(Random%100)/20.00)
	bindtime = 1
	scale = fvar(6), fvar(6)
	ownpal = 1
	IgnoreHitPause = 1


[State 0]
	type = DestroySelf
	trigger1 = time = 0
	IgnoreHitPause = 1

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

;--------------------------------------------------------------
;抧柺慁?僿?僷乕 (dust)
;Level: ID = [160100-9]
;time = ID * 5 / 19=-1

[StateDef 160100]
type = C
physics = N
ctrl = 0

[State 0]
	type = AssertSpecial
	trigger1 = 1
	flag = invisible
	flag2 = noshadow
[State 0]
	type = NotHitBy
	trigger1 = 1
	value = SCA

;--------
[State 0]
	type = varset
	trigger1 = 1
	var(1) = Floor(GameTime*2)
	IgnoreHitPause = 1

[State 0]
	type = varset
	trigger1 = 1
	fvar(7) = var(1) / 180.00 * 3.14 * 4
	IgnoreHitPause = 1
[State 0]
	type = varset
	trigger1 = 1
	fvar(8) = (var(1) + 45) / 180.00 * 3.14 * 4
	IgnoreHitPause = 1

[State 0]
	type = varset
	trigger1 = 1
	fvar(1) = sin(fvar(7)) * 45
	IgnoreHitPause = 1
[State 0]
	type = varset
	trigger1 = 1
	fvar(2) = sin(fvar(8)) * 45
	IgnoreHitPause = 1

[State 0]
	type = varset
	trigger1 = 1
	fvar(4) = cos(fvar(7)) * 10
	IgnoreHitPause = 1
[State 0]
	type = varset
	trigger1 = 1
	fvar(5) = cos(fvar(8)) * 10
	IgnoreHitPause = 1

;--------
[State 0]
	type = Explod
	trigger1 = var(1)%3 = 0
	anim = F210530
	pos = Floor(fvar(1)), Floor(fvar(4))
	Sprpriority = Ifelse(fvar(4) > 0, 4, -4)
;	scale = 0.5, 0.5
	bindtime = 1
	IgnoreHitPause = 1
[State 0]
	type = Explod
	trigger1 = var(1)%3 = 0
	anim = F210530
	pos = Floor(fvar(2)), Floor(fvar(5))
	Sprpriority = Ifelse(fvar(5) > 0, 4, -4)
;	scale = 0.5, 0.5
	bindtime = 1
	IgnoreHitPause = 1


[State 0]
	type = DestroySelf
	trigger1 = var(1) > 2 ;27
	IgnoreHitPause = 1


;--------------------------------------------------------------
;(dust)
;-------------------------------------------------------------
[StateDef 152000]
type = C
physics = N
ctrl = 0

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

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

[State 0]
	type = varset
	trigger1 = Time = 0
	var(0) = Ifelse(IsHelper(152010), 1, 0)

[State 0]
	type = varset
	trigger1 = Time = 0
	fvar(0) = (Parent,Const(Size.ground.back) + Parent,Const(Size.ground.front)) * (Parent,Const(Size.Xscale))
[State 0]
	type = varset
	trigger1 = Time = 0
	fvar(0) = fvar(0) / 50.00

;--------
[State 0]
	type = playsnd
	triggerall = Root,NumExplod(990100) = 0
	trigger1 = Time = 0
	value = F(Ifelse(var(0), 5000, 52)), 0

;--------
[State 0]
	type = Explod
	triggerall = Root,NumExplod(990100) = 0
	trigger1 = Time = 0
	anim = F(Ifelse(var(0), 60, 50))
	sprpriority = -2
	postype = p1
	ownpal = 1
	scale = fvar(0), fvar(0)

;--------
[State 0]
	type = Explod
	triggerall = Root,NumExplod(990100)
	trigger1 = Time = 0
	id = 990101
	anim = F127
	sprpriority = 7
	postype = p1
	pos = 0, -8
	ownpal = 1
[State 0]
	type = Explod
	triggerall = Root,NumExplod(990100)
	trigger1 = Time = 0
	id = 990102
	anim = F128
	sprpriority = 7
	postype = p1
	pos = 0, -8
	ownpal = 1

[State 0]
	type = PlaySnd
	triggerall = Root,NumExplod(990100)
	trigger1 = Time = 0
	value = F127, 0


;--------
[State 0]
	type = DestroySelf
	trigger1 = time > 0
;--------------------------------------------------------------
;(mini display)
;--------------------------------------------------------------
[StateDef 990107]
type = S
physics = N
ctrl = 0
sprpriority = -7

[State 0]
	type = AssertSpecial
	trigger1 = 1
	flag = invisible
	flag2 = noshadow
[State 0]
	type = NotHitBy
	trigger1 = 1
	value = SCA

;--------
[State 0]
	type = varset
	trigger1 = GameTime%1200 = 0
	var(0) = !var(0)

;--------
[State 0]
	type = ChangeAnim
	trigger1 = Anim != Parent,Anim
	trigger1 = SelfAnimExist(Parent,Anim)
	value = Parent,Anim

[State 0]
	type = Turn
	trigger1 = facing != Parent,facing


[State 0]
	type = varset
	trigger1 = AnimElem = 1
	trigger2 = AnimTime = 0
	var(3) = Ifelse((AnimElem = 1), 0, 250)

[State 0]
	type = Afterimage
	triggerall = GameTime%2
	trigger1 = MatchNo = 1 && Ifelse(TeamSide = 1, var(0), !var(0))
	trigger2 = MatchNo > 1
	time = 2
	length = 2
	TimeGap = 1
	FrameGap = 1
	PalContrast = 0, 125, 0
	Trans = Add1

;--------------------------------------------------------------
;==============================================================
[Statedef -2]
;==============================================================
;--------------------------------------------------------------
; [5900] Set PlayerType for normal mode
[State 0]
	type = VarSet
	triggerall = !IsHelper
	triggerall = StateNo = 5900 && time = 0
	trigger1 = sysvar(4) = 0
	trigger1 = NumPartner = 0
	sysvar(4) = Ifelse(!(PalNo%7), 7, PalNo%7)

; for TeamMode (tag)
[State 0]
	type = VarSet
	triggerall = !IsHelper
	triggerall = StateNo = 5900 && time = 0
	trigger1 = sysvar(4) = 0
	trigger1 = NumPartner
	trigger1 = ID < Partner,ID
	sysvar(4) = 4

;#ADD004BASC PIEs#
;============================================================================
; edited life & power bar
[State 2,1]
	type = Helper
	triggerall = !IsHelper
	triggerall = !NumHelper(90900)
	triggerall = !NumHelper(90901)
	triggerall = !NumHelper(90902)
	trigger1 = NumPartner
	trigger1 = ID < Partner,ID
	trigger2 = !NumPartner
	name = "LifeBar-A4"
	ID = 90900
	Stateno = 90900
;======================================
; blocking/JD system helper set
[State 2,1]
	type = Helper
	triggerall = !IsHelper
	triggerall = NumHelper(90900)
	triggerall = Helper(90900),var(22) = [2,3]
	triggerall = !NumHelper(99997) && !NumHelper(99998)
	triggerall = Ctrl || StateNo = 40 || StateNo = 52 || StateNo = 100
	triggerall = StateNo != 195500
	trigger1 = Helper(90900),var(22) = 2 && Command = "holdfwd"
	trigger2 = Helper(90900),var(22) = 3 && Command = "holdback"
	;-----------------
	ID = 99997 + (Helper(90900),var(22) = 3)
	Stateno = 99997
	IgnoreHitPause = 4
;--------------------------------------
; blocking/JD succeed!
[State 0]
	type = ChangeState
	triggerall = !IsHelper
	triggerall = NumHelper(90900)
	triggerall = Helper(90900),var(22) = [2,3]
	triggerall = NumHelper(99997) || NumHelper(99998)
	triggerall = Ctrl || StateNo = 40 || StateNo = 52 || StateNo = 100
	triggerall = StateNo != 195500
	trigger1 = NumHelper(99997)
	trigger1 = Helper(99997),StateNo = 99996
	trigger2 = NumHelper(99998)
	trigger2 = Helper(99998),StateNo = 99996
	value = 198800
	IgnoreHitPause = 1
;--------------------------------------
; muteki
[State 0]
	type = HitBy
	triggerall = !IsHelper
	triggerall = NumHelper(90900)
	triggerall = Helper(90900),var(22) = [2,3]
	trigger1 = NumHelper(99997)
	trigger1 = Helper(99997),StateNo = [99996, 99997]
	trigger2 = NumHelper(99998)
	trigger2 = Helper(99998),StateNo = [99996, 99997]
	value = SCA, NT, ST, HT
	IgnoreHitPause = 10
;============================================================================

;==============================================================
; STAGE OPTIONS
;==============================================================

; 僗僥乕僕忣曬庢摼
[State 0]
	type = Explod
	triggerall = !IsHelper
	triggerall = !NumExplod(990100)
	trigger1 = sysvar(0) = 1073
	trigger2 = NumEnemy
	trigger2 = Enemy,NumExplod(990100)
	ID = 990100
	anim = F111111
	removetime = -1
; ?
[State 0]
	type = Explod
	triggerall = NumExplod(990100)
	triggerall = Time = 1
	trigger1 = StateNo = 5100
	trigger2 = StateNo = 5110
	trigger3 = StateNo = 5201
	trigger4 = StateNo = 190112
	trigger5 = StateNo = 190114
	id = 990101
	anim = F127
	sprpriority = 7
	postype = p1
	pos = 0, -8
	ownpal = 1
[State 0]
	type = Explod
	triggerall = NumExplod(990100) && !NumExplod(990102)
	triggerall = Time = 1
	trigger1 = StateNo = 5100
	trigger2 = StateNo = 5110
	trigger3 = StateNo = 5201
	trigger4 = StateNo = 190112
	trigger5 = StateNo = 190114
	trigger6 = Pos Y = 0 
	id = 990102
	anim = F128
	sprpriority = 7
	postype = p1
	pos = 0, -8
	ownpal = 1
	bindtime = -1
	removetime = -1
	IgnoreHitPause = 1
[State 0]
	type = PlaySnd
	triggerall = NumExplod(990100)
	triggerall = Time = 1
	trigger1 = StateNo = 5100
	trigger2 = StateNo = 5110
	trigger3 = StateNo = 5201
	trigger4 = StateNo = 190112
	trigger5 = StateNo = 190114
	value = F127, 0

; ?(僕??僾慜)
[State 0]
	type = Explod
	triggerall = NumExplod(990102)
	trigger1 = Pos Y < 0
	trigger1 = !NumExplod(990103)
	id = 990103
	anim = F127
	sprpriority = 7
	postype = p1
	pos = 0, -6 + Floor(Abs(Pos Y + Vel Y))
	ownpal = 1
	scale = 0.75, 0.40
	IgnoreHitPause = 1
[State 0]
	type = RemoveExplod
	triggerall = NumExplod(990102)
	trigger1 = Pos Y != 0
	id = 990102
	IgnoreHitPause = 1
;==============================================================

;==============================================================
;[EOF]
