
; Special

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

;--- TCRojbV

[statedef 1000]
type=s
movetype=a
physics=s
anim=1000
sprpriority=2
juggle=8
poweradd=80
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=varset
	trigger1=!time
	var(5)=ifelse(command="sp1",0,1)
[state 0]
	type=varset
	trigger1=!time && var(51)>0
	var(5)=(random<500)

;---
[state 0]
	type=hitby
	trigger1=1
	value=sca,na,sa,ha,nt,st,st

;---
[state 0]
	type=changeanim
	trigger1=(animelem=4,=3) && !var(5)
	value=anim
	elem=5

;---
[state 0] ; dash_dust
	type=helper
	trigger1=((animelem=4) || (animelem=7)) && (sysfvar(0)>0)
	id=152040
	stateno=152040
	pos=floor(ifelse((animelem=4),-16,25)*const(size.xscale)),0
	size.xscale=ifelse((animelem=4),0.5,0.65)
	size.yscale=ifelse((animelem=4),0.5,0.65)

;---
[state 0]
	type=playsnd
	trigger1=time=2
	value=0,12+var(5)
	channel=0
[state 0]
	type=playsnd
	trigger1=time=2
	value=1,2
	channel=1

;---
[state 0]
	type=removeexplod
	trigger1=((!time) || (animelem=5))
	id=200
[state 0]
	type=explod
	trigger1=((time=1) || (animelem=5)) && !numexplod(200)
	id=200
	anim=anim+ifelse((time=1),1,2)
	postype=p1
	sprpriority=3
	bindtime=-1
	scale=const(size.xscale),const(size.yscale)
	ignorehitpause=0
	removeongethit=1
[state 0]
	type=explod
	trigger1=((time=1) || (animelem=5)) && numexplod(200)=1
	id=200
	anim=anim+ifelse((time=1),11,12)
	postype=p1
	sprpriority=1
	bindtime=-1
	scale=const(size.xscale),const(size.yscale)
	ignorehitpause=0
	removeongethit=1

;---
[state 0]
	type=helper
	trigger1=(animelem=7) && (sysfvar(0)>0)
	stateno=1005
	pos=floor(12*const(size.xscale)),0

[state 0]
	type=hitdef
	trigger1=(animelem=6)||(animelem=7)||(animelem=8)
	trigger1=1|| var(6):=floor( (100 -(animelem=7)*30 -(animelem=8)*75) *const(size.yscale))
	trigger2=((animelem=7,>0)&&(animelem=8,<0)) && var(5)
	trigger2=1|| var(6):=var(6)-floor(14*const(size.yscale))
	attr=s,sa
	animtype=hard
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=low
	damage=30,6
	getpower=20,10
	guardflag=m
	hitflag=maf
	pausetime=3,3
	sparkxy=-10,-var(6)
	;ad; sparkno=3+(random%4)*10
	;ad; guard.sparkno =41
	hitsound=300,20
	guardsound=41,0
	ground.slidetime=20
	ground.hittime=20
	ground.velocity= (animelem=8)*(-11)
	air.velocity=    -4,-7
	ground.cornerpush.veloff=(animelem=8)*(-20)
	air.cornerpush.veloff=0
	yaccel=0.5
	air.fall=1
	fall.recover=1
	fall.recovertime=38	
	;---
	palfx.time=23
	palfx.add=48,0,168
	palfx.mul=176,176,176
	palfx.sinadd=64,64,64,17
	palfx.color=0
	palfx.invertall=1
	;---
	guard.ctrltime=     id +0*(var(31):=3 || var(30):= 510500 +var(6) )
	fall.envshake.time= id
	fall.envshake.ampl= 0

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


;--------------
;--- wp[

[statedef 1005]
movetype=a
anim=stateno
velset=0,0
ctrl=0
;---
[state 0] ; code_set
	type=varset
	trigger1=!time
	var(18)=(var(15):=10311)+(var(16):=10212)+(var(17):=10113) ;; ###
;---
[state 0]
	type=hitby
	trigger1=1
	value=sca,ap
	time=1
[state 0]
	type=destroyself
	trigger1=time>12





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

;--- TCRCpNg
[statedef 1100]
type=s
movetype=a
physics=n
anim=1100
sprpriority=2
juggle=8
poweradd=100
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=varset
	trigger1=!time
	var(5)=ifelse(command="sp2",0,1)
[state 0]
	type=varset
	trigger1=!time && var(51)>0
	var(5)=((p2bodydist x>90) || random<500)

;---
[state 0]
	type=removeexplod
	trigger1=!time
	id=200

;---
[state 0]
	type=playsnd
	trigger1=time=1
	value=0,11
	channel=0

;---
[state 0] ; dash_dust
	type=helper
	trigger1=(animelem=2) && (sysfvar(0)>0)
	id=152040
	stateno=152040
	pos=floor(2*const(size.xscale)),0
	size.xscale=0.65
	size.yscale=0.65

[state 0]
	type=velset
	trigger1=(animelem=2)
	x=ifelse(var(5),10,6.5)

[state 0]
	type=changestate
	trigger1=(animtime=0) || ((animelem=2,=6) && !var(5))
	trigger2=(animelem=2,>0) && (p2bodydist x<12)
	value=1105


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

;--- U
[statedef 1105]
type=s
movetype=a
physics=n
anim=1105
velset=3.5,0
ctrl=0

[state 0] ; dash_dust
	type=helper
	trigger1=(animelem=6,=1) && (sysfvar(0)>0)
	id=152040
	stateno=152040
	pos=floor(25*const(size.xscale)),0
	size.xscale=-0.65
	size.yscale= 0.65

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

[state 0]
	type=posadd
	trigger1=(animelem=5) && (p2bodydist x>9)
	x=27 *const(size.xscale)
[state 0]
	type=velset
	trigger1=(animelem=10)
	x=0
[state 0]
	type=velmul
	trigger1=1
	x=0.98

;---
[state 0]
	type=removeexplod
	trigger1=(animelem=7)
	id=200
[state 0]
	type=explod
	trigger1=(animelem=7) && !numexplod(200)
	id=200
	anim=1101
	postype=p1
	sprpriority=3
	bindtime=7
	scale=const(size.xscale),const(size.yscale)
	ignorehitpause=0
	removeongethit=1
[state 0]
	type=explod
	trigger1=(animelem=7) && numexplod(200)=1
	id=200
	anim=1102
	postype=p1
	sprpriority=1
	bindtime=7
	scale=const(size.xscale),const(size.yscale)
	ignorehitpause=0
	removeongethit=1

;---
[state 0]
	type=hitdef
	trigger1=(animelem=2)
	attr=s,sa
	animtype=heavy
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	damage=80,8
	getpower=60,30
	guardflag=m
	hitflag=maf
	pausetime=12,13
	sparkxy=-10,-45
	;ad; sparkno=3+(random%4)*10
	;ad; guard.sparkno =41
	hitsound=300,4
	guardsound=41,0
	ground.slidetime=18
	ground.hittime=20
	air.hittime=20
	ground.velocity=-4
	air.velocity=   -4,-6
	fall=0
	fall.recover=0
	guard.cornerpush.veloff=-18
	air.cornerpush.veloff=0
	;---
	guard.ctrltime=     id +0*(var(31):=3 || var(30):= 510545 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

[state 0]
	type=hitdef
	trigger1=(animelem=7)
	attr=s,sa
	animtype=diagup
	air.type=low
	ground.type=low
	damage=80,8
	getpower=60,30
	guardflag=m
	hitflag=maf
	pausetime=13,13
	;ad; sparkno=3+(random%4)*10
	;ad; guard.sparkno =41
	hitsound=300,20
	guardsound=41,0
	sparkxy=-10,-75
	ground.slidetime=18
	ground.hittime=20
	air.hittime=20
	ground.velocity=-4,-6
	air.velocity=   -4,-6
	guard.velocity=-10
	yaccel=0.5
	fall=1
	fall.recover=0
	guard.cornerpush.veloff=-18
	air.cornerpush.veloff=0
	;---
	palfx.time=23
	palfx.add=48,0,168
	palfx.mul=176,176,176
	palfx.sinadd=64,64,64,17
	palfx.color=0
	palfx.invertall=1
	;---
	guard.ctrltime=     id +0*(var(31):=3 || var(30):= 510575 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

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





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

;--- wbhvX
[statedef 1200]
type=s
movetype=i
physics=s
anim=1200
sprpriority=2
poweradd=100
velset=0,0
ctrl=0
facep2=1

;---
[state 0]
	type=removeexplod
	trigger1=!time
	id=200

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

[state 0]
	type=changestate
	trigger1=animtime=0
	value=1205


;--------------
;--- 
[statedef 1205]
type=a
movetype=a
physics=n
anim=1205
velset=(p2dist x+10)/32.00,-11.00
ctrl=0

[state 0]
	type=veladd
	trigger1=time>0
	y=0.6

[state 0]
	type=playerpush
	trigger1=(animelem=4,>=0)
	value=0
	ignorehitpause=1

[state 0]
	type=removeexplod
	trigger1=(animelem=5)
	id=200
[state 0]
	type=explod
	trigger1=(animelem=5,>=0) && (!movecontact)
	id=200
	anim=anim+1
	postype=p1
	sprpriority=2
	bindtime=-1
	scale=const(size.xscale),const(size.yscale)
	shadow=-1
	removetime=1
	ignorehitpause=1
	removeongethit=1

[state 0]
	type=assertspecial
	trigger1=numexplod(200)
	flag=invisible
	ignorehitpause=0

;---
[state 0]
	type=hitdef
	trigger1=!time
	attr=a,sa
	damage=110,12
	animtype=hard
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	getpower=80,40
	guardflag=m
	hitflag=maf
	pausetime=1,14
	;ad; sparkno=3+(random%4)*10
	;ad; guard.sparkno =41
	hitsound=300,4
	guardsound=41,0
	sparkxy=-10,0
	ground.slidetime=20
	ground.hittime=20
	air.hittime=20
	ground.velocity=-10
	air.velocity=   -4.5,-7
	yaccel=0.5
	air.fall=1
	fall.recover=0
	persistent=0
	;---
	guard.ctrltime=     id +0*(var(31):=3 || var(30):= 510500 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=changestate
	trigger1=(movecontact)
	value=1210
	ignorehitpause=1
;---
[state 0]
	type=changestate
	trigger1=(pos y+vel y>=0) && (vel y>0)
	value=1215


;--------------
[statedef 1210]
type=a
movetype=i
physics=n
anim=1210
velset=0,0
ctrl=0

;---
[state 0]
	type=removeexplod
	trigger1=!time
	id=200

[state 0]
	type=playsnd
	trigger1=time=1
	value=0,2
	channel=0
[state 0]
	type=playsnd
	trigger1=(animelem=5)
	value=f200,3
	channel=1
;---
[state 0]
	type=velset
	trigger1=(animelem=6)
	x= 0
	y=-7
[state 0]
	type=veladd
	trigger1=(animelem=6,>0)
	y=0.5

;--- player
[state 0]
	type=velset
	trigger1=(animelem=6,>0) && var(51)<1
	x= 5 *((command="holdfwd")-(command="holdback"))
;--- ai
[state 0]
	type=varset
	trigger1=!time
	var(6)=(random%2)
[state 0] ;; approching
	type=velset
	trigger1=(animelem=6,>0) && var(51)>0 && var(6)=0
	x=5 *((p2bodydist x>10)-(p2bodydist x<-10))
[state 0] ;; leaving
	type=velset
	trigger1=(animelem=6,>0) && var(51)>0 && var(6)=1
	x=5 *((p2bodydist x<0)-(p2bodydist x>=0))

;--- T}[\gXJ_Co[
[state 0]
	type=changestate
	value=1250
	triggerall=(animelem=9,>0) && (pos y<-10)
	trigger1=var(51)<1 && (command="x" || command="y")
	trigger2=var(51)>0 && ((p2bodydist x=[-10,60]) || var(18)=0) && (p2bodydist y=[-10,80])
;---
[state 0]
	type=changestate
	trigger1=(pos y+vel y>=0) && (vel y>0)
	value=1215


;--------------
;--- n

[statedef 1215]
type=s
movetype=i
physics=s
anim=1215
velset=0,0
ctrl=0

[state 0]
	type=posset
	trigger1=!time
	y=0
[state 0]
	type=removeexplod
	trigger1=!time
	id=200
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1


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

;--- T}[\gXJ_Co[
[statedef 1250]
type=a
movetype=a
physics=n
anim=1250
poweradd=50
ctrl=0

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

[state 0]
	type=veladd
	trigger1=1
	y=0.5

;---
[state 0]
	type=velset
	trigger1=var(51)<1 && (command="holdfwd" || command="holdback")
	x=5*ifelse(command="holdfwd",1,-1)
[state 0]
	type=velset
	trigger1=var(51)>0 && (p2bodydist x!=[-10,10])
	x=5 *ifelse((p2bodydist x>0),1,-1)

;---
;---
[state 0]
	type=removeexplod
	trigger1=!time
	id=200
[state 0]
	type=explod
	trigger1=!time && !numexplod(200)
	id=200
	anim=anim+1
	postype=p1
	sprpriority=3
	bindtime=-1
	scale=const(size.xscale),const(size.yscale)
	ignorehitpause=0
	removeongethit=1
[state 0]
	type=explod
	trigger1=!time && numexplod(200)=1
	id=200
	anim=anim+2
	postype=p1
	sprpriority=1
	bindtime=-1
	scale=const(size.xscale),const(size.yscale)
	ignorehitpause=0
	removeongethit=1

;---
[state 0]
	type=hitdef
	trigger1=!time
	attr=a,sa
	animtype=hard
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	damage=105,12
	getpower=80,40
	guardflag=ha
	hitflag=maf
	pausetime=8,13
	sparkxy=-10,-35
	;ad; sparkno=3+(random%4)*10
	;ad; guard.sparkno =41
	hitsound=300,4
	guardsound=41,0
	ground.slidetime=10
	ground.hittime=18
	air.hittime=18
	ground.velocity=-9
	air.velocity=   -3,-7
	yaccel=0.4
	air.fall=1
	fall.recover=0
	persistent=0
	;---
	palfx.time=23
	palfx.add=48,0,168
	palfx.mul=176,176,176
	palfx.sinadd=64,64,64,17
	palfx.color=0
	palfx.invertall=1
	;---
	guard.ctrltime=     id +0*(var(31):=3 || 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=(pos y+vel y>=0) && (vel y>0)
	value=1215






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

;--- fro[X
[statedef 1300]
type=s
movetype=i
physics=s
anim=1200
sprpriority=2
poweradd=100
velset=0,0
ctrl=0
facep2=1

;---
[state 0]
	type=removeexplod
	trigger1=!time
	id=200

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

[state 0]
	type=changestate
	trigger1=animtime=0
	value=1305


;--------------
;--- 
[statedef 1305]
type=a
movetype=i
physics=n
anim=1305
velset=(p2bodydist x+10)/32.00,-10.00
ctrl=0

[state 0]
	type=gravity
	trigger1=time>0

;--- T}[\gXJ_Co[
[state 0]
	type=changestate
	triggerall=(animelem=3,>=2) && (animelem=4,<22) && (pos y<-10)
	trigger1=var(51)<1 && (command="x" || command="y")
	trigger2=var(51)>0 && (p2bodydist x=[-60,60]) && (p2bodydist y=[-10,110])
	value=1310
;---
[state 0]
	type=changestate
	trigger1=(pos y+vel y>=0) && (vel y>0)
	value=1215


;--------------
[statedef 1310]
type=a
movetype=a
physics=n
anim=1310
velset=-6,-7
ctrl=0

[state 0]
	type=veladd
	trigger1=1
	y=0.5
[state 0]
	type=velmul
	trigger1=(animelem=5,<0)
	x=0.94

;--- player
[state 0]
	type=velset
	trigger1=(animelem=5,>0) && var(51)<1
	x=5 *((command="holdfwd")-(command="holdback"))
;--- ai
[state 0]
	type=varset
	trigger1=!time
	var(6)=ifelse(p2movetype=a && random<250, 1, 0)
[state 0] ;; approching
	type=velset
	trigger1=(animelem=5,>0) && var(51)>0 && var(6)=0
	x=5 *((p2bodydist x>20)-(p2bodydist x<-20))
[state 0] ;; leaving
	type=velset
	trigger1=(animelem=5,>0) && var(51)>0 && var(6)=1
	x=5 *((p2bodydist x<0)-(p2bodydist x>=0))

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

;---
[state 0]
	type=removeexplod
	trigger1=(animelem=7)
	id=200
[state 0]
	type=explod
	trigger1=(animelem=7) && !numexplod(200)
	id=200
	anim=anim+1
	postype=p1
	sprpriority=3
	bindtime=-1
	scale=const(size.xscale),const(size.yscale)
	ignorehitpause=0
	removeongethit=1
[state 0]
	type=explod
	trigger1=(animelem=7) && numexplod(200)=1
	id=200
	anim=anim+2
	postype=p1
	sprpriority=1
	bindtime=-1
	scale=const(size.xscale),const(size.yscale)
	ignorehitpause=0
	removeongethit=1

;---
[state 0]
	type=hitdef
	trigger1=!time
	attr=s,sa
	damage=100,12
	animtype=back
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	getpower=80,40
	guardflag=m
	hitflag=maf
	pausetime=8,13
	;ad; sparkno=3+(random%4)*10
	;ad; guard.sparkno =41
	hitsound=300,4
	guardsound=41,0
	sparkxy=-10,-55
	ground.slidetime=18
	ground.hittime=20
	air.hittime=20
	ground.velocity=-4.5
	air.velocity=   -4.5,-7
	guard.velocity=-10
	yaccel=0.5
	fall=0
	fall.recover=0
	persistent=0
	;---
	palfx.time=39
	palfx.add=48,0,168
	palfx.mul=176,176,176
	palfx.sinadd=64,64,64,17
	palfx.color=0
	palfx.invertall=1
	;---
	guard.ctrltime=     id +0*(var(31):=3 || var(30):= 515555 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=10)
	movetype=i
[state 0]
	type=changestate
	trigger1=(pos y+vel y>=0) && (vel y>0)
	value=1215






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

;--- TCRNbV[
[statedef 1400]
type=s
movetype=a
physics=s
anim=1400
sprpriority=2
poweradd=100
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=varset
	trigger1=!time
	var(5)=ifelse(command="sp3", 0, 1)
[state 0]
	type=varset
	trigger1=!time && var(51)>0
	var(5)=((p2bodydist x>100) || random<500)

;---
[state 0]
	type=removeexplod
	trigger1=!time
	id=200

[state 0]
	type=varset
	trigger1=!time
	var(6)=0
;---
[state 0]
	type=playsnd
	trigger1=time=1
	value=0,10
	channel=0
[state 0]
	type=playsnd
	trigger1=time=2
	value=1,3
	channel=1

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=5)
	statetype=a
	physics=n
[state 0]
	type=posadd
	trigger1=(animelem=5)
	y=-1

;---
[state 0] ; dash_dust
	type=helper
	trigger1=(animelem=5) && (sysfvar(0)>0)
	id=152040
	stateno=152040
	pos=floor(-6*const(size.xscale)), floor(-pos y)
	size.xscale=0.85
	size.yscale=0.85

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


;--------------
[statedef 1405]
type=a
movetype=a
physics=n
anim=1405
velset=0,0
ctrl=0

[state 0]
	type=velset
	trigger1=!time
	x=ifelse(var(5),9,6)

[state 0]
	type=assertspecial
	trigger1=1
	flag=noautoturn
[state 0]
	type=playerpush
	trigger1=1
	value=0

;---
[state 0]
	type=explod
	trigger1=!time && !numexplod(200)
	id=200
	anim=anim+1
	postype=p1
	sprpriority=3
	bindtime=-1
	scale=const(size.xscale),const(size.yscale)
	removetime=512
	ignorehitpause=1
	removeongethit=1
[state 0]
	type=explod
	trigger1=!time && numexplod(200)=1
	id=200
	anim=anim+2
	postype=p1
	sprpriority=1
	bindtime=-1
	scale=const(size.xscale),const(size.yscale)
	removetime=512
	ignorehitpause=1
	removeongethit=1

;---
[state 0]
	type=hitdef
	trigger1=(time%8=1) && var(6)<3 && !movehit
	attr=s,sa
	animtype=hard
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	damage=ifelse(var(5),120,110),8
	getpower=50,25
	guardflag=m
	hitflag=maf
	pausetime=13,13
	sparkxy=-10,-62
	;ad; sparkno=3+(random%4)*10
	;ad; guard.sparkno =41
	hitsound=300,4
	guardsound=41,0
	ground.slidetime=18
	ground.hittime=20
	air.hittime=20
	ground.velocity=-4.5,-7
	air.velocity=   -4.5,-7
	guard.velocity= -7
	yaccel=0.5
	fall=1
	fall.recover=0
	;---
	palfx.time=40
	palfx.add=48,0,168
	palfx.mul=176,176,176
	palfx.sinadd=64,64,64,17
	palfx.color=0
	palfx.invertall=1
	;---
	guard.ctrltime=     id +0*(var(31):=3 || var(30):= 510562 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=varadd
	trigger1=(movecontact=1) && (hitpausetime=13)
	var(6)=1
	ignorehitpause=1

;---
[state 0]
	type=changestate
	trigger1=(time>22 && !var(5)) || time>62
	trigger2=time>12 && frontedgebodydist<const(size.ground.front)
	value=1415


;--------------
;--- n
[statedef 1415]
type=s
movetype=i
physics=n
anim=1415
ctrl=0

[state 0]
	type=velmul
	trigger1=1
	x=0.75
[state 0]
	type=velset
	trigger1=(animelem=3)
	x=0
	y=0
[state 0]
	type=posset
	trigger1=(animelem=3)
	y=0

[state 0]
	type=removeexplod
	trigger1=!time
	id=200

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





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

;--- _uj[vX
[statedef 1500]
type=s
movetype=a
physics=s
anim=1500
juggle=7
sprpriority=2
poweradd=100
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=varset
	trigger1=!time
	var(5)=ifelse(command="sp4", 0, 1)
[state 0]
	type=varset
	trigger1=!time && var(51)>0
	var(5)=((p2bodydist x>90) || random<500)

;---
[state 0]
	type=removeexplod
	trigger1=!time
	id=200

;---
[state 0] ; dash_dust
	type=helper
	trigger1=(animtime=0) && (sysfvar(0)>0)
	id=152040
	stateno=152040
	pos=floor(2*const(size.xscale)),0
	size.xscale=0.85
	size.yscale=0.85

[state 0]
	type=playsnd
	trigger1=time=1
	value=0,12
	channel=0
[state 0]
	type=playsnd
	trigger1=animtime=0
	value=f200,3
	channel=1
[state 0]
	type=changestate
	trigger1=animtime=0
	value=1510


;--------------
[statedef 1510]
type=a
movetype=a
physics=n
anim=1510
velset=0,0
ctrl=0

[state 0]
	type=velset
	trigger1=!time
	x=ifelse(var(5),11,7)
	y=-3
[state 0]
	type=veladd
	trigger1=1
	y=0.4

;---
[state 0]
	type=changeanim
	trigger1=((animelem=1,=2) || (animelem=2,=3)) && !var(5)
	value=anim
	elem=2 +(animelem=2,=3)

;---
[state 0]
	type=hitdef
	trigger1=(animelem=2) && (p2statetype=a) && var(5)
	trigger2=(animelem=3)
	attr=s,sa
	animtype=hard
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	damage=var(5)*20+60, var(5)*2+6
	getpower=20,10
	guardflag=m
	hitflag=maf
	pausetime=13,13
	sparkxy=-15,-ifelse((animelem=2),85,45)
	;ad; sparkno=3+(random%4)*10
	;ad; guard.sparkno =41
	hitsound=300,4
	guardsound=41,0
	ground.slidetime=10
	ground.hittime=18
	air.hittime=18
	ground.velocity=-5
	air.velocity=   -4,-6
	yaccel=0.5
	air.fall=1
	fall.recover=0
	;---
	guard.ctrltime=     id +0*(var(31):=3 || var(30):= 515500 +ifelse((animelem=2),85,45) )
	fall.envshake.time= id
	fall.envshake.ampl= 0

[state 0]
	type=hitdef
	trigger1=(animelem=4)
	attr=s,sa
	damage=var(5)*20+60, var(5)*2+6
	animtype=hard
	air.animtype=back
	fall.animtype=back
	air.type=low
	ground.type=high
	getpower=40,20
	guardflag=m
	hitflag=maf
	pausetime=13,13
	sparkxy=-15,-15
	;ad; sparkno=3+(random%4)*10
	;ad; guard.sparkno =41
	hitsound=300,4
	guardsound=41,0
	ground.slidetime=18
	ground.hittime=20
	air.hittime=20
	ground.velocity=-5,-7
	air.velocity=   -5,-7
	guard.velocity=-11
	yaccel=0.5
	fall=1
	fall.recover=0
	;---
	guard.ctrltime=     id +0*(var(31):=3 || var(30):= 515515 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=changestate
	trigger1=(pos y+vel y>=0) && (vel y>0)
	value=1515


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

[state 0]
	type=posset
	trigger1=!time
	y=0

[state 0] ; dash_dust
	type=helper
	trigger1=(!time) && (sysfvar(0)>0)
	id=152040
	stateno=152040
	pos=floor(16*const(size.xscale)),0
	size.xscale=-0.75
	size.yscale= 0.75

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




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

;--- xK[v
[statedef 1600]
type=s
movetype=i
physics=s
anim=1600
sprpriority=2
poweradd=0
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=varset
	trigger1=!time
	var(5)=(command="y")+(command="a")*2+(command="b")*3

[state 0]
	type=nothitby
	trigger1=((animelem=3,>=0)&&(animelem=13,<0)) || var(51)>0
	value=sca
[state 0]
	type=playerpush
	trigger1=1
	value=0

;---
[state 0]
	type=removeexplod
	trigger1=!time
	id=200
;---
;--- fx_start
[state 0]
	type=palfx
	trigger1=(animelem=3)
	time=12
	add=0,0,0
	mul=255,255,255
	sinadd=0,-255,0,48
;--- fx_end
[state 0]
	type=palfx
	trigger1=(animelem=12)
	time=12
	add=0,-255,0
	mul=255,255,255
	sinadd=0,255,0,48

;---
[state 0]
	type=playsnd
	trigger1=(time=2)
	value=0,(random%2)*5
	channel=0
[state 0]
	type=playsnd
	trigger1=(animelem=5)||(animelem=15)
	value=1,1
	channel=1

;---
;--- [vړ
[state 0]
	type=posadd
	trigger1=(animelem=11)
	x=ifelse((var(5)%2=0),78,209)*ifelse(var(5)<2,1,-1)
[state 0]
	type=turn
	trigger1=(p2dist x<-5) && (animelem=11,>0)
;---
; boss advantage
; {XD
[state 0]
	type=ctrlset
	trigger1=(animelem=12) && var(51)>0
	value=1
;---
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1



;[EOF]
