;------------------
[Statedef 2240]
type    = S
movetype= A
physics = S
poweradd= 0
ctrl = 0
velset = 10,0
anim = 2001
sprpriority = 2
facep2 = 1

[State sound]
type = PlaySnd
trigger1 = time = 3 && anim = [2041,2046]
value = 20, 42

; constant part--
[State var]
type = varset
trigger1 = time = 0 && prevstateno != [2200,2299]
v = 11
value = 0

[State 0, Explod]
type = assertspecial
trigger1 = 1
flag = nomusic
ignorehitpause = 1

[State 0, Explod]
type = removeExplod
trigger1 = time = 0
anim = 888
ID = 2200

[State sound]
type = PlaySnd
trigger1 = time = 2
value = f5, 20

[State ]
type = posset
trigger1 = time = 0
y = 0

[State 1610, 1]
type = PosAdd
trigger1 = time = 2 
x = 4

[State 2, blood111]
type = Helper
trigger1 = movehit
trigger1 = numhelper(27) < 1
ID = 27
stateno = 27
pos = 0, 0
postype = p1
persistent = 0
ignorehitpause = 1
;--

;animation part
[State 1610, 1]
type = changeanim
trigger1 = time = 0 && var(11) = 0 
value = 2041

[State 1610, 1]
type = changeanim
trigger1 = time = 0 && var(11) = 1 
value = 2045

[State 1610, 1]
type = changeanim
trigger1 = time = 0 && var(11) = 2 
value = 2101

[State 1610, 1]
type = changeanim
trigger1 = time = 0 && var(11) = 3 
value = 2108

[State 1610, 1]
type = changeanim
trigger1 = time = 0 && var(11) = 4 
value = 2109


[State 1610, 1]
type = changeanim
trigger1 = time = 0 && var(11) = 5 
value = 2046

[State 1610, 1]
type = changeanim
trigger1 = time = 0 && var(11) = 6 
value = 2042

[State 1610, 1]
type = changeanim
trigger1 = time = 0 && var(11) = 7 
value = 2041

[State 1610, 1]
type = changeanim
trigger1 = time = 0 && var(11) = 8 
value = 2042

[State 1610, 1]
type = changeanim
trigger1 = time = 0 && var(11) = 9 
value = 240
;-----


;command input part
[State 0, Explod]
type = Explod
triggerall = time > 0 && numexplod(2200) = 0
trigger1 = var(11) = 0 && command = "x"
trigger2 = var(11) = 1 && command = "a"
trigger3 = var(11) = 2 && command = "b"
trigger4 = var(11) = 3 && command = "y"
trigger5 = var(11) = 4 && command = "x"
trigger6 = var(11) = 5 && command = "a"
trigger7 = var(11) = 6 && command = "b"
trigger8 = var(11) = 7 && command = "y"
trigger9 = var(11) = 8 && command = "x"
trigger10 = var(11) = 9 && command = "x"
trigger11 = var(50) = 1 && random%8 < AILevel; AI brutality
anim = 888
ID = 2200
removetime = -1
removeongethit = 1
ignorehitpause = 1
;--

;
[State ]
type = Hitdef
trigger1 = !movecontact
pausetime = 5,2
attr = S,SA
hitflag = MAF
priority = 4, hit
sparkno = -1
hitsound = 5,21
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 40
guard.hittime = 15
ground.velocity = -2, 0
guard.velocity = -2
p2facing = 1
envshake.time = 8
envshake.freq = 110
envshake.ampl = 6
p2stateno = 2202
numhits = 0

[State var]
type = selfstate
trigger1 = movecontact 
value = 2201



;===
[Statedef 2201]; hit counter
type    = S
movetype= A
physics = S
ctrl = 0

[State 0, Explod]
type = assertspecial
trigger1 = 1
flag = nomusic
ignorehitpause = 1

[State var]
type = varadd
trigger1 = time = 0
v = 11
value = 1

[State var]
type = selfstate
trigger1 = numexplod(2200) > 0 && var(11) < 10
value = prevstateno

[State var]
type = selfstate
trigger1 = numexplod(2200) > 0 && var(11) = 10
value = 3300

[State end]
type = changeanim
trigger1 = animtime = -1
value = anim
elem = animelemno(0)

[State end]
type = selfstate
trigger1 = time > 60
value = 0
ctrl = 1

[Statedef 2202]; p2 reaction
type    = S
movetype= H
physics = S
anim = 5002
velset = 0,0
ctrl = 0

[State var]
type = playsnd
trigger1 = time = 1
value = 3,0 + 2*(random%2)
channel = 3

[State var]
type = posset
trigger1 = time = 0
y = 0

[State var]
type = lifeadd
trigger1 = time = 30
trigger2 = p2stateno = 0
value = -9999

[State end]
type = selfstate
trigger1 = time > 30
trigger2 = p2stateno = 0
value = 21299

[Statedef 2203]; p2 gone
type    = S
movetype= H
physics = S
anim = 888
ctrl = 0

[State var]
type = posadd
trigger1 = time = 0
x = -30

[State var]
type = playsnd
trigger1 = time = 1
value = 3,0 + 2*(random%2)
channel = 3

[State var]
type = varset
trigger1 = time = 0
v = 26
value = 1

[State var]
type = lifeadd
trigger1 = time = 3
value = -9999

[State end]
type = selfstate
trigger1 = time > 3
value = 5150

;---------------------
[Statedef 3300]; brutal finish
type    = S
movetype= A
physics = N
poweradd= 0
ctrl = 0
anim = 2404
sprpriority = 2
velset = 1,0

[State 0, Explod]
type = assertspecial
trigger1 = 1
flag = nomusic
ignorehitpause = 1

[State var]
type = varset
trigger1 = 1
v = 4
value = 5

[State 210, 1]
type = Playsnd
trigger1 = time = 3
value = F5,10
channel = 1

[State ]
type = Helper
trigger1 = p2stateno = 2202 && enemy,time = 1
helpertype = Normal
stateno = 30
postype = p1
ignorehitpause = 1
ownpal = 1

[State ]
type = Hitdef
trigger1 = 1
pausetime = 2,2
attr = S,SA
hitflag = MAF
priority = 4, hit
sparkno = -1
hitsound = 5,21
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 40
guard.hittime = 15
ground.velocity = -2, 0
guard.velocity = -2
p2facing = 1
envshake.time = 8
envshake.freq = 110
envshake.ampl = 8
p2stateno = 2202
numhits = 0

[State end]
type = selfstate
trigger1 = animelem = 42
value = 3301

[Statedef 3301]; more brutal finish
type    = S
movetype= A
physics = S
velset = 0,0
ctrl = 0

[State ]
type = Hitdef
trigger1 = !movecontact
pausetime = 0,2
attr = S,SA
hitflag = MAF
priority = 4, hit
sparkno = -1
hitsound = 5,21
ground.type = high
air.type = high
ground.slidetime = 10
guard.slidetime = 15
ground.hittime = 40
guard.hittime = 15
ground.velocity = -2, 0
guard.velocity = -2
p2facing = 1
p2stateno = 2203
numhits = 0

[State end]
type = selfstate
trigger1 = movehit
value = 3302

[Statedef 3302];even more brutal finish
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0

[State ]
type = Helper
trigger1 = time = 2
helpertype = Normal
stateno = 6900
pos = 0, -100
postype = p2
;persistent = 0
ignorehitpause = 1
ownpal = 1

[State ]
type = Helper
trigger1 = time = 3 || time = 4
helpertype = Normal
stateno = 31
pos = 10, -30
postype = p1
;persistent = 0
ignorehitpause = 1
ownpal = 1

[State ]
type = Helper
trigger1 = time = 0
helpertype = Normal
stateno = 7442
pos = -10, -110
postype = p2
persistent = 0
ignorehitpause = 1
ownpal = 1

[State ]
type = envshake
trigger1 = time = 2
freq = 110
ampl = 12
time = 30
ignorehitpause = 1

[State 210, 1]
type = Playsnd
trigger1 = time < 3
value = F5,35

[State ]
type = envcolor
trigger1 = time = 0 || time = 8 || time = 16
value = 255,255,255
time = 4
ignorehitpause = 1

[State end]
type = selfstate
trigger1 = !animtime
value = 0
ctrl = 1