
; super / hyper


;-------------------------
; shin_ku_hadou
; ^g
; messtsu_ha_dou
; ŎEg

[statedef 3000]
type=s
physics=s
movetype=a
anim=1000
sprpriority=2
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=varset
	trigger1=!time
;;	var(10)=(command="hp1_s" && power>=2000)
	var(10)=(command="hp3_s" && power>=2000)

[state 0]
	type=width
	trigger1=(animelem=7)
	value=28,0

;-[hpe]---------
[state 0]
	type=poweradd
	trigger1=(animelem=4) && roundstate=2
	value=-ifelse(var(10),2000,1000)
[state 0]
	type=helper
	trigger1=(animelem=4) && roundstate=2 && (sysfvar(0)>0)
	id=88880
	stateno=88880+ifelse(var(10),2,0)
	pos=floor(-18*const(size.xscale)),floor(-73*const(size.yscale))
;---------------

[state 0] ; old_ver
	type=superpause
	trigger1=(animelem=4) && roundstate=2 && (sysfvar(0)<=0)
	pos=floor(-18*const(size.xscale)),floor(-73*const(size.yscale))
	anim=100
	sound=20,0

[state 0]
	type=afterimage
	trigger1=(animelem=4)
	time=abs(animtime)
	length=9
	timegap=2
	framegap=4
	palbright=1,1,1
	palcontrast=128,(!var(10))*128,(!var(10))*128
	paladd=0,0,0
	palmul=1,1,1
;afia;	trans=add1

;---
[state 0]
	type=projectile
	trigger1=(animelem=3,>=0) && (animelem=4,<0)
	trigger1=1|| var(11):=-16 || var(12):=-66 || fvar(1):=0.5
	trigger2=(animelem=4,>=0) && (animelem=5,<0)
	trigger2=1|| var(11):=-16 || var(12):=-68 || fvar(1):=0.75
	trigger3=(animelem=5,>=0) && (animelem=6,<0)
	trigger3=1|| var(11):=-16 || var(12):=-69 || fvar(1):=1
	trigger4=(animelem=6,>=0) && (animelem=7,<0)
	trigger4=1|| var(11):=-6 || var(12):=-66 || fvar(1):=1
	projanim=1004
	projsprpriority=3
	postype=p1
	offset=floor(var(11)*const(size.xscale)), floor(var(12)*const(size.yscale))
	projedgebound=800
	projstagebound=800
	projscale=fvar(1),fvar(1)
	projremovetime=1

;---
[state 0]
	type=helper
	trigger1=(animelem=7) && (sysfvar(0)>0)
	id=3000
	size.height=511222;;<-(removetime+options)
	pos=floor(60*const(size.xscale)),floor(-66*const(size.yscale))
	stateno=91000
	size.head.pos=3015,3006;;<-anim,hitanim
	size.mid.pos=ifelse(var(10),6500,5500),0;;<-speed_x,y(1/1000)
	size.ground.front=ifelse(var(10),7,4)*1000+9;;<-max_hits/miss_time
	size.ground.back=600010;;<-damage hit/guard
	size.air.front=620560;; <vel_x,y_hit
	size.air.back= 640530;; <vel_x,y_guard
	size.shadowoffset=13;;<-fall(10=recovery/1=ground/2=air/3=g&a)
	ownpal=1
	size.xscale=ifelse(var(10),1.15,1)
	size.yscale=ifelse(var(10),1.15,1)

;---
[state 0]
	type=projectile
	trigger1=(animelem=7) && (sysfvar(0)<=0)
	projid=91000
	projanim=3005
	projhitanim=3006
	projpriority=3
	projsprpriority=3
	projscale=ifelse(var(10),1.15,1),ifelse(var(10),1.15,1)
	projremovetime=222
	projhits=ifelse(var(10),7,4)
	offset=floor(60*const(size.xscale)),floor(-66*const(size.yscale))
	velocity=ifelse(var(10),6.5,5.5), 0
	attr=s,hp
	damage=60,10
	hitflag=maf
	guardflag=m
	animtype=heavy
	air.animtype=back
	fall.animtype=diagup
	ground.type=high
	air.type=low
	pausetime=9,10
	sparkno=3
	guard.sparkno =41
	hitsound=5,4
	guardsound=6,0
	ground.slidetime=18
	ground.hittime=18
	air.hittime=18
	ground.velocity=-12
	air.velocity=    -6,-6
	air.juggle=8
	getpower=0,0
	fall=1
	air.fall=1
	fall.recover=0
	;---
	palfx.time=58
	palfx.add=48,0,168
	palfx.mul=200,180,256
	palfx.sinadd=168,128,256,20
	palfx.color=0
	palfx.invertall=1

;---
[state 0]
	type=playsnd
	trigger1=(time=1)
;;	value=0,20 ;; shin-ku
	value=0,40 ;; metsu
	channel=0
[state 0]
	type=playsnd
	trigger1=(animelem=7)
	value=0,10
	channel=0

[state 0]
	type=playsnd
	trigger1=(animelem=5)
	value=f200,2
	channel=1
[state 0]
	type=playsnd
	trigger1=(animelem=7)
	value=2,0
	channel=2

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


;-------------------------
; messatsu_gou_syo_ryu
; ŎE

[statedef 3100]
type=s
movetype=a
physics=s
juggle=7
anim=3100
sprpriority=2
velset=0,0
ctrl=0
facep2=1
;---
[state 0]
	type=varset
	trigger1=!time
	var(10)=ifelse((command="hp1_s" && power>=2000),2,0)
[state 0]
	type=varset
	trigger1=!time && var(51)>0
	var(10)=ifelse(power>=2000 && random<500, 2, 0)

;-[hpe]---------
[state 0]
	type=poweradd
	trigger1=(animelem=1) && roundstate=2
	value=-ifelse(var(10),2000,1000)
[state 0]
	type=helper
	trigger1=(animelem=1) && roundstate=2 && (sysfvar(0)>0)
	id=88880
	stateno=88880+ifelse(var(10),2,0)
	pos=floor(14*const(size.xscale)),floor(-54*const(size.yscale))
;---------------

[state 0] ; old_ver
	type=superpause
	trigger1=(animelem=1) && roundstate=2 && (sysfvar(0)<=0)
	pos=floor(14*const(size.xscale)),floor(-54*const(size.yscale))
	anim=100
	sound=20,0

[state 0]
	type=afterimage
	trigger1=(animelem=1)
	time=256
	length=9
	timegap=2
	framegap=4
	palbright=1,1,1
	palcontrast=128,(!var(10))*128,(!var(10))*128
	paladd=0,0,0
	palmul=1,1,1
;afia;	trans=add1

;---
[state 0]
	type=changeanim
	trigger1=(animelem=8,=1) && !var(10)
	value=anim
	elem=17
;---
[state 0]
	type=playsnd
	trigger1=(animelem=2)||(animelem=10)||(animelem=18)
	value=f200,2
	channel=1
[state 0]
	type=playsnd
	trigger1=!time
	value=0,40 ;; 0,5
	channel=0

[state 0]
	type=playsnd
	trigger1=(animelem=3)||(animelem=10)||(animelem=18)
	value=0,ifelse((animelem=3), 0, ifelse((animelem=10), 1, 5))
	channel=0

[state 0]
	type=nothitby
	trigger1=(animelem=12,<0)
	value=sca,na,sa,ha,np,sp,hp

[state 0]
	type=statetypeset
	trigger1=(animelem=20)
	statetype=a
	physics=n

[state 0]
	type=velset
	trigger1=(animelem=2)||(animelem=10)||(animelem=18)
	x=13.5
[state 0]
	type=velset
	trigger1=(animelem=20)
	x= 4
	y=-10
;---
[state 0] ; dash_dust
	type=helper
	trigger1=(animelem=2)||(animelem=10)||(animelem=18)||(animelem=20)
	trigger1=(sysfvar(0)>0)
	id=152040
	stateno=152040
	pos=floor(2*const(size.xscale)),floor(-pos y)
	size.xscale=0.85
	size.yscale=0.85

;;---
[state 0]
	type=velmul
	trigger1=1
	x=0.98
[state 0]
	type=veladd
	trigger1=(animelem=20,>=0)
	y=0.47

;---
[state 0]
	type=hitdef
	trigger1=(animelem=3)||(animelem=4)||(animelem=11)||(animelem=12)
	attr=s,ha
	animtype=heavy
	air.animtype=back
	fall.animtype=back
	air.type=low
	damage=50,8
	hitflag=maf
	guardflag=m
	pausetime=8,8
	;ad; sparkno=4+(random%4)*10
	;ad; guard.sparkno =41
	sparkxy=-10,-80
	hitsound=300,4
	guardsound=41,0
	ground.type=high
	ground.slidetime=14
	ground.hittime=18
	air.hittime=18
	ground.velocity=-vel x*0.6
	air.velocity=   -vel x*0.7,-4.5
	ground.cornerpush.veloff=0
	air.fall=1
	air.recover=0
	;---
	guard.ctrltime=     id +0*(var(31):=4 || var(30):= 510580 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

[state 0]
	type=hitdef
	trigger1=(animelem=2)||(animelem=10)||(animelem=18)
	attr=s,ha
	animtype=heavy
	air.animtype=back
	fall.animtype=back
	air.type=low
	damage=50,8
	hitflag=ma
	guardflag=m
	pausetime=8,8
	;ad; sparkno=4+(random%4)*10
	;ad; guard.sparkno =41
	sparkxy=-10,-36
	hitsound=300,4
	guardsound=41,0
	ground.type=low
	ground.slidetime=14
	ground.hittime=18
	air.hittime=18
	ground.velocity=-vel x*0.6
	air.velocity=   -vel x*0.7,-4.5
	ground.cornerpush.veloff=0
	air.fall=1
	air.recover=0
	;---
	guard.ctrltime=     id +0*(var(31):=4 || var(30):= 510536 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

[state 0]
	type=hitdef
	trigger1=(animelem=19)||(animelem=20)
	attr=a,ha
	animtype=heavy
	air.animtype=back
	fall.animtype=back
	air.type=low
	damage=60,10
	hitflag=maf
	guardflag=m
	pausetime=12,12
	;ad; sparkno=4+(random%4)*10
	;ad; guard.sparkno =41
	sparkxy=-10,-85
	hitsound=300,4
	guardsound=41,0
	ground.type=low
	ground.slidetime=14
	ground.hittime=18
	air.hittime=18
	ground.velocity=-vel x*0.5,-11
	air.velocity=   -vel x*0.3,-11
	guard.velocity=-11
	fall=1
	fall.recover=0
	air.fall=1
	air.recover=0
	yaccel=0.5
	;---
	guard.ctrltime=     id +0*(var(31):=4 || var(30):= 510585 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=changestate
	trigger1=(animelem=20,>0) && (vel y>0)
	value=1101 ;; fall
[state 0]
	type=changestate
	trigger1=(pos y+vel y>=0) && (vel y>0)
	value=1105 ;; for_safety


;-------------------------
; shin_ku_tatsu_maki
; ^󗳊r

[statedef 3200]
type=a
physics=n
movetype=a
anim=3200
juggle=4
sprpriority=2
poweradd=0
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=varset
	trigger1=!time
	var(10)=(command="hp2_s" && power>=2000)

[state 0]
	type=varset
	trigger1=!time
	var(11)=ifelse(var(10),9,5)

[state 0]
	type=nothitby
	trigger1=1
	value=sca
	time=ifelse(var(10),15,9)

[state 0]
	type=playsnd
	trigger1=(time=2)
	value=0,20
	channel=0

;-[hpe]---------
[state 0]
	type=poweradd
	trigger1=(animelem=3) && roundstate=2
	value=-ifelse(var(10),2000,1000)
[state 0]
	type=helper
	trigger1=(animelem=3) && roundstate=2 && (sysfvar(0)>0)
	id=88880
	stateno=88880+ifelse(var(10),2,0)
	pos=floor(-33*const(size.xscale)),floor(-31*const(size.yscale))
;---------------

[state 0] ; old_ver
	type=superpause
	trigger1=(animelem=3) && roundstate=2 && (sysfvar(0)<=0)
	pos=floor(-33*const(size.xscale)),floor(-31*const(size.yscale))
	anim=100
	sound=20,0

[state 0]
	type=afterimage
	trigger1=(animelem=3)
	time=256
	length=9
	timegap=2
	framegap=4
	palbright=1,1,1
	palcontrast=128,(!var(10))*128,(!var(10))*128
	paladd=0,0,0
	palmul=1,1,1
;afia;	trans=add1

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

;---
[state 0]
	type=velset
	trigger1=(animelem=4)
	y=-2.5

[state 0]
	type=playerpush
	trigger1=1
	value=0

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

; tatsu_tatsu
;--------------
; maki_maki

[statedef 3201]
type=a
physics=n
movetype=a
anim=3201
poweradd=0
velset=0,0
ctrl=0
facep2=1

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

;---
[state 0]
	type=playsnd
	trigger1=(animelem=1,=1)
	value=f200,3
	channel=1

[state 0]
	type=playerpush
	trigger1=1
	value=0
	ignorehitpause=1

;---
[state 0]
	type=projectile
	trigger1=1
	projanim=1002+var(10)
	projsprpriority=-5
	postype=p1
	offset=0,floor(-pos y)
	projedgebound=800
	projstagebound=800
	projscale=(abs(animtime)+2)*0.5, (abs(animtime)+2)*0.05
	projremovetime=1
	ignorehitpause=1

;---
[state 0]
	type=hitdef
	trigger1=(animelem=2)||(animelem=5)
	attr=a,ha
	animtype=heavy
	air.animtype=back
	fall.animtype=diagup
	ground.type=high
	air.type=low
	damage=45,10
	hitflag=maf
	guardflag=m
	pausetime=4,3
	;ad; sparkno=4+(random%4)*10
	;ad; guard.sparkno =41
	sparkxy=-10,-60
	hitsound=300,3
	guardsound=41,0
	ground.slidetime=16
	ground.hittime=16
	air.hittime=16
	ground.velocity= ifelse(p2bodydist x>30,5,0)
	air.velocity=    ifelse(p2bodydist x>30,5,0), -3
	air.fall=1
	air.recover=0
	yaccel=0.5
	getpower=0,0
	;---
	guard.ctrltime=     id +0*(var(31):=4 || var(30):= 510560 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=varadd
	trigger1=(animtime=0)
	var(11)=-1
[state 0]
	type=changestate
	trigger1=(animtime=0) && var(11)<0
	value=3202

;--------------
; maki_maki finish

[statedef 3202]
type=a
physics=n
movetype=a
anim=1202
poweradd=0
velset=0,0
ctrl=0

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

[state 0]
	type=playerpush
	trigger1=1
	value=0
	ignorehitpause=1

;---
[state 0]
	type=hitdef
	trigger1=!time
	attr=a,ha
	animtype=heavy
	air.animtype=back
	fall.animtype=diagup
	ground.type=high
	air.type=low
	damage=45,10
	hitflag=maf
	guardflag=m
	pausetime=13,13
	;ad; sparkno=4+(random%4)*10
	;ad; guard.sparkno =41
	sparkxy=-10,-80
	hitsound=300,5
	guardsound=41,0
	ground.slidetime=18
	ground.hittime=18
	air.hittime=18
	ground.velocity= -5,-9
	air.velocity=    -5,-9
	guard.velocity=  -12
	fall=1
	air.fall=1
	air.recover=0
	yaccel=0.5
	getpower=0,0
	;---
	guard.ctrltime=     id +0*(var(31):=4 || var(30):= 510580 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=changestate
	trigger1=(animelem=7,>3)
	value=3203

;-------------- fall
[statedef 3203]
type=a
physics=a
movetype=i
ctrl=0

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

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

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


;--------------------
; shin-syo_ryu
; ^E
; (max2)

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

[state 0]
	type=nothitby
	trigger1=(animelem=5,<0) && (anim=3400)
	value=sca

;-[hpe]---------
[state 0]
	type=helper
	trigger1=(animelem=2) && (anim=3400) && roundstate=2 && (sysfvar(0)>0)
	id=88880
	stateno=88883
	pos=floor(-26*const(size.xscale)),floor(-55*const(size.yscale))
[state 0]
	type=helper
	trigger1=(animelem=2) && (anim=3400) && roundstate=2 && (sysfvar(0)>0)
	trigger1=!numhelper(88870)
	id=88870
	stateno=88870;max2bg
	size.height=0
;---------------

[state 0] ; old_ver
	type=superpause
	trigger1=(animelem=2) && (anim=3400) && roundstate=2 && (sysfvar(0)<=0)
	pos=floor(-26*const(size.xscale)),floor(-55*const(size.yscale))
	anim=100
	sound=20,0
	poweradd=-2000

[state 0]
	type=afterimage
	trigger1=(animelem=2) && (anim=3400)
	time=256
	length=9
	timegap=2
	framegap=4
	palbright=1,1,1
	palcontrast=128,0,0
	paladd=0,0,0
	palmul=1,1,1
;afia;	trans=add1

;---
[state 0]
	type=playsnd
	trigger1=time=1
	value=0,21
	channel=0
	persistent=0
[state 0]
	type=playsnd
	trigger1=(animelem=6) && (anim=[3400,3401])
	value=0,22
	channel=0
	persistent=0
	ignorehitpause=1

[state 0]
	type=playsnd
	trigger1=(animelem=5) && (anim=[3400,3401])
	value=2,0
	channel=1

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=5) && (anim=[3400,3401])
	statetype=a
	physics=n

[state 0]
	type=velset
	trigger1=(animelem=5) && (anim=[3400,3401])
	x= ifelse((anim=3401), 1, 9)
	y=-ifelse((anim=3401),13,11)

[state 0]
	type=gravity
	trigger1=(animelem=5,>0) && (anim=[3400,3401])
	trigger2=(anim=[1101,1102])

;---
[state 0]
	type=velmul
	trigger1=(vel y<0) && (vel x>0)
	x=0.92
[state 0]
	type=velset
	trigger1=(vel y>0)
	x=0

;--- fall
[state 0]
	type=changeanim
	trigger1=(animelem=5,>0) && (vel y>-1) && (anim=[3400,3401])
	value=ifelse((anim=3401), 1102, 1101)

;--- change form
[state 0]
	type=changeanim
	trigger1=(movehit) && (anim=3400) && (animelem=4,>=0) && (animelem=5,<0)
	value=3401

; dash_dust
[state 0]
	type=helper
	trigger1=((animelem=4)||(animelem=5)) && (anim=[3400,3401]) && (sysfvar(0)>0)
	id=152040
	stateno=152040
	pos=floor(-32*const(size.xscale)),0
	size.xscale=1
	size.yscale=1

; ground_wave
[state 0]
	type=helper
	trigger1=((animelem=4)||(animelem=5)) && (anim=[3400,3401]) && (sysfvar(0)>0)
	pos=floor(12*const(size.xscale)),0
	id=159005
	stateno=159005
	size.height=0
	size.xscale=1
	size.yscale=1

;--- ground hit
[state 0]
	type=hitdef
	trigger1=(animelem=4) && (anim=[3400,3401])
	attr=s,ha
	damage=150,15
	animtype=hard
	air.animtype=back
	fall.animtype=back
	ground.type=low
	air.type=low
	guardflag=m
	hitflag=maf
	pausetime=ifelse((anim=3400),45,30), ifelse((anim=3400),35,30)
	sparkxy=-10,-ifelse((anim=3400),80,90)
	;ad; sparkno=4+(random%4)*10
	;ad; guard.sparkno =41
	hitsound=300,5
	guardsound=41,0
	ground.slidetime=22
	ground.hittime=22
	air.hittime=22
	ground.velocity=(p2bodydist x) *0.05 *((anim=3400)&&(p2bodydist x>28)), -ifelse((anim=3400), 5, 0)
	air.velocity=   (p2bodydist x) *0.05 *((anim=3400)&&(p2bodydist x>28)), -5
	fall=1
	fall.recover=0
	accel=0.5
	getpower=0,0
	p2facing=1
	kill=0
	;---
	guard.ctrltime=     id +0*(var(31):=4 || var(30):= 510500 +ifelse((anim=3400),80,90) )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;--- up
[state 0]
	type=hitdef
	trigger1=((animelem=5)||(animelem=6)||(animelem=7)||(animelem=8)) && (anim=[3400,3401])
	attr=s,ha
	damage=50,5
	animtype=up
	ground.type=low
	air.type=low
	guardflag=m
	hitflag=maf
	pausetime=13,13
	sparkxy=-10,-90
	;ad; sparkno=4+(random%4)*10
	;ad; guard.sparkno =41
	hitsound=300,5
	guardsound=41,0
	ground.slidetime=22
	ground.hittime=22
	air.hittime=22
	ground.velocity= -1, -12
	air.velocity=    -1, -12
	getpower=0,0
	fall=1
	air.fall=1
	air.recover=0
	fall.recover=0
	yaccel=0.5
	;---
	guard.ctrltime=     id +0*(var(31):=4 || var(30):= 510590 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;--- hit ring
[state 0]
	type=varset
	trigger1=!time
	fvar(1)=0
[state 0]
	type=varset
	trigger1=(hitpausetime=[44,45]) && (anim=3400)
	trigger1=1|| var(11):=36 || var(12):=-78
	trigger2=(hitpausetime=[29,30]) && (anim=3401)
	trigger2=1|| var(11):=29 || var(12):=-90
	fvar(1)=26
	ignorehitpause=1
[state 0]
	type=varadd
	trigger1=fvar(1)>0
	fvar(1)=-1
	ignorehitpause=1
[state 0]
	type=projectile
	trigger1=fvar(1)>0
	projanim=3402
	projsprpriority=3
	postype=p1
	offset=floor(var(11)*const(size.xscale)), floor(var(12)*const(size.yscale))
	projscale=(28-fvar(1))*0.1 , (28-fvar(1))*0.1
	projremovetime=1
	ignorehitpause=1

;---
[state 0]
	type=statetypeset
	trigger1=(anim=[1101,1102]) && (pos y+vel y>=0) && (vel y>0)
	movetype=i

;--- land ; n
[state 0]
	type=changestate
	trigger1=(anim=[1101,1102]) && (pos y+vel y>=0) && (vel y>0)
	value=1105


;--------------------
; syun_goku_satsu
; uE
; (max2)

[statedef 3500]
type=s
movetype=a
physics=s
anim=3500
juggle=0
velset=0,0
ctrl=0
facep2=1

;-[hpe]---------
[state 0]
	type=helper
	trigger1=(time=1) && roundstate=2 && (sysfvar(0)>0)
	id=88880
	stateno=88883
	pos=floor(12*const(size.xscale)),floor(-107*const(size.yscale))
;---------------
[state 0]
	type=helper
	trigger1=(time=1) && roundstate=2 && (sysfvar(0)>0)
	trigger1=!numhelper(88870)
	id=88870
	stateno=88870;max2bg
	size.height=8
;---------------

[state 0] ; old_ver
	type=superpause
	trigger1=(time=1) && roundstate=2 && (sysfvar(0)<=0)
	pos=floor(12*const(size.xscale)),floor(-107*const(size.yscale))
	anim=100
	sound=20,0
	poweradd=-2000

[state 0]
	type=afterimage
	trigger1=time=1
	time=64
	length=13
	timegap=2
	framegap=4
	palbright=1,1,1
	palcontrast=128,0,0
	paladd=0,0,0
	palmul=1,1,1
;afia;	trans=add1

;---
[state 0]
	type=nothitby
	trigger1=(time<6)
	value=sca

[state 0]
	type=playsnd
	trigger1=(time=1)
	value=0,5
	channel=0
[state 0]
	type=playsnd
	trigger1=(time=2)
	value=2,2
	channel=1
[state 0]
	type=statetypeset
	trigger1=(time=2)
	physics=n
[state 0]
	type=velset
	trigger1=(time=2)
	x=ifelse(var(51)>0, 9, 6)

;---
[state 0]
	type=attackdist
	trigger1=1
	value=0

[state 0]
	type=hitdef
	trigger1=(time>1) && (p2movetype!=h) && (p2stateno!=[150,155])
	attr=s,ht
	hitflag=m-
	priority=7,miss
	guardflag= ;; none
	sparkno=(var(31):=-1)
	p1facing=1
	p2facing=1
	p1stateno=3505
	p2stateno=3510
	p2getp1state=1
	hitsound=-1
	fall=1
	fall.recover=0
	id=3500
	numhits=0
	hitonce=1

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


;--------------
; p1
[statedef 3505]
type=s
movetype=a
physics=s
anim=3505
velset=0,0
ctrl=0

[state 0]
	type=afterimagetime
	trigger1=!time
	time=0
[state 0]
	type=nothitby
	trigger1=1
	value=sca
[state 0]
	type=posfreeze
	trigger1=1
[state 0]
	type=playsnd
	trigger1=!time
	value=0,0
	channel=0
[state 0]
	type=playsnd
	trigger1=(time=95)
	value=0,23 ;; ifelse(win,23,6)
	channel=0
[state 0]
	type=playsnd
	trigger1=(time=[35,90]) && (time%3=0)
	value=f0 + ifelse(sysfvar(0)>0, 300, 5) , 4
	channel=1
[state 0]
	type=playsnd
	trigger1=(time=95)
	value=2,1
	channel=1
[state 0]
	type=targetbind
	trigger1=(time<30)
	pos=38,0
[state 0]
	type=width
	trigger1=(time<30) && (frontedgedist<40)
	edge=40,0
;---
[state 0] ; grab_spark
	type=helper
	trigger1=(time=1) && (sysfvar(0)>0)
	id=152080
	stateno=152080
	postype=p1
	pos=floor(40*const(size.xscale)),floor(-72*const(size.yscale))
	size.xscale=1.5 ;w
	size.yscale=1.5 ;h
	size.height=102 ;type
	persistent=0
;---
[state 0] ; remove max2 bg
	type=explod
	trigger1=!time
	id=88870
	anim=0
	scale=0,0
	removetime=12
;---
[state 0]
	type=bgpalfx
	trigger1=(time<120)
	add=-255,-255,-255
	time=128
[state 0] ; fx_end
	type=bgpalfx
	trigger1=(time=120)
	time=25
	add=  -256,-256,-256
	mul=   256, 256, 256
	sinadd=256, 256, 256, 100

;---
[state 0]
	type=hitadd
	trigger1=(time=[35,90]) && (time%3=0)
	value=1
[state 0]
	type=targetlifeadd
	trigger1=(time=[35,90]) && (time%3=0)
	value=-23
	kill=0
[state 0]
	type=targetdrop
	trigger1=(time=96)
[state 0]
	type=targetlifeadd
	trigger1=(time=95)
	value=-28

;;--- hit_spark
[state 0] ; hit/guard_spark
	type=helper
	trigger1=(time=[35,90]) && (time%3=0) && (sysfvar(0)>0)
	id=152100
	stateno=152100
	helpertype=normal
	ownpal=0
	keyctrl=0
	postype=p1
	pos=(random%80),-(random%100)
	size.height=4 ;; hit_spark
	facing=-1

;--- big character "METSU"
;--- 啶uŁv
[state 0]
	type=projectile
	trigger1=(time=93)
	projanim=3520
	projsprpriority=-5
	postype=p1
	offset=floor(-pos x)*facing,-72
	projedgebound=800
	projstagebound=800
	projscale=0.75*facing, 0.75
	projremovetime=58

;---
[state 0]
	type=assertspecial
	trigger1=1
	flag=intro
	flag2=roundnotover

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

;---
[state 0]
	type=changestate
	trigger1=(time>=135) && (anim!=180) && (win)
	value=3506
[state 0]
	type=changestate
	trigger1=animtime=0 && (!win)
	value=0
	ctrl=1

;--------------
; uEiIjiko1j
[statedef 3506]
type=s
movetype=i
physics=s
sprpriority=2
poweradd=0
velset=0,0
ctrl=1 ;;<- ***

[state 0]
	type=nothitby
	trigger1=1
	value=sca
[state 0]
	type=changeanim
	trigger1=!time
	value=185
	elem=7
[state 0]
	type=changestate
	trigger1=(p2movetype=a)
	value=0
	ctrl=1


;-------------- p2 state
[statedef 3510]
type=s
movetype=h
physics=s
velset=0,0
ctrl=0

[state 0]
	type=afterimagetime
	trigger1=!time
	time=0
[state 0]
	type=changeanim2
	trigger1=!time
	value=3510
[state 0]
	type=changestate
	trigger1=animtime=0
	value=3511

;-------------- p2 state
[statedef 3511]
type=l
movetype=h
physics=s
anim=5110 ;; liedown
sprpriority=-1
juggle=0
velset=0,0
ctrl=0
[state 0]
	type=nothitby
	trigger1=1
	value=sca
[state 0]
	type=selfstate
	trigger1=time=90
	value=ifelse(alive, 5120, 5150)


;--------------------
; misogi
; S
; (max2)

[statedef 3600]
type=s
movetype=a
physics=s
anim=3600
juggle=0
velset=0,0
ctrl=0
facep2=1

;-[hpe]---------
[state 0]
	type=helper
	trigger1=(!time) && roundstate=2 && (sysfvar(0)>0)
	id=88880
	stateno=88883
	pos=floor(40*const(size.xscale)),floor(-47*const(size.yscale))
;---------------
[state 0]
	type=helper
	trigger1=(!time) && roundstate=2 && (sysfvar(0)>0)
	trigger1=!numhelper(88870)
	id=88870
	stateno=88870;max2bg
	size.height=4
;---------------

[state 0] ; old_ver
	type=superpause
	trigger1=(!time) && roundstate=2 && (sysfvar(0)<=0)
	pos=floor(40*const(size.xscale)),floor(-47*const(size.yscale))
	anim=100
	sound=20,0
	poweradd=-2000

[state 0] ; ground_wave
	type=helper
	trigger1=(animelem=10) && (sysfvar(0)>0)
	id=159005
	stateno=159005
	size.height=2

[state 0]
	type=explod
	trigger1=(animelem=11,>=0) && (animelem=11,<=25)
	anim=8600
	postype=p1
	sprpriority=6
	scale=(gametime%4)*0.2+1,1.5-(gametime%4)*0.2
	bindtime=-1
	removetime=1
	removeongethit=1
	ignorehitpause=1

[state 0]
	type=afterimage
	trigger1=!time
	time=64
	length=9
	timegap=2
	framegap=4
	palbright=1,1,1
	palcontrast=128,0,0
	paladd=0,0,0
	palmul=1,1,1
;afia;	trans=add1

[state 0]
	type=nothitby
	trigger1=(animelem=11,<0)
	value=sca

[state 0]
	type=playsnd
	trigger1=!time
	value=0,40
	channel=0
[state 0]
	type=playsnd
	trigger1=(animelem=10)
	value=2,2
	channel=1
[state 0]
	type=playsnd
	trigger1=(animelem=11)
	value=0,5
	channel=0

[state 0]
	type=velset
	trigger1=(time=41) || (animelem=6) || (animelem=11)
	x=ifelse((animelem=11),0,ifelse(time=41,3,-3))
	y=ifelse((animelem=11),12,0)

[state 0]
	type=veladd
	trigger1=(animelem=11,>0)
	y=0.47

[state 0]
	type=posadd
	trigger1=(animelem=11)
	x= p2bodydist x-15
	y=-260

[state 0]
	type=statetypeset
	trigger1=(animelem=11)
	statetype=a
	physics=n

[state 0]
	type=playerpush
	trigger1=(animelem=11,<0)
	value=0

;---
[state 0]
	type=projectile
	trigger1=(animelem=11,>0)
	projanim=3620
	projsprpriority=3
	postype=p1
	offset=0, floor(-16 *const(size.yscale))
	projedgebound=800
	projstagebound=800
	projscale=1,1
	projremovetime=1
	ignorehitpause=1

;---
[state 0]
	type=hitdef
	trigger1=(animelem=11,>=0)
	attr=a,ha
	animtype=heavy
	air.animtype=back
	fall.animtype=back
	damage=0,20
	hitflag=mafd
	guardflag=h
	pausetime=2,14
	guard.pausetime=0,8
	;ad; sparkno=4+(random%4)*10
	;ad; guard.sparkno =41
	sparkxy=-10,-45
	hitsound=300,4
	guardsound=41,0
	ground.type=low
	ground.slidetime=11
	ground.hittime=11
	air.hittime=11
	ground.velocity=0,12
	air.velocity=   0,12
	guard.velocity=-9
	fall=1
	air.fall=1
	fall.recover=0
	air.recover=0
	persistent=0
	id=3600
	;---
	guard.ctrltime=     id +0*(var(31):=4 || var(30):= 510530 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=targetstate
	trigger1=(movehit=2) && numtarget(3600)
	value=3606 ;; >- 195200
	id=3600
	ignorehitpause=1

[state 0]
	type=changestate
	trigger1=(pos y>=-15) && (vel y>0)
	value=3605

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

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

;---
[state 0] ; ground_wave
	type=helper
	trigger1=!time && (sysfvar(0)>0)
	id=159005
	stateno=159005
	size.height=6


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

;---
[state 0]
	type=playsnd
	trigger1=(animelem=9)
	value=0,6
	channel=0
[state 0]
	type=changestate
	trigger1=animtime=0
	value=0
	ctrl=1


;-------------- p2state
[statedef 3606]
type=s
movetype=h
physics=s
velset=0,0
ctrl=0

[state 0]
	type=afterimagetime
	trigger1=!time
	time=0
[state 0]
	type=posset
	trigger1=1
	y=0
[state 0]
	type=lifeadd
	trigger1=!time
	value=-450
[state 0]
	type=nothitby
	trigger1=1
	value=sca
[state 0]
	type=changeanim
	trigger1=1
	value=5002
[state 0]
	type=selfstate
	trigger1=(time>58)
	value=ifelse((sysfvar(0)>0), 195200, 5050)


;--------------------
; ra_sen_kyaku
; r
; (max2)

[statedef 3700]
type=s
movetype=a
physics=n
anim=3700
sprpriority=2
juggle=6
poweradd=0
velset=0,0
ctrl=0
facep2=1

[state 0]
	type=varset
	trigger1=!time
	var(10)=0

;-[hpe]---------
[state 0]
	type=helper
	trigger1=(animelem=2) && roundstate=2 && (sysfvar(0)>0)
	id=88880
	stateno=88883
	pos=floor(-28*const(size.xscale)),floor(-29*const(size.yscale))
;---------------
[state 0]
	type=helper
	trigger1=(animelem=2) && roundstate=2 && (sysfvar(0)>0)
	trigger1=!numhelper(88870)
	id=88870
	stateno=88870;max2bg
	size.height=6
;---------------

[state 0] ; old_ver
	type=superpause
	trigger1=(animelem=2) && roundstate=2 && (sysfvar(0)<=0)
	pos=floor(-28*const(size.xscale)),floor(-29*const(size.yscale))
	anim=100
	sound=20,0
	poweradd=-2000

[state 0]
	type=afterimage
	trigger1=(animelem=2)
	time=128
	length=9
	timegap=2
	framegap=4
	palbright=1,1,1
	palcontrast=128,0,0
	paladd=0,0,0
	palmul=1,1,1
;afia;	trans=add1

;---
[state 0] ; ground_wave
	type=helper
	trigger1=(animelem=5) && (sysfvar(0)>0)
	pos=0,floor(-pos y)
	id=159005
	stateno=159005
	size.height=2

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

;---
[state 0]
	type=nothitby
	trigger1=(animelem=18,<0)
	value=sca,na,sa,ha,np,sp,hp

[state 0]
	type=playsnd
	trigger1=(time=1)||(animelem=5)||(animelem=17)
	value=0,(time=1)*40 +(animelem=5)*5 +(animelem=17)*4
	channel=0
[state 0]
	type=playsnd
	trigger1=(animelem=5)||(animelem=9)||(animelem=12)||(animelem=16)
	value=f200,3
	channel=1

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=5)
	statetype=a
	physics=n
[state 0]
	type=velset
	trigger1=(animelem=5)
	y=-11
[state 0]
	type=veladd
	trigger1=(animelem=5,>0) && (animelem=17,<0) && (vel y<0)
	trigger2=(animelem=18,>0)
	y=0.5
[state 0]
	type=veladd
	trigger1=(animelem=17)
	y=0

;---
[state 0]
	type=varadd
	trigger1=(animelem=14)
	var(10)=1
[state 0]
	type=changeanim
	trigger1=(animelem=14) && var(10)<5
	value=anim
	elem=9

;---
[state 0]
	type=hitdef
	trigger1=(animelem=5)
	attr=a,ha
	animtype=heavy
	fall.animtype=back
	air.animtype=back
	damage=105,20
	hitflag=maf
	guardflag=m
	pausetime=28,28
	;ad; sparkno=4+(random%4)*10
	;ad; guard.sparkno =41
	sparkxy=-10,-63
	hitsound=300,5
	guardsound=41,0
	ground.type=high
	air.type=low
	ground.slidetime=14
	ground.hittime=15
	ground.velocity=0,-10
	air.velocity=   0,-10
	guard.velocity=-4
	air.fall=1
	air.recover=0
	;---
	guard.ctrltime=     id +0*(var(31):=4 || var(30):= 510563 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=hitdef
	trigger1=(animelem=10)||(animelem=13)
	attr=a,ha
	animtype=heavy
	fall.animtype=back
	air.animtype=back
	damage=40,8
	hitflag=maf
	guardflag=m
	pausetime=8,8
	;ad; sparkno=4+(random%4)*10
	;ad; guard.sparkno =41
	sparkxy=-10,-63
	hitsound=300,5
	guardsound=41,0
	ground.type=high
	air.type=low
	ground.slidetime=14
	ground.hittime=15
	ground.velocity=0,-10
	air.velocity=   0, vel y-1
	guard.velocity=-4
	fall=1
	air.fall=1
	air.recover=0
	;---
	guard.ctrltime=     id +0*(var(31):=4 || var(30):= 510563 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

[state 0]
	type=hitdef
	trigger1=(animelem=17)
	attr=a,ha
	animtype=diagup
	fall.animtype=diagup
	air.animtype=diagup
	damage=50,10
	hitflag=maf
	guardflag=m
	pausetime=30,31
	guard.pausetime=30,31
	;ad; sparkno=4+(random%4)*10
	;ad; guard.sparkno =41
	sparkxy=-10,-63
	hitsound=300,5
	guardsound=41,0
	ground.type=high
	air.type=low
	ground.slidetime=14
	ground.hittime=15
	ground.velocity=-4,3
	air.velocity=   -4,3
	guard.velocity= -10
	fall=1
	air.fall=1
	fall.recover=0
	air.recover=0
	;---
	guard.ctrltime=     id +0*(var(31):=4 || var(30):= 510563 )
	fall.envshake.time= id
	fall.envshake.ampl= 0

;---
[state 0]
	type=statetypeset
	trigger1=(animelem=18)
	movetype=i
[state 0]
	type=afterimagetime
	trigger1=(pos y+vel y>=0) && (vel y>0)
	time=0
[state 0]
	type=changestate
	trigger1=(pos y+vel y>=0) && (vel y>0)
	value=3205 ;; land ; n






;[EOF]
