;==========<ZERO COUNTER>==========
[Statedef 9750]
type=A
physics=N
movetype=I
anim=8070
ctrl=0
velset=0,0
poweradd=0
sprpriority=4

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0-(time*20),0-(time*20),0-(time*20)
;mul = 256,256,256
;sinadd = 0,0,0,10
invertall = 0
color = 256
;ignorehitpause =
;persistent =

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time >=15
trigger2 = parent,movetype = H
;ignorehitpause =
;persistent =

;========================<FIRE>=============================
[Statedef 9995]
physics=N
velset=0,0
anim=9741
sprpriority=4

[State 1195, assert]
type=assertspecial
trigger1= 1
flag=noshadow
ignorehitpause=1

[State 1195, flames]
type=explod
trigger1= 1
anim=9995
ID=9995
sprpriority=5
postype=p2
vel=-.2,-.75
pos=(enemynear,const(size.mid.pos.x)),(enemynear,const(size.mid.pos.y))+(ifelse((enemynear,statetype != A),-5,10))
random=40,40;40,40;50,40
removetime=-2
scale=(.3-(.001*time)),(.3-(.001*time))
ownpal=0

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = 1
ID = 9995
trans=addalpha
alpha=220,256

[State 7180, pos]
type=posadd
trigger1= 1
x=ceil(p2dist x)
y=ceil(p2dist y)

[State 7180, end]
type=destroyself
trigger1= time>=(ifelse(enemynear,statetype != A ,20,120))
trigger2= enemynear,ctrl || (enemynear,movetype!=H) || (enemynear,statetype=L)
;------------------------------
[StateDef 1]
type=S
ctrl=0
anim=root,anim
sprpriority=-1

[State 0, Trans]
type=Trans
trigger1=1
trans=add1

[State 0, BindToRoot]
type = BindToRoot
trigger1=1
time=2
facing=1
ignorehitpause=1

[State 0, Explod]
type = Explod
trigger1=1
anim=1008
ID=1008
pos=0,-45
postype=p1
vel=var(1),var(2)
random=90,90
removetime=15
scale=.5,.5
sprpriority=-3
ownpal = 0

[State 0, VarRandom]
type = VarRandom
trigger1=1
v=1
range=-3,3

[State 0, VarRandom]
type = VarRandom
trigger1=1
v=2
range=-9,-5
[State 0, PalFX]
type=PalFX
trigger1=1
time=-1
add=0,-200,-200
mul=256,256,256
sinadd = 40,80,40,0
invertall = 0
color = 0

[State 0, AngleDraw]
type = AngleDraw
trigger1=1
scale=1*(atan(time%9)),1*(atan(time%9))
ignorehitpause=1

[State 1, end]
type = DestroySelf
trigger1=root,stateno!=199
trigger2=roundstate>=2
trigger3=root,stateno=199&&animelemtime(2)>=0

;------------------------------
[StateDef 1005]
type = A
movetype= A
physics = N
velset = 0,0
anim=1005
ctrl = 0
sprpriority = 4

[State 0, VarSet]
type = VarSet
trigger1 = time=0&&prevstateno!=1005
var(10)=root,var(10)
[State 0, VarSet]
type = VarSet
trigger1 = time=0
var(3)=floor(root,p2dist X)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0&&prevstateno!=1005
value = S10,0
volume = 0
channel = -1

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 1006
time = 1
ignorehitpause = 1
[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignorehitpause=1

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = ifelse(var(10)=3, 7.5,ifelse(var(10)=2, 6, 4.5))
y = 0

[State 0, AfterImage]
type = AfterImage
trigger1 = time=0
time = 9999
length = 6
timegap = 1
framegap = 2
trans = add

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit && numtarget
trigger1 = !(target, time)
value = S1,9
channel = 1
persistent=0
ignorehitpause=1

[State 225, hit]
type=hitdef
trigger1=time=0
attr=A,SP
damage=ceil(ifelse(var(3)<100, 70, 45)*root,fvar(10)),3
animtype=Hard
guardflag=MA
hitflag=MAF
priority=4,Hit
pausetime=1,3
sparkno=-1;s8210+(random%8)
guard.sparkno=s8100
sparkxy=-10,0
hitsound=-1,0
guardsound=s2,0
ground.type=High
ground.slidetime=18
ground.hittime=24
ground.velocity=-9.1,ifelse(var(3)<100,-4,0)
ground.cornerpush.veloff=0
air.type=Low
air.hittime=24
air.velocity=-9.1,-4
fall=ifelse(var(3)<100,1,0)
fall.yvelocity=0
yaccel=.63
persistent=0
sprpriority = 4
envshake.time = 12
envshake.ampl = 3
palfx.time = 48
palfx.sinadd = 64, 64, 64, 4
palfx.mul = 128, 128, 128
getpower=0

[State 0, Explod]
type = Explod
trigger1 = movehit && numtarget
trigger1 = !(target, time)
anim = 8210+(random%8)
ID = 8200
pos = 0,0
postype = p1
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
sprpriority = 10
ownpal = 1
ignorehitpause = 1
persistent = 0

[State 0, Dark Fire Explod]
type = Explod
triggerall = NumExplod(8060)<5
trigger1 = movehit && numtarget
trigger1 = !(target, time)
anim = 8060+(random%4)
ID = 8060
postype = p2
pos = enemy,const(size.mid.pos.x),enemy,const(size.mid.pos.y)
random=60,60
bindtime = -1
removetime = -2
sprpriority = ifelse(random<500,5,-1)
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 1
range = -5,-1
[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 2
range = -1,1

[State 0, Explod]
type = Explod
;triggerall = (time = [8,64])
trigger1 = (gametime%3)=0
anim = 1060+(random%2)
ID =1060
pos = 0,0
vel = var(1),var(2)
random = 10,45
postype = p1
bindtime = 1
removetime = -2
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = Time = 0&&PrevStateNo!=1005
helpertype = normal ;player
name = "Dust FX"
ID = 8015
stateno = 8015
pos = Ceil(-30*root,const(size.xscale)),-Ceil(parent,Pos Y)
postype = p1
ownpal = 0
size.xscale=root,const(size.xscale)
size.yscale=root,const(size.yscale)
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = movecontact
value = 1006
[State 0, DestroySelf]
type = DestroySelf
trigger1 = backedgedist < -120||frontedgedist < -120
;------------------------------
[StateDef 1006]
type = A
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 1006
sprpriority = 4

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time>=27

;------------------------------
[StateDef 1010]
type = A
movetype= A
physics = N
velset = 0,0
anim=1010
ctrl = 0
sprpriority = 4

[State 0, VarSet]
type = VarSet
trigger1 = time=0&&prevstateno!=1010
var(10)=root,var(10)
[State 0, VarSet]
type = VarSet
trigger1 = time=0
var(3)=floor(root,p2dist X)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0&&prevstateno!=1010
value = S10,0
volume = 0
channel = -1

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 1011
time = 1
ignorehitpause = 1
[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignorehitpause=1

[State 0, AfterImage]
type = AfterImage
trigger1 = time=0
time = 9999
length = 6
timegap = 1
framegap = 2
trans = add

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = ifelse(var(10) = 3, 6.7, ifelse(var(10) = 2, 5.3, 3.9))
y = ifelse(var(10) = 3, 5, ifelse(var(10) = 2, 4, 3))

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit && numtarget
trigger1 = !(target, time)
value = S1,9
channel = 1
persistent=0
ignorehitpause=1

[State 225, hit]
type=hitdef
trigger1=time=0
attr=A,SP
damage=ceil(ifelse(var(3)<100, 70, 45)*root,fvar(10)),3
animtype=Hard
guardflag=MA
hitflag=MAF
priority=4,Hit
pausetime=1,3
sparkno=-1;s8210+(random%8)
guard.sparkno=s8100
sparkxy=-10,0
hitsound=-1,0
guardsound=s2,0
ground.type=High
ground.slidetime=18
ground.hittime=24
ground.velocity=-9.1,ifelse(var(3)<100,-4,0)
ground.cornerpush.veloff=0
air.type=Low
air.hittime=24
air.velocity=-5.5,ifelse(root,var(11)=1,((root,vel y)-.2),-4)
fall=ifelse(var(3)<100,1,0)
fall.yvelocity=0
yaccel=.63
persistent=0
sprpriority = 4
envshake.time = 12
envshake.ampl = 3
palfx.time = 48
palfx.sinadd = 64, 64, 64, 4
palfx.mul = 128, 128, 128
getpower=0

[State 0, Explod]
type = Explod
trigger1 = movehit && numtarget
trigger1 = !(target, time)
anim = 8210+(random%8)
ID = 8200
pos = 0,0
postype = p1
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
sprpriority = 10
ownpal = 1
ignorehitpause = 1
persistent = 0

[State 0, Dark Fire Explod]
type = Explod
triggerall = NumExplod(8060)<5
trigger1 = movehit && numtarget
trigger1 = !(target, time)
anim = 8060+(random%4)
ID = 8060
postype = p2
pos = enemy,const(size.mid.pos.x),enemy,const(size.mid.pos.y)
random=60,60
bindtime = -1
removetime = -2
sprpriority = ifelse(random<500,5,-1)
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 0, Explod]
type = Explod
;triggerall = (time = [8,64])
trigger1 = (gametime%3)=0
anim = 1060+(random%2)
ID =1060
pos = 0,0
vel = var(1),var(2)
random = 10,45
postype = p1
bindtime = 1
removetime = -2
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 1
range = -3,-1
[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 2
range = -3,3

[State 0, ChangeState]
type = ChangeState
trigger1 = movecontact
trigger2 = pos Y >= 0
value = 1011
[State 0, DestroySelf]
type = DestroySelf
trigger1 = backedgedist < -120||frontedgedist < -120
;------------------------------
[StateDef 1011]
type = A
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 1011
sprpriority = 4

[State 0, PosSet]
type = PosSet
trigger1 = Pos Y > 0
y = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time>=27
;------------------------------
[StateDef 1015]
type = A
movetype= A
physics = N
velset = 0,0
anim=1015
ctrl = 0
sprpriority = 4

[State 0, VarSet]
type = VarSet
trigger1 = time=0&&prevstateno!=1015
var(10)=root,var(10)
[State 0, VarSet]
type = VarSet
trigger1 = time=0
var(2)=floor(root,p2dist X)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0&&prevstateno!=1015
value = S10,0
volume = 0
channel = -1

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 1016
time = 1
ignorehitpause = 1
[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignorehitpause=1

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = ifelse(var(10)=3, 7.5,ifelse(var(10)=2, 6, 4.5))
y = 0

[State 0, AfterImage]
type = AfterImage
trigger1 = time=0
time = 9999
length = 6
timegap = 1
framegap = 2
trans = add

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit && numtarget
trigger1 = !(target, time)
value = S1,9
channel = 1
persistent=0
ignorehitpause=1

[State 225, hit]
type=hitdef
trigger1=time=0
attr=A,SP
damage=ceil(ifelse(var(2)<100, 70, 45)*root,fvar(10)),3
animtype=Hard
guardflag=MA
hitflag=MAF
priority=4,Hit
pausetime=1,3
sparkno=-1;s8210+(random%8)
guard.sparkno=s8100
sparkxy=-10,0
hitsound=-1,0
guardsound=s2,0
ground.type=High
ground.slidetime=18
ground.hittime=24
ground.velocity=-9.1,ifelse(var(2)<100,-4,0)
ground.cornerpush.veloff=0
air.type=Low
air.hittime=24
air.velocity=-9.1,-4
fall=ifelse(var(2)<100,1,0)
fall.yvelocity=0
yaccel=.63
persistent=0
sprpriority = 4
envshake.time = 12
envshake.ampl = 3
palfx.time = 48
palfx.sinadd = 64, 64, 64, 4
palfx.mul = 128, 128, 128
getpower=0

[State 0, Explod]
type = Explod
trigger1 = movehit && numtarget
trigger1 = !(target, time)
anim = 8210+(random%8)
ID = 8200
pos = 0,0
postype = p1
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
sprpriority = 10
ownpal = 1
ignorehitpause = 1
persistent = 0

[State 0, Dark Fire Explod]
type = Explod
triggerall = NumExplod(8060)<5
trigger1 = movehit && numtarget
trigger1 = !(target, time)
anim = 8060+(random%4)
ID = 8060
postype = p2
pos = enemy,const(size.mid.pos.x),enemy,const(size.mid.pos.y)
random=60,60
bindtime = -1
removetime = -2
sprpriority = ifelse(random<500,5,-1)
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 1
range = -7,-3
[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 2
range = -1,1

[State 0, Explod]
type = Explod
;triggerall = (time = [8,64])
trigger1 = (gametime%3)=0
anim = 1060+(random%2)
ID =1060
pos = 0,0
vel = var(1),var(2)
random = 10,75
postype = p1
bindtime = 1
removetime = -2
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = Time = 0&&PrevStateNo!=1015
helpertype = normal ;player
name = "Dust FX"
ID = 8015
stateno = 8015
pos = Ceil(-30*root,const(size.xscale)),-Ceil(parent,Pos Y)
postype = p1
ownpal = 0
size.xscale=root,const(size.xscale)
size.yscale=root,const(size.yscale)
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = movecontact
value = 1016
[State 0, DestroySelf]
type = DestroySelf
trigger1 = backedgedist < -120||frontedgedist < -120
;------------------------------
[StateDef 1016]
type = A
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 1016
sprpriority = 4

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time>=27

;------------------------------
[StateDef 1020]
type = A
movetype= A
physics = N
velset = 0,0
;anim=1020
ctrl = 0
sprpriority = 4

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0&&anim!=1020
value = 1020

[State 0, VarSet]
type = VarSet
trigger1 = time=0&&prevstateno!=1020
var(10)=root,var(10)
[State 0, VarSet]
type = VarSet
trigger1 = time=0
var(2)=floor(root,p2dist X)
[State 0, VarAdd]
type = VarAdd
trigger1 = time=0
var(1)=1
ignorehitpause=1
persistent=0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0&&prevstateno!=1020
value = S10,0
volume = 0
channel = -1

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 1021
time = 1
ignorehitpause = 1
[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignorehitpause=1

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = ifelse(var(10)=3, 7.5,ifelse(var(10)=2, 6, 4.5))
y = 0

[State 0, AfterImage]
type = AfterImage
trigger1 = time=0
time = 9999
length = 6
timegap = 1
framegap = 2
trans = add

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit && numtarget
trigger1 = !(target, time)
value = S1,9
channel = 1
persistent=0
ignorehitpause=1

[State 225, hit]
type=hitdef
triggerall=var(10)=1
trigger1=time=0
attr=A,SP
damage=ceil(ifelse(var(2)<100, 90, 65)*root,fvar(10)),3
animtype=Hard
guardflag=MA
hitflag=MAF
priority=4,Hit
pausetime=3,9
sparkno=-1;s8210+(random%8)
guard.sparkno=s8100
sparkxy=-10,0
hitsound=-1,0
guardsound=s2,0
ground.type=High
ground.slidetime=18
ground.hittime=24
ground.velocity=-9.1,ifelse(var(2)<100,-4,0)
ground.cornerpush.veloff=0
air.type=Low
air.hittime=24
air.velocity=-9.1,-4
fall=ifelse(var(2)<100,1,0)
fall.yvelocity=0
yaccel=.63
persistent=0
sprpriority=4
palfx.time = 48
palfx.color = 32
palfx.sinadd = 80, 25, 0, 8
palfx.mul = 512, 256, 128
envshake.time = 12
envshake.ampl = 3
getpower=0
[State 225, hit]
type=hitdef
triggerall=var(10)=2
trigger1=time=0
attr=A,SP
damage=ceil(ifelse(var(2)<100, 50, 35)*root,fvar(10)),3
animtype=Hard
guardflag=MA
hitflag=MAF
priority=4,Hit
pausetime=3,9
sparkno=-1;s8210+(random%8)
guard.sparkno=s8100
sparkxy=-10,0
hitsound=-1,0
guardsound=s2,0
ground.type=High
ground.slidetime=18
ground.hittime=24
ground.velocity=-9.1,ifelse(var(2)<100,-4,0)
ground.cornerpush.veloff=0
air.type=Low
air.hittime=24
air.velocity=-9.1,-4
fall=ifelse(var(2)<100,1,0)
fall.yvelocity=0
yaccel=.63
persistent=0
sprpriority=4
palfx.time = 48
palfx.color = 32
palfx.sinadd = 80, 25, 0, 8
palfx.mul = 512, 256, 128
envshake.time = 12
envshake.ampl = 3
getpower=0
[State 225, hit]
type=hitdef
triggerall=var(10)=3
trigger1=time=0
attr=A,SP
damage=ceil(ifelse(var(2)<100, 40, 30)*root,fvar(10)),3
animtype=Hard
guardflag=MA
hitflag=MAF
priority=4,Hit
pausetime=3,9
sparkno=-1;s8210+(random%8)
guard.sparkno=s8100
sparkxy=-10,0
hitsound=-1,0
guardsound=s2,0
ground.type=High
ground.slidetime=18
ground.hittime=24
ground.velocity=-9.1,ifelse(var(2)<100,-4,0)
ground.cornerpush.veloff=0
air.type=Low
air.hittime=24
air.velocity=-9.1,-4
fall=ifelse(var(2)<100,1,0)
fall.yvelocity=0
yaccel=.63
persistent=0
sprpriority=4
palfx.time = 48
palfx.color = 32
palfx.sinadd = 80, 25, 0, 8
palfx.mul = 512, 256, 128
envshake.time = 12
envshake.ampl = 3
getpower=0

[State 0, Explod]
type = Explod
trigger1 = movehit && numtarget
trigger1 = !(target, time)
anim = 8210+(random%8)
ID = 8200
pos = 0,0
postype = p1
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
sprpriority = 10
ownpal = 1
ignorehitpause = 1
persistent = 0

[State 0, Fire Explod]
type = Explod
triggerall = NumExplod(8055)<5
trigger1 = movehit && numtarget
trigger1 = !(target, time)
anim = 8055+(random%4)
ID = 8055
postype = p2
pos = enemy,const(size.mid.pos.x),enemy,const(size.mid.pos.y)
random=60,60
bindtime = -1
removetime = -2
sprpriority = ifelse(random<500,5,-1)
ownpal = 1
removeongethit = 0
ignorehitpause = 1
persistent=0

[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 3
range = -5,-1
[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 4
range = -1,1

[State 0, Explod]
type = Explod
;triggerall = (time = [8,64])
trigger1 = (gametime%3)=0
anim = 1070+(random%2)
ID =1070
pos = 0,0
vel = var(3),var(4)
random = 10,45
postype = p1
bindtime = 1
removetime = -2
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = Time = 0&&PrevStateNo!=1020
helpertype = normal ;player
name = "Dust FX"
ID = 8015
stateno = 8015
pos = Ceil(-30*root,const(size.xscale)),-Ceil(parent,Pos Y)
postype = p1
ownpal = 0
size.xscale=root,const(size.xscale)
size.yscale=root,const(size.yscale)
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = movecontact
value = ifelse((var(1) < var(10)), 1020, 1021)
ignorehitpause=1
[State 0, DestroySelf]
type = DestroySelf
trigger1 = backedgedist < -120||frontedgedist < -120
;------------------------------
[StateDef 1021]
type = A
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 1021
sprpriority = 4

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time>=27

;------------------------------
[StateDef 1025]
type = A
movetype= A
physics = N
velset = 0,0
;anim=1020
ctrl = 0
sprpriority = 4

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time=0&&anim!=1015
value = 1015

[State 0, VarSet]
type = VarSet
trigger1 = time=0&&prevstateno!=1025
var(10)=5
[State 0, VarSet]
type = VarSet
trigger1 = time=0
var(2)=floor(root,p2dist X)
[State 0, VarAdd]
type = VarAdd
trigger1 = time=0
var(1)=1
ignorehitpause=1
persistent=0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0&&prevstateno!=1025
value = S10,0
volume = 0
channel = -1

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
stateno = 1026
time = 1
ignorehitpause = 1
[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignorehitpause=1

[State 0, VelSet]
type = VelSet
trigger1 = Time=0
x = 9;ifelse(var(10)=3, 7.5,ifelse(var(10)=2, 6, 4.5))
y = var(5)

[State 0, VarRandom]
type = VarRandom
triggerall = prevstateno!= 1025
trigger1 = time>=0
v = 5
range = -5,5

[State 0, AfterImage]
type = AfterImage
trigger1 = time=0
time = 9999
length = 6
timegap = 1
framegap = 2
trans = add

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit && numtarget
trigger1 = !(target, time)
value = S1,9
channel = 1
persistent=0
ignorehitpause=1

[State 225, hit]
type=hitdef
trigger1=time=0
attr=A,HP
damage=ceil(ifelse(var(2)<100, 18, 12)*root,fvar(10)),3
animtype=Hard
guardflag=MA
hitflag=MAF
priority=4,Hit
pausetime=1,9
sparkno=-1;s8210+(random%8)
guard.sparkno=s8100
sparkxy=-10,0
hitsound=-1,0
guardsound=s2,0
ground.type=High
ground.slidetime=18
ground.hittime=24
ground.velocity=-9.1;,ifelse(var(2)<100,-4,0)
ground.cornerpush.veloff=0
air.type=Low
air.hittime=24
air.velocity=-9.1,-4
;fall=ifelse(var(2)<100,1,0)
;fall.yvelocity=0
yaccel=.63
persistent=0
sprpriority=4
palfx.time = 48
palfx.color = 32
palfx.sinadd = 80, 25, 0, 8
palfx.mul = 512, 256, 128
envshake.time = 12
envshake.ampl = 3
getpower=0

[State 0, Explod]
type = Explod
trigger1 = movehit && numtarget
trigger1 = !(target, time)
anim = 8220+(random%8)
ID = 8200
pos = 0,0
postype = p1
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
sprpriority = 10
ownpal = 1
ignorehitpause = 1
persistent = 0

[State 0, Dark Fire Explod]
type = Explod
triggerall = NumExplod(8060)<5
trigger1 = movehit && numtarget
trigger1 = !(target, time)
anim = 8060+(random%4)
ID = 8060
postype = p2
pos = enemy,const(size.mid.pos.x),enemy,const(size.mid.pos.y)
random=60,60
bindtime = -1
removetime = -2
sprpriority = ifelse(random<500,5,-1)
ownpal = 1
removeongethit = 0
ignorehitpause = 1
persistent=0

[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 3
range = -7,-3
[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 4
range = -3,3

[State 0, Explod]
type = Explod
;triggerall = (time = [8,64])
trigger1 = (gametime%3)=0
anim = 1060+(random%2)
ID =1060
pos = 0,0
vel = var(3),var(4)
random = 10,75
postype = p1
bindtime = 1
removetime = -2
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = movecontact
value = ifelse((var(1) < var(10)), 1025, 1026)
ignorehitpause=1
[State 0, ChangeState]
type = ChangeState
trigger1 = Pos Y >= 0
value = 1026
ignorehitpause=1
[State 0, DestroySelf]
type = DestroySelf
trigger1 = backedgedist < -120||frontedgedist < -120
;------------------------------
[StateDef 1026]
type = A
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 1016
sprpriority = 4

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time>=27
;------------------------------
[Statedef 1055]
type = A
movetype = I
physics = N
ctrl = 0
sprpriority = 6
velset = 0,0
juggle = 0

[State 0, Trans]
type = Trans
trigger1 = 1
trans = add1
ignorehitpause=1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = ifelse(root,stateno=1002,1056,1055)

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
scale=.75,.75

[State 0, AngleAdd]
type = AngleAdd
triggerall = time = 0
trigger1 = root,stateno=1001
trigger2 = root,stateno=3001
value = -25

[State 0, BindToRoot]
type = BindToRoot
trigger1 = root,stateno = 1000 || root,stateno = 1002
time=2
pos = ceil(98*const(size.xscale)),ceil(-53*const(size.yscale))
ignorehitpause = 1

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 9999
length = 6
framegap = 1
trans = add

[State 901:destroyself]
type = destroyself
;trigger1 = root,movetype=H
;trigger2 = root,stateno!=[1000,1002]
trigger1 = animtime=0
;------------------------------
[Statedef 1090]
type = A
movetype = I
physics = N
ctrl = 0
;anim = (root,anim)+90
sprpriority = 3
velset = 0,0
juggle = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1090

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1
time=2
ignorehitpause = 1

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 2
time = 9999
length = 6
framegap = 1
trans = add1

[State 901:destroyself]
type = destroyself
trigger1 = root,movetype=H
trigger2 = root,stateno!=[1000,1002]
trigger3 = animtime=0
;------------------------------
[Statedef 1091]
type = A
movetype = I
physics = N
ctrl = 0
;anim = (root,anim)+90
sprpriority = 3
velset = 0,0
juggle = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1091

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1
time=2
ignorehitpause = 1

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 2
time = 9999
length = 6
framegap = 1
trans = add1

[State 901:destroyself]
type = destroyself
trigger1 = root,movetype=H
trigger2 = root,stateno!=1001&&root,stateno!=1501
trigger3 = animtime=0
;------------------------------
[Statedef 1092]
type = A
movetype = I
physics = N
ctrl = 0
;anim = (root,anim)+90
sprpriority = 3
velset = 0,0
juggle = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1092

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1
time=2
ignorehitpause = 1

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 2
time = 9999
length = 6
framegap = 1
trans = add1

[State 901:destroyself]
type = destroyself
trigger1 = root,movetype=H
trigger2 = root,stateno!=1001
trigger3 = animtime=0
;------------------------------
[StateDef 1150]
type = A
movetype= I
physics = N
ctrl = 0
;anim = 1150
sprpriority = 3

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = 1
value = 1150
elem = root,time

[State 0, BindToParent]
type = BindToParent
trigger1 = 1
time=2
ignorehitpause = 1

[State 0, Trans]
type = Trans
trigger1 = 1
value = add1
ignorehitpause = 1

[State 1150, end]
type = ChangeState
trigger1 = (root,anim=1100)&&root,time>=8
trigger2 = (root,anim=3101)&&root,time>=8
trigger3 = (root,anim=3102)&&root,time>=8
trigger4 = (root,anim=3103)&&root,time>=8
trigger5 = (root,anim=3105)&&root,time>=8
trigger6 = (root,anim=3106)&&root,time>=8
value = 1151

[State 0, DestroySelf]
type = DestroySelf
trigger1 = root,stateno!=[1100,1109]
trigger1 = root,stateno!=[3101,3109]
trigger2 = root,movetype=H

;------------------------------
[StateDef 1151]
type = A
movetype= I
physics = N
ctrl = 0
anim = 1151
sprpriority = 3

[State 0, Trans]
type = Trans
trigger1 = 1
value = add1
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S10,20
channel = -1

[State 0, BindToParent]
type = BindToParent
trigger1 = 1
time=2
ignorehitpause = 1

[State 0, AfterImage]
type = AfterImage
trigger1 = animelem = 1
time = 9999
length = 10
framegap = 1
timegap=1
trans = add

[State 1150, end]
type = ChangeState
trigger1 = (root,anim=1105)
trigger2 = (root,anim=3101)&&root,time>=14
trigger3 = (root,anim=3102)&&root,time>=14
value = 1152

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 1
range = -6,6
[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 2
range = 3,9

[State 0, Explod]
type = Explod
trigger1 = (gametime%2)=0
anim = 1008
ID = 1190
pos = 20,-60
vel = var(1),var(2)
random = 5,70
postype = p1
bindtime = 1
removetime = 10
scale = .5,.2
accel = -1/3*(var(1)),-(var(2))/6
supermovetime=9999
pausemovetime=9999
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = (gametime%2)=0
anim = 1008
ID = 1190
pos = 20,-60
vel = var(1),var(2)
random = 5,70
postype = p1
bindtime = 1
removetime = 10
scale = .2,.5
accel = -1/3*(var(1)),-(var(2))/6
supermovetime=9999
pausemovetime=9999
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, Explod]
type = Explod
;triggerall = (time = [8,64])
trigger1 = (gametime%2)=0
anim = 1060+(random%2)
ID =1060
pos = 20,-90
random = 5,70
vel = var(1),var(2)
accel = -1/3*(var(1)),-(var(2))/6
postype = p1
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = root,stateno!=[1100,1109]
trigger1 = root,stateno!=[3101,3109]
trigger2 = root,movetype=H

;------------------------------
[StateDef 1152]
type = A
movetype= I
physics = N
ctrl = 0
anim = 1152
sprpriority = 3

[State 0, Trans]
type = Trans
trigger1 = 1
value = add1
ignorehitpause = 1

[State 0, BindToParent]
type = BindToParent
trigger1 = 1
time=2
ignorehitpause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = root,stateno!=[1100,1109]
trigger1 = root,stateno!=[3101,3109]
trigger2 = root,movetype=H
trigger3 = animtime=0
;------------------------------
[Statedef 1250]
type = A
movetype = I
physics = N
ctrl = 0
anim = 1250
sprpriority = 5
velset = 0,0
juggle = 0

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1
ignorehitpause = 1

[State 0, AfterImage]
type = AfterImage
trigger1 = animelem=2
time = 9999
length = 15
framegap = 1
timegap=1
trans = add

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S10,1
channel = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 1
range = -3,3
[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 2
range = -6,-3

[State 0, Explod]
type = Explod
trigger1 = time = [2,8]
anim = 1008
ID = 1250
pos = 0,-70
random = 35,5
postype = p1
bindtime = 1
removetime = 15
vel = var(2),(var(1))
scale = 0.25,0.25
accel = -1/3*(var(1)),-(var(1))/6
sprpriority = 4
ownpal = 0
removeongethit = 0
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = time = [2,8]
anim = 1008
ID = 1250
pos = 0,-70
random = 35,5
postype = p1
bindtime = 1
removetime = 15
vel = var(2),(var(1))
scale = 0.25,0.25
accel = -1/3*(var(1)),-(var(1))/6
sprpriority = 4
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, ChangeState]
type = DestroySelf
trigger1 = animelemno(0)=7
trigger2 = root,movetype=H
trigger3 = root,stateno!=[1205,1212]
trigger3 = root,stateno!=[3205,3206]
;------------------------------
[Statedef 1251]
type = A
movetype = I
physics = N
ctrl = 0
anim = 1251
sprpriority = -1
velset = 0,0
juggle = 0

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1
ignorehitpause = 1

[State 0, AfterImage]
type = AfterImage
trigger1 = animelem=2
time = 9999
length = 15
framegap = 1
timegap=1
trans = add

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S10,1
channel = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 1
range = -3,3
[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 2
range = 3,6

[State 0, Explod]
type = Explod
trigger1 = time = [2,8]
anim = 1008
ID = 1250
pos = 0,-70
random = 35,5
postype = p1
bindtime = 1
removetime = 15
vel = var(2),(var(1))
scale = 0.25,0.25
accel = -1/3*(var(1)),-(var(1))/6
sprpriority = -1
ownpal = 0
removeongethit = 0
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = time = [2,8]
anim = 1008
ID = 1250
pos = 0,-70
random = 35,5
postype = p1
bindtime = 1
removetime = 15
vel = var(2),(var(1))
scale = 0.25,0.25
accel = -1/3*(var(1)),-(var(1))/6
sprpriority = -1
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, ChangeState]
type = DestroySelf
trigger1 = animelemno(0)=7
trigger2 = root,movetype=H
trigger3 = root,stateno!=[1205,1212]
trigger3 = root,stateno!=[3205,3206]

;------------------------------
[StateDef 1350]
type = A
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 1350
sprpriority = 5

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S10,20
channel = -1

[State 0, Trans]
type = Trans
trigger1 = 1
trans=Add
ignorehitpause = 1

[State 0, BindToRoot]
type = BindToRoot
trigger1 = (root,stateno=[1300,1305])
time=2
pos = ceil(65*const(size.xscale)),ceil(-10*const(size.yscale))

[State 0, BindToRoot]
type = BindToRoot
trigger1 = (root,stateno=3300)
time=2
pos = ceil(40*const(size.xscale)),ceil(-10*const(size.yscale))

[State 0, AngleAdd]
type = AngleAdd
trigger1 = Time=0
value = -45

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 1
range = -5,5
[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 2
range = -3,3

[State 0, Explod]
type = Explod
trigger1 = time < 24
trigger1 = (gametime%2)=0
anim = 1060+(random%2)
ID =1360
pos = 0,0
vel = Var(1),Var(2)
random = 10,45
postype = p1
bindtime = 1
removetime = -2
accel = -1/3*(var(1)),-(var(2))/6
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, Explod]
type = Explod
trigger1 = time < 24
trigger1 = (gametime%2)=0
anim = 1060+(random%2)
ID =1360
pos = 0,0
vel = Var(1),Var(2)
random = 10,45
postype = p1
bindtime = 1
removetime = -2
accel = -1/3*(var(1)),-(var(2))/6
sprpriority = -1
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = (root,stateno!= [1300,1305])&&(root,stateno!= 3300)||(numhelper(7005)>0)
trigger2 = root,movetype = H
trigger3 = AnimTime = 0

;---------------------------------------------------------------------------;
[Statedef 3005]
type = A
movetype = A
physics = N
juggle = 0
ctrl = 0
;anim = 3005
velset = 0,0
poweradd = 0
sprpriority=4

[State 0, PlaySnd]
type = PlaySnd
triggerall = prevstateno!= 3005
trigger1 = time = 0
value = S10,5
channel = -1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0 && anim!=3005
value = 3005

[State 0, BindToRoot]
type = BindToRoot
trigger1 = root,anim=3000
pos = ceil(118*const(size.xscale)),ceil(-53*const(size.yscale))

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 3
helpertype = normal ;player
name = "KoF2002 Flame"
ID = 3008
stateno = 3008
pos = 0,0;ceil(118*const(size.xscale)),ceil(-53*const(size.yscale))
postype = p1
ownpal = 0
size.xscale=const(size.xscale)
size.yscale=const(size.yscale)

[State 1001]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animtime = 0

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AP,AT
stateno = 3005

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AT

[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AP

[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 1
range = -600,0
[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 2
range = -45,45
[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 3
range = -5,5

[State 1, hit]
type=hitdef
;triggerall = (time < 8)||(time>74)
trigger1 = hitcount<25
trigger1 = (time%3)=0
attr=A,HA
damage=ceil(15*root,fvar(10)),2
animtype=Back
guardflag=MA
hitflag=MAF
priority=4,Hit
pausetime=1,1
sparkno=-1;s8220+(random%8)
guard.sparkno=s8100
sparkxy=ceil(var(1)/10),0
hitsound=-1,6
guardsound=s2,0
ground.type=High
ground.slidetime=19
ground.hittime=21
ground.velocity=-20,-2;-12.75,-3
ground.cornerpush.veloff=0
air.type=Low
air.hittime=18
p2facing=1
fall=1
fall.recover=0
fall.yvelocity=0
air.velocity=-20,-.75;-9,-1
yaccel = .63
sprpriority = 4
envshake.time = 3
envshake.ampl = 1
palfx.time = 48
palfx.sinadd = 64, 64, 64, 4
palfx.mul = 128, 128, 128
getpower=0

[State 2, hit]
type=null;hitdef
trigger1 = animelem=6
trigger2 = animelem=8
trigger3 = animelem=10
trigger4 = animelem=12
trigger5 = animelem=14
trigger6 = animelem=16
trigger7 = animelem=18
trigger8 = animelem=20
trigger9 = animelem=22
trigger10 = animelem=24
trigger11 = animelem=26
trigger12 = animelem=28
trigger13 = animelem=30
trigger14 = animelem=32
trigger15 = animelem=34
trigger16 = animelem=36
trigger17 = animelem=38
attr=A,HA
damage=ceil(18*root,fvar(10)),1
animtype=Back
guardflag=MA
hitflag=MAF
priority=4,Hit
pausetime=1,1
sparkno=-1;s8220+(random%8)
guard.sparkno=s8100
sparkxy=ceil(var(1)/10),0
hitsound=-1,6
guardsound=s2,0
ground.type=High
ground.slidetime=19
ground.hittime=21
ground.velocity=-20,-2;-12.75,-3
ground.cornerpush.veloff=0
air.type=Low
air.hittime=18
p2facing=1
fall=1
fall.recover=0
fall.yvelocity=0
air.velocity=-20,-1;-9,-1
yaccel = .63
sprpriority = 4
envshake.time = 3
envshake.ampl = 1
palfx.time = 48
palfx.sinadd = 64, 64, 64, 4
palfx.mul = 128, 128, 128
getpower=0

[State 0, PlaySnd]
type = PlaySnd
triggerall = numtarget
triggerall = movehit
trigger1 = target,time<=0
value = S1,17
channel = 0
volume=255
ignorehitpause = 1

[State 0, Explod]
type = Explod
triggerall = numtarget
triggerall = movehit
trigger1 = target,time<=0
anim = 3006+(root,var(58)*10000)
ID = 3006
pos = ceil(var(1)/10),target,const(size.mid.pos.y)
postype = p2  ;p2,front,back,left,right
facing = -1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 10
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, Explod]
type = Explod
triggerall = (time = [8,64])
trigger1 = (gametime%2)=0
anim = 3020
ID = 3020
pos = 0,ceil(var(2))
vel = 25,0
accel = .25,0
postype = p1
facing = 1
bindtime = 1
removetime = 20
scale = 5,.1
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, Explod]
type = Explod
triggerall = (time = [8,64])
trigger1 = (gametime%2)=0
anim = 1008
ID = 3021
pos = 0,0;ceil(var(2))
vel = 12,var(3)
accel = .25,0
postype = p1
facing = 1
bindtime = 1
removetime = 20
scale = .5,.25
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1
;-----------------------------------------
[State 0, Explod]
type = Explod
trigger1 = animelemtime(6)=0
trigger2 = animelemtime(16)=0
trigger3 = animelemtime(26)=0
trigger4 = animelemtime(36)=0
anim = 1055
ID = 1055
pos = ceil(30*root,const(size.xscale)),0
postype = p1  ;p2,front,back,left,right
bindtime = -1
random = 0,0
removetime = -2
scale = root,const(size.xscale),root,const(size.yscale)/1.5
sprpriority = 9
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, Explod]
type = Explod
trigger1 = animelemtime(7)=0
trigger2 = animelemtime(17)=0
trigger3 = animelemtime(27)=0
trigger4 = animelemtime(37)=0
anim = 1055
ID = 1055
pos = ceil(90*root,const(size.xscale)),0
postype = p1  ;p2,front,back,left,right
bindtime = -1
random = 0,0
removetime = -2
scale = root,const(size.xscale),root,const(size.yscale)/1.5
sprpriority = 9
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, Explod]
type = Explod
trigger1 = animelemtime(8)=0
trigger2 = animelemtime(18)=0
trigger3 = animelemtime(28)=0
trigger4 = animelemtime(38)=0
anim = 1055
ID = 1055
pos = ceil(150*root,const(size.xscale)),0
postype = p1  ;p2,front,back,left,right
bindtime = -1
random = 0,0
removetime = -2
scale = root,const(size.xscale),root,const(size.yscale)/1.5
sprpriority = 9
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, Explod]
type = Explod
trigger1 = animelemtime(9)=0
trigger2 = animelemtime(19)=0
trigger3 = animelemtime(29)=0
trigger4 = animelemtime(39)=0
anim = 1055
ID = 1055
pos = ceil(210*root,const(size.xscale)),0
postype = p1  ;p2,front,back,left,right
bindtime = -1
random = 0,0
removetime = -2
scale = root,const(size.xscale),root,const(size.yscale)/1.5
sprpriority = 9
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, Explod]
type = Explod
trigger1 = animelemtime(10)=0
trigger2 = animelemtime(20)=0
trigger3 = animelemtime(30)=0
trigger4 = animelemtime(40)=0
anim = 1055
ID = 1055
pos = ceil(270*root,const(size.xscale)),0
postype = p1  ;p2,front,back,left,right
bindtime = -1
random = 0,0
removetime = -2
scale = root,const(size.xscale),root,const(size.yscale)/1.5
sprpriority = 9
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
;------------------------------------------
[State 0, Explod]
type = Explod
triggerall = time>=10;(time = [8,64])
trigger1 = (gametime%3)=0
anim = 1060+(random%2)
ID =1060
pos = 140,30
random = 280,60
vel = .25,0
accel = .1,0
postype = p1
bindtime = 1
removetime = -2
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1
[State 0, Explod]
type = Explod
triggerall = time>=10;(time = [8,64])
trigger1 = (gametime%3)=0
anim = 1060+(random%2)
ID =1060
pos = 140,-30
random = 280,60
vel = .25,0
accel = .1,0
postype = p1
bindtime = 1
removetime = -2
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 1002]
type = Destroyself
trigger1 = animtime = 0
trigger2 = root,stateno!=[3000,3001]
trigger3 = root,movetype=H

;---------------------------------------------------------------------------;
[Statedef 3007]
type = A
movetype = I
physics = N
juggle = 0
ctrl = 0
;anim = 3005
velset = 0,0
poweradd = 0
sprpriority=4

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0 && root,anim=3000
value = 3007

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 9999
length = 5
framegap = 1
trans = add

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1

[State 1001]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 1002]
type = Destroyself
trigger1 = root,time>=154
trigger2 = root,movetype=H
trigger3 = root,stateno!=[3000,3001]
;------------------------------------
[StateDef 3008]
type = A
movetype= I
physics = N
velset = 0,0
ctrl=0
anim = 3008
sprpriority = 5

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 1
time = 9999
length = 9
framegap = 1
trans = add

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=1
value = S10,28
volume=255
channel = -1

[State 0, BindToRoot]
type = BindToRoot
trigger1 = root,anim=3000
pos = ceil(118*const(size.xscale)),ceil(-53*const(size.yscale))

[State 0, AngleAdd]
type = AngleAdd
trigger1 = time=0
value = -90

[State 0, AngleDraw]
type = AngleDraw
trigger1 = time>=0
scale=1,1

[State 0, Trans]
type = Trans
trigger1 = 1
trans = add1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = root,stateno!=3000
trigger2 = root,movetype=H
trigger3 = animtime=0

;---------------------------------------------------------------------------;
[Statedef 3011]
type = A
movetype = I
physics = N
juggle = 0
ctrl = 0
;anim = 3011
velset = 0,0
poweradd = 0
sprpriority=4

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 1
time = 9999
length = 5
framegap = 1
trans = add

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0 && root,anim=3000
value = 3011

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1

[State 1001]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 1002]
type = Destroyself
trigger1 = root,movetype=H
trigger2 = root,stateno!=[3000,3001]
trigger3 = animtime=0

;---------------------------------------------------------------------------;
[Statedef 3015]
type = A
movetype = A
physics = N
juggle = 0
ctrl = 0
;anim = 3015
velset = 0,0
poweradd = 0
sprpriority=5

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0 && anim!=3015+(root,var(58)*10000)
value = 3015+(root,var(58)*10000)

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 9999
length = 5
framegap = 1
trans = add

[State 0, BindToRoot]
type = BindToRoot
trigger1 = root,anim=3000||root,anim=23000

[State 0, BindToRoot]
type = BindToRoot
trigger1 = root,anim=3001||root,anim=23001
pos = ceil(-16*const(size.xscale)),ceil(-18*const(size.yscale))

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 1002]
type = Destroyself
trigger1 = animtime = 0
trigger2 = root,stateno!=[3000,3001]
trigger3 = root,movetype=H
;---------------------------------------------------------------------------;
[Statedef 3016]
type = A
movetype = A
physics = N
juggle = 0
ctrl = 0
;anim = 3016
velset = 0,0
poweradd = 0
sprpriority=3

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0 && anim!=3016+(root,var(58)*10000)
value = 3016+(root,var(58)*10000)

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 9999
length = 5
framegap = 1
trans = add

[State 0, BindToRoot]
type = BindToRoot
trigger1 = root,anim=3000||root,anim=23000

[State 0, BindToRoot]
type = BindToRoot
trigger1 = root,anim=3001||root,anim=23001
pos = ceil(-16*const(size.xscale)),ceil(-18*const(size.yscale))

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 1002]
type = Destroyself
trigger1 = animtime = 0
trigger2 = root,stateno!=[3000,3001]
trigger3 = root,movetype=H

;---------------------------------------------------------------------------;
[Statedef 3025]
type = A
movetype = A
physics = N
juggle = 0
ctrl = 0
;anim = 3025
velset = 0,0
poweradd = 0
sprpriority=5

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0 && anim!=3025
value = 3025

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 9999
length = 5
framegap = 1
trans = add

[State 0, PlaySnd]
type = PlaySnd
trigger1 = (time%21)=1
value = S10,1
volume=255
channel = -1

[State 0, BindToRoot]
type = BindToRoot
trigger1 = root,anim=3000||root,anim=23000

[State 0, BindToRoot]
type = BindToRoot
trigger1 = root,anim=3001||root,anim=23001
pos = 0,ceil(-24*const(size.yscale))

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 1002]
type = Destroyself
trigger1 = root,time>12
trigger2 = root,stateno!=[3000,3001]
trigger3 = root,movetype=H

[StateDef 3050]
type = A
movetype= I
physics = N
velset = 12,0
ctrl=0
anim = 3050
sprpriority = 8

[State 0, VarRandom]
type = VarRandom
trigger1 = time = 0
v = 1
range = -5,5

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
y = var(1)

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 1
time = 9999
length = 9
framegap = 1
trans = add

[State 0, DestroySelf]
type = DestroySelf
trigger1 = frontedgedist <= -70;time >= 20
trigger2 = root,stateno!=[3000,3001]

;-------------------------------------------------------------------------------
; Hadouken
[StateDef 3055]
type = A
movetype= A
physics = N
juggle  = 5
;velset = ifelse(var(10)=2, 9, ifelse(var(10)=1, 7, 5)),0
ctrl = 0
anim = 1010
sprpriority = 4

[State 0, VelSet]
type = VelSet
trigger1 = time=0
x = 6.5
y = 4.5

[State 0, VarSet]
type = VarSet
trigger1 = time=0
var(2)=floor(root,p2dist X)

[State 1055, Shadows]
type = afterimage
trigger1 = !time && !prevstateno
time = 999
timegap = 1
framegap = 2
length = 6
palcontrast = 100, 50, 100
trans = add

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S10,0
volume = 0
channel = -1

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AP,AT
stateno = 3056
ignorehitpause=1

[State 0, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AP
ignorehitpause = 1

[State 1005, 1]
type = HitDef
triggerall = var(2)>100;p2bodydist X > 18
trigger1 = time = 0
attr = A, HP
damage = ceil(12*root,fvar(10)),2
animtype = Hard
guardflag = MA
hitflag = MAFD
priority = 3, Hit
pausetime = 1, 9
sparkno = -1;S8210+(random%8)
sparkxy = -10, 0
hitsound = -1;S1,9
guardsound = S2,0
ground.type = High
ground.slidetime = 18
ground.hittime  = 24
air.hittime = 24
ground.velocity = -9.1,-2.5
air.velocity = -9.1,-2.5
down.velocity=-3,0
air.type = High
fall.yvelocity=0
fall=1
fall.recover=0
yaccel=.63
sprpriority = 4
envshake.time=3
envshake.ampl=-1
palfx.time = 48
palfx.sinadd = 64, 64, 64, 4
palfx.mul = 128, 128, 128

[State 1005, 1]
type = HitDef
triggerall = var(2)<=100;p2bodydist X <= 18
trigger1 = time = 0
attr = A, HP
damage = ceil(18*root,fvar(10)),4
animtype = Hard
guardflag = MA
hitflag = MAFD
priority = 3, Hit
pausetime = 1, 9
sparkno = -1;S8210+(random%8)
sparkxy = -10, 0
hitsound = -1;S1,9
guardsound = S2,0
ground.type = High
ground.slidetime = 18
ground.hittime  = 24
air.hittime = 24
ground.velocity = -9.1,-2.5
air.velocity = -9.1,-2.5
down.velocity=-3,0
air.type = High
fall.yvelocity=0
fall=1
fall.recover=0
yaccel=.63
sprpriority = 4
envshake.time=3
envshake.ampl=-1
palfx.time = 48
palfx.sinadd = 64, 64, 64, 4
palfx.mul = 128, 128, 128

[State 0, Explod]
type = Explod
triggerall = numtarget
triggerall = movehit
trigger1 = target,time<=0
anim = 8220+(random%8)
ID = 8200
postype = p1
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
sprpriority = 5
ownpal = 0
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = numtarget
triggerall = movehit
trigger1 = target,time<=0
value = S1,9
channel = -1
ignorehitpause = 1

[State 0, Explod]
type = Explod
;triggerall = (time = [8,64])
trigger1 = (gametime%3)=0
anim = 1060+(random%2)
ID =1060
pos = 0,0
vel = var(1),var(2)
random = 10,45
postype = p1
bindtime = 1
removetime = -2
sprpriority = 8
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 1
range = -3,-1
[State 0, VarRandom]
type = VarRandom
trigger1 = time>=0
v = 2
range = -3,3

[State 0, ChangeState]
type = ChangeState
trigger1 = movecontact||movereversed
trigger2 = rootdist X != [-640,640]
trigger3 = Pos Y >= 0
value = 3056

[StateDef 3056]
type = A
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 1011
sprpriority = 4

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time>=27
;------------------------------
[Statedef 3091]
type = A
movetype = I
physics = N
ctrl = 0
;anim = (root,anim)+90
sprpriority = 3
velset = 0,0
juggle = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 3091

;[State 0, BindToRoot]
;type = BindToRoot
;trigger1 = 1
;time=2
;ignorehitpause = 1

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 2
time = 9999
length = 6
framegap = 1
trans = add1

[State 901:destroyself]
type = destroyself
trigger1 = root,movetype=H
trigger2 = root,stateno!=3001
trigger3 = animtime=0
;------------------------------
[Statedef 3092]
type = A
movetype = I
physics = N
ctrl = 0
;anim = (root,anim)+90
sprpriority = 3
velset = 0,0
juggle = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 3092

;[State 0, BindToRoot]
;type = BindToRoot
;trigger1 = 1
;time=2
;ignorehitpause = 1

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 2
time = 9999
length = 6
framegap = 1
trans = add1

[State 901:destroyself]
type = destroyself
trigger1 = root,movetype=H
trigger2 = root,stateno!=3001
trigger3 = animtime=0
;------------------------------------------------------------------------
;Leave Everything Below From This Point Alone
;------------------------------------------------------------------------
[Statedef 7005]
type = S
movetype = I
physics = N
ctrl = 0
anim = 9741
sprpriority = 5
juggle = 0

[State 901:Assertspecial]
type = assertspecial
trigger1 = 1
flag = nobardisplay

[State 901:Assertspecial]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 901:playerpush]
type = PlayerPush
trigger1 = 1
value = 0
persistent = 1

[State 901: NotHitBy]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA,AA,AT
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S7001,1
volume = 255
channel = 15

[State 0, EnvColor]
type = BGPalFX
;trigger1 = animelem = 1
trigger1 = time <= 50
add = -200,-200,-200
;sinadd=-255,-255,-255,160
;mul = 10-((time)*10),10-((time)*10),10-((time-45)*10)
;mul = ceil(1-((animtime-15)*10)),ceil(10-((animtime)*15)),ceil(140-((animtime-30)*10))
time = 1
;invertall = 1
;ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = (time = 0) && (parent,stateno=3400)
helpertype = normal ;player
name = "portraitlvl3"
ID = 7006
stateno = 7006
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermove = 99999
pausemove = 99999
supermovetime=9999

[State 0, Explod]
type = Explod
trigger1 = time =0
anim = 7005
ID =  7000
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermove =999999
pausemove =999999
supermovetime=9999
scale = 1,1
sprpriority = 4
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, Explod]
type = Explod
triggerall = parent,stateno !=3400
trigger1 = time =0
anim = 7009
ID =  7009
pos = 73,133
postype = back ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 5
vel = 0,0
accel = 0,0
random = 0,0
removetime = 10
supermove =999999
pausemove =999999
scale = .5,.5
sprpriority = -3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 0, Explod]
type = Explod
triggerall= parent,stateno !=3400
trigger1 = time =10
anim = 7009
ID =  7010
pos = 73,133
postype = back ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 5
vel = -.15,0
accel = 0,0
random = 0,0
removetime = 50
supermove =999999
pausemove =999999
scale = .5,.5
sprpriority = -3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 4300, shrink]
type=modifyexplod
trigger1=numexplod(7009) && time <=10
ID=7009
scale = 2.5-(.21*(time)),2.5-(.21*(time))

[State 4300, shrink]
type=modifyexplod
trigger1=numexplod(7009) && time >10
ID=7010
scale = .5,.5

[State 4300, circle]
type=explod
trigger1=time = 28
anim=7007
ID=7007
sprpriority=5
postype=p1
ownpal = 1
removetime=30
supermovetime=300

[State 4300, shrink]
type=modifyexplod
trigger1=numexplod(7007)
ID=7007
scale = .5+(.04*(time-28)),.5+(.04*(time-28))

[State 4300, circle]
type=explod
trigger1=time = 20
anim=7008
ID=7008
sprpriority=5
postype=p1
ownpal = 1
removetime=30
supermovetime=300

[State 4300, shrink]
type=modifyexplod
trigger1=numexplod(7008)
ID=7008
scale = .5+(.08*(time-20)),.5+(.08*(time-20))

[State -3, StopSnd]
type = StopSnd
trigger1 = time >=50
trigger2 = parent,movetype=H
channel = 15
ignorehitpause = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time >=50
trigger2 = parent,movetype=H

[State 901:destroyself]
type = destroyself
trigger1 = time >=50
trigger2 = parent,movetype=H
;------------------------------------------------------------------------
[Statedef 7006]
type = S
movetype = I
physics = N
ctrl = 0
anim = 9741
sprpriority = 5
juggle = 0

[State 0, BindToParent]
type = BindToParent
trigger1 = 1
time = 2
;facing = 0
;pos = 0,0
;ignorehitpause =
;persistent =

[State 901:Assertspecial]
type = assertspecial
trigger1 = 1
flag = nobardisplay

[State 901:Assertspecial]
type = assertspecial
trigger1 = 1
flag = noshadow

[State 901:playerpush]
type = PlayerPush
trigger1 = 1
value = 0
persistent = 1

[State 901: NotHitBy]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA,AA,AT
ignorehitpause = 1

[State 0, Explod]
type = Explod
trigger1 = time =0
anim = 7010
ID =  7010
pos = 160,119
postype = back ;p2,front,back,left,right
facing = ifelse((root,facing= 1),1,-1)
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermove =999999
pausemove =999999
scale = 1,1
sprpriority = -5
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1

[State 4300, shrink]
type=modifyexplod
trigger1=numexplod(7010) && time <=8
ID=7010
scale = .5,.5;2-(.145*(time)),2-(.145*(time))

[State 4300, shrink]
type=modifyexplod
trigger1=numexplod(7010) && time = [9,40]
ID=7010
scale = .5,.5

[State 4300, shrink]
type=modifyexplod
trigger1=numexplod(7010) && time >40
ID=7010
scale = .5+(.16*(time-40)),.5+(.16*(time-40))

[State 0, PalFX]
type = PalFX
trigger1=numexplod(7010) && time <=20
time = 1
add = 255-(10*(time)),255-(10*(time)),255-(10*(time))

[State 0, PalFX]
type = PalFX
trigger1=numexplod(7010) && time >40
time = 1
add = 0-(10*(time-40)),0-(10*(time-40)),0-(10*(time-40))

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time >=50
trigger2 = root,movetype=H

[State 901:destroyself]
type = destroyself
trigger1 = time >=50
trigger2 = root,movetype=H
;========================<KANJI B.G.>=============================
[Statedef 7610]
physics=N
velset=0,0
anim=9741

[State 7610, assert]
type=assertspecial
trigger1=time<120
flag=nomusic

[State 7610, snd]
type=playsnd
trigger1=!time
value=7610,0

[State 7610, black]
type=bgpalfx
trigger1=time<120
time=2
add=-255,-255,-255

[State 7610, black]
type=bgpalfx
trigger1=time=120
time=60
add=-255,-255,-255
sinadd=255,255,255,240

[State 7610, fade]
type=palfx
trigger1=time=120
time=60
sinadd=-255,-255,-255,240

[State 7610, kanji]
type=explod
trigger1=!time
anim=ifelse(root,palno=12,7615,7610)
ID=7610
sprpriority=-5
postype=left
pos=160,120
scale=.5,.5
bindtime=-1

[State 7610, shrink]
type=modifyexplod
trigger1=time<6
ID=7610
scale=(5.5-time),(5.5-time)

[State 7610, shrink]
type=modifyexplod
trigger1=time>=6
ID=7610
scale=.5,.5

[State 7610, flamebg]
type=explod
trigger1=!time
anim=7611
ID=7611
sprpriority=5
postype=left
pos=0,0
bindtime=-1
removetime=-1
pausemovetime=300
supermovetime=300

;[State 9999, PlaySnd]
;type = PlaySnd
;triggerall = roundstate = 4
;trigger1 = root,stateno = 362
;trigger2 = root,stateno = [382,383]
;value = s9999,0
;ignorehitpause = 1
;volume = 255
;persistent = 0
;abspan = 1

[State 7610, assert]
type=assertspecial
trigger1=1
flag=invisible
flag2=nobardisplay
ignorehitpause=1

[State 7610, assert]
type=assertspecial
trigger1=time<120
flag=noFG
ignorehitpause=1

[State 7610, safety]
type=removeexplod
trigger1=time>=180

[State 7610, end]
type=destroyself
trigger1=time>=180
;========================<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
;---------------------------------------------------------
;hyper bg
[Statedef 7021]
physics = N
anim = 9741
sprpriority = -3

[State 7020, 9]
type = AssertSpecial
trigger1 = 1;1
flag = noFG
ignorehitpause = 1

[State 7020, 9]
type   = Explod
;triggerall = p2life >0
trigger1 = numexplod(7021)=0
anim = 7021
postype = left
ID = 7021
sprpriority = -10
removetime = -2
pos = 0,0;160,0
scale = 1,1
bindtime = -1
facing=1
ignorehitpause=1
supermovetime=9999
pausemovetime=9999
supermove = 9999
pausemove = 9999

[State 7020, 9] ;animação de fundo
type  = null;Explod
;triggerall = p2life >0
trigger1 = numexplod(7022)=0
anim = 7021
postype = right
ID = 7022
sprpriority = -4
removetime = -2
pos = -160,0
scale = 0.642,1
bindtime = -1
facing=-1
ignorehitpause=1
supermovetime=9999
pausemovetime=9999
supermove = 9999
pausemove = 9999

;[State 8000, 1] ;Anim for Super KO FX
;type = ChangeAnim
;trigger1 = anim=9741 && roundstate=3 && p2life=0
;value = 8550

[State 8500, 7]
Type = RemoveExplod
trigger1 = root, movetype = H
trigger2 = root, var(45)=0;stateno!=3000
trigger3 = numhelper(9998) = 1
trigger4 = numhelper(9999) = 1
trigger5 = numhelper(7005) = 1
;trigger3 = p2life <= 0
;triggerall = root, var(9)<=0
;triggerall = anim=8500
;trigger1 = root, stateno!=3000
;trigger1 = root, stateno!=3100
;trigger1 = root, stateno!=[3000,3604]
;trigger2 = anim=8500 && roundstate=3

[State 8500, 7]
Type = destroyself
trigger1 = root, movetype = H
trigger2 = root, var(45)=0;stateno!=3000
trigger3 = numhelper(9998) = 1
trigger4 = numhelper(9999) = 1
trigger5 = numhelper(7005) = 1
;value = 7022
;trigger3 = p2life <= 0
;triggerall = root, var(9)<=0
;triggerall = anim=8500
;trigger1 = root, stateno!=3000
;trigger1 = root, stateno!=3100
;trigger1 = root, stateno!=[3000,3604]
;trigger2 = anim=8500 && roundstate=3
;---------------------------------------------------------
;hyper bg
[Statedef 7022]
physics = N
anim = 9741
sprpriority = -3

[State 0, Trans]
type = Trans
trigger1 = 1
trans = Add

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0-(time*4),0-(time*4),0-(time*4)
;mul = 256,256,256
;sinadd = 0,0,0,10
invertall = 0
color = 256
;ignorehitpause =
;persistent =

[State 7020, 9]
type = AssertSpecial
trigger1 = 1;1
flag = noFG
ignorehitpause = 1

[State 7020, 9]
type   = Explod
triggerall = p2life >0
trigger1 = numexplod(7021)=0
anim = 70210
postype = left
ID = 7021
sprpriority = -5
supermovetime = 1
removetime = -2
pos = 160,0
scale = 0.642,1
bindtime = -1
facing=1
ignorehitpause=1
supermovetime=9999
pausemovetime=9999
supermove = 9999
pausemove = 9999
ownpal=0

[State 7020, 9] ;animação de fundo
type  = Explod
triggerall = p2life >0
trigger1 = numexplod(7022)=0
anim = 70210
postype = right
ID = 7022
sprpriority = -5
supermovetime = 1
removetime = -2
pos = -160,0
scale = 0.642,1
bindtime = -1
facing=-1
ignorehitpause=1
supermovetime=9999
pausemovetime=9999
supermove = 9999
pausemove = 9999
ownpal=0

;[State 8500, 7]
;Type = RemoveExplod
;trigger1 = root, movetype = H
;trigger2 = root, var(45)=0;stateno!=3000
;trigger3 = p2life <= 0
;triggerall = root, var(9)<=0
;triggerall = anim=8500
;trigger1 = root, stateno!=3000
;trigger1 = root, stateno!=3100
;trigger1 = root, stateno!=[3000,3604]
;trigger2 = anim=8500 && roundstate=3

[State 8500, 7]
Type = Destroyself
trigger1 = time >=40
;trigger2 = root, var(45)=0;stateno!=3000
;trigger3 = p2life <= 0
;triggerall = root, var(9)<=0
;triggerall = anim=8500
;trigger1 = root, stateno!=3000
;trigger1 = root, stateno!=3100
;trigger1 = root, stateno!=[3000,3604]
;trigger2 = anim=8500 && roundstate=3
;========================< ZERO COUNTER CHARGE >=============================
[Statedef 7250]
physics = N
velset = 0, 0
anim = 9741

[State 7250, BG PalFX]
type = bgpalfx
trigger1 = !time
time = 20
add = -255, -128, -64
sinadd = 255, 128, 64, 80
persistent = 0
[State 7250, palfx]
type = palfx
trigger1 = !time
time = 20
sinadd = -255, -255, -255, 80

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

[State 7250, Shrink]
type = modifyexplod
trigger1 = numexplod(7251)
ID = 7251
scale = 0.2 + (0.09 * time), 0.2 + (0.09 * time)
[State 7250, No Shadow]
type = assertspecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1
[State 7250, End]
type = destroyself
trigger1 = time >= 20
;------------------------------
;Hadou Dust FX
[Statedef 8015]
type = A
movetype = I
physics = N
ctrl = 0
anim = 8015
sprpriority = 5
velset = 0,0
juggle = 0

[State 0, BindToRoot]
type = BindToParent
trigger1 = 1
time=2
pos = Ceil(-30*root,const(size.xscale)),-Ceil(parent,Pos Y)
ignorehitpause = 1

[State 0, AfterImage]
type = AfterImage
triggerall = anim = 8015
trigger1 = animelem=4
time = 9999
length = 6
framegap = 1
trans = add1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = (parent,stateno = 1006||parent,stateno=1021)
trigger1 = anim != 8016
value = 8016

[State 901:destroyself]
type = destroyself
trigger1 = !numhelper(1005)&&!numhelper(1020)
trigger2 = anim=8016&&animtime=0
;------------------------------------
[StateDef 9741]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9741, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 0

[State 9741, PauseCheck]
type = VarSet
trigger1 = (GameTime>(Parent,var(59)))
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)
trigger4 = Parent,var(59)
trigger5 = (var(3):=0)
var(2) = (var(3):=1)+(var(4):=0)

[State 9741, Facing]
type = Turn
trigger1 = (var(9):=(Facing != Parent,Facing))

[State 9741, DirTurnOnAI]
type = ParentVarSet
triggerall = !var(3)
triggerall = !var(9)
trigger1 = (Parent,command = "holdfwd")
trigger2 = (Parent,command = "holdback")
trigger3 = (Parent,command = "holdup")
trigger4 = (Parent,command = "holddown")
trigger5 = !(var(4):=1)
var(59) = var(4)

[State 9741, DirTurnOffAI]
type = ParentVarSet
triggerall = !var(3)
triggerall = Parent,var(59)
trigger1 = (command = "holdfwd")
trigger1 = (Parent,command = "holdfwd")
trigger2 = (command = "holdback")
trigger2 = (Parent,command = "holdback")
trigger3 = (command = "holdup")
trigger3 = (Parent,command = "holdup")
trigger4 = (command = "holddown")
trigger4 = (Parent,command = "holddown")
var(59) = (var(4):=0)

[State 9741, ButtonTurnOnAI]
type = ParentVarSet
triggerall = var(1)
triggerall = !var(2)
trigger1 = (Parent,command = "a")
trigger2 = (Parent,command = "b")
trigger3 = (Parent,command = "c")
trigger4 = (Parent,command = "x")
trigger5 = (Parent,command = "y")
trigger6 = (Parent,command = "z")
trigger7 = (Parent,command = "start")
var(59) = 1

[State 9741, ButtonTurnOffAI]
type = ParentVarSet
triggerall = !var(2)
trigger1 = (command = "a")
trigger1 = (Parent,command = "a")
trigger2 = (command = "b")
trigger2 = (Parent,command = "b")
trigger3 = (command = "c")
trigger3 = (Parent,command = "c")
trigger4 = (command = "x")
trigger4 = (Parent,command = "x")
trigger5 = (command = "y")
trigger5 = (Parent,command = "y")
trigger6 = (command = "z")
trigger6 = (Parent,command = "z")
trigger7 = (command = "start")
trigger7 = (Parent,command = "start")
var(59) = -1

[State 9741, UnPauseCheck]
type = VarSet
triggerall = var(2)
trigger1 = (Parent,command = "a")
trigger2 = (Parent,command = "b")
trigger3 = (Parent,command = "c")
trigger4 = (Parent,command = "x")
trigger5 = (Parent,command = "y")
trigger6 = (Parent,command = "z")
trigger7 = (Parent,command = "start")
trigger8 = (var(2) = 2)
trigger8 = (var(2):=0)
var(2) = 2

[State 9741, Goodbye]
type = DestroySelf
triggerall = (var(1):=1)
trigger1 = Parent,var(59)
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)


;------------------
; AI Activation Helper State - Compatibly Partnered Version
;
; var(1) - First tick dir activation prevention
; var(2) - Used for pause/superpause and custom state check, basically.
; var(3) - (Super/)Pause & custom state-triggered dir detection disabler.
; var(4) - Hitpause check.
; var(5) - No button on previous tick.
; var(6) - Any dir on this tick.
; var(7) - Any button on this tick.
; var(8) - Matching partner button detected.
; var(9) - AutoTurn bug fixer.
; parent's var(57) - Parent's GameTime var, for pause and custom state check.
; parent's var(59) - Parent's primary AI variable.
;
; The code in this state is mostly simply copy/pasteable.
; But if you're using different indices for the parent's variables,
; or if you change your character's basic commands' names, you'll
; of course need to change the code in this state accordingly.

[StateDef 9742]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9742, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 0

[State 9742, PauseCheck]
type = VarSet
trigger1 = (GameTime>Parent,var(57))
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)
trigger4 = Parent,var(59)
trigger5 = (var(3):=0)
var(2) = (var(3):=1)

[State 9742, Facing]
type = Turn
trigger1 = (var(9):=(Facing != Parent,Facing))

[State 9742, ParentDirCheck]
type = VarSet
trigger1 = (Parent,command = "holdfwd")
trigger2 = (Parent,command = "holdback")
trigger3 = (Parent,command = "holdup")
trigger4 = (Parent,command = "holddown")
trigger5 = (var(6):=0)
var(6) = 1

[State 9742, ParentButtonCheck]
type = VarSet
trigger1 = (Parent,command = "a")
trigger2 = (Parent,command = "b")
trigger3 = (Parent,command = "c")
trigger4 = (Parent,command = "x")
trigger5 = (Parent,command = "y")
trigger6 = (Parent,command = "z")
trigger7 = (Parent,command = "start")
trigger8 = (var(7):=0)
var(7) = 1

[State 9742, SameButtonCheck]
type = VarSet
triggerall = var(7)
triggerall = !var(2)
triggerall = NumPartner
trigger1 = (Parent,command = "a")
trigger1 = (Partner,command = "a")
trigger2 = (Parent,command = "b")
trigger2 = (Partner,command = "b")
trigger3 = (Parent,command = "c")
trigger3 = (Partner,command = "c")
trigger4 = (Parent,command = "x")
trigger4 = (Partner,command = "x")
trigger5 = (Parent,command = "y")
trigger5 = (Partner,command = "y")
trigger6 = (Parent,command = "z")
trigger6 = (Partner,command = "z")
trigger7 = (Parent,command = "start")
trigger7 = (Partner,command = "start")
trigger8 = (var(15):=0)
var(15) = 1

[State 9742, DirTurnOnAI]
type = ParentVarSet
trigger1 = var(1)
trigger1 = var(6)
trigger1 = !var(3)
trigger1 = !var(4)
trigger1 = !var(16)
var(59) = 1

[State 9742, DirTurnOffAI]
type = ParentVarSet
triggerall = var(6)
triggerall = !var(3)
triggerall = Parent,var(59)
trigger1 = (command = "holdfwd")
trigger1 = (Parent,command = "holdfwd")
trigger2 = (command = "holdback")
trigger2 = (Parent,command = "holdback")
trigger3 = (command = "holdup")
trigger3 = (Parent,command = "holdup")
trigger4 = (command = "holddown")
trigger4 = (Parent,command = "holddown")
var(59) = 0

[State 9742, ButtonTurnOnAI]
type = ParentVarSet
trigger1 = var(5)
trigger1 = var(7)
trigger1 = !var(2)
trigger1 = !var(15)
var(59) = 1

[State 9742, ButtonTurnOffAI]
type = ParentVarSet
triggerall = var(7)
triggerall = !var(2)
triggerall = !var(15)
trigger1 = (command = "a")
trigger1 = (Parent,command = "a")
trigger2 = (command = "b")
trigger2 = (Parent,command = "b")
trigger3 = (command = "c")
trigger3 = (Parent,command = "c")
trigger4 = (command = "x")
trigger4 = (Parent,command = "x")
trigger5 = (command = "y")
trigger5 = (Parent,command = "y")
trigger6 = (command = "z")
trigger6 = (Parent,command = "z")
trigger7 = (command = "start")
trigger7 = (Parent,command = "start")
var(59) = -1

[State 9742, UnPauseCheck]
type = VarSet
triggerall = var(2)
triggerall = !var(4)
trigger1 = var(7)
trigger2 = (var(2) = 2)
trigger2 = (var(2):=0)
var(2) = 2

[State 9742, Goodbye]
type = DestroySelf
trigger1 = Parent,var(59)
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)

[State 9742, HitPauseCheck]
type = VarSet
trigger1 = var(6)
trigger2 = var(7)
trigger3 = !(Parent,HitPauseTime)
var(4) = Parent,HitPauseTime

[State 9742, Delay]
type = VarSet
trigger1 = (var(1):=1)
var(5) = !var(7)
;-------------------------------------------
; Ffffffinish!!
[StateDef 9998]
type    = A
movetype= I
physics = N
ctrl = 0
anim = 9741

[State 9999, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = s9999,2
ignorehitpause = 1
volume = -255
abspan = 1

[State 9999, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = s9999,3
ignorehitpause = 1
volume = 255
abspan = 1

[State 9999, PlaySnd]
type = PlaySnd
trigger1 = root,stateno = [180,185]
value = s9999,0
ignorehitpause = 1
volume = 255
persistent = 0
abspan = 1

[State 9999, Short Pause]
type = Pause
trigger1 = Time = 1
time = 60
movetime = 0
ignorehitpause = 1

[State 9999, Explod]
type = Explod
trigger1 = time = 0
anim = 9997
postype = back  ;p2,front,back,left,right
pos = 0,240
bindtime = -1
removetime = -2
supermovetime = 9999
pausemovetime = 9999
ontop = 1
ownpal = 1
removeongethit = 0
;ignorehitpause =
;persistent =

;-------------------------------------------
; Hyper Combo Finish!!
[StateDef 9999]
type    = A
movetype= I
physics = N
ctrl = 0
anim = 9741

[State 9999, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = s9999,4
volume = 255
ignorehitpause = 1
abspan = 1

[State 9999, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = s9999,5
volume = 0
ignorehitpause = 1
abspan = 1

[State 9999, PlaySnd]
type = PlaySnd
trigger1 = root,stateno = [180,185]
value = s9999,0
ignorehitpause = 1
volume = 255
persistent = 0
abspan = 1

[State 9999, Explod]
type = Explod
trigger1 = time = 0
anim = 9999
id = 9999
postype = left  ;p2,front,back,left,right
bindtime = -1
removetime = -2
scale = 1,1
facing = 1
supermovetime = 9999
pausemovetime = 9999
sprpriority = -5
ownpal = 1
removeongethit = 0
;ignorehitpause =
;persistent =

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = parent, movetype = H
id = 9999
