;========================<OTOKO SATSU>=============================

[Statedef 4000]
type=S
physics=S
movetype=A
anim=4000
ctrl=0
velset=0,0
juggle=15
poweradd=-3000
facep2=1
sprpriority=1

[State 4000, strengthvar]
type=varset
trigger1= var(10)!=7
var(10)=7

[State 4000, snd]
type=playsnd
trigger1= animelem=3
value=4,27
channel=0
volume=200
[State 4000, ECreset]
type=palfx
trigger1= !time
trigger1= !(var(20):=0)
time=1
[State 4000, superchargehelper]
type=helper
trigger1= animelem=3
helpertype=normal
stateno=7500
ID=7500
name="Super Charge"
postype=p1
pos=floor(7*const(size.xscale)),floor(-132*const(size.yscale))
ownpal=1
persistent=0
supermovetime=9999
size.xscale=1
size.yscale=1
[State 4000, superchargepause]
type=superpause
trigger1= animelem=3
time=60
anim=-1
sound=s7,0
p2defmul=1
darken=0

[State 4000, nhb]
type=nothitby
trigger1= animelemtime(4)<4
time=1
value=SCA
[State 4000, sts]
type=statetypeset
trigger1= animelemtime(4)>=0 && animelemtime(5)<0
physics=N
[State 4000, vel]
type=velset
trigger1= animelemtime(4)>=0 && animelemtime(5)<0
x=9
[State 4000, sts]
type=statetypeset
trigger1= animelemtime(5)>=0
physics=S


[State 4000, snd]
type=playsnd
trigger1= animelem=4
value=0,105
channel=1



[State 4000, dust]
type=explod
trigger1= !(time%6)
trigger1= animelemtime(4)>=0 && animelemtime(5)<0
anim=7103
sprpriority=3
postype=p1
pos=floor(50*const(size.xscale))
vel=-2,0
ownpal=1

[State 4000, hit]
type=hitdef
trigger1= animelemtime(4)>=0 && animelemtime(5)<0
attr=S,HT
hitflag=M
priority=1,Miss
numhits=0
sparkno=-1
p1facing=1
p2facing=1
p1stateno=4001
animtype=Up
ground.velocity=-1.5,-32
yaccel=.75
sprpriority=1
fall=1
fall.recover=0


[State Idle]
type=statetypeset
trigger1= animelemtime(5)>=0
movetype=I

[State 4000, end]
type=changestate
trigger1= !animtime
value=0
ctrl=1


;---PLAYER---
[Statedef 4001]
type=S
physics=S
movetype=A
anim=4001
ctrl=0
velset=0,0
sprpriority=1

[State Throw]
type=targetstate
trigger1= !time
value=4002


[State 4001, grabsound]
type=playsnd
trigger1= !time
value=0,800


[State 4001, nothitby]
type=nothitby
trigger1= 1
value=SCA
time=1

[State 4001, nomusic]
type=assertspecial
trigger1= animelemtime(6)<0
flag=nomusic

[State 4001, imageoff]
type=afterimagetime
trigger1= animelemtime(4)>=0
time=0
[State 4001, spr]
type=sprpriority
trigger1= animelemtime(4)>=0
value=-1

[State 4001, bind 1]
type=targetbind
trigger1= animelemtime(1)>=0 && animelemtime(2)<0
pos=floor(120*const(size.xscale)),0
[State 4001, bind 2]
type=targetbind
trigger1= animelemtime(2)>=0 && animelemtime(3)<0
pos=floor(90*const(size.xscale)),0
[State 4001, bind 3]
type=targetbind
trigger1= animelemtime(3)>=0 && animelemtime(4)<0
pos=floor(60*const(size.xscale)),0
[State 4001, bind 4]
type=targetbind
trigger1= animelemtime(4)>=0 && animelemtime(6)<0
pos=floor(30*const(size.xscale)),0


[State 4001, charge]
type=helper
trigger1= animelemtime(5)>=0 && animelemtime(6)<0 && !numhelper(4006)
helpertype=normal
stateno=4006
ID=4006
name="Otoko Charge"
postype=p1
pos=floor(15*const(size.xscale)),floor(-95*const(size.yscale))
ownpal=1
persistent=0
size.xscale=1
size.yscale=1
[State 4001, palfx]
type=palfx
trigger1= animelem=5
time=120
sinadd=64,64,192,480

[State 4001, hitadd]
type=hitadd
trigger1= animelem=6
value=10
[State 4001, hitdamage]
type=targetlifeadd
trigger1= animelem=6
value=-ceil(535*fvar(12))
[State 4001, hitdamage]
type=targetpoweradd
trigger1= animelem=6
value=36
[State 4001, throw]
type=targetstate
trigger1= animelem=6
value=4004

[State 4001, snd]
type=playsnd
trigger1= animelem=6
value=5,7
[State 4001, snd]
type=playsnd
trigger1= animelem=6
value=5,9
[State 4001, snd]
type=playsnd
trigger1= animelem=7
value=4,7
channel=0
[State 4001, shake]
type=envshake
trigger1= animelem=6
time=12
fre=120
ampl=12
[State 4001, explosion]
type=explod
trigger1= animelemtime(6)=-3
anim=4005
ID=4005
sprpriority=4
postype=p1
removetime=-2
ownpal=1

[State 4001, bg]
type=helper
trigger1= animelem=6
helpertype=normal
stateno=4008
ID=4008
name="Otoko Portrait"
postype=back
ownpal=1
persistent=0
size.xscale=.5
size.yscale=.5



[State 4001, flames]
type=helper
trigger1= animelem=6 && numtarget && !numhelper(7180)
helpertype=normal
stateno=7180
ID=7180
name="flames"
postype=p2
ownpal=1
facing=-1
size.ground.front=0
size.ground.back=0
size.xscale=.5
size.yscale=.5
ignorehitpause=1
persistent=0






[State 4001, fix]
type=velset
trigger1= winko
trigger1= vel y>0 && screenpos y<0
x=0
[State 4001, fix]
type=posset
trigger1= winko
trigger1= vel y>0 && screenpos y<0
x=-80*facing



[State 4001, sts]
type=statetypeset
trigger1= animelemtime(7)>=0
statetype=S
physics=N
movetype=H
[State 4001, grav]
type=veladd
trigger1= animelemtime(7)>=0
y=0
[State 4001, shake]
type=envshake
trigger1= animelemtime(6)>=0 && vel y>0 && pos y>=5
time=12
fre=120
ampl=12

[State 4001, end]
type=changestate
trigger1=!animtime
value=0
ctrl=1


;---TARGET---
[Statedef 4002]
type=S
physics=N
movetype=H
velset=0,0
ctrl=0
[State 4002, anim]
type=changeanim2
trigger1= !time
value=4002
[State 4002, palfx]
type=palfx
trigger1= time=76
time=120
sinadd=64,64,192,480

[Statedef 4004]
type=S
physics=N
movetype=H
ctrl=0
[State 4004, palfx]
type=palfx
trigger1= !time
time=100
color=32
sinadd=80,25,0,8
mul=512,256,128
[State 4004, end]
type=selfstate
trigger1= 1
value=5020
;__________________________________________________________________
;========================<KUUCHU ZANKUU HADOUKEN helper>=============================
[Statedef 1156]
type=A
physics=N
movetype=A
anim=1055
ctrl=0
velset=0,0
sprpriority=4

[State 1156, hitoverride]
type=hitoverride
trigger1=1
time=-1
attr=SCA,AA,AP,AT
stateno=1015
ignorehitpause=1
[State 1156,hitby]
type=hitby
trigger1=1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[State 1156, strengthvar]
type=varset
trigger1=!time
var(10)=root, var(10)
;[State 1156, hitvar]
;type=varadd
;trigger1=!time&&!sysvar(4)
;var(2)=1
[State 1156, movehitvar]
type=varset
trigger1=movecontact&&numtarget
trigger1=!(target,ishelper)
var(3)=1
ignorehitpause=1
[State 1156, reflectionvar]
type=varset
trigger1=!time&&!prevstateno
sysvar(3)=123000
[State 1156, reflectedpos]
type=posadd
trigger1=!time&&sysvar(4)=1
x=53
[State 1156, wasreflected]
type=varset
trigger1=sysvar(4)
sysvar(4)=0

[State 1156, vel]
type=velset
trigger1=1
x=ifelse((time<2&&var(2)>1),1,7.4)
y=ifelse((time<2&&var(2)>1),1,5.2)

[State 1156, trans]
type=trans
trigger1=1
trans=addalpha
alpha=256,256
ignorehitpause=1

[State 1156, hitsnd]
type=playsnd
trigger1=movehit&&numtarget
trigger1=!(target,time)&&target,movetype=H
value=2,7
persistent=0
ignorehitpause=1





[State 1156, hit]
type=hitdef
trigger1=root,var(1)!=1
priority=7,Hit
attr=A,HP
damage=ceil(46*5.3+root,fvar(12)),5
animtype=Back
hitflag=MAF
guardflag=M
pausetime=4,6
sparkno=-1
guard.sparkno=s7001
sparkxy=-10,0
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=ifelse(time<=6,-6,-4),-4
ground.cornerpush.veloff=0
air.velocity=ifelse(time<=6,-6,-4),-3
fall=1
fall.recover=0
getpower=0
envshake.time=16
envshake.freq=100
envshake.ampl=6
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=32
sprpriority=4
yaccel=.5


[State 1156, end]
type=changestate
trigger1=movecontact
value=1056
ignorehitpause=1
[State 1055, end]
type=changestate
trigger1=pos y>=0
value=1057
ignorehitpause=1


[Statedef 1056]
type=A
physics=N
movetype=I
anim=1056
velset=0,0
ctrl=0
sprpriority=4
movehitpersist=1
[State 1056, trans]
type=trans
trigger1=1
trans=addalpha
alpha=256,256
ignorehitpause=1
[State 1056, snd]
type=playsnd
trigger1=animelem=1
value=5,3
ignorehitpause=1
persistent=0
[State 1056, end]
type=destroyself
trigger1=!animtime

[Statedef 1057]
type=A
physics=N
movetype=I
anim=1057
velset=0,0
ctrl=0
sprpriority=4
[State 1057, trans]
type=trans
trigger1=1
trans=addalpha
alpha=256,256
ignorehitpause=1
[State 1057, pos]
type=posset
trigger1=1
y=0
[State 1057, snd]
type=playsnd
trigger1=animelem=1
value=5,3
ignorehitpause=1
persistent=0
[State 1057, dust]
type=explod
trigger1=!time
anim=7104
ID=7104
sprpriority=-2
pos=0,0
vel=0,0
removetime=-2
ownpal=1
scale=.75,.75
[State 1057, end]
type=destroyself
trigger1=!animtime

