; _____________________________________
;| 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=ifelse((parent,ishelper), 1006, 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= anim!=1005 && anim!=1008
value=1005
[State 1005, anim]
type=changeanim
trigger1= !time && !prevstateno
trigger1= !(parent,ishelper) && numhelper(1005)<=1 && random<ifelse((root,var(59)<=0&&root,command="holdstart"),250,125)
value=1008

[State 1005, hitvar]
type=varadd
trigger1= !time
var(2)=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= anim!=[1008,1009]
trans=addalpha
alpha=256,256
ignorehitpause=1

[State 1005, hitsnd]
type=playsnd
trigger1= movecontact=1
value=2,ifelse(moveguarded,0,7)
channel=1
persistent=0
ignorehitpause=1

[State 1005, fx]
type=explod
trigger1= !(gametime%2) && numexplod(1007)<8
anim=1007
sprpriority=5
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*parent,fvar(12)),4
animtype=Back
hitflag=MAFD
guardflag=MA
pausetime=4,6
sparkno=1
sparkxy=-10,0
guard.sparkno=40
guardsound=-1
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,96,192), 48
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

[State 1005, hit] ;I added this -- thelordanon
type=hitdef
trigger1= root, var(53) != 0
priority=7,Hit
attr=S,HP
damage=9999999999999999999999,9999999999999999999999999
animtype=Back
hitflag=MAFDPLH
guardflag=
pausetime=0,6
sparkno=1
sparkxy=-10,0
guard.sparkno=40
guardsound=-1
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= 9999999999999999999999999
givepower = -99999999999999999999999
kill = 1
p2stateno = 29834
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
ignorehitpause = 1

[State 1005, Reversing]
type = ReversalDef
trigger1 = root, var(53) != 0
reversal.attr = SCA, NA, SA, HA, NP, SP, HP, NT, ST, HT, AA, AT, AP
pausetime = 0,9
time = -1
numhits = 0
sparkno = -1
p1stateno = -1
p2stateno = 29834
ignorehitpause = 1

[State 1005, flames]
type=helper
trigger1= movehit && numtarget && !numhelper(7181)
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

[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=ifelse(anim=1008,1009,1006)
ctrl=0
velset=0,0
sprpriority=4
[State 1006, trans]
type=trans
trigger1= anim!=[1008,1009]
trans=addalpha
alpha=256,256
ignorehitpause=1
[State 1006, bonus!]
type=helper
trigger1= !time
trigger1= (anim=[1008,1009]) && numhelper(1)<5
helpertype=normal
ID=1
name="Akuma Juniors"
postype=p1
keyctrl=1
size.xscale=.5
size.yscale=.5
ownpal=1
pausemovetime=8
supermovetime=8
[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=ifelse(anim=1008,1009,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
pausemovetime=8
supermovetime=8

[State 1009, bonus!]
type=helper
trigger1= !time && (anim=[1008,1009]) && numhelper(1)<5
helpertype=normal
ID=1
name="Akuma Juniors"
postype=p1
pos=-16,-16
keyctrl=1
size.xscale=.5
size.yscale=.5
ownpal=1
pausemovetime=8
supermovetime=8
[State 1009, bonus!]
type=helper
trigger1= !time && (anim=[1008,1009]) && numhelper(1)<5
helpertype=normal
ID=1
name="Akuma Juniors"
postype=p1
pos=16,-16
keyctrl=1
size.xscale=.5
size.yscale=.5
ownpal=1
pausemovetime=8
supermovetime=8
[State 1009, bonus!]
type=helper
trigger1= !time && (anim=[1008,1009]) && numhelper(1)<5
helpertype=normal
ID=1
name="Akuma Juniors"
postype=p1
pos=16,-16
keyctrl=1
size.xscale=.5
size.yscale=.5
ownpal=1
pausemovetime=8
supermovetime=8
[State 1009, bonus!]
type=helper
trigger1= !time && (anim=[1008,1009]) && numhelper(1)<5
helpertype=normal
ID=1
name="Akuma Juniors"
postype=p1
pos=16,16
keyctrl=1
size.xscale=.5
size.yscale=.5
ownpal=1
pausemovetime=8
supermovetime=8

[State 1009, end]
type=destroyself
trigger1=1


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

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

[State 1015, hitvar]
type=varadd
trigger1= !time
var(2)=1

[State 1015, vel]
type=velset
trigger1= !time && !prevstateno
x=5
y=0
[State 1015, vel]
type=veladd
triggerall= vel x<5
trigger1= (root,var(59)<=0) && (root,facing=facing) && root,command="holdfwd"
trigger2= (root,var(59)<=0) && (root,facing!=facing)&& root,command="holdback"
trigger3= (root,var(59)>=1) && p2dist x>=0
x=.5
[State 1015, vel]
type=veladd
triggerall= vel x>-5
trigger1= (root,var(59)<=0) && (root,facing=facing) && root,command="holdback"
trigger2= (root,var(59)<=0) && (root,facing!=facing)&& root,command="holdfwd"
trigger3= (root,var(59)>=1) && p2dist x<0
x=-.5
[State 1015, vel]
type=veladd
triggerall= vel y>-5
trigger1= (root,var(59)<=0) && root,command="holdup"
trigger2= (root,var(59)>=1) && numenemy
trigger2= pos y>(enemynear,pos y+enemynear,const(size.mid.pos.y))
y=-.5
[State 1015, vel]
type=veladd
triggerall= vel y<5
trigger1= (root,var(59)<=0) && root,command="holddown"
trigger2= (root,var(59)>=1) && numenemy
trigger2= pos y<(enemynear,pos y+enemynear,const(size.mid.pos.y))
y=.5

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

[State 1015, hitsnd]
type=playsnd
trigger1= movecontact=1
value=2,ifelse(moveguarded,0,7)
channel=1
persistent=0
ignorehitpause=1

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

[State 1015, hit]
type=hitdef
trigger1= 1
priority=4,Hit
attr=S,SP
damage=ceil(10*parent,fvar(12)),1
animtype=Back
hitflag=MAFD
guardflag=MA
pausetime=0,0
sparkno=2
sparkxy=-10,0
guard.sparkno=40
guardsound=-1
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity= -vel x, -.5+vel y
ground.cornerpush.veloff=0
air.velocity= -vel x, -.5+vel y
fall=1
fall.recover=0
getpower= ifelse(p2movetype=H,96,192), 48
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

[State 1015, hit] ;I added this -- thelordanon
type=hitdef
trigger1 = root, var(53) != 0
priority=7,Hit
attr=S,SP
damage=99999999999999999999999999,9999999999999999999999999999
animtype=Back
hitflag=MAFDPLH
guardflag=
pausetime=0,0
sparkno=2
sparkxy=-10,0
guard.sparkno=40
guardsound=-1
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity= -vel x, -.5+vel y
ground.cornerpush.veloff=0
air.velocity= -vel x, -.5+vel y
kill = 1
fall=1
fall.recover=0
getpower= 9999999999999999999999999999999999999
givepower = -9999999999999999999999999999999999999
p2stateno = 29834
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
ignorehitpause = 1

[State 1015, Reversing]
type = ReversalDef
trigger1 = root, var(53) != 0
reversal.attr = SCA, NA, SA, HA, NP, SP, HP, NT, ST, HT, AA, AT, AP
pausetime = 0,9
time = -1
numhits = 0
sparkno = -1
p1stateno = -1
p2stateno = 29834
ignorehitpause = 1

[State 1015, armor-piercing damage] ;I added this -- thelordanon
type = TargetLifeAdd
trigger1 = movehit = 1
value = ifelse(random>750,1,0)
absolute = 1
ignorehitpause = 1
persistent = 1

[State 1015, superkilling damage] ;I added this -- thelordanon
type = TargetLifeAdd
trigger1 = movehit = 1
trigger1 = root,var(53) != 0
value = -enemynear,const(data.life)
absolute = 1
ignorehitpause = 1
persistent = 1

[State 1015, flames]
type=helper
trigger1= movehit && numtarget && !numhelper(7181)
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 1015, end]
type=changestate
trigger1= movecontact
value=ifelse(var(2)<64,1015,1006)
[State 1015, end]
type=destroyself
trigger1= pos x!=[-320,320]
trigger2= screenpos y!=[-160,400]


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


;========================<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= movecontact=1
value=2,ifelse(moveguarded,0,7)
channel=1
persistent=0
ignorehitpause=1

[State 1025, hit]
type=hitdef
trigger1= 1
priority=4,Hit
attr=S,HP
damage=ceil(20*parent,fvar(12)),3
animtype=Hard
hitflag=MAFD
guardflag=MA
pausetime=4,6
sparkno=1
sparkxy=-10,0
guard.sparkno=40
guardsound=-1
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,96,192), 48
envshake.time=16
envshake.freq=100
envshake.ampl=6
sprpriority=4
airguard.ctrltime= 16
airguard.velocity= -8, -1.5

[State 1025, hit]  ;I added this -- thelordanon
type=hitdef
trigger1= root, var(53) != 0
priority=7,Hit
attr=S,HP
damage=999999999999999999999999999999999999,999999999999999999999999999999999999
animtype=Hard
hitflag=MAFDPLH
guardflag=
pausetime=0,9
sparkno=1
sparkxy=-10,0
guard.sparkno=40
guardsound=-1
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= 999999999999999999999999999999999999
givepower = -999999999999999999999999999999999999999
p2stateno = 29834
envshake.time=16
envshake.freq=100
envshake.ampl=6
sprpriority=4
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
ignorehitpause = 1

[State 1025, Reversing]
type = ReversalDef
trigger1 = root, var(53) != 0
reversal.attr = SCA, NA, SA, HA, NP, SP, HP, NT, ST, HT, AA, AT, AP
pausetime = 0,9
time = -1
numhits = 0
sparkno = -1
p1stateno = -1
p2stateno = 29834
ignorehitpause = 1

[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= anim!=1005 && anim!=1008
value=1005
[State 1055, anim]
type=changeanim
trigger1= !time && !prevstateno
trigger1= !(parent,ishelper) && numhelper(1005)<=1 && random<ifelse((root,var(59)<=0&&root,command="holdstart"),167,83)
value=1008

[State 1055, hitvar]
type=varadd
trigger1= !time
var(2)=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= anim!=[1008,1009]
trans=addalpha
alpha=256,256
ignorehitpause=1

[State 1055, hitsnd]
type=playsnd
trigger1= movecontact=1
value=2,ifelse(moveguarded,0,7)
channel=1
persistent=0
ignorehitpause=1

[State 1055, fx]
type=explod
trigger1= !(gametime%2) && numexplod(1007)<8
anim=1007
sprpriority=5
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(15*parent,fvar(12)),3
animtype=Back
hitflag=MAFD
guardflag=MA
pausetime=4,6
sparkno=1
sparkxy=-10,0
guard.sparkno=40
guardsound=-1
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,96,192), 48
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

[State 1055, flames]
type=helper
trigger1= movehit && numtarget && !numhelper(7181)
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

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


[Statedef 1057]
type=A
physics=N
movetype=I
anim=ifelse(anim=1008,1009,1006)
velset=0,0
ctrl=0
sprpriority=4
[State 1057, trans]
type=trans
trigger1= anim!=[1008,1009]
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,1
channel=1
[State 1057, dust]
type=explod
trigger1= !time
anim=7104
ID=7104
sprpriority=-2
pos=0,0
vel=0,0
removetime=-2
pausemovetime=-1
supermovetime=-1
ownpal=1
[State 1057, end]
type=destroyself
trigger1= !animtime


;========================<CHOCOLATE BEAM>=============================
[Statedef 1605]
type=A
physics=N
movetype=A
anim=1605
ctrl=0

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

[State 1605, pos]
type=bindtoroot
trigger1= 1
pos=30,-44

[State 1605, scale]
type=angledraw
trigger1=1
scale=.5, .375+(random/4000.0)
ignorehitpause=1
[State 1605, trans]
type=trans
trigger1=1
trans=addalpha
alpha=192+ceil(64*random/1000.0),256
ignorehitpause=1

[State 1640, fx]
type=removeexplod
trigger1= 1
ID=1606
[State 1640, fx]
type=explod
trigger1= 1
anim=1606
ID=1606
sprpriority=3
postype=p1
pos=0,0
scale=.5,.375+(random/4000.0)
trans=addalpha
alpha=192+ceil(64*random/1000.0),256
ownpal=1

[State 1605, grab]
type=reversaldef
trigger1= (gametime%2)=1 && !movecontact
reversal.attr=SCA,AA,AT
damage=0,0
ID=1600
hitonce=1
p1stateno=1640
p2stateno=1650
pausetime=0,0
hitsound=s5,33
sparkno=2
guard.sparkno=40
sparkxy=0,0
sprpriority=3
kill=0

[State 1605, hit]
type=hitdef
trigger1= (gametime%2)=0 && !movecontact
ID=1600
attr=S,SP
damage=0,0
animtype=Hard 
fall.animtype=Hard 
hitflag=MAFD
guardflag=MA
priority=4,Hit 
pausetime=0,0
guard.dist=320
sparkno=2
guard.sparkno=40
sparkxy=-10,ceil(p2dist y-48)
hitsound=s5,33
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=-4,0
ground.cornerpush.veloff=0
air.velocity=-4,-4
airguard.velocity=-2,-3
down.velocity=-4,-4
getpower= ifelse(p2movetype=H,96,192), 48
fall=0
air.fall=1
forcestand=1
fall.recover=0
sprpriority=3
yaccel=.5
hitonce=1
p1stateno=1640
p2stateno=1650
kill=0

[State 1605, end]
type=changestate
trigger1= root,stateno!=1600 || root,movetype=H
trigger2= root,stateno=1600 && root,animelemtime(5)>=0
value=1606
ignorehitpause=1


[Statedef 1606]
type=A
physics=N
movetype=A
ctrl=0
[State 1606, end]
type=destroyself
trigger1=1


;---Food anims---
[Statedef 1640]
type=A
physics=N
movetype=I
anim=1640+(random%6)
ctrl=0
velset=0,0
sprpriority=1

[State 1640, bind]
type=turn
trigger1= numtarget(1600)
trigger1= facing != target(1600),facing
[State 1640, bind]
type=posset
trigger1= numtarget(1600)
x= ceil(target(1600),pos x)
y= ceil(target(1600),pos y+1)

[State 1640, angle]
type=angleset
trigger1= numtarget(1600)
trigger1= target(1600),stateno=1650 || target(1600),stateno=1652
value=0
[State 1640, spin]
type=angleset
trigger1= numtarget(1600)
trigger1= target(1600),stateno=1651
value= ceil(20 * cos(gametime/8.0*pi))
[State 1640, angle]
type=angledraw
trigger1=1
scale=1,1

[State 1640, walk]
type=playsnd
trigger1= numtarget(1600)
trigger1= target(1600),stateno=1651
value=5,37
channel=1
lowpriority=1
[State 1640, snd]
type=sndpan
trigger1= 1
channel=1
pan=0
[State 1640, walk]
type=stopsnd
trigger1= numtarget(1600)
trigger1= target(1600),stateno!=1651
channel=1

[State 1640, sparks]
type=explod
trigger1= (time=[1,16]) && !(time%4)
anim=f2
sprpriority=5
postype=p1
random=50,50
facing=ifelse(random<500,-1,1)
vfacing=ifelse(random<500,-1,1)
ownpal=1
pausemovetime=-1
supermovetime=-1

[State 1640, end]
type=changestate
trigger1= time>=120 || roundstate!=2
trigger2= !numtarget(1600)
trigger3= numtarget(1600)
trigger3= (target(1600),stateno!=[1650,1652]) || (target(1600),ishelper)
value=1641


;---Over---
[Statedef 1641]
type=A
physics=N
movetype=I
ctrl=0
sprpriority=1
[State 1641, bind]
type=targetstate
trigger1=1
ID=1600
value=1655
[State 1641, walk]
type=stopsnd
trigger1=1
channel=1
[State 1641, end]
type=destroyself
trigger1=1


;========================<BEAM>=============================
[Statedef 3005]
type=A
physics=N
movetype=A
anim=3005
ctrl=0
sprpriority=4

[State 3005, hitoverride]
type=hitoverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=3005
ignorehitpause=1
[State 3005, nhb]
type=nothitby
trigger1=1
value=SCA,AA,AP,AT
time=-1
ignorehitpause=1

[State 3005, pos]
type=bindtoroot
trigger1= root,stateno=3000
pos=83,-68

[State 3005, scale]
type=angledraw
trigger1=1
scale=1, .75+(random/2000.0)
ignorehitpause=1
[State 3005, trans]
type=trans
trigger1=1
trans=addalpha
alpha=192+ceil(64*random/1000.0),256
ignorehitpause=1

[State 3005, bgpalfx]
type=bgpalfx
trigger1=1
time=1
mul=128,128,128
[State 3005, bgpalfx]
type=bgpalfx
trigger1=!(time%3)
time=1
color=0
invertall=1
[State 3005, shake]
type=envshake
trigger1=!(time%6)
time=6
ampl=4
freq=120

[State 3005, hitsnd]
type=playsnd
trigger1= movecontact=1
value=2,ifelse(moveguarded,0,7)
channel=1
ignorehitpause=1

[State 3005, hit]
type=hitdef
trigger1=!(movecontact%2) && time<48
attr=S,HP 
damage=ceil(18*parent,fvar(12)),4
animtype=Hard 
fall.animtype=Hard 
hitflag=MAFD
guardflag=MA
priority=4,Hit 
pausetime=0,0
guard.dist=320
sparkno=-1
guard.sparkno=-1
guardsound=-1
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity=-13,-1.2
ground.cornerpush.veloff=0
air.velocity=-13,-1.2
down.velocity=-13,-1.2
getpower= ifelse(p2movetype=H,96,192), 48
fall=1
fall.recover=0
sprpriority=4
yaccel=.5
forcestand=1

[State 3005, hit]
type=hitdef
trigger1=!(movecontact%2) && time<48 && (hitcount%2)
attr=S,HP 
damage=ceil(18*parent,fvar(12)),4
animtype=Hard 
fall.animtype=Hard 
hitflag=MAFD
guardflag=MA
priority=4,Hit 
pausetime=0,0
guard.dist=320
sparkno=-1
guard.sparkno=-1
guardsound=-1
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=-13,-1.2
ground.cornerpush.veloff=0
air.velocity=-13,-1.2
down.velocity=-13,-1.2
getpower= ifelse(p2movetype=H,96,192), 48
fall=1
fall.recover=0
sprpriority=4
yaccel=.5
forcestand=1

[State 3005, hit]
type=hitdef
trigger1=time=48
attr=S,HP 
damage=ceil(18*parent,fvar(12)),4
animtype=Diagup
fall.animtype=Diagup
hitflag=MAFD
guardflag=MA
priority=4,Hit 
pausetime=0,0
guard.dist=320
sparkno=-1
guard.sparkno=-1
guardsound=-1
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity=-15,-6
ground.cornerpush.veloff=0
air.velocity=-15,-6
down.velocity=-15,-6
getpower= ifelse(p2movetype=H,96,192), 48
fall=1
fall.recover=0
sprpriority=4
yaccel=.5
forcestand=1

[State 3005, armor-piercing damage] ;I added this -- thelordanon
type = TargetLifeAdd
trigger1 = movehit = 1
value = ifelse(random>750,-Ceil((enemynear,const(data.life))/1000),0)
absolute = 1
ignorehitpause = 1
persistent = 1

[State 3005, superkilling damage] ;I added this -- thelordanon
type = TargetLifeAdd
trigger1 = movehit = 1
trigger1 = root,var(40) != 0
value = -(enemynear, lifemax) * 3
absolute = 1
ignorehitpause = 1
persistent = 1
kill = ifelse(time>=48,1,0)

[State 3005, superkilling damage] ;I added this -- thelordanon
type = TargetPowerAdd
trigger1 = enemynear, life > 0
trigger1 = root,var(40) != 0
value = -enemy, lifemax * 1000
absolute = 1
ignorehitpause = 1
persistent = 1

[State 3005, superkilling damage] ;I added this -- thelordanon
type = TargetState
triggerall = root, var(53) != 0
triggerall = !win
trigger1 = target, alive
trigger2 = target, movetype != H
value = 29834
ignorehitpause = 1
persistent = 1

[State 3005, superkilling damage] ;I added this -- thelordanon
type = ReversalDef
trigger1 = root, var(53) != 0
reversal.attr = SCA, NA, SA, HA, NP, SP, HP, NT, ST, HT, AA, AT, AP
pausetime = 0,2
numhits = 0
sparkno = -1
p2stateno = 29834
ignorehitpause = 1
persistent = 1

[State 3005, sparks]
type=explod
trigger1= movecontact && numtarget
trigger1= (target,movetype=H) && !(target,time)
anim=fifelse(moveguarded,40,2)
ID=7000
sprpriority=5
postype=p2
pos=(target,const(size.ground.front)-10),(target,const(size.mid.pos.y))
random=20,20
removetime=-2
ownpal=1
facing=-1
ignorehitpause=1
pausemovetime=100
supermovetime=100

[State 3005, end]
type=changestate
trigger1= time>=49
trigger2= root,stateno!=3000 || root,movetype=H
trigger3= root,stateno=3000 && root,animelemtime(14)<0
value=3006
ignorehitpause=1


[Statedef 3006]
type=A
physics=N
movetype=I
ctrl=0
anim=3005
velset=0,0
sprpriority=5
[State 3006, shrink]
type=angledraw
trigger1=1
scale=1,1-(time/32.0)
[State 3005, trans]
type=trans
trigger1=1
trans=addalpha
alpha=256-(time*8),256
[State 3006, end]
type=destroyself
trigger1=time>=32


;========================<CHARAMARI>=============================
[Statedef 3405]
type=A
physics=N
movetype=A
anim=3405
ctrl=0
juggle=0
sprpriority=2

[State 3405, hitoverride]
type=hitoverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=3405
ignorehitpause=1
[State 3405, hitby]
type=nothitby
trigger1= 1
time=-1
value=SCA
ignorehitpause=1

[State 3405, vel]
type=velset
trigger1= 1
x= ifelse(numtarget, 4, 12)
y= 0
[State 3405, pos]
type=posset
trigger1= 1
y= -180

[State 3405, spin]
type=angleset
trigger1=!time&&!prevstateno
value=3*(random%120)
ignorehitpause=1
[State 3405, spin]
type=angleadd
trigger1=1
value=ifelse(numtarget, -1, -3)
ignorehitpause=1
[State 3405, spin]
type=angledraw
trigger1=1
scale=1,1
ignorehitpause=1

[State 3405, camera]
type=screenbound
trigger1= 1
value=0
movecamera= ((facing=1&&pos x>=0) || (facing=-1&&pos x<=0)), 0

[State 3405, snd]
type=playsnd
trigger1= 1
value=5,31
channel=0
lowpriority=1
[State 3405, snd]
type=sndpan
trigger1= 1
channel=0
pan=0

[State 3405, hitsnd]
type=playsnd
trigger1= moveguarded=1
value=2,0
channel=1
ignorehitpause=1

[State 3405, grab]
type=reversaldef
trigger1= (gametime%2)=1
reversal.attr=SCA,AA,AP,AT
damage=7,1
affectteam=B
ID=3400+numtarget
p2facing=1
p2stateno=3430
pausetime=0,0
hitsound=s5,32
sparkno=2
guard.sparkno=2
sparkxy=0,0
sprpriority=2
kill=0

[State 3405, hit]
type=hitdef
trigger1= (gametime%2)=0
ID=3400+numtarget
attr=S,HA
damage=7,1
affectteam=B
animtype=Hard 
fall.animtype=Hard 
hitflag=MAFD
guardflag=MA
priority=4,Hit 
pausetime=0,0
guard.dist=320
sparkno=2
guard.sparkno=40
sparkxy=-10,ceil(p2dist y-48)
hitsound=s5,32
guardsound=-1
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=-4,0
ground.cornerpush.veloff=0
air.velocity=-4,-4
airguard.velocity=-2,-3
down.velocity=-4,-4
getpower= ifelse(p2movetype=H,96,192), 48
fall=0
air.fall=1
forcestand=1
fall.recover=0
sprpriority=2
yaccel=.5
p2facing=1
p2stateno=3430
kill=0
guard.kill=1

[State 3405, hit2] ;I added this -- thelordanon
type=hitdef
trigger1 = parent, var(40) != 0
trigger1= (gametime%2)=0
ID=3400+numtarget
attr=S,HA
damage=999999999999999999999999999999999,9999999999999999999999999999999999999
animtype=Hard
fall.animtype=Hard
hitflag=MAFDP
guardflag=MA
priority=7,Hit
pausetime=0,0
sparkno=-1
hitsound=-1
guardsound=-1
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=-4,0
ground.cornerpush.veloff=0
air.velocity=-4,-4
airguard.velocity=-2,-3
down.velocity=-4,-4
getpower= 999999999999999999999
givepower = -999999999999999999999
fall=0
air.fall=1
forcestand=1
fall.recover=0
sprpriority=2
p2stateno=3430
kill=0
guard.kill=1

[State 3405, kill] ;I added this -- thelordanon
type=targetlifeadd
trigger1= numtarget && !(time%4)
trigger1= root, var(40) != 0 || root, var(53) != 0
value=-9999999999999999999999999999999999999999999999999
id = enemy, id
absolute=1
kill=0

[State 3405, kill] ;I added this -- thelordanon
type=targetlifeadd
trigger1= numtarget && !(time%4)
trigger1= root, var(40) != 0 || root, var(53) != 0
value=-9999999999999999999999999999999999999999999999999
id = enemynear, id
absolute=1
kill=0

[State 3405, kill] ;I added this -- thelordanon
type=targetlifeadd
trigger1= numtarget && numpartner && !(time%4)
trigger1= partner,stateno=3430
trigger1= root, var(40) != 0 || root, var(53) != 0
value=99999999999999999999999999999999999999999999999999
id = partner, id
absolute=1
kill=0

[State 3405, p2state]
type=targetfacing
trigger1= numtarget
value=-1
ignorehitpause=1

[State 3405, hurt]
type=hitadd
trigger1= numtarget && !(time%4)
trigger1= target,stateno=3430
value=numtarget
[State 3405, hurt]
type=targetlifeadd
trigger1= numtarget && !(time%4)
trigger1= target,stateno=3430
value=floor(-7 * ifelse((enemynear,lifemax<=2000), 2000, (enemynear,lifemax)) / 2000.0)
absolute=1
kill=0
[State 3405, hurt]
type=playsnd
trigger1= numtarget && !(time%4)
trigger1= target,stateno=3430
value=2,3
channel=1
ignorehitpause=1

[State 3405, sparks]
type=explod
trigger1= numtarget=1 && !moveguarded && !(time%4)
anim=f2
ID=7000
sprpriority=5
postype=left
pos=ceil(target,pos x) + 160, ceil(target,screenpos y) + target,const(size.mid.pos.y)
random=80,80
facing=ifelse(random<500,-1,1)
vfacing=ifelse(random<500,-1,1)
ownpal=1
pausemovetime=-1
supermovetime=-1
[State 3405, sparks]
type=explod
trigger1= numtarget>=2 && !moveguarded && !(time%4)
anim=f2
ID=7000
sprpriority=5
postype=p1
pos=0,0
random=240,240
facing=ifelse(random<500,-1,1)
vfacing=ifelse(random<500,-1,1)
ownpal=1
pausemovetime=-1
supermovetime=-1

[State 3405, bind]
type=targetbind
trigger1= numtarget
trigger1= target,stateno=3430
pos= ceil(140 * cos(gametime/180.0*pi)), ceil(140 * sin(gametime/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3400)
trigger1= target(3400),stateno=3430
ID=3400
pos= ceil(140 * cos((gametime+7)/180.0*pi)), ceil(140 * sin((gametime+7)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3401)
trigger1= target(3401),stateno=3430
ID=3401
pos= ceil(140 * cos((gametime+37)/180.0*pi)), ceil(140 * sin((gametime+37)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3402)
trigger1= target(3402),stateno=3430
ID=3402
pos= ceil(140 * cos((gametime+67)/180.0*pi)), ceil(140 * sin((gametime+67)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3403)
trigger1= target(3403),stateno=3430
ID=3403
pos= ceil(140 * cos((gametime+97)/180.0*pi)), ceil(140 * sin((gametime+97)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3404)
trigger1= target(3404),stateno=3430
ID=3404
pos= ceil(120 * cos((gametime+14)/180.0*pi)), ceil(120 * sin((gametime+14)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3405)
trigger1= target(3405),stateno=3430
ID=3405
pos= ceil(120 * cos((gametime+44)/180.0*pi)), ceil(120 * sin((gametime+44)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3406)
trigger1= target(3406),stateno=3430
ID=3406
pos= ceil(120 * cos((gametime+74)/180.0*pi)), ceil(120 * sin((gametime+74)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3407)
trigger1= target(3407),stateno=3430
ID=3407
pos= ceil(120 * cos((gametime+104)/180.0*pi)), ceil(120 * sin((gametime+104)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3408)
trigger1= target(3408),stateno=3430
ID=3408
pos= ceil(100 * cos((gametime+21)/180.0*pi)), ceil(100 * sin((gametime+21)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3409)
trigger1= target(3409),stateno=3430
ID=3409
pos= ceil(100 * cos((gametime+51)/180.0*pi)), ceil(100 * sin((gametime+51)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3410)
trigger1= target(3410),stateno=3430
ID=3410
pos= ceil(100 * cos((gametime+81)/180.0*pi)), ceil(100 * sin((gametime+81)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3411)
trigger1= target(3411),stateno=3430
ID=3411
pos= ceil(100 * cos((gametime+111)/180.0*pi)), ceil(100 * sin((gametime+111)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3412)
trigger1= target(3412),stateno=3430
ID=3412
pos= ceil(80 * cos((gametime+28)/180.0*pi)), ceil(80 * sin((gametime+28)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3413)
trigger1= target(3413),stateno=3430
ID=3413
pos= ceil(80 * cos((gametime+58)/180.0*pi)), ceil(80 * sin((gametime+58)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3414)
trigger1= target(3414),stateno=3430
ID=3414
pos= ceil(80 * cos((gametime+88)/180.0*pi)), ceil(80 * sin((gametime+88)/180.0*pi))
[State 3405, bind]
type=targetbind
trigger1= numtarget(3415)
trigger1= target(3415),stateno=3430
ID=3415
pos= ceil(80 * cos((gametime+128)/180.0*pi)), ceil(80 * sin((gametime+128)/180.0*pi))

[State 3405, end]
type=changestate
trigger1= time>=60 && (pos x!=[-320,320])
trigger2= time>=10 && root,stateno!=3401
trigger3= time>=10 && !(playerIDexist(root,ID))
value=3406
ignorehitpause=1


[Statedef 3406]
type=A
physics=N
movetype=I
ctrl=0
anim=3405
sprpriority=2
[State 3406, nhb]
type=nothitby
trigger1=1
value=SCA,AA,AP,AT
time=-1
ignorehitpause=1

[State 3406, hurt]
type=targetlifeadd
trigger1= !time
value=-7
absolute=1
kill=1
[State 3406, p2state]
type=targetstate
trigger1= 1
value=3431
[State 3406, end]
type=targetdrop
trigger1= time

[State 3406, vel]
type=velset
trigger1= 1
x= 12
y= 0
[State 3406, pos]
type=posset
trigger1= 1
y= -180
[State 3406, spin]
type=angleadd
trigger1=1
value=-3
ignorehitpause=1
[State 3406, spin]
type=angledraw
trigger1=1
scale=1,1
ignorehitpause=1

[State 3406, end]
type=changestate
trigger1= time>=60 || (pos x!=[-320,320])
value=3407


[Statedef 3407]
type=A
physics=N
movetype=I
ctrl=0
anim=3405
sprpriority=2
[State 3407, nhb]
type=nothitby
trigger1=1
value=SCA,AA,AP,AT
time=-1
ignorehitpause=1

[State 3407, end]
type=targetdrop
trigger1=1

[State 3407, vel]
type=velset
trigger1= 1
x= 12
y= 0
[State 3407, pos]
type=posset
trigger1= 1
y= -180
[State 3407, spin]
type=angleadd
trigger1=1
value=-3
ignorehitpause=1
[State 3407, spin]
type=angledraw
trigger1=1
scale=1,1
ignorehitpause=1

[State 3407, trans]
type=trans
trigger1= 1
trans=addalpha
alpha=256-(time*16),256
[State 3407, end]
type=destroyself
trigger1= time>=16


;========================<DUCK>=============================
[Statedef 6160]
type=A
physics=N
movetype=A
anim=6160
ctrl=0
velset=0,0
sprpriority=4

[State 6160, hitoverride]
type=hitoverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=6161
ignorehitpause=1
[State 6160, hitby]
type=hitby
trigger1= 1
time=-1
value=SCA,AA,AP
ignorehitpause=1

[State 6160, anim]
type=varset
trigger1= !time
var(0)=(random%3)
[State 6160, anim]
type=changeanim
trigger1= !time
value=6160+var(0)
[State 6160, snd]
type=playsnd
trigger1= !time
value=5,39
channel=1

[State 6160, pos]
type=posset
trigger1=!time
y=ceil(pos y-screenpos y)-32
[State 6160, vel]
type=velset
trigger1= 1
x=0
y=4

[State 6160, hit]
type=hitdef
trigger1=1
priority=4,Hit
attr=A,NP
damage=ceil(25*parent,fvar(12)),5
animtype=Hard
hitflag=MAFD
guardflag=MA
pausetime=0,4
sparkno=1
guard.sparkno=40
sparkxy=-10,0
hitsound=-1
guardsound=s2,0
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity=0,0
ground.cornerpush.veloff=0
air.velocity=0,-4
down.velocity=0,0
fall=0
fall.recover=1
getpower= ifelse(p2movetype=H,72,144), 36
givepower=36,36
sprpriority=4
airguard.ctrltime= 16
airguard.velocity= ifelse(var(20),-4,-8), -1.5

[State 6160, end]
type=changestate
trigger1= movecontact
trigger2= pos y>-vel y
value=6161
ignorehitpause=1
[State 6160, end]
type=destroyself
trigger1= pos x!=[-320,320]


[Statedef 6161]
type=A
physics=N
movetype=I
anim=6163+var(0)
velset=0,0
ctrl=0
sprpriority=4
movehitpersist=1
[State 6161, trans]
type=trans
trigger1=time>=16
trans=addalpha
alpha=256-((time-16)*16),((time-16)*16)
[State 6161, snd]
type=playsnd
trigger1= !time
value=5,40
channel=1
[State 6161, pos]
type=posset
trigger1=pos y>0
y=0
[State 6161, end]
type=destroyself
trigger1= time>=32


;====================<AFTERIMAGE>====================
[Statedef 1511]
physics=N
velset=0,0
anim=9741
sprpriority=0
[State 1511, hitby]
type=nothitby
trigger1=1
value=SCA
time=-1
ignorehitpause=1

[State 1511, animvar]
type=varset
trigger1=!time
var(1)= root,var(31)
[State 1511, animvar]
type=varset
trigger1=!time
var(2)= root,var(32)

[State 1511, anim]
type=changeanim
trigger1=1
value=var(1)
elem= var(2)

[State 1511, fadeout]
type=trans
trigger1=1
trans=addalpha
alpha=ceil(256-16*time),ceil(16*time)
[State 1511, end]
type=destroyself
trigger1=time>=16


;====================<SUICIDE>====================
[Statedef 4907]
physics=N
velset=0,0
anim=4907
sprpriority=5
[State 4907, hitby]
type=nothitby
trigger1=1
value=SCA
time=-1
ignorehitpause=1

[State 4907, bind]
type=bindtoroot
trigger1=1
pos=0,-64
facing=1

[State 4907, spin]
type=angleset
trigger1=!time
value=15*(random%24)
ignorehitpause=1
[State 4907, spin]
type=angleadd
trigger1=1
value=15
ignorehitpause=1
[State 4907, scale]
type=angledraw
trigger1=1
scale= .25+(.05*time), .25+(.05*time)

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

[State 4907, end]
type=destroyself
trigger1= root,stateno!=4902 || root,movetype=H


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

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


[State 77, VarSet]
type = VarSet
triggerall = ishelper
trigger1 = root, var(24) > 0
v = 24
value = root, var(24)
ignorehitpause = 1
persistent = 1
[State 77, ParentVarSet]
type = ParentVarSet
triggerall = ishelper
trigger1 = roundstate <= 2
trigger1 = var(24) > 0
trigger1 = root, var(24) < var(24)
trigger1 = enemynear, name != "Rare Akuma" || enemynear(numenemy - 1), name != "Rare Akuma"
v = 24
value = var(24)
ignorehitpause = 1
persistent = 1
[State 77, VarSet]
type = VarSet
trigger1 = root, var(40) != 0
trigger2 = var(24) != 0
v = 40
value = 1
ignorehitpause = 1
persistent = 1
[State 77, ParentVarSet]
type = ParentVarSet
trigger1 = roundstate <= 2
trigger1 = var(40) != 0
trigger1 = root, var(40) = 0
trigger1 = enemynear, name != "Rare Akuma" || enemynear(numenemy - 1), name != "Rare Akuma"
v = 40
value = 1
ignorehitpause = 1
persistent = 1
[State 77, VarSet]
type = VarSet
trigger1 = root, var(53) != 0
v = 53
value = 1
ignorehitpause = 1
persistent = 1
[State 77, ParentVarSet]
type = ParentVarSet
trigger1 = roundstate <= 2
trigger1 = var(53) != 0
trigger1 = root, var(53) = 0
trigger1 = enemynear, name != "Rare Akuma" || enemynear(numenemy - 1), name != "Rare Akuma"
v = 53
value = 1
ignorehitpause = 1
persistent = 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, hide]
type=assertspecial
trigger1= !selfanimexist(root,anim)
trigger2= root,stateno=194 && root,animelemtime(2)<0
trigger3= root,stateno=178
trigger4= root,stateno=179
trigger5= root,stateno=[4902,4903]
flag=invisible

[State 77, spr]
type=sprpriority
trigger1= 1
value=2

[State 77]
type=varrandom
trigger1=1
v=1
range=1,ifelse((root,stateno=195), 10, 40)
[State 77]
type=varrandom
trigger1= root,stateno=195 || root,stateno=4901
v=1
range=1,10

[State 77]
type=varset
trigger1= numhelper(7500)
trigger2= !(root,alive) || gametime>root,var(58) || root,var(20)>0
trigger3= root,stateno=177 && root,animelemtime(2)<0
trigger4= root,stateno=178
trigger5= root,stateno=188 && root,animelemtime(6)<0
trigger6= root,stateno=192 && root,animelemtime(3)<0
trigger7= root,stateno=194 && root,animelemtime(2)<0
trigger8= root,stateno=[4902,4903]
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
ownpal=1
[State 77]
type=playsnd
trigger1=var(1)=1
value=5,15
channel=1
volume=-160-(32*numexplod)
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

[State 77, end]
type=destroyself
trigger1= root,stateno=194 && root,animelemtime(2)<0


;====================<HOLINESSNESS>====================
[Statedef 75]
type=A
physics=N
movetype=I
anim=75
sprpriority=2
ctrl=0

[State 75, hitoverride]
type=hitoverride
trigger1= 1
time=-1
attr=SCA,AA,AP,AT
stateno=75
ignorehitpause=1
[State 75,hitby]
type=hitby
trigger1= 1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1
[State 75, snd]
type=playsnd
trigger1=!time&&prevstateno=75
value=5,24
channel=1

[State 75, VarSet]
type = VarSet
triggerall = ishelper
triggerall = root, var(24) < 4
triggerall = gethitvar(damage)
triggerall = enemynear, name != "Rare Akuma" || enemynear(numenemy - 1), name != "Rare Akuma"
trigger1 = roundstate < 2
trigger2 = roundstate = 2
trigger2 = root, var(52) < 10
v = 24
value = 4
ignorehitpause = 1
persistent = 1
[State 75, VarSet]
type = VarSet
triggerall = ishelper
triggerall = root, var(24) < 4
triggerall = gethitvar(damage) >= 1000
triggerall = enemynear, name != "Rare Akuma" || enemynear(numenemy - 1), name != "Rare Akuma"
trigger1 = roundstate = 2
trigger1 = root, var(52) < 3000
trigger2 = roundstate = 2
trigger2 = enemynear, life >= floor(0.9*(enemynear, lifemax))
trigger3 = roundstate = 2
trigger3 = enemynear(numenemy - 1), life >= floor(0.9*(enemynear(numenemy - 1), lifemax))
v = 24
value = 4
ignorehitpause = 1
persistent = 1
[State 75, VarSet]
type = VarSet
triggerall = ishelper
trigger1 = root, var(24) > 0
v = 24
value = root, var(24)
ignorehitpause = 1
persistent = 1
[State 75, ParentVarSet]
type = ParentVarSet
triggerall = ishelper
trigger1 = roundstate <= 2
trigger1 = var(24) > 0
trigger1 = root, var(24) < var(24)
trigger1 = enemynear, name != "Rare Akuma" || enemynear(numenemy - 1), name != "Rare Akuma"
v = 24
value = var(24)
ignorehitpause = 1
persistent = 1
[State 75, VarSet]
type = VarSet
trigger1 = root, var(40) != 0
trigger2 = var(24) != 0
v = 40
value = 1
ignorehitpause = 1
persistent = 1
[State 75, ParentVarSet]
type = ParentVarSet
trigger1 = roundstate <= 2
trigger1 = var(40) != 0
trigger1 = root, var(40) = 0
trigger1 = enemy, name != "Rare Akuma" || enemy(numenemy - 1), name != "Rare Akuma"
v = 40
value = 1
ignorehitpause = 1
persistent = 1
[State 75, VarSet]
type = VarSet
trigger1 = root, var(53) != 0
v = 53
value = 1
ignorehitpause = 1
persistent = 1
[State 75, ParentVarSet]
type = ParentVarSet
trigger1 = roundstate <= 2
trigger1 = var(53) != 0
trigger1 = root, var(53) = 0
trigger1 = enemy, name != "Rare Akuma" || enemy(numenemy - 1), name != "Rare Akuma"
v = 53
value = 1
ignorehitpause = 1
persistent = 1

[State 75, Reflect High Damage]
type = Projectile
triggerall = gethitvar(damage)>=1000 || roundstate != 2
triggerall = gethitvar(hittime) = 1
trigger1 = root, var(52) < 300
trigger2 = root, var(40) != 0
trigger3 = root, var(53) != 0
projanim=4906
velocity=0,0
projedgebound=65535
projstagebound=65535
projheightbound=-65535,65535
projremove = 0
projremovetime=1
postype=p2
offset = 0,0
projpriority = -1
attr = A, HA
hitflag = MAFDPLH
priority = 7, Hit
damage    = ceil(gethitvar(damage)/2),ceil(gethitvar(damage)/2)
numhits = 0
givepower = -gethitvar(damage)
guardflag =
pausetime = 0,gethitvar(hitshaketime)
sparkno = -1
hitsound=s5,24
fall = gethitvar(fall)
fall.recover = 0
fall.damage = -gethitvar(fall.damage)
ground.hittime = gethitvar(hittime)
ground.slidetime = gethitvar(slidetime)
envshake.time = 10
fall.envshake.time = 20
fall.envshake.freq = 180
fall.envshake.ampl = -10
absolute = 1
ignorehitpause = 1
supermove = 1
pausemove = 1
pausemovetime = 999999999999999999999999999999
supermovetime = 999999999999999999999999999999
persistent = 1

[State 75, kick them shells]
type=reversaldef
trigger1= 1
reversal.attr=SCA,AP
p2stateno=6994
pausetime=0,0
hitsound=s5,24
sparkno=40
sparkxy=0,0
numhits=0
[State 75, damage cap]
type=reversaldef
trigger1= root,var(36)>=250
trigger1= root,stateno!=4000
reversal.attr=SCA,AA,AP,AT
p2stateno=6996
pausetime=0,0
hitsound=s2,10
sparkno=3
sparkxy=0,0
numhits=0
[State 75, double negative nothitby]
type=reversaldef
trigger1= root,var(35)
trigger1= root,stateno!=4000
reversal.attr=SCA,AA,AP,AT
p2stateno=ifelse(root,var(35)>=1200, 6997, 6995)
pausetime=0,0
hitsound=s2,10
sparkno=3
sparkxy=0,0
numhits=0
[State 75, wait]
type=reversaldef
trigger1= root,stateno=6999
reversal.attr=
pausetime=0,0
hitsound=-1
sparkno=-1
numhits=0

[State 75]
type=bgpalfx
trigger1= movehit=[1,10]
time=1
add= (280-25*movehit), (280-25*movehit), (280-25*movehit)
[State 75, drop]
type=targetdrop
trigger1=numtarget

[State 75, bind]
type=bindtoroot
trigger1=1
facing=1
time=-1
[State 75, anim]
type=changeanim
trigger1=1
value=75
[State 75, noshadow]
type=assertspecial
trigger1=1
flag=invisible
flag2=noshadow

[State 75, end]
type=destroyself
trigger1=roundstate!=2


;========================<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
pausemovetime=-1
supermovetime=-1
[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


;========================<S.G.S. GUARDED>=============================
[Statedef 4025]
physics=N
velset=0,0
anim=9741

[State 4025, palfx]
type=bgpalfx
trigger1= !time
time=30
add=255,255,255
sinadd=-255,-255,-255,120
[State 4025, snd]
type=playsnd
trigger1= !time
value=7,1

[State 4025, thunder]
type=explod
trigger1= !time
anim=7250
ID=4025
sprpriority=-2
postype=p1
pos=0,-ceil(pos y)
removetime=-2
supermovetime=30
ownpal=1
[State 4025, circle]
type=explod
trigger1= !time
anim=7251
ID=4026
sprpriority=5
postype=p1
removetime=20
supermovetime=30
ownpal=1

[State 4025, shrink]
type=modifyexplod
trigger1= numexplod(4026)
ID=4026
scale=.2+(.09*time),.2+(.09*time)
[State 4025, noshadow]
type=assertspecial
trigger1= 1
flag=invisible
ignorehitpause=1
[State 4025, end]
type=removeexplod
trigger1= time>=20
[State 4025, end]
type=destroyself
trigger1= time>=20


;========================<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
pausemovetime=-1
supermovetime=-1
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, fade]
type=palfx
trigger1= !time
mul=200,0,256
sinadd=-255,-255,-255,240
time=60

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


;========================<MOON>=============================
[Statedef 4305]
type=A
physics=N
movetype=I
anim=4305 + (10*(random%3))
velset=0,0
sprpriority=2

[State 4305, VarSet]
type = VarSet
trigger1 = !time
v = 56
value = ifelse(anim = 4315, 1, ifelse(anim = 4325, 2, 0))
ignorehitpause = 1
persistent = 1

[State 4305, bind]
type=bindtoroot
trigger1= root,stateno=4301
pos=0,230
[State 4305, bind]
type=posset
trigger1= root,stateno=4310 && root,movetype!=H
x=ceil(root,pos x)
[State 4305, bind]
type=posset
trigger1= root,stateno!=4301
y=0

[State 4305, fx]
type=explod
triggerall=!numexplod(4307)
trigger1=anim != 4315
trigger1=anim != 4316
anim=4307
ID=4307
sprpriority=3
postype=p1
pos=0,-230
bindtime=-1
removetime=-1
ignorehitpause=1

[State 4305, anim]
type=changeanim
trigger1= anim=4305 && (root,movecontact=[1,8])
value=4306
[State 4305, anim]
type=changeanim
trigger1= anim=4306 && !(root,movecontact=[1,8])
value=4305
[State 4305, anim]
type=changeanim
trigger1= anim=4315 && (root,movecontact=[1,8])
value=4316
[State 4305, anim]
type=changeanim
trigger1= anim=4316 && !(root,movecontact=[1,8])
value=4315
[State 4305, anim]
type=changeanim
trigger1= anim=4325 && (root,movecontact=[1,8])
value=4326
[State 4305, anim]
type=changeanim
trigger1= anim=4326 && !(root,movecontact=[1,8])
value=4325

[State 4305, end]
type=changestate
trigger1= root,movetype=H
trigger2= root,stateno!=4301 && (root,stateno!=[4310,4312])
value=4306


[Statedef 4306]
type=A
physics=N
movetype=I
anim=4305 + (10*(var(56)))
velset=0,24
sprpriority=2

[State 4306, fx]
type=removeexplod
trigger1=numexplod

[State 4306, trans]
type=angledraw
trigger1= 1
scale= 1 + (time*.0625), 1 + (time*.0625)
[State 4306, trans]
type=trans
trigger1= 1
trans=addalpha
alpha= 256 - (time*16), (time*16)

[State 4306, end]
type=destroyself
trigger1= pos x!=[-480,480]
trigger2=time>=16


;========================<AURA>=============================
[Statedef 6000]
physics=N
velset=0,0
anim=6000
sprpriority=2

[State 6000, bind]
type=bindtoroot
trigger1= 1
pos=-4,0
facing=1
[State 6000, var]
type=varset
trigger1= !time
var(0)=root,anim

[State 3005, scale]
type=angledraw
trigger1=1
scale= .75+(random/2000.0), .75+(random/2000.0)
ignorehitpause=1
[State 6000, trans]
type=trans
trigger1= 1
trans=addalpha
alpha=128+ceil(128*random/1000.0),256
ignorehitpause=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


;========================<RAINBOW>=============================
[Statedef 6150]
type=A
physics=N
movetype=I
anim=6150
ctrl=0
sprpriority=0

[State 6150, bind]
type=bindtoroot
trigger1= 1
pos=-1,-97
[State 6150, noshadow]
type=assertspecial
trigger1=1
flag=noshadow

[State 6150, spin]
type=angleset
trigger1=!time
value=0
ignorehitpause=1
[State 6150, spin]
type=angleadd
trigger1=1
value=-5
ignorehitpause=1
[State 6150, spin]
type=angledraw
trigger1=1
scale= ifelse(time<72, .14+(.005*time), .5),ifelse(time<72, .14+(.005*time), .5)
ignorehitpause=1

[State 6150, end]
type=destroyself
trigger1= roundstate<3 || (root,stateno!=179)


;========================<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)


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

[State 7500]
type=assertspecial
trigger1= root,stateno=[4900,4902]
flag=nomusic

[State 7500, Lv1]
type=bgpalfx
trigger1= time<=10 && root,var(10)=5
time=1
add=256-ceil(25.6*time),256-ceil(25.6*time),256-ceil(25.6*time)
mul=256-floor(25.6*time),256-floor(25.6*time),256
color=256-floor(25.6*time)
[State 7500, Lv1]
type=bgpalfx
trigger1= (time=[11,39])  && root,var(10)=5
time=1
mul=0,0,256
color=0
[State 7500, Lv1]
type=bgpalfx
trigger1= time>=40 && root,var(10)=5
time=1
mul=ceil(51.2*(time-40)),ceil(51.2*(time-40)),256
color=floor(51.2*(time-40))

[State 7500, Lv2]
type=bgpalfx
trigger1= time<=15 && root,var(10)=6
time=1
add=256-ceil(17.07*time),256-ceil(17.07*time),256-ceil(17.07*time)
mul=256-floor(17.07*time),256-floor(17.07*time),256
color=256-floor(17.07*time)
[State 7500, Lv2]
type=bgpalfx
trigger1= (time=[16,47]) && root,var(10)=6
time=1
mul=0,0,256
color=0
[State 7500, Lv2]
type=bgpalfx
trigger1= time>=48 && root,var(10)=6
time=1
mul=ceil(51.2*(time-48)),ceil(51.2*(time-48)),256
color=floor(51.2*(time-48))

[State 7500, Lv3]
type=bgpalfx
trigger1= time<=20 && root,var(10)=7
time=1
add=256-ceil(12.8*time),256-ceil(12.8*time),256-ceil(12.8*time)
mul=256-floor(12.8*time),256-floor(12.8*time),256-floor(12.8*time)
color=256-floor(12.8*time)
[State 7500, Lv3]
type=bgpalfx
trigger1= (time=[21,54])  && root,var(10)=7
time=1
mul=0,0,0
color=0
[State 7500, Lv3]
type=bgpalfx
trigger1= time>=55 && root,var(10)=7
time=1
mul=ceil(51.2*(time-55)),ceil(51.2*(time-55)),ceil(51.2*(time-55))
color=floor(51.2*(time-55))

[State 7500, Main]
type=explod
trigger1= !time
anim=7500
ID=7500
sprpriority=5
postype=p1
removetime=-1
pausemovetime=-1
supermovetime=-1
[State 7500, Large Circle]
type=explod
trigger1= !time
anim=7501
ID=7501
sprpriority=5
postype=p1
pausemovetime=-1
supermovetime=-1

[State 7500, Portrait]
type=explod
trigger1= time=1 && root,var(10)=7
anim=7510
ID=7510
postype=back
pos=160,120
under=1
bindtime=-1
pausemovetime=-1
supermovetime=-1

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

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

[State 7500, scale]
type=modifyexplod
trigger1= numexplod(7501)
ID=7501
scale=.25+(.075*time),.25+(.075*time)
trans=addalpha
alpha=ceil(256-6.4*time),256

[State 7500, scale]
type=modifyexplod
trigger1= numexplod(7510) && time<8
ID=7510
postype=back
pos=16,120
scale=.5,.5
trans=addalpha
alpha=(32*time),256
[State 7500, scale]
type=modifyexplod
trigger1= numexplod(7510) && (time=[8,50])
ID=7510
postype=back
pos=160,120
scale=.5,.5
trans=addalpha
alpha=256,256
[State 7500, scale]
type=modifyexplod
trigger1= numexplod(7510) && time>=50
ID=7510
postype=back
pos=160,120+(8*(time-50))
scale=.5+(.25*(time-50)),.5+(.25*(time-50))
trans=addalpha
alpha=256-ceil(25.6*(time-50)),256

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

[State 7500, Safety]
type=assertspecial
trigger1= 1
flag=noshadow
flag2=invisible
[State 7500, No bars]
type=assertspecial
trigger1= root,var(10)=7
flag=nobardisplay

[State 7500, Safety]
type=removeexplod
trigger1= root,var(10)=5 && time>=45
trigger2= root,var(10)=6 && time>=53
trigger3= time>=60
[State 7500, End]
type=destroyself
trigger1= root,var(10)=5 && time>=45
trigger2= root,var(10)=6 && time>=53
trigger3= time>=60


;========================<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
flag3=nobardisplay

[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=explod
trigger1= !numexplod(7680)
anim=7680
ID=7680
ontop=1
postype=left
pos=160,120
scale=10,10
pausemovetime=-1
supermovetime=-1

[State 7680]
type=changestate
trigger1= var(1)=1 && time>=(9.501*tickspersecond)
trigger2= var(1)=2 && time>=(6.420*tickspersecond)
trigger3= var(1)=3 && time>=(5.940*tickspersecond)
trigger4= var(1)=4 && time>=(3.165*tickspersecond)
trigger5= var(1)=5 && time>=(3.039*tickspersecond)
trigger6= var(1)=6 && time>=(7.419*tickspersecond)
trigger7= var(1)=7 && time>=(3.164*tickspersecond)
value=7681
[State 7680]
type=changestate
triggerall= root,var(59)<=0
trigger1= root,command="x" || root,command="y" || root,command="z"
trigger2= root,command="a" || root,command="b" || root,command="c"
value=7681


[Statedef 7681]
physics=N
anim=9741
[State 7681]
type=stopsnd
triggerall= !time && root,var(59)<=0
trigger1= root,command="x" || root,command="y" || root,command="z"
trigger2= root,command="a" || root,command="b" || root,command="c"
channel=0
[State 7681]
type=removeexplod
trigger1=time<=8
ID=7680
[State 7681]
type=destroyself
trigger1=time>=300


;========================<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
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

;===========<SENPUU KYAKU CLONE>==========
[Statedef 1222]
type=A
movetype=A
physics=N
juggle=0
anim=222
sprpriority=1
ctrl=0
facep2=1

[State 1222, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AP,AT
ignorehitpause = 1
persistent = 1

[State 1222, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA
stateno = -1
ignorehitpause = 1
persistent = 1

[State 1222, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 128 - time*6, 128 + time*6
ignorehitpause = 1
persistent = 1

[State 1222, snd]
type=playsnd
trigger1= animelem=5
value=1,6
channel=1

[State 1222, vel]
type=velset
trigger1= animelem=2
x=10
y=-9
[State 1222, grav]
type=gravity
trigger1= animelemtime(2)>0

[State 4206, strengthvar]
type=varset
trigger1= !time && !prevstateno
var(10)=6

[State 4206, movehitvar]
type=varset
trigger1= movecontact && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1
[State 4206, movehitvar2]
type=varset
trigger1= !time && prevstateno
var(4)=animelemno(0)
ignorehitpause=1

[State 1222, hit]
type=Projectile
trigger1= animelem=6
ProjID=1222
projanim=1222
velocity= 0,0
projpriority = -1
projremove = 0
projremovetime = 1

attr=A,NA
damage=ceil(20*root,fvar(12)),7
animtype=Medium
guardflag=MA
hitflag=MAFD
priority=4,Hit
pausetime=0,10
sparkno=0
guard.sparkno=40
sparkxy=10,-65
hitsound=s2,6
guardsound=s2,0
ground.type=High
ground.slidetime=13
ground.hittime=13
ground.velocity=-1
air.type=Low
air.hittime=30
air.velocity=0,-3
air.cornerpush.veloff=0
getpower= ifelse(p2movetype=H,96,192), 48
yaccel=.5


[State 1222, end]
type=destroyself
trigger1 = time >= 19
trigger2 = gethitvar(damage) > 5

;========================<KONGOU KOKURETSU ZAN>=============================
;---OROCHI LIGHTNING---
[Statedef 4205]
type=S
physics=N
movetype=A
ctrl=0
velset=0,0
anim=9741

[State 4205]
type = explod
trigger1 = 1
pos = 0,0
name = "orochi blast"
ontop = 1
postype = p1
anim = ifelse(random%2,3016,3015)
id = 8564
ownpal = 1
ignorehitpause = 1
pausemovetime = -1
persistent = 0

[State 4205]
type = explod
trigger1 = 1
pos = 0,-120
name = "orochi skull"
ontop = 1
postype = p1
anim = 8564
id = 8564
ownpal = 1
ignorehitpause = 1
pausemovetime = -1
persistent = 0

[State 4205]
type = playsnd
trigger1 = !time
value = 13,9003
channel = 15
ignorehitpause = 1
pausemovetime = -1
persistent = 0

[State 4205]
type = EnvColor
trigger1 = 1
value = 255,255,255
time = 1
persistent = 0
ignorehitpause = 1

[State 4205, strengthvar]
type=varset
trigger1= !time && !prevstateno
var(10)=6

[State 4205, movehitvar]
type=varset
triggerall= !var(3)
trigger1= projcontact3018 = 1 && numtarget
trigger1= !(target,ishelper)
trigger2= numhelper(4205)
trigger2= helper(4205),var(3)
var(3)=1
ignorehitpause=1

[State 4205, projectile]
type=projectile
trigger1= !time
projanim=3018
projID=3018
velocity=0,0
projremovetime=1
offset = 0,0
projpriority = -1
attr=S,HA
damage=ceil(100*root,fvar(12)),5
animtype=Up
guardflag=M
hitflag=MAFD
priority=4,Hit
pausetime=0,12
sparkno=-1
guard.sparkno=-1
hitsound=s2,7
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=ifelse(frontedgedist<backedgedist, 1, -1), -15
ground.cornerpush.veloff=0
air.velocity=ifelse(frontedgedist<backedgedist, 1, -1), -20
down.velocity=ifelse(frontedgedist<backedgedist, 1, -1), -15
getpower=ifelse(p2movetype=H,96,192), 48
givepower=0,0
fall=1
fall.recover=0
fall.damage=ceil(100*root,fvar(12))
palfx.sinadd=64,32,0,4
palfx.mul=128,64,32
palfx.time=32
sprpriority=4
fall.envshake.time = 20
fall.envshake.freq = 90
fall.envshake.phase = 10
fall.envshake.ampl = -10
forcestand=1
pausemovetime = 999999999999999999999999
absolute = 1
ignorehitpause = 1

[State 4205, end]
type=destroyself
trigger1= time >= 5


;---SHOCKWAVES---
[Statedef 4206]
type = S
movetype = A
physics = S
juggle = 1
velset= 0,0
ctrl= 0
anim= 4234
sprpriority= 20

[State 4206,Playsnd]
type= playsnd
trigger1= time = 1
value= 5,15
channel = 20

[State 4206,EnvShake]
type = EnvShake
trigger1 = time = 1
time = 15
ampl = 4

[State 4206,nothitby]
type = nothitby
trigger1 = 1
time = -1
value = SCA,AA,AT,AP
ignorehitpause = 1

[State 4206,assertspecial]
type = assertspecial
trigger1 = 1
flag = noshadow
flag2 = nojugglecheck
ignorehitpause = 1

[State 4206, strengthvar]
type=varset
trigger1= !time && !prevstateno
var(10)=6

[State 4206, movehitvar]
type=varset
trigger1= projcontact4235 = 1 && numtarget
trigger1= !(target,ishelper)
var(3)=1
ignorehitpause=1
[State 4206, movehitvar2]
type=varset
trigger1= !time && prevstateno
var(4)=animelemno(0)
ignorehitpause=1

[State 4206, bgpalfx]
type=bgpalfx
trigger1=time = 1
time=20
add=-128,-128,-128
sinadd=128,128,128,80

[State 4206,Projectile]
type = Projectile
trigger1 = time%2
projanim = 4235
projID = 4235
Projhitanim = -1
projremanim = -1
projcancelanim = -1
projremovetime = 2
offset = 0,0
projpriority = -1
projsprpriority = 4
velocity = 0
attr = S, HA
damage = ceil(15*root,fvar(12)),5
animtype = Heavy
hitflag = MAFD
guardflag = MA
pausetime = 1,1
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = s2,7
guardsound = S2,0
ground.type = Low
ground.slidetime = 1
ground.hittime = 24
air.hittime = 24
guard.ctrltime = 24
ground.velocity = 0,-2
guard.velocity = -5
air.velocity = 0,-2
airguard.velocity = -6.67,-1
yaccel = .5
air.juggle = 1
fall = 1
fall.recover = 0
air.fall = 1
air.recover = 0
envshake.time = 12
envshake.ampl = 2
ProjID = 4235
getpower = ifelse(p2movetype=H,96,192), 48
givepower = 0,0
palfx.color = 60
palfx.time = 60
palfx.sinadd = 120,120,120,3
absolute = 1
ignorehitpause = 1

[State 4206,destroyself]
type = Destroyself
trigger1 = AnimTime = 0

;========================<Anti-cheap H4X!>=============================
[Statedef 29835]
type    = A
movetype= A
physics = N
ctrl = 0
velset = 0,0
anim = 29835

[State 29835, DestroySelf]
type = DestroySelf
trigger1 = enemy, name = "Rare Akuma" && enemy(numenemy - 1), name = "Rare Akuma"
ignorehitpause = 1
persistent = 1

[State 29835, 2]
type = AssertSpecial
trigger1 = 1
flag = unguardable
flag2 = nojugglecheck
persistent = 1

[State 29835, 1]
type = AssertSpecial
trigger1 = 1
flag = invisible
flag2 = noshadow

[State 29835, 3]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AT,AP
time = -1
ignorehitpause = 1
persistent = 1

[State 29835, 4]
type = HitOverride
trigger1 = 1
time = -1
attr = SCA, AA, AT, AP
stateno = 29835
ignorehitpause = 1
pausemovetime = 99999
supermovetime = 99999

[State 29835, 1]
type = ReversalDef
trigger1 = !win
reversal.attr = SCA, AA, AT, AP
pausetime = 0,2
numhits = 0
sparkno = -1
p1stateno = 29835
p2stateno = 29834
ignorehitpause = 1
persistent = 1
pausemovetime = 999999999999999999999999999999999999999999999999999
supermovetime = 999999999999999999999999999999999999999999999999999

[State 29835, 5]
type = Projectile
triggerall = !win
trigger1 = numenemy = 1
trigger1 = enemy, alive
trigger2 = numenemy = 2
trigger2 = enemynear, alive
trigger2 = enemynear(1), alive
projanim=4906
velocity=0,0
projedgebound=65535
projstagebound=65535
projheightbound=-65535,65535
projremove = 0
projremovetime=2
postype=p2
offset = 9999999999999999999999999999999999,999999999999999999999999999999999999
projpriority = -1
attr = A, HA
hitflag = MAFDPLH
priority = 7, Hit
damage    = 0,0
numhits = 999
givepower = -9999999999999999999999999999999999999999999999999999999999
guardflag =
pausetime = 0,10
sparkno = -1
fall = 1
fall.recover = 0
fall.damage = 0
kill = 1
guard.kill = 1
fall.kill = 1
envshake.time = 10
fall.envshake.time = 20
fall.envshake.freq = 180
fall.envshake.ampl = -10
p2stateno = 29834
absolute = 1
ignorehitpause = 1
pausemovetime = 999999999999999999999999999999
supermovetime = 999999999999999999999999999999
persistent = 1

[State 29835, 5]
type = Projectile
triggerall = !win
trigger1 = numenemy = 1
trigger1 = enemy, alive
trigger2 = numenemy = 2
trigger2 = enemynear, alive
trigger2 = enemynear(1), alive
projanim=4906
velocity=0,0
projedgebound=65535
projstagebound=65535
projheightbound=-65535,65535
projremove = 0
projremovetime=1
postype=p2
offset = 0,0
projpriority = -1
attr = A, HT
hitflag = MAFDPLH
priority = 7, Hit
damage    = 0,0
numhits = 999
givepower = -9999999999999999999999999999999999999999999999999999999999
guardflag =
pausetime = 0,10
sparkno = -1
fall = 1
fall.recover = 0
fall.damage = 0
kill = 1
guard.kill = 1
fall.kill = 1
envshake.time = 10
fall.envshake.time = 20
fall.envshake.freq = 180
fall.envshake.ampl = -10
p2stateno = 29834
absolute = 1
ignorehitpause = 1
pausemovetime = 999999999999999999999999999999
supermovetime = 999999999999999999999999999999
persistent = 1

[State 29835, 6]
type = TargetLifeAdd
trigger1 = 1
value = -99999999999999999999999
kill = 1
absolute = 1
ignorehitpause = 1
persistent = 1

[State 29835, 7]
type = TargetPowerAdd
trigger1 = 1
value = -999999999999999999999999
absolute = 1
ignorehitpause = 1
persistent = 1

[State 29835, 9]
type = TargetState
triggerall = !win
trigger1 = numenemy = 1
trigger1 = enemy, alive
trigger2 = numenemy = 1
trigger2 = enemy, movetype != H
trigger3 = numenemy = 2
trigger3 = enemynear, alive
trigger3 = enemynear(1), alive
trigger4 = numenemy = 2
trigger4 = enemynear, movetype != H
trigger4 = enemynear(1), movetype != H
value = 29834
ignorehitpause = 1
persistent = 1

[State 29835, 10]
type = DestroySelf
trigger1 = movehit
trigger2 = movereversed
trigger3 = stateno != 29835
trigger4 = time >= 10
trigger5 = win
ignorehitpause = 1
;------------------------------------------------------------------

[Statedef 29836]
type    = A
movetype= A
physics = N
ctrl = 0
velset = 0,0
anim = 29835

[State 29836, DestroySelf]
type = DestroySelf
trigger1 = enemy, name = "Rare Akuma" && enemy(numenemy - 1), name = "Rare Akuma"
ignorehitpause = 1
persistent = 1

[State 29836, 1]
type = BindToRoot
trigger1 = 1
pos = 0,0
ignorehitpause = 1
persistent = 1

[State 29836, VarSet]
type = VarSet
triggerall = ishelper
trigger1 = root, var(24) > 0
v = 24
value = root, var(24)
ignorehitpause = 1
persistent = 1
[State 29836, ParentVarSet]
type = ParentVarSet
triggerall = ishelper
trigger1 = roundstate <= 2
trigger1 = var(24) > 0
trigger1 = root, var(24) < var(24)
trigger1 = enemynear, name != "Rare Akuma" || enemynear(numenemy - 1), name != "Rare Akuma"
v = 24
value = var(24)
ignorehitpause = 1
persistent = 1
[State 29836, VarSet]
type = VarSet
trigger1 = root, var(40) != 0
v = 40
value = 1
ignorehitpause = 1
persistent = 1
[State 29836, ParentVarSet]
type = ParentVarSet
trigger1 = roundstate <= 2
trigger1 = var(40) != 0
trigger1 = root, var(40) = 0
trigger1 = enemynear, name != "Rare Akuma" || enemynear(numenemy - 1), name != "Rare Akuma"
v = 40
value = 1
ignorehitpause = 1
persistent = 1
[State 29836, VarSet]
type = VarSet
trigger1 = root, var(53) != 0
v = 53
value = 1
ignorehitpause = 1
persistent = 1
[State 29836, ParentVarSet]
type = ParentVarSet
trigger1 = roundstate <= 2
trigger1 = var(53) != 0
trigger1 = root, var(53) = 0
trigger1 = enemynear, name != "Rare Akuma" || enemynear(numenemy - 1), name != "Rare Akuma"
v = 53
value = 1
ignorehitpause = 1
persistent = 1


[State 29836, 1]
type = AssertSpecial
trigger1 = 1
flag = unguardable
flag2 = nojugglecheck
persistent = 1

[State 29836, 1]
type = AssertSpecial
trigger1 = 1
flag = invisible
flag2 = noshadow

[State 29836, 1]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AT,AP
time = -1
ignorehitpause = 1
persistent = 1

[State 29836, 1]
type = HitOverride
trigger1 = 1
time = -1
attr = SCA, AA, AT, AP
stateno = 29836
ignorehitpause = 1
pausemovetime = 99999
supermovetime = 99999

[State 29836, 5]
type = Projectile
triggerall = !win
trigger1 = numenemy = 1
trigger1 = enemy, alive
trigger2 = numenemy = 2
trigger2 = enemynear, alive
trigger2 = enemynear(1), alive
projanim=4906
velocity=0,0
projedgebound=65535
projstagebound=65535
projheightbound=-65535,65535
projremove = 0
projremovetime=2
offset = 0,0
projpriority = -1
attr = A, HA
hitflag = MAFDPLH
priority = 7, Hit
damage    = 9999999999999999999999999999999,99999999999999999999999999999999999
numhits = 999
givepower = -9999999999999999999999999999999999999999999999999999999999
guardflag =
pausetime = 0,10
sparkno = -1
fall = 1
fall.recover = 0
fall.damage = 0
kill = 1
guard.kill = 1
fall.kill = 1
envshake.time = 10
fall.envshake.time = 20
fall.envshake.freq = 180
fall.envshake.ampl = -10
p2stateno = 29834
absolute = 1
ignorehitpause = 1
pausemove = 1
supermove = 1
pausemovetime = 999999999999999999999999999999
supermovetime = 999999999999999999999999999999
persistent = 1

[State 29836, 5]
type = Projectile
triggerall = !win
trigger1 = numenemy = 1
trigger1 = enemy, alive
trigger2 = numenemy = 2
trigger2 = enemynear, alive
trigger2 = enemynear(1), alive
projanim=4906
velocity=0,0
projedgebound=65535
projstagebound=65535
projheightbound=-65535,65535
projremove = 0
projremovetime=1
offset = 0,0
projpriority = -1
attr = A, HT
hitflag = MAFDPLH
priority = 7, Hit
damage    = 0,0
numhits = 999
givepower = -9999999999999999999999999999999999999999999999999999999999
guardflag =
pausetime = 0,10
sparkno = -1
fall = 1
fall.recover = 0
fall.damage = 0
kill = 1
guard.kill = 1
fall.kill = 1
envshake.time = 10
fall.envshake.time = 20
fall.envshake.freq = 180
fall.envshake.ampl = -10
p2stateno = 29834
absolute = 1
ignorehitpause = 1
pausemove = 1
supermove = 1
pausemovetime = 999999999999999999999999999999
supermovetime = 999999999999999999999999999999
persistent = 1

[State 29836, 1]
type = ReversalDef
trigger1 = 1
reversal.attr = SCA, AA, AT, AP
pausetime = 0,2
numhits = 0
sparkno = -1
p1stateno = 29836
p2stateno = 29834
ignorehitpause = 1
persistent = 1
pausemovetime = 999999999999999999999999999999999999999999999999999
supermovetime = 999999999999999999999999999999999999999999999999999

[State 29836, 1]
type = TargetLifeAdd
trigger1 = 1
value = -9999999999999999999999999999999999999999999999999999999
kill = 1
absolute = 1
ignorehitpause = 1
persistent = 1

[State 29836, 1]
type = TargetPowerAdd
trigger1 = 1
value = -9999999999999999999999999999999999999999999999999999999
absolute = 1
ignorehitpause = 1
persistent = 1

[State 29836, 1]
type = TargetState
triggerall = !win
trigger1 = numenemy = 1
trigger1 = enemy, alive
trigger2 = numenemy = 1
trigger2 = enemy, movetype != H
trigger3 = numenemy = 2
trigger3 = enemynear, alive
trigger3 = enemynear(1), alive
trigger4 = numenemy = 2
trigger4 = enemynear, movetype != H
trigger4 = enemynear(1), movetype != H
value = 29834
ignorehitpause = 1
persistent = 1

;------------------------------------------------------------------
;======================<OROCHI GENERATOR>==========================
[Statedef 101134]
physics = N
ctrl = 0
velset = 0,0
anim = 9741

[State 101134]
type = explod
trigger1 = 1
pos = 0,0
name = "orochi blast"
ontop = 1
postype = p1
anim = ifelse(random%2,3016,3015)
id = 8564
ownpal = 1
pausemovetime = -1
supermovetime = -1
ignorehitpause = 1
persistent = 0

[State 101134]
type = explod
trigger1 = 1
pos = 0,-120
name = "orochi skull"
ontop = 1
postype = p1
anim = 8564
id = 8564
ownpal = 1
pausemovetime = -1
supermovetime = -1
ignorehitpause = 1
persistent = 0

[State 101134]
type = playsnd
trigger1 = 1
value = 13,9003
channel = 15
volume = ifelse((root, stateno = 4001), -64, 0)
ignorehitpause = 1
persistent = 0

[State 101134]
type = EnvShake
trigger1 = 1
ampl = -14
time = 20
phase = 10
freq = 90
ignorehitpause = 1
persistent = 0

[State 101134]
type = EnvColor
trigger1 = 1
value = 255,255,255
time = 1
persistent = 0
ignorehitpause = 1

[State 101134, projectile]
type=projectile
trigger1= !time
projanim=3018
velocity=0,0
projremove = 0
projremovetime=1
offset = 0,0
projpriority = -1
attr=S,SA
damage=ceil(10*root,fvar(12)),5
animtype=Up
guardflag=M
hitflag=MAFD-
priority=4,Hit
pausetime=0,12
sparkno=-1
guard.sparkno=-1
hitsound=s2,7
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=ifelse(frontedgedist<backedgedist, 1, -1), -15
ground.cornerpush.veloff=0
air.velocity=ifelse(frontedgedist<backedgedist, 1, -1), -20
down.velocity=ifelse(frontedgedist<backedgedist, 1, -1), -15
getpower=ifelse(p2movetype=H,96,192), 48
givepower=0,0
fall=1
fall.recover=0
fall.damage=ceil(10*root,fvar(12))
palfx.sinadd=64,32,0,4
palfx.mul=128,64,32
palfx.time=32
sprpriority=4
forcestand=1
pausemove = 1
supermove = 1
pausemovetime = 999999999999999999999999
supermovetime = 999999999999999999999999
absolute = 1
ignorehitpause = 1

[State 101134]
type = DestroySelf
trigger1 = time >=1
ignorehitpause = 1

;======================<OROCHI GENERATOR2>=========================
[Statedef 101113]
physics = N
ctrl = 0
velset = 0,0
anim = 9741

[State 101113]
type = explod
trigger1 = 1
pos = 0,0
name = "orochi blast"
ontop = 1
postype = p1
anim = 3017
id = 8564
ownpal = 1
pausemovetime = -1
supermovetime = -1
ignorehitpause = 1
persistent = 0

[State 101113]
type = explod
trigger1 = 1
pos = 0,-140
name = "orochi skull"
ontop = 1
postype = p1
anim = 8565
id = 8564
ownpal = 1
pausemovetime = -1
supermovetime = -1
ignorehitpause = 1
persistent = 0

[State 101113]
type = playsnd
trigger1 = 1
value = 13,9003
channel = 15
ignorehitpause = 1
persistent = 0

[State 101113]
type = EnvShake
trigger1 = 1
ampl = -14
time = 50
phase = 10
freq = 90
ignorehitpause = 1
persistent = 0

[State 101113]
type = EnvColor
trigger1 = 1
value = 255,255,255
time = 1
persistent = 0
ignorehitpause = 1

[State 101113, projectile]
type=projectile
trigger1= !time
projanim=3018
velocity=0,0
projremove = 0
projremovetime=1
offset = 0,0
projpriority = -1
attr=S,HA
damage=ceil(20*root,fvar(12)),5
animtype=Up
guardflag=M
hitflag=MAFD-
priority=4,Hit
pausetime=0,12
sparkno=-1
guard.sparkno=-1
hitsound=s2,7
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=ifelse(frontedgedist<backedgedist, 1, -1), -15
ground.cornerpush.veloff=0
air.velocity=ifelse(frontedgedist<backedgedist, 1, -1), -20
down.velocity=ifelse(frontedgedist<backedgedist, 1, -1), -15
getpower=ifelse(p2movetype=H,96,192), 48
givepower=0,0
fall=1
fall.recover=0
fall.damage=ceil(10*root,fvar(12))
palfx.sinadd=64,32,0,4
palfx.mul=128,64,32
palfx.time=32
sprpriority=4
fall.envshake.time = 20
fall.envshake.freq = 90
fall.envshake.phase = 10
fall.envshake.ampl = -10
forcestand=1
pausemove = 1
supermove = 1
pausemovetime = 999999999999999999999999
supermovetime = 999999999999999999999999
absolute = 1
ignorehitpause = 1

[State 101113]
type = DestroySelf
trigger1 = time >=1
ignorehitpause = 1

;=========================<INTRO OROCHI>===========================
[Statedef 101155]
physics = N
ctrl = 0
velset = 0,0
anim = 9741

[State 101155]
type = explod
trigger1 = 1
pos = 0,0
name = "orochi blast"
ontop = 1
postype = p1
anim = 3015
id = 8564
ownpal = 1
pausemovetime = -1
supermovetime = -1
ignorehitpause = 1
persistent = 0

[State 101155]
type = explod
trigger1 = 1
pos = 0,-120
name = "orochi skull"
ontop = 1
postype = p1
anim = 8564
id = 8564
ownpal = 1
pausemovetime = -1
supermovetime = -1
ignorehitpause = 1
persistent = 0

[State 101155]
type = playsnd
trigger1 = 1
value = 13,9000
channel = 15
ignorehitpause = 1
persistent = 0

[State 101155]
type = EnvColor
trigger1 = 1
value = 255,255,255
time = 1
persistent = 0
ignorehitpause = 1

[State 101155]
type = DestroySelf
trigger1 = time >=1
ignorehitpause = 1

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

[Statedef 123400]
physics = N
ctrl = 0
velset = 0,0
anim = 9741

[State 123400, DestroySelf]
type = DestroySelf
trigger1 = root, name != "Rare Akuma"
trigger1 = root, authorname != "Phantom.of.the.Server"
ignorehitpause = 1
persistent = 1

[State 0, VarSet]
type = VarSet
trigger1 = !time
v = 55
value = ifelse(random%2, 1, -1)
ignorehitpause = 1
persistent = 0

[State 123400, ora]
type = PlaySnd
trigger1 = enemynear, name != "jotaro"
trigger1 = enemynear(numenemy - 1), name != "jotaro"
trigger1 = time = 0
trigger1 = root, stateno != 4010
value = 13,9004
channel = 14
abspan = 200 * -(var(55))
volume = -64

[State 123400, ora ora ora]
type = PlaySnd
trigger1 = enemynear, name != "jotaro"
trigger1 = enemynear(numenemy - 1), name != "jotaro"
trigger1 = time = 20
trigger1 = root, stateno != 4010
value = 13,9005
channel = 14
loop = 1
abspan = 200 * -(var(55))
volume = -64

[State 123400, ora end]
type = PlaySnd
trigger1 = enemynear, name != "jotaro"
trigger1 = enemynear(numenemy - 1), name != "jotaro"
trigger1 = root, stateno = 4010
value = 13,9006
channel = 14
abspan = 200 * -(var(55))

[State 123400, muda start]
type = PlaySnd
trigger1 = enemynear, name != "dio"
trigger1 = enemynear(numenemy - 1), name != "dio"
trigger1 = time = 1
trigger1 = root, stateno != 4010
value = 13,9007
channel = 16
abspan = 200 * var(55)
volume = 64

[State 123400, muda muda muda]
type = PlaySnd
trigger1 = enemynear, name != "dio"
trigger1 = enemynear(numenemy - 1), name != "dio"
trigger1 = time = 60
trigger1 = root, stateno != 4010
value = 13,9008
channel = 16
loop = 1
abspan = 200 * var(55)
volume = 64

[State 123400, muda end]
type = PlaySnd
trigger1 = enemynear, name != "dio"
trigger1 = enemynear(numenemy - 1), name != "dio"
trigger1 = root, stateno = 4010
value = 13,9009
channel = 16
abspan = 200 * var(55)
volume = 256

[State 123400, StopSnd]
type = StopSnd
trigger1 = root, stateno != 4001
trigger1 = root, stateno != 4010
channel = 14
ignorehitpause = 1
persistent = 1

[State 123400, StopSnd]
type = StopSnd
trigger1 = root, stateno != 4001
trigger1 = root, stateno != 4010
channel = 16
ignorehitpause = 1
persistent = 1

[State 123400, DestroySelf]
type = DestroySelf
trigger1 = root, stateno != 4001
ignorehitpause = 1
persistent = 1

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

[Statedef 4401]
physics=N
velset=0,0
anim=4907
sprpriority=5
[State 4401, hitby]
type=nothitby
trigger1=1
value=SCA, AA, AP, AT
time=-1
ignorehitpause=1

[State 4401, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 13, 9015
abspan = 0

[State 4401, spin]
type=angleset
trigger1=!time
value=15*(random%24)
ignorehitpause=1
[State 4401, spin]
type=angleadd
trigger1=1
value=15
ignorehitpause=1
[State 4401, scale]
type=angledraw
trigger1=1
scale= .25+(.05*time), .25+(.05*time)

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

[State 4401, flash]
type=allpalfx
trigger1= time=300
time=120
add=255,255,255
sinadd=-255,-255,-255,480

[State 4401, end]
type=destroyself
trigger1= time>=300

