; _____________________________________
;| Rare Akuma by Phantom.of.the.Server |
; ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
;==============================================================================================
;=======================================<HELPER STATES>========================================
;==============================================================================================

;========================<AI ACTIVATION>=============================
;Adapted from Winane's (http://www.mugenguild.net/~winane)
[Statedef 9741]
type=A
movetype=I
physics=N
anim=9741
ctrl=0

[State 9741, wrong]
type=destroyself
trigger1= (parent,ID)!=(root,ID)
[State 9741, safety]
type=selfstate
trigger1= !ishelper
value=0

[State 9741, uglyhack]
type=varset
trigger1= !var(1)
var(2)=1
[State 9741, pausecheck]
type=varset
trigger1= gametime>root,var(58)
trigger2= !(root,alive)
trigger3= roundstate!=2
trigger4= root,var(59)
var(2)=1

[State 9741, facing]
type=turn
trigger1= var(9):=(facing!=root,facing)

[State 9741, dirturnonAI]
type=parentvarset
triggerall= !var(2) && !var(9)
trigger1= root,command="fwd"
trigger2= root,command="back"
trigger3= root,command="up"
trigger4= root,command="down"
var(59)=1
[State 9741, dirturnoffAI]
type=parentvarset
triggerall= !var(2) && !var(9) && (root,var(59)>=1)
trigger1= command="fwd" && root,command="fwd"
trigger2= command="back" && root,command="back"
trigger3= command="up" && root,command="up"
trigger4= command="down" && root,command="down"
var(59)=-1

[State 9741, buttonturnonAI]
type=parentvarset
triggerall= !var(2)
trigger1= root,command="a"
trigger2= root,command="b"
trigger3= root,command="c"
trigger4= root,command="x"
trigger5= root,command="y"
trigger6= root,command="z"
trigger7= root,command="start"
var(59)=1
[State 9741, buttonturnoffAI]
type=parentvarset
triggerall= !var(2) && (root,var(59)>=1)
trigger1= command="a" && root,command="a"
trigger2= command="b" && root,command="b"
trigger3= command="c" && root,command="c"
trigger4= command="x" && root,command="x"
trigger5= command="y" && root,command="y"
trigger6= command="z" && root,command="z"
trigger7= command="start" && root,command="start"
var(59)=-1

[State 9741, unpausecheck]
type=varset
triggerall= var(2)
trigger1= root,command="fwd" || root,command="back" || root,command="up" || root,command="down"
trigger2= root,command="a" || root,command="b" || root,command="c"
trigger3= root,command="x" || root,command="y" || root,command="z"
trigger4= root,command="start"
trigger5= var(2)=1
trigger5= var(2):=0
var(2)=1

[State 9741, goodbye]
type=destroyself
triggerall= var(1):=1
trigger1= root,var(59)
trigger2= !(root,alive)
trigger3= roundstate!=2


;========================<MESSATSU GOU HADOU>=============================
[Statedef 1005]
type=A
physics=N
movetype=A
ctrl=0
velset=0,0
sprpriority=4
 
[State 1005, hitoverride]
type=hitoverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=1009
ignorehitpause=1
[State 1005,hitby]
type=hitby
trigger1= 1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[State 1005, strengthvar]
type=varset
trigger1= !time
var(10)=root,var(10)
[State 1005, anim]
type=changeanim
trigger1= !time && !prevstateno
value=1005

[State 1005, hitvar]
type=varadd
trigger1= !time
var(2)=1
[State 1005, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1

[State 1005, hitvar]
type=varset
trigger1= numenemy
trigger1= enemynear,name="Psycho Shredder[S]"
var(2)=1
ignorehitpause=1

[State 1005, vel]
type=velset
trigger1= 1
x=ifelse(var(10)=3,10,ifelse(var(10)=2,6,2))
[State 1005, vel]
type=velset
trigger1= time<2 && var(2)>1
x=1

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

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

[State 1005, fx]
type=explod
trigger1=!(gametime%2)
trigger1=numexplod(1007)<8
anim=1007
sprpriority=4
postype=p1
random=48,48
vel= -(.25+(random/4000.0))*vel x, -(.25+(random/4000.0))*vel y
accel=0,.25
scale=.5,.5
ignorehitpause=1

[State 1005, hit]
type=hitdef
trigger1= 1
priority=4,Hit
attr=S,HP
damage=ceil(20*root,fvar(12)),4
animtype=Back
hitflag=MAFD
guardflag=MA
pausetime=4,6
sparkno=1
sparkxy=-10,0
guard.sparkno=41
guardsound=s2,0
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity=-6,-4
ground.cornerpush.veloff=0
air.velocity=-6,-4
fall=1
fall.recover=0
getpower= ifelse(p2movetype=H,72,144), 36
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
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
p2stateno=100115

[State 1005, noflamesvar]
type=varset
triggerall= movehit && numtarget
trigger1= (target,ID=root,ID)
trigger2= numpartner
trigger2= (target,ID=partner,ID)
var(16)=1
ignorehitpause=1
[State 1005, flames]
type=helper
trigger1= movehit && numtarget && numhelper(7181)<1
trigger1= !(target,time) && (target,movetype=H) && !var(16)
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 1005, noflamesvar]
type=varset
trigger1= 1
var(16)=0

[State 1005, end]
type=changestate
trigger1= movecontact
value=ifelse(var(2)<8,1005,1006)
[State 1005, end]
type=destroyself
trigger1= pos x!=[-240,240]

[Statedef 1006]
type=A
physics=N
movetype=A
anim=1006
ctrl=0
velset=0,0
sprpriority=4
[State 1006, trans]
type=trans
trigger1= 1
trans=addalpha
alpha=256,256
ignorehitpause=1
[State 1006, snd]
type=playsnd
trigger1=!time
value=5,1
channel=1
[State 1006, end]
type=destroyself
trigger1= !animtime


[Statedef 1009]
type=A
physics=N
movetype=A
anim=1006
ctrl=0
velset=0,0
sprpriority=4
[State 1009, fx]
type=helper
trigger1=!time && numhelper(1)<3
helpertype=normal
ID=1
name="Akuma Juniors"
postype=p1
keyctrl=1
size.xscale=.5
size.yscale=.5
ownpal=1
[State 1009, end]
type=destroyself
trigger1=1


;========================<MESSATSU GO TO HELL>=============================
[Statedef 1025]
type=A
physics=N
movetype=A
ctrl=0
velset=0,0
sprpriority=4
 
[State 1025, hitoverride]
type=hitoverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=1006
ignorehitpause=1
[State 1025,hitby]
type=hitby
trigger1= 1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[State 1025, anim]
type=changeanim
trigger1= anim!=1025
value=1025

[State 1025, vel]
type=velset
trigger1= !time && !prevstateno
x=-2.5-(random/400.0)
y=-10+(random/50.0)

[State 1025, vel]
type=veladd
trigger1= vel x<10 && p2dist x>0
x=.25
[State 1025, vel]
type=veladd
trigger1= vel x>-10 && p2dist x<0
x=-.25
[State 1025, vel]
type=veladd
trigger1= vel y<10 && numenemy
trigger1= pos y<(enemynear,pos y+enemynear,const(size.mid.pos.y))
y=.25
[State 1025, vel]
type=veladd
trigger1= vel y>-10 && numenemy
trigger1= pos y>(enemynear,pos y+enemynear,const(size.mid.pos.y))
y=-.25

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

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

[State 1025, hit]
type=hitdef
trigger1= 1
priority=4,Hit
attr=S,HP
damage=ceil(25*root,fvar(12)),4
animtype=Hard
hitflag=MAFD
guardflag=MA
pausetime=4,6
sparkno=1
sparkxy=-10,0
guard.sparkno=41
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=-7,0
ground.cornerpush.veloff=0
air.velocity=-6,-4
fall=0
fall.recover=0
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=16
envshake.freq=100
envshake.ampl=6
sprpriority=4
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
p2stateno=100115

[State 1025, end]
type=changestate
trigger1= movecontact
value=1006
[State 1025, end]
type=destroyself
trigger1= pos x!=[-240,240]


;========================<TENMA GOU ZANKUU>=============================
[Statedef 1055]
type=A
physics=N
movetype=A
ctrl=0
velset=0,0
sprpriority=4

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

[State 1055, strengthvar]
type=varset
trigger1= !time
var(10)=root,var(10)
[State 1055, anim]
type=changeanim
trigger1= !time && !prevstateno
value=1005

[State 1055, hitvar]
type=varadd
trigger1= !time
var(2)=1
[State 1055, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1

[State 1055, hitvar]
type=varset
trigger1= numenemy
trigger1= enemynear,name="Psycho Shredder[S]"
var(2)=1
ignorehitpause=1

[State 1055, vel]
type=velset
trigger1= 1
x=ifelse(var(10)=3,10,ifelse(var(10)=2,6,2))
y=ifelse(var(10)=3,7,ifelse(var(10)=2,4.2,1.4))
[State 1055, vel]
type=velset
trigger1= time<2 && var(2)>1
x=1
y=1

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

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

[State 1055, fx]
type=explod
trigger1=!(gametime%2)
trigger1=numexplod(1007)<8
anim=1007
sprpriority=4
postype=p1
random=48,48
vel= -(.25+(random/4000.0))*vel x, -(.25+(random/4000.0))*vel y
accel=0,.25
scale=.5,.5
ignorehitpause=1

[State 1055, hit]
type=hitdef
trigger1= 1
priority=4,Hit
attr=A,HP
damage=ceil(20*root,fvar(12)),4
animtype=Back
hitflag=MAFD
guardflag=MA
pausetime=4,6
sparkno=1
sparkxy=-10,0
guard.sparkno=41
guardsound=s2,0
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity=-4,-2
ground.cornerpush.veloff=0
air.velocity=-4,-2
down.velocity=0,0
down.hittime=20
fall=1
fall.recover=0
getpower= ifelse(p2movetype=H,72,144), 36
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
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
p2stateno=100115

[State 1055, noflamesvar]
type=varset
triggerall= movehit && numtarget
trigger1= (target,ID=root,ID)
trigger2= numpartner
trigger2= (target,ID=partner,ID)
var(16)=1
ignorehitpause=1
[State 1055, flames]
type=helper
trigger1= movehit && numtarget && numhelper(7181)<1 && (root,var(1)!=1)
trigger1= !(target,time) && (target,movetype=H) && !var(16)
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 1055, noflamesvar]
type=varset
trigger1= 1
var(16)=0

[State 1055, end]
type=changestate
trigger1= movecontact
value=ifelse(var(2)<8,1055,1056)
[State 1055, end]
type=changestate
trigger1= pos y>=0
value=1057
[State 1055, end]
type=destroyself
trigger1= pos x!=[-240,240]

[Statedef 1056]
type=A
physics=N
movetype=A
anim=1006
ctrl=0
velset=0,0
sprpriority=4
[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=1006
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
[State 1057, end]
type=destroyself
trigger1= !animtime


;========================<MESSATSU GOU HADOU 2>=============================
[Statedef 3005]
type=A
physics=N
movetype=A
ctrl=0
sprpriority=4
 
[State 3005, hitoverride]
type=hitoverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=3005
ignorehitpause=1
[State 3005,hitby]
type=hitby
trigger1= 1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[State 3005, strengthvar]
type=varset
trigger1= !time
var(10)=root,var(10)
[State 3005, anim]
type=changeanim
trigger1= !time && !prevstateno
value=3005

[State 3005, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1

[State 3005, vel]
type=velmul
trigger1=1
x=1.1
[State 3005, vel]
type=velset
trigger1= !time && !prevstateno
x=.5
y=-4+(random/125.0)
[State 3005, vel]
type=veladd
trigger1= vel y<6 && numenemy
trigger1= pos y<(enemynear,pos y+enemynear,const(size.mid.pos.y))
y=.25
[State 3005, vel]
type=veladd
trigger1= vel y>-6 && numenemy
trigger1= pos y>(enemynear,pos y+enemynear,const(size.mid.pos.y))
y=-.25

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

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

[State 3005, fx]
type=explod
trigger1=!(gametime%2)
trigger1=numexplod(1007)<8
anim=1007
sprpriority=4
postype=p1
random=112,112
accel=0,.25
scale=1,1
ignorehitpause=1

[State 3005, hit]
type=hitdef
trigger1= 1
priority=4,Hit
attr=S,HP
damage=ceil(20*root,fvar(12)),4
animtype=Back
hitflag=MAFD
guardflag=MA
pausetime=2,1
sparkno=2
sparkxy=-10,0
guard.sparkno=41
guardsound=s2,0
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity= -vel x, -3
ground.cornerpush.veloff=0
air.velocity= -vel x, -3
fall=1
fall.recover=0
getpower= ifelse(p2movetype=H,72,144), 36
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
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
p2stateno=100115

[State 3005, noflamesvar]
type=varset
triggerall= movehit && numtarget
trigger1= (target,ID=root,ID)
trigger2= numpartner
trigger2= (target,ID=partner,ID)
var(16)=1
ignorehitpause=1
[State 3005, flames]
type=helper
trigger1= movehit && numtarget && numhelper(7181)<1
trigger1= !(target,time) && (target,movetype=H) && !var(16)
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 3005, noflamesvar]
type=varset
trigger1= 1
var(16)=0

[State 3005, end]
type=changestate
trigger1= movecontact
value=3005
[State 3005, end]
type=destroyself
trigger1= pos x!=[-320,320]

[Statedef 3006]
type=A
physics=N
movetype=A
anim=1006
ctrl=0
velset=0,0
sprpriority=4
[State 3006, trans]
type=trans
trigger1= 1
trans=addalpha
alpha=256,256
ignorehitpause=1
[State 3006, snd]
type=playsnd
trigger1=!time
value=5,1
channel=1
[State 3006, end]
type=destroyself
trigger1= !animtime


;====================<HOLINESS>====================
[Statedef 77]
type=A
physics=N
anim=9741
sprpriority=2
ctrl=0

[State 77, nhb]
type=nothitby
trigger1= 1
value=SCA
time=-1
ignorehitpause=1

[State 77, noshadow]
type=assertspecial
trigger1=1
flag=noshadow

[State 77, bind]
type=bindtoroot
trigger1=1
pos= -1+(random%2), ceil(.3125*(gametime%32))-1+(random%2)
facing=1
[State 77, bind]
type=bindtoroot
trigger1= root,stateno=4010
pos= -4+(random%8), ceil(1.25*(gametime%32))-4+(random%8)
facing=1

[State 77, trans]
type=angledraw
trigger1= 1
scale= 1 + .01*(gametime%32), 1 + .01*(gametime%32)
[State 77, trans]
type=angledraw
trigger1= root,stateno=4010
scale= 4 + .04*(gametime%32), 4 + .04*(gametime%32)

[State 77, trans]
type=trans
trigger1= 1
trans=addalpha
alpha= 256 - 8*(gametime%32), 8*(gametime%32)
ignorehitpause=1

[State 77, anim]
type=changeanim
trigger1=selfanimexist(root,anim)
value=(root,anim)
elem=(root,animelemno(0))
[State 77, custom]
type=assertspecial
trigger1=!selfanimexist(root,anim)
flag=invisible

[State 77]
type=varrandom
trigger1=1
v=1
range=1,ifelse((root,stateno=195), 10, 40)
[State 77]
type=varset
trigger1=numhelper(7500)
var(1)=99

[State 77]
type=explod
trigger1=var(1)=1
anim=7250
sprpriority=3
postype=p1
pos=0,ceil(-pos y)
facing=ifelse(random<500,-1,1)
random=160,40
trans=addalpha
alpha=192,256
pausemovetime=-1
supermovetime=-1
[State 77]
type=playsnd
trigger1=var(1)=1
value=5,15
channel=1
volume=-128
freqmul= .9 + (random/5000.0)
[State 77]
type=bgpalfx
trigger1=var(1)=1
trigger1=var(1):=99
time=20
add=-128,-128,-128
sinadd=128,128,128,80


;========================<GONE>=============================
[Statedef 1510]
type=A
physics=N
movetype=I
anim=1510
ctrl=0
velset=0,0
sprpriority=2

[State 1510]
type=nothitby
trigger1= 1
time=-1
value=SCA
ignorehitpause=1

[State 1510]
type=veladd
trigger1=1
y=.33
[State 1510]
type=velset
trigger1=!time
x=-2+(random/500.0)
y=-1-(random/500.0)

[State 1510]
type=posset
trigger1=pos y>=0
y=0
[State 1510]
type=velmul
trigger1=pos y>=0 && vel y>2
x=.75
y=-.75

[State 1510]
type=trans
trigger1= time=[33,64]
trans=addalpha
alpha= 256-8*(time-32), 8*(time-32)
ignorehitpause=1

[State 1510]
type=destroyself
trigger1=time>=64


;========================<PURPLE DUST>=============================
[Statedef 4210]
physics=N
anim=9741
[State 4210, assert]
type=assertspecial
trigger1= 1
flag=noshadow
ignorehitpause=1
[State 4210, dust]
type=explod
trigger1= !time
anim=4210
ID=4210
sprpriority=-2
postype=p1
removetime=25
[State 4210, fade]
type=palfx
trigger1= !time
mul=384,384,384
sinadd=-255,-255,-255,100
time=25
[State 4210, shrink]
type=modifyexplod
trigger1= 1
ID=4210
scale=.5+(.1*time),.1+(.02*time)
[State 4210, end]
type=destroyself
trigger1= time>=26


;========================<TENMA SHINZUI WARI F.X.>=============================
[Statedef 3305]
physics=N
velset=0,0
anim=3305
sprpriority=3
[State 3305, trans]
type=trans
trigger1= 1
trans=addalpha
alpha=256,256
ignorehitpause=1
[State 3305, bind]
type=bindtoroot
trigger1= root,anim=3300
ignorehitpause=1

[State 3305, image]
type=afterimage
trigger1= !time
time=999
timegap=1
framegap=2
length=3
palcontrast=120,90,150
trans=add

[State 3305, end]
type=destroyself
trigger1= !animtime || root,stateno!=3300


;========================<MISOGI ILLUSIONS>=============================
[Statedef 4104]
physics=N
anim=9741
[State 4111, assert]
type=assertspecial
trigger1= 1
flag=invisible

[State 4104, dust]
type=explod
trigger1= !time
anim=4110
ID=4110
sprpriority=-1
postype=p1
pos=0,0
vel=0,0
removetime=-2
ownpal=1
[State 4104, particles]
type=explod
trigger1= time=[1,16]
vel=0,-ceil(random/200)
accel=0,-.3
anim=4111
sprpriority=-1
postype=p1
pos=-2,-45
random=50,50
facing=-1+(random<500)*2
removetime=-2
ownpal=1
scale=.25,.25
pausemovetime=300
supermovetime=300

[State 4104, illusion]
type=null;explod
trigger1= !time
anim=4104
ID=4104
sprpriority=-1
vel=3,0
accel=-.1,0
removetime=60
[State 4104, illusion]
type=null;explod
trigger1= !time
anim=4104
ID=4104
sprpriority=-1
vel=-3,0
accel=.1,0
removetime=60

[State 4104, fade]
type=palfx
trigger1= !time
mul=200,0,256
sinadd=-255,-255,-255,240
time=60

[State 4104, end]
type=destroyself
trigger1= time>=60


;========================<AURA>=============================
[Statedef 6000]
physics=N
velset=0,0
anim=6000
sprpriority=-2
[State 6000, trans]
type=trans
trigger1= 1
trans=addalpha
alpha=256,256
ignorehitpause=1
[State 6000, var]
type=varset
trigger1= !time
var(0)=root,anim
[State 6000, image]
type=afterimage
trigger1= !time
time=999
timegap=1
framegap=1
length=2
palcontrast=100,100,100
trans=add
[State 6000, bind]
type=bindtoroot
trigger1= 1
[State 6000, end]
type=destroyself
trigger1= (root,anim)!=var(0)
trigger2= root,stateno=195 && root,animelemtime(19)>=0
trigger3= root,stateno=182 && root,animelemtime(26)>=0
trigger4= root,stateno=1020 && root,animelemtime(9)>=0
trigger5= root,stateno=1400 && root,animelemtime(5)>=0
trigger6= root,stateno=3020 && root,anim=3020 && root,animelemtime(22)>=0
trigger7= root,stateno=193 && root,anim=193 && root,animelemtime(39)>=0


;========================<METSU>=============================
[Statedef 6002]
physics=N
velset=0,-.5
anim=6002
sprpriority=-1
[State 6002, trans]
type=trans
trigger1= 1
trans=addalpha
alpha=256,256
ignorehitpause=1
[State 6002, image]
type=afterimage
trigger1= !time
time=999
timegap=1
framegap=1
length=2
palcontrast=120,90,150
trans=add
[State 6002, image]
type=velset
trigger1= animelem=6
y=-3
[State 6002, fade]
type=palfx
trigger1= animelem=7
sinadd=-255,-255,-255,64
time=16

[State 6002, bind]
type=posset
trigger1= root,stateno=195 && root,movetype!=H
x= ceil(root,pos x) + ifelse(root,facing=-1, 5, -5)

[State 6002, end]
type=destroyself
trigger1= !animtime || root,movetype=H


;========================<FIRE>=============================
;---PURPLE---
[Statedef 7181]
physics=N
velset=0,0
anim=9741
sprpriority=4
[State 7181, assert]
type=assertspecial
trigger1= 1
flag=noshadow
ignorehitpause=1
[State 7181, flames]
type=explod
trigger1= 1
anim=7181
ID=7181
sprpriority=3
postype=p2
vel=-.2,-.75
pos=(enemynear,const(size.mid.pos.x)),(enemynear,const(size.mid.pos.y))+10
random=40,40
removetime=-2
scale=.5,.5
ownpal=1
[State 7181, pos]
type=posadd
trigger1= 1
x=ceil(p2dist x)
y=ceil(p2dist y)
[State 7181, end]
type=destroyself
trigger1= time>=120
trigger2= enemynear,ctrl || (enemynear,movetype!=H) || (enemynear,statetype=L)


;========================<SUPERCHARGE>=============================
[Statedef 7500]
physics=N
velset=0,0
anim=9741

[State 7500, bgpalfx1]
type=bgpalfx
trigger1= !time && root,var(10)=5
time=40
invertall=1
add=100,100,100
sinadd=-710,-710,-355,160
[State 7500, bgpalfx1]
type=bgpalfx
trigger1= time=40 && root,var(10)=5
time=5
add=-255,-255,-255
sinadd=255,255,255,20

[State 7500, bgpalfx1]
type=bgpalfx
trigger1= !time && root,var(10)=6
time=48
invertall=1
add=100,100,100
sinadd=-710,-710,-355,192
[State 7500, bgpalfx1]
type=bgpalfx
trigger1= time=48 && root,var(10)=6
time=5
add=-255,-255,-255
sinadd=255,255,255,20

[State 7500, bgpalfx1]
type=bgpalfx
trigger1= !time && root,var(10)=7
time=55
invertall=1
add=100,100,100
sinadd=-710,-710,-355,220
[State 7500, bgpalfx1]
type=bgpalfx
trigger1= time=55 && root,var(10)=7
time=5
add=-255,-255,-255
sinadd=255,255,255,20

[State 7500, fade]
type=palfx
trigger1= !time
time=40
sinadd=-255,-255,-255,160
[State 7500, fade]
type=palfx
trigger1= time=40
time=-1
add=-255,-255,-255

[State 7500, portrait]
type=helper
trigger1= !time && root,var(10)=7
helpertype=normal
stateno=7510
ID=7510
name="Super Charge Portrait"
postype=p1
supermovetime=300
ownpal=1

[State 7500, main]
type=explod
trigger1= !time
anim=7500
ID=7500
sprpriority=5
postype=p1
removetime=-1
supermovetime=300
ownpal=1
[State 7500, circle]
type=explod
trigger1= !time
anim=7501
ID=7501
sprpriority=5
postype=p1
removetime=43
supermovetime=300

[State 7500, circle]
type=explod
trigger1= !time
anim=7502
ID=75021
sprpriority=5
postype=p1
supermovetime=300
ownpal=1
[State 7500, circle]
type=explod
trigger1= time=7
anim=7502
ID=75022
sprpriority=5
postype=p1
supermovetime=300
ownpal=1
[State 7500, circle]
type=explod
trigger1= time=14
anim=7502
ID=75023
sprpriority=5
postype=p1
supermovetime=300
ownpal=1
[State 7500, circle]
type=explod
trigger1= time=21
anim=7502
ID=75024
sprpriority=5
postype=p1
supermovetime=300
ownpal=1
[State 7500, circle]
type=explod
trigger1= time=28
anim=7502
ID=75025
sprpriority=5
postype=p1
supermovetime=300
ownpal=1

[State 7500, shrink]
type=modifyexplod
trigger1= root,var(10)=5
ID=7500
scale=1.5-(.033*time),1.5-(.033*time)
[State 7500, shrink]
type=modifyexplod
trigger1= root,var(10)=6
ID=7500
scale=1.5-(.028*time),1.5-(.028*time)
[State 7500, shrink]
type=modifyexplod
trigger1= root,var(10)=7
ID=7500
scale=1.5-(.025*time),1.5-(.025*time)

[State 7500, shrink]
type=modifyexplod
trigger1= numexplod(7501)
ID=7501
scale=.25+(.075*time),.25+(.075*time)

[State 7500, shrink]
type=modifyexplod
trigger1= numexplod(75021)
ID=75021
scale=.25+(.0375*time),.25+(.0375*time)
[State 7500, shrink]
type=modifyexplod
trigger1= numexplod(75022)
ID=75022
scale=.25+(.0375*(time-7)),.25+(.0375*(time-7))
[State 7500, shrink]
type=modifyexplod
trigger1= numexplod(75023)
ID=75023
scale=.25+(.0375*(time-14)),.25+(.0375*(time-14))
[State 7500, shrink]
type=modifyexplod
trigger1= numexplod(75024)
ID=75024
scale=.25+(.0375*(time-21)),.25+(.0375*(time-21))
[State 7500, shrink]
type=modifyexplod
trigger1= numexplod(75025)
ID=75025
scale=.25+(.0375*(time-28)),.25+(.0375*(time-28))

[State 7500, noshadow]
type=assertspecial
trigger1= 1
flag=noshadow
flag2=invisible
ignorehitpause=1
[State 7500, safety]
type=removeexplod
trigger1= root,var(10)=5 && time>=46
trigger2= root,var(10)=6 && time>=54
trigger3= root,var(10)=7 && time>=61
[State 7500, end]
type=destroyself
trigger1= root,var(10)=5 && time>=46
trigger2= root,var(10)=6 && time>=54
trigger3= root,var(10)=7 && time>=61


;========================<Lv3 SUPERCHARGE PORTRAIT>=============================
[Statedef 7510]
physics=N
anim=9741
[State 7510, assert]
type=assertspecial
trigger1= 1
flag=invisible
flag2=nobardisplay
ignorehitpause=1
[State 7510, portrait]
type=explod
trigger1= !time
anim=7510
ID=7510
postype=back
pos=160,120
under=1
bindtime=-1
removetime=60
pausemovetime=300
supermovetime=300
[State 7510, shrink]
type=modifyexplod
trigger1= time<45
ID=7510
scale=.5,.5
[State 7510, shrink]
type=modifyexplod
trigger1= time>=45
ID=7510
scale=.5225+(.13*(time-45)),.5225+(.13*(time-45))
[State 7510, fade]
type=palfx
trigger1= time=45
time=15
sinadd=-255,-255,-255,60
[State 7510, safety]
type=removeexplod
trigger1= time>=61
[State 7510, end]
type=destroyself
trigger1= time>=61


;========================<THE WORLD IS SAFE>=============================
[Statedef 7680]
physics=N
anim=9741

[State 7680]
type=varset
trigger1=!time
var(1)=root,var(48)
[State 7680]
type=destroyself
trigger1=!var(1)

[State 7680]
type=pause
trigger1=1
time=3
movetime=3

[State 7680]
type=bgpalfx
trigger1=1
time=2
color=0
[State 7680]
type=allpalfx
trigger1=1
time=2
color=0

[State 7680]
type=assertspecial
trigger1=1
flag=roundnotover
flag2=nomusic

[State 7680]
type=stopsnd
trigger1=time<=1
channel=-1
[State 7680]
type=playsnd
trigger1=time=1
value=8,var(1)
channel=0

[State 7680]
type=destroyself
trigger1= var(1)=1 && time>=540
trigger2= var(1)=2 && time>=360
trigger3= var(1)=3 && time>=360
trigger4= var(1)=4 && time>=180
trigger5= var(1)=5 && time>=180
trigger6= var(1)=6 && time>=420
trigger7= var(1)=7 && time>=180


;========================<POWER CHARGE>=============================
;-----<MAIN FX>-----
[Statedef 7240]
physics=N
anim=7240
sprpriority=-2
[State 7240, bind]
type=bindtoroot
trigger1= (root,stateno=740) && (root,anim=740)
pos=-4,0
[State 7240, assert]
type=assertspecial
trigger1= 1
flag=noshadow
ignorehitpause=1

[State 7240, snd]
type=playsnd
trigger1= !time
value=7,4
channel=0
[State 7240, image]
type=afterimage
trigger1= !time
time=999
timegap=1
framegap=1
length=4
palmul=.5,.33,.25
palcontrast=120,120,120
trans=add

[State 7240, fx]
type=explod
trigger1= !numexplod(7242)
anim=7242
ID=7242
sprpriority=4
postype=p1
bindtime=-1
removetime=-1
[State 7240, fx]
type=modifyexplod
trigger1= 1
ID=7242
scale=.5,.1+.00022*(root,power)
[State 7240, fx]
type=modifyexplod
trigger1= root,power>=3000
ID=7242
scale=.5,.75

[State 7240, fx]
type=helper
trigger1= anim=7240 && !(time%7) && numhelper(7243)<8
helpertype=normal
stateno=7243
ID=7243
name="Power Particle"
postype=p1;left
pos=ceil(240-random/2.1),-ceil(random/4)
size.xscale=.5
size.yscale=.5
ownpal=1

[State 7240, anim]
type=changeanim
trigger1= anim=7240 && ((root,stateno!=740) || (root,anim!=740))
value=7241
elem=animelemno(0)
[State 7240, stopsnd]
type=stopsnd
trigger1= anim=7241
channel=0
persistent=0
[State 7240, fade]
type=palfx
trigger1= anim=7241
sinadd=-255,-255,-255,64
time=17
persistent=0
[State 7240, remove]
type=removeexplod
trigger1= anim=7241 && !animtime
[State 7240, end]
type=destroyself
trigger1= anim=7241 && !animtime


;-----<PARTICLES>-----
[Statedef 7243]
physics=N
anim=7243
sprpriority=4
[State 7243, assert]
type=assertspecial
trigger1= 1
flag=noshadow
[State 7243, assert]
type=assertspecial
trigger1= !time
flag=invisible
[State 7243, fade]
type=palfx
trigger1= !time
add=-255,-255,-255
sinadd=300,300,300,240
time=56
[State 7243, vel]
type=velset
trigger1= !time
x=(rootdist x-4)/60
y=(rootdist y-55)/60
[State 7243, end]
type=destroyself
trigger1= time>=56
trigger2= (root,stateno!=740) || (root,anim!=740)


;========================<CAMERA CONTROL>=============================
[Statedef 7650]
physics=N
velset=0,0
anim=9741
[State 7650, bound]
type=screenbound
trigger1= 1
value=0
movecamera=1,1
[State 7650, end]
type=destroyself
trigger1= roundstate=2
