[data]
life = 1500
power = 3000
attack = 90
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = -1
guard.sparkno = -1
ko.echo = 0
intpersistindex = 0
floatpersistindex = 40

[Size]
xscale = 1
yscale = 1
ground.back = 10
ground.front = 10
air.back = 10
air.front = 10
height = 30
attack.dist = 160
proj.attack.dist = 15
proj.doscale = 0
head.pos = 3, -35
mid.pos = 1, -20

[velocity]
walk.fwd = 0.8
walk.back = -.8
run.fwd = 8, 0
run.back = -4, -4
jump.fwd = 3.5, 0
jump.back = -3.5, 0
jump.neu = 0, -6

[movement]
airjump.num = 0
airjump.height = 40
yaccel = .45
stand.friction = .85
crouch.friction = .82

[statedef 170]
type = s
anim = 170
ctrl = 0

[state 0]
type = assertspecial
trigger1 = time < 170
flag = roundnotover
ignorehitpause = 1

[statedef 180]
type = s

[state 0]
type = changestate
trigger1 = !time
value = 181

[statedef 181]
type = s
anim = 180
ctrl = 0

;zoom
[State 0] 
Type = Zoom
Trigger1 = Time = [0,200] 
Scale = 1.9
Pos = (Pos X/2) * CameraZoom,0
IgnoreHitPause = 1

[state 0]
type = velset
trigger1 = animelem = 6
x = -.5
y = 0

[state 0]
type = playsnd
trigger1 = animelem = 2
value = s0, 49
[state 0]
type = playsnd
trigger1 = animelem = 2
value = s0, 49

[state 0]
type = playsnd
trigger1 = animelem = 9
value = s52, 1

[state 0]
type = changeanim
trigger1 = time = 127
value = 180
elem = 8

[state 0]
type = nothitby
trigger1 = 1
value = sca
time = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = random % 4
ignorehitpause = 1



[state 0]
type = assertspecial
trigger1 = time < 275
flag = roundnotover

[statedef 190]
type = s
anim = 190
sprpriority = 2
ctrl = 0

[state 0]
type = playsnd
trigger1 = time = 2
value = s8, 40

[state 0]
type = bgpalfx
trigger1 = time = 1
time = 32                
add = 0, 0, 0
mul = 64, 64, 64
sinadd = 0, 0, 0, 1
invertall = 0

;zoom
[State 0] 
Type = Zoom
Trigger1 = Time = [5,200] 
Scale = 1.9
Pos = (Pos X/2) * CameraZoom,0
IgnoreHitPause = 1

[state 0]
type = playsnd
trigger1 = animelem = 11
value = s21, 7


;--- SCREEN SHAKE ON BRAKE ---
[state 0]
type = envshake
trigger1 = animelem = 10
time = 10
freq = 60
ampl = -4
phase = 0

;--- START POSITION ---
[state 0]
type = posset
trigger1 = !time
x = 100
y = 0

;--- DASH ---
[state 0]
type = velset
trigger1 = animelem = 1
x = -6
y = 0

;--- BRAKE ---
[state 0]
type = velset
trigger1 = time = 32 | time = 34
x = -3
y = 0

;--- STANCE LOCK ---
[state 0]
type = velset
trigger1 = time = 34
x = 0
y = 0

;--- BLUE AFTERIMAGE DURING DASH ---
[state 0]
type = afterimage
trigger1 = animelem = 1
time = 16
length = 10
palcolor = 0
palinvertall = 0
palbright = 0, 0, 255
palcontrast = 255, 255, 255
palpostbright = 0, 0, 0
paladd = 0, 0, 255
palmul = 0.5, 0.5, 1.0
timegap = 1
framegap = 2

[state 0]
type = superpause
trigger1 = animelem = 1
time = 30
movetime = 30
pausebg = 1
darken = 0
anim = -1
sound = -1, 0
p2defmul = 1
poweradd = 0
unhittable = 1

[state 0]
type = bgpalfx
trigger1 = animelem = 2
time = 29
add = 0, 0, 0
mul = 64, 64, 64
sinadd = 0, 0, 0, 1
invertall = 0

;--- AFTERIMAGE OFF ---
[state 0]
type = afterimagetime
trigger1 = animelem = 12
time = 0

;--- DASH SOUND ---
[state 0]
type = playsnd
trigger1 = time = 2
value = s190, 1
channel = 2

[state 0]
type = playsnd
trigger1 = time = 2
value = s190, 1
channel = 3

[state 0]
type = playsnd
trigger1 = time = 2
value = s190, 1
channel = 4

[state 0]
type = playsnd
trigger1 = time = 2
value = s190, 1
channel = 5

[state 0]
type = playsnd
trigger1 = time = 2
value = s190, 1
channel = 6

[state 0]
type = playsnd
trigger1 = time = 2
value = s190, 1
channel = 7

[state 0]
type = playsnd
trigger1 = time = 2
value = s190, 1
channel = 8

;--- STANCE SOUND ---
[state 0]
type = varset
trigger1 = !time
v = 1
value = random % 3



;--- INTRO FLAG ---
[state 0]
type = assertspecial
trigger1 = 1
flag = intro

;--- END INTRO ---
[state 0]
type = changestate
trigger1 = !animtime
value = 0

[statedef 200]
type = s
movetype = a
physics = s
anim = 200
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = velset
trigger1 = !animelemtime(2)
x = 2.6
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 9, random % 12)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 2
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 2
persistent = 0
volumescale = 90
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 10
persistent = 0
volumescale = 90
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(3)
attr = s, na
hitflag = maf
guardflag = ma
animtype = light
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*1.0)/70))), (abs(ceil((enemynear, const(data.life)*0.5)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 4, 9
guard.pausetime = 4, 7
guard.velocity = -2
guardsound = s104, 0
ground.type = high
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -2.3
air.velocity = -1, 0
envshake.time = 5
envshake.ampl = -5
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -30
postype = p2
ownpal = 1
size.xscale = .3
size.yscale = .3
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "holddown"  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100) && (var(58) = 3)
value = 450

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "a"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 201

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 301

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 401

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 201]
type = s
movetype = a
physics = s
anim = 201
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = velset
trigger1 = !animelemtime(3)
x = 2.7
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 9, random % 12)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(3)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(3)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(3)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 6
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 3
persistent = 0
volumescale = 90
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(4)
attr = s, na
hitflag = maf
guardflag = ma
animtype = hard
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*1.0)/70))), (abs(ceil((enemynear, const(data.life)*0.5)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 7, 10
guard.pausetime = 6, 8
guard.velocity = -2
guardsound = s104, 0
ground.type = high
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -2.3
air.velocity = -1, 0
envshake.time = 5
envshake.ampl = -5
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -27
postype = p2
ownpal = 1
size.xscale = .3
size.yscale = .3
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "holddown"  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100) && (var(58) = 3)
value = 450

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "a"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 202

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 302

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 402

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 202]
type = s
movetype = a
physics = s
anim = 202
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = velset
trigger1 = !animelemtime(1)
x = 3.3
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 9, random % 12)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 4
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 2
persistent = 0
volumescale = 95
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 13
persistent = 0
volumescale = 55
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(3)
attr = s, na
hitflag = maf
guardflag = ma
animtype = hard
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*1.0)/70))), (abs(ceil((enemynear, const(data.life)*0.5)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 7, 13
guard.pausetime = 5, 7
guard.velocity = -2
guardsound = s104, 0
ground.type = high
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -2.9
air.velocity = -1, 0
envshake.time = 7
envshake.ampl = -6
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -30
postype = p2
ownpal = 1
size.xscale = .3
size.yscale = .3
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "holddown"  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100) && (var(58) = 3)
value = 450

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "a"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 203

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 303

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 403

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 203]
type = s
movetype = a
physics = s
anim = 203
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = velset
trigger1 = !animelemtime(2)
x = -2
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(3)
x = 4
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 9, random % 12)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(3)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(3)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(3)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 4
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 2
persistent = 0
volumescale = 90
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 12
persistent = 0
volumescale = 70
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(3)
attr = s, na
hitflag = maf
guardflag = ma
animtype = medium
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*1.0)/70))), (abs(ceil((enemynear, const(data.life)*0.5)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 10, 7
guard.pausetime = 5, 7
guard.velocity = -7
guardsound = s104, 0
ground.type = high
ground.slidetime = 5
ground.hittime = 24
ground.velocity = -12.2
air.velocity = -6.1, 0
envshake.time = 8
envshake.ampl = -10
id = 203
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .3
size.yscale = .3
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "holddown"  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100) && (var(58) = 3)
value = 450

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "a"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 204

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 304

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 403

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1


[statedef 204]
type = s
movetype = a
physics = s
anim = 204
sprpriority = 2
facep2 = 1
ctrl = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 1810
ignorehitpause = 888788888
;persistent = 

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 7040
ignorehitpause = 888788888
;persistent = 


[state 0]
type = helper
trigger1 = animelem = 2
stateno = 8100
id = 8100
postype = p1

[state 0]
type = velset
trigger1 = animelem = 2
x = 6
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 6, random % 8)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 3
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(4)
attr = s, na
hitflag = maf
guardflag = ma
animtype = hard
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*2.0)/80))), (abs(ceil((enemynear, const(data.life)*0.5)/70)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 7, 8
guard.pausetime = 5, 7
guard.velocity = -7.5
hitsound = s0, 14
guardsound = s104, 0
ground.type = High
ground.slidetime = 15
ground.hittime  = 45
air.hittime = 45
ground.velocity = (-3*const(size.xscale))+var(54)*.01,-8*const(size.yscale)
air.velocity = (-4*const(size.xscale)),(-7.5)*const(size.yscale)
Fall = 1
air.fall = 1
fall.recover = 1
fall.recovertime = 45
air.velocity = -5.3, -2
envshake.time = 7
envshake.ampl = -10
fall = 1
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 40, 20
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .35
size.yscale = .35
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .75
size.yscale = .75
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 250]
type = s
movetype = i
physics = s
anim = 250
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = helper
trigger1 = time % 10 = 0
stateno = 8060
id = 8060
pos = 0, 0
postype = p1
supermovetime = 999
pausemovetime = 999

[state 0]
type = varset
trigger1 = !time
v = 1
value = random % 3
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s700, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s700, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s700, 0 + var(1)
ignorehitpause = 1

[state 0]
type = reversaldef
trigger1 = (time >= 0) && (cond(ishelper, 0, 1))
reversal.attr = sca, na, nt, sa, st
pausetime = 0, 20
sparkno = -1
hitsound = -1
p1stateno = cond(random < 500, 251, 252)

[state 0]
type = changestate
trigger1 = time >= 55
value = 253

[statedef 251]
type = s
movetype = a
physics = s
anim = 251
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = helper
trigger1 = animelem = 3
stateno = 8100
id = 8100
postype = p1

[state 0]
type = afterimage
trigger1 = !time
time = 12
trans = add
length = 11
timegap = 1
framegap = 1
palbright = 10, 10, 10
palcontrast = 100, 100, 100
paladd = -10, -10, -10
palmul = .90, .90, .90
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(2)
x = -1.5
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(4)
x = 2
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 8
persistent = 0
volumescale = 90
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 6
value = s2, 1 + random % 7
volumescale = 80
                                                                        
[state 0]
type = hitdef
trigger1 = !animelemtime(4)
attr = s, na
hitflag = m
guardflag = m
animtype = hard
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*2.0)/60))), (abs(ceil((enemynear, const(data.life)*1.0)/60)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 10, 8
guard.pausetime = 5, 7
guard.velocity = -7.5
guardsound = s104, 0
ground.type = trip
ground.slidetime = 5
ground.hittime = 15
ground.velocity = -3.4, -4
air.velocity = -3.4, -4
envshake.time = 7
envshake.ampl = -12
fall = 1
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 0, 0
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .35
size.yscale = .35
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .75
size.yscale = .75
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 252]
type = s
movetype = a
physics = s
anim = 204
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = helper
trigger1 = animelem = 2
stateno = 8100
id = 8100
postype = p1

[state 0]
type = afterimage
trigger1 = !time
time = 10
trans = add
length = 11
timegap = 1
framegap = 1
palbright = 10, 10, 10
palcontrast = 100, 100, 100
paladd = -10, -10, -10
palmul = .90, .90, .90
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(2)
x = 2.5
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(3)
x = 3
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 3
value = s2, 1 + random % 7
volumescale = 80

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 3
volumescale = 90

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 8
volumescale = 70

[state 0]
type = hitdef
trigger1 = !animelemtime(3)
attr = s, na
hitflag = m
guardflag = m
animtype = medium
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*2.0)/60))), (abs(ceil((enemynear, const(data.life)*1.0)/60)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 4, 7
guard.pausetime = 4, 7
guard.velocity = -2
guardsound = s104, 0
ground.type = trip
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -1.8, -7.4
air.velocity = -1.8, -7.4
envshake.time = 8
envshake.ampl = -12
fall = 1
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 0, 0
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .35
size.yscale = .35
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .75
size.yscale = .75
ignorehitpause = 1
persistent = 0

[state 0]
type = ctrlset
trigger1 = time >= 22
value = 1

[state 0]
type = changestate
triggerall = (movehit) && (animelemtime(4) >= 10)
trigger1 = !ailevel
trigger1 = command = "up"
trigger2 = (movehit) && (animelemtime(4) >= 10)
trigger2 = ailevel
trigger2 = roundstate = 2
trigger2 = p2statetype != l
trigger2 = enemynear, p2bodydist x < 45
value = 40

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 253]
type = u
physics = u
anim = 253
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 300]
type = s
movetype = a
physics = s
anim = 300
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = velset
trigger1 = !animelemtime(2)
x = 2
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 9, random % 12)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 2
persistent = 0
volumescale = 90
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 1
persistent = 0
volumescale = 70
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(3)
attr = s, na
hitflag = maf
guardflag = ma
animtype = light
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*1.0)/70))), (abs(ceil(enemynear, const(data.life)*0.5)/100))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 5, 10
guard.pausetime = 5, 7
guard.velocity = -0.6
guardsound = s104, 0
ground.type = high
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -2.4
air.velocity = -1, 0
envshake.time = 5
envshake.ampl = -5
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .3
size.yscale = .3
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "holddown"  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100) && (var(58) = 3)
value = 450

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "a"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 201

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 301

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 401

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 301]
type = s
movetype = a
physics = s
anim = 301
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = velset
trigger1 = !animelemtime(2)
x = 2.6
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 9, random % 12)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 4
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = explod
trigger1 = !animelemtime(1)
anim = 306
id = 306
pos = 0, 0
postype = p1
facing = 1
bindtime = -1
removetime = -2
sprpriority = 3
scale = const(size.xscale), const(size.yscale)
angle = 0
ownpal = 1
remappal = 3, (var(40))
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
persistent = 0

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 2
persistent = 0
volumescale = 90
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 2
persistent = 0
volumescale = 30
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(3)
attr = s, na
hitflag = maf
guardflag = ma
animtype = medium
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*1.0)/70))), (abs(ceil((enemynear, const(data.life)*0.5)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 5, 10
guard.pausetime = 5, 7
guard.velocity = -0.6
guardsound = s104, 0
ground.type = high
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -2.4
air.velocity = -1, 0
envshake.time = 6
envshake.ampl = -6
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .3
size.yscale = .3
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "holddown"  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100) && (var(58) = 3)
value = 450

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "a"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 202

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 302

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 402

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 302]
type = s
movetype = a
physics = s
anim = 202
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = velset
trigger1 = !animelemtime(1)
x = 3.3
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 9, random % 12)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 4
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 2
persistent = 0
volumescale = 95
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 13
persistent = 0
volumescale = 55
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(3)
attr = s, na
hitflag = maf
guardflag = ma
animtype = hard
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*1.0)/70))), (abs(ceil((enemynear, const(data.life)*0.5)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 7, 8
guard.pausetime = 5, 7
guard.velocity = -2
guardsound = s104, 0
ground.type = high
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -7.5
air.velocity = -3.25, 0
envshake.time = 7
envshake.ampl = -6
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .3
size.yscale = .3
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "holddown"  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100) && (var(58) = 3)
value = 450

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "a"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 203

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 303

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 403

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 303]
type = s
movetype = a
physics = s
anim = 303
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = velset
trigger1 = time = 4
x = 12
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(6)
x = 3
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(7)
x = 2
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 9, random % 12)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 4
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 2
persistent = 0
volumescale = 90
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 3
persistent = 0
volumescale = 80
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(5)
attr = s, na
hitflag = maf
guardflag = ma
animtype = hard
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*1.0)/70))), (abs(ceil((enemynear, const(data.life)*0.5)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 6, 10
guard.pausetime = 6, 8
guard.velocity = -2
guardsound = s104, 0
ground.type = high
ground.slidetime = 5
ground.hittime = 18
ground.velocity = -12, 0
air.velocity = -6, 0
envshake.time = 8
envshake.ampl = -10
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .325
size.yscale = .325
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .725
size.yscale = .725
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "holddown"  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100) && (var(58) = 3)
value = 450

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "a"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 204

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 304

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 403

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 304]
type = s
movetype = a
physics = s
anim = 304
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = helper
trigger1 = animelem = 2
stateno = 8100
id = 8100
postype = p1

[state 0]
type = velset
trigger1 = animelem = 2
x = 7
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 6, random % 8)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 6
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(3)
value = s52, 1
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(3)
value = s52, 1
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(3)
attr = s, na
hitflag = maf
guardflag = ma
animtype = hard
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*2.0)/80))), (abs(ceil((enemynear, const(data.life)*0.5)/70)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 8, 10
guard.pausetime = 6, 8
guard.velocity = -2
hitsound = s0, 14
guardsound = s104, 0
ground.type = trip
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -8, 0
air.velocity = -8, 0
envshake.time = 8
envshake.ampl = -9
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
getpower = 40, 20
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .35
size.yscale = .35
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .75
size.yscale = .75
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
trigger1 = !animtime
value = 52
ctrl = 0

[statedef 400]
type = s
movetype = a
physics = s
anim = 400
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = helper
trigger1 = animelem = 2
stateno = 8100
id = 8100
postype = p1

[state 0]
type = velset
trigger1 = animelem = 2
x = 7
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 6, random % 8)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 3
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 13
persistent = 0
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 2
persistent = 0
volumescale = 90
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(4)
attr = s, na       
hitflag = maf     
guardflag = ma
animtype = medium             
priority = 4, hit
damage = (abs(ceil((enemynear, const(data.life)*1.0)/70))), (abs(ceil((enemynear, const(data.life)*0.5)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 6, 7
guardsound = s104, 0
ground.type = high 
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -2, 0
air.velocity = -1, 0
envshake.time = 6
envshake.ampl = -8
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .3
size.yscale = .3
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "holddown"  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100) && (var(58) = 3)
value = 450

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "a"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 201

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 301

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 401

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 401]
type = s
movetype = a
physics = s
anim = 203
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = velset
trigger1 = !animelemtime(2)
x = -2.5
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(3)
x = 4
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 9, random % 12)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 4
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 2
persistent = 0
volumescale = 90
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 12
persistent = 0
volumescale = 70
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(3)
attr = s, na
hitflag = maf
guardflag = ma
animtype = medium
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*1.0)/70))), (abs(ceil((enemynear, const(data.life)*0.5)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 10, 7
guard.pausetime = 5, 7
guard.velocity = -7
guardsound = s104, 0
ground.type = high
ground.slidetime = 5
ground.hittime = 24
ground.velocity = -6, 0
air.velocity = -6, -1
envshake.time = 7
envshake.ampl = -7
id = 401
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .3
size.yscale = .3
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "holddown"  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100) && (var(58) = 3)
value = 450

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "a"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 202

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 302

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 402

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 402]
type = s
movetype = a
physics = s
anim = 301
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = helper
trigger1 = animelem = 2
stateno = 8100
id = 8100
postype = p1

[state 0] 
type = explod
trigger1 = (numtarget(203))||(numtarget(401))
trigger1 = (prevstateno = 401)||(prevstateno = 203)
trigger1 = !time
anim = 307
id = 307
pos = 20, 0
postype = p1
facing = facing
sprpriority = 0
scale = const(size.xscale), const(size.yscale)
ownpal = 1
shadow = 0, 0, 0
removetime = -2
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
persistent = 0

[state 0]
type = turn
trigger1 = (numtarget(203))||(numtarget(401))
trigger1 = (prevstateno = 401)||(prevstateno = 203)
trigger1 = !time
ignorehitpause = 1

[state 0]
type = posadd
trigger1 = (numtarget(203))||(numtarget(401))
trigger1 = (prevstateno = 401)||(prevstateno = 203)
trigger1 = !time
x = p2bodydist x-44
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = (numtarget(203))||(numtarget(401))
trigger1 = (prevstateno = 401)||(prevstateno = 203)
trigger1 = !time
value = s60, 1
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(2)
x = 2.5
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 9, random % 12)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 8
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 2
persistent = 0
volumescale = 95
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 13
persistent = 0
volumescale = 55
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(4)
attr = s, sa
hitflag = maf
guardflag = ma
animtype = up
priority = 4, hit
damage = (abs(ceil((enemynear, const(data.life)*1.0)/70))), (abs(ceil((enemynear, const(data.life)*0.5)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 10, 4
guard.pausetime = 4, 7
guard.velocity = -3.5
hitsound = s0, 12
guardsound = s104, 0
ground.type = trip
ground.slidetime = 7
ground.hittime = 25
ground.velocity = -1, -4.4
air.velocity = -1, -3.4
envshake.time = 8
envshake.ampl = -12
fall = 1
fall.recover = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .325
size.yscale = .325
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .725
size.yscale = .725
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "holddown"  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100) && (var(58) = 3)
value = 450

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "a"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 203

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 303

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "c"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 403

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 403]
type = s
movetype = a
physics = s
anim = 251
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = velset
trigger1 = !animelemtime(2)
x = 2
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(4)
x = 4
ignorehitpause = 1

[state 0]
type = velset
triggerall = prevstateno = 303
trigger1 = !animelemtime(4)
x = 8
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(5)
x = 0
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 6, random % 8)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 10
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 12
persistent = 0
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 3
persistent = 0
volumescale = 80
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(4)
attr = a, na
hitflag = haf
animtype = up
air.animtype = up
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*2.0)/80))), (abs(ceil((enemynear, const(data.life)*0.5)/70)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 10, 8
guard.pausetime = 5, 7
guard.velocity = -7.5
hitsound = s0, 14
guardsound = s104, 0
ground.type = trip
ground.slidetime = 5
ground.hittime = 15
ground.velocity = -4.5, -2
air.velocity = -4.5, -2
envshake.time = 7
envshake.ampl = -14
fall = 1
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 40, 20
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .35
size.yscale = .35
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .75
size.yscale = .75
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 450]
type = s
movetype = a
physics = s
anim = 450
sprpriority = 2
facep2 = 1
ctrl = 0

;--- 24 FRAMES BLUE AFTERIMAGE ---
[state 0]
type = afterimage
trigger1 = animelem = 1
time = 30
length = 5
palcolor = 0
palinvertall = 0
palbright = 0, 0, 255
palcontrast = 255, 255, 255
palpostbright = 0, 0, 0
paladd = 0, 0, 255
palmul = 0.5, 0.5, 1.0
timegap = 1
framegap = 2

[state 0]
type = varset
trigger1 = !time
v = 1
value = random % 3
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s10, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s10, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s10, 0 + var(1)
ignorehitpause = 1

[state 0]
type = helper
trigger1 = animelem = 3
stateno = 8100
id = 8100
postype = p1

[state 0]
type = velset
trigger1 = time = 9
x = 20
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(7)
x = 3
ignorehitpause = 1

[state 0]
type = playerpush
trigger1 = 1
value = 0
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 8
value = s2, 1 + random % 7
volumescale = 90

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 8
volumescale = 60

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 13
volumescale = 90

[state 0]
type = hitdef
trigger1 = !animelemtime(6)
attr = s, na
hitflag = maf
guardflag = ma
animtype = heavy
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*3.0)/100))), (abs(ceil((enemynear, const(data.life)*2.0)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 2, 15
guard.pausetime = 5, 7
guard.velocity = -0.6
hitsound = s0, 14
guardsound = s104, 0
ground.type = trip
ground.slidetime = 5
ground.hittime = 10
ground.velocity = -0.5, -4.8
air.velocity = -0.5, -4.8
envshake.time = 12
envshake.ampl = -18
envshake.freq = 45
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
id = 500
getpower = 0, 0
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .4
size.yscale = .4
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .75
size.yscale = .75
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

[statedef 600]
type = a
movetype = a
physics = a
anim = 600
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0] 
type = velset
trigger1 = !animelemtime(1)
x = 1.5
y = -1.8
ignorehitpause = 1

[state 0] 
type = velset
trigger1 = (time > 6) && (time % 4 = 0)
x = 0.68
y = -0.62
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(1)
value = s4, 0
ignorehitpause = 1


[state 0]
type = explod
trigger1 = (time > 6) && (time % 8 = 0)
anim = 7040
id = 7040
pos = 25, -35
postype = p1
facing = 1
angle = 0
sprpriority = 3
scale = .20, .35
ownpal = 1
trans = sub
removetime = -2
removeongethit = 1
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = (time > 6) && (time % 4 = 0)
value = s2, 1 + random % 7
volumescale = 65
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 1 + random % 3
volumescale = 90
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = time % 7 = 0
attr = a, sa
hitflag = maf
guardflag = ma
animtype = medium
priority = 4, hit
damage = (abs(ceil((enemynear, const(data.life)*0.5)/110))), (abs(ceil((enemynear, const(data.life)*0.2)/100)))
sparkno = -1
sparkxy = -8, -25
guard.sparkno = -1
pausetime = 0, 5
guardsound = s104, 0
guard.velocity = -0.52
ground.type = high
ground.slidetime = 7
ground.hittime = 15
ground.velocity = -2.62, 0
air.velocity = -2.62, -0.65
envshake.time = 4
envshake.ampl = -2
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 10, 5
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit = 1
stateno = 8030
id = 8030
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .275
size.yscale = .275
ignorehitpause = 1
persistent = 6
[state 0]
type = helper
trigger1 = moveguarded = 1
stateno = 8000
id = 8000
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .675
size.yscale = .675
ignorehitpause = 1
persistent = 6

[state 0]
type = varset
trigger1 = movehit = 1
v = 1
value = random % 20
ignorehitpause = 1

[state 0]
type = varset
trigger1 = movehit = 1
v = 2
value = random % 22
ignorehitpause = 1

[state 0]
type = removeexplod
trigger1 = time >= 74
id = 7040
ignorehitpause = 1

[state 0]
type = removeexplod
trigger1 = time >= 74
id = 70040
ignorehitpause = 1

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  time  >=  65  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 610

[state 0]
type = changestate
trigger1 = cond((movehit)||(moveguarded), time >= 75, time >= 35)
value = 50
ctrl = 0

[statedef 610]
type = a
movetype = a
physics = a
anim = 610
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0] 
type = velset
trigger1 = !animelemtime(1)
x = 2.0
y = -2.0
ignorehitpause = 1

[state 0] 
type = velset
trigger1 = !animelemtime(2)
x = 2.0
y = -2.0
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 9, random % 12)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s3, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 3
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 2
persistent = 0
volumescale = 90
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 12
persistent = 0
volumescale = 85
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(3)
attr = a, sa
hitflag = maf
guardflag = ma
animtype = medium
priority = 4, hit
damage = (abs(ceil((enemynear, const(data.life)*1.0)/70))), (abs(ceil((enemynear, const(data.life)*0.5)/100)))
sparkno = -1
sparkxy = -8, -25
guard.sparkno = -1
pausetime = 5, 7
guardsound = s104, 0
guard.velocity = -0.52
ground.type = high
ground.slidetime = 7
ground.hittime = 15
ground.velocity = -3.2, -3.25
air.velocity = -3.2, -3.25  
envshake.time = 4
envshake.ampl = -5
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -30
postype = p2
ownpal = 1
size.xscale = .3
size.yscale = .3
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 611

[state 0]
type = changestate
trigger1 = !animtime
value = 50
ctrl = 0

[statedef 611]
type = a
movetype = a
physics = a
anim = 611
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0] 
type = velset
trigger1 = !animelemtime(1)
x = 1.20
y = -1.20
ignorehitpause = 1

[state 0] 
type = velset
trigger1 = !animelemtime(2)
x = 2.25
y = -2.85
ignorehitpause = 1

[state 0] 
type = velset
trigger1 = !animelemtime(3)
x = 2.85
y = -2.00
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 6, random % 8)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 6
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 13
persistent = 0
volumescale = 100
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 7
persistent = 0
volumescale = 90
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(5)
attr = a, sa
hitflag = maf
guardflag = ma
animtype = medium
priority = 4, hit
damage = (abs(ceil((enemynear, const(data.life)*2.0)/80))), (abs(ceil((enemynear, const(data.life)*1.0)/70)))
sparkno = -1
sparkxy = -8, -25
guard.sparkno = -1
pausetime = 10, 4
guardsound = s104, 0
guard.velocity = -0.52
ground.type = high
ground.slidetime = 7
ground.hittime = 30
ground.velocity = 0, 10
air.velocity = -8, 10
envshake.time = 9
envshake.ampl = 18
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
down.bounce = 1
fall = 1
fall.recover = 0
fall.xvelocity = -0.95
fall.yvelocity = -0.00
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -30
postype = p2
ownpal = 1
size.xscale = .35
size.yscale = .35
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .725
size.yscale = .725
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
trigger1 = !animtime
value = 50
ctrl = 1

[statedef 620]
type = a
movetype = a
physics = a
anim = 620
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0] 
type = velset
trigger1 = !animelemtime(1)
x = 1.5
y = -1.8
ignorehitpause = 1

[state 0] 
type = velset
trigger1 = (time > 6) && (time % 4 = 0)
x = 0.68
y = -0.62
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(1)
value = s10, 0
ignorehitpause = 1


[state 0]
type = playsnd
trigger1 = !animelemtime(1)
value = s10, 0
ignorehitpause = 1

[state 0]
type = explod
trigger1 = (time > 6) && (time % 8 = 0)
anim = 7040
id = 7040
pos = 25, -20
postype = p1
facing = 1
angle = 0
sprpriority = 3
scale = .20, .35
ownpal = 1
trans = sub
removetime = -2
removeongethit = 1
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = (time > 6) && (time % 4 = 0)
value = s2, 1 + random % 7
volumescale = 65
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 1 + random % 3
volumescale = 90
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = time % 7 = 0
attr = a, sa
hitflag = maf
guardflag = ma
animtype = medium
priority = 4, hit
damage = (abs(ceil((enemynear, const(data.life)*0.5)/110))), (abs(ceil((enemynear, const(data.life)*0.2)/100)))
sparkno = -1
sparkxy = -8, -25
guard.sparkno = -1
pausetime = 0, 5
guardsound = s104, 0
guard.velocity = -0.52
ground.type = high
ground.slidetime = 7
ground.hittime = 15
ground.velocity = -2.62, 0
air.velocity = -2.62, -0.65
envshake.time = 4
envshake.ampl = -2
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
getpower = 10, 5
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit = 1
stateno = 8030
id = 8030
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .275
size.yscale = .275
ignorehitpause = 1
persistent = 6
[state 0]
type = helper
trigger1 = moveguarded = 1
stateno = 8000
id = 8000
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .675
size.yscale = .675
ignorehitpause = 1
persistent = 6

[state 0]
type = varset
trigger1 = movehit = 1
v = 1
value = random % 20
ignorehitpause = 1

[state 0]
type = varset
trigger1 = movehit = 1
v = 2
value = random % 22
ignorehitpause = 1

[state 0]
type = removeexplod
trigger1 = time >= 74
id = 7040
ignorehitpause = 1

[state 0]
type = removeexplod
trigger1 = time >= 74
id = 70040
ignorehitpause = 1

[state 0]
type = changestate
triggerall = movecontact
trigger1 = ailevel = 0  &&  time  >=  65  &&  command = "b"
trigger2 = roundstate = 2  &&  ailevel  >  0  &&  random  <  (ailevel * 100)
value = 610

[state 0]
type = changestate
trigger1 = cond((movehit)||(moveguarded), time >= 75, time >= 35)
value = 50
ctrl = 0


[statedef 621]
type = a
movetype = a
physics = a
anim = 621
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0] 
type = velset
trigger1 = !animelemtime(1)
x = 1.2
y = -1.2
ignorehitpause = 1

[state 0] 
type = velset
trigger1 = !animelemtime(2)
x = 2.2
y = -3.3
ignorehitpause = 1

[state 0] 
type = velset
trigger1 = !animelemtime(3)
x = 3.0
y = -1.0
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 6, random % 8)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 8
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 13
persistent = 0
volumescale = 100
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 8
persistent = 0
volumescale = 60
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(5)
attr = a, sa
hitflag = maf
guardflag = ma
animtype = medium
priority = 4, hit
damage = (abs(ceil((enemynear, const(data.life)*2.0)/80))), (abs(ceil((enemynear, const(data.life)*1.0)/70)))
sparkno = -1
sparkxy = -8, -25
guard.sparkno = -1
pausetime = 10, 3
guardsound = s104, 0
guard.velocity = -0.52
ground.type = high
ground.slidetime = 7
ground.hittime = 25
ground.velocity = 0, 10
air.velocity = -8, 10
envshake.time = 9
envshake.ampl = 18
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
down.bounce = 1
fall = 1
fall.recover = 0
fall.xvelocity = -1.2
fall.yvelocity = -4.0
getpower = 30, 15
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -30
postype = p2
ownpal = 1
size.xscale = .35
size.yscale = .35
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .725
size.yscale = .725
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
trigger1 = cond((movehit)||(moveguarded), time >= 75, time >= 35)
value = 50
ctrl = 0

[statedef 1000]
type = s
movetype = a
physics = s
anim = 1000
poweradd = -1000
sprpriority = 2
velset = 0, 0
facep2 = 1
ctrl = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 10
value = S4, 0
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 10
value = S4, 0
volume = 999

[state 0]
type = superpause
trigger1 = animelem = 3
time = 30
movetime = 30
pausebg = 1
darken = 0
anim = -1
sound = -1, 0
p2defmul = 1
poweradd = 0
unhittable = 1

[state 0]
type = bgpalfx
trigger1 = animelem = 2
time = 29
add = 0, 0, 0
mul = 64, 64, 64
sinadd = 0, 0, 0, 1
invertall = 0

[state 0]
type = helper
trigger1 = !time
stateno = 8050
id = 8050
pos = 0, 0
postype = p1
ownpal = 1
supermovetime = 999
pausemovetime = 999

[state 0]
type = helper
trigger1 = animelem = 1
stateno = 8060
id = 8060
pos = 0, 0
postype = p1
supermovetime = 999
pausemovetime = 999

;--- BLUE AFTERIMAGE DURING DASH ---
[state 0]
type = afterimage
trigger1 = animelem = 3
time = 16
length = 10
palcolor = 0
palinvertall = 0
palbright = 0, 0, 255
palcontrast = 255, 255, 255
palpostbright = 0, 0, 0
paladd = 0, 0, 255
palmul = 0.5, 0.5, 1.0
timegap = 1
framegap = 2

;--- AFTERIMAGE OFF DURING HITS ---
[state 0]
type = afterimagetime
trigger1 = animelem = 4
time = 0

;--- SPEED BOOST DURING DASH ---
[state 0]
type = velset
trigger1 = animelem = 3
x = 20
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !animelemtime(2)
x = 2
ignorehitpause = 1

;--- SCREEN SHAKE ON EVERY HIT ---
[state 0]
type = envshake
trigger1 = animelem = 4
time = 4
freq = 60
ampl = -3
phase = 0

[state 0]
type = envshake
trigger1 = animelem = 5
time = 4
freq = 60
ampl = -3
phase = 0

[state 0]
type = envshake
trigger1 = animelem = 6
time = 4
freq = 60
ampl = -3
phase = 0

;--- BLUE FLASH ON EACH HIT ---
[state 0]
type = palfx
trigger1 = animelem = 4
time = 3
add = 0, 0, 150
mul = 256, 256, 256

[state 0]
type = palfx
trigger1 = animelem = 5
time = 3
add = 0, 0, 150
mul = 256, 256, 256

[state 0]
type = palfx
trigger1 = animelem = 6
time = 3
add = 0, 0, 150
mul = 256, 256, 256

;--- SLOW MO ON FINAL HIT ---
[state 0]
type = superpause
trigger1 = animelem = 6
time = 8
movetime = 8
pausebg = 1
darken = 0
anim = -1
sound = -1, 0
p2defmul = 1
poweradd = 0
unhittable = 0

[state 0]
type = explod
trigger1 = animelem = 2
anim = 8120
id = 8120
pos = -10, 2
postype = p1
facing = 1
bindtime = 1
removetime = -2
sprpriority = 0
scale = .15, .2
angle = 0
ownpal = 1
remappal = 3, 0
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
vel = -1, 0
trans = sub

[state 0]
type = explod
trigger1 = animelem = 2
anim = 8120
id = 8120
pos = -10, 2
postype = p1
facing = 1
bindtime = 1
removetime = -2
sprpriority = 3
scale = .15, .2
angle = 0
ownpal = 1
remappal = 3, 9
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
vel = -1, 0

[state 0]
type = explod
trigger1 = animelem = 2
anim = 8120
id = 8120
pos = 10, -2
postype = p1
facing = -1
bindtime = 1
removetime = -2
sprpriority = 0
scale = .15, .2
angle = 0
ownpal = 1
remappal = 3, 0
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
vel = 1, 0
trans = sub

[state 0]
type = explod
trigger1 = animelem = 2
anim = 8120
id = 8120
pos = 10, -2
postype = p1
facing = -1
bindtime = 1
removetime = -2
sprpriority = 1
scale = .15, .2
angle = 0
ownpal = 1
remappal = 3, 9
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
vel = 1, 0

[state 0]
type = helper
trigger1 = animelem = 2
stateno = 8100
id = 8100
postype = p1

[state 0]
type = varset
trigger1 = !time
v = 1
value = random % 3
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s1000, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s1000, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(2)
value = s1000, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 12
value = s2, 1 + random % 7
volumescale = 100
ignorehitpause = 1

[state 0]
type = explod
trigger1 = !animelemtime(3)
anim = 1005
id = 1005
pos = 0, 0
postype = p1
facing = 1
bindtime = -1
removetime = -2
sprpriority = 3
scale = const(size.xscale), const(size.yscale)
angle = 0
ownpal = 1
remappal = 3, (var(40))
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
persistent = 0

[state 0]
type = playsnd
trigger1 = (movehit = 1) && (p2name != "saitama")
value = s0, 8
persistent = 0
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = (movehit = 1) && (p2name != "saitama")
value = s0, 3
persistent = 0
volumescale = 100
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = (movehit = 1) && (p2name = "saitama")
value = s0, 12
persistent = 0
volumescale = 100
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(4)
attr = s, sa
hitflag = maf
guardflag = ma
animtype = heavy
priority = 4, hit
damage = cond(p2name = "saitama", (abs(ceil((enemynear, const(data.life)*0.2)/100))), (abs(ceil((enemynear, const(data.life)*4.0)/40)))), cond(p2name = "saitama", (abs(ceil((enemynear, const(data.life)*0.2)/100))), (abs(ceil((enemynear, const(data.life)*1.0)/50))))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 15, 15
guard.pausetime = 6, 8
guard.velocity = -2
hitsound = s0, 14
guardsound = s104, 0
ground.type = high
ground.slidetime = 5
ground.hittime = cond(p2name = "saitama", 80, 45)
ground.velocity = -1, 0
air.velocity = -1, 0
envshake.time = cond(p2name = "saitama", 13, 11)
envshake.ampl = cond(p2name = "saitama", -13, -16)
envshake.freq = cond(p2name = "saitama", 25, 54)
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = cond(p2name = "saitama", 0, 1)
down.bounce = cond(p2name = "saitama", 0, 1)
fall.xvelocity = cond(p2name = "saitama", 0, 1)
fall.yvelocity = 0
fall.recover = 0
getpower = 0, 0
givepower = 0, 0

[state 0]
type = targetstate
triggerall = enemy, stateno != 9060
trigger1 = (time >= 15) && (movehit = 1)
value = 9060

[state 0]
type = explod
triggerall = enemynear, movetype = h
trigger1 = movehit
anim = 9060
id = 9060
pos = 40, -28
postype = p1
facing = 1
bindtime = 1
removetime = -2
sprpriority = 0
scale = .15, .2
angle = 45
ownpal = 1
remappal = 3, 0
removeongethit = 1
ignorehitpause = 1
supermovetime = 0
pausemovetime = 0
persistent = 0
vel = -.1, 0
trans = sub

[state 0]
type = explod
triggerall = enemynear, movetype = h
trigger1 = movehit
anim = 9060
id = 9060
pos = 40, -28
postype = p1
facing = 1
bindtime = 1
removetime = -2
sprpriority = 3
scale = .15, .2
angle = 45
ownpal = 1
remappal = 3, 11
removeongethit = 1
ignorehitpause = 1
supermovetime = 0
pausemovetime = 0
persistent = 0
vel = -.1, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -30
postype = p2
ownpal = 1
size.xscale = .4
size.yscale = .4
ignorehitpause = 1
persistent = 0

[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

;--- AFTERIMAGE OFF AT END ---
[state 0]
type = afterimagetime
trigger1 = !animtime
time = 0

[state 0]
type = changestate
trigger1 = cond(((movehit) && (p2name = "saitama")), !animelemtime(7), !animtime)
value = cond(((movehit) && (p2name = "saitama")), 9019, 0)
ctrl = 1
;===========================================================================
; WORKING GAROU COUNTER STANCE
;===========================================================================
[statedef 1100]
type = s
movetype = i
physics = s
anim = 1100
poweradd = -1000
sprpriority = 2
facep2 = 1
ctrl = 0


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0, 49
volume = 999

[State 0, Slow BG Helper]
type = helper
trigger1 = !time
stateno = 8050
id = 8050
pos = 0, 0
postype = p1
ownpal = 1
supermovetime = 999
pausemovetime = 999

[state 0, Screen FX Helper]
type = helper
trigger1 = time % 10 = 0
stateno = 8060
id = 8060
pos = 0, 0
postype = p1
supermovetime = 999
pausemovetime = 999

[state 0, Sound Randomizer Index]
type = varset
trigger1 = !time
v = 1
value = random % 3
ignorehitpause = 1

[state 0, Voice Spawn 1]
type = playsnd
trigger1 = !time
value = s700, 0 + var(1)
ignorehitpause = 1

[state 0, Voice Spawn 2]
type = playsnd
trigger1 = !time
value = s700, 0 + var(1)
ignorehitpause = 1

[state 0, Voice Spawn 3]
type = playsnd
trigger1 = !time
value = s700, 0 + var(1)
ignorehitpause = 1

[state 0, Clean Reversal Windows]
type = reversaldef
trigger1 = (time >= 0) && (cond(ishelper, 0, 1))
reversal.attr = sca, na, nt, sa, st, ha, ht
pausetime = 0, 20
sparkno = -1
hitsound = -1
p1stateno = 1105 ; Instantly kicks over to the Garou payload below!

[state 0, Stance Time Out]
type = changestate
trigger1 = time >= 80
value = 0
ctrl = 1
;===========================================================================
; COUNTER ATTACK PAYLOAD (Moving Barrage Rush Fixed)
;===========================================================================
[Statedef 1105]
type     = S
movetype = A
physics  = N                        ; Changed to N so forward movement isn't stopped by friction!
juggle   = 1
ctrl     = 0
anim     = 1105        
poweradd = 0
facep2   = 1
sprpriority = 2


[state 0]
type = veladd
trigger1 = !time
x = 2
ignorehitpause = 1

[state 0]
type = bgpalfx
trigger1 = time = 1
time = 150                
add = 0, 0, 0
mul = 64, 64, 64
sinadd = 0, 0, 0, 1
invertall = 0

[state 0]
type = afterimage
trigger1 = time = 0
time = 150                 
length = 10
palcolor = 0
palinvertall = 0
palbright = 0, 0, 255
palcontrast = 255, 255, 255
palpostbright = 0, 0, 0
paladd = 0, 0, 255
palmul = 0.5, 0.5, 1.0
timegap = 1
framegap = 2

[state 0]
type = afterimage
trigger1 = time = 150       
time = 0      

[state 0] 
type = explod
triggerall = prevstateno = 1200
trigger1 = time = 5
anim = 1210
id = 1210
pos = 0, 0
postype = p1
facing = facing
sprpriority = 0
scale = const(size.xscale), const(size.yscale)
ownpal = 1
removetime = -2
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
persistent = 0

[state 0]
type = veladd
trigger1 = !time
x = 2
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = random % 3
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(5)
value = s1210, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(5)
value = s1210, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(5)
value = s1210, 0 + var(1)
ignorehitpause = 1

[state 0]
type = explod
trigger1 = !animelemtime(6)
anim = 12100
id = 12100
pos = 0, 0
postype = p1
facing = 1
bindtime = -1
removetime = -1
sprpriority = 3
scale = const(size.xscale), const(size.yscale)
angle = 0
ownpal = 1
remappal = 3, (var(40))
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
persistent = 0

[state 0]
type = playsnd
trigger1 = !time
value = s60, 1
volumescale = 100
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s60, 1
volumescale = 100
ignorehitpause = 1

[state 0]
type = helper
trigger1 = animelem = 4
stateno = 8100
id = 8100
postype = p1

[state 0]
type = posadd
trigger1 = !animelemtime(4)
x = p2bodydist x - 20
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 1 + random % 3
volumescale = 90
ignorehitpause = 1

[state 0]
type = velset
trigger1 = (time > 17) && (time % 3 = 0)
x = .59
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = (time > 17) && (time % 4 = 0)
value = s2, 1 + random % 7
volumescale = 100
ignorehitpause = 1

[state 0]
type = explod
trigger1 = (time = [15, 160]) && (time % 4 = 0)
anim = 8100
id = 8100
pos = 0, -35 + (random % 30)
postype = p1
facing = 1
bindtime = 1
removetime = -2
sprpriority = cond(random < 500, 3, 0)
scale = .25, .1
angle = 90
ownpal = 1
remappal = 3, 0
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
vel = -1, 0

[state 0]
type = helper
trigger1 = (time = [15, 160]) && (time % 8 = 0)
stateno = 8120
id = 8120
pos = 5, 2
postype = p1
ownpal = 1
size.xscale = .2
size.yscale = .25
ignorehitpause = 1

;--- JONATHAN ENGINE HITBOX (RE-TUNED WITH 1201 REACTION VALUES) ---
[State 1105, Barrage Hitdef]
type = HitDef
triggerall = animelem = 5 || animelem = 8
trigger1 = 1
attr = S, NA
animtype  = Medium
damage    = 5,1
guardflag = MA
pausetime = 2,3
sparkno = -1                    
guard.sparkno = -1
sparkxy = -1, -26
hitsound   = s0, 1 + random % 3 
guardsound = s104, 0            
ground.type = High
ground.slidetime = 30
ground.hittime  = 35
guard.velocity = -1.179
;--- PUSH ENGINE: MATCHES THE ENEMY'S BACKWARD MOVEMENT TO YOUR SPEED ---
ground.velocity = -2.5          ; Negative value pushes them back perfectly with you!
air.velocity = -2.5, 0
Fall = 0
id = 5
envshake.time = 4
envshake.ampl = -4

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit = 1
stateno = 8030
id = 8030
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .325
size.yscale = .325
ignorehitpause = 1
persistent = 6
[state 0]
type = helper
trigger1 = moveguarded = 1
stateno = 8000
id = 8000
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .725
size.yscale = .725
ignorehitpause = 1
persistent = 6

[state 0]
type = varset
trigger1 = movehit = 1
v = 1
value = random % 20
ignorehitpause = 1

[state 0]
type = varset
trigger1 = movehit = 1
v = 2
value = random % 22
ignorehitpause = 1

[state 0]
type = varset
trigger1 = movehit = 1
v = 3
value = random % 24
ignorehitpause = 1

[state 0]
type = varset
trigger1 = movehit = 1
v = 4
value = random % 30
ignorehitpause = 1
;--- TIMED FINISHER TRANSITION (Using your exact triggers) ---
[State 200, End]
type = ChangeState
trigger1 = time >= 45 && command != "hold_a" 
trigger2 = time >= 80                        
value = 1106                    
ctrl = 0
;===========================================================================
; BARRAGE FINISHER STATE (The Final Slam Payload)
;===========================================================================
[Statedef 1106]
type    = S
movetype= A
physics = S
ctrl = 0
anim = 1106                     
poweradd = 0
sprpriority = 2

[state 0]
type = afterimage
trigger1 = time = 1       
time = 0 

[state 0]
type = bgpalfx
trigger1 = time = 1       
time = 0  

[state 0]
type = playsnd
trigger1 = animelem = 4
value = s160, 4
[state 0]
type = playsnd
trigger1 = animelem = 4
value = s160, 5

[state 0]
type = envshake
trigger1 = animelem = 4
time = 5
ampl = -5
freq = 25

[state 0]
type = explod
trigger1 = animelem = 4
anim = 8100
id = 8100
pos = 10, -25
postype = p1
facing = 1
bindtime = 1
removetime = -2
sprpriority = 3
scale = .5, .15
angle = 90
ownpal = 1
remappal = 3, 0
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999

[state 0]
type = velset
trigger1 = time = 5
x = 2
y = 0
ignorehitpause = 1

[state 0]
type = statetypeset
trigger1 = time > 4
statetype = a
movetype = a
physics = n
ignorehitpause = 1

[state 0]
type = velset
trigger1 = time > 11
y = 0
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = random % 6
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 17
persistent = 0
volumescale = 100
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 17
persistent = 0
volumescale = 10
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(5)
attr = a, sa
hitflag = ma
guardflag = ma
animtype = hard
priority = 4, hit
damage = (abs(ceil((enemynear, const(data.life)*3.0)/100))), (abs(ceil((enemynear, const(data.life)*2.0)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 14, 5
guardsound = s104, 0
guard.velocity = -3
ground.type = trip
ground.slidetime = 7
ground.hittime = 25
ground.velocity = -6.5, -2.6
air.velocity = -6.5, -2.6
envshake.time = 10
envshake.ampl = -6
fall = 1
fall.recover = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
getpower = 0, 0
givepower = 0, 0

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -30
postype = p2
ownpal = 1
size.xscale = .4
size.yscale = .4
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[state 0]
type = velset
trigger1 = !animelem = 2
x = 2
y = 0
ignorehitpause = 1

[State 1106, End State]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

;===============================================================================
;-----------------Ultimate Jutsu------------------------------------------------
;===============================================================================
;===============================================================================
; Gokuraku Jodo:
;-------------------------------------------------------------------------------
; Start
[Statedef 1200]
type    = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1200
poweradd = -1000
sprpriority = 2




[State 0, Explod]
type = Explod
trigger1 = time = 126
anim = 22587
ID = 22587
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .2,.2
sprpriority = -22
ontop = 0
ownpal = 1


[state 0, Screen FX Helper]
type = helper
trigger1 = time % 10 = 0
stateno = 8060
id = 8060
pos = 0, 0
postype = p1
supermovetime = 999
pausemovetime = 999

[state 0, Sound Randomizer Index]
type = varset
trigger1 = animelem = 1
v = 1
value = random % 3
ignorehitpause = 1

[State 2000, Helper]
Type = Helper
Trigger1 = animelem = 22
Name = "8 Gates Aura Effect"
ID = 2015
StateNO = 2015
pos = -15,0
postype = p1
OwnPal = 1
PauseMoveTime = 99999
IgnoreHitPause = 1
Persistent = 0

[state 0]
type = superpause
trigger1 = animelem = 1
time = 144
movetime = 144
pausebg = 1
darken = 0
anim = -1
sound = -1, 0
p2defmul = 1
poweradd = 0
unhittable = 1

[state 0]
type = superpause
trigger1 = animelem = 3
time = 144
movetime = 144
pausebg = 1
darken = 1
anim = -1
sound = -1, 0
p2defmul = 1
poweradd = 0
unhittable = 1


[state 0]
type = helper
trigger1 = !time
stateno = 8050
id = 8050
pos = 0, 0
postype = p1
ownpal = 1
supermovetime = 999
pausemovetime = 999

[state 0]
type = helper
trigger1 = animelem = 1
stateno = 8060
id = 8060
pos = 0, 0
postype = p1
supermovetime = 999
pausemovetime = 999

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,25
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,25
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 126
value = S0,24
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 126
value = S0,24
volume = 999





[state 0]
type = helper
trigger1 = (time % 10 = 0) && (time >= 12)
stateno = 8060
id = 8060
pos = 0, 0
postype = p1
supermovetime = 999
pausemovetime = 999

[state 0]
type = playsnd
trigger1 = time = 10
value = s500, 0

[state 0]
type = explod
trigger1 = time = 126
anim = 9551
id = 9551
pos = 0, 0
postype = p1
facing = 1
bindtime = -1
removetime = -2
sprpriority = 0
scale = .25, .25
angle = 0
ownpal = 1
remappal = 3, 0
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
trans = sub
[state 0]
type = explod
trigger1 = time = 126
anim = 9551
id = 9551
pos = 0, 0
postype = p1
facing = 1
bindtime = -1
removetime = -2
sprpriority = 3
scale = .25, .25
angle = 0
ownpal = 1
remappal = 3, (var(40))
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999

[state 0]
type = envshake
trigger1 = time % 10 = 0
time = 10
ampl = -2
freq = 5

[state 0]
type = playsnd
trigger1 = time =0
value = s500, 1
channel = 2


[State 0, Explod]
type = Explod
trigger1 = time = 125
anim = 8115
ID = 8115
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .25,.25
sprpriority = -22
ontop = 0
ownpal = 1
removeongethit = 1
supermovetime = 99999999
supermove = 999999999
pausemovetime = 99999999
pausemove = 999999999

[State 2000, PalFX]
Type = PalFX
Trigger1 = Time = 125
Time = 8
Add = 0, 0, 0
SinAdd = 0, 100, 256, 16      ; Emphasizes blue color channel
IgnoreHitPause = 1

[State 2000, PalFX]
Type = PalFX
Trigger1 = Time = 128
Time = 8
Add = 0, 100, 256             ; Maxes out blue channels
SinAdd = 0, -100, -256, 16    ; Fades out the blue tint
IgnoreHitPause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 125
value = S8,40
volume = 999


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 125
value = S8,38
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 125
value = S8,38
volume = 999

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 125
value = S8,39
volume = 999

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S800, 0
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S800, 0
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S800, 0
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S800, 0
volume = 999



[State 1200, ChangeState]
Type = ChangeState
Trigger1 = Time = 150
Value = 2001
Ctrl = 1
;---------------------------------------------------------------------------
[StateDef 2001]
Type = S
MoveType = A
Physics = S
juggle  = 2
ctrl = 0
Anim = 2001
SprPriority = 2


;zoom
[State 0] 
Type = Zoom
Trigger1 = Time = [5,200] 
Scale = 1.9
Pos = (Pos X/2) * CameraZoom,0
IgnoreHitPause = 1


;--- SPEED HELPER ---
[state 0]
type = helper
trigger1 = time = 0 
stateno = 8120
id = 8120
pos = 5, 0
postype = p1
ownpal = 1
size.xscale = .3
size.yscale = .35
ignorehitpause = 1

;--- BLUE SPEED PARTICLES ---
[state 0]
type = explod
trigger1 = time = 0
anim = 8100
id = 8100
pos = 0, -35 + (random % 30)
postype = p1
facing = 1
bindtime = 1
removetime = -2
sprpriority = cond(random < 500, 3, 0)
scale = .3, .3
angle = 90
ownpal = 1
remappal = 3, 0
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
vel = -1, 0


[State 2001, VelSet]
Type = VelSet
Trigger1 = time = 3
X = 35

[State 2001, PlaySnd]
Type = PlaySnd
Trigger1 = animelem = 6
Value = S21, 10 
IgnoreHitPause = 1

[State 2001, PlaySnd]
Type = PlaySnd
Trigger1 = animelem = 2
Value = S8, 45
IgnoreHitPause = 1

[State 2001, PlaySnd]
Type = PlaySnd
Trigger1 = animelem = 2
Value = S8, 42
IgnoreHitPause = 1

[State 0, Explod]
type = Explod
trigger1 = time = 3
anim = 8060
ID = 1051
pos = -15,5
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .3,.3
sprpriority = 2
ontop = 1
ownpal = 1
removeongethit = 1
[State 0, Explod]
type = Explod
trigger1 = time = 3
anim = 8060
ID = 1051
pos = -15,5
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .3,.3
sprpriority = -2
ontop = 0
trans = sub
ownpal = 1
removeongethit = 1

[State 0, FX Corte]
type = Explod
trigger1 = time = 3
anim = 7021
ID = 7021
pos = 25,5
postype = p1
facing = 1
vfacing = 1
bindtime = 0
removetime = -2
scale = .3,.3
sprpriority = -2
ontop = 1
ownpal = 1
removeongethit = 1
[State 0, FX Corte]
type = Explod
trigger1 = time = 6
anim = 7021
ID = 7021
pos = 0,5
postype = p1
facing = 1
vfacing = 1
bindtime = 0
removetime = -2
scale = .3,.3
sprpriority = -2
ontop = 1
ownpal = 1
removeongethit = 1
[State 0, FX Corte]
type = Explod
trigger1 = animelem = 5
anim = 8120
ID = 8120
pos = 0,0
postype = p1
facing = -1
vfacing = 1
bindtime = 0
removetime = -2
scale = .3,.3
sprpriority = -2
ontop = 1
ownpal = 1
removeongethit = 1

[State 2001, NotHitBy]
Type = NotHitBy
Trigger1 = !AnimElemTime(3) 
Value = SCA
Time = 4
IgnoreHitPause = 1

[State 2001, PlaySnd]
Type = PlaySnd
Trigger1 = animelem = 5
Value = S21,7
VolumeScale = 50
IgnoreHitPause = 1
Persistent = 0

[State 200, 1]
type = HitDef
triggerall = !movecontact
trigger1 = 1
attr = A, SA
HItflag = MAFDE
animtype  = up
damage    = 50,25
guardflag = MA
pausetime = 10,10
sparkno = -1
guard.sparkno = -1
sparkxy = -8,-25
hitsound   = S8,20
guardsound = S4,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -1,-9
air.velocity = -1,-8
Fall = 1
Fall.recover = 0
getpower = 0
envshake.time = 10

[State 200, REMATE]
type = ChangeState
trigger1 = movehit && animelem = 9
value = 2002

[State 0, Explod]
type = Explod
trigger1 = time = 15
anim = 2011
ID = 2011
pos = 15,-50
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
scale = .05,.05
sprpriority = 2
ontop = 1
ownpal = 1
removeongethit = 1

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit = 1
stateno = 8030
id = 8030
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .325
size.yscale = .325
ignorehitpause = 1
persistent = 6
[state 0]
type = helper
trigger1 = moveguarded = 1
stateno = 8000
id = 8000
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .725
size.yscale = .725
ignorehitpause = 1
persistent = 6

[State 0, VelSet]
type = VelSet
trigger1 = p2bodydist x < 0
x = 0

[State 2001, ChangeState]
Type = ChangeState
Trigger1 = AnimTime = 0
Value = 0
Ctrl = 1
;---------------------------------------------------------------------------
[StateDef 2002]
Type = S
MoveType = A
Physics = S
Ctrl = 0
Anim = 2002
SprPriority = 2


[State 3006, NotHitBy]
Type = NotHitBy
Trigger1 = StateNO = StateNO
Value = SCA, AA, AT, AP
IgnoreHitPause = 1

[State 3006, PosAdd]
Type = PosAdd
Trigger1 = AnimElemTime(2) >= 0
Trigger1 = AnimElemTime(3) < 0
Trigger1 = NumTarget(StateNO - 1)
X = ((Target(StateNO - 1),Pos X  - Pos X) * Facing)  / 5
Y = ((Target(StateNO - 1),Pos Y  - Pos Y) - 250)/ 5
IgnoreHitPause = 1

[State 3006, PlayerPush]
Type = PlayerPush
Trigger1 = AnimElemTime(2) >= 0
Value = 0
IgnoreHitPause = 1

[State 3006, StateTypeSet]
Type = StateTypeSet
Trigger1 = !AnimElemTime(2)
StateType = A
Physics = N
IgnoreHitPause = 1

[State 3006, PlaySnd]
Type = PlaySnd
Trigger1 = !AnimElemTime(1) 
Value = S0, 49
VolumeScale = 80
IgnoreHitPause = 1
Persistent = 0

[State 3006, PlaySnd]
Type = PlaySnd
Trigger1 = !AnimElemTime(1)
Value = S8, 40
IgnoreHitPause = 1

[State 3006, PlaySnd]
Type = PlaySnd
Trigger1 = !AnimElemTime(1)
Value = S8, 42
IgnoreHitPause = 1

[State 3006, Explod]
Type = Explod
Trigger1 = !AnimElemTime(1)
Anim = 7017
ID = 11002
Pos = (Pos X + CameraPos X) + (0 * Facing), (Pos Y)
Space = Stage 
Facing = Facing
Scale = 0.6,0.6
SprPrioritY = 3
Shadow = 0, 0, 0
OwnPal = 1
IgnoreHitPause = 1

[State 3006, Explod]
Type = Explod
Trigger1 = !AnimElemTime(1)
Anim = 2011
ID = 11007
Pos = 0,50
postype = P1
Space = Stage
Facing = Facing
Scale = .275, .175
SprPriority = 3
Shadow = 0, 0, 0
OwnPal = 1
Trans = Add
IgnoreHitPause = 1
Persistent = 0

[State 3006, Explod]
Type = Explod
Trigger1 = !AnimElemTime(1)
Anim = 2011
ID = 11007
Pos = 0,50
postype = P1
Space = Stage
Facing = Facing
Scale = -.275, .175
SprPriority = 3
Shadow = 0, 0, 0
OwnPal = 1
Trans = Sub
IgnoreHitPause = 1
Persistent = 0

[State 0, PalFXWiz]
type = PalFX
trigger1 = time = 10
time = 180
add = 50, 150, 255
mul = 200, 220, 256
sinadd = 0, 0, 0, 1
invertall = 0
color = 256

[State 3006, Helper]
Type = Helper
Trigger1 = !AnimElemTime(3)
Trigger1 = !NumHelper(2030)
Name = "Fast Movement Effect"
ID = 2030
StateNO = 2030
Pos = 100,-150
postype = P1
OwnPal = 1
PauseMoveTime = 99999
Size.XScale = 0.2
Size.YScale = 0.2
IgnoreHitPause = 1

;----------------------------
; FIXED AURA GROUNDS (Bindtime = 0 & Absolute height calculation fixes floating)
;----------------------------
[State 0, Explod]
type = Explod
trigger1 = time = 10
anim = 2010
ID = 2010
pos = 0, -80 - pos y
postype = p1
facing = 1
vfacing = 1
bindtime = 0
removetime = 180
scale = .2,.2
sprpriority = 9
ownpal = 1
angle = 40
supermovetime = 9999
pausemovetime = 9999

[State 0, Explod]
type = Explod
trigger1 = time = 10
anim = 2010
ID = 2010
pos = 120, -140 - pos y
postype = p1
facing = -1
vfacing = -1
bindtime = 0
removetime = 180
scale = .2,.2
sprpriority = 9
ownpal = 1
angle = 40
supermovetime = 9999
pausemovetime = 9999

[State 0, Explod]
type = Explod
trigger1 = time = 10
anim = 2011
ID = 2011
pos = 50, 50 - pos y
postype = p1
facing = 1
vfacing = 1
bindtime = 0
trans = add
removetime = 180
scale = .3,.3
sprpriority = 9
ownpal = 0
angle = -65
supermovetime = 9999
pausemovetime = 9999

[State 0, Explod]
type = Explod
trigger1 = time = 11
anim = 2011
ID = 2011
pos = 50, 50 - pos y
postype = p1
facing = 1
vfacing = 1
bindtime = 0
trans = sub
removetime = 180
scale = .3,.3
sprpriority = 9
ownpal = 1
angle = -65
supermovetime = 9999
pausemovetime = 9999

;----------------------------
[State 0, Explod]
type = Explod
trigger1 = time = 15
anim = 2010
ID = 2010
pos = 50, -20 - pos y
postype = p1
facing = 1
vfacing = 1
bindtime = 0
removetime = 180
scale = .2,.2
sprpriority = 9
ownpal = 1
angle = 90
supermovetime = 9999
pausemovetime = 9999

[State 0, Explod]
type = Explod
trigger1 = time = 15
anim = 2010
ID = 2010
pos = 50, -160 - pos y
postype = p1
facing = 1
vfacing = 1
bindtime = 0
removetime = 180
scale = .2,.2
sprpriority = 9
ownpal = 1
angle = -90
supermovetime = 9999
pausemovetime = 9999

[State 0, Explod]
type = Explod
trigger1 = time = 15
anim = 2011
ID = 2011
pos = 50, 50 - pos y
postype = p1
facing = 1
vfacing = 1
bindtime = 0
trans = add
removetime = 180
scale = .3,.3
sprpriority = 9
ownpal = 0
supermovetime = 9999
pausemovetime = 9999

[State 0, Explod]
type = Explod
trigger1 = time = 16
anim = 2011
ID = 2011
pos = 50, 50 - pos y
postype = p1
facing = 1
vfacing = 1
bindtime = 0
trans = sub
removetime = 180
scale = .3,.3
sprpriority = 9
ownpal = 1
supermovetime = 9999
pausemovetime = 9999

;----------------------------
[State 0, Explod]
type = Explod
trigger1 = time = 20
anim = 2010
ID = 2010
pos = 120, -80 - pos y
postype = p1
facing = -1
vfacing = 1
bindtime = 0
removetime = 180
scale = .2,.2
sprpriority = 9
ownpal = 1
angle = 40
supermovetime = 9999
pausemovetime = 9999

[State 0, Explod]
type = Explod
trigger1 = time = 20
anim = 2010
ID = 2010
pos = 0, -140 - pos y
postype = p1
facing = 1
vfacing = -1
bindtime = 0
removetime = 180
scale = .2,.2
sprpriority = 9
ownpal = 1
angle = 40
supermovetime = 9999
pausemovetime = 9999

[State 0, Explod]
type = Explod
trigger1 = time = 20
anim = 2011
ID = 2011
pos = 50, 50 - pos y
postype = p1
facing = -1
vfacing = 1
bindtime = 0
trans = add
removetime = 180
scale = .3,.3
sprpriority = 9
ownpal = 0
angle = -65
supermovetime = 9999
pausemovetime = 9999

[State 0, Explod]
type = Explod
trigger1 = time = 21
anim = 2011
ID = 2011
pos = 50, 50 - pos y
postype = p1
facing = -1
vfacing = 1
bindtime = 0
trans = sub
removetime = 180
scale = .3,.3
sprpriority = 9
ownpal = 1
angle = -65
supermovetime = 9999
pausemovetime = 9999
;----------------------------

[State 0, VelSet]
type = VelSet
trigger1 = time = [10,180]
x = -0.01
y = -0.5

[State 0, Helper]
type = Helper
Triggerall = numhelper(2050) = 0
trigger1 = time = 5
helpertype = normal
name = "2050"
ID = 2050
stateno = 2050
pos = 15,0
postype = p1
ownpal = 1

[State 3006, Null]
Type = Null
Trigger1 = Var(26) :=  2
Trigger1 = Var(27) :=  0
IgnoreHitPause = 1

[State 3006, ChangeState]
Type = ChangeState
Trigger1 = Time = 195
Value = 2003
;---------------------------------------------------------------------------
[StateDef 2003]
Type = A
MoveType = A
Physics = N
Ctrl = 0
Anim = 2003
SprPriority = 2

[state 0] 
type = velset
trigger1 = !animelemtime(8)
x = 1.20
y = -1.20
ignorehitpause = 1


[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 10
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 13
persistent = 0
volumescale = 100
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 2
value = s0, 7
persistent = 0
volumescale = 90
ignorehitpause = 1



[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,29
volume = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,29
volume = 999

[State 0, PosSet]
type = Posadd
trigger1 = time = 0
x = p2bodydist x + 0
y = p2bodydist y + -30

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

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

[State 0, TargetBind]
type = TargetBind
trigger1 = animelem = 1
time = 50
pos = 0,35

[State 0, TargetBind]
type = TargetBind
trigger1 = animelem = 7
time = 2
pos = 0,16

[State 0, TargetDrop]
type = TargetDrop
trigger1 = animelem = 7

[State 3007, NotHitBy]
Type = NotHitBy
Trigger1 = StateNO = StateNO
Value = SCA, AA, AT, AP
IgnoreHitPause = 1

[State 3006, Explod]
Type = Explod
Trigger1 = !AnimElemTime(1)
Anim = 2011
ID = 11007
Pos = 0,50
postype = P1
Space = Stage ;Screen
Facing = Facing
Scale = .2, .1
SprPriority = 3
Shadow = 0, 0, 0
OwnPal = 1
Trans = Add
IgnoreHitPause = 1
Persistent = 0
[State 3006, Explod]
Type = Explod
Trigger1 = !AnimElemTime(1)
Anim = 2011
ID = 11007
Pos = 0,50
postype = P1
Space = Stage ;Screen
Facing = Facing
Scale = -.275, .175
SprPriority = 3
Shadow = 0, 0, 0
OwnPal = 1
Trans = Sub
IgnoreHitPause = 1
Persistent = 0

[State 0, HitDef]
type = HitDef
trigger1 = animelem = 2
attr = S,NT
damage = 0,0
getpower = 0
animtype = Light
guardflag = MA
hitflag = MAF
priority = -2
sprpriority = -2
pausetime = 0, 25
sparkno = -1
sparkxy = -8,-25
hitsound = -1
guardsound = -1
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = 0,0
airguard.velocity = 0,0
air.type = High
air.velocity = 0,0
air.hittime = 12
Numhits = 0

[State 0, HitDef]
type = HitDef
trigger1 = animelem = 7
attr = S,NT
damage = 150,150
getpower = 0
animtype = down
guardflag = MA
hitflag = MAF
priority = -2
sprpriority = -2
pausetime = 5,5
sparkno = -1
sparkxy = -8,-25
hitsound = S8,19
guardsound = S4,1
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = 0,10
airguard.velocity = 0,10
air.type = High
air.velocity = 0,30
air.hittime = 12
fall = 1
; --- ENVIRONMENT SHAKE ON IMPACT ADDED HERE ---
fall.envshake.time = 20             ; Duration of the shake
fall.envshake.freq = 60             ; Frequency/speed of shake
fall.envshake.ampl = -6             ; Vertical amplitude strength
fall.envshake.phase = 90


[State 0, Explod]
type = Explod
trigger1 = animelem = 7
anim = 7013
ID = 1051
pos = 0,40
postype = p1
facing = 1
vfacing = -1
bindtime = 1
removetime = -2
scale = .3,.3
sprpriority = 2
ontop = 1
ownpal = 1
angle = 90
removeongethit = 1

[state 0]
type = targetstate
triggerall = enemy, stateno != 9060
triggerall = time >= 15
trigger1 = movehit = 2
value = 9060

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = animelem = 7
stateno = 8030
id = 8030
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .325
size.yscale = .325
ignorehitpause = 1
persistent = 6
[state 0]
type = helper
trigger1 = moveguarded = 1
stateno = 8000
id = 8000
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .725
size.yscale = .725
ignorehitpause = 1
persistent = 6

[State 3007 SuperPause]
Type = SuperPause
Trigger1 =  Movehit
Trigger1 = AnimElemTime(7) >= 0
Trigger1 = NumTarget(StateNO)
Trigger1 = Target(StateNO),GetHitVar(HitShakeTime) > 0
Time = 2
MoveTime = 0
Anim = -1
Sound = -1
Pos = 0, 0
Darken = 0
P2DefMul = 0
PowerAdd = 0
Unhittable = 0
IgnoreHitPause = 1

[State 0, End]
type = ChangeState
trigger1 = animtime = 0
value = 50
ctrl = 1
;---------------------------------------------------------------------------
[StateDef 2015]
Type = A
MoveType = I
Physics = N
VelSet = 0,0
Ctrl = 0
Anim = 9999

[State 2015, BindToRoot]
Type = BindToRoot
Trigger1 = StateNO = StateNO
IgnoreHitPause = 1

[State 2015, Turn]
Type = Turn
Trigger1 = Facing != Root,Facing
IgnoreHitPause = 1

[State 2015, Null]
Type = Null
Trigger1 = Fvar(0) := ((-100 + (Random%120)) / 100.0) * 4.0
IgnoreHitPause = 1
[State 2015, Null]
Type = Null
Trigger1 = Fvar(1) := ((-20 - (Random%80)) / 100.0) * 2.5
IgnoreHitPause = 1
[State 12030, Null]
Type = Null
Trigger1 = Fvar(2) := ((100 - (Random%45)) / 100.0) * 0.55
IgnoreHitPause = 1

[State 2015, Explod]
Type = Explod
Trigger1 = Time%2= 0
Trigger1 = Cond(Root,StateNO = 2001 && Root,AnimElemTime(5) < 0,0,1)
Anim = 9550 + Random%2
ID = 9550
Pos = 0,0
postype = p1
Space = Stage 
Facing = Facing
PauseMoveTime = 99999
Vel = Fvar(0) * Facing,Fvar(1)
Scale = 0.1,0.1
SprPriority = 2 + Random%10
Shadow = 0, 0, 0
OwnPal = 0                           ; Changed to 0 so custom tinting works
Trans = addalpha                     ; Changed to addalpha for color manipulation
Alpha = 50, 256                      ; Filters out Red/Green to leave a strong Blue aura
Angle = -50 + Random%100
IgnoreHitPause = 1

[State 2015, Null]
Type = Null
Trigger1 = Fvar(3) := ((-100 + (Random%150)) / 100.0) * 5.5
IgnoreHitPause = 1
[State 2015, Null]
Type = Null
Trigger1 = Fvar(4) := ((-50 - (Random%50)) / 100.0) * 4.0
IgnoreHitPause = 1

[State 2015, Explod]
Type = Explod
Trigger1 = Time%4 = 0
Trigger1 = Cond(Root,StateNO = 2001 && Root,AnimElemTime(5) < 0,0,1)
Anim = 9550
ID = 9550
Pos = 0,0
postype = p1
Space = Stage 
Facing = Facing
PauseMoveTime = 99999
Vel = Fvar(3) * Facing ,Fvar(4)
Accel = Cond(Fvar(3) > 0,((Fvar(3) / 20) * (-1 * Facing)),0),0
Scale = 0.045,0.045
SprPriority = 2 + Random%10
Shadow = 0, 0, 0
OwnPal = 0                           ; Changed to 0 so custom tinting works
Trans = addalpha                     ; Changed to addalpha for color manipulation
Alpha = 50, 256                      ; Filters out Red/Green to leave a strong Blue aura
Angle = Random%360
IgnoreHitPause = 1

[State 2015, DestroySelf]
Type = DestroySelf
Trigger1 = Root,StateNO != [1200,2001]
Trigger2 = Root,StateNO = 2001
Trigger2 = Root,AnimElemTime(10) >= 0
Trigger3 = Root,MoveType = H
IgnoreHitPause = 1
;---------------------------------------------------------------------------
[StateDef 2030]
Type = A
MoveType = I
Physics = N
VelSet = 0,0
Ctrl = 0
Anim = 9999

[State 3030, BindToParent]
Type = BindToParent
Trigger1 = StateNO = StateNO
IgnoreHitPause = 1

[State 3030, Null]
Type = Null
Trigger1 = Time%8 = 0
Trigger1 = Var(0) := (-125 + Random%50)
IgnoreHitPause = 1

[State 3030, Null]
Type = Null
Trigger1 = Time%8 = 0
Trigger1 = Var(1) := (-25 + Random%50)
IgnoreHitPause = 1

[State 3030, Null]
Type = Null
Trigger1 = Time%8 = 0
Trigger1 = Var(2) :=  ((Var(2) + 45) + Random%180)
IgnoreHitPause = 1

[State 3030, Explod]
Type = Explod
Trigger1 = Time%8 = 0
Anim = 2018
ID = 1108
Pos = (Pos X + CameraPos X) + ((((-260 * Const(Size.XScale))  + Var(0)) * (Cos(Var(2) * PI / 180))) * Facing), (Pos Y) + (((260 * Const(Size.YScale)) + Var(1)) * (Sin(Var(2) * PI / 180)))
postype = P1 
Facing = Facing
PauseMoveTime = 99999
Scale = 0.45 * Const(Size.XScale), 0.45 * Const(Size.YScale)
SprPriority = 3
Shadow = 0, 0, 0
OwnPal = 1
Trans = Add
Angle = Var(2)
IgnoreHitPause = 1

[State 3030, Explod]
Type = Explod
Trigger1 = Time%8 = 0
Anim = 2019
ID = 11007
Pos = (Pos X + CameraPos X) + (Var(0) * Facing), (Pos Y) + (Var(1))
postype = P1 
Facing = Facing
PauseMoveTime = 99999
Vel = (Cos((PI * 2) - (Var(2) / 180.0) * PI) * 10) *  Facing, (Sin((PI * 2) - (Var(2)  / 180.0) * PI) * 10)
Scale = 0.825  * Const(Size.XScale),0.825 * Const(Size.YScale)
SprPriority = 3
Shadow = 0, 0, 0
OwnPal = 1
Trans = Add
RemapPal = 5,17
Angle = -90 + Var(2)
IgnoreHitPause = 1

[State 3030, Explod]
Type = Explod
Trigger1 = Time%8 = 0
Anim = 2019
ID = 11007
Pos = (Pos X + CameraPos X) + (Var(0) * Facing), (Pos Y) + (Var(1))
postype = P1
Facing = Facing
PauseMoveTime = 99999
Vel = (Cos((PI * 2) - (Var(2) / 180.0) * PI) * 10) *  Facing, (Sin((PI * 2) - (Var(2)  / 180.0) * PI) * 10)
Scale = -0.825 * Const(Size.XScale), 0.825 * Const(Size.YScale)
SprPriority = 3
Shadow = 0, 0, 0
OwnPal = 1
Trans = Sub
Angle = -90 + Var(2)
IgnoreHitPause = 1

[State 3030, PlaySnd]
Type = PlaySnd
Trigger1 = Time%8 = 0
Value = S8, 40
VolumeScale = 25
IgnoreHitPause = 1
[State 3030, PlaySnd]
Type = PlaySnd
Trigger1 = Time%8 = 0
Value = S8, 40
VolumeScale = 25
IgnoreHitPause = 1

[State 3030, PlaySnd]
Type = PlaySnd
Trigger1 = Time%8 = 0
Value = S8, 42
VolumeScale = 25
IgnoreHitPause = 1
[State 3030, PlaySnd]
Type = PlaySnd
Trigger1 = Time%8 = 0
Value = S8, 42
VolumeScale = 25
IgnoreHitPause = 1

[State 3030, DestroySelf]
Type = DestroySelf
Trigger1 = Parent,StateNO != 2002
Trigger2 = Parent,MoveType = H
IgnoreHitPause = 1
;-------------------------------------------------------------------------------
[Statedef 2050]
type    = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 2050
sprpriority = 2


[state 0]
type = bgpalfx
trigger1 = time = 0
time = 189
add = 0, 0, 0
mul = 64, 64, 64
sinadd = 0, 0, 0, 1
invertall = 0

[State 0, VarRandom]
type = VarRandom
trigger1 = !time
v = 29
range = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(29) = 0
trigger1 = Movehit = 1
trigger1 = hitcount = 1||hitcount = 2||hitcount = 3||hitcount = 4||hitcount = 5||hitcount = 6||hitcount = 7||hitcount = 8||hitcount = 9||hitcount = 10||hitcount = 11||hitcount = 12||hitcount = 13
value = S8,47+Random%6
volume = 999
ignorehitpause = 1
[State 0, PlaySnd]
type = PlaySnd
triggerall = var(29) =0
trigger1 = Movehit = 1
trigger1 = hitcount = 1||hitcount = 2||hitcount = 3||hitcount = 4||hitcount = 5||hitcount = 6||hitcount = 7||hitcount = 8||hitcount = 9||hitcount = 10||hitcount = 11||hitcount = 12||hitcount = 13
value = S8,47+Random%6
volume = 999
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(29) = 1
trigger1 = Movehit = 1
trigger1 = hitcount = 1||hitcount = 2||hitcount = 3||hitcount = 4||hitcount = 5||hitcount = 6||hitcount = 7||hitcount = 8||hitcount = 9||hitcount = 10||hitcount = 11||hitcount = 12||hitcount = 13
value = S8,47+Random%6
volume = 999
ignorehitpause = 1
[State 0, PlaySnd]
type = PlaySnd
triggerall = var(29) =1
trigger1 = Movehit = 1
trigger1 = hitcount = 1||hitcount = 2||hitcount = 3||hitcount = 4||hitcount = 5||hitcount = 6||hitcount = 7||hitcount = 8||hitcount = 9||hitcount = 10||hitcount = 11||hitcount = 12||hitcount = 13
value = S8,47+Random%6
volume = 999
ignorehitpause = 1


[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
moveCamera = 0,0
ignoreHitPause = 1

[State 200, 1]
type = HitDef
trigger1 = timemod = 7,0 && time > 0 && time < 180
attr = A, SA
animtype  = Medium
damage    = 8,7
Hitflag = MAFDE
guardflag = MA
pausetime = 0,5
guard.pausetime = 5,6
sparkno = -1
guard.sparkno = -1
sparkxy = 0,0
hitsound   = -1
guardsound = S4,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 25
; --- FORCES OPPONENT TO STAY IN PLACE ON GROUND OR AIR ---
ground.velocity = 0,0               
air.velocity = 0,0                  
; ---------------------------------------------------------
air.hittime = 25
fall.recover = 0
; --- COMPLETELY DISABLES CORNER PUSHING ---
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
p1.cornerpush.veloff = 0
p2.cornerpush.veloff = 0
; ------------------------------------------
envshake.time = 5

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit = 1
stateno = 8030
id = 8030
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .325
size.yscale = .325
ignorehitpause = 1
persistent = 6
[state 0]
type = helper
trigger1 = moveguarded = 1
stateno = 8000
id = 8000
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .725
size.yscale = .725
ignorehitpause = 1
persistent = 6

[State 0, DestroySelf]
type = DestroySelf
trigger1 = AnimTime = 0
;-----------------------------
[StateDef 105052]
type = A
movetype= H
physics = N
juggle  = 1
ctrl = 0
anim = 5000+var(0)*10000
poweradd = 0
sprpriority = 0

[State 195, 2]
type = selfstate
trigger1 = time = 200
value = 5000
ctrl = 1

;-----------------------------
[StateDef 105053]
type = A
movetype= H
physics = N
juggle  = 1
ctrl = 0
anim = 5170+var(0)*10000
poweradd = 0
sprpriority = 6

[State 195, 2]
type = selfstate
trigger1 = time = 100
value = 5050
ctrl = 1

;-------------------------------------------------------------------------------
; P2 Hacia Abajo Vertical (Fixed for Rock Lee's Super Slam)
[Statedef 3305]
type    = A
movetype= H                         ; Must be H (GetHit) so they look like they are in pain
physics = N                         ; Must be N (No Physics) so gravity doesn't float them up!
juggle  = 1
ctrl = 0
sprpriority = -1
facep2 = 1


[State 0, Force Downward Speed]
type = VelSet
trigger1 = time = 0
x = 0
y = 20                              ; Slam them down fast!

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

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 5

; --- FORCE STANDARD MUGEN FALL ANIMATION ---
[State 0, Fall Anim]
type = ChangeAnim
trigger1 = time = 0
value = 5050                        ; Universal "Slammed into air/falling" animation
; -------------------------------------------

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 180                         ; Keeps them spun around for the upside down slam

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

[State 200, End]
type = Changestate
trigger1 = pos y >= -5             ; Triggers cleanly as soon as they hit the dirt
value = 3306
ignorehitpause = 1

;-------------------------------------------------------------------------------
; P2 Reventado Suelo (The Dirt Crash)
[Statedef 3306]
type    = S
movetype= H                         ; Must be H (GetHit)
physics = S                         ; Ground physics
juggle  = 1
ctrl = 0
sprpriority = -1
facep2 = 1

; --- STANDARD MUGEN GROUND DUST IMPACT ---
[State 3306, Floor Impact FX]
type = Explod
trigger1 = time = 0                 
anim = 9060                        ; Uses MUGEN's built-in universal ground dust slam FX!
ID = 9060
pos = 0, 0                          
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2                     
scale = .2, .2                        
sprpriority = 3                     
ontop = 1
ownpal = 1
ignorehitpause = 1

; --- STANDARD MUGEN GROUND DUST IMPACT ---
[State 3306, Floor Impact FX]
type = Explod
trigger1 = time = 0                 
anim = 8115                       ; Uses MUGEN's built-in universal ground dust slam FX!
ID = 8115
pos = 0, 0                          
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -1                     
scale = .2, .2                        
sprpriority = 3                     
ontop = 1
ownpal = 1
ignorehitpause = 1

; --- STANDARD MUGEN GROUND DUST IMPACT ---
[State 3306, Floor Impact FX]
type = Explod
trigger1 = time = 0                 
anim = 8240                       ; Uses MUGEN's built-in universal ground dust slam FX!
ID = 8240
pos = 0, 0                          
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -1                     
scale = .2, .2                        
sprpriority = 3                     
ontop = 1
ownpal = 1
ignorehitpause = 1

[State ____, EnvShake]
type = EnvShake
trigger1 = time = 0  ; Or when the hit connects/floors them
time = 20            ; Duration of the shake
freq = 60            ; Frequency
ampl = -4            ; Amplitude (vertical shakiness)

[State 0, LifeAdd]
type = LifeAdd
trigger1 = time = 0
value = -10

[State 0, Reset Angle]
type = AngleDraw
trigger1 = 1
value = 0                           ; Turn them right-side up instantly on impact

[State 0, Pin To Ground]
type = PosSet
trigger1 = time = 0
y = 0

[State 0, Stop Velocity]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

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

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 5

                   ; Universal MUGEN ground bounce/hit animation
; ----------------------------------------------

[State 200, End]
type = Selfstate
trigger1 = time = 40                ; Gives them a moment to absorb the hit...
value = 5110                        ; ...then forces standard MUGEN down/lying state safely!
ctrl = 1
;===============================================================================
;===============================================================================
;-------------------------------------------------------------------------------
; One Inch Punch - 1
[Statedef 1300]
type    = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1300
poweradd = -1000
sprpriority = 3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit = 1
value = S115,1
volumescale = 100
[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit = 1
value = S115,1
volumescale = 100


[State 0, Glass/Effect Sandwich Layer]
type = Explod
trigger1 = Movehit = 1
anim = 225417
ID = 225417
postype = P2
pos = 0,-40
facing = 1
sprpriority = 1          
supermove = 1
removetime = -2
bindtime = 1
ownpal = 1
scale = 0.7, 0.5
removeongethit = 1
supermovetime = 999
pausemovetime = 999      ; Kept this from our last fix!
ignorehitpause = 1
; === TRANSPARENCY ADDED HERE ===
trans = addalpha         ; Enables alpha blending transparency
alpha = 35, 256         ; First number (120) controls the explod visibility (lower = more see-through)


[state 0]
type = superpause
trigger1 = animelem = 1
time = 30
movetime = 30
pausebg = 1
darken = 0
anim = -1
sound = -1, 0
p2defmul = 1
poweradd = 0
unhittable = 1

[state 0]
type = bgpalfx
trigger1 = animelem = 1
time = 29
add = 0, 0, 0
mul = 64, 64, 64
sinadd = 0, 0, 0, 1
invertall = 0

[state 0]
type = bgpalfx
trigger1 = movehit = 1
time = 50
add = 0, 0, 0
mul = 64, 64, 64
sinadd = 0, 0, 0, 1
invertall = 0

[state 0]
type = helper
trigger1 = !time
stateno = 8050
id = 8050
pos = 0, 0
postype = p1
ownpal = 1
supermovetime = 999
pausemovetime = 999

[state 0]
type = helper
trigger1 = animelem = 1
stateno = 8060
id = 8060
pos = 0, 0
postype = p1
supermovetime = 999
pausemovetime = 999


; SOUNDS ============
;====================

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

[State 210, 1]
type = HitDef
trigger1 = !Movecontact
attr = S, NA
damage = 0,0
animtype = Light
guardflag = MA
Hitflag = MAFD
priority = 3, Hit
pausetime = 5,50
sparkno = -1
guard.sparkno = -1
sparkxy = -10,-40
hitsound = S5,7
guardsound = -1
ground.type = High
ground.slidetime = 5
ground.hittime  = 45
ground.velocity = 0,0
air.type = High
air.hittime = 12
EnvShake.Time = 4
EnvShake.Ampl = -4


[state 0]
type = helper
trigger1 = movehit = 1
stateno = 9900
id = 9900
postype = p2
pos = 0, 0
ownpal = 0
persistent = 0

[State 0, Catch Spark]
type = Explod
trigger1 = Movehit = 1
anim = 8050;7010
ID = 8050
postype = P1
pos = 22,-35
facing = 1
sprpriority = -1
ontop = 1
supermove = 1
removetime = -2
bindtime = 1
ownpal = 1
scale = 0.1,0.1
removeongethit = 1
supermovetime = 999
ignorehitpause  = 1

[state 0]
type = superpause
trigger1 = movehit = 1
time = 70
movetime = 0
pausebg = 1
darken = 0
anim = -1
sound = -1, 0
p2defmul = 1
poweradd = 0
unhittable = 1

[State 0, Save Hit Success]
type = VarSet
trigger1 = MoveHit = 1
v = 13
value = 1                        ; Saves the hit into var(13) memory
ignorehitpause = 1

[State 0, Reset Hit Variable at Start]
type = VarSet
trigger1 = time = 0
v = 13
value = 0                        ; Clears the old hit memory instantly

[State 200, End]
type = ChangeState
triggerall = var(13) = 1         ; CRITICAL: Only goes to next state if it hits!
triggerall = time >= 30
trigger1 = ailevel = 0 && command != "hold_a"
trigger2 = time = 65
trigger3 = ailevel > 0 && p2bodydist x < 100
trigger4 = ailevel > 0 && p2bodydist x >= 100 && p2bodydist x < 300 && time = 15+random%20
value = 33001

[State 200, Whiff Reset]
type = ChangeState
trigger1 = AnimTime = 0          ; If animation ends and it missed, reset to stance
value = 0
ctrl = 1
;-------------------------------------------------------------------------------
; One Inch Punch - 2
[Statedef 33001]
type    = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 33001
poweradd = 0
sprpriority = 2


[State 0, Glass/Effect Sandwich Layer]
type = Explod
trigger1 = Movehit = 1
anim = 141477
ID = 141477
postype = P2
pos = 0,-40
facing = 1
sprpriority = 1          
supermove = 1
removetime = -2
bindtime = 1
ownpal = 1
scale = 0.2, 0.2
removeongethit = 1
supermovetime = 999
pausemovetime = 999      ; Kept this from our last fix!
ignorehitpause = 1
   
[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit = 1
value = S115,0
volumescale = 100
[State 0, PlaySnd]
type = PlaySnd
trigger1 = movehit = 1
value = S115,0
volumescale = 100


[state 0]
type = removeexplod
trigger1 = movehit = 1
id = 225417

[State 0, Reset Hit Variable at Next Punch]
type = VarSet
trigger1 = time = 0
v = 13
value = 0                        ; Clears the memory when entering the 2nd punch

[state 0]
type = helper
trigger1 = animelem = 2
stateno = 8100
id = 8100
postype = p1

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit = 1
stateno = 8030
id = 8030
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .325
size.yscale = .325
ignorehitpause = 1
persistent = 6
[state 0]
type = helper
trigger1 = moveguarded = 1
stateno = 8000
id = 8000
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .725
size.yscale = .725
ignorehitpause = 1
persistent = 6


;=============================


; SOUNDS ============
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S0,24
volumescale = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 3
value = S5,4
volumescale = 100



[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 1
x = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = AnimElem = 3
time = 5
ampl = -4

[State 200, Glow Hit FX1]
type = Explod
trigger1 = AnimElem = 2
anim = 33007
ID = 1007
postype = P1
pos = 20*Helper(999999),Fvar(16),-28*Helper(999999),Fvar(16)
facing = 1
sprpriority = 3
ontop = 1
removetime = -2
bindtime = 1
ownpal = 1
scale = .10*Helper(999999),Fvar(16),.15*Helper(999999),Fvar(16)
removeongethit = 1
supermovetime = 999
ignorehitpause  = 1
Vel = .25,0
Trans = AddAlpha
ALpha = 180,256

[State 200, Glow Hit FX1]
type = Explod
trigger1 = AnimElem = 2
anim = 33007
ID = 1007
postype = P1
pos = 20*Helper(999999),Fvar(16),-28*Helper(999999),Fvar(16)
facing = 1
sprpriority = 0
ontop = 0
removetime = -2
bindtime = 1
ownpal = 1
scale = .10*Helper(999999),Fvar(16),.15*Helper(999999),Fvar(16)
removeongethit = 1
supermovetime = 999
ignorehitpause  = 1
Vel = .25,0
Trans = AddAlpha
ALpha = 106,256

[State 0, Shock Wave]
type = Explod
trigger1 = AnimElem = 3
anim = 450
ID = 900
pos = 30*Helper(999999),Fvar(16),-25*Helper(999999),Fvar(16)
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = .125*Helper(999999),Fvar(16),.125*Helper(999999),Fvar(16)
sprpriority = 1
ontop = 1
ownpal = 1
removeongethit = 1
Vel = -.125,0

[State 210, 1]
type = HitDef
trigger1 = !Movecontact
attr = S, NA
damage = 60,25
animtype = Heavy
guardflag = MA
Hitflag = MAF
priority = 3, Hit
pausetime = 5,15
sparkno = -1
guard.sparkno = -1
sparkxy = -10,-40
hitsound = S1,13
guardsound = S4,1
ground.type = High
ground.slidetime = 5
ground.hittime  = 45
ground.velocity = -2,-4
air.velocity = -2,-4
air.type = High
air.hittime = 12
Fall = 1
Fall.Recover = 0
EnvShake.Time = 8
EnvShake.Ampl = -6
ground.cornerpush.veloff = 0

[State 0, Blow Spark]
type = Explod
triggerall = Numexplod(1006) = 0
trigger1 = Movehit = 1
anim = 7010;7010
ID = 1006
postype = P1
pos = 20*Helper(999999),Fvar(16),-26*Helper(999999),Fvar(16)
facing = 1
sprpriority = -1
ontop = 0
removetime = -2
bindtime = 1
ownpal = 1
scale = .25*Helper(999999),Fvar(16),.225*Helper(999999),Fvar(16);.4*Helper(999999),Fvar(16),.35*Helper(999999),Fvar(16)
removeongethit = 1
ignorehitpause  = 1

[State 0, Spark B1]
type = Helper
trigger1 = movehit = 1 && numhelper(1000) = 0
helpertype = normal
name = "Spark B1"
ID = 980
stateno = 980
pos = 0*Helper(999999),Fvar(16),-25*Helper(999999),Fvar(16)
postype = P2
facing = -1
ownpal = 1
size.xscale = .275*Helper(999999),Fvar(16)
size.yscale = .275*Helper(999999),Fvar(16)
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = animelem = 4
anim = 7013
ID = 1051
pos = 0,40
postype = p1
facing = 1
vfacing = -1
bindtime = 1
removetime = -2
scale = .3,.3
sprpriority = 2
ontop = 1
ownpal = 1
angle = 90
removeongethit = 1

[state 0]
type = targetstate
triggerall = enemy, stateno != 9060
triggerall = time >= 1
trigger1 = movehit = 1
value = 9060

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = animelem = 4
stateno = 8030
id = 8030
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .325
size.yscale = .325
ignorehitpause = 1
persistent = 6
[state 0]
type = helper
trigger1 = moveguarded = 1
stateno = 8000
id = 8000
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .725
size.yscale = .725
ignorehitpause = 1
persistent = 6

[State 3007 SuperPause]
Type = SuperPause
Trigger1 =  Movehit
Trigger1 = AnimElemTime(7) >= 0
Trigger1 = NumTarget(StateNO)
Trigger1 = Target(StateNO),GetHitVar(HitShakeTime) > 0
Time = 2
MoveTime = 0
Anim = -1
Sound = -1
Pos = 0, 0
Darken = 0
P2DefMul = 0
PowerAdd = 0
Unhittable = 0
IgnoreHitPause = 1

[State 200, End]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

[StateDef 1400]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1400
poweradd = -1000
sprpriority = 2

[state 0]
type = bgpalfx
trigger1 = animelem = 1
time = 400
add = 0, 0, 0
mul = 64, 64, 64
sinadd = 0, 0, 0, 1
invertall = 0

[state 0]
type=Pause
trigger1=time=14
time=50
movetime=50

[state 0]
type = PlaySnd
trigger1 = time = 0
value = S0,5
volumescale = 100
channel = 10

[State 200, PlaySnd]
type = PlaySnd
trigger1 = time >= 50
trigger1 = timemod = 10,0
value = S5,49
volume = 255
channel = -1

[State 200, PlaySnd]
type = PlaySnd
trigger1 = time >= 50
trigger1 = timemod = 10,0
value = S5,50
volume = 255
channel = -1

[State 200, PlaySnd]
type = PlaySnd
trigger1 = time >= 50
trigger1 = timemod = 10,0
value = S5,51
volume = 255
channel = -1

[state 0]
type=helper
trigger1=time = 0
id=8050
stateno=8050
pos=0,0
postype=p1
ownpal=1
pausemovetime = 999
supermovetime = 999

[state 0]
type=helper
trigger1=time%10=0
stateno=8060
id=8060
pos=0,0
postype=p1
supermovetime=999
pausemovetime=999

[state 0]
type=palfx
trigger1=time = 0
time=10
add=130,130,130
mul=256,256,256
color=256

[State 0, Helper Clone 1]
type = Helper
trigger1 = animelem = 5
ID = 1401
stateno = 1401
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper Clone 2]
type = Helper
trigger1 = animelem = 7
ID = 1402
stateno = 1402
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper Clone 1 Repeat]
type = Helper
trigger1 = animelem = 8
ID = 1401
stateno = 1401
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 0

[State 0, Helper Clone 2 Repeat]
type = Helper
trigger1 = animelem = 13
ID = 1402
stateno = 1402
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 0

[state 0]
type = VelSet
trigger1 = animelem = 6
trigger2 = animelem = 13
x = 0

[state 0]
type = VelSet
triggerall = time = [50,100]
trigger1 = animelem = 3
x = 15

[state 0]
type = VelSet
triggerall = time = [50,100]
trigger1 = animelem = 10
x = -15

[state 0]
type = VelSet
triggerall = time = [100,150]
trigger1 = animelem = 3
x = 19

[state 0]
type = VelSet
triggerall = time = [100,150]
trigger1 = animelem = 10
x = -19

[state 0]
type = VelSet
triggerall = time = [150,400]
trigger1 = animelem = 3
x = 23

[state 0]
type = VelSet
triggerall = time = [150,400]
trigger1 = animelem = 10
x = -23

[State 915]
type = AfterImage
trigger1 = animelem = 3
trigger2 = animelem = 10
time = 10
trans = add1
TimeGap  = 2
FrameGap = 2
length = 10
PalBright = 0, 0, 50
PalContrast = 80, 80, 256
PalAdd = 0, 0, 120
PalMul = 0.5, 0.5, 1.5

[State 0, Helper]
type = Helper
trigger1 = animelem = 3
trigger2 = animelem = 10
name = "Ground Dig FX"
ID = 1530
stateno = 1530
pos = 25,0
postype = P1
facing = 1
keyctrl = 0
ownpal = 1
pausemovetime = 5
size.xscale = .3
size.yscale = .3
size.shadowoffset = 2000

[State 0, Helper]
type = Helper
trigger1 = animelem = 3
name = "Ground Swirl FX"
ID = 1540
stateno = 1540
pos = -2,0
postype = P1
facing =1
keyctrl = 0
ownpal = 1
pausemovetime = 5
size.xscale = .15
size.yscale = .2

[State 0, Helper]
type = Helper
trigger1 = animelem = 10
name = "Ground Swirl FX"
ID = 1540
stateno = 1540
pos = 22,0
postype = P1
facing =-1
keyctrl = 0
ownpal = 1
pausemovetime = 5
size.xscale = .15
size.yscale = .2

[State 0,Dirt]
type=Explod
triggerall = time = [51,370]
trigger1=TimeMod=4,0
anim=7031
ID=7031
pos=0,-5
postype=p1
facing=1
vfacing=1
bindtime=0
removetime=-2
scale=.2,.15
sprpriority=1
ontop=1
ownpal=1
removeongethit=1
Vel=-.5,0

[State 0,Dirt]
type=Explod
triggerall = time = [51,370]
trigger1=TimeMod=8,0
anim=7031
ID=7031
pos=0,-5
postype=p1
facing=-1
vfacing=1
bindtime=0
removetime=-2
scale=.2,.15
sprpriority=1
ontop=1
ownpal=1
removeongethit=1
Vel=.5,0

[State 0, Helper]
type = Helper
triggerall = time = [51,370]
trigger1 = timemod = 5,0
name = "Ground Dust Damage FX"
ID = 1550
stateno = 1550
pos = 0,-20
postype = P1
facing = cond(random < 500,-1,1)
keyctrl = 0
ownpal = 1
pausemovetime = 7
size.xscale = .4
size.yscale = .4

[State 715, end]
type = ChangeState
trigger1 = Time = 400
value = 0
ctrl = 1

;-------------------------------------------------------------------------------
[StateDef 1401]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1401
poweradd = 0
sprpriority = 2

[State 915]
type = AfterImage
trigger1 = time = 0
time = 10
trans = add1
TimeGap = 2
FrameGap = 2
length = 10
PalBright = 0, 0, 50
PalContrast = 80, 80, 256
PalAdd = 0, 0, 120
PalMul = 0.5, 0.5, 1.5

[state 0]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[state 0]
type = VelSet
trigger1 = 1
x = -10

[State 700, end]
type = destroyself
trigger1 = !animtime

;-------------------------------------------------------------------------------
[StateDef 1402]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1402
poweradd = 0
sprpriority = 2

[State 915]
type = AfterImage
trigger1 = time = 0
time = 10
trans = add1
TimeGap = 2
FrameGap = 2
length = 10
PalBright = 0, 0, 50
PalContrast = 80, 80, 256
PalAdd = 0, 0, 120
PalMul = 0.5, 0.5, 1.5

[state 0]
type = AssertSpecial
trigger1 =1
flag = noshadow

[state 0]
type = VelSet
trigger1 = 1
x = 10

[State 700, end]
type = destroyself
trigger1 = !animtime

;-------------------------------------------------------------------------------
[StateDef 1530]
type = S
physics = N
velset = 0,0
ctrl = 0
anim = 8240
sprpriority =-7

[State 0, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 50
freq = 60
ampl = -2
phase = 90
IgnoreHitPause=1

[state 0]
type = destroyself
trigger1 = parent, stateno != 1400
IgnoreHitPause = 1

;-------------------------------------------------------------------------------
[StateDef 1540]
type = S
physics = N
velset = 0,0
ctrl = 0
anim = 8120
sprpriority = 6

[state 0]
type = AssertSpecial
trigger1 =1
flag = noshadow

[state 0]
type = Trans
trigger1 = 1
trans = add

[state 0]
type = destroyself
trigger1 = parent,stateno != 1400
IgnoreHitPause = 1

;-------------------------------------------------------------------------------
[StateDef 1550]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 8112
sprpriority = 2

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit = 1
stateno = 8030
id = 8030
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .325
size.yscale = .325
ignorehitpause = 1
persistent = 6
[state 0]
type = helper
trigger1 = moveguarded = 1
stateno = 8000
id = 8000
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .725
size.yscale = .725
ignorehitpause = 1
persistent = 6

[state 0]
type = AssertSpecial
trigger1 =1
flag = noshadow
flag2 = unguardable

[State 200, HitDef]
type = HitDef
triggerall = time <= 15
trigger1 = time = 0
attr = S, SA
damage = 9,3
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 0,20
sparkno = -1
sparkxy = -1,-1
hitsound = S1,2
guardsound = s104,0
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -4,-3
airguard.velocity = -4,-3
air.type = High
air.velocity = -4.4,-3
getpower = 0
kill = 1
fall = 1
fall.recover = 0

[state 0]
type = destroyself
trigger1 = !animtime
;-----------------------------
;-------------------------------------------------------------------------------
[Statedef 1605]
type    = A
movetype= A
physics = N
anim = 1605
poweradd =0
sprpriority = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = 1
time = 15
freq = 40
ampl = -2
ignorehitpause = 1
persistent = 15

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1
time = 1
facing = 0
pos = 20,-35+fvar(25)
ignorehitpause = 1

[state 0]
type = VarSet
trigger1 = time=0
fv = 25    ;fv = 10
value = 0
ignorehitpause = 1
;persistent = 
[state 0]
type = VarAdd
trigger1 = (time=[0,20]) || (time=[40,60]) || (time=[80,90])
fv =    25 ;fv = 
value = .3
ignorehitpause = 1
[state 0]
type = VarAdd
trigger1 = (time=[20,40]) || (time=[60,80]) || (time=[90,110])
fv =    25 ;fv = 
value = -.3
ignorehitpause = 1
;persistent = 

[state 0]
type = PlaySnd
trigger1 =1
value = S401,14
volumescale = 999
persistent = 80
;lowpriority = -1

[state 0]
type = Explod
trigger1 =1
anim = 1611
ID = 1610
pos = 0,-3
postype = p1
facing = -1 ;P2, Front, Back, Left, Right
bindtime = 1
vel = 7,0
accel = -.1,0
random = 0,0
persistent = 4
removetime = -2
supermovetime = 0
pausemovetime = 0
scale =.3,.3
sprpriority = 3
trans=add
angle = 0
remappal = 3,0
ownpal = 1
removeongethit = 1
[state 0]
type = Explod
trigger1 =1
anim = 1611
ID = 1610
pos =0,-3
postype = p1
facing = -1 ;P2, Front, Back, Left, Right
bindtime = 1
vel = 7,0
accel = -.1,0
random = 0,0
persistent = 4
removetime = -2
supermovetime = 0
pausemovetime = 0
scale =.3,.3
sprpriority = 3
trans=sub
angle = 0
ownpal = 1
removeongethit = 1
;
;[state 0]
;type = Explod
;trigger1 =1
;anim = 1610
;ID = 1610
;pos = 0,0
;postype = p1
;facing = -1 ;P2, Front, Back, Left, Right
;bindtime = 1
;vel = 7,0
;accel = -.1,0
;random = 0,0
;persistent = 4
;removetime = -2
;supermovetime = 0
;pausemovetime = 0
;scale =.3,.3
;sprpriority = 4
;remappal = 7500,1
;trans=add
;angle = 90
;ownpal = 1
;removeongethit = 1
;[state 0]
;type = Explod
;trigger1 =1
;anim = 1610
;ID = 1610
;pos = 0,0
;postype = p1
;facing = -1 ;P2, Front, Back, Left, Right
;bindtime = 1
;vel = 7,0
;accel = -.1,0
;random = 0,0
;persistent = 4
;removetime = -2
;supermovetime = 0
;pausemovetime = 0
;scale =.3,.3
;sprpriority = 4
;trans=sub
;angle = 90
;ownpal = 1
;removeongethit = 1
;persistent = 
;[State 0, TargetBind]
;type = TargetBind
;trigger1 = movehit = 1 && hitcount = 1
;time = 1
;id = -1
;pos = 0,0
;ignorehitpause = 1



[state 0]
type = HitDef
trigger1 = 1
attr = A, SA
animtype  = up
damage    = 8,4
guardflag = MA
pausetime = 0,2
sparkno = -1
persistent = 4
guard.sparkno=s8000
sparkxy=0,-25
hitsound=s5,2
guardsound=s104,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
getpower=0
ground.velocity = cond(p2bodydist x< 90,cond(time<5,-6,-2),-.1),cond(time>94,-8,-1)
air.velocity = cond(p2bodydist x< 90,cond(time<5,-6,-2),-.1),cond(time>94,-8,-1)
ignorehitpause = 1
fall = 1
fall.recover=0
p2facing = 1
envshake.Time = 10
envshake.Ampl = COND(RANDOM<500,-9,9)

[state 0]
type = Helper
trigger1 =movehit = 1
name = "Hit Spark"
ID = 8010
stateno = 8010
pos = -15+random%25,-15-random%45
postype = p2
facing = -1
ownpal = 1
ignorehitpause = 1
persistent = 8
size.xscale=.15
size.yscale=.15
[state 0]
type = PlaySnd
trigger1 = time= 75 ;|| (time>0&&timemod =20,0)
value = S401,13
volumescale = 999
[state 0]
type = destroyself
trigger1 = time = 15|| root,stateno !=620
value = 14088
;-----------------------------

[statedef 1403]
type = a
movetype = a
physics = a
anim = 1403
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0] 
type = velset
trigger1 = !animelemtime(1)
x = 2
y = -2.5
ignorehitpause = 1

[state 0]
type = angledraw
trigger1 = stateno = 1430
value = -30 - time * 41
scale = const(size.xscale), const(size.yscale)
ignorehitpause = 1

[state 0]
type = changestate
trigger1 = time >= 4
value = 1404
ctrl = 1

[statedef 1404]
type = a
movetype = a
physics = a
anim = 1404
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0] 
type = velset
trigger1 = !animelemtime(1)
x = 4.0
y = -1.0
ignorehitpause = 1

[state 0] 
type = velset
trigger1 = !animelemtime(2)
x = 4.0
y = -1.5
ignorehitpause = 1

[state 0] 
type = velset
trigger1 = movehit = 1
x = 1.2
y = 0.0
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 1
value = cond(random < 500, random % 6, random % 8)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(4)
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !animelemtime(4)
value = s4, 0 + var(1)
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 6
value = s2, 1 + random % 7
volumescale = 80
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 13
persistent = 0
volumescale = 100
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 12
persistent = 0
volumescale = 100
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = !animelemtime(4)
attr = a, sa
hitflag = maf
guardflag = ma
animtype = medium
priority = 4, hit
damage = (abs(ceil((enemynear, const(data.life)*2.0)/50))), (abs(ceil((enemynear, const(data.life)*1.0)/70)))
sparkno = -1
sparkxy = -8, -25
guard.sparkno = -1
pausetime = 10, 3
guardsound = s104, 0
guard.velocity = -0.52
ground.type = high
ground.slidetime = 7
ground.hittime = 30
ground.velocity = 0, 10
air.velocity = -2, 10
envshake.time = 9
envshake.ampl = 18
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
down.bounce = 1
fall = 1
fall.recover = 0
fall.xvelocity = -0.00
fall.yvelocity = -0.00
getpower = 30, 15
givepower = 0, 0

[state 0]
type = targetstate
triggerall = enemy, stateno != 9060
trigger1 = movehit = 1
value = 9060

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -30
postype = p2
ownpal = 1
size.xscale = .4
size.yscale = .4
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[state 0]
type = changestate
trigger1 = !animtime
value = 50
ctrl = 1

[;-------------------------------------------------------------------------------
; special - 4 ,1
[Statedef 1500]
type = S
movetype= A
physics = S
ctrl = 0
anim = 300
velset = 0,0
sprpriority = -2
poweradd = -1500
juggle = 0

[state 0]
type = bgpalfx
trigger1 = animelem = 2
time = 29
add = 0, 0, 0
mul = 64, 64, 64
sinadd = 0, 0, 0, 1
invertall = 0

[state 0]
type = helper
trigger1 = !time
stateno = 8050
id = 8050
pos = 0, 0
postype = p1
ownpal = 1
supermovetime = 999
pausemovetime = 999

[state 0]
type = helper
trigger1 = animelem = 1
stateno = 8060
id = 8060
pos = 0, 0
postype = p1
supermovetime = 999
pausemovetime = 999

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S200,0
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S200,0
volumescale = 999

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

[State 200, 1]
type = HitDef
triggerall = !movecontact
trigger1 = 1
attr = S, NA
animtype  = Light
damage    = 40,25
guardflag = MA
pausetime = 5,8
sparkno = -1
sparkxy = -8,-25
hitsound   = S0,1
guard.sparkno = s70000
guardsound = S4,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
air.hittime  = 70
ground.velocity = -2,0
air.velocity = -1,-1
Fall = 0
envshake.time = 10
envshake.freq = 70
envshake.ampl = -2


[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, -30
postype = p2
ownpal = 1
size.xscale = .2
size.yscale = .2
ignorehitpause = 1
persistent = 0

[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0

[State 200, End]
type = ChangeState
trigger1 = Time = 30
value = 0
ctrl = 1

[State 200, End]
type = ChangeState
Triggerall = movecontact
trigger1 = movecontact
value = 1501

;-------------------------------------------------------------------------------
; special - 4 ,2
[Statedef 1501]
type = S
movetype= A
physics = S
ctrl = 0
anim = 1501
velset = 0,0
sprpriority = 2
poweradd = 30
juggle = 0

;zoom
[State 0] 
Type = Zoom
Trigger1 = Time = [0,200] 
Scale = 1.9
Pos = (Pos X/2) * CameraZoom,0
IgnoreHitPause = 1




[State 200, 1]
type = HitDef
triggerall = !movecontact
trigger1 = 1
attr = S, NA
animtype  = Light
damage    = 45,35
guardflag = MA
pausetime = 2,35
sparkno = -1
sparkxy = -8,-25
hitsound   = S11,15
guard.sparkno = s70000
guardsound = S4,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -3,0
air.velocity = -4,0
Fall = 0
envshake.time = 10
envshake.freq = 70
envshake.ampl = -4
fall.recovertime = 40



[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit
stateno = 8030
id = 8030
pos = 0, 5
postype = p2
ownpal = 1
size.xscale = .2
size.yscale = .2
ignorehitpause = 1
persistent = 0

[state 0]
type = helper
trigger1 = moveguarded
stateno = 8000
id = 8000
pos = 0, -25
postype = p2
ownpal = 1
size.xscale = .7
size.yscale = .7
ignorehitpause = 1
persistent = 0


[State 0, Explod]
type = Explod
trigger1 = movehit  = 1
anim = 33004
ID = 33004
pos = 40,-53
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = 555
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 555
scale = .2,.2
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
angle = -45

[State 200, End]
type = ChangeState
trigger1 = Time = 35
value = 0
ctrl = 1


[State 200, End]
type = ChangeState
trigger1 =  time > 30
value = 1502

;-------------------------------------------------------------------------------
; special - 4 ,2
[Statedef 1502]
type = S
movetype= A
physics = S
ctrl = 0
anim = 1502
velset = 0,0
sprpriority = 2
poweradd = 30
juggle = 0

;zoom
[State 0] 
Type = Zoom
Trigger1 = Time = [0,200] 
Scale = 1.9
Pos = (Pos X/2) * CameraZoom,0
IgnoreHitPause = 1

[State 1800, 1]
type = HitDef
trigger1 = 1
attr = A, NA
animtype  = Medium
damage    = 2,1
guardflag = MA
pausetime = 1,2
sparkno = -1
guard.sparkno = -1
sparkxy = -8,-25
hitsound   = S0,1+random%3
guardsound = S4,1
ground.type = High
ground.slidetime = 30
ground.hittime  = 35
guard.velocity = (-4+random%3)*const(size.xscale)
airguard.velocity = (-3+random%3)*const(size.xscale),(-1-random%3)*const(size.yscale)
ground.velocity = (-2+random%5)*const(size.xscale);-random%3
air.velocity = ((-2+random%5)*.6)*const(size.xscale),(-2-random%3)*const(size.yscale);-1-random%3
Fall = 0
air.fall = 1
fall.recover = 0
id = 1800
priority = 2,hit

[State 0, TargetBind]
type = TargetBind
triggerall = movehit
triggerall = numtarget(1800)
triggerall = !target(1800),ishelper
trigger1 = target(1800),statetype = A
time = 1
pos = 40*const(size.xscale),-4*const(size.yscale)
id = 1800
ignorehitpause = 1
persistent = 8

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit = 1
stateno = 8030
id = 8030
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .2
size.yscale = .2
ignorehitpause = 1
persistent = 6
[state 0]
type = helper
trigger1 = moveguarded = 1
stateno = 8000
id = 8000
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .725
size.yscale = .725
ignorehitpause = 1
persistent = 6

[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 1811
ID = 1810
pos = 13*const(size.xscale),-35*const(size.yscale)
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
pausemovetime = 0
scale = const(size.xscale)+(var(56)*.01),const(size.yscale)+(var(56)*.01)
sprpriority = 4
ontop = 0
ownpal = 1
removeongethit = 1
ignorehitpause = 1

[State 0, Explod]
type = Explod
trigger1 = time=0
anim = 7040
ID = 7040
pos = 35*const(size.xscale),-35*const(size.yscale)
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
pausemovetime = 0
scale = .15,.5
sprpriority = 4
ontop = 1
ownpal = 1
removeongethit = 1
ignorehitpause = 1


[State 200, End]
type = ChangeState
trigger1 =  time > 68
value = 204
;-------------------------------------------------------------------------------
;Domain expansion
[Statedef 3000]
type = S
movetype= A
physics = N
ctrl = 0
anim = 3001
velset = 0,0
sprpriority = -1
poweradd = -3000
poweradd = 0

[State 0, Explod Behind Naoya]
type = Explod
trigger1 = time = 20
anim = 23398
ID = 23398
pos = -10, -30          
postype = p1            
facing = 1
vfacing = 1
bindtime = -1           
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 5555
scale = 0.1, 0.1
sprpriority = -2         
ontop = 0
shadow = 0,0,0
ownpal = 1
trans = add             ; <-- FORCES alpha blending
alpha = 256, 256         ; <-- FORCES 100% solid color visibility, protecting the black center
removeongethit = 1
angle = 0


[state 0]
type = helper
trigger1 = !time
stateno = 8500
id = 8500
pos = 0, 0
ownpal = 1
postype = p1
supermovetime = 999
pausemovetime = 999

[state 0]
type = pause
trigger1 = time  = 0
time = 60
movetime = 15

[state 0]
type = helper
trigger1 = (time = [0, 15])  &&  (time % 10 = 0)
stateno = 8060
id = 8060
pos = 0, 0
postype = p1
supermovetime = 999
pausemovetime = 999

;zoom
[State 0] 
Type = Zoom
Trigger1 = Time = [75,200] 
Scale = 1.9
Pos = (Pos X/2) * CameraZoom,0
IgnoreHitPause = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S24489,0
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S24489,0
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S24489,0
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S24489,0
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S24489,0
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S24489,0
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S24489,0
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S24489,0
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S24489,0



[State 0, AllPalFX]
type = AllPalFX
trigger1 = time >= 80
trigger1 = time <= 200
time = 1
add = 80-time,80-time,80-time

[State 0, AllPalFX]
type = AllPalFX
trigger1 = time >= 200
time = 1
add = -120,-120,-120

[State 0, AllPalFX]
type = AllPalFX
trigger1 = time = 1000
time = 30
add = -256,-256,-256


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 230
value = S11447,1
volumescale = 999



[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 300
value = S24489,1
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 300
value = S24489,1
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 300
value = S24489,1
volumescale = 999


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoBarDisplay
flag2 = NoMusic
flag3 = TimerFreeze


[State 0, PosSet]
type = PosSet
trigger1 = time = 1000
x = 0
y = -300

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 10
value = S40,9
volumescale = 420
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 10
value = S40,9
volumescale = 420


[State 0, PlayerPush]
type = PlayerPush
trigger1 = time > 60
value = 0
;ignorehitpause = 
;persistent = 

[State 0, Helper]
type = helper
trigger1 = numhelper(40010) = 0
trigger1=(alive)
helpertype = Player
name = "Malevolent Shrine"
trigger1 = time = 200
ID = 225587
stateno = 225587
pos = -60,-10
pos = 0,0
postype = P1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.2
supermovetime = 55555

[State 0, Helper]
type = helper
trigger1 = numhelper(40010) = 0
trigger1=(alive)
helpertype = Player
name = "Malevolent Shrine"
trigger1 = time = 200
ID = 40010
stateno = 41001
pos = -60,-10
pos = -60,-10
postype = P1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.2
supermovetime = 55555
[State 0, Helper]
type = helper
trigger1 = numhelper(40010) = 0
trigger1=(alive)
helpertype = Player
trigger1 = time = 220
name = "Malevolent Shrine (sukna)"
ID = 40010
stateno = 41001
pos = -60,-10
postype = P1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = 0.5
size.yscale = 0.2
supermovetime = 55555

[State 0,Ki Blast]
type=Helper
trigger1=time=199
helpertype=normal
name="1950"
ID=1950
stateno=1950
pos=-60,0
postype=p1
facing=-1
keyctrl=0
ownpal=1
size.xscale=3
size.yscale=.3
supermovetime = 999
pausemovetime= 999
[State 0,Ki Blast]
type=Helper
trigger1=time=199
helpertype=normal
name="1951"
ID=1951
stateno=1951
pos=-60,0
postype=p1
facing=-1
keyctrl=0
ownpal=1
size.xscale=3
size.yscale=.3
supermovetime = 999
pausemovetime= 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1000
value = S300,4
volumescale = 220

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 145
value = S11447,0
volumescale = 9999

[State 0, VarSet]
type = VarSet
trigger1 = time = 250
v = 47    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 500
value = 0
ctrl = 1

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


;-------------------------------------------------------------------------------
;Summon Domain
[Statedef 41001]
type = S
movetype= I
physics = N
ctrl = 0
anim = 3010
velset = 0,0
sprpriority = -1
juggle = 0
poweradd =0

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = 1,1
;ignorehitpause = 
;persistent = 

[State 0, Trans]
type = Trans
trigger1 = time < 80
trans = add ;none, add, addalpha, add1, sub
alpha = 0+time*3,256-time*3


[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

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

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 2

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoMusic
[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 0, Helper]
type = helper
trigger1 =animelem=18
trigger1 = numhelper(40012) = 0
helpertype = Normal ;Player
ID = 40012
stateno = 40012
pos = 0,0
postype = P1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = 0.6
size.yscale = 0.6

[State 0, Explod]
type = Explod
trigger1 =animelem=18
anim = 222224
ID = 222224
pos = 0,100
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 55555
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1.5,1.5
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1

[State 0, PlaySnd]
Type = PlaySnd
Trigger1 = time = 0
Value = S1000,0
volume = 999
channel = 30
[State 0, PlaySnd]
Type = PlaySnd
Trigger1 = time = 0
Value = S1000,0
volume = 999
channel = 31

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

[State 0, VarSet]
type = VarSet
trigger1 = time < 10
fv = 23    ;fv = 10
value = 1


[State 0, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 40010
ctrl = 0

;-------------------------------------------------------------------------------
;Domain
[Statedef 40010]
type = S
movetype= I
physics = N
ctrl = 0
anim = 3005
velset = 0,0
sprpriority = -1
juggle = 0
poweradd = 0

; === 1. PUT THE NEW AUDIO PLAY BLOCK HERE ===
[State 40010, Play Domain Loop]
type = PlaySnd
trigger1 = time = 0
value = S526,0
volume = 255            
channel = 69
      
; === 1. PUT THE NEW AUDIO PLAY BLOCK HERE ===
[State 40010, Play Domain Loop]
type = PlaySnd
trigger1 = time = 0
value = S526,0
volume = 255            
channel = 69
     
; === 1. PUT THE NEW AUDIO PLAY BLOCK HERE ===
[State 40010, Play Domain Loop]
type = PlaySnd
trigger1 = time = 0
value = S526,0
volume = 255            
channel = 69
               

; === 2. PUT THE NEW AUDIO STOP BLOCK HERE ===
[State 40010, Stop Domain Loop]
type = StopSnd
trigger1 = numhelper(40012) = 0   
trigger2 = fVar(23) <= 0          
trigger3 = Lose || DrawGame       
channel = 69                      
ignorehitpause = 1
; === 2. PUT THE NEW AUDIO STOP BLOCK HERE ===
[State 40010, Stop Domain Loop]
type = StopSnd
trigger1 = numhelper(40012) = 0   
trigger2 = fVar(23) <= 0          
trigger3 = Lose || DrawGame       
channel = 69                      
ignorehitpause = 1
; === 2. PUT THE NEW AUDIO STOP BLOCK HERE ===
[State 40010, Stop Domain Loop]
type = StopSnd
trigger1 = numhelper(40012) = 0   
trigger2 = fVar(23) <= 0          
trigger3 = Lose || DrawGame       
channel = 69                      
ignorehitpause = 1


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1000
value = S300,4
volumescale = 220


[State 0, Deep Dark Red Domain]
type = BGPalFX
trigger1 = time >= 80
time = 1
add = -255, -255, -255   ; <-- -255 removes all light, making the screen pitch black
mul = 150, 0, 0          ; <-- 150, 0, 0 gives you a deep, saturated blood red
color = 0                
ignorehitpause = 1

[State 1500, Spawn Invisible Attacker]
type = Helper
trigger1 = time = 0
helpertype = normal
name = "Domain_Attack_Zone"
ID = 1510
stateno = 1510          
pos = 0,0
postype = p1

[state 0]
type = angledraw
trigger1 = 1
value = cond(vel x != 0, - (atan(vel y / vel x) * (const(size.air.back) * 1.25) / pi), 0)
scale = 1 + (sin((time / (12.5 + (life / 25))) * (pi / 2)) * 0.0025), 1 + (sin((time / (12.5 + (life / 25))) * (pi / 2)) * 0.012)
ignorehitpause = 1

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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
stateno = 40011
time = 9999

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

[State 0, ChangeState]
type = ChangeState
trigger1 = numhelper(40012) = 0
trigger2 = fVar(23) <= 0
trigger3 = Lose || DrawGame
value = 40015
ctrl = 0
;-------------------------------------------------------------------------------
;Domain floor
[Statedef 225587]
type = S
movetype= I
physics = N
ctrl = 0
anim = 225587
velset = 0,0
sprpriority = -5
juggle = 0
poweradd = 0


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

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
stateno = 40011
time = 9999

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

[State 0, ChangeState]
type = destroyself
trigger1 = root,Var(47) = 0
;trigger1 = time = 2110
trigger1 = numhelper(40010) = 0
trigger3 = Lose || DrawGame
;-------------------------------------------------------------------------------
;Domain Hit
[Statedef 40011]
type = S
movetype= I
physics = N
ctrl = 0
anim = 3005
velset = 0,0
sprpriority = -1
juggle = 0
poweradd = 0


;Domain Health

[state 0]
type = explod
triggerall = !numexplod(4002)
trigger1 = time = 0
anim = 4001
id = 4002
pos = -6, -120
postype = p1
facing = 1
bindtime = -1
removetime = 180
angle = 0
pausemovetime = 9999
supermovetime = 9999
trans = add
scale = const(size.xscale), const(size.yscale)
sprpriority = 9
ignorehitpause = 1

[state 0]
type = explod
triggerall = !numexplod(4003)
trigger1 = time = 0
anim = 4000
id = 4003
pos = -6, -100
postype = p1
facing = 1
bindtime = -1
removetime = 180
angle = 0
pausemovetime = 9999
supermovetime = 9999
scale = const(size.xscale), const(size.yscale)
sprpriority = 8
ignorehitpause = 1


[state 0]
type = modifyexplod
triggerall = time = 1
trigger1 = numexplod(4002)
id = 4002
pos = -6, -100
postype = p1
removetime = 180
angle = 0
pausemovetime = 9999
supermovetime = 9999
trans = add
scale = const(size.xscale) * fvar(23), const(size.yscale)
sprpriority = 9
ignorehitpause = 1



[State 0, VarSet]
type = VarSet
trigger1 = time = 0
fv = 24    ;fv = 10
value = -floor(gethitvar(damage))
ignorehitpause = 1
persistent = -1

[State 0, VarSet]
type = Varadd
trigger1 = time = 1
fv = 23    ;fv = 10
value = (fVar(24)/2200)
ignorehitpause = 1
persistent = -1

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

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
stateno = 40011
time = 9999

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 2
value = 40010
ctrl = 0

;-------------------------------------------------------------------------------
;Domain Timer
[Statedef 40012]
type = S
movetype= I
physics = N
ctrl = 0
anim = 9999
velset = 0,0
sprpriority = -10
juggle = 0
poweradd = 0



[state 0]
type = explod
trigger1 = !time
anim = 3021
id = 30213
pos = 0, 0
postype = p1
facing = 1
bindtime = -1
removetime = -1
sprpriority = 20
scale = 3, .5
angle = 0
ownpal = 1
remappal = 3, 12;(root, var(53))
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
[state 0]
type = explod
trigger1 = !time
anim = 3021
id = 30213
pos = 0,0
postype = p1
facing = 1
bindtime = -1
removetime = -1
sprpriority = 19
scale = 3, .5
angle = 0
ownpal = 1
remappal = 3, 0
removeongethit = 1
ignorehitpause = 1
supermovetime = 999
pausemovetime = 999
trans = sub


[State 0, VarSet]
type = VarSet
triggerall = numhelper(40010) !=0 && helper(40010),stateno != 41002
trigger1 = 1
fv = 34    ;fv = 10
value =  helper(40010),fVar(23)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = gametime%10 = 0
value = S7,random%2 + 3
volumescale = 40
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = time >=0
v = 2
value = random%360

[State 0, VarSet]
type = VarSet
trigger1 = time >=0
v = 1
value = random%1000

[State 0, VarSet]
type = VarSet
trigger1 = time >=0
v = 3
value = random%250

[State 0, VarSet]
type = VarSet
trigger1 = time >=0
v = 4
value = random%1000

[State 0, VarSet]
type = VarSet
trigger1 = time >=0
v = 5
value = random%250


[state 0]
type = angledraw
trigger1 = 1
value = cond(vel x != 0, - (atan(vel y / vel x) * (const(size.air.back) * 1.25) / pi), 0)
scale = 1 + (sin((time / (12.5 + (life / 25))) * (pi / 2)) * 0.0025), 1 + (sin((time / (12.5 + (life / 25))) * (pi / 2)) * 0.012)
ignorehitpause = 1



;
[State 0, Explod]
type = Explod
;triggerall=time>50 && time < 145
trigger1 =timemod=30,0
anim =112365
ID = 112365
pos = -500+random%1000,-30-(random%35)
postype = p1
sprpriority = 1+(random%4)
facing=-1
supermove = 1
removetime = -2
bindtime = -1
ownpal = 1
scale = .4,.3
removeongethit = 1
ontop = 0
supermovetime 	= 999
ignorehitpause  = 1

[State 0, Explod]
type = Explod
;triggerall=time>50 && time < 145
trigger1 =timemod=30,0
anim =112365
ID = 112365
pos = -500+random%1000,-40
postype = p1
sprpriority = 1
facing=-1
supermove = 1
removetime = -2
bindtime = -1
ownpal = 1
scale = .5,.3
removeongethit = 1
ontop = 0
supermovetime 	= 999
ignorehitpause  = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = timemod=10,0
value = S1,112
volume = 10
channel = -1
;lowpriority = -1
freqmul = 1.0


[State 0, Explod]
type = Explod
trigger1 =timemod=10,0
anim =112365
ID = 112365
postype = p1
pos = 20+(random%200),-50-(random%40)
sprpriority = 1
facing=-1
supermove = 1
removetime = -2
bindtime = -1
ownpal = 1
scale = 1.3,1
removeongethit = 1
ontop = 0
supermovetime 	= 999
ignorehitpause  = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = timemod=100,0
value = S1,112
volume = 10
channel = -1
freqmul = 1.0

[state 0]
type = removeexplod
trigger1 = numhelper(40010) = 0
trigger2 = Lose || DrawGame
id = 30213
ignorehitpause = 1


[State 0, ChangeState]
type = destroyself
trigger1 = root,Var(47) = 0
;trigger1 = time = 2110
trigger1 = numhelper(40010) = 0
trigger3 = Lose || DrawGame
;-------------------------------------------------------------------------------


;-------------------------------------------------------------------------------
;Domain Leave 
[Statedef 40015]
type = S
movetype= I
physics = N
ctrl = 0
anim = 3015
velset = 0,0
sprpriority = -1
juggle = 0
poweradd = 0


[State 0, Black & Red Domain BG]
type = BGPalFX
trigger1 = time = 0   ; <-- FIXED! Keeps it on from frame 80 until the state ends
time = 110                 ; <-- FIXED! Refreshes smoothly every frame
add = -50, -200, -200    
mul = 256, 30, 30        
color = 0                
ignorehitpause = 1

[State 0, Pause]
type = Pause
trigger1 = time = 0
time = 100
movetime = 100

[State 0, EnvShake]
type = EnvShake
trigger1 = time = 0
trigger2 = time = 50
time = 15
freq = 20
ampl = -6

[State 0, EnvShake]
type = EnvShake
trigger1 = time = 110
time = 35
freq = 80
ampl = -3


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=0
value = S300,42
volumescale = 999

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=50
value = S300,40
volumescale = 999


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time=110
value = S300,41
volumescale = 999

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 7049
ID = 7049
pos = 150,180
postype = left  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 5555
scale = 1.3,1
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
angle = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 30213

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 4002

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 4003

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time = 20
id = 7048


[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = 1,1
;ignorehitpause = 
;persistent = 

[State 0, VarSet]
type = parentVarSet
trigger1 = time = 0
v = 47    ;fv = 10
value = 0
;ignorehitpause = 
;persistent =


[State 0, VarSet]
type = parentVarSet
triggerall = root,Var(19) = 1
Trigger1 = time =0
var(19) = 2

[State 0, StopSnd]
type = StopSnd
triggerall = helper(30990),Var(50) = 0
triggerall = numhelper(11985) = 0
trigger1 = time = 0
channel = 30
[State 0, StopSnd]
type = StopSnd
triggerall = helper(30990),Var(50) = 0
triggerall = numhelper(11985) = 0
trigger1 = time = 0
channel = 31

[State 0, StopSnd]
type = StopSnd
trigger1 = time = 0
channel = 69
[State 0, StopSnd]
type = StopSnd
trigger1 = time = 0
channel = 69
[State 0, StopSnd]
type = StopSnd
trigger1 = time = 0
channel = 69

;ignorehitpause = 
;persistent = 
[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 0, ChangeState]
type = destroyself
trigger1 = animtime = 0
;-------------------------------------------------------------------------------


;Domain expansion
[Statedef 41000]
type = S
movetype= A
physics = N
ctrl = 0
anim = 3001
velset = 0,0
sprpriority = 0
poweradd = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 23
value = S0,12
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 23
value = S0,12
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 23
value = S0,12
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 23
value = S0,12
volumescale = 999

[State 0, VelAdd]
type = VelAdd
trigger1 = helper(40010),stateno=41003
trigger1 = time>=0
trigger1 = pos y <0
y = .4

[State 0, VelSet]
type = VelSet
trigger1 = pos y >=0
x = 0
y = 0
;ignorehitpause = 
;persistent = 

[State 6969, PlaySnd]
type = PlaySnd
triggerall = p2life < lifemax/2
trigger1 = time = 30
value = S6969,0
volume = 999
channel = 69

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 18
value = S0,12
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 18
value = S0,12
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 18
value = S0,12
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 18
value = S0,12
volumescale = 999

[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S0,13
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S0,13
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S0,13
volumescale = 999

[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S0,13
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S0,13
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 80
value = S0,13
volumescale = 999


[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life < lifemax/2
trigger1 = time = 80
value = S0,58
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life < lifemax/2
trigger1 = time = 80
value = S0,58
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life < lifemax/2
trigger1 = time = 80
value = S0,58
volumescale = 999


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 230
value = S0,14
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 230
value = S0,14
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 230
value = S0,14
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 230
value = S0,14
volumescale = 999


[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 300
value = S0,15
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 300
value = S0,15
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 300
value = S0,15
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 300
value = S0,15
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 300
value = S0,15
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 300
value = S0,15
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life > lifemax/2
trigger1 = time = 300
value = S0,15
volumescale = 999

[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life < lifemax/2
trigger1 = time = 300
value = S0,59
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life < lifemax/2
trigger1 = time = 300
value = S0,59
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life < lifemax/2
trigger1 = time = 300
value = S0,59
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life < lifemax/2
trigger1 = time = 300
value = S0,59
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life < lifemax/2
trigger1 = time = 300
value = S0,59
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life < lifemax/2
trigger1 = time = 300
value = S0,59
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
triggerall = p2life < lifemax/2
trigger1 = time = 300
value = S0,59
volumescale = 999

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoBarDisplay
flag2 = NoMusic
flag3 = TimerFreeze


[State 0, Pause]
type = Pause
trigger1 = time = 0
time = 280
movetime = 280

[State 0, BGPalFX]
type = BGPalFX
trigger1 = TIME%1=0
time =2
add =0,-256,-256

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 10
value = S0,12
volumescale = 420

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 30
value = S0,13
volumescale = 310


[State 0, PlayerPush]
type = PlayerPush
trigger1 = time > 60
value = 0
;ignorehitpause = 
;persistent = 


[State 0, Helper]
type = helper
trigger1 = numhelper(40010) = 0
trigger1=(alive)
helpertype = Player
name = "Malevolent Shrine"
trigger1 = time = 200
ID = 40010
stateno = 41002
pos = -60,-10
postype = P1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = 0.4
size.yscale = 0.4
supermovetime = 55555
pausemovetime= 999
[State 0, Helper]
type = helper
trigger1 = numhelper(40010) = 0
trigger1=(alive)
helpertype = Player
trigger1 = time = 220
name = "Malevolent Shrine (sukna)"
ID = 40010
stateno = 41002
pos = -60,-10
postype = P1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = 0.6
size.yscale = 0.6
supermovetime = 55555
pausemovetime= 999

[State 0,Ki Blast]
type=Helper
trigger1=time=199
helpertype=normal
name="1950"
ID=1950
stateno=1950
pos=-60,0
postype=p1
facing=-1
keyctrl=0
ownpal=1
size.xscale=2
size.yscale=.9
supermovetime = 999
pausemovetime= 999

[State 0,Ki Blast]
type=Helper
trigger1=time=199
helpertype=normal
name="1951"
ID=1951
stateno=1951
pos=-60,0
postype=p1
facing=-1
keyctrl=0
ownpal=1
size.xscale=2
size.yscale=.9
supermovetime = 999
pausemovetime= 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1000
value = S300,4
volumescale = 220

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 145
value = S0,17
volumescale = 9999

[State 0, VarSet]
type = VarSet
trigger1 = time = 250
v = 47    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 



[State 0, ChangeState]
type = ChangeState
trigger1 = time = 500
value = 0
ctrl = 1
;------------------------------------------------------------------------------------------------
[Statedef 1510]
type = S
movetype = A            
physics = N
anim = 1510             

; Reset the attack lock as soon as the opponent is out of their hit/flinch state
[State 1510, Reset Lock]
type = VarSet
trigger1 = enemynear, MoveType != H
v = 1
value = 0

; Trigger the hit detection
[State 1510, Trigger Slash]
type = hitdef           
triggerall = var(1) = 0   ; Ready to strike!
triggerall = enemynear, MoveType != H ; Don't re-hit while they are already flinching
trigger1 = enemynear, vel x != 0
trigger2 = enemynear, vel y != 0
attr = S, SA
damage = 10, 10
animtype = light
guardflag =             
hitflag = MAF
pausetime = 3, 3
sparkno = -1
hitsound = s1115, 0
ground.velocity = 0, 0
air.velocity = 0, 0
fall = 0
getpower = 10, 5
ignorehitpause = 1

[State 1510, Spawn Blood Explod]
type = Explod
trigger1 = movehit = 1      
anim = 777455            
ID = 777455
; Randomizes X from -30 to 10, and Y from -60 to -10
pos = -10 + random % 40, -30 + random % 50 
postype = p2            
facing = 1
vfacing = 1
bindtime = 1
removetime = 10         
scale = .06, .06            
sprpriority = 5         
ownpal = 1
ignorehitpause = 1

; Lock the domain instantly when a hit lands
[State 1510, Lock On Hit]
type = VarSet
trigger1 = movehit
v = 1
value = 1              

[State 1510, Kill Self]
type = DestroySelf
trigger1 = Parent, StateNo = 40015
;-------------------------------------------------------------------------------
;Summon Domain
[Statedef 41002]
type = S
movetype= I
physics = N
ctrl = 0
anim = 3011
velset = 0,0
sprpriority = -1
juggle = 0
poweradd =0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = 1.5,1.5
;ignorehitpause = 
;persistent = 


;[State 0, PosSet]
;type = PosSet
;trigger1 = time = 0
;y = 0

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

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 2

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoMusic
[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

;[State 0, Helper]
;type = helper
;trigger1 =animelem=18
;trigger1 = numhelper(51312) = 0
;helpertype = Normal ;Player
;ID = 51312
;stateno = 51312
;pos = 0,0
;postype = P1
;facing = 1
;keyctrl = 0
;ownpal = 1
;size.xscale = 0.6
;size.yscale = 0.6

[State 0, PlaySnd]
Type = PlaySnd
Trigger1 = time = 0
Value = S1000,0
volume = 999
channel = 30
[State 0, PlaySnd]
Type = PlaySnd
Trigger1 = time = 0
Value = S1000,0
volume = 999
channel = 31

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

[State 0, VarSet]
type = VarSet
trigger1 = time < 10
fv = 23    ;fv = 10
value = 1


[State 0, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 41003;51310
ctrl = 0

[Statedef 41003]
type = S
movetype= I
physics = N
ctrl = 0
anim = 3005
velset = 0,0
sprpriority = -1
juggle = 0
poweradd = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = timemod = 10,0
trigger1 = vel y >0
time = 28
freq = 100
ampl = -9
phase = 140


[State 0, FX Corte]
type=Explod
trigger1 = vel y >0
trigger1 = pos y >= 0
anim=1311
ID= 1311
pos=0,-0
postype=p1
facing=1
vfacing=1
bindtime=-1
removetime=-2
scale=.6,.6
sprpriority=2
ontop=-1
ownpal=1
removeongethit=1
trans=add

[State 0, tierra]
type = Explod
trigger1 = vel y >0
trigger1 = pos y >= 0
anim = 233
ID = 233
pos = 0,10
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0


[State 0, Explod]
type = Explod
trigger1 = vel y >0
trigger1 = pos y >= 0
anim =  70301
ID = 7031
pos = 0,0
postype = p1
vel = 0,0
facing = -1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1.5
sprpriority = 7
ontop = 1
ownpal = 1
removeongethit = 0
ignorehitpause = 0



[State 0, Explod]
type = Explod
trigger1 = vel y >0
trigger1 = pos y >= 0
anim = 7046
ID = 7046
pos = 0,100
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 55555
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1.5,1.5
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = vel y >0
trigger1 = pos y >= 0
value = S0,29
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = vel y >0
trigger1 = pos y >= 0
value = S0,29
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = vel y >0
trigger1 = pos y >= 0
value = S0,29
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = vel y >0
trigger1 = pos y >= 0
value = S0,29
volumescale = 999
[State 0, PlaySnd]
type = PlaySnd
trigger1 = vel y >0
trigger1 = pos y >= 0
value = S0,29
volumescale = 999

[State 0, Helper]
type = helper
trigger1 = vel y >0
trigger1 = pos y >= 0
trigger1 = numhelper(40012) = 0
helpertype = Normal ;Player
ID = 40012
stateno = 40012
pos = 0,0
postype = P1
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = 0.6
size.yscale = 0.6

[State 0, VelAdd]
type = VelAdd
trigger1 = time>=0
y = .4


[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >= 0
value = 40010
ctrl = 0

[statedef 81000]
type = u
movetype = a
physics = s
velset = 0, 0
ctrl = 0
anim = 30703
sprpriority = 6

[state 0]
type = envshake
trigger1 = !time
time = 30
freq = 60
ampl = -5

[state 0]
type = playsnd
trigger1 = !time
value = s9104, 4
[state 0]
type = playsnd
trigger1 = !time
value = s9104, 4
[state 0]
type = playsnd
trigger1 = !time
value = s9600, 5

[state 0]
type = helper
trigger1 = !time
stateno = 31000
size.height = 30218
size.ground.front = 3
size.ground.back = 0
postype = p1
ownpal = 1
facing = 1
size.mid.pos = (const(size.mid.pos.x) + 0), (const(size.mid.pos.y) + 15)
size.head.pos = 0, 12
size.xscale = .2
size.yscale = .2
supermovetime = 999
pausemovetime = 999
ignorehitpause = 1
persistent = 0
[state 0]
type = helper
trigger1 = !time
stateno = 31000
size.height = 30113
size.ground.front = 4
size.ground.back = 3
postype = p1
ownpal = 1
facing = 1
size.mid.pos = (const(size.mid.pos.x) + 0), (const(size.mid.pos.y) - 15)
size.head.pos = 0, 12
size.xscale = .2
size.yscale = .2
supermovetime = 999
pausemovetime = 999
ignorehitpause = 1
persistent = 0

[State 0, Electricity FX]
type = Explod
trigger1 = !time
anim = 801
ID = 510
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 7
removeongethit = 1
ignorehitpause = 1
ownpal = 1
remappal = 1028,1
angle = 0
[State 0, Electricity FX]
type = Explod
trigger1 = !time
anim = 801
ID = 510
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = 14
pausemovetime = 0
scale = 1,1
sprpriority = 6
removeongethit = 1
ignorehitpause = 1
ownpal = 1
trans = sub
angle = 0

[State 0, Explod]
type = Explod
trigger1=time=0
anim = 923
ID = 923
pos = 0,-30
postype = P1  ;P2, Front, Back, Left, Right
facing = 1
vfacing = 1
bindtime = 0
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
scale = .1,.1
pausemovetime = cond(root,var(13)>0,999999,0)
sprpriority = 5
remappal = 7502,1
ignorehitpause =1
trans = sub
ownpal = 1

[State 0, Explod]
type = Explod
trigger1=time=0
;triggerall =var(2)>0
anim = 923
ID = 923
pos = 0,-30
postype = P1  ;P2, Front, Back, Left, Right
facing = 1
vfacing = 1
bindtime = 0
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
scale = .3,.3
pausemovetime = cond(root,var(13)>0,999999,0)
sprpriority = 5
ignorehitpause =1
ownpal = 1


[State 0, Explod]
type = Explod
trigger1=time=0
ID = 7699
anim = 7699
pos = 0,-30
postype = P1  ;P2, Front, Back, Left, Right
facing = 1
vfacing = 1
bindtime = 0
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
scale = .15,.15
pausemovetime = cond(root,var(13)>0,999999,0)
sprpriority = 5
ignorehitpause =1
ownpal = 1

[state 0]
type = pause
trigger1 = time = [0, 10]
time = 2

[state 0]
type = hitdef
trigger1 = !movecontact
animtype = diagup
attr = s, st
damage = 30 + (random % 20), 25
hitflag = mafd
guardflag = ma
pausetime = 0, 6
hitsound = -1
guardsound = s9104, 0
ground.type = high
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -1.5, -6.5
air.velocity = -1.5, -6.5
fall = 1
envshake.time = 15
kill = 0
p2stateno = 82738
guard.kill = 0

[state 0]
type = helper
triggerall = p2movetype = h
trigger1 = movecontact = 1
stateno = 98010
id = 001
size.height = 0
size.head.pos = (random % 360), 12;(root, var(53))
pos = 0, -24 + (random % 8)
postype = p2
ownpal = 1
size.xscale = .8
size.yscale = .8
ignorehitpause = 1
persistent = 0


[state 0]
type = destroyself
trigger1 = !animtime
ignorehitpause = 1

[Statedef 1950]
type=S
movetype=I
physics=N
velset=0,0
ctrl=0
anim=7280
sprpriority=-11

[State 0,PalFXWiz]
type=PalFX
trigger1=1
time=999999
color=0

[State 0,AngleDraw]
type=AngleDraw
trigger1=time<10
scale=.1+time*.1,.1+time*.1

[State 0,AngleDraw]
type=AngleDraw
trigger1=time>10
scale=1+fvar(1),1+fvar(1)

[State 0,PlaySnd]
type=PlaySnd
trigger1=!Time
value=S5,28
volumescale=150

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

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

[State 200,End]
type=ChangeState
trigger1=time>=180
value=1955

[Statedef 1951]
type=S
movetype=I
physics=N
velset=0,0
ctrl=0
anim=7280
sprpriority=-9

[State 0,PalFXWiz]
type=PalFX
trigger1=1
time=999999
color=0

[State 0,AngleDraw]
type=AngleDraw
trigger1=time<10
scale=.1+time*.1,.1+time*.1

[State 0,AngleDraw]
type=AngleDraw
trigger1=time>10
scale=1+fvar(1),1+fvar(1)

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

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

[State 200,End]
type=ChangeState
trigger1=time>=180
value=1955

[Statedef 1955]
type=S
movetype=I
physics=N
ctrl=0
sprpriority=-10

[State 0,RemoveExplod]
type=RemoveExplod
trigger1=!Time
id=001

[State 0,VarSet]
type=VarSet
trigger1=!Time
fv=1
value=0

[State 0,VarSet]
type=VarAdd
trigger1=time>5
fv=1
value=.0425

[State 0,AngleDraw]
type=AngleDraw
trigger1=1
scale=1-fvar(1),1-fvar(1)
ignorehitpause=1

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

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

[State 200,End]
type=Destroyself
trigger1=time=28
;-------------------------------------------------------------------------------


[statedef 9007]
ctrl = 0

[state 0]
type = bindtoparent
trigger1 = stateno = 9007
pos = 0, 0
ignorehitpause = 1

[state 0]
type = playerpush
trigger1 = stateno = 9007
value = 1
ignorehitpause = 1

[state 0]
type = turn
trigger1 = facing != root, facing
ignorehitpause = 1

[state 0]
type = assertspecial
trigger1 = stateno = 9007
flag = invisible
ignorehitpause = 1

[state 0]
type = hitoverride
trigger1 = stateno = 9007
attr = sca, na, sa, np, sp, nt, st
stateno = stateno
time = 1
ignorehitpause = 1

[state 0]
type = changeanim
trigger1 = stateno = 9007
value = parent, anim
elem = parent, animelemno(0)
ignorehitpause = 1

[state 0]
type = destroyself
trigger1 = !(parent, alive)
trigger2 = parent, movetype = h 
trigger3 = parent, stateno = [3000, 3200]
trigger4 = parent, stateno = [1310, 1320]
ignorehitpause = 1

[statedef 9008]
type = a
movetype = a
physics = n
sprpriority = 6
ctrl = 0

[state 0]
type = gravity
trigger1 = 1
ignorehitpause = 1

[state 0]
type = varadd
trigger1 = 1
v = 1
value = -12-random % 5
ignorehitpause = 1

[state 0]
type = angledraw
trigger1 = 1
scale = 1, 1
value = var(1)
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 0
value = random % 5
ignorehitpause = 1

[state 0]
type = changeanim
trigger1 = 1
value = 7028
elem = var(0)
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !time
x = 2 + random % 4
y = -6-random % 6
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = (!animelemtime(1))||(!animelemtime(2))||(!animelemtime(3))||(!animelemtime(4))||(!animelemtime(5))
attr = a, np
hitflag = mfd
guardflag = m
affectteam = b
animtype = light
priority = 3, hit
damage = (abs(ceil((enemynear, const(data.life)*2.0)/100))), (abs(ceil((enemynear, const(data.life)*1.0)/100)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 1, 5
guard.pausetime = 1, 5
guard.velocity = 0
guardsound = s104, 0
ground.type = high
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -1, 0
air.velocity = -1, 0
envshake.time = 4
envshake.ampl = -4
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
persistent = 0

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 13
persistent = 0
volumescale = 60
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = movehit = 1
value = s0, 13
persistent = 0
volumescale = 60
ignorehitpause = 1

[state 0]
type = velset
trigger1 = movehit = 1
x = 2 + random % 2
y = -1.5-random % 2

[state 0]
type = changestate
trigger1 = (time > 10) && (pos y >= -10)
value = 9009

[statedef 9009]
type = s
movetype = i
physics = s

[state 0]
type = envshake
trigger1 = !time
time = 5
ampl = -5
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = !time
value = s0, 21 + random % 3
persistent = 0
volumescale = 45
ignorehitpause = 1

[state 0]
type = velset
trigger1 = !time
y = 0
ignorehitpause = 1

[state 0]
type = posset
trigger1 = !time
y = 0
ignorehitpause = 1

[state 0]
type = veladd
trigger1 = vel x < 0
x = .165
ignorehitpause = 1

[state 0]
type = varadd
trigger1 = time < 8
trigger1 = vel x != 0
v = 1
value = -5
ignorehitpause = 1

[state 0]
type = angledraw
trigger1 = 1
value = var(1)
ignorehitpause = 1

[state 0]
type = changeanim
trigger1 = 1
value = anim
elem = var(0)
ignorehitpause = 1

[state 0]
type = varset
trigger1 = !time
v = 2
value = 0
ignorehitpause = 1

[state 0]
type = varadd
trigger1 = time >= 120
v = 2
value = 20
ignorehitpause = 1

[state 0]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256-var(2), 0 + var(2)
ignorehitpause = 1

[state 0]
type = destroyself
trigger1 = var(2) >= 256
ignorehitpause = 1

[statedef 9011]
type = s
movetype = i
physics = n
anim = 9999
ctrl = 0

[state 0]
type = playsnd
trigger1 = time % 8 = 0
trigger2 = !time
value = s0, 23
volumescale = 100-(time*1.11111)

[state 0]
type = playsnd
trigger1 = time % 8 = 0
trigger2 = !time
value = s0, 23
volumescale = 100-(time*1.11111)

[state 0]
type = posadd
trigger1 = 1
x = p2dist x

[state 0]
type = posset
trigger1 = 1
y = 0

[state 0]
type = explod
trigger1 = time % 3 = 0
trigger2 = !time
anim = 7031
id = 7031
pos = 0, -15
postype = p1
facing = facing
vel = -.5*facing, 0
scale = .44-(time*0.0115), .44-(time*0.0115)
sprpriority = 1
ontop = 1
ownpal = 1
removetime = -2
removeongethit = 1

[state 0]
type = destroyself
trigger1 = enemy, stateno != 9010

[statedef 9012]
movetype = h
anim = 5030
sprpriority = 1
ctrl = 0

[state 0]
type = velset
trigger1 = stateno = 9012
x = -18
y = 0
ignorehitpause = 1

[state 0]
type = posset
trigger1 = pos y >= 0
y = 0

[state 0]
type = playerpush
trigger1 = stateno = 9012
value = 0
ignorehitpause = 1

[state 0]
type = turn
trigger1 = p2dist x <= 0

[state 0]
type = nothitby
trigger1 = stateno = 9012
value = sca, na, sa, ha, np, sp, hp, nt, st, ht
time = 5

[state 0]
type = changestate
trigger1 = backedgebodydist <= 0
value = 9013

[statedef 9013]
type = a
movetype = h
physics = a
velset = 0, 0
sprpriority = 2
ctrl = 0

[state 0]
type = posadd
trigger1 = !time
y = const(size.height)/2
ignorehitpause = 1

[state 0]
type = envshake
trigger1 = !time
time = 14
freq = 30
ampl = -20
phase = 2

[state 0]
type = playerpush
trigger1 = stateno = 9013
value = 0
ignorehitpause = 1

[state 0]
type = nothitby
trigger1 = stateno = 9013
value = sca, na, sa, ha, np, sp, hp, nt, st, ht
time = 1
ignorehitpause = 1

[state 0]
type = lifeadd
trigger1 = !time
value = -30

[state 0]
type = velset
trigger1 = !time
x = -1
y = -4

[state 0]
type = selfstate
trigger1 = time = 1
value = 5050

[statedef 9018]
type = u
sprpriority = 5

[state 0]
type = bindtoroot
trigger1 = 1
time = -1
ignorehitpause = 1

[state 0]
type = playerpush
trigger1 = 1
value = 1
ignorehitpause = 1

[state 0]
type = changeanim
trigger1 = 1
value = root, anim
elem = root, animelemno(0)
ignorehitpause = 1

[state 0]
type = turn
trigger1 = facing != root, facing
ignorehitpause = 1

[state 0]
type = nothitby
trigger1 = 1
value = sca, na, sa, ha, np, sp, hp, nt, st, ht
time = -1
ignorehitpause = 1

[state 0]
type = angledraw
trigger1 = 1
scale = const(size.xscale) + (time*.02), const(size.yscale) + (time*.02)
value = 0

[state 0]
type = trans
trigger1 = 1
trans = addalpha
alpha = 125-(time*10), 256

[state 0]
type = assertspecial
trigger1 = 1
flag = noshadow

[state 0]
type = destroyself
trigger1 = (time = 20)||(movetype = h)

[statedef 9019]
type = u
movetype = u
physics = u
anim = 1010
sprpriority = 2
ctrl = 0

[state 0]
type = assertspecial
trigger1 = !time
flag = nomusic
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 12
value = s1001, 0
volumescale = 100
persistent = 0

[state 0]
type = nothitby
trigger1 = 1
value = sca, na, sa, ha, np, sp, hp, nt, st, ht
time = 52
ignorehitpause = 1

[state 0]
type = changestate
trigger1 = !animtime
value = 105
ctrl = 1

[statedef 9020]
type = a
movetype = h
physics = n
anim = 5030
sprpriority = 2
facep2 = 1
ctrl = 0

[state 0]
type = playerpush
trigger1 = 1
value = 0
ignorehitpause = 1

[state 0]
type = targetbind
trigger1 = !time
pos = 40, -30
time = 30

[state 0]
type = changeanim
trigger1 = time >= 16
value = 5010 + (var(10))
elem = 1
ignorehitpause = 1 

[state 0]
type = angledraw
trigger1 = time >= 16
trigger1 = stateno = 9020
value = -20
ignorehitpause = 1

[state 0]
type = nothitby
trigger1 = !time
value = sca, na, sa, ha, np, sp, hp, nt, st, ht
time = 125
ignorehitpause = 1

[state 0]
type = selfstate
trigger1 = time = 125
value = 5050

[statedef 9022]
type = s
movetype = a
physics = s
anim = 7047
sprpriority = 3
ctrl = 0

[state 0]
type = angledraw
trigger1 = 1 
scale = 0.35, 0.35
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = (!animelemtime(3))||(!animelemtime(4))||(!animelemtime(5))||(!animelemtime(6))
attr = s, sa
hitflag = mafd
guardflag = ma
animtype = hard
priority = 4, hit
damage = (abs(ceil((enemynear, const(data.life)*4.0)/30))), (abs(ceil((enemynear, const(data.life)*2.0)/60)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 0, 6
guard.pausetime = 4, 7
guard.velocity = -2
guardsound = s104, 0
ground.type = trip
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -2.8, -8.0
air.velocity = -2.8, -8.0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
fall.recover = 0
persistent = 0
ignorehitpause = 1

[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit = 1
stateno = 8030
id = 8030
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .45
size.yscale = .45
ignorehitpause = 1
persistent = 6
[state 0]
type = helper
trigger1 = moveguarded = 1
stateno = 8000
id = 8000
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .75
size.yscale = .75
ignorehitpause = 1
persistent = 6

[state 0]
type = envshake
trigger1 = time = 74 
time = 5
freq = 30
ampl = -2
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 74
value = s0, 24
volumescale = 60
ignorehitpause = 1

[state 0]
type = destroyself
trigger1 = time > 101
trigger2 = hitcount >= 5
ignorehitpause = 1

[statedef 9023]
type = s
movetype = a
physics = s
anim = 7047
sprpriority = 3
ctrl = 0

[state 0]
type = angledraw
trigger1 = 1 
scale = 0.35, 0.35
ignorehitpause = 1

[state 0]
type = hitdef
trigger1 = (!animelemtime(3))||(!animelemtime(4))||(!animelemtime(5))||(!animelemtime(6))
attr = s, sa
hitflag = mafd
guardflag = ma
animtype = hard
priority = 4, hit
damage = (abs(ceil((enemynear, const(data.life)*4.0)/30))), (abs(ceil((enemynear, const(data.life)*2.0)/60)))
sparkno = -1
sparkxy = -1, -26
guard.sparkno = -1
pausetime = 0, 6
guard.pausetime = 4, 7
guard.velocity = -2
guardsound = s104, 0
ground.type = trip
ground.slidetime = 5
ground.hittime = 12
ground.velocity = -2.8, -8.0
air.velocity = -2.8, -8.0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
fall.recover = 0
persistent = 0
ignorehitpause = 1
[state 0]
type = helper
triggerall = enemynear, movetype = h
trigger1 = movehit = 1
stateno = 8030
id = 8030
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .45
size.yscale = .45
ignorehitpause = 1
persistent = 6
[state 0]
type = helper
trigger1 = moveguarded = 1
stateno = 8000
id = 8000
pos = -10 + (random % 15) , -40 + (random % 25)
postype = p2
ownpal = 1
size.xscale = .75
size.yscale = .75
ignorehitpause = 1
persistent = 6

[state 0]
type = envshake
trigger1 = time = 74 
time = 5
freq = 45
ampl = -4
ignorehitpause = 1

[state 0]
type = playsnd
trigger1 = time = 74
value = s0, 24
volumescale = 60
ignorehitpause = 1

[state 0]
type = destroyself
trigger1 = time > 101
ignorehitpause = 1
;-------------------------------------------------------------------------------
; P2 - Hacia la Pared
[Statedef 290]
type    = A
movetype= H
physics = N
juggle  = 1
velset = -15
ctrl = 0
sprpriority = 1
Facep2 = 1

[State 0, PosSet]
type = PosSet
trigger1 = pos y >= 0



[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = 1
value = 5020+Cond(authorname = "Mikel8888"||authorname = "Keyber"||authorname = "Knightmare"||authorname = "UZuUChi",var(10),0)
elem = 2

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

[State 200, End]
type = ChangeState
trigger1 = backedgebodydist < 5
value = 291
;-------------------------------------------------------------------------------
; P2 - Empotrado en la Pared
[Statedef 291]
type    = A
movetype= H
physics = A
juggle  = 1
velset = 3,-8
ctrl = 0
sprpriority = 1


[State 0, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 20

[State 0, LifeAdd]
type = LifeAdd
trigger1 = time = 0
value = -10

[State 200, End]
type = Selfstate
trigger1 = time = 1
value = 5050
                   ; Sends them back to normal hit states
[statedef 9900]
type = S
movetype = I
physics = N
anim = 9999

[state 0]
type = palfx
trigger1 = !time
time = 8
add = 255, 255, 255
mul = 256, 256, 256
ownpal = 0

[state 0]
type = destroyself
trigger1 = time = 8