; _____________________________________
;| Shin Gouki by Phantom.of.the.Server |
; ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
;================================================================================================
;=======================================<COMMON STATES>==========================================
;================================================================================================

;==========<PARRY>==========
;---STANDING---
[Statedef 700]
type=S
physics=S
movetype=I
anim=700
velset=0,0
ctrl=0
sprpriority=2
poweradd=75

[State 700, pause]
type=pause
trigger1=!time
time=10
movetime=10
[State 700, nhb]
type=nothitby
trigger1=time<=10
time=1
value=SCA

[State 700, blueflash]
type=palfx
trigger1=!time&&var(21)=1
add=0,50,255
sinadd=0,-50,-255,60
time=15
[State 700, redflash]
type=palfx
trigger1=time<15&&var(21)=2
mul=256,time*17,time*17
time=1

[State 700, snd]
type=playsnd
trigger1=!time
value=3+(var(1)=2)*10,6-(var(1)=2)*3
channel=0
[State 700, snd]
type=playsnd
trigger1=!time
value=7,3

[State 700, spark]
type=explod
trigger1=animelem=3
anim=7200
ID=7200
sprpriority=5
postype=p1
pos=31,-69
removetime=-2
pausemovetime=60
ownpal=1
scale=.5,.5

[State 700, asserts]
type=assertspecial
trigger1=1
flag=nowalk
flag2=nostandguard
flag3=nocrouchguard
[State 700, ctrl]
type=ctrlset
trigger1=time>10
value=1
[State 700, end]
type=changestate
trigger1=!animtime
value=0
ctrl=1


;---CROUCHING---
[Statedef 701]
type=C
physics=C
movetype=I
anim=701
velset=0,0
ctrl=0
sprpriority=2
poweradd=75

[State 701, pause]
type=pause
trigger1=!time
time=10
movetime=10
[State 701, nhb]
type=nothitby
trigger1=time<=10
time=1
value=SCA

[State 701, blueflash]
type=palfx
trigger1=!time&&var(21)=1
add=0,50,255
sinadd=0,-50,-255,60
time=15
[State 701, redflash]
type=palfx
trigger1=time<15&&var(21)=2
mul=256,time*17,time*17
time=1

[State 701, snd]
type=playsnd
trigger1=!time
value=3+(var(1)=2)*10,6-(var(1)=2)*3
channel=0
[State 701, snd]
type=playsnd
trigger1=!time
value=7,3

[State 701, spark]
type=explod
trigger1=animelem=2
anim=7200
ID=7200
sprpriority=5
postype=p1
pos=25,-22
removetime=-2
pausemovetime=60
ownpal=1
scale=.5,.5

[State 701, asserts]
type=assertspecial
trigger1=1
flag=nowalk
flag2=nostandguard
flag3=nocrouchguard
[State 701, ctrl]
type=ctrlset
trigger1=time>10
value=1
[State 701, end]
type=changestate
trigger1=!animtime
value=11
ctrl=1


;---AERIAL---
[Statedef 702]
type=A
physics=A
movetype=I
anim=702
ctrl=0
sprpriority=2
poweradd=80

[State 702, slow]
type=pause
trigger1=time<=10
time=1
[State 702, nhb]
type=nothitby
trigger1=time<=10
time=1
value=SCA

[State 702, blueflash]
type=palfx
trigger1=!time&&var(21)=1
add=0,50,255
sinadd=0,-50,-255,60
time=15
[State 702, redflash]
type=palfx
trigger1=time<15&&var(21)=2
mul=256,time*17,time*17
time=1

[State 702, snd]
type=playsnd
trigger1=!time
value=3+(var(1)=2)*10,6-(var(1)=2)*3
channel=0
[State 702, snd]
type=playsnd
trigger1=!time
value=7,3

[State 702, spark]
type=explod
trigger1=animelem=2
anim=7200
ID=7200
sprpriority=5
postype=p1
pos=40,-66
removetime=-2
pausemovetime=60
ownpal=1
scale=.5,.5

[State 702, asserts]
type=assertspecial
trigger1=1
flag=noairguard
[State 702, ctrl]
type=ctrlset
trigger1=time>10
value=1


;==========<POWER CHARGE>==========
[Statedef 515]
type=S
physics=S
movetype=I
anim=515
ctrl=0
velset=0,0

[State 515, power]
type=poweradd
triggerall=anim=515&&animelemtime(2)>=0&&power<powermax
trigger1=command="holdb"&&command="holdy"
trigger2=var(59)
value=ifelse(time>=220,28,ceil(time/8))*(power<powermax)

[State 515, snd]
type=playsnd
trigger1=!time
value=3,2
channel=0
[State 515, snd]
type=playsnd
trigger1=anim=515&&!animelemtime(2)
value=6,4
channel=4
[State 515, snd]
type=playsnd
trigger1=power>=powermax
value=6,5
channel=4
persistent=0

[State 515, shake]
type=envshake
trigger1=anim=515&&animelemtime(2)>=0&&!(time%4)
time=4
fre=80
ampl=2
[State 515, flash]
type=palfx
trigger1=anim=515&&animelemtime(2)>=0&&!(time%12)
add=50,15,0
sinadd=50,15,0,12
time=12
[State 515, flash]
type=palfx
trigger1=anim=516
add=0,0,0
time=1
persistent=0

[State 515, fx]
type=helper
trigger1=anim=515&&animelemtime(2)>=0&&!numhelper(6115)
helpertype=normal
stateno=6115
ID=6115
name="Power Charge"
postype=p1
size.xscale=1
size.yscale=1
ownpal=1
persistent=0

[State 515, anim]
type=changeanim
triggerall=anim=515&&animelemtime(2)>=0
trigger1=command!="holdb"||command!="holdy"
trigger2=power>=powermax||roundstate!=2
trigger3=var(59)&&p2movetype=A
value=516

[State 515, stopsnd]
type=stopsnd
trigger1=anim=516
channel=0
persistent=0
[State 515, stopsnd]
type=stopsnd
trigger1=anim=516&&power<powermax
channel=4
persistent=0
[State 515, end]
type=changestate
trigger1=anim=516&&!animtime
value=0
ctrl=1


;==========<ZERO COUNTER>==========
[Statedef 750]
type=S
physics=S
movetype=I
anim=750
ctrl=0
velset=0,0
sprpriority=2

[State 750, strengthvar]
type=varset
trigger1=!time&&!var(59)
var(10)=ifelse((command="bdx"||command="bdy"||command="bdz"),1,2)
ignorehitpause=1
[State 750, strengthvarAI]
type=varset
trigger1=!time&&var(59)
var(10)=ifelse((p2statetype=A),1,ifelse((p2statetype=C),2,ifelse(random<500,1,2)))
ignorehitpause=1

[State 750, snd]
type=playsnd
trigger1=!time
value=3,0
channel=0
[State 750, superchargehelper]
type=helper
trigger1=!time
helpertype=normal
stateno=7250
ID=7250
postype=p1
pos=23,-74
ownpal=1
persistent=0
supermovetime=999
[State 750, superpause]
type=superpause
trigger1=!time
time=20
movetime=20
anim=-1
sound=s6,1
poweradd=-1000
p2defmul=1
darken=0
[State 750, end]
type=changestate
trigger1=time>=20
value=ifelse(var(10)=1,1100,255)


;===================<CUSTOM COMBO>===================
[Statedef 550]
type=U
physics=U
movetype=I
anim=550+(statetype=A)
ctrl=(statetype=A)
velset=ifelse((statetype=S),0,vel x),ifelse((statetype=S),0,vel y)

[State 550, snd]
type=playsnd
trigger1=!time
value=4,11
channel=0
volume=200
[State 550, superchargehelper]
type=helper
trigger1=!time
helpertype=normal
stateno=6150
ID=6150
postype=p1
pos=-5,-45-(anim=551)*30
ownpal=1
persistent=0
supermovetime=9999
[State 550, superchargepause]
type=superpause
trigger1=!time
time=30
anim=-1
sound=s6,2
darken=0
movetime=30*(anim=550)

[State 550, var]
type=varset
trigger1=anim=550&&time=30
trigger2=anim=551&&time=1
var(20)=300

[State 550, image]
type=afterimage
trigger1=anim=550&&time=30
trigger2=anim=551&&time=1
time=2
timegap=1
framegap=3
length=15
palcontrast=0,128,256
palmul=.5,.7,.8
trans=add
persistent=0

[State 550, end]
type=changeanim
trigger1=anim=551&&!animtime
value=41+(vel x>0)+(vel x<0)*2
elem=7-(!vel x)*4
persistent=0
[State 550, end]
type=changestate
trigger1=anim=550&&!animtime
value=0
ctrl=1


;==========<STAND>==========
[Statedef 0]
type=S
physics=S
sprpriority=(prevstateno=500)
[State 0, anim]
type=changeanim
trigger1=anim!=0&&anim!=5
trigger2=anim=5&&!animtime
value=0
[State 0, stop]
type=posset
trigger1=1
y=0
[State 0, stop]
type=velset
trigger1=abs(vel x)<2
trigger2=time=4
x=0


;===================<JUMPING>================
;===================<JUMPING>================
[Statedef 40]
type=S
physics=S
anim=40
ctrl=0
sprpriority=1
[State 40, var]
type=varset
trigger1=!time&&!var(59)
var(9)=ifelse(command="superjump",3,1)
[State 40, var]
type=varset
trigger1=!var(59)
sysvar(1)=ifelse(command="holdfwd",1,ifelse(command="holdback",-1,0))
[State 40, var]
type=varset
trigger1=!time&&var(59)
var(9)=ifelse((p2dist x>240||p2dist y>180||random<100),3,1)
[State 40, var]
type=varset
trigger1=var(59)
sysvar(1)=ifelse((enemynear,movetype!=A||backedgebodydist<=10),1,-1)
[State 40, dust]
type=helper
trigger1=!animtime
helpertype=normal
stateno=7100
ID=7100
name="Dust"
postype=p1
ownpal=1
[State 40, vel]
type=velset
trigger1=!animtime&&var(9)!=3
x=ifelse(!sysvar(1),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, vel]
type=velset
trigger1=!animtime&&var(9)=3
x=ifelse(sysvar(1)=0,const(velocity.jump.neu.x),ifelse(sysvar(1)=1,1.33*const(velocity.jump.fwd.x),1.33*const(velocity.jump.back.x)))
y=1.15*const(velocity.jump.y)
[State 40, vel]
type=velset
trigger1=!animtime&&prevstateno=100&&sysvar(1)=1
trigger1=var(9):=3
x=const(velocity.runjump.fwd.x)
[State 40, end]
type=changestate
trigger1=!animtime
value=50
ctrl=1

[Statedef 50]
type=A
physics=A
[State 50, snd]
type=playsnd
trigger1=!time
value=0,ifelse(var(9)=3,41,40)
[State 50, var]
type=varset
triggerall=var(9)=1&&time<3
trigger1=!var(59)&&vel y<0&&command!="holdup"
trigger2=var(59)&&random<200
var(9)=2
persistent=0
[State 50, vel]
type=velmul
trigger1=var(9)=2
x=.9
y=.66
persistent=0
[State 50, anim]
type=changeanim
trigger1=var(9)!=2
value=ifelse(!(vel x), 41, ifelse((vel x)>0, 42, 43))
persistent=0
[State 50, anim]
type=changeanim
trigger1=var(9)=2
value=ifelse(!(vel x), 51, ifelse((vel x)>0, 52, 53))
elem=animelemno(0)
persistent=0

[Statedef 51]
type=A
physics=A
[State 51, null]
type=null
trigger1=1

[Statedef 52]
type=S
physics=S
ctrl=0
anim=ifelse(vel y>11,48,47)
[State 52, nowalk]
type=assertspecial
trigger1=1
flag=nowalk
[State 52, anim48]
type=changeanim
trigger1=!time&&(prevstateno=222||(prevstateno=[1200,1250])||(prevstateno=[1301,1310]))
value=48
[State 52, anim283]
type=changeanim
trigger1=!time&&prevstateno=282
value=283
[State 52, anim1102]
type=changeanim
trigger1=!time&&((prevstateno=[1100,1110])||prevstateno=3100)
value=1102
[State 52, anim1103]
type=changeanim
trigger1=!time&&prevstateno=4302
value=1103
[State 52, snd]
type=playsnd
trigger1=time=1
value=0,52
[State 52, dust]
type=explod
trigger1=!time
anim=7102
ID=7102
sprpriority=-2
postype=p1
scale=.5,.5
ownpal=1
[State 52, stop]
type=velset
trigger1=1
y=0
[State 52, pos]
type=posset
trigger1=1
y=0
[State 52, ctrl]
type=ctrlset
trigger1=time>=2
value=1
[State 52, end]
type=changestate
trigger1=!animtime
value=0
ctrl=1


;======================<RUN>===========================
[Statedef 100]
type=S
physics=S
anim=100
ctrl=1
sprpriority=1
[State 100, width]
type=width
trigger1=1
value=8
[State 100,as]
type=assertspecial
trigger1=1
flag=nowalk
flag2=noautoturn
[State 100, vel]
type=velSet
trigger1=anim=100
x=const(velocity.run.fwd.x)
[State 100, steps]
type=playsnd
trigger1=anim=100&&(animelem=3||animelem=6)
value=0,100
[State 100, change]
type=changeanim
triggerall=time>7&&anim=100
trigger1=!var(59)&&command!="holdfwd"
trigger2=var(59)&&p2dist x<80
value=101
persistent=0
[State 100, snd]
type=playsnd
trigger1=anim=101
value=0,101
persistent=0
[State 100, end]
type=changestate
trigger1=anim=101&&!animtime
value=0
ctrl=1


;========================<FORWARD DASH>==========================
[Statedef 102]
type=S
movetype=I
physics=S
velset=0,0
anim=102
ctrl=0
sprpriority=1
[State 102, vel]
type=velset
trigger1=animelem=2
x=-1.2*const(velocity.run.back.x)
y=const(velocity.run.back.y)
[State 102, snd]
type=playsnd
trigger1=animelem=2
value=0,105
[State 102, dust]
type=explod
trigger1=animelem=2
anim=7103
ID=7103
sprpriority=3
postype=p1
vel=1,0
removetime=-2
ownpal=1
[State 102, end]
type=changestate
trigger1=!animtime
value=0
ctrl=1
[State 102, end]
type=changestate
triggerall=(animelemtime(2)>4)&&(animelemtime(3)<0)
trigger1=!var(59)&&command="holdfwd"
trigger2=var(59)&&p2dist x>=80
value=100


;========================<BACK DASH>==========================
[Statedef 105]
type=S
movetype=I
physics=S
velset=0,0
anim=105
ctrl=0
sprpriority=1
[State 105, vel]
type=velset
trigger1=animelem=2
x=const(velocity.run.back.x)
y=const(velocity.run.back.y)
[State 105, snd]
type=playsnd
trigger1=animelem=2
value=0,105
[State 105, dust]
type=explod
trigger1=animelem=2
anim=7103
ID=7103
sprpriority=3
postype=p1
pos=-17,0
vel=-1,0
removetime=-2
ownpal=1
[State 105, end]
type=changestate
trigger1=!animtime
value=0
ctrl=1


;==========<GUARD>==========
;---START---
[Statedef 120]
type=U
physics=U
[State 120, anim]
type=changeanim
trigger1=!time
value=120+(statetype=C)+(statetype=A)*2
[State 120, sts]
type=statetypeset
trigger1=!time&&statetype=S
physics=S
[State 120, sts]
type=statetypeset
trigger1=!time&&statetype=C
physics=C
[State 120, sts]
type=statetypeset
trigger1=!time&&statetype=A
physics=A
[State 120, Hi to Lo]
type=statetypeset
trigger1=!var(59)&&statetype=S&&command="holddown"
trigger2=var(59)&&statetype=S&&(enemynear,movetype=A)&&(enemynear,statetype=C)
statetype=C
physics=C
[State 120, Lo to Hi]
type=statetypeset
trigger1=!var(59)&&statetype=C&&command!="holddown"
trigger2=var(59)&&statetype=C&&(enemynear,movetype=A)&&(enemynear,statetype!=C)
statetype=S
physics=S
[State 120, end]
type=changestate
trigger1=!animtime
value=130+(statetype=C)+(statetype=A)*2

[State 120, stop]
type=changestate
trigger1=!var(59)&&command!="holdback"
trigger2=var(59)
trigger2=enemynear,movetype!=A&&p2bodydist x>=80&&(p2bodydist y!=[-75,75])&&!(enemy,numproj)
trigger3=!inguarddist
value=140


;---STAND GUARD (guarding)---
[Statedef 130]
type=S
physics=S
[State 130, anim]
type=changeanim
trigger1=anim!=130
value=130
[State 130, Hi to Lo]
type=changestate
trigger1=!var(59)&&command="holddown"
trigger2=var(59)&&(enemynear,movetype=A)&&(enemynear,statetype=C)
value=131

[State 130, Stop Guarding]
type=changeState
trigger1=!var(59)&&command!="holdback"
trigger2=var(59)
trigger2=enemynear,movetype!=A&&p2bodydist x>=80&&(p2bodydist y!=[-75,75])&&!(enemy,numproj)
trigger3=!inguarddist
value=140


;---CROUCH GUARD (guarding)---
[Statedef 131]
type=C
physics=C
[State 131, anim]
type=changeanim
trigger1=anim!=131
value=131
[State 131, Lo to Hi]
type=changestate
trigger1=!var(59)&&statetype=C&&command!="holddown"
trigger2=var(59)&&statetype=C&&(enemynear,movetype=A)&&(enemynear,statetype!=C)
value=130

[State 131, Stop Guarding]
type=changestate
trigger1=!var(59)&&command!="holdback"
trigger2=var(59)
trigger2=enemynear,movetype!=A&&p2bodydist x>=80&&(p2bodydist y!=[-75,75])&&!(enemy,numproj)
trigger3=!inguarddist
value=140


;---AIR GUARD (guarding)---
[Statedef 132]
type=A
physics=N
[State 132, anim]
type=changeanim
trigger1=anim!=132
value=132
[State 132, grav]
type=veladd
trigger1=1
y=const(movement.yaccel)
[State 132, var]
type=varset
trigger1=1
sysvar(0)=(pos y>=0)&&(vel y>0)
[State 132, vel]
type=velset
trigger1=sysvar(0)
y=0
[State 132, pos]
type=posset
trigger1=sysvar(0)
y=0

[State 132, end]
type=changestate
triggerall=sysvar(0)
triggerall=inguarddist
trigger1=!var(59)&&command!="holdback"
trigger2=var(59)
trigger2=enemynear,movetype!=A&&p2bodydist x>=80&&(p2bodydist y!=[-75,75])&&!(enemy,numproj)
value=130

[State 132, end]
type=changeState
trigger1=sysvar(0)
value=52

[State 132, stop guarding]
type=changestate
trigger1=!var(59)&&command!="holdback"
trigger2=var(59)
trigger2=enemynear,movetype!=A&&p2bodydist x>=80&&(p2bodydist y!=[-75,75])&&!(enemy,numproj)
trigger3=!inguarddist
value=140

;---GUARD (end)---
[Statedef 140]
type=U
physics=U
ctrl=1
[State 140, anim]
type=changeanim
trigger1=!time
value=140+(statetype=C)+(statetype=A)*2
[State 140, sts]
type=statetypeset
trigger1=!time&&statetype=S
physics=S
[State 140, sts]
type=statetypeset
trigger1=!time&&statetype=C
physics=C
[State 140, sts]
type=statetypeset
trigger1=!time&&statetype=A
physics=A

[State 140, Hi to Lo]
type=statetypeset
trigger1=!var(59)&&statetype=S&&command="holddown"
trigger2=var(59)&&statetype=S&&(enemynear,movetype=A)&&(enemynear,statetype=C)
statetype=C
physics=C
[State 140, Lo to Hi]
type=statetypeset
trigger1=!var(59)&&statetype=C&&command!="holddown"
trigger2=var(59)&&statetype=C&&(enemynear,movetype=A)&&(enemynear,statetype!=C)
statetype=S
physics=S

[State 140, 5]
type=changestate
trigger1=!animtime
value=(statetype=C)*11+(statetype=A)*51

;---SGUARDHIT (shaking)---
[Statedef 150]
type=S
movetype=H
physics=N
velset=0,0
[State 150, anim]
type=changeanim
trigger1=1
value=150
[State 150, end]
type=changestate
trigger1=hitshakeover
value=151+2*(command="holddown")
[State 150, Hi to Lo]
type=statetypeset
trigger1=!var(59)&&statetype=S&&command="holddown"
trigger2=var(59)&&statetype=S&&(enemynear,movetype=A)&&(enemynear,statetype=C)
statetype=C
physics=C
[State 150, Lo to Hi]
type=statetypeset
trigger1=!var(59)&&statetype=C&&command!="holddown"
trigger2=var(59)&&statetype=C&&(enemynear,movetype=A)&&(enemynear,statetype!=C)
statetype=S
physics=S
[State 150, shake]
type=forcefeedback
trigger1=!time
waveform=square
time=3

;---SGUARDHIT2 (knocked back)---
[Statedef 151]
type=S
movetype=H
physics=S
anim=150
[State 151, vel]
type=hitvelset
trigger1=!time
x=1
[State 151, vel]
type=velset
trigger1=time=gethitvar(slidetime)
trigger2=hitover
x=0
[State 151, ctrl]
type=ctrlset
trigger1=time=gethitvar(ctrltime)
value=1
[State 151, Hi to Lo]
type=statetypeset
trigger1=!var(59)&&statetype=S&&command="holddown"
trigger2=var(59)&&statetype=S&&(enemynear,movetype=A)&&(enemynear,statetype=C)
statetype=C
physics=C
[State 151, Lo to Hi]
type=statetypeset
trigger1=!var(59)&&statetype=C&&command!="holddown"
trigger2=var(59)&&statetype=C&&(enemynear,movetype=A)&&(enemynear,statetype!=C)
statetype=S
physics=S
[State 151, end]
type=changestate
trigger1=hitover
value=130
ctrl=1

;---CGUARDHIT (shaking)---
[Statedef 152]
type=C
movetype=H
physics=N
velset=0,0
[State 152, anim]
type=changeanim
trigger1=1
value=151
[State 152, end]
type=changestate
trigger1=hitshakeover
value=151+2*(command="holddown")
[State 152, Hi to Lo]
type=statetypeset
trigger1=!var(59)&&statetype=S&&command="holddown"
trigger2=var(59)&&statetype=S&&(enemynear,movetype=A)&&(enemynear,statetype=C)
statetype=C
physics=C
[State 152, Lo to Hi]
type=statetypeset
trigger1=!var(59)&&statetype=C&&command!="holddown"
trigger2=var(59)&&statetype=C&&(enemynear,movetype=A)&&(enemynear,statetype!=C)
statetype=S
physics=S
[State 152, shake]
type=forcefeedback
trigger1=!time
waveform=square
time=4

;---CGUARDHIT2 (knocked back)---
[Statedef 153]
type=C
movetype=H
physics=C
anim=151
[State 153, vel]
type=hitvelset
trigger1=!time
x=1
[State 153, vel]
type=velset
trigger1=time=gethitvar(slidetime)
trigger2=hitover
x=0
[State 153, ctrl]
type=ctrlset
trigger1=time=gethitvar(ctrltime)
value=1
[State 153, Hi to Lo]
type=statetypeset
trigger1=!var(59)&&statetype=S&&command="holddown"
trigger2=var(59)&&statetype=S&&(enemynear,movetype=A)&&(enemynear,statetype=C)
statetype=C
physics=C
[State 153, Lo to Hi]
type=statetypeset
trigger1=statetype=C&&command!="holddown"
statetype=S
physics=S
[State 153, end]
type=changestate
trigger1=hitover
value=131
ctrl=1

;---AGUARDHIT (shaking)---
[Statedef 154]
type=A
movetype=H
physics=N
velset=0,0
[State 154, anim]
type=changeanim
trigger1=1
value=152
[State 154, end]
type=changestate
trigger1=hitshakeover
value=155
[State 154, shake]
type=forcefeedback
trigger1=!time
waveform=square
time=4

;---AGUARDHIT2 (knocked away)---
[Statedef 155]
type=A
movetype=H
physics=N
anim=152
[State 155, vel]
type=hitvelset
trigger1=!time
x=1
y=1
[State 155, vel]
type=veladd
trigger1=1
y=const(movement.yaccel)
[State 155, ctrl]
type=ctrlset
trigger1=time=gethitvar(ctrltime)
value=1
[State 155, var]
type=varset
trigger1=1
sysvar(0)=(pos y>=0)&&(vel y>0)
[State 155, vel]
type=velset
trigger1=sysvar(0)
y=0
[State 155, pos]
type=posset
trigger1=sysvar(0)
y=0

[State 155, end]
type=changestate
triggerall=sysvar(0)
triggerall=inguarddist
trigger1=!var(59)&&command!="holdback"
trigger2=var(59)
trigger2=enemynear,movetype!=A&&p2bodydist x>=80&&(p2bodydist y!=[-75,75])&&!(enemy,numproj)
value=130

[State 155, end]
type=changestate
trigger1=sysvar(0)
value=52


;==========<CHIP K.O.>==========
[Statedef 5950]
type=S
physics=S
movetype=H
anim=5950
velset=0,0
ctrl=0
[State 5950, nhb]
type=nothitby
trigger1=1
value=SCA
[State 5950, pos]
type=posset
trigger1=1
y=0
[State 5950, sts]
type=statetypeset
trigger1=animelem=2
statetype=C
physics=C
[State 5950, snd]
type=playsnd
trigger1=animelem=2
value=0,52
[State 5950, end]
type=changestate
trigger1=!animtime
value=5150


;==========<TAUNT>==========
[Statedef 195]
type=S                      
movetype=A                      
physics=S                      
juggle=2           
anim=195
velset=0,0
sprpriority=1
ctrl=0            

[State 195, hit]
type=hitdef
trigger1=animelem=5
attr=S,NA                   
damage=10,0    
animtype=Back        
guardflag=MA           
hitflag=MA          
priority=1,Hit             
pausetime=9,9              
sparkno=s7010+(random%8)
guard.sparkno=s7000
sparkxy=-10,-34
hitsound=s2,3      
guardsound=s2,0
ground.type=High
ground.slidetime=9
ground.hittime=12
ground.velocity=-3,-4.5
air.type=Low
air.velocity=-3,-4
getpower=0
givepower=0
envshake.time=9
envshake.freq=60
envshake.ampl=2
palfx.color=32
palfx.sinadd=40,20,60,8
palfx.mul=384,128,512
palfx.time=32
fall=1

[State 195, flames]
type=helper
triggerall=movehit&&numtarget&&numhelper(7181)<1
trigger1=!(target,time)&&(target,movetype=H)
helpertype=normal
stateno=7181
ID=7181
name="flames"
postype=p2
bindtime=1000
ownpal=1
facing=-1
size.ground.front=0
size.ground.back=0
ignorehitpause=1
persistent=0

[State 195, aura]
type=helper
trigger1=!animelemtime(5)
helpertype=normal
stateno=6000
ID=6000
postype=p1
ownpal=1
persistent=0
ignorehitPause=1
[State 195, metsu]
type=helper
trigger1=!animelemtime(5)
helpertype=normal
stateno=6002
ID=6002
postype=p1
pos=-5,-100
facing=ifelse(facing=1,1,-1)
ownpal=1
persistent=0
ignorehitPause=1
[State 195, snd]
type=playsnd
trigger1=!animelemtime(5)
value=4,10
channel=0
ignorehitPause=1
[State 195, snd]
type=playsnd
trigger1=!animelemtime(5)
value=5,4
ignorehitPause=1
[State 195, dust]
type=explod
trigger1=animelem=5
anim=7104
ID=7104
sprpriority=-2
postype=p1
pos=-35,0
vel=0,0
removetime=-2
ownpal=1
ignorehitPause=1
[State 195, shake]
type=envshake
trigger1=animelem=5
time=18
freq=60
ampl=4
ignorehitPause=1

[State 195, power]
type=poweradd
trigger1=animelem=5&&!var(20)
value=50
[State 195, attackvar]
type=varadd
trigger1=!animtime&&fvar(11)<=.15
fvar(11)=.05
persistent=0

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


;==========<LOSE (Time over)>==========
[Statedef 170]
type=S
ctrl=0
anim=170
velset=0,0
[State 170, nhb]
type=nothitby
trigger1=1
value=SCA
time=1
[State 170, dust]
type=explod
trigger1=animelem=2
anim=7104
ID=7104
sprpriority=-2
postype=p1
pos=-6,0
removetime=-2
ownpal=1
scale=.5,.5
[State 170, snd]
type=playsnd
trigger1=animelem=2
value=0,52


;==========<DRAWGAME (Time over)>==========
[Statedef 175]
type=S
ctrl=0
anim=175
velset=0,0
[State 175, nhb]
type=nothitby
trigger1=1
value=SCA
time=1
[State 175, dust]
type=explod
trigger1=animelem=5
anim=7104
ID=7104
sprpriority=-2
postype=p1
pos=-5,0
removetime=-2
ownpal=1
[State 175, snd]
type=playsnd
trigger1=animelem=5
value=5,4


;==========<PREINTRO>==========
[Statedef 190]
type=S
ctrl=0
velset=0,0
[State 190, AI]
type=null;varset
trigger1=ishometeam&&(teamside=2||matchno>1)
trigger2=teamside=2&&numpartner
trigger2=ID>partner,ID
var(58)=1
[State 190, AIsimul]
type=null;varset
trigger1=teamside=2&&numpartner
trigger1=ID>partner,ID
var(58)=1
[State 190, intro]
type=changestate
trigger1=!time
value=ifelse(random<333,351,ifelse(random<500,356,350))


;==========<INTRO 1>==========
[Statedef 351]
type=S
anim=351
[State 351, intro]
type=assertspecial
trigger1=1
flag=intro

[State 351, aura]
type=helper
trigger1=!animelemtime(7)
helpertype=normal
stateno=6000
ID=6000
postype=p1
ownpal=1
persistent=0
[State 351, metsu]
type=helper
trigger1=!animelemtime(7)
helpertype=normal
stateno=6002
ID=6002
postype=p1
pos=-5,-100
facing=ifelse(facing=1,1,-1)
ownpal=1
persistent=0
[State 351, snd]
type=playsnd
trigger1=!animelemtime(7)
value=3,5
channel=0
[State 351, snd]
type=playsnd
trigger1=!animelemtime(7)
value=5,4

[State 351, fx]
type=explod
trigger1=animelem=7
anim=6025
ID=6025
sprpriority=4
postype=p1
pos=-35,0
scale=1,.5
ownpal=1
[State 351, dust]
type=explod
trigger1=animelem=7
anim=7104
ID=7104
sprpriority=-2
postype=p1
pos=-35,0
ownpal=1
[State 351, shake]
type=envshake
trigger1=animelemtime(7)>=0&&animelemtime(26)<0&&!(animelemtime(7)%12)
time=12
freq=60
ampl=4
[State 351, end]
type=changestate
trigger1=!animtime
value=0


;==========<INTRO 2>==========
[Statedef 356]
type=S
anim=356
[State 356, intro]
type=assertspecial
trigger1=1
flag=intro

[State 356, kanji]
type=explod
trigger1=!time
anim=6015+(facing=-1)
ID=6015
sprpriority=1
postype=p1
bindtime=-1
removetime=-2
removeongethit=1
ownpal=1

[State 356, snd]
type=playsnd
trigger1=!time
value=5,11
[State 351, hadou]
type=explod
trigger1=!time
anim=6020
ID=6020
sprpriority=2
postype=p1
pos=14,-72
removetime=240
removeongethit=1
ownpal=1

[State 356, grow]
type=modifyexplod
trigger1=time<40
ID=7020
scale=(.025*time),(.025*time)
[State 356, normal]
type=modifyexplod
trigger1=time>=40&&time<=120
ID=7020
scale=1,1
[State 356, shrink]
type=modifyexplod
trigger1=time>120&&time<=280
ID=7020
scale=1-(.0063*(time-120)),1-(.0063*(time-120))

[State 356, particles]
type=explod
trigger1=time>120&&time<=240&&!(time%4)
vel=ceil(1+random/250),-ceil(random/500)
accel=-.2,-.33
anim=4108
sprpriority=4
postype=p1
pos=24,-72
random=20,10
facing=-1+(random<500)*2
removetime=-2
ownpal=1
scale=1,.15
[State 356, particles]
type=explod
trigger1=time>120&&time<=240&&!(time%4)
vel=-ceil(1+random/250),-ceil(random/500)
accel=.2,-.33
anim=4108
sprpriority=4
postype=p1
pos=4,-72
random=20,10
facing=-1+(random<500)*2
removetime=-2
ownpal=1
scale=1,.15

[State 356, dust]
type=null;explod
trigger1=time>120&&time<=240
trigger1=ifelse(animelemtime(4)>=0,!(time%12),!(time%9))
anim=6025
ID=6025
sprpriority=-2
postype=p1
pos=ifelse(animelemtime(4)>=0,16,20),0
removetime=-2
ownpal=1
scale=.75,.75

[State 356, dust]
type=helper
trigger1=time>120&&time<=240
trigger1=ifelse(animelemtime(4)>=0,!(time%12),!(time%9))
helpertype=normal
stateno=7503
ID=7503
name="Red Dust"
postype=p1
pos=ifelse(animelemtime(4)>=0,16,20),0
ownpal=1

[State 356, snd]
type=playsnd
trigger1=time=120
value=5,12
channel=5
loop=1
[State 356, snd]
type=stopsnd
trigger1=time>=280
channel=5

[State 356, snd]
type=playsnd
trigger1=time=240
value=4,7
channel=0

[State 356, snd]
type=playsnd
trigger1=!animelemtime(11)
value=5,4
[State 356, dust]
type=explod
trigger1=animelem=11
anim=7104
ID=7104
sprpriority=-2
postype=p1
pos=-35,0
vel=0,0
removetime=-2
ownpal=1
[State 356, shake]
type=envshake
trigger1=animelem=11
time=8
freq=60
ampl=4

[State 356, shake]
type=envshake
trigger1=time>120&&time<=210&&!(time%12)
time=12
freq=60
ampl=ifelse(animelemtime(4)>=0,3,4)

[State 356, end]
type=changestate
trigger1=!animtime
value=0


;==========<INTRO 3>==========
[Statedef 350]
type=S
anim=350
[State 350, intro]
type=assertspecial
trigger1=1
flag=intro

[State 350, kanji]
type=explod
trigger1=!time
anim=6010
ID=6010
sprpriority=1
postype=p1
facing=ifelse(facing=1,1,-1)
pos=ifelse(facing=1,0,32)
bindtime=-1
removetime=-2
removeongethit=1
ownpal=1

[State 350, snd]
type=playsnd
trigger1=time=15
value=4,3
channel=0
[State 350, end]
type=changestate
trigger1=!animtime
value=0


;==========<WIN POSE DECIDER>==========
[Statedef 180]
type=S
[State 180, winSGS/misogi]
type=changestate
trigger1=prevstateno=352||prevstateno=353
value=prevstateno
[State 180, win1]
type=changestate
trigger1=!time
value=ifelse(random<333,354,ifelse(random<500,355,357))


;==========<WIN 1>==========
[Statedef 354]
type=S
anim=354

[State 354, snd]
type=playsnd
trigger1=animelem=4
value=4,ifelse(random<500,2,8)
channel=0

[State 354, kanji]
type=explod
trigger1=animelem=4
anim=6011
ID=6011
sprpriority=1
postype=p1
facing=ifelse(facing=1,1,-1)
pos=ifelse(facing=1,0,32)
bindtime=-1
removetime=-2
removeongethit=1
ownpal=1


;==========<WIN 2>==========
[Statedef 355]
type=S
anim=355

[State 355, snd]
type=playsnd
trigger1=animelem=3
value=3,5
channel=0
persistent=0


;==========<WIN 3>==========
[Statedef 357]
type=S
anim=357

[State 357, aura]
type=helper
trigger1=!animelemtime(5)
helpertype=normal
stateno=6000
ID=6000
postype=p1
ownpal=1
persistent=0
ignorehitPause=1
[State 357, metsu]
type=helper
trigger1=!animelemtime(5)
helpertype=normal
stateno=6002
ID=6002
postype=p1
pos=-5,-100
facing=ifelse(facing=1,1,-1)
ownpal=1
persistent=0
ignorehitPause=1
[State 357, snd]
type=playsnd
trigger1=!animelemtime(5)
value=5,4
ignorehitPause=1
[State 357, snd]
type=playsnd
trigger1=!animelemtime(5)
value=4,13
channel=0
[State 357, dust]
type=explod
trigger1=animelem=5
anim=7104
ID=7104
sprpriority=-2
postype=p1
pos=-35,0
vel=0,0
removetime=-2
ownpal=1
[State 357, shake]
type=envshake
trigger1=animelemtime(5)>=0&&!(time%12)
time=12
freq=60
ampl=4
[State 357, snd]
type=playsnd
trigger1=animelem=5
value=5,12
loop=1
persistent=0


;==========<WIN by S.G.S.>==========
[Statedef 352]
type=S
sprpriority=-4
anim=352

[State 352, safety]
type=removeexplod
trigger1=1
ID=7013

[State 352, kanji]
type=helper
trigger1=!time&&prevstateno=4001
helpertype=normal
stateno=6012
ID=6012
postype=p1
facing=ifelse(facing=1,1,-1)
pos=ifelse(facing=1,0,32)
ownpal=1
persistent=0
pausemovetime=99
supermovetime=99

[State 352, kanjibg]
type=helper
trigger1=!time&&prevstateno=4001
helpertype=normal
stateno=7610
ID=7610
postype=left
ownpal=1
persistent=0

[State 352, snd]
type=playsnd
trigger1=time=10&&prevstateno=4001
value=4,12
channel=0

[State 352, win]
type=changestate
trigger1=prevstateno=4001&&time>150
value=180
ctrl=1


;==========<WIN by MISOGI>==========
[Statedef 353]
type=S
sprpriority=-5

[State 353, anim]
type=changeanim
trigger1=anim!=353&&prevstateno=4100
value=353

[State 353, snd]
type=playsnd
trigger1=animelem=6
value=4,8
channel=0

[State 353, kanji]
type=explod
trigger1=animelem=6
anim=6011
ID=6011
sprpriority=-3
postype=p1
facing=ifelse(facing=1,1,-1)
pos=ifelse(facing=1,0,32)
bindtime=-1
removetime=-2
removeongethit=1
ownpal=1

[State 353, win]
type=changestate
trigger1=prevstateno=4100
value=180
ctrl=1


;==========<CONTINUE?>==========
[Statedef 5500]
type=S
ctrl=0
velset=0,0
[State 5500, snd]
type=playsnd
trigger1=!time
value=4,2
channel=0
[State 5500, anim]
type=changeanim
trigger1=!time
value=5500


;==========<INITIALIZE>==========
[Statedef 5900]
type=S

[State 5900, partner]
type=varset
trigger1=teammode=simul
trigger1=partner,name="Pocket Shin Gouki"&&partner,authorname="Phantom.of.the.Server"
var(50)=1
[State 5900, partner]
type=varset
trigger1=teammode=simul
trigger1=partner,name="Ryu"&&partner,authorname="Phantom.of.the.Server"
var(50)=(partner,var(1))+2

[State 5900, end]
type=changestate
trigger1=!time
value=ifelse(roundno=1,190,0)


;==========<FALL RECOVERY>==========
[Statedef 5200]
type=A
movetype=H
physics=N
[State 5200, anim]
type=changeanim
trigger1=anim=5035&&!animtime
value=5050
[State 5200, vel]
type=veladd
trigger1=1
y=gethitvar(yaccel)
[State 5200, end]
type=selfstate
trigger1=vel y>0&&pos y>=-10
value=5201

[Statedef 5201]
type=A
movetype=I
physics=N
anim=5200
velset=vel x-2

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

[State 5201, vel]
type=veladd
trigger1=1
x=-vel x/20

[State 5201, snd]
type=playsnd
trigger1=animelem=1
value=3,1
[State 5201, flash]
type=palfx
trigger1=!time
add=20,50,75
sinadd=20,50,75,6
time=12

[State 5201, nhb]
type=nothitby
trigger1=animelemtime(5)<0
value=SCA
time=1

[State 5201, fx]
type=gamemakeanim
trigger1=!time
value=60
pos=0,-ceil(pos y)
under=1

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

[Statedef 5210]
type=A
movetype=I
physics=A
anim=5210
ctrl=0
[State 5210, snd]
type=playsnd
trigger1=!time
value=3,1
channel=0
[State 5210, flash]
type=palfx
trigger1=!time
add=20,50,75
sinadd=20,50,75,6
time=12
[State 5210, turn]
type=turn
trigger1=!time&&p2dist x<-20
[State 5210, direction]
type=velset
trigger1=!time
x=ifelse(command="holdback",(.75*vel x),-2)
y=-7
[State 5210, nhb]
type=nothitby
trigger1=animelemtime(6)<0
value=SCA
time=1
[State 5210, ctrl]
type=ctrlset
trigger1=animelemtime(7)>=0
value=1


;==========<RECOVERY ROLL>==========
[Statedef 5220]
type=A
movetype=H
physics=N
[State 5220, anim]
type=changeanim
trigger1=anim=5035&&!animtime
value=5050
[State 5220, vel]
type=veladd
trigger1=1
y=gethitvar(yaccel)
[State 5220, end]
type=selfstate
trigger1=vel y>0&&pos y>=-10
value=5221

[Statedef 5221]
type=C
movetype=I
physics=N
anim=5220
velset=5

[State 5221, pos]
type=posset
trigger1=1
y=0
[State 5221, vel]
type=velset
trigger1=1
y=0

[State 5221, nhb]
type=nothitby
trigger1=animelemtime(13)<0
value=SCA
time=1
[State 5221, push]
type=playerpush
trigger1=animelemtime(15)<0
value=0

[State 5221, anim]
type=changeanim
trigger1=!animelemtime(8)&&command!="holdfwd"
value=5220
elem=12
[State 5221, sts]
type=statetypeset
trigger1=animelemtime(15)>=0
physics=S

[State 5221, dust]
type=explod
trigger1=animelemtime(13)<0&&!(time%5)
anim=6051
ID=6051
sprpriority=3
postype=p1
vel=-1,0
removetime=-2
ownpal=1
[State 5221, dust]
type=explod
trigger1=animelem=15
anim=7104
ID=7104
sprpriority=-2
postype=p1
pos=25,0
vel=0,0
removetime=-2
ownpal=1
scale=.5,.5
[State 5221, snd]
type=playsnd
trigger1=animelem=15
value=0,53
persistent=0

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


;===========================================================================
;===============================<-2 STATES>=================================
;===========================================================================
[Statedef -2]

[State -2, turnoffAI]
type=varset
trigger1=var(58)>0&&(roundstate!=2||!alive)
var(58)=-2
ignorehitPause=1
[State -2, AIvar]
type=varset
trigger1=var(58)=1
trigger2=var(59):=0
var(59)=1
ignorehitPause=1

[State -2, powerCC]
type=poweradd
trigger1=movetype=H&&var(20)>0
trigger1=var(20):=-1
value=-1500
ignorehitPause=1
[State -2, turnoffCC]
type=varset
trigger1=var(20)<=0||roundstate!=2
var(20)=0
ignorehitPause=1

[State -2, resetmashvar]
type=varset
triggerall=var(15)
trigger1=!time&&movetype=A
trigger2=movetype!=A
var(15)=0
ignorehitPause=1
[State -2, resetmashvar]
type=varset
triggerall=var(16)
trigger1=!time&&movetype=A
trigger2=movetype!=A
var(16)=0
ignorehitPause=1

[State -2, nodizzy >:)]
type=null;selfstate
trigger1=anim=5300
value=0
ctrl=1

[State -2, stopsnd]
type=stopsnd
trigger1=!time&&(prevstateno=356||prevstateno=510)
channel=5
persistent=0

[State -2, Debug]
type=displaytoclipboard
trigger1=1
text="AI=%d Damage=%f Helpers=%d Mash=%d by P.o.t.S."
params=var(59), (1-fvar(10)+(fvar(11)*!var(20))+fvar(12)), numhelper, var(15)


;===========================================================================
;===============================<-3 STATES>=================================
;===========================================================================
[Statedef -3]

[State -3, AIactivation]
type=helper
trigger1=!var(58)&&!numhelper(9741)&&roundstate=2&&alive
helpertype=normal
name="Shin Gouki's AI"
ID=9741
pos=9999,9999
stateno=9741
keyctrl=1
pausemovetime=2147483647
supermovetime=2147483647
[State -3, turnbackonAI]
type=varset
trigger1=var(58)=-2&&roundState=2&&alive
var(58)=1

[State -3, counterFX]
type=helper
trigger1=movehit&&numtarget&&!numhelper(6300)&&var(29)
trigger1=(target,movetype=H)&&!(target,time)
helpertype=normal
stateno=6300
ID=6300
name="Counter"
postype=back
pos=-9999,0
ignorehitpause=1
persistent=0
[State -3, countervar]
type=varset
trigger1=1
var(29)=ifelse((p2movetype=A),1,0)

[State -3, attackvarbyhits]
type=varadd
trigger1=time=1&&movetype=A&&fvar(10)<.8
trigger1=(stateno!=[800,815])&&(stateno!=[4301,4303])
fvar(10)=ifelse((stateno=[3000,4999]),.4,ifelse((stateno=[1000,2999]),.1,.05))
ignorehitpause=1
[State -3, attackvarreset]
type=varset
trigger1=numenemy&&fvar(10)
trigger1=(enemynear,movetype!=H)
fvar(10)=0
persistent=0
ignorehitpause=1
[State -3, attackvarbypower]
type=varset
trigger1=1
fvar(12)=ifelse(power>=3000,.05,ifelse(power>=2000,.02,ifelse(power>=1000,.01,0)))
ignorehitpause=1
[State -3, dampener]
type=attackmulset
trigger1=1
value=ifelse(fvar(10)>=.8,.2,1-fvar(10))+(fvar(11)*!var(20))+fvar(12)
ignorehitPause=1

[State -3, varCC]
type=varadd
trigger1=var(20)>0
var(20)=-1
ignorehitPause=1
[State -3, powerCC]
type=poweradd
trigger1=var(20)>0
value=-6
ignorehitPause=1

[State -3, glowCC]
type=palfx
trigger1=var(20)>0&&!(gametime%16)
time=16
add=20,20,20
sinadd=20,20,20,16

[State -3, assertsCC]
type=assertspecial
trigger1=var(20)>0
flag=nojugglecheck
[State -3, assertsCC]
type=assertspecial
trigger1=var(20)>0
flag=nostandguard
flag2=nocrouchguard
flag3=noairguard

[State -3, CCnhb]
type=nothitby
trigger1=var(20)>=270
time=1
value=SCA

[State -3, moveshadow]
type=afterimage
triggerall=time=1&&!var(20)
trigger1=stateno=50&&var(7)=3
time=2
timegap=1
framegap=3
length=9
palbright=0,0,0
paladd=0,0,0
palmul=.9,.9,.9
palcontrast=120,120,120
palpostbright=0,0,0
trans=add1
persistent=0

[State -3, lv1supershadow]
type=afterimage
trigger1=stateno=3000&&anim=3000&&!animelemtime(3)
trigger2=stateno=3050&&!animelemtime(2)
trigger3=stateno=3100&&anim=3100&&animelemtime(1)=2
trigger4=stateno=3200&&anim=3200&&!animelemtime(2)
trigger5=stateno=3250&&anim=3250&&!animelemtime(3)
trigger6=stateno=3300&&time=1
time=2
timegap=1
framegap=10
length=30
paladd=0,0,0
palmul=.9,.9,.9
palcontrast=120,120,120
palpostbright=0,0,0
trans=add1
persistent=0

[State -3, lv2supershadow]
type=afterimage
trigger1=stateno=4200&&!animelemtime(2)
trigger2=stateno=4300&&!animelemtime(6)
trigger3=stateno=4400&&anim=4400&&!animelemtime(2)
time=2
timegap=1
framegap=10
length=30
paladd=0,0,0
palmul=.9,.9,.9
palcontrast=20,20,160
palpostbright=0,0,0
trans=add1
persistent=0

[State -3, lv3supershadow]
type=afterimage
trigger1=stateno=4000&&time=1
trigger2=stateno=4100&&anim=4100&&time=63
trigger3=stateno=3020&&anim=3020&&!animelemtime(4)
trigger4=stateno=3060&&!animelemtime(2)
time=2
timegap=1
framegap=10
length=30
paladd=0,0,0
palmul=.9,.9,.9
palcontrast=160,20,20
palpostbright=0,0,0
trans=add1
persistent=0

[State -3, AfterImagePersist]
type=afterimagetime
trigger1=stateno=50&&var(7)=3&&vel y<-1
trigger2=(stateno=[3000,4999])&&anim!=1101&&anim!=1102&&anim!=3205&&(anim!=[4102,4103])&&anim!=4302
trigger3=stateno=1400
trigger4=var(20)
time=2

[State -3, HitSnd]
type=playsnd
triggerall=alive&&(time=1)&&(random<250)
trigger1=stateno=5000||stateno=5010||stateno=5020||stateno=5070||stateno=5080
value=5000,ceil(random/200)
channel=0
ignorehitPause=1
persistent=0

[State -3, collapse]
type=changestate
trigger1=!alive&&(stateno=[5000,5030])
trigger1=(prevstateno=[130,131])||(prevstateno=[150,153])
value=5950

[State -3, KOfx]
type=helper
triggerall=winKO&&!numhelper(6210)&&!numhelper(6200)
trigger1=movehit&&numtarget&&(stateno=[3000,4999])
trigger2=numhelper(3005)
trigger2=helper(3005),var(3)
trigger3=numhelper(3055)
trigger3=helper(3055),var(3)
trigger4=numhelper(4205)
trigger4=helper(4205),var(3)
helpertype=normal
stateno=6210
ID=6210
name="KO FX"
postype=left
ownpal=1
persistent=0
ignorehitPause=1
pausemovetime=999
supermovetime=999

[State -3, gametimevar]
type=varset
trigger1=1
var(57)=gametime
ignorehitPause=1