; Grinder attack ;Air jump
[Statedef 1001]
type    = A
movetype= A
physics = A
ctrl = 0
velset = 0,-3
anim = 1001

[state 1000]
type = playsnd
trigger1 = time = 0
value = F24,1
volume = 200

[state 1000]
type = velset
trigger1 = time = [10,50]
x = 4
y = 0.3

[State 1000, 2]
type = HitDef
trigger1 = time = 0
attr = S, NA
animtype  = light
damage    = 10,5
guardflag = MA
pausetime = 3,11
sparkno = 0
sparkxy = 0,-10
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 1,0)
guardsound = 6,0
ground.type = High
ground.slidetime = 2
ground.hittime  = 20
ground.velocity = -2
air.velocity = -2.2,-3.2
getpower = 30,0
givepower = 0,30

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

;---------------------------------------------------------------------------
; KN straight
[Statedef 205]
type    = S
movetype= A
physics = S
juggle  = 4
ctrl = 0
velset = 3,0
anim = 205

[State 205, 2]
type = PlaySnd
trigger1 = Time = 0
value = F30, 8
volume = 200

[State 200, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = light
damage    = 10,5
guardflag = MA
pausetime = 3,11
sparkno = 0
sparkxy = 3,-18
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 1,0)
guardsound = 6,0
ground.type = high
ground.slidetime = 3
ground.hittime  = 20
ground.velocity = -1.5
air.velocity = -2.2,-3.2
getpower = 30,0
givepower = 0,30

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; knuckles chop
[Statedef 206]
type    = S
movetype= A
physics = S
juggle  = 4
ctrl = 0
velset = 0,0,0
anim = 206

[State 206, 2]
type = PlaySnd
trigger1 = Time = 0
value = F30, 8
volume = 200

[State 201, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 15
guardflag = MA
pausetime = 3,11
sparkno = 0
sparkxy = 2,-19
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 1,0)
guardsound = 6,0
ground.type = high
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -1.5
air.velocity = -2.2,-3.2
getpower = 40,0
givepower = 0,40

[State 201, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; knuckles upper
[Statedef 207]
type    = S
movetype= A
physics = S
juggle  = 4
ctrl = 0
velset = 0,0,0
anim = 207

[State 207, 2]
type = PlaySnd
trigger1 = Time = 0
value = F30, 8
volume = 200

[State 202, 2]
type = HitDef
trigger1 = time = 0
attr = S, NA
animtype  = Hard
damage    = 20
guardflag = MA
sparkno = 0
sparkxy = -1,-10
pausetime = 3,11
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 1,0)
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -1.2
air.velocity = -2.2,-3.2
getpower = 50,0
givepower = 0,50

[State 202, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; megaton hook
[Statedef 208]
type    = S
movetype= A
physics = S
juggle  = 8
ctrl = 0
anim = 208

[State 0, ]
type = Explod
trigger1 = animelem = 4 
anim = F150
ID = 150 
pos = 0,0
removetime = -2
sprpriority = 1
ontop = 1
ignorehitpause = 1
persistent = 1

[state 203]
type = playsnd
trigger1 = animelem = 3
value = F40,0
volume = 255

[State 203, 2]
type = HitDef
trigger1 = animelem = 5
persistent = 0
attr = S, NA
animtype  = back
hitflag = MAF
damage    = 25
guardflag = MA
pausetime = 3,11
sparkxy = -4,-12
sparkno = 1
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 4,3)
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -6,-8
air.velocity = -6,-8
p2stateno = 6025
p2getp1state = ifelse(p2name = "Robotnik and G-mel by Cyanide", 0, 1)
fall = 1
getpower = 60,0
givepower = 0,60

[State 203, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


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

;---------------------------------------------------------------------------
; enrage
[Statedef 209]
type    = S
movetype= A
physics = S
juggle  = 6
ctrl = 0
anim = 209

[State 205, 2]
type = PlaySnd
trigger1 = Time = 0
value = F30, 8
volume = 200

[State 209, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
damage    = 20
animtype  = up
hitflag = MAF
guardflag = MA
pausetime = 3,12
sparkxy = 0,-30
sparkno = 1
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 1,0)
guardsound = 6,0
ground.type = low
ground.slidetime = 10
ground.hittime  = 20
air.hittime = 30
ground.velocity = -0.2,-6.5
air.velocity = -1.3,-3
down.velocity = -4,0
down.hittime = 20
getpower = 50,0
givepower = 0,50

[State 209, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 209, 4]
type = ChangeState
trigger1 = (movecontact)
trigger1 = command = "holdup" && (command != "holdfwd" || command != "holdback")
value = 40
ctrl = 1

;---------------------------------------------------------------------------
; kn air hook
[Statedef 603]
type    = A
movetype= A
physics = A
juggle  = 6
ctrl = 0
anim = 603

[State 205, 2]
type = PlaySnd
trigger1 = Time = 0
value = F30, 8
volume = 200

[State 603, 2]
type = HitDef
trigger1 = animelem = 2
attr = A, NA
damage    = 30
animtype  = light
hitflag = MAF
guardflag = MA
pausetime = 0,0
sparkxy = 0,-10
sparkno = 0
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 1,0)
guardsound = 6,0
ground.type = high
ground.slidetime = 4
ground.hittime  = 15
ground.velocity = -4,3
air.velocity = -1.3,3
down.velocity = -1.3,3
down.hittime = 20
air.fall = 1
fall = 0
getpower = 30,0
givepower = 0,30

[State 603, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; double punch
[Statedef 604]
type    = S
movetype= A
physics = S
juggle  = 6
ctrl = 0
anim = 604

[State 205, 2]
type = PlaySnd
trigger1 = Time = 10
value = F30, 8
volume = 200

[state 1056]
type = playsnd
trigger1 = time = 10
value = F80,0
volume = 255

[state 604]
type = velset
trigger1 = time = [0,12]
x = 5

[state 604]
type = velset
trigger1 = time = [13,18]
x = 2.5

[state 604]
type = velset
trigger1 = time > 18
x = 0

[State 604, 2]
type = HitDef
trigger1 = animelem = 2
attr = S, NA
damage    = 30
animtype  = back
hitflag = MAF
guardflag = M
pausetime = 10,12
sparkxy = 0,-10
sparkno = 0
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 1,0)
guardsound = 6,0
ground.type = high
ground.slidetime = 4
ground.hittime  = 15
ground.velocity = -3
air.velocity = -4,-3
down.velocity = -4,0
down.hittime = 20
fall = 1
getpower = 30,0
givepower = 0,30

[State 604, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; meteor punch
[Statedef 605]
type    = A
movetype= A
physics = A
juggle  = 6
ctrl = 0
velset = 0,0
anim = 605

[State 205, 2]
type = PlaySnd
trigger1 = Time = 0
value = F30, 8
volume = 200

[state 605]
type = velset
trigger1 = 1
x = 0
y = 0

[State 605, 2]
type = HitDef
trigger1 = animelem = 2
attr = A, NA
damage    = 30
animtype  = medium
hitflag = MAF
guardflag = MA
pausetime = 3,3
sparkxy = 0,-5
sparkno = 0
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 1,0)
guardsound = 6,0
ground.type = high
ground.slidetime = 4
ground.hittime  = 15
ground.velocity = -2, 9
air.velocity = -2,9
down.velocity = -2,9
down.hittime = 20
fall = 1
air.fall = 1
down.bounce = 1
getpower = 20,0
givepower = 20,0

[State 605, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; rock free fall
[Statedef 1070]
type    = S
movetype= A
physics = S
juggle  = 2
ctrl = 0
velset = 0,0
anim = 1070

[state 1070]
type = poweradd
trigger1 = time = 1
value = ifelse(power >= 1000, -1000, -50)

[state 1070]
type = varset
trigger1 = time = 0
trigger1 = power >= 1000
v = 20
value = 1070

[state 1070]
type = varset
trigger1 = time = 0
trigger1 = power < 1000
v = 20
value = 0

[State 205, 2]
type = PlaySnd
trigger1 = Time = 0
value = F40, 2
volume = 255

[State 205, 2]
type = PlaySnd
trigger1 = Time = 20
value = F40, 3
volume = 255

[state 1070]
type = helper
trigger1 = time = 44
helpertype = normal
name = "rock"
ID = 1071
pos = 9,-31
stateno = 1071

[State 1070, ]
type = Explod
trigger1 = animelem = 4
anim = F230
ID = 230 
pos = 0,0
removetime = -2
sprpriority = 1
bindtime = -1
ontop = 1
ignorehitpause = 1
persistent = 1

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

;Rock smash
[statedef 1071]
type = A
movetype = A
physics = A
ctrl = 0
anim = 6003

[state 1071]
type = attackmulset
trigger1 = parent, var(20) = 1070
value = 2

[state 1071]
type = assertspecial
trigger1 = 1
flag = invisible

[state 1071]
type = explod
trigger1 = time = 0
removetime = -1
removeongethit = 1
bindtime = -1
ID = 1071
pos = 0,0
anim = F231
ontop = 1
;vel = 2,0
;accel = 0.2,0

[state 1071]
type = velset
trigger1 = time = 0
x = 5
y = -4

[state 1010]
type = playsnd
trigger1 = uniqhitcount = 1 && (movehit)
trigger1 = parent, var(20) > 0
trigger1 = numexplod(410) = 0
value = F31,2
volume = 200

[state 1010]
type = Explod
trigger1 = movehit
trigger1 = numexplod(410) = 0
trigger1 = parent, var(20) > 0
anim = F410
ID = 410 
pos = 0,-10
postype = p2
facing = -1
bindtime = -1
removetime = -2
sprpriority = 1
ontop = 1
ignorehitpause = 1
persistent = 0

[State 1071, 2]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage    = 40
animtype  = back
hitflag = MA
guardflag = MA
pausetime = 0,12
sparkxy = 0,-15
sparkno = 1
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 4,3)
guardsound = 6,0
ground.type = high
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -4,-5
air.velocity = -1.3,-3
down.velocity = -4,0
down.hittime = 20
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
fall = 1
getpower = ifelse(parent, var(20) > 0, 150,70),0
givepower = 0,ifelse(parent, var(20) > 0, 500,70)

[state 1071]
type = changestate
trigger1 = pos Y>= -6
trigger2 = (movecontact) || (moveguarded)
value = 1072
ctrl = 0

[statedef 1072]
type = S
movetype = A
physics = S
anim = 6004
velset = 0,0
ctrl = 0

[state 1071]
type = attackmulset
trigger1 = parent,var(20) = 1070
value = 2

[State 205, 2]
type = PlaySnd
trigger1 = Time = 0
value = F40, 4
volume = 200

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

[State 1071, 2]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage    = 40
animtype  = back
hitflag = MA
guardflag = MA
pausetime = 0,12
sparkxy = 0,-15
sparkno = 1
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 1,0)
guardsound = 6,0
ground.type = high
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -4,-5
air.velocity = -1.3,-3
down.velocity = -4,0
down.hittime = 20
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
fall = 1
getpower = ifelse(parent, var(20) > 0, 20,10),0
givepower = 0,ifelse(parent, var(20) > 0, 75,35)

[state 1071]
type = explod
trigger1 = time = 0
removetime = -2
removeongethit = 1
bindtime = -1
ID = 1072
pos = -10,-5
anim = F232
ontop = 1

[state 1071]
type = removeexplod
trigger1 = time = 0
ID = 1071

[state 1072]
type = destroyself
trigger1 = numexplod(1072) = 0
trigger1 = time > 5

;---------------------------------------------------------------------------
; Meteor crush
[Statedef 1080]
type    = A
movetype= A
physics = N
juggle  = 2
ctrl = 0
velset = 0, ifelse(vel Y >= 0, 0.2, -0.2)
anim = 1080

[state 1070]
type = poweradd
trigger1 = time = 1
value = ifelse(power >= 1000, -1000, -50)

[state 1070]
type = varset
trigger1 = time = 0
trigger1 = power >= 1000
v = 20
value = 1070

[state 1070]
type = varset
trigger1 = time = 0
trigger1 = power < 1000
v = 20
value = 0

[State 205, 2]
type = PlaySnd
trigger1 = Time = 0
value = F40, 2
volume = 255

[state 1020]
type = helper
trigger1 = time = 15
helpertype = normal
name = "Crush"
ID = 1081
pos = 40, -90
stateno = 1081

[state 1020]
type = changestate
trigger1 = animtime = 0
trigger2 = Pos Y = 0
value = 50
ctrl = 1

;Rock crush
[statedef 1081]
type = S
movetype = A
physics = S
ctrl = 0
anim = 6003

[state 1010]
type = playsnd
trigger1 = uniqhitcount = 1 && (movehit)
trigger1 = parent, var(20) > 0
trigger1 = numexplod(410) = 0
value = F31,2
volume = 200

[state 1010]
type = Explod
trigger1 = movehit
trigger1 = numexplod(410) = 0
trigger1 = parent, var(20) > 0
anim = F410
ID = 410 
pos = 0,-10
postype = p2
facing = -1
bindtime = -1
removetime = -2
sprpriority = 1
ontop = 1
ignorehitpause = 1
persistent = 0


[state 1081]
type = assertspecial
trigger1 = 1
flag = invisible

[state 1081]
type = attackmulset
trigger1 = parent, var(20) = 1070
value = 2

[state 1081]
type = explod
trigger1 = time = 0
removetime = -1
removeongethit = 1
bindtime = -1
ontop = 1
ID = 1071
pos = 0,0
anim = F231
;vel = 2,0
;accel = 0.2,0

[state 1081]
type = velset
trigger1 = time >= 0
x = 1
y = 4

[State 1081, 2]
type = HitDef
trigger1 = time = 0
trigger2 = time = 25
attr = S, SP
damage    = 40
animtype  = back
hitflag = MAFD
guardflag = MA
pausetime = 0,12
sparkxy = 10,-10
sparkno = 1
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 4,3)
guardsound = 6,0
ground.type = high
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -4,-5
air.velocity = -1.3,-3
down.velocity = -4,0
down.hittime = 20
fall = 1
getpower = ifelse(parent, var(20) > 0, 150,70),0
givepower = 0,ifelse(parent, var(20) > 0, 500,70)

[state 1081]
type = changestate
trigger1 = pos Y>= -6
trigger2 = (movecontact) || (moveguarded)
value = 1072
ctrl = 0

;---------------------------------------------------------------------------
;Deep impact
[statedef 1090]
type = S
movetype = A
physics = S
anim = 1090
ctrl = 0

[state 1010]
type = playsnd
trigger1 = uniqhitcount = 1 && (movehit)
trigger1 = var(20) > 0
trigger1 = numexplod(410) = 0
value = F31,2
volume = 200

[state 1010]
type = Explod
trigger1 = movehit
trigger1 = numexplod(410) = 0
trigger1 = var(20) > 0
anim = F410
ID = 410 
pos = 0,-10
postype = p2
facing = -1
bindtime = -1
removetime = -2
sprpriority = 1
ontop = 1
ignorehitpause = 1
persistent = 0

[state 1070]
type = poweradd
trigger1 = time = 1
value = ifelse(power >= 1000, -1000, -50)

[state 1070]
type = varset
trigger1 = time = 0
trigger1 = power >= 1000
v = 20
value = 1090

[state 1070]
type = varset
trigger1 = time = 0
trigger1 = power < 1000
v = 20
value = 0

[state 1070]
type = attackmulset
trigger1 = var(20) = 1090
value = 2

[State 205, 2]
type = PlaySnd
trigger1 = Time = 5
value = F40, 6
volume = 255

[state 1090]
type = veladd
trigger1 = command = "holdfwd"
trigger1 = vel X < 5
x = 0.4

[state 1090]
type = veladd
trigger1 = command != "holdfwd"
trigger1 = vel X < 5 && vel X > 0
x = -0.2

[state 1090]
type = velset
trigger1 = animelem = 8
x = 0
y = 0

[state 1090]
type = explod
trigger1 = animelem = 8
removetime = -2
removeongethit = 1
bindtime = 1
ID = 1090
pos = 28,-17
ontop = 1
anim = F220

[state 1056]
type = playsnd
trigger1 = animelem = 8
value = F80,0
volume = 255

[State 1090, 2]
type = HitDef
trigger1 = time = 0
attr = S, HA
damage    = 100
animtype  = back
hitflag = MA
guardflag = MA
pausetime = 0,12
sparkxy = 0,-15
sparkno = 1
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 4,3)
guardsound = 6,0
ground.type = low
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -9,-8
air.velocity = -9,-7
down.velocity = 0,0
down.hittime = 20
fall = 1
p2stateno = 6025
p2getp1state = ifelse(p2name = "Robotnik and G-mel by Cyanide", 0, 1)
getpower = ifelse(var(20) > 0, 300,100),0
givepower = 0,ifelse(var(20) > 0, 800,100)

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

;---------------------------------------------------------------------------
;major eruption
[statedef 1100]
type = A
movetype = A
Physics = N
anim = 1100
ctrl = 0

[state 1010]
type = playsnd
trigger1 = uniqhitcount = 1 && (movehit)
trigger1 = var(20) > 0
trigger1 = numexplod(410) = 0
value = F31,2
volume = 200

[state 1010]
type = Explod
trigger1 = movehit
trigger1 = numexplod(410) = 0
trigger1 = var(20) > 0
anim = F410
ID = 410 
pos = 0,-10
postype = p2
facing = -1
bindtime = -1
removetime = -2
sprpriority = 1
ontop = 1
ignorehitpause = 1
persistent = 0

[state 1070]
type = poweradd
trigger1 = time = 1
value = ifelse(power >= 1000, -1000, -50)

[state 1070]
type = varset
trigger1 = time = 0
trigger1 = power >= 1000
v = 20
value = 1100

[state 1070]
type = varset
trigger1 = time = 0
trigger1 = power < 1000
v = 20
value = 0

[state 1100]
type = attackmulset
trigger1 = var(20) = 1100
value = 2

[State 205, 2]
type = PlaySnd
trigger1 = Time = 0
value = F30, 5
volume = 255
channel = 6

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

[State 1100, 2]
type = HitDef
trigger1 = time = 0
attr = S, HA
damage    = 60
animtype  = back
hitflag = MA
guardflag = MA
pausetime = 0,12
sparkxy = 0,-15
sparkno = 1
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 1,0)
guardsound = 6,0
ground.type = low
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -3,0
air.velocity = -3,0
down.velocity = -4,0
down.hittime = 20
getpower = ifelse(var(20) > 0, 75,35),0
givepower = 0,ifelse(var(20) > 0, 250,35)

[state 1100]
type = velset
trigger1 = time = 0
y = 5

[state 1100]
type = veladd
trigger1 = pos Y< -4
y = 0.2

[state 1100]
type = velset
trigger1 = pos Y>= -4
x = 0
y = 0

[state 1100]
type = changestate
trigger1 = pos Y>= -4
value = 1101
ctrl = 0

;major eruption dig in
[statedef 1101]
type = S
movetype = I
Physics = S
anim = 1101
ctrl = 0
velset = 0,0

[state 1101]
type = nothitby
trigger1 = 1
value = SCA

[state 1101]
type = stopsnd
trigger1 = time = 10
channel = 6

[State 205, 2]
type = PlaySnd
trigger1 = Time = 0
value = F40, 3
volume = 255

[State 1101, ]
type = Explod
trigger1 = time = 0
anim = F240
ID = 240 
pos = 0,0
removetime = -2
sprpriority = 1
ontop = 1
ignorehitpause = 1
persistent = 1

[state 1101]
type = posset
trigger1 = time = 0
y = 0

[State 1101, ]
type = Explod
trigger1 = time = 24
anim = F241
ID = 241 
pos = 0,0
removetime = -1
bindtime = -1
sprpriority = 1
ontop = 1
ignorehitpause = 1
persistent = 1

[state 1101]
type = removeexplod
trigger1 = time = 180
trigger2 = command = "y"
ID = 241

[state 1101]
type = veladd
trigger1 = numexplod(241) = 1
trigger1 = command = "holdfwd"
trigger1 = vel X<= 5
x = 0.8

[state 1101]
type = veladd
trigger1 = numexplod(241) = 1
trigger1 = command = "holdback"
trigger1 = vel X>= -5
x = -0.8

[state 1101]
type = turn
trigger1 = p2dist X < -10

[state 1101]
type = velset
trigger1 = command != "holdfwd" && command != "holdback"
x = 0

[state 1101]
type = nothitby
trigger1 = numexplod(241) = 1
value = SCA

[state 1101]
type = playerpush
trigger1 = numexplod(241) = 1
value = 0

[state 1101]
type = changestate
trigger1 = time = 180
trigger2 = command = "y"
value = 1102
ctrl = 0

;major eruption uppercut
[statedef 1102]
type = A
movetype = A
physics = S
ctrl = 0
anim = 1102

[state 1010]
type = playsnd
trigger1 = uniqhitcount = 1 && (movehit)
trigger1 = var(20) > 0
trigger1 = numexplod(410) = 0
value = F31,2
volume = 200

[state 1010]
type = Explod
trigger1 = movehit
trigger1 = numexplod(410) = 0
trigger1 = var(20) > 0
anim = F410
ID = 410 
pos = 0,-10
postype = p2
facing = -1
bindtime = -1
removetime = -2
sprpriority = 1
ontop = 1
ignorehitpause = 1
persistent = 0

[state 1100]
type = attackmulset
trigger1 = var(20) = 1100
value = 2

[State 205, 2]
type = PlaySnd
trigger1 = Time = 0
value = F40, 6
volume = 255

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

[state 1102]
type = velset
trigger1 = time = 18
y = -8

[state 1102]
type = statetypeset
trigger1 = time = 19
statetype    = A
movetype= I
physics = A

[state 1102]
type = gravity
trigger1 = time > 18

[state 1102]
type = velset
trigger1 = time > 28
y = 0

[State 1102, 2]
type = HitDef
trigger1 = time = 10
attr = S, HA
damage    = 60
animtype  = back
hitflag = MA
guardflag = MA
pausetime = 0,12
sparkxy = 0,-15
sparkno = 1
hitsound   = ifelse(enemy, animexist(7997), 8,5),ifelse(enemy, animexist(7996), 4,3)
guardsound = 6,0
ground.type = low
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -1,-6
air.velocity = -1.3,-3
down.velocity = -4,0
down.hittime = 20
fall = 1
getpower = ifelse(var(20) > 0, 75,35),0
givepower = 0,ifelse(var(20) > 0, 250,35)

[state 1102]
type = changestate
trigger1 = animtime = 0
value = 50

;---------------------------------------------------------------------------
;Mole bomb
[statedef 1110]
type = S
movetype = A
physics = S
anim = 1110
velset = 0,0
ctrl = 0

[state 1110]
type = poweradd
trigger1 = time = 1
value = ifelse(power >= 1000, -1000, -50)

[state 1110]
type = varset
trigger1 = time = 0
trigger1 = power >= 1000
v = 20
value = 1110

[state 1110]
type = varset
trigger1 = time = 0
trigger1 = power < 1000
v = 20
value = 0

[State 205, 2]
type = PlaySnd
trigger1 = Time = 0
value = F40, 5
volume = 255

[state 1110]
type = helper
trigger1 = animelem = 5
helpertype = normal
name = "Corkscrew"
ID = 1115
pos = 15,0
stateno = 1115
keyctrl = 0
ownpal = 1

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

;air mole bomb
[statedef 1120]
type = A
movetype = A
physics = A
anim = 1120
velset = 0,-4
ctrl = 0

[state 1110]
type = poweradd
trigger1 = time = 1
value = ifelse(power >= 1000, -1000, -50)

[state 1110]
type = varset
trigger1 = time = 0
trigger1 = power >= 1000
v = 20
value = 1110

[state 1110]
type = varset
trigger1 = time = 0
trigger1 = power < 1000
v = 20
value = 0

[State 205, 2]
type = PlaySnd
trigger1 = Time = 0
value = F40, 5
volume = 255

[state 1120]
type = velset
trigger1 = time = 8
y = -6

[state 1120]
type = helper
trigger1 = animelem = 4
helpertype = normal
name = "Corkscrew"
ID = 1115
pos = 0,0
stateno = 1115
keyctrl = 0
ownpal = 1

[state 1120]
type = changestate
trigger1 = animtime = 0
value = 51
ctrl = 0

;corkscrew
[statedef 1115]
type = S
movetype = I
physics = S
velset = 0,0
ctrl = 0
anim = 6000

[state 1115]
type = varset
trigger1 = parent, var(20) = 1110
trigger1 = time = 0
v = 21
value = 1

[state 1115]
type = varset
trigger1 = parent, var(20) != 1110
trigger1 = time = 0
v = 21
value = 0

[state 1115]
type = velset
trigger1 = Pos Y< -3
y = 9

[state 1115]
type = velset
trigger1 = Pos Y>= -3
y = 0

[state 1115]
type = posset
trigger1 = Pos Y>= -3
y = 0

[state 1115]
type = explod
trigger1 = time = 0
removetime = -2
removeongethit = 1
bindtime = -1
ontop = 1
ID = 1115
pos = 0,0
anim = F213

[state 1055]
type = removeexplod
trigger1 = numhelper(1115) != 1 && time > 5
ID = 1115

[state 1055]
type = changestate
trigger1 = p2dist X< 20 && p2dist X> -20
trigger1 = p2dist Y< 5 && p2dist Y> -20
trigger2 = parent,command = "z" && time > 15 && (parent, stateno = 1120 || parent, stateno = 1110)
value = 1056
ctrl = 0

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


;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------
;knux dash
[statedef 10100]
type = S
movetype = I
physics = S
anim = 10100
ctrl = 0

[State 410, 2]
type = PlaySnd
trigger1 = Time = 1
value = F21,0
volume = 255

[state 10100]
type = assertspecial
trigger1 = 1
flag = nowalk

[state 10100]
type = velset
trigger1 = 1
x = 5.5

[State 10100, 3]
type = Explod
trigger1 = time = 0
anim = F170
ID = 170
pos = 0,5
bindtime = 1
removetime = -2
ontop = 1
ownpal = 1
supermove = 1

[state 10100]
type = changestate
trigger1 = time > 40
value = 0
ctrl = 1

;knux dash back
[statedef 10105]
type = S
movetype = I
physics = S
anim = 10105
ctrl = 0

[State 410, 2]
type = PlaySnd
trigger1 = Time = 1
value = F21,0
volume = 255

[state 10100]
type = assertspecial
trigger1 = 1
flag = nowalk

[state 10100]
type = velset
trigger1 = 1
x = -5.5

[State 10100, 3]
type = Explod
trigger1 = time = 0
anim = F170
ID = 170
pos = 0,5
bindtime = 1
removetime = -2
ontop = 1
ownpal = 1
facing = -1
supermove = 1

[state 10100]
type = changestate
trigger1 = time > 40
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------
[statedef -2]
[state -2]
type = removeexplod
trigger1 = stateno != 1070
ID = 230

[state -2]
type = palFX
trigger1 = power >= 1000
trigger1 = gametime%10 = 0
time = 5
add = 0,0,0
mul = 500,500,500
color = 256

[state -2]
type = attackmulset
trigger1 = movetype = H
trigger2 = ctrl
trigger3 = stateno = 90
value = 1

[state -2]
type = varset
trigger1 = p2name = "robotnik and g-mel by cyanide" && var(55) = 0
v = 55
value = 1
