
; v05: level / facing
; v06-07: counter
; v20-23: temp
; v30-31: spark
; v41: cancel switch
; v59: score

;--------------
; lose / time over
[statedef 170]
type=s
anim=170
velset=0,0
ctrl=0

[state 0]
	type=assertspecial
	trigger1=time<200
	flag=roundnotover

;--------------
; win
[statedef 180]
type=s
anim=181+(random%6)
velset=0,0
ctrl=0

[state 0]
	type=assertspecial
	trigger1=time<300
	flag=roundnotover
;---
[state 0]
	type=playsnd
	trigger1=(animelem=12) && (anim=181)
	value=0,2
	channel=0
[state 0]
	type=playsnd
	trigger1=(time=2) && ((anim=[181,182]) || (anim=184) || (anim=186))
	value=1,3
	channel=1
[state 0]
	type=playsnd
	trigger1=((animelem=8)||(animelem=14)) && (anim=182)
	value=3,1+(animelem=14)
	channel=0
[state 0]
	type=playsnd
	trigger1=(animelem=3) && (anim=186)
	value=3,2
	channel=0
[state 0]
	type=playsnd
	trigger1=(animelem=12) && (anim=183)
	value=3,3
	channel=0
[state 0]
	type=playsnd
	trigger1=(animelem=25) && (anim=184)
	trigger2=(animelem=20) && (anim=185)
	value=3,4+(random%2)
	channel=0
;---
[state 0]
	type=playsnd
	trigger1=(animelem=10) && (anim=186)
	value=f300,5
[state 0]
	type=playsnd
	trigger1=(animelem=10) && (anim=186)
	value=5000,0
	channel=0
;;--- hit_spark
[state 0] ; hit_spark
	type=helper
	trigger1=(animelem=12) && (anim=186) && (sysfvar(0)>0)
	id=152100
	stateno=152100
	helpertype=normal
	ownpal=0
	keyctrl=0
	postype=p1
	pos=floor(31*const(size.xscale)),floor(-91*const(size.yscale))
	size.height=0 ;; hit_spark
	facing=-1

;--------------
; intro
[statedef 190]
type=s
anim=190
velset=0,0
ctrl=0

[state 0]
	type=assertspecial
	trigger1=1
	flag=intro
;---
[state 0]
	type=changestate
	triggerall=!time && numenemy
	trigger1=enemy,name="chunli" || enemy,name="dan"
	trigger2=enemy,name="karate" || enemy,name="yun" || enemy,name="xiangfei"
	value=193
[state 0]
	type=changestate
	triggerall=!time && numenemy
	trigger1=enemy,name="chang"
	value=192
;---
[state 0]
	type=playsnd
	trigger1=(animelem=2)
	value=3,6
	channel=0
[state 0]
	type=playsnd
	trigger1=(animelem=2)
	value=1,3
	channel=1
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0

;--------------
; intro 2
[statedef 192]
type=s
anim=192
velset=0,0
ctrl=0

[state 0]
	type=assertspecial
	trigger1=1
	flag=intro
[state 0]
	type=playsnd
	trigger1=time=2
	value=1,3
	channel=1
[state 0]
	type=playsnd
	trigger1=(animelem=10)
	value=f300,5
[state 0]
	type=playsnd
	trigger1=(animelem=10)
	value=5000,0
	channel=0

;;--- hit_spark
[state 0] ; hit_spark
	type=helper
	trigger1=(animelem=12) && (sysfvar(0)>0)
	id=152100
	stateno=152100
	helpertype=normal
	ownpal=0
	keyctrl=0
	postype=p1
	pos=floor(31*const(size.xscale)),floor(-91*const(size.yscale))
	size.height=0 ;; hit_spark
	facing=-1
;---
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0

;--------------
; vs.
[statedef 193]
type=s
anim=193
velset=0,0
ctrl=0

[state 0]
	type=assertspecial
	trigger1=1
	flag=intro
[state 0]
	type=playsnd
	trigger1=(animelem=6)
	value=3,7
	channel=0
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0



;--------------
; taunt
[statedef 195]
type=s
physics=s
movetype=i
anim=195
velset=0,0
ctrl=0

[state 0]
	type=playsnd
	trigger1=time=1
	value=3,7
	channel=0
[state 0]
	type=playsnd
	trigger1=time=1
	value=1,3
	channel=1
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1



;--------------
; normal

;--------------
; slp
[statedef 200]
type=s
movetype=a
physics=s
anim=ifelse(p2bodydist x<22,205,200)
juggle=8
poweradd=10
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=playsnd
	trigger1=time=1 && random<250
	value=0,1+(random%3)
	channel=0
[state 0]
	type=playsnd
	trigger1=time=1 && (anim=200)
	value=1,2
	channel=1
[state 0]
	type=playsnd
	trigger1=time=1 && (anim=205)
	value=f200,0
	channel=1

[state 0]
	type=hitdef
	trigger1=time=0
	attr=s,na
	damage=25
	animtype=light
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	guardflag=ma
	hitflag=maf
	pausetime=9,9
	;ad; sparkno=0+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-78
	hitsound=300,0
	guardsound=40,0
	ground.slidetime=9
	ground.hittime=10
	air.hittime=10
	ground.velocity=-6
	air.velocity=   -4,-3
	getpower=20,10
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=0 || var(30):= 510578 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=5)
	movetype=i
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1

;--------------
; slk
[statedef 210]
type=s
movetype=a
physics=s
anim=ifelse(p2bodydist x<18,215,210)
juggle=8
poweradd=10
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=playsnd
	trigger1=time=1 && random<250
	value=0,1+(random%3)
	channel=0
[state 0]
	type=playsnd
	trigger1=time=1
	value=f200,1
	channel=1

[state 0]
	type=hitdef
	trigger1=(anim=210)
	attr=s,na
	damage=25
	animtype=light
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	guardflag=ma
	hitflag=maf
	pausetime=9,9
	;ad; sparkno=0+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-75
	hitsound=300,1
	guardsound=40,0
	ground.slidetime=9
	ground.hittime=10
	air.hittime=10
	ground.velocity=-6
	air.velocity=   -4,-3
	getpower=20,10
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=0 || var(30):= 510575 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

[state 0]
	type=hitdef
	trigger1=(anim=215)
	attr=s,na
	damage=25
	animtype=light
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=low
	guardflag=ma
	hitflag=maf
	pausetime=9,9
	;ad; sparkno=0+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-35
	hitsound=300,1
	guardsound=40,0
	ground.slidetime=9
	ground.hittime=10
	air.hittime=10
	ground.velocity=-6
	air.velocity=   -4,-3
	getpower=20,10
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=0 || var(30):= 510535 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=5)
	movetype=i
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1

;--------------
; shp
[statedef 220]
type=s
movetype=a
physics=s
anim=ifelse(p2bodydist x<26,225,220)
juggle=8
poweradd=50
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=playsnd
	trigger1=time=1 && random<750
	value=0,4+(random%2)
	channel=0
[state 0]
	type=playsnd
	trigger1=time=2
	value=1,3
	channel=1
[state 0]
	type=playsnd
	trigger1=((animelem=2)||(animelem=5)) && (anim=225)
	value=f200,2
	channel=1

[state 0]
	type=hitdef
	trigger1=(anim=220)
	attr=s,na
	damage=80
	animtype=heavy
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	guardflag=ma
	hitflag=maf
	pausetime=13,13
	;ad; sparkno=2+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-65
	hitsound=300,2
	guardsound=41,0
	ground.slidetime=16
	ground.hittime=18
	air.hittime=18
	ground.velocity=-9
	air.velocity=   -5,-4
	getpower=50,25
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=2 || var(30):= 510565 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

[state 0]
	type=hitdef
	trigger1=((animelem=3)||(animelem=6)) && (anim=225)
	attr=s,na
	damage=40
	animtype=heavy
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=low
	guardflag=ma
	hitflag=maf
	pausetime=13,13
	;ad; sparkno=2+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-50
	hitsound=300,2
	guardsound=41,0
	ground.slidetime=16
	ground.hittime=18
	air.hittime=18
	ground.velocity=-ifelse((animelem=3),0,8)
	air.velocity=   -4,-5
	getpower=25,12
	;---
	guard.ctrltime=     id +0*(var(31):=2 || var(30):= 510550 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=5) && (anim=220)
	trigger2=(animelem=7)
	movetype=i
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1

;--------------
; shk
[statedef 230]
type=s
movetype=a
physics=s
anim=ifelse(p2bodydist x<21,235,230)
sprpriority=-1
juggle=8
poweradd=50
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=sprpriority
	trigger1=(animelem=5) || (anim=235)
	value=1

[state 0]
	type=playsnd
	trigger1=time=1 && random<750
	value=0,4+(random%2)
	channel=0
[state 0]
	type=playsnd
	trigger1=time=2
	value=f200,3
	channel=1

[state 0]
	type=hitdef
	trigger1=((animelem=3)||(animelem=4)) && (anim=230)
	attr=s,na
	damage=40
	animtype=heavy
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	guardflag=ma
	hitflag=maf
	pausetime=12,13
	;ad; sparkno=2+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-ifelse((animelem=3),80,70)
	hitsound=300,3
	guardsound=41,0
	ground.slidetime=16
	ground.hittime=18
	air.hittime=18
	ground.velocity=-ifelse((animelem=3),5,13)
	air.velocity=   -ifelse((animelem=3),3,5),-4
;;op;	p1sprpriority=-1
	getpower=20,10
	;---
	guard.ctrltime=     id +0*(var(31):=2 || var(30):= 510500 +ifelse((animelem=3),80,70) )
	fall.envshake.time= id
	fall.envshake.ampl= 0

[state 0]
	type=hitdef
	trigger1=(anim=235)
	attr=s,na
	damage=80
	animtype=heavy
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	guardflag=ma
	hitflag=maf
	pausetime=12,13
	;ad; sparkno=2+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-66
	hitsound=300,3
	guardsound=41,0
	ground.slidetime=16
	ground.hittime=18
	air.hittime=18
	ground.velocity=-5
	air.velocity=   -4,-5
	getpower=50,25
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=2 || var(30):= 510566 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=5)
	movetype=i
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1

;--------------
; F + a
[statedef 300]
type=s
movetype=a
physics=n
anim=300
juggle=8
velset=4.6,0
ctrl=0
facep2=1

[state 0] ; dash_dust
	type=helper
	trigger1=((animelem=3) || (animelem=8)) && (sysfvar(0)>0)
	id=152040
	stateno=152040
	pos=floor(ifelse((animelem=3),-2,18)*const(size.xscale)),0
	size.xscale=0.4*ifelse((animelem=3),1,-1)
	size.yscale=0.4

[state 0]
	type=velmul
	trigger1=(animelem=7,>=0)
	x=0.8
[state 0]
	type=velset
	trigger1=animtime=0
	x=0

[state 0]
	type=playsnd
	trigger1=time=1
	value=0,5
	channel=0
[state 0]
	type=playsnd
	trigger1=time=1 && random<500
	value=0,16
	channel=0

[state 0]
	type=playsnd
	trigger1=time=1
	value=f200,3
	channel=1

[state 0]
	type=hitdef
	trigger1=time=0
	attr=s,na
	damage=32
	animtype=medium
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	guardflag=ma
	hitflag=maf
	pausetime=9,13
	;ad; sparkno=2+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-80
	hitsound=300,1
	guardsound=40,0
	ground.slidetime=13
	ground.hittime=18
	air.hittime=18
	ground.velocity=-11
	air.velocity=    -5,-4
	getpower=20,10
	ground.cornerpush.veloff=0
	air.cornerpush.veloff=0
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=2 || var(30):= 510580 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=7)
	movetype=i
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1

;--------------
; D + x
[statedef 320]
type=s
movetype=a
physics=s
anim=320
juggle=0
poweradd=20
velset=0,0
ctrl=0

[state 0]
	type=playsnd
	trigger1=time=1
	value=0,6
	channel=0
[state 0]
	type=playsnd
	trigger1=(animelem=3)
	value=1,1
	channel=1

[state 0]
	type=hitdef
	trigger1=(animelem=5)
	attr=s,na
	damage=32
	animtype=light
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=low
	guardflag=ma
	hitflag=fd
	pausetime=12,12
	;ad; sparkno=2+(random%4)*10
	sparkxy=-10,-5
	hitsound=300,2
	guardsound=41,0
	down.hittime=12
	fall=1
	fall.recover=0
	getpower=20,10
	;---
	guard.ctrltime=     id +0*(var(31):=2 || var(30):= 510505 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1


;--------------
; clp
[statedef 400]
type=c
movetype=a
physics=c
anim=400
juggle=8
poweradd=10
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=playsnd
	trigger1=time=1 && random<250
	value=0,1+(random%3)
	channel=0
[state 0]
	type=playsnd
	trigger1=time=1
	value=f200,0
	channel=1

[state 0]
	type=hitdef
	trigger1=time=0
	attr=c,na
	damage=25
	animtype=light
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=low
	guardflag=ma
	hitflag=maf
	pausetime=9,9
	;ad; sparkno=0+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-50
	hitsound=300,0
	guardsound=40,0
	ground.slidetime=9
	ground.hittime=10
	air.hittime=10
	ground.velocity=-6
	air.velocity=   -4,-3
	getpower=20,10
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=0 || var(30):= 510550 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=3)
	movetype=i
[state 0]
	type=changestate
	trigger1=animtime=0
	value=11
	ctrl=1

;--------------
; clk
[statedef 410]
type=c
movetype=a
physics=c
anim=410
juggle=8
poweradd=10
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=playsnd
	trigger1=time=1 && random<250
	value=0,1+(random%3)
	channel=0
[state 0]
	type=playsnd
	trigger1=time=1
	value=f200,1
	channel=1

[state 0]
	type=hitdef
	trigger1=time=0
	attr=c,na
	damage=25
	animtype=light
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=low
	guardflag=l
	hitflag=maf
	pausetime=9,9
	;ad; sparkno=0+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-50
	hitsound=300,1
	guardsound=40,0
	ground.slidetime=9
	ground.hittime=10
	air.hittime=10
	ground.velocity=-6
	air.velocity=   -4,-3
	getpower=20,10
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=0 || var(30):= 510550 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=5)
	movetype=i
[state 0]
	type=changestate
	trigger1=animtime=0
	value=11
	ctrl=1


;--------------
; chp
[statedef 420]
type=c
movetype=a
physics=c
anim=420
juggle=8
poweradd=50
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=playsnd
	trigger1=time=1 && random<750
	value=0,16
	channel=0
[state 0]
	type=playsnd
	trigger1=time=1
	value=1,2
	channel=1

[state 0]
	type=hitdef
	trigger1=(animelem=4)
	attr=c,na
	damage=80
	animtype=hard
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	guardflag=l
	hitflag=maf
	pausetime=12,13
	;ad; sparkno=2+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-75
	hitsound=300,2
	guardsound=41,0
	ground.slidetime=16
	ground.hittime=18
	air.hittime=18
	ground.velocity=-9
	air.velocity=   -4,-5
	getpower=50,25
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=2 || var(30):= 45510575 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=5)
	movetype=i
[state 0]
	type=changestate
	trigger1=animtime=0
	value=11
	ctrl=1

;--------------
; chk
[statedef 430]
type=c
movetype=a
physics=c
anim=430
juggle=8
poweradd=50
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=playsnd
	trigger1=time=1 && random<750
	value=0,4+(random%2)
	channel=0
[state 0]
	type=playsnd
	trigger1=(animelem=3)
	value=f200,3
	channel=1

[state 0]
	type=hitdef
	trigger1=(animelem=4)
	attr=c,na
	damage=80
	animtype=heavy
	air.animtype=back
	fall.animtype=back
	ground.type=trip
	guardflag=l
	hitflag=maf
	pausetime=13,13
	;ad; sparkno=2+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-10
	hitsound=300,3
	guardsound=41,0
	ground.slidetime=16
	ground.hittime=18
	air.hittime=18
	ground.velocity=-2,-5
	air.velocity=   -2,-5
	guard.velocity= -12
	getpower=40,20
	air.fall=1
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=2 || var(30):= 510510 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=5)
	movetype=i
[state 0]
	type=changestate
	trigger1=animtime=0
	value=11
	ctrl=1




;--- ݑOi
; c-walk
[statedef 480]
type=c
movetype=i
physics=n
anim=480
velset=1,0

[state 0]
	type=changestate
	trigger1=command!="holdfwd"
	value=11
	ctrl=1



;--------------
; jlp
[statedef 600]
type=a
movetype=a
physics=a
anim=ifelse(vel x,600,605)
juggle=8
poweradd=10
ctrl=0

[state 0]
	type=playsnd
	trigger1=time=1 && random<250
	value=0,1+(random%3)
	channel=0
[state 0]
	type=playsnd
	trigger1=time=1
	value=f200,0
	channel=1

[state 0]
	type=hitdef
	trigger1=time=0
	attr=a,na
	damage=25
	animtype=light
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	guardflag=ha
	hitflag=maf
	pausetime=9,9
	;ad; sparkno=0+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-ifelse((anim=600),40,60)
	hitsound=300,0
	guardsound=40,0
	ground.slidetime=9
	ground.hittime=10
	air.hittime=10
	ground.velocity=-6
	air.velocity=   -4,-3
	getpower=20,10
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=0 || var(30):= 510540 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=3) && (anim=605)
	trigger2=(animelem=5) && (anim=600)
	movetype=i


;--------------
; jlk
;--------------
[statedef 610]
type=a
movetype=a
physics=a
anim=ifelse(vel x,610,615)
juggle=8
poweradd=10
ctrl=0

[state 0]
	type=playsnd
	trigger1=time=1 && random<250
	value=0,1+(random%3)
	channel=0
[state 0]
	type=playsnd
	trigger1=time=1
	value=f200,1
	channel=1

[state 0]
	type=hitdef
	trigger1=time=0
	attr=a,na
	damage=25
	animtype=medium
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	guardflag=ha
	hitflag=maf
	pausetime=9,9
	;ad; sparkno=0+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-ifelse((anim=610),45,70)
	hitsound=300,1
	guardsound=40,0
	ground.slidetime=9
	ground.hittime=10
	air.hittime=10
	ground.velocity=-6
	air.velocity=   -4,-3
	getpower=20,10
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=0 || var(30):= 510545 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=3)
	movetype=i

;--------------
; jhp
[statedef 620]
type=a
movetype=a
physics=a
anim=620
juggle=8
poweradd=50
ctrl=0

[state 0]
	type=playsnd
	trigger1=time=1 && random<750
	value=0,4+(random%2)
	channel=0
[state 0]
	type=playsnd
	trigger1=time=2
	value=1,1
	channel=1

[state 0]
	type=hitdef
	trigger1=time=0
	attr=a,na
	damage=80
	animtype=heavy
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	guardflag=ha
	hitflag=maf
	pausetime=13,13
	;ad; sparkno=2+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-60
	hitsound=300,2
	guardsound=41,0
	ground.slidetime=16
	ground.hittime=18
	air.hittime=18
	ground.velocity=-8
	air.velocity=   -5,-4
	getpower=50,25
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=2 || var(30):= 510560 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=4)
	movetype=i


;-------------
; jhk
[statedef 630]
type=a
movetype=a
physics=a
anim=ifelse(vel x,630,635)
juggle=8
poweradd=50
ctrl=0

[state 0]
	type=playsnd
	trigger1=time=1 && random<750
	value=0,4+(random%2)
	channel=0
[state 0]
	type=playsnd
	trigger1=time=1
	value=f200,3
	channel=1

[state 0]
	type=hitdef
	trigger1=time=0
	attr=a,na
	damage=80
	animtype=heavy
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	guardflag=ha
	hitflag=maf
	pausetime=13,13
	;ad; sparkno=2+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-ifelse((anim=620),45,60)
	hitsound=300,3
	guardsound=41,0
	ground.slidetime=16
	ground.hittime=18
	air.hittime=18
	ground.velocity=-8
	air.velocity=   -5,-4
	getpower=50,25
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=2 || var(30):= 510545 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=4)
	movetype=i





;-------------
; j-turn
[statedef 680]
type=a
movetype=i
physics=a
anim=44

[state 0]
	type=turn
	trigger1=!time

[state 0]
	type=playsnd
	trigger1=time=1
	value=f200,0
	channel=1









;-------------
; throw
[statedef 800]
type=s
movetype=a
physics=s
anim=800
poweradd=0
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=varset
	trigger1=!time
	var(5)=(command="holdback")
[state 0]
	type=varset
	trigger1=!time
	var(6)=(command="y")
[state 0]
	type=varset
	trigger1=!time && var(51)>0
	var(6)=(random<500)

;---
[state 0]
	type=hitdef
	trigger1=time=0
	attr=s,nt
	hitflag=m-
	priority=3,miss
	sparkno=(var(31):=-1)
	hitsound=-1
	pausetime=0,0
	p1facing=1
	p2facing=1
	p1stateno=801
	p2stateno=802
	getpower=0,0
	hitonce=1

[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1






;-------------
; throw1 - p1
[statedef 801]
type=s
movetype=a
physics=n
anim=801
sprpriority=2
poweradd=0
velset=0,0
ctrl=0

;---
; grab_spark
[state 0]
	type=helper
	trigger1=(time=1) && (sysfvar(0)>0)
	id=152080
	stateno=152080
	postype=p1
	pos=floor(43*const(size.xscale)),floor(-49*const(size.yscale))
	size.xscale=1 ;w
	size.yscale=1 ;h
	size.height=100 ;type
	persistent=0
;---
; against_throw O
[state 0]
	type=changestate
	triggerall=(time=[1,2]) && numtarget
	triggerall=playeridexist(floor(sysfvar(0)))
	triggerall=playerid(floor(sysfvar(0))),stateno=90900 && playerid(floor(sysfvar(0))),var(17)>0
	trigger1=target,command="y"||target,command="b"
	trigger2=target,var(51)>0 && (random%2) && random<target,var(51)*118 ;*at
	value=190130

;---
[state 0]
	type=turn
	trigger1=(animelem=2) && var(5)
[state 0]
	type=targetfacing
	trigger1=(animelem=2) && var(5)
	value=-1

[state 0]
	type=changestate
	trigger1=(animelem=2) && var(6)
	value=811
;---
[state 0]
	type=width
	trigger1=1
	edge=60,60

;---
[state 0]
	type=targetbind
	trigger1=(animelem=3,<0)
	pos=floor(40*const(size.xscale)),0

;---
[state 0]
	type=playsnd
	trigger1=(animelem=5)||(animelem=9)||(animelem=13)
	value=f200,1+(animelem=13,>=0)*2
	channel=1
[state 0]
	type=playsnd
	trigger1=(animelem=5)||(animelem=9)||(animelem=13)
	value=0,3+(animelem=9,>=0)+(animelem=13,>=0)
	channel=0
[state 0]
	type=playsnd
	trigger1=(animelem=18)
	value=0,11
	channel=0

;---
[state 0]
	type=hitdef
	trigger1=(animelem=6)||(animelem=10)
	attr=c,na
	damage=30
	animtype=hard
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=low
	guardflag=ma
	hitflag=ma+
	pausetime=11,11
	;ad; sparkno=0+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-15
	hitsound=300,1
	guardsound=40,0
	ground.slidetime=12
	ground.hittime=18
	air.hittime=18
	ground.velocity=0
	air.velocity=   0,-4
	getpower=0,0
	hitonce=1
	kill=0
	;---
	guard.ctrltime=     id +0*(var(31):=0 || var(30):= 510515 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

[state 0]
	type=hitdef
	trigger1=(animelem=14)
	attr=s,na
	damage=68
	animtype=heavy
	air.animtype=back
	fall.animtype=diagup
	air.type=low
	ground.type=low
	guardflag=ma
	hitflag=ma+
	pausetime=11,11
	;ad; sparkno=2+(random%4)*10
	;ad; guard.sparkno =40
	sparkxy=-10,-95
	hitsound=300,3
	guardsound=41,0
	ground.slidetime=16
	ground.hittime=18
	air.hittime=18
	ground.velocity=-2,-10
	air.velocity=   -2,-10
	fall=1
	air.fall=1
	recover=0
	fall.recover=0
	yaccel=0.5
	getpower=0,0
	hitonce=1
	;---
	guard.ctrltime=     id +0*(var(31):=2 || var(30):= 510595 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1


;-------------
; - p2
[statedef 802]
type=s
movetype=h
physics=n
velset=0,0
ctrl=0
[state 0]
	type=afterimagetime
	trigger1=!time
	time=0
[state 0]
	type=hitfallset
	trigger1=!time
	value=0
	xvel=0
	yvel=0
[state 0]
	type=posset
	trigger1=!time
	y=0
[state 0]
	type=changeanim2
	trigger1=!time
	value=802
[state 0]
	type=selfstate
	trigger1=animtime=0
	value=0
	ctrl=1




;-------------
; throw2 - p1
[statedef 811]
type=s
movetype=a
physics=n
anim=811
sprpriority=2
poweradd=0
velset=0,0
ctrl=0

;---
[state 0]
	type=targetstate
	trigger1=!time
	value=812

;---
[state 0]
	type=targetbind
	trigger1=(animelem=3,<0)
	pos=floor(28*const(size.xscale)),0

[state 0]
	type=bindtotarget
	trigger1=(animelem=3,>=0) && (animelem=7,<0)
	pos=0,0,head

[state 0]
	type=targetbind
	trigger1=(animelem=7,>=0) && (animelem=8,<0)
	pos=0,floor(-100*const(size.yscale))

[state 0]
	type=targetbind
	trigger1=(animelem=8)
	pos=floor(30*const(size.xscale)),floor(-85*const(size.yscale))

[state 0]
	type=posadd
	trigger1=(animelem=7)||(animelem=8)
	x=floor(25*const(size.xscale))
[state 0]
	type=posset
	trigger1=(animelem=7)||(animelem=8)
	y=-2
[state 0]
	type=posset
	trigger1=(animelem=8)
	y=0

;---
[state 0]
	type=playsnd
	trigger1=(animelem=7)
	value=f200,2
	channel=1
[state 0]
	type=playsnd
	trigger1=(animelem=8)
	value=0,11
	channel=0

[state 0]
	type=targetlifeadd
	trigger1=(animelem=8)
	value=-128
[state 0]
	type=targetstate
	trigger1=(animelem=8)
	value=813
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1

;-------------
; - p2
[statedef 812]
type=a
movetype=h
physics=n
velset=0,0
ctrl=0
[state 0]
	type=afterimagetime
	trigger1=!time
	time=0
[state 0]
	type=changeanim2
	trigger1=!time
	value=812
[state 0]
	type=selfstate
	trigger1=(animtime=0)
	value=5050

;-------------
; - p2
[statedef 813]
type=a
movetype=h
physics=n
velset=-6,-5
ctrl=0
[state 0]
	type=hitfallset
	trigger1=!time
	value=1
	xvel=-6
	yvel=-5
[state 0]
	type=veladd
	trigger1=1
	y=0.5
[state 0]
	type=selfstate
	trigger1=(pos y+vel y>-30)
	value=5100



;-------------
; throw3 - p1
[statedef 821]
type=s
movetype=a
physics=n
anim=821
sprpriority=2
poweradd=0
velset=0,0
ctrl=0

;---
[state 0]
	type=targetbind
	trigger1=(animelem=2,<0)
	pos=floor(28*const(size.xscale)),0
[state 0]
	type=bindtotarget
	trigger1=(animelem=4,>=0) && (animelem=5,<0)
	pos=0,0,head
[state 0]
	type=targetbind
	trigger1=(animelem=5,>=0) && (animelem=6,<0)
	pos=0,0

[state 0]
	type=posadd
	trigger1=(animelem=5) || (animelem=6)
	x=-35*const(size.xscale)
[state 0]
	type=posset
	trigger1=(animelem=5) && (pos y>-80)
	y=-80
[state 0]
	type=posset
	trigger1=(animelem=6)
	y=0

[state 0]
	type=targetbind
	trigger1=(animelem=6)
	pos=0,floor(-90*const(size.yscale))

;---
[state 0]
	type=turn
	trigger1=!time
[state 0]
	type=targetfacing
	trigger1=!time
	value=-1
;---
[state 0]
	type=playsnd
	trigger1=(animelem=6)
	value=f200,2
	channel=1
[state 0]
	type=playsnd
	trigger1=(animelem=7)
	value=0,11
	channel=0

[state 0]
	type=targetlifeadd
	trigger1=(animelem=7)
	value=-128
[state 0]
	type=targetstate
	trigger1=!time
	value=822
[state 0]
	type=targetstate
	trigger1=(animelem=7)
	value=823
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1

;-------------
; - p2
[statedef 822]
type=a
movetype=h
physics=n
velset=0,0
ctrl=0
[state 0]
	type=afterimagetime
	trigger1=!time
	time=0
[state 0]
	type=changeanim2
	trigger1=!time
	value=822
[state 0]
	type=selfstate
	trigger1=animtime=0
	value=5050

;-------------
; - p2
[statedef 823]
type=a
movetype=h
physics=n
velset=6,-1
ctrl=0
[state 0]
	type=hitfallset
	trigger1=!time
	value=1
	xvel= 6
	yvel=-1
[state 0]
	type=veladd
	trigger1=1
	y=0.5
[state 0]
	type=selfstate
	trigger1=(pos y+vel y>-30)
	value=5100





;--------------
; override common1.cns
;--------------

; recover
[statedef 5201]
type=s
movetype=h
physics=n
anim=5200
velset=0,0
ctrl=0

; turn if not facing opponent
[state 0]
	type=turn
	trigger1=!time && (p2dist x<-6)
[state 0]
	type=posset
	trigger1=!time
	y=0
[state 0]
	type=nothitby
	trigger1=1
	value=sca
[state 0]
	type=palfx
	trigger1=!time
	time=2
	add=128,128,128
[state 0]
	type=velset
	trigger1=!time
	x=-5
[state 0]
	type=veladd
	trigger1=(vel x>0)
	x=0.2
[state 0]
	type=velset
	trigger1=(animelem=5,>=0)
	x=0
;---
[state 0]
	type=playsnd
	trigger1=time=2
	value=0,1+(random%3)
	channel=0
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1

;--------------
; falldown
[statedef 195200]
type=s
movetype=h
physics=s
anim=195200
velset=0,0
ctrl=0
[state 0]
	type=nothitby
	trigger1=1
	value=sca
[state 0]
	type=posadd
	trigger1=(animelem=8)
	x=-26 *const(size.xscale)
[state 0]
	type=selfstate
	trigger1=animtime=0
	value=5110
	ctrl=0


;[EOF]
