;=============================================
; CNS File for Freeza Z2 by Balthazar, Cybaster, Websta, KoopaKoot, JMorphman and XGargoyle
; Supers file
;=============================================

;===========================================================================
; <<<<< DEATH BEAM >>>>>
; Charge State = 2000
; Launch state = 2010
; Helper = 2015
;===========================================================================

[Statedef 2000]
type = S
physics = S
movetype = A
anim = 2000
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1
poweradd = -1000 ;ifelse(var(50)>0, 0, -1000)

[State 3000, cancel Sadism Mode]
type = null;varset
trigger1 = !time
var(50) = 0

[State 3000, width]
type = width
trigger1 = 1
value = 25,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [0,48]
flag = noFG

[State 3000, nhb]
type = nothitby
trigger1 = 1
time = 1
value = SCA

[State 200, Death Beam voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = time = 0
value = 2000,5
volume = 355
channel = 0

[State 200, Death Beam voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=English
trigger1 = time = 0
value = 2000,10+random%3
volume = 355
channel = 0

[State 200, Death beam charge]
type = PlaySnd
trigger1 = time = 10
value = 2000,1
volume = 355

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 40
p2defmul = 1
unhittable = 1
anim = -1
sound = s2000,0
darken = 0
movetime = 40

[State 0, Super FX]
type = Explod
trigger1 = time = 5
anim = 2003
id = 2003
pos = -49,43
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 0, Charge Ball FX]
type = Explod
trigger1 = time = 5
anim = 2001+10000*(var(2)=0)
id = 2001
pos = 60,-65
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -1
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[state 17100, scale charge FX]
type = modifyexplod
trigger1 = numexplod(2015)
scale = 1.0+0.003*(time-20),1.0+0.003*(time-20)
id = 2015

[State 0, Ki Gather FX]
type = null ;Explod
trigger1 = time = 5
anim = 2002
id = 2002
pos = 30,-60
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 6
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 2500, bgpalfx1]
type = bgpalfx
trigger1 = !time
time = 48
color=0
mul=0,0,0

;Throw Death Beam
[State 901, ChangeAnim]
type = ChangeState
trigger1 = time>=48
value = 2010
ctrl = 0

;-----------------------------
;Throwing Death Beam
[Statedef 2010]
type = S
physics = S
movetype = A
anim = 2010
ctrl = 0
velset = 0,0
sprpriority = 1

[State 3000, nhb]
type = nothitby
trigger1 = time<4
time = 1
value = SCA

[State 3000, width]
type=width
trigger1 = 1
value = 25,0

[state 1215, remove charge FX]
type = removeexplod
trigger1 = !time
ID = 2001

[state 1215, Smoke FX]
type = explod
trigger1 = !time
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1

[state 1215, Flash FX]
type = explod
trigger1 = !time
anim = 2011
id = 2011
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
bindtime = -1

[State 3000, beam helper]
type = helper
trigger1 = !time
helpertype = normal
stateno = 2015
ID = 2015
name = "Death_Beam"
postype = p1
ownpal = 1

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1


;===========================================================================
; <<<<< DEATH BEAM LV2 >>>>>
; Charge State = 2100
; Launch state = 2110
; Helper = 2115
;===========================================================================

[Statedef 2100]
type = S
physics = S
movetype = A
anim = 2000
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1
poweradd = -2000 ;ifelse(var(50)>0, -1000, -2000)

[State 3000, cancel Sadism Mode]
type = null;varset
trigger1 = !time
var(50) = 0


[State 3000, width]
type = width
trigger1 = 1
value = 25,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [0,48]
flag = noFG

[State 3000, nhb]
type = nothitby
trigger1 = 1
time = 1
value = SCA

[State 200, Death Beam voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = time = 0
value = 2000,5
volume = 355
channel = 0

[State 200, Death Beam voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=English
trigger1 = time = 0
value = 2000,10+random%3
volume = 355
channel = 0

[State 200, Death beam charge]
type = PlaySnd
trigger1 = time = 10
value = 2000,1
volume = 355

[State 200, Superpause sound]
type = PlaySnd
trigger1 = time=5
value = 2350,0

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 40
p2defmul = 1
unhittable = 1
anim = -1
darken = 0
movetime = 40

[State 0, Hyper Charge FX]
type = Explod
trigger1 = time = 5
anim = 2440
id = 2440
pos = 60,-65
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 6
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 0, Charge Ball FX]
type = Explod
trigger1 = time = 5
anim = 2001+10000*(var(2)=0)
id = 2001
pos = 60,-65
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -1
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 2500, bgpalfx1]
type = bgpalfx
trigger1 = !time
time = 48
color=0
mul=0,0,0

;Throw Death Beam
[State 901, ChangeAnim]
type = ChangeState
trigger1 = time>=48
value = 2110
ctrl = 0

;-----------------------------
;Throwing Death Beam Lv2
[Statedef 2110]
type = S
physics = S
movetype = A
anim = 2110
ctrl = 0
velset = 0,0
sprpriority = 1

[State 3000, nhb]
type = nothitby
trigger1 = time<4
time = 1
value = SCA

[State 3000, width]
type=width
trigger1 = 1
value = 25,0

[state 1215, remove charge FX]
type = removeexplod
trigger1 = !time
ID = 2001

[state 1215, Smoke FX]
type = explod
trigger1 = !time
trigger2 = animelemtime(3)=0
trigger3 = animelemtime(5)=0
trigger4 = animelemtime(7)=0
trigger5 = animelemtime(9)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 1
ignorehitpause = 1

[state 1215, Flash FX normal height]
type = explod
trigger1 = !time
trigger2 = animelemtime(9)=0
anim = 2011
id = 2011
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 1
ignorehitpause = 0
bindtime = -1

[state 1215, Flash FX up]
type = explod
trigger1 = animelemtime(3)=0
trigger2 = animelemtime(7)=0
anim = 2111
id = 2011
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 1
ignorehitpause = 0
bindtime = -1

[state 1215, Flash FX down]
type = explod
trigger1 = animelemtime(5)=0
anim = 2112
id = 2011
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0
bindtime = -1

[State 3000, beam helper normal]
type = helper
trigger1 = !time
helpertype = normal
stateno = 2115
ID = 2115
name = "Death_Beam"
postype = p1
ownpal = 1
persistent = 1

[State 3000, beam helper up]
type = helper
trigger1 = animelemtime(3)=0
trigger2 = animelemtime(7)=0
helpertype = normal
stateno = 2116
ID = 2115
name = "Death_Beam"
postype = p1
ownpal = 1
persistent = 1

[State 3000, beam helper down]
type = helper
trigger1 = animelemtime(5)=0
helpertype = normal
stateno = 2117
ID = 2115
name = "Death_Beam"
postype = p1
ownpal = 1
persistent = 1

[State 3000, beam helper normal last]
type = helper
trigger1 = animelemtime(9)=0
helpertype = normal
stateno = 2118
ID = 2115
name = "Death_Beam"
postype = p1
ownpal = 1
persistent = 1

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1


;===========================================================================
; <<<<< DEATH BALL 25% >>>>>
; State : 2200
; Helper : 2205-2210
;===========================================================================

[Statedef 2200]
type = S
physics = S
movetype = A
anim = 2200
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1
poweradd = -1000 ;ifelse(var(50)>0, 0, -1000)

[State 3000, cancel Sadism Mode]
type = null;varset
trigger1 = !time
var(50) = 0

[State 40, 4]
type = Width
trigger1 = 1
edge = 0, 30

[State 3000, cancel Sadism Mode]
type = null;varset
trigger1 = !time
var(50) = 0

[State 0]; goto charge
type = changeanim
triggerall = time = 87 && anim = 2200
trigger1 = random<((AILevel+1)*100)
value = 2201

[State 0]; goto launch
type = changeanim
triggerall = anim = 2201 && time >= 5
trigger1 = time > 170
trigger2 = p2bodydist x<80
trigger3 = numenemy
trigger3 = enemy,movetype=A
value = 2203

[State 100, jump SND]
type = playsnd
trigger1 = !time
value = 40,1

[state 1215, Rising Effect]
type = explod
trigger1 = !time
anim = 1216
id = 1216
pos = 10,12
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
supermovetime = 9999
pausemovetime = 9999
persistent = 0
ignorehitpause = 0

[State 40, 4]
type = VelSet
trigger1 = Time = 0
x = 0
y = const(velocity.jump.y)/1.2

[State 40, 4]
type = VelSet
trigger1 =  animelemtime(3)=0
x = 0
y = 0

[State 2200, sts]
type = statetypeset
trigger1 = animelemtime(1)>0
physics = N
statetype = A

[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = time = 5
value = 2200,5
channel = 0
volume = 300

[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 = !time
value = 2200,6
channel = 0
volume = 300
[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 = anim=2200 && animelem=5
trigger2 = anim=2203 && animelem=1
value = 2200,7
channel = 0
volume = 300

[State 200, 1];Death Ball Charge
type = PlaySnd
trigger1 = time=8
value = 2200, 0
channel = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(6) < 0
flag = noBG
flag2 = noFG

[State 3000, nhb]
type = nothitby
trigger1 = animelemtime(7) < 0
time = 1
value = SCA

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 80
p2defmul = 1
unhittable = 1
anim = -1
sound = s2000,0
darken = 0
movetime = 80

[State 0, Death Ball charge FX]
type = Explod
trigger1 = time = 8
anim = 2202
id = 2202
pos = -48,-150
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -1;79
sprpriority = 7
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
removeongethit = 1

[State 0]
type = removeexplod
trigger1 = anim = 2203 && animelemtime(1) = 0
trigger2 = anim = 2200 && animelemtime(5) = 0
value = 2202
ignorehitpause = 1

[State 0, Death Ball charge FX moved]
type = Explod
trigger1 = anim = 2200
trigger1 = animelemtime(5) = 0
trigger2 = anim = 2203
trigger2 = animelemtime(1) = 0
anim = 2202
id = 2202
pos = -43,-128
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = 3
sprpriority = 7
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
removeongethit = 1

[State 0, Super FX]
type = Explod
trigger1 = time = 8
anim = 2003
id = 2003
pos = -160,-43
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 200, 1];Woosh
type = PlaySnd
trigger1 = animelem = 5
value = 0, 0
channel = 1

[State 3000, Death Ball 25]
type = helper
trigger1 = anim=2200 && animelem=6
trigger2 = anim=2203 && animelem=2
helpertype = normal
stateno = 2205
ID = 2205
name = "death_ball_25"
postype = p1
pos = 70,-30
ownpal = 1

[State 3000, end]
type = changestate
triggerall = !animtime
trigger1 = anim = 2200
trigger2 = anim = 2203
value = 50
ctrl = 0


;===========================================================================
; <<<<< AIR DEATH BALL 25% >>>>>
; State : 2220
; Helper : 2205-2210
;===========================================================================

[Statedef 2220]
type = A
physics = N
movetype = A
anim = 2200
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1
poweradd = -1000 ;ifelse(var(50)>0, 0, -1000)

[State 40, 4]
type = Width
trigger1 = 1
edge = 0, 30

[State 3000, cancel Sadism Mode]
type = null;varset
trigger1 = !time
var(50) = 0

[State 0]; goto charge
type = changeanim
triggerall = time = 87 && anim = 2200
trigger1 = random<((AILevel+1)*100)
value = 2201

[State 0]; goto launch
type = changeanim
triggerall = anim = 2201 && time >= 5
trigger1 = time > 170
trigger2 = p2bodydist x<80
trigger3 = numenemy
trigger3 = enemy,movetype=A
value = 2203

[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = time = 5
value = 2200,5
channel = 0
volume = 300

[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 = !time
value = 2200,6
channel = 0
volume = 300
[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 = anim=2200 && animelem=5
trigger2 = anim=2203 && animelem=1
value = 2200,7
channel = 0
volume = 300

[State 200, 1];Death Ball Charge
type = PlaySnd
trigger1 = time=8
value = 2200, 0
channel = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(6) < 0
flag = noBG
flag2 = noFG

[State 3000, nhb]
type = nothitby
trigger1 = animelemtime(7) < 0
time = 1
value = SCA

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 80
p2defmul = 1
unhittable = 1
anim = -1
sound = s2000,0
darken = 0
movetime = 80

[State 0, Death Ball charge FX]
type = Explod
trigger1 = time = 8
anim = 2202
id = 2202
pos = -48,-150
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -1;79
sprpriority = 7
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
removeongethit = 1

[State 0]
type = removeexplod
trigger1 = anim = 2203 && animelemtime(1) = 0
trigger2 = anim = 2200 && animelemtime(5) = 0
value = 2202
ignorehitpause = 1

[State 0, Death Ball charge FX moved]
type = Explod
trigger1 = anim = 2200
trigger1 = animelemtime(5) = 0
trigger2 = anim = 2203
trigger2 = animelemtime(1) = 0
anim = 2202
id = 2202
pos = -43,-128
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = 3
sprpriority = 7
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
removeongethit = 1

[State 0, Super FX]
type = Explod
trigger1 = time = 8
anim = 2003
id = 2003
pos = -160,-43
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 200, 1];Woosh
type = PlaySnd
trigger1 = animelem = 5
value = 0, 0
channel = 1

[State 3000, Death Ball 25]
type = helper
trigger1 = anim=2200 && animelem=6
trigger2 = anim=2203 && animelem=2
helpertype = normal
stateno = 2205
ID = 2205
name = "death_ball_25"
postype = p1
pos = 70,-30
ownpal = 1

[State 3000, end]
type = changestate
triggerall = !animtime
trigger1 = anim = 2200
trigger2 = anim = 2203
value = 50
ctrl = 0

;===========================================================================
; <<<<< DEATH SAW A >>>>>
; Charge State = 2300
; Launch state = 2301
;===========================================================================

[Statedef 2300]
type = S
physics = S
movetype = A
anim = 2300
ctrl = 0
facep2 = 1
velset = 0,0
sprpriority = 1
poweradd = -1000 ;ifelse(var(50)>0, 0, -1000)

[State 3000, cancel Sadism Mode]
type = null;varset
trigger1 = !time
var(50) = 0

[State 100, "Death Saw voice]
type = playsnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = time = 5
value = 2200,5
channel = 0
supermovetime = 9999
pausemovetime = 9999

[State 100, "Death Saw voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 =time = 0
value = 2301,(random%2)
channel = 0
supermovetime = 9999
pausemovetime = 9999

[State 3000, width]
type=width
trigger1 = 1
value = 15,0

[State 0] ;Resets the Damage Dampener for Death Saw
type = varset
trigger1 = time = 0
fvar(12) = 0.5
supermovetime = 9999
pausemovetime = 9999

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [0,48]
flag = noFG

[State 3000, nhb]
type = nothitby
trigger1 = 1
time = 1
value = SCA

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 40
p2defmul = 1
unhittable = 1
anim = -1
sound = s2000,0
darken = 0
movetime = 40

[State 0, Super FX]
type = Explod
trigger1 = time = 5
anim = 2003
id = 2003
pos = -100,-10
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 3000, Charging Saw]
type = helper
trigger1 = animelem = 2
helpertype = normal
stateno = 2312
ID = 2311
name = "Death_Saw"
postype = p1
ownpal = 1
pausemovetime=40
supermovetime=40

[State 2500, bgpalfx1]
type = bgpalfx
trigger1 = !time
time = 48
color=0
mul=0,0,0

;Throw Death Saw
[State 901, ChangeAnim]
type = ChangeState
trigger1 = animtime = 0
value = 2301
ctrl = 0

;-----------------------------
;Throwing Death Saw
[Statedef 2301]
type = S
physics = S
movetype = A
anim = 2301
ctrl = 0
velset = 0,0
sprpriority = 1

[State 3000, width]
type=width
trigger1 = 1
value = 15,0

[State 3000, nhb]
type = nothitby
trigger1 = time<4
time = 1
value = SCA

[State 3000, Charging Saw]
type = helper
trigger1 = time = 0
helpertype = normal
stateno = 2310
ID = 2310
name = "Death_Saw"
postype = p1
ownpal = 1

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

;===========================================================================
; <<<<< DEATH SAW B >>>>>
; Charge State = 2302
; Launch state = 2303
;===========================================================================

[Statedef 2302]
type = S
physics = S
movetype = A
anim = 2300
ctrl = 0
facep2 = 1
velset = 0,0
sprpriority = 1
poweradd = -1000 ;ifelse(var(50)>0, 0, -1000)

[State 3000, cancel Sadism Mode]
type = null;varset
trigger1 = !time
var(50) = 0

[State 100, "Death Saw voice]
type = playsnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = time = 5
value = 2200,5
channel = 0
volume = 300
supermovetime = 9999
pausemovetime = 9999

[State 100, "Death Saw voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 =time = 0
value = 2301,(random%2)+2
channel = 0
supermovetime = 9999
pausemovetime = 9999

[State 0] ;Resets the Damage Dampener for Death Saw
type = varset
trigger1 = time = 0
fvar(12) = 0.5
supermovetime = 9999
pausemovetime = 9999

[State 3000, width]
type=width
trigger1 = 1
value = 15,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [0,48]
flag = noFG

[State 3000, nhb]
type = nothitby
trigger1 = time = 0
time = 50
value = SCA

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 40
p2defmul = 1
unhittable = 1
anim = -1
sound = s2000,0
darken = 0
movetime = 40

[State 0, Super FX]
type = Explod
trigger1 = time = 5
anim = 2003
id = 2003
pos = -100,-10
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 3000, Charging Saw]
type = helper
trigger1 = animelem = 2
helpertype = normal
stateno = 2312
ID = 2311
name = "Death_Saw"
postype = p1
ownpal = 1
pausemovetime=40
supermovetime=40

[State 2500, bgpalfx1]
type = bgpalfx
trigger1 = !time
time = 48
color=0
mul=0,0,0

;Throw Death Saw
[State 901, ChangeAnim]
type = ChangeState
trigger1 = time = 55
value = 2303
ctrl = 0

;-----------------------------
;Throwing Death Saw
[Statedef 2303]
type = S
physics = S
movetype = A
anim = 2301
ctrl = 0
velset = 0,0
sprpriority = 1

[State 3000, width]
type=width
trigger1 = 1
value = 15,0

[State 3000, nhb]
type = nothitby
trigger1 = time<4
time = 1
value = SCA

[State 3000, Charging Saw]
type = helper
trigger1 = time = 0
helpertype = normal
stateno = 2311
ID = 2310
name = "Death_Saw"
postype = p1
ownpal = 1

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

;===========================================================================
; <<<<< DEATH SAW C >>>>>
; Charge State = 2304
; Launch state = 2305
;===========================================================================

[Statedef 2304]
type = S
physics = S
movetype = A
anim = 2300
ctrl = 0
facep2 = 1
velset = 0,0
sprpriority = 1
poweradd = -1000 ;ifelse(var(50)>0, 0, -1000)

[State 3000, cancel Sadism Mode]
type = null;varset
trigger1 = !time
var(50) = 0

[State 100, "Death Saw voice]
type = playsnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = time = 5
value = 2200,5
channel = 0
volume = 300
supermovetime = 9999
pausemovetime = 9999

[State 100, "Death Saw voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 =time = 0
value = 2301,(random%2)+4
channel = 0
supermovetime = 9999
pausemovetime = 9999

[State 0] ;Resets the Damage Dampener for Death Saw
type = varset
trigger1 = time = 0
fvar(12) = 0.5
supermovetime = 9999
pausemovetime = 9999

[State 3000, width]
type=width
trigger1 = 1
value = 15,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time = [0,48]
flag = noFG

[State 3000, nhb]
type = nothitby
trigger1 = time = 0
time = 50
value = SCA

[State 3000, superpause]
type = superpause
trigger1 = time=5
time = 40
p2defmul = 1
unhittable = 1
anim = -1
sound = s2000,0
darken = 0
movetime = 40

[State 0, Super FX]
type = Explod
trigger1 = time = 5
anim = 2003
id = 2003
pos = -100,-10
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 8
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 3000, Charging Saw]
type = helper
trigger1 = animelem = 2
helpertype = normal
stateno = 2312
ID = 2311
name = "Death_Saw"
postype = p1
ownpal = 1
pausemovetime=40
supermovetime=40

[State 2500, bgpalfx1]
type = bgpalfx
trigger1 = !time
time = 48
color=0
mul=0,0,0

;Throw Death Saw
[State 901, ChangeAnim]
type = ChangeState
trigger1 = time = 60
value = 2305
ctrl = 0

;-----------------------------
;Throwing Death Saw
[Statedef 2305]
type = S
physics = S
movetype = A
anim = 2301
ctrl = 0
velset = 0,0
sprpriority = 1

[State 3000, width]
type=width
trigger1 = 1
value = 15,0

[State 3000, nhb]
type = nothitby
trigger1 = time<4
time = 1
value = SCA

[State 3000, Charging Saw]
type = helper
trigger1 = time = 0
helpertype = normal
stateno = 2314
ID = 2310
name = "Death_Saw"
postype = p1
ownpal = 1

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

;===========================================================================
; <<<<< DEATH BALL 50% (Lv2) >>>>>
; State : 2400
; Helper : 2205-2210
;===========================================================================

[Statedef 2400]
type = S
physics = S
movetype = A
anim = 2200
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1
poweradd = -1000 ;ifelse(var(50)>0, -1000, -2000)

[State 3000, cancel Sadism Mode]
type = null; varset
trigger1 = !time
var(50) = 0

[State 40, 4]
type = Width
trigger1 = 1
edge = 0, 30

[State 0]; goto charge
type = changeanim
triggerall = time = 87 && anim = 2200
trigger1 = random<((AILevel+1)*100)
value = 2201

[State 0]; goto launch
type = changeanim
triggerall = anim = 2201 && time >= 5
trigger1 = time > 170
trigger2 = p2bodydist x<80
value = 2203

[State 100, jump SND]
type = playsnd
trigger1 = !time
value = 40,1

[state 1215, Rising Effect]
type = explod
trigger1 = !time
anim = 1216
id = 1216
pos = 10,12
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
supermovetime = 9999
pausemovetime = 9999
persistent = 0
ignorehitpause = 0

[State 40, 4]
type = VelSet
trigger1 = Time = 0
x = 0 ;const(velocity.jump.back.x)
y = const(velocity.jump.y)/1.2

[State 40, 4]
type = VelSet
trigger1 =  animelemtime(3)=0
x = 0
y = 0

[State 2200, sts]
type = statetypeset
trigger1 = animelemtime(1)>0
physics = N
statetype = A

[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = time = 5
value = 2200,5
channel = 0
volume = 300

[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 = !time
value = 2400,0
channel = 0
volume = 300
[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 = anim=2200 && animelem=5
trigger2 = anim=2203 && animelem=1
value = 2200,7
channel = 0
volume = 300

[State 200, 1];Death Ball Charge
type = PlaySnd
trigger1 = time=8
value = 2200, 0
channel = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(6) < 0
flag = noBG
flag2 = noFG

[State 3000, nhb]
type = nothitby
trigger1 = animelemtime(7) < 0
time = 1
value = SCA

[State 200, Superpause sound]
type = PlaySnd
trigger1 = time=8
value = 2350,0

[State 3000, superpause]
type = superpause
trigger1 = time=8
time = 80
p2defmul = 1
unhittable = 1
anim = -1
darken = 0
movetime = 80

[State 0, Hyper Charge FX]
type = Explod
trigger1 = time = 5
anim = 2440
id = 2440
pos = -53,-155
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 6
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 0, Death Ball charge FX]
type = Explod
trigger1 = time = 8
anim = 2202
id = 2202
pos = -53,-155
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -1;79
sprpriority = 5
ownpal = 1
bindtime = -1
;scale = 1.25,1.25
persistent = 0
removeongethit = 1

[State 0]
type = removeexplod
trigger1 = anim = 2203 && animelemtime(1) = 0
trigger2 = anim = 2200 && animelemtime(5) = 0
value = 2202
ignorehitpause = 1

[State 0, Death Ball charge FX moved]
type = Explod
trigger1 = anim = 2200
trigger1 = animelemtime(5) = 0
trigger2 = anim = 2203
trigger2 = animelemtime(1) = 0
anim = 2202
id = 2202
pos = -48,-133
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = 3
sprpriority = 5
ownpal = 1
bindtime = -1
;scale = 1.25,1.25
persistent = 0
removeongethit = 1

[State 200, 1];Woosh
type = PlaySnd
trigger1 = animelem = 5
value = 0, 0
channel = 1

[State 3000, Death Ball 50]
type = helper
trigger1 = anim=2200 && animelem=6
trigger2 = anim=2203 && animelem=2
helpertype = normal
stateno = 2205
ID = 2205
name = "death_ball_50"
postype = p1
pos = 70,-30
ownpal = 1

[State 3000, end]
type = changestate
triggerall = !animtime
trigger1 = anim = 2200
trigger2 = anim = 2203
value = 50
ctrl = 0

;===========================================================================
; <<<<< DEATH BALL 50% (Lv2) AIR >>>>>
; State : 2420
; Helper : 2205-2210
;===========================================================================

[Statedef 2420]
type = A
physics = N
movetype = A
anim = 2200
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1
poweradd = -2000 ;ifelse(var(50)>0, -1000, -2000)

[State 3000, cancel Sadism Mode]
type = null ;varset
trigger1 = !time
var(50) = 0

[State 40, 4]
type = Width
trigger1 = 1
edge = 0, 30

[State 0]; goto charge
type = changeanim
triggerall = time = 87 && anim = 2200
trigger1 = random<((AILevel+1)*100)
value = 2201

[State 0]; goto launch
type = changeanim
triggerall = anim = 2201 && time >= 5
trigger1 = time > 170
trigger2 = p2bodydist x<80
value = 2203

[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = time = 5
value = 2200,5
channel = 0
volume = 300

[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 = !time
value = 2400,0
channel = 0
volume = 300
[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 = anim=2200 && animelem=5
trigger2 = anim=2203 && animelem=1
value = 2200,9
channel = 0
volume = 300

[State 200, 1];Death Ball Charge
type = PlaySnd
trigger1 = time=8
value = 2200, 0
channel = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(6) < 0
flag = noBG
flag2 = noFG

[State 3000, nhb]
type = nothitby
trigger1 = animelemtime(7) < 0
time = 1
value = SCA

[State 200, Superpause sound]
type = PlaySnd
trigger1 = time=8
value = 2350,0

[State 3000, superpause]
type = superpause
trigger1 = time=8
time = 80
p2defmul = 1
unhittable = 1
anim = -1
darken = 0
movetime = 80

[State 0, Hyper Charge FX]
type = Explod
trigger1 = time = 5
anim = 2440
id = 2440
pos = -53,-155
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 6
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 0, Death Ball charge FX]
type = Explod
trigger1 = time = 8
anim = 2202
id = 2202
pos = -53,-155
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -1;79
sprpriority = 5
ownpal = 1
bindtime = -1
;scale = 1.25,1.25
persistent = 0
removeongethit = 1

[State 0]
type = removeexplod
trigger1 = anim = 2203 && animelemtime(1) = 0
trigger2 = anim = 2200 && animelemtime(5) = 0
value = 2202
ignorehitpause = 1

[State 0, Death Ball charge FX moved]
type = Explod
trigger1 = anim = 2200
trigger1 = animelemtime(5) = 0
trigger2 = anim = 2203
trigger2 = animelemtime(1) = 0
anim = 2202
id = 2202
pos = -48,-133
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = 3
sprpriority = 5
ownpal = 1
bindtime = -1
;scale = 1.25,1.25
persistent = 0
removeongethit = 1

[State 200, 1];Woosh
type = PlaySnd
trigger1 = animelem = 5
value = 0, 0
channel = 1

[State 3000, Death Ball 50]
type = helper
trigger1 = anim=2200 && animelem=6
trigger2 = anim=2203 && animelem=2
helpertype = normal
stateno = 2205
ID = 2205
name = "death_ball_50"
postype = p1
pos = 70,-30
ownpal = 1

[State 3000, end]
type = changestate
triggerall = !animtime
trigger1 = anim = 2200
trigger2 = anim = 2203
value = 50
ctrl = 0

;===========================================================================
; <<<<< DEATH BALL 75% (Lv3) >>>>>
; State : 2450
; Helper : 2205-2210
;===========================================================================

[Statedef 2450]
type = S
physics = S
movetype = A
anim = 2200
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1
poweradd = -3000 ;ifelse(var(50)>0, -2000, -3000)

[State 3000, cancel Sadism Mode]
type = null ;varset
trigger1 = !time
var(50) = 0

[State 40, 4]
type = Width
trigger1 = 1
edge = 0, 30

[State 0]; goto charge
type = changeanim
triggerall = time = 87 && anim = 2200
trigger1 = random<((AILevel+1)*100)
value = 2201

[State 0]; goto launch
type = changeanim
triggerall = anim = 2201 && time >= 5
trigger1 = time > 170
trigger2 = p2bodydist x<80
value = 2203

[State 100, jump SND]
type = playsnd
trigger1 = !time
value = 40,1

[state 1215, Rising Effect]
type = explod
trigger1 = !time
anim = 1216
id = 1216
pos = 10,12
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
supermovetime = 9999
pausemovetime = 9999
persistent = 0
ignorehitpause = 0

[State 40, 4]
type = VelSet
trigger1 = Time = 0
x = 0 ;const(velocity.jump.back.x)
y = const(velocity.jump.y)/1.2

[State 40, 4]
type = VelSet
trigger1 =  animelemtime(3)=0
x = 0
y = 0

[State 2200, sts]
type = statetypeset
trigger1 = animelemtime(1)>0
physics = N
statetype = A

[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = time = 5
value = 2200,5
channel = 0
volume = 300

[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 = !time
value = 2450,0
channel = 0
volume = 300
[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 = anim=2200 && animelem=5
trigger2 = anim=2203 && animelem=1
value = 2200,9
channel = 0
volume = 300

[State 200, 1];Death Ball Charge
type = PlaySnd
trigger1 = time=8
value = 2200, 0
channel = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(6) < 0
flag = noBG
flag2 = noFG

[State 3000, nhb]
type = nothitby
trigger1 = animelemtime(7) < 0
time = 1
value = SCA

[State 200, Superpause sound]
type = PlaySnd
trigger1 = time=8
value = 2350,0

[State 3000, superpause]
type = superpause
trigger1 = time=8
time = 80
p2defmul = 1
unhittable = 1
anim = -1
darken = 0
movetime = 80

[State 0, Hyper Charge FX]
type = Explod
trigger1 = time = 0
anim = 2440
id = 2440
pos = -53,-155
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 6
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 0, Death Ball charge FX]
type = Explod
trigger1 = time = 8
anim = 2202
id = 2202
pos = -53,-155
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -1;79
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1.25,1.25
persistent = 0
removeongethit = 1

[State 0]
type = removeexplod
trigger1 = anim = 2203 && animelemtime(1) = 0
trigger2 = anim = 2200 && animelemtime(5) = 0
value = 2202
ignorehitpause = 1

[State 0, Death Ball charge FX moved]
type = Explod
trigger1 = anim = 2200
trigger1 = animelemtime(5) = 0
trigger2 = anim = 2203
trigger2 = animelemtime(1) = 0
anim = 2202
id = 2202
pos = -48,-133
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = 3
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1.25,1.25
persistent = 0
removeongethit = 1

[State 0, Lv3 version from sky lightning]
type = explod
triggerall = time > 8
trigger1 = gametime%(50-(time-8)/5) = 0
anim = 2450+random%6
sprpriority = 7
postype = p1
pos = 0,-ceil(pos y)
facing = ifelse(random<500,-1,1)
random = 120,0
scale = 1,2
pausemovetime = -1
supermovetime = -1
ownpal = 1
persistent = 1

[State 200, electricity]
type = PlaySnd
triggerall = time > 8
trigger1 = gametime%(50-(time-8)/5) = 0
value = 2400,3
volume = -170-(32*numexplod)
freqmul = .9 + (random/5000.0)

[State 200, 1];Woosh
type = PlaySnd
trigger1 = animelem = 5
value = 0, 0
channel = 1

[State 3000, Death Ball Lv3 helper]
type = helper
trigger1 = anim=2200 && animelem=6
trigger2 = anim=2203 && animelem=2
helpertype = normal
stateno = 2205
ID = 2205
name = "death_ball_lv3"
postype = p1
pos = 70,-30
ownpal = 1

[State 3000, end]
type = changestate
triggerall = !animtime
trigger1 = anim = 2200
trigger2 = anim = 2203
value = 50
ctrl = 0


;===========================================================================
; <<<<< DEATH BALL 75% (Lv3) AIR >>>>>
; State : 2470
; Helper : 2205-2210
;===========================================================================

[Statedef 2470]
type = A
physics = N
movetype = A
anim = 2200
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1
poweradd = -3000 ;ifelse(var(50)>0, -2000, -3000)

[State 3000, cancel Sadism Mode]
type = null;varset
trigger1 = !time
var(50) = 0

[State 40, 4]
type = Width
trigger1 = 1
edge = 0, 30

[State 0]; goto charge
type = changeanim
triggerall = time = 87 && anim = 2200
trigger1 = random<((AILevel+1)*100)
value = 2201

[State 0]; goto launch
type = changeanim
triggerall = anim = 2201 && time >= 5
trigger1 = time > 170
trigger3 = p2bodydist x<80
value = 2203

[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = time = 5
value = 2200,5
channel = 0
volume = 300

[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 = !time
value = 2450,0
channel = 0
volume = 300
[State 100, "Death Ball" voice]
type = playsnd
triggerall = var(55)=1		;Voice=English
trigger1 = anim=2200 && animelem=5
trigger2 = anim=2203 && animelem=1
value = 2200,9
channel = 0
volume = 300

[State 200, 1];Death Ball Charge
type = PlaySnd
trigger1 = time=8
value = 2200, 0
channel = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(6) < 0
flag = noBG
flag2 = noFG

[State 3000, nhb]
type = nothitby
trigger1 = animelemtime(7) < 0
time = 1
value = SCA

[State 200, Superpause sound]
type = PlaySnd
trigger1 = time=8
value = 2350,0

[State 3000, superpause]
type = superpause
trigger1 = time=8
time = 80
p2defmul = 1
unhittable = 1
anim = -1
darken = 0
movetime = 80

[State 0, Hyper Charge FX]
type = Explod
trigger1 = time = 5
anim = 2440
id = 2440
pos = -53,-155
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 6
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 0, Death Ball charge FX]
type = Explod
trigger1 = time = 8
anim = 2202
id = 2202
pos = -53,-155
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -1;79
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1.25,1.25
persistent = 0
removeongethit = 1

[State 0]
type = removeexplod
trigger1 = anim = 2203 && animelemtime(1) = 0
trigger2 = anim = 2200 && animelemtime(5) = 0
value = 2202
ignorehitpause = 1

[State 0, Death Ball charge FX moved]
type = Explod
trigger1 = anim = 2200
trigger1 = animelemtime(5) = 0
trigger2 = anim = 2203
trigger2 = animelemtime(1) = 0
anim = 2202
id = 2202
pos = -48,-133
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = 3
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1.25,1.25
persistent = 0
removeongethit = 1

[State 0, Lv3 version from sky lightning]
type = explod
triggerall = time > 8
trigger1 = gametime%(50-(time-8)/5) = 0
anim = 2450+random%6
sprpriority = 7
postype = p1
pos = 0,-ceil(pos y)
facing = ifelse(random<500,-1,1)
random = 120,0
scale = 1,2
pausemovetime = -1
supermovetime = -1
ownpal = 1
persistent = 1

[State 200, electricity]
type = PlaySnd
triggerall = time > 8
trigger1 = gametime%(50-(time-8)/5) = 0
value = 2400,3
volume = -170-(32*numexplod)
freqmul = .9 + (random/5000.0)

[State 200, 1];Woosh
type = PlaySnd
trigger1 = animelem = 5
value = 0, 0
channel = 1

[State 3000, Death Ball 25]
type = helper
trigger1 = anim=2200 && animelem=6
trigger2 = anim=2203 && animelem=2
helpertype = normal
stateno = 2205
ID = 2205
name = "death_ball_lv3"
postype = p1
pos = 70,-30
ownpal = 1

[State 3000, end]
type = changestate
triggerall = !animtime
trigger1 = anim = 2200
trigger2 = anim = 2203
value = 50
ctrl = 0


;===========================================================================
; <<<<< TAIL PRESS NIGHTMARE Lv3 / SADISTIC DANCE >>>>>
; State : 2500
; Helper : 2205-2210
;===========================================================================

[Statedef 2500]
type = S
physics = N
movetype = A
anim = 2400
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1
poweradd = -3000 ;ifelse(var(50)>0, -2000, -3000)

[State 13200, saving Sadism mode variable for finishers]
type = Varset
trigger1 = !Time
var(39) =  0 ;var(50)
[State 13200, deactivate Sadism mode]
type = null ;Varset
trigger1 = !Time
var(50) = 0

[State 200, Death Beam voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = time = 0
value = 1400,5 ;shine! ;2000,5
volume = 355
channel = 0

[State 200, Death Beam voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=English
trigger1 = time = 0
value = 2500,0
volume = 355
channel = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(2) < 0
flag = noBG
flag2 = noFG

[State 3000, nhb]
type = nothitby
trigger1 = animelemtime(4) < 0
time = 1
value = SCA

[State 200, Superpause sound]
type = PlaySnd
trigger1 = time=0
value = 2350,0

[State 3000, superpause]
type = superpause
trigger1 = time=0
time = 60
p2defmul = 1
unhittable = 1
anim = -1
darken = 0
movetime = 60

[State 0, Hyper Charge FX]
type = Explod
trigger1 = time = 0
anim = 2440
id = 2440
pos = 4,-47
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 6
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[State 41, Train]
type = AfterImage
trigger1 = Time = 0
time= -1
timegap= 1
framegap= 3
length= 12
palbright= 0,0,0
paladd= 0,0,0
palmul= .9,.9,.9
palcontrast= 120,120,120
palpostbright= 0,0,0
trans= add1

[State 420, 3]
type = HitDef
trigger1 = AnimElem = 6
trigger2 = AnimElem = 7
trigger3 = AnimElem = 8
trigger4 = AnimElem = 18
trigger5 = AnimElem = 19
trigger6 = AnimElem = 20
attr = S, HA
;damage = 40,4
damage = ceil(ifElse(fvar(11) * 40 < 10, 10, fvar(11) * 40)), 4
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 6,8
guard.pausetime = 6,8
sparkno = s7030
guard.sparkno = s7000
sparkxy = -25,-50
hitsound   = s5, 5
guardsound = S6,0
animtype = Hard     
air.animtype = Back
ground.type = Low
ground.slidetime = 25
ground.hittime = 25
ground.velocity = -4,0
guard.velocity = -9
air.velocity = -4,-6
fall = 0
fall.recover = 0
air.fall = 1
air.animtype = back
getpower= 0, 0
givepower = 20,20
yaccel = 0.45
envshake.time = 16
envshake.ampl = 3
envshake.freq = 100
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
kill = 0

[State 420, 3]
type = HitDef
trigger1 = AnimElem = 27
trigger2 = AnimElem = 32
trigger3 = AnimElem = 36
attr = A, HA
;damage = 40,4
damage = ceil(ifElse(fvar(11) * 40 < 10, 10, fvar(11) * 40)), 4
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 6,8
guard.pausetime = 6,8
sparkno = s7030
guard.sparkno = s7000
sparkxy = -25,-80
hitsound   = s5, 5
guardsound = S6,0
animtype = Up
ground.type = high
ground.slidetime = 25
ground.hittime = 25
ground.velocity = 0,-9.5
guard.velocity = -6
air.velocity = 0,-6
kill = 0
fall = 1
fall.recover = 0
air.fall = 1
air.animtype = up
getpower= 0, 0
givepower = 20,20
yaccel = 0.45
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 420, 3]
type = HitDef
trigger1 = AnimElem = 41
ID = 2500
attr = A, HA
;damage = 80,4
damage = ceil(ifElse(fvar(11) * 80 < 10, 10, fvar(11) * 80)), 4
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 15,2
guard.pausetime = 15,2
sparkno = s7030
guard.sparkno = s7000
sparkxy = -25,-80
hitsound   = s5, 6
guardsound = S6,1
animtype = Diagup
ground.type = Low
ground.slidetime = 0
ground.hittime = 0
guard.slidetime = 25
guard.hittime = 25
ground.velocity = -1,-9.5
guard.velocity = -9
air.velocity = -1,-9
fall = 1
fall.recover = 0
air.fall = 1
air.animtype = Diagup
getpower= 0, 0
givepower = 20,20
yaccel = 0.45
envshake.time = 16
envshake.ampl = 6
envshake.freq = 100
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
kill = (var(39)<300)
;p2stateno = 2502

[State 0, TargetState]
type = TargetState
;trigger1 = AnimElem = 41
trigger1 = movehit = 1
trigger1 = numtarget(2500)
trigger1 = !(target(2500), ishelper)
value = 2502
ignorehitpause = 1
persistent = 0

;Piccolo compatibility
[State 0, Explod]
type = Explod
trigger1 = !NumExplod(991901)
trigger1 = MoveHit = 1
anim = 5939
ID = 991901
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = -1
removetime = -1
removeongethit = 1

[State 3000, width]
type = width
trigger1 = AnimElemTime(44) >=0
player = 50,0

[State 200, Death Beam voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = AnimElem = 41
value = 2000,5
volume = 355
channel = 0

[State 200, Death Beam voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=English
trigger1 = AnimElem = 41
value = 2500,1
volume = 355
channel = 0

[State 0]
type = playsnd
trigger1 = animelemtime(6) = 0
trigger2 = animelemtime(18) = 0
trigger3 = animelemtime(36) = 0
value = 0,10

[State 0]
type = playsnd
trigger1 = animelemtime(27) = 0
trigger2 = animelemtime(32) = 0
value = 0,4

[State 0]
type = playsnd
trigger1 = animelemtime(40) = 0
value = 0,12

[State 0]
type = playsnd
trigger1 = animelemtime(11) = 0
trigger2 = animelemtime(23) = 0
value = 40,2

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(2) = 0
trigger2 = animelemtime(14) = 0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1

[state 1215, Land FX]
type = explod
trigger1 = animelemtime(11) = 0
trigger2 = animelemtime(23) = 0
anim = 17100
pos = 0,0
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
ignorehitpause = 1

[State 0]
type = Velset
trigger1 = AnimElemTime(2) >= 0
x = (15*exp((-0.1225)*(time-60)))

[State 0]
type = velset
trigger1 = animelemtime(11)= 0
trigger2 = animelemtime(23)= 0
x = 0

[State 0]
type = Velset
trigger1 = AnimElemTime(14) >= 0
x = (12*exp((-0.1225)*(time-87)))

[State 0]
type = statetypeset
trigger1 = animelem = 29
statetype = A

[State 10230, Superjump Sound]
type = playsnd
trigger1 = animelem = 29
value = 0,24

[State 0]
type = velset
trigger1 = animelem = 29
y = -7
[State 0]
type = veladd
trigger1 = time > 120
y = .3

[State 105]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = ifElse((var(39)>=300) && (var(39)<600 && numtarget(2500)), 2900, 2501)
ctrl = 0

;----------------
;Tail Press Nightmare Land
[Statedef 2501]
type = C
physics = C
movetype = I
anim = 2401
ctrl = 0
velset = 0,0
sprpriority = 1

[State 0]
type = playsnd
trigger1 = animelemtime(1) = 0
value = 9,1

[state 1215, Land FX]
type = explod
trigger1 = animelemtime(1) = 0
anim = 17200
pos = 0,0
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
ignorehitpause = 1

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

; TIME TO GO TO THE FINISHERS !!!
; Finisher 1 : Daichiretsuzan (vertictal cut-in-half fatality)	: state = 2902
; Finisher 2 : Death Beam Barrage Maximum + Rock Slam		: state = 2800
; Finisher 3 : Supernova (blown to smithereens)					: state = 3010

[State 3000, FINISHER 1]
type = null;changestate
triggerall = numtarget(2500)
triggerall = (var(39)>=300) && (var(39)<600)
trigger1 = !animtime
value = 2900
ctrl = 0

[State 3000, FINISHER 2/3]
type = null;changestate
triggerall = p2stateno=2502 || p2stateno=2503 || p2stateno=2700 || p2stateno=2701
triggerall = (var(39)>=600)
trigger1 = animelem = 7
value = 3010
ctrl = 0

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

;-------------------------------------
;P2 custom state, sent away
[Statedef 2502]
type = A
movetype = H
physics = N
ctrl = 0
facep2 = 1

[State 0]
type = changeanim2
trigger1 = 1
value = 5051

[State 0]
type = changestate
trigger1 = hitshakeover
value = 2503

;-------------------------------------
;P2 custom state, sent away
[Statedef 2503]
type = A
movetype = H
physics = N
anim = ifelse(selfanimexist(5937),5937,ifelse(selfanimexist(5052),5052,5030))
ctrl = 0
facep2 = 1

[State 4005, vel]
type = velset
triggerall = enemy,var(39) < 300
trigger1 = !time
x = -2
y = -9

[State 4005, vel]
type = null;velset
triggerall = enemy,var(39) >= 300 && enemy,var(39) < 600
trigger1 = !time
x = -2
y = -5

[State 4005, vel - go out of screen for finisher 2/3]
type = null; velset
triggerall = enemy,var(39) >= 600
trigger1 = !time
x = -10
y = -4

[State 182, go out of screen for finisher 2/3]
type = null ;screenbound
triggerall = enemy,var(39) >= 600
trigger1 = 1
movecamera = 0,0
value = 0

[State 6100, turning snd]
type = playsnd
triggerall = anim=5937
trigger1 = !time
trigger2 = time = 10
trigger3 = time = 20
trigger4 = time = 30
trigger5 = time = 40
trigger6 = time = 50
trigger7 = time = 60
trigger8 = time = 70
trigger9 = time = 80
value = 21,1
persistent = 1

[state 17100, Flip KO FX]
type=explod
trigger1 = Anim=5937 && !numexplod(59370) && animelemtime(3)=0
anim = 5938
id = 5938
pos = 0,-50
postype = P1
sprpriority = 3
ownpal = 1
;supermovetime = -1
removetime = -1
persistent = 0
bindtime = -1
ignorehitpause = 1
 
[State 9011, VelAdd]
type = VelAdd
trigger1 = Pos Y < 0
y = 0.35
 
[State 9011, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 0, PalFX]
type = PalFX
trigger1 = !Time && Enemy, StateNo = 2925
time = 41
add = 255,50,0
sinadd = -255,-50,0,20

[State 9011, ChangeState]
type = SelfState
triggerall = enemy,var(39) < 300 || Enemy, StateNo = 2925
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 5100

[State 9011, ChangeState for Finisher 1]
type = null;ChangeState
triggerall = enemy,var(39) >= 300 && enemy,var(39) < 600
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 2700

[State 9011, ChangeState for Finishers 2/3]
type = null; ChangeState
triggerall = enemy,var(39) >= 600
;trigger1 = (Pos Y >= 0) && (Vel Y > 0)
trigger1 = P2StateNo = 3011
value = 3000



;===========================================================================
; <<<<< SADISM MODE ACTIVATION >>>>>
; State : 2600
;===========================================================================

[Statedef 2600]
type = S
movetype = I
physics = S
anim = 2600 ;195
ctrl = 0
velset = 0,0
sprpriority = 2
poweradd = -2000

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = !time
value = 196,(random%3)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=1		;Voice=English
trigger1 = !time
value = 195,2 + (random%8)
channel = 0

[State 200, 1];Dreadful Realization
type = PlaySnd
trigger1 = !time
value = 2600,0

[State 200, 1];crack
type = PlaySnd
trigger1 = animelem = 5
trigger2 = animelem = 6
value = 1,1

[State 181, 1];Laugh
type = PlaySnd
trigger1 = AnimElemTime(11)=0
value = 182, 0

[State 200, BGPalFX]
type = BGPalFX
trigger1 = 1
time = 1
add	= -100,-100,-100
mul	= 256,100,100
invertall = 0
color = 256

[State 3000, superpause]
type = superpause
trigger1 = animelemtime(4)=0
time = 198
p2defmul = 1
unhittable = 1
anim = -1
darken = 0
movetime = 198

[State 3000, nhb]
type = nothitby
trigger1 = animelemtime(4)>=0
time = 1
value = SCA

[State 3000, Sadism var]
type = varset
trigger1 = animelemtime(7)=0
var(50) = 1

[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;===========================================================================
; <<<<< DEATH CHARGE >>>>>
; State : 2680
;===========================================================================

[StateDef 2680]
type = S
MoveType = A
Physics = N
VelSet = 0, 0
SprPriority = 2 
ctrl = 0
poweradd = -3000
Anim = 2680

[State 250, Save sadism value]
type = VarSet
trigger1 = !time
var(4) = var(50)
[State 250, disable sadism mode]
type = null;VarSet
trigger1 = !time
var(50) = 0

[State 220, "shine" voice]
type = playsnd
triggerall = anim=2680
triggerall = var(55)=0		;Voice=Japan
trigger1 = animelem=3
value = 1400,5
channel = 0

[State 220, head charge voice]
type = playsnd
triggerall = anim=2680
triggerall = var(55)=1		;Voice=English
trigger1 = animelem=3
value = 1400,10+(random%2)
channel = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(3) >= 0
flag = noBG
flag2 = noFG

[State 3000, nhb]
type = nothitby
trigger1 = animelemtime(3) >= 0
time = 1
value = SCA

[State 200, Superpause sound]
type = PlaySnd
trigger1 = animelemtime(7) = 0
value = 2350,0

[State 3000, superpause]
type = superpause
trigger1 = animelemtime(3) = 0
time = 65
p2defmul = 1
unhittable = 1
anim = -1
darken = 0
movetime = 65

[State 0, Hyper Charge FX]
type = null;Explod
trigger1 = animelemtime(7) = 0
anim = 2440
id = 2440
pos = 25,-63
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 6
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0

[state 1215, Super Energy FX]
type = explod
trigger1 = animelemtime(7) = 0
anim = 2682
id = 2682
pos = 0,-53
postype = P1
sprpriority = -2
ownpal = 1
removetime = -1
persistent = 0
ignorehitpause = 1
removeongethit = 1
supermovetime = 9999
pausemovetime = 9999
bindtime = -1

[State 901, to charge]
type = ChangeState
trigger1 = anim=2680
trigger1 = time > 70
value = 2681

;--------------------------
; Head Charge - charging to P2 state

[StateDef 2681]
type = A
MoveType = A
Physics = N
SprPriority = 2 
ctrl = 0
poweradd = 0
Anim = 2681

[State 250, camera]
type = null ;screenbound
trigger1 = 1
value = 1
movecamera = 0,1

[State 3050, width]
type = width
trigger1 = anim = 2681
value = 20
ignorehitpause = 1

[State 250, head charge nova woosh]
type = PlaySnd
trigger1 = !time
value = 2681,0

[state 1215, Smoke FX]
type = explod
trigger1 = !time
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .7,.7

[state 17100, charge Effect]
type = explod
trigger1 = !numexplod(2681)
anim = 1505
id = 2681
pos = 20,-15
postype = P1
sprpriority = -3
ownpal = 1
supermovetime = -1
removetime = -1
removeongethit = 1

[State 3050, nothitby]
type = nothitby
trigger1 = anim = 2681
value = , NP, SP
time = 1
ignorehitpause = 1

[State 3050, Vel]
type = velset
trigger1 = anim = 2681
x = 16
y = 0
[State 3050, Vel]
type = velset
trigger1 = anim = 2681 && var(33) < 9
trigger1 = (movecontact = [1, 3]) || (movereversed = [1, 3])
x = 0
y = 0

[State 3050, Push]
type = playerpush
trigger1 = anim = 2681
trigger1 = movecontact > 8
value = 0
ignorehitpause = 1

[State 3050, hitvar]
type = varset
trigger1 = anim != 2681
trigger2 = !time
var(33) = 0
[State 3050, hitvar]
type = varadd
trigger1 = anim = 2681 && (movehit = 1 || moveguarded = 1 || movereversed = 1)
var(33) = 1

[State 12000, Hit]
type = HitDef
trigger1 = Anim = 2681
trigger1 = !(movecontact % 4) && var(33) < 8
attr = A, HA
hitflag = MAF
guardflag = M
animtype = Hard
priority = 4, Hit
;damage = ceil((200.0 + var(4)/6.0)/(fvar(15) * 9.0)),7  ;from 200 to 350 damage - no dampener
;damage = ceil(ifElse(fvar(11) * (25.0 + (var(4)/6.0)) < 7, 7, fvar(11) * (25.0 + (var(4)/6.0)))), 7 ;original
damage = ceil(ifElse(fvar(11) * (25.0 + (var(4)/60.0)) < 17, 17, fvar(11) * (25.0 + (var(4)/60.0)))), 7 ;JNP Fix
pausetime = 4,8
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10,-55
hitsound = s1500,0
guardsound = s6,0
ground.type = High
ground.slidetime = 17
ground.hittime = 17
ground.velocity = -3,-8
guard.velocity = -3
air.velocity = -2,-8
getpower = 0,0
givepower = 35,35
yaccel = .5
envshake.time = 14
envshake.freq = 80
envshake.ampl = 7
palfx.add = 255,50,0
palfx.sinadd = -255,-50,0,20
palfx.time = 60
forcestand = 1
fall = 1
air.fall = 1
fall.recover = 0

[State 12000, Hit]
type = HitDef
trigger1 = Anim = 2681
trigger1 = !(movecontact % 4) && var(33) = 8
attr = A, HA
hitflag = MAF
guardflag = M
;animtype = Hard
animtype = Diagup
fall.animtype = Diagup
priority = 4, Hit
;damage = ceil((150.0 + var(4)/6.0)/(fvar(15) * 9.0)),7  ;from 150 to 300 damage - no dampener
damage = ceil(ifElse(fvar(11) * (150.0 + (var(4)/6.0)) < 15, 15, fvar(11) * (150.0 + (var(4)/6.0)))), 7
pausetime = 4,8
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10,-55
hitsound = s1500,0
guardsound = s6,0
ground.type = High
ground.slidetime = 17
ground.hittime = 17
ground.velocity = -3,-12
guard.velocity = -3
air.velocity = -2,-12
air.type = low
getpower = 0,0
givepower = 35,35
yaccel = .5
envshake.time = 14
envshake.freq = 80
envshake.ampl = 7
palfx.add = 255,50,0
palfx.sinadd = -255,-50,0,20
palfx.time = 80
forcestand = 1
fall = 1
air.fall = 1
fall.recover = 0

[state -2, helper]
type = helper
trigger1 = numtarget && movehit
trigger1 = (target,movetype=H) && (time%40)=1 ;&& !(target,time) && !numhelper(8600)
pos = 0,0
postype = left
stateno = 8600
ID = 8600
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[state 17100, remove charge FX]
type = removeexplod
trigger1 = Anim != 2681
ID = 2681

;------------------------
; HIT
[State 901, has hit]
type = ChangeAnim
trigger1 = anim=2681
trigger1 = time > 60 || FrontEdgeBodyDist < 20
value = 1510

[State 280, go if hit]
type = VelSet
triggerall = anim=1510
trigger1 = animelemtime(1) = 0 
X = -1.5
Y = -5

[State 280, go]
type = VelAdd
triggerall = anim=1510
trigger1 = animelemtime(1) > 0 
Y = 0.45

[State 280, go]
type = VelMul
triggerall = anim=1510
trigger1 = animelemtime(1) > 0 
X = 0.95

[State 17100, Dismount Sound]
type = PlaySnd
triggerall = anim=1510
trigger1 = animelemtime(1) = 0
value = 1510, 0

[State 3300, land anim]
type = changeanim
trigger1 = anim=1510 && animelemtime(2)>0 && pos y>=-5
value = 48
persistent = 0

;------------------------
; LAND
[State 3300, sts]
type = statetypeset
trigger1 = anim = 48
statetype = S
physics = N

[State 3300, sts]
type = velmul
trigger1 = anim = 48
x = 0.8

[State 3300, stop]
type = posset
trigger1 = anim = 48
y = 0
[State 3300, stop]
type = velset
trigger1 = anim = 48
y = 0

[state 17100, Landing Effect]
type = explod
trigger1 = anim = 48
trigger1 = animelemtime(1) = 0
anim = 17100
id = 17100
pos = 0,0
postype = P1
sprpriority = -3
ownpal = 1
supermovetime = -1

[State 240, landing sound]
type = PlaySnd
trigger1 = anim = 48
trigger1 = animelemtime(1) = 0
value = 40, 0

[State 3300, end]
type = changestate
trigger1 = anim = 48 && !animtime
value = 0
ctrl = 1

;===========================================================================
; <<<<< CUSTOM STATE : P2 getting up for Fatality >>>>>
; State : 2700
;===========================================================================

; Downed get-hit (hit ground from fall)
[Statedef 2700]
type    = L
movetype= H
physics = N

[State 5100, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 2710 ;Downed get-hit (lying down)

[State 5100, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 2701 ;Downed get-hit (bounce off ground)

;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 2701]
type    = L
movetype= H
physics = N

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5101, 4]
type = PosSet
trigger1 = Time = 0
y = 20

[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = 1
y = .4

[State 5101, 6] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 12
type = ChangeState
value = 2710

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 2710]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 13] ;Friction
type = ChangeState
trigger1 = time=40
value = 2720
ctrl = 0

;-------------------------------------
;P2 Get up
[Statedef 2720]
type    = L
movetype= H
physics = N

[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5120, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, 2]
type = VelSet
trigger1 = Time = 0
x = 0

[State 5120, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 5120, 4]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5120, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value = SCA
time = 3

[State 5120, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 2730
ctrl = 0

;------------------------------------------------
[StateDef 2730] ;P2 Dizzy
type = S
movetype = H
physics = S
velset = 0,0
ctrl = 0
anim = 5300
sprpriority = -1

;FUCKING SHIN GOUKI HACK !!! >:(
[State 13200, Anim]
type = ChangeAnim2
trigger1 = Time=0 && name="Shin Gouki" && authorname="Phantom.of.the.Server"
value = 2731

;FUCKING WAR MACHINE HACK !!! >:(
[State 13200, Anim]
type = ChangeAnim2
trigger1 = Time=0 && name="Marvel vs. Capcom's WarMachine" && authorname="One Winged Angel"
value = 2732


;===========================================================================
; <<<<< FINISHER 2 : DEATH BEAM BARRAGE MAXIMUM >>>>>
; State								2800
; Crack neck for fun				2801
; Barrage startup					2802
; Dash Back in case too close		2803-2804
; Torture Gun hitting and loops		2805
; Torture Gun recovery				2807
; HELPER - Beam (normal/up/down)	2810-2811-2812
; P2 hit by barrage					2815
; P2 collapse						2820
;===========================================================================

[Statedef 2800]
type = S
movetype = I
physics = S
anim = 451
ctrl = 0
velset = 0,0
sprpriority = 2
poweradd = 0

[State 0, PosSet]
type = PosSet
trigger1 = !time
x = -105 * facing

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noBG
flag2 = noFG
flag3 = nobardisplay

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

[State 10230, Teleport Sound]
type = playsnd
trigger1 = animelemtime(1)=0
trigger2 = animelemtime(2)=0
value = 2302,0
persistent = 1

[State 41, Train]
type = AfterImage
trigger1 = Time = 0
time= 30
timegap= 1
framegap= 3
length= 12
palbright= 0,0,0
paladd= 0,0,0
palmul= .9,.9,.9
palcontrast= 120,120,120
palpostbright= 0,0,0
trans= add1

[State 13200, Anim]
type = ChangeState
trigger1 = !animtime
value = 2801
ctrl = 0

;-----------------------------------------
; Crack the neck for fun

[Statedef 2801]
type = S
ctrl = 0
anim = 2801
velset = 0,0
movetype = I
physics = S
sprpriority = 2

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noBG
flag2 = noFG
flag3 = nobardisplay


[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = !time
value = 196,(random%3)

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=1		;Voice=English
trigger1 = !time
value = 193,0

[State 890, 2];lips
type = Explod
trigger1 = animelem = 6
Anim = 18201
id = 18201
postype = P1
pos = 0,0
bindtime = -1
sprpriority = 4
ownpal = 1
removetime = -2
persistent = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = animelem = 7
id = 18201

[State 195, dash back if close to border (deprecated)]
type = null;ChangeState
trigger1 = FrontEdgeBodyDist < 90
trigger1 = AnimTime = 0
value = 2803
ctrl = 0

[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 2802
ctrl = 0


;-----------------------------------------
;barrage startup

[Statedef 2802]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 2000
ctrl = 0
sprpriority = 2
faceP2 = 1

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noBG
flag2 = noFG
flag3 = nobardisplay

[State 3000, width]
type = width
trigger1 = 1
value = 15,0

[State 1100, Set count variable]
type = VarSet
trigger1 = !time
var(34) = 0

[State 1800, startup finished]
type = PlaySnd
trigger1 = anim=2000 & animelemtime(3)=2
value = 2805,2

[State 1800, startup finished]
type = changestate
trigger1 = anim=2000 & animelemtime(3)=2
value = 2805

;----------------------
;Torture Gun hitting & loops
[Statedef 2805]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 1800
ctrl = 0
sprpriority = 2
faceP2 = 1

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

[State 1100, Counting loops]
type = VarAdd
trigger1 = !time
var(34) = 1

[State 2201, helper]; Background lines
type = Helper
trigger1 = !time && !numhelper(2937)
pos = -640, -480
postype = back
stateno = 37010
helpertype = normal
name = "horizontal_lines_BG"
id = 2937
ownpal = 1
supermovetime = 9999 ;150
pausemovetime = 9999 ;150
sprpriority = 2
size.xscale = 5
size.yscale= 5

[state Spark]
type = null;explod
trigger1 = !time
anim = 1810
pos = 51, -65
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
removeongethit = 1

[State 200, Flash SFX]
type = PlaySnd
trigger1 = animelem=1 || animelem=3 || animelem=5
value = 1800,0
persistent = 1

[state 1215, Smoke FX]
type = explod
trigger1 = !time
trigger1 = animelem=1 || animelem=3 || animelem=5
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 1
ignorehitpause = 1

[State 3000, beam helper normal]
type = helper
trigger1 = animelem=1
helpertype = normal
stateno = 2810
ID = 2810
name = "Torture_Beam"
postype = p1
ownpal = 1
persistent = 1

[State 3000, beam helper up]
type = helper
trigger1 = animelem=3
helpertype = normal
stateno = 2811
ID = 2810
name = "Torture_Beam"
postype = p1
ownpal = 1
persistent = 1

[State 3000, beam helper down]
type = helper
trigger1 = animelem=5
helpertype = normal
stateno = 2812
ID = 2810
name = "Torture_Beam"
postype = p1
ownpal = 1
persistent = 1

[State 8000, var]
type = varset
trigger1 = !time && prevstateno!=2805
var(40)=0
ignorehitpause = 1
[State 8000, var]
type = varadd
trigger1 = animelemtime(5)>0 && var(40)<=200
var(40)=1
ignorehitpause = 1

[State 1800, looping]
type = changestate
triggerall = !animtime
trigger1 = var(34)<=20
value = 2805
ctrl = 0

[State 1800, finish state]
type = changestate
triggerall = !animtime
trigger1 = var(34) > 20 ;too many loops
value = 2807
ctrl = 0

;----------------------
;Torture Gun recovery
[Statedef 2807]
type    = S
movetype= A
physics = N
juggle  = 0
velset = 0,0
anim = 1805
ctrl = 0
sprpriority = 2
faceP2 = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noBG
flag2 = noFG
flag3 = nobardisplay

[State 3000, end]
type = changeanim
trigger1 = !animtime && anim = 1805
value = 181

[State 3000, end]
type = changestate
trigger1 = enemy, anim = 5110
trigger2 = enemy, anim = 5111
trigger3 = enemy, anim = 5112
value = 2808


;----------------------
;TK Slam Startup
[Statedef 2808]
anim = 2808

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(9) <= 0
flag = noBG
flag2 = noFG
flag3 = nobardisplay

[State 13100, TK grab]
type = playsnd
trigger1 = animelemtime(7)=0
value = 2808,0
volume = 500

[State 182, allow to go out of screen]
type = screenbound
trigger1 = AnimElemTime(7) >=0 && AnimElemTime(9) < 0
movecamera = 0,0
value = 0

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(7) = 10
x = -3.5

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(7) = 30
x = 0

[State 0, VelSet]
type = VelSet
trigger1 = Time = 137
y = 15

[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 8
y = 0

[State 3000, Rock slam]
type = helper
trigger1 = numtarget
trigger1 = target, stateno = 2821 && target, vel y = 0
helpertype = normal
stateno = 12821
ID = 12821
name = "ROCK SLAM"
postype = p2
ownpal = 1
persistent = 0

[State 2302, teleport pause]
type = pause
trigger1 = animelemtime(10)=0
time = 9
movetime = 9
ignorehitpause = 1

[State 10230, Teleport Sound]
type = playsnd
trigger1 = animelemtime(10)=0
trigger2 = animelemtime(11)=0
value = 2302,0
persistent = 1

[State 0, PosSet]
type = PosSet
trigger1 = AnimElem = 8
x = -70 * facing
y = 0

[State 0, HitAdd]
type = HitAdd
trigger1 = Time = 104
value = 1

[State 0, HitAdd]
type = HitAdd
trigger1 = AnimElemTime(14) >= 0
trigger1 = numhelper(12821)
trigger1 = (helper(12821), pos y) - 30 > -(helper(12821), vel y)
value = 1
persistent = 0

[State 0, TargetState]
type = TargetState
trigger1 = AnimElemTime(14) >= 0
trigger1 = numhelper(12821)
trigger1 = (helper(12821), pos y) - 30 > -(helper(12821), vel y)
value = ifElse(Enemy, Life <= 161 && roundno>=2, 2825, 2822)
persistent = 0

[State 0, Explod]
type = Explod
trigger1 = !(Enemy, Life <= 40 && roundno>=2) ;!(Enemy, Life <= 161 && roundno>=2)
trigger1 = AnimElemTime(14) >= 0
trigger1 = numhelper(12821)
trigger1 = (helper(12821), pos y) - 30 > -(helper(12821), vel y)
anim = 2210
postype = p2

[State 0, Explod]
type = Explod
trigger1 = Enemy, Life <= 40 && roundno>=2 ;Enemy, Life <= 161 && roundno>=2
trigger1 = AnimElemTime(14) >= 0
trigger1 = numhelper(12821)
trigger1 = (helper(12821), pos y) - 30 > -(helper(12821), vel y)
anim = 28250
postype = p2
pos = 0,5

[State 0, Explod]
type = Explod
trigger1 = Enemy, Life <= 40 && roundno>=2 ;Enemy, Life <= 161 && roundno>=2
trigger1 = AnimElemTime(14) >= 0
trigger1 = numhelper(12821)
trigger1 = (helper(12821), pos y) - 30 > -(helper(12821), vel y)
anim = 28250
postype = p2
pos = -30,5

[State 0, Explod]
type = Explod
trigger1 = Enemy, Life <= 40 && roundno>=2 ;Enemy, Life <= 161 && roundno>=2
trigger1 = AnimElemTime(14) >= 0
trigger1 = numhelper(12821)
trigger1 = (helper(12821), pos y) - 30 > -(helper(12821), vel y)
anim = 28250
postype = p2
pos = 30,5

[State 0, Explod]
type = Explod
trigger1 = Enemy, Life <= 40 && roundno>=2 ;Enemy, Life <= 161 && roundno>=2
trigger1 = AnimElemTime(14) >= 0
trigger1 = numhelper(12821)
trigger1 = (helper(12821), pos y) - 30 > -(helper(12821), vel y)
anim = 28250
postype = p2
pos = -15,-10
sprpriority = -3

[State 0, Explod]
type = Explod
trigger1 = Enemy, Life <= 40 && roundno>=2 ;Enemy, Life <= 161 && roundno>=2
trigger1 = AnimElemTime(14) >= 0
trigger1 = numhelper(12821)
trigger1 = (helper(12821), pos y) - 30 > -(helper(12821), vel y)
anim = 28250
postype = p2
pos = 15,20
sprpriority = -3

[State 0, Explod]
type = Explod
trigger1 = Enemy, Life <= 40 && roundno>=2 ;Enemy, Life <= 161 && roundno>=2
trigger1 = AnimElemTime(14) >= 0
trigger1 = numhelper(12821)
trigger1 = (helper(12821), pos y) - 30 > -(helper(12821), vel y)
anim = 28250
postype = p2
pos = -15,20
sprpriority = -3

[State 0, Explod]
type = Explod
trigger1 = Enemy, Life <= 40 && roundno>=2 ;Enemy, Life <= 161 && roundno>=2
trigger1 = AnimElemTime(14) >= 0
trigger1 = numhelper(12821)
trigger1 = (helper(12821), pos y) - 30 > -(helper(12821), vel y)
anim = 28250
postype = p2
pos = 15,-10
sprpriority = -3

;Piccolo compatibility
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !animtime
id = 991901

[State 3000, end]
type = changestate
trigger1 = !AnimTime
value = 0
ctrl = 1


;------------------------------------------------
; P2 hit by barrage
[StateDef 2815]
type = S
movetype = H
physics = S
velset = 0,0
ctrl = 0
anim = 5000+(random%3)+(10*(random%2))
sprpriority = -1

[State 13200, Anim]
type = PosSet
trigger1 = 1
Y = 0

[State 8000, getting burned]
type = PalFX
trigger1 = enemy,var(40)<120
add = -ceil(enemy,var(40)*1.0/2.0), -ceil(enemy,var(40)*1.0/2.0), -ceil(enemy,var(40)*1.0/2.0)
color = 256-(enemy,var(40))
time = 100000
ignorehitpause = 1

[State 8000, getting burned]
type = PalFX
trigger1 = enemy,var(40)>=120
add = -60,-60,-60
color = 120
time = 100000
ignorehitpause = 1

[State 901, go to collapse]
type = ChangeState
trigger1 = enemy,stateno = 2807
value = 2820

;------------------------------------------------
; P2 collapse (from Oswald_WLS)
[StateDef 2820]
type = S
movetype = H
physics = S
velset = 0,0
ctrl = 0
sprpriority = -1

;Common Collapse (Cheap KO)
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = !Time
trigger1 = SelfAnimExist(5950)
value = 5950

;Common Collapse (Real Collapse)
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = !Time
trigger1 = SelfAnimExist(5955)
value = 5955

;Ironmugen (I hope :P)
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "David Demianoff"
triggerAll = !Time
trigger1 = SelfAnimExist(6010)
value = 6010

;KOD, WDA & Sepp
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "K.O.D" || AuthorName = "Sepp" || AuthorName =  "K.O.D & Vans"
triggerAll = !Time
trigger1 = SelfAnimExist(5400)
value = 5400

;Fervicante
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "Fervicante"
triggerAll = !Time
trigger1 = SelfAnimExist(5800)
value = 5800

;Juke Kisaragi
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "Juke Kisaragi"
triggerAll = !Time
trigger1 = SelfAnimExist(9219)
value = 9219

;OrochiKOF97
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "OrochiKOF97"
triggerAll = !Time
trigger1 = SelfAnimExist(5130)
value = 5130

[State 2820, ChangeAnim2]
type = ChangeAnim2
triggerAll = !Time
trigger1 = Anim != 5950 && Anim != 5955
trigger1 = Anim != 5400
trigger1 = Anim != 9219
trigger1 = Anim != 6010
trigger1 = Anim != 5800
trigger1 = Anim != 5130
value = 2820

[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = Anim != 9219
trigger1 = !AnimTime
trigger2 = AnimElemTime(AnimElemNo(0) + 1) = 0
value = ifElse((Anim = 5950 && SelfAnimExist(5112) || Anim = 5955 && SelfAnimExist(5112) || Anim = 5400 && SelfAnimExist(5112) || Anim = 6010 && SelfAnimExist(5112) || Anim = 5800 && SelfAnimExist(5112) || Anim = 5130 && SelfAnimExist(5112)), 5112, 5110)
persistent = 0

[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = Anim = 9219
trigger1 = !AnimTime
trigger2 = AnimElemTime(AnimElemNo(0) + 1) = 0
value = ifElse((Anim = 9219 && SelfAnimExist(5111)), 5111, 5110)
persistent = 0

[State 0, Turn] ;Satan hack
type = Turn
trigger1 = Anim = 5110
trigger1 = Name = "Satan Z2" || Name = "Shin Satan Z2"
trigger1 = Authorname = "Team Z2"
;ignorehitpause =
persistent = 0						   
[State 901, lie dead and wait]
type = ChangeAnim
triggerAll = Anim = 2820
trigger1 = !AnimTime
trigger2 = AnimElemTime(AnimElemNo(0) + 1) = 0
value = 5150

[State 5100, 10]
type = PlaySnd
trigger1 = anim = 2820 && !AnimTime
value = F7,0
channel = 1

[State 5100, Explod]
type = Explod
trigger1 = anim = 2820 && !AnimTime
anim = F60
pos = 0,0
postype = p1
sprpriority = -3
ownpal = 1

[State 901, TK Slam]
type = PalFX
trigger1 = enemy, stateno = 2808
trigger1 = enemy, animelem = 6
time = 0

[State 901, TK Slam]
type = ChangeState
trigger1 = enemy, stateno = 2808
trigger1 = enemy, animelem = 6
value = 2821

[State 901, alive]
type = SelfState
trigger1 = time > 300
value = 5120



;TK Slam
[StateDef 2821]
type = A
movetype = H
physics = N

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = SelfAnimExist(5051)
value = 5051

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
trigger1 = !SelfAnimExist(5051)
value = 2821

[State 182, allow to go out of screen]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 0, VelSet]
type = VelSet
trigger1 = !Time
y = -4

[State 0, VelAdd]
type = VelAdd
trigger1 = vel y < 0
y = 0.1

[State 0, VelSet]
type = VelSet
trigger1 = vel y >= 0
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = enemy, AnimElemTime(7) = 10
x = ifElse(Facing = Enemy, Facing, -3.5, 3.5)

[State 0, VelSet]
type = VelSet
trigger1 = enemy, AnimElemTime(7) = 30
x = 0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = Time = 56
value = 15997

[State 0, PosAdd]
type = PosAdd
trigger1 = Time = 114
x = ifElse(Facing = Enemy, Facing, 50, -50)


;Hit ground from rock slam
[StateDef 2822]
type = L
moveType = H
physics = N

[State 0, LifeAdd]
type = LifeAdd
trigger1 = !Time && PrevStateNo != 3105
value = -80 ;-40 ;-161
kill = 1

[State 2822, FallEnvShake]
type = FallEnvShake
trigger1 = !Time

[State 2822, VarSet]
type = VarSet
trigger1 = !Time
sysvar(1) = floor(-100)

[State 2822, ChangeAnim]
type = ChangeAnim
triggerAll = !Time
trigger1 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = !SelfAnimExist(5100 + (Anim % 10))
value = 5100

[State 2822, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = (Anim = [5051, 5059]) || (Anim = [5061, 5069])
trigger1 = SelfAnimExist(5100 + (Anim % 10))
value = 5100 + (Anim % 10)

[State 2822, PosSet]
type = PosSet
trigger1 = !Time
y = 0

[State 2822, VelSet]
type = VelSet
trigger1 = !Time
y = 0

[State 2822, VelMul]
type = VelMul
trigger1 = !Time
x = 0.75

[State 2822, Explod]
type = Explod
trigger1 = Time = 1
anim = F(60 + (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56)))
pos = 0,0
sprPriority = ifElse(sysvar(1) <= Const720p(56), -10, 10)

[State 2822, HitFallDamage]
type = HitFallDamage
trigger1 = Time = 3

[State 2822, PlaySnd]
type = PlaySnd
trigger1 = Time = 1
value = F7, (sysvar(1) > Const720p(20)) + (sysvar(1) > Const720p(56))

[State 2822, PosFreeze]
type = PosFreeze
trigger1 = 1

[State 2822, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 2823


;Bounce off ground)
[StateDef 2823]
type  = A
moveType = H
physics = N

[State 2823, ChangeAnim]
type = ChangeAnim
triggerAll = !Time
trigger1 = Anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (Anim % 10))
value = 5160

[State 2823, ChangeAnim]
type = ChangeAnim
triggerAll = !Time
trigger1 = Anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (Anim % 10))
value = 5160 + (Anim % 10)

[State 2823, VelSet]
type = VelSet
trigger1 = !Time
x = ifElse(Facing = Enemy, Facing, 1.75, -1.75)
y = -10.875

[State 2823, PosSet]
type = PosSet
trigger1 = !Time
y = const(movement.down.bounce.offset.y)

[State 2823, PosAdd]
type = PosAdd
trigger1 = !Time
x = const(movement.down.bounce.offset.x)

[State 2823, VelAdd]
type = VelAdd
trigger1 = Time > 0
y = const(movement.down.bounce.yaccel)

[State 2823, SelfState]
type = SelfState
trigger1 = vel y > 0
trigger1 = pos y >= const(movement.down.bounce.groundlevel)
value = 5100

;;Hit ground from rock slam (fatality)
[Statedef 2825]
type    = L
movetype= H
physics = N
velset = 0,0

[State 0, LifeAdd]
type = LifeAdd
trigger1 = !Time
value = -161
kill = 1

[State 5080, 1] ;Set default anim
type = VarSet
trigger1 = time = 0
sysvar(2) = 5080

[State 5080, 2]
type = VarAdd
trigger1 = time = 0
trigger1 = (anim = [5081,5089]) || (anim = [5111,5119])
trigger1 = SelfAnimExist(sysvar(2) + (anim % 10))
sysvar(2) = anim % 10

[State 5080, 3] ;Freeze
type = ChangeAnim
trigger1 = 1
value = sysvar(2)

[State 5080, 4]
type = SelfState
trigger1 = HitShakeOver
value = 5081




;===========================================================================
; <<<<< FINISHER 1 : Daichiretsuzan (vertictal cut-in-half fatality) >>>>>
; State										2900
; Crack neck for fun						2901
; Charging finisher							2902
; Launching finisher						2903
; HELPER - slash hit						2905
; HELPER - red and white flash screen		2906
; P2 hit by slash (not killed)				2907
; P2 hit by slash (cut in half fatality)	2910
; Falling back on ground					2920
; Freeza Land								2921
; Force Choke								2925
;===========================================================================

[Statedef 2900]
type = C
physics = C
movetype = I
anim = 2900
ctrl = 0
velset = 0,0
sprpriority = 1

[State 0]
type = playsnd
trigger1 = animelemtime(1) = 0
value = 9,1

[state 1215, Land FX]
type = explod
trigger1 = animelemtime(1) = 0
anim = 17200
pos = 0,0
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
ignorehitpause = 1

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

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

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = AnimElem = 13
value = 196,(random%3)

[State 200, 1];voice "nothing left to bury"
type = PlaySnd
triggerall = var(55)=1		;Voice=English
trigger1 = AnimElem = 13
value = 2902,0   ;195,(random%8)

; Dizzy stars when opponent gets up
[State 3025, dizzyfx]
type = helper
trigger1 = numhelper(2534) < 1
trigger1 = target,stateno = 2730
helpertype = normal
stateno = 2534
ID = 2534
name = "Dizzy FX"
postype = p1
ownpal = 1
facing = -1
size.ground.front = 0
size.ground.back = 0
ignorehitpause = 1
persistent = 0

[State 890, 2];lips
type = Explod
trigger1 = animelem = 13
Anim = 18201
id = 18201
postype = P1
pos = 0,0
bindtime = -1
sprpriority = 4
ownpal = 1
removetime = -2
persistent = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = target,stateno = 2730 && enemy, time = 60
id = 18201

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = target,stateno = 2730 && enemy, time = 60
value = 2900
elem = 14
persistent = 0

[State 13200, Anim]
type = ChangeState
trigger1 = !AnimTime
value = 2902
ctrl = 0

;-----------------------------------------
; Crack the neck for fun

[Statedef 2901]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

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

[State 200, 1];crack
type = PlaySnd
trigger1 = animelem = 5
trigger2 = animelem = 6
value = 1,1

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = !time
value = 196,(random%3)

[State 200, 1];voice "nothing left to bury"
type = PlaySnd
triggerall = var(55)=1		;Voice=English
trigger1 = !time
value = 2902,0   ;195,(random%8)

[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 2902
ctrl = 0

;-----------------------------------------
; Charging Cut Wave Finisher 1

[Statedef 2902]
type = S
physics = S
movetype = A
anim = 2902
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1

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

[State 40, 4]
type = Width
trigger1 = 1
edge = 0, 30

[State 100, jump SND]
type = playsnd
trigger1 = !time
value = 40,1

[state 1215, Rising Effect]
type = explod
trigger1 = !time
anim = 1216
id = 1216
pos = 10,12
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
supermovetime = 9999
pausemovetime = 9999
persistent = 0
ignorehitpause = 0

[State 40, 4]
type = VelSet
trigger1 = Time = 0
x = 0
y = const(velocity.jump.y)/1.2

[State 40, 4]
type = VelSet
trigger1 =  animelemtime(3)=0
x = 0
y = 0

[State 2200, sts]
type = statetypeset
trigger1 = animelemtime(1)>0
physics = N
statetype = A

[State 3000, end]
type = changestate
trigger1 = (anim = 2902) && (time > 130)
trigger1 = target, stateno = 2730
value = 2903
ctrl = 0


;------------------------------------
; Launching Cut Wave Finisher 1

[Statedef 2903]
type = A
physics = N
movetype = A
anim = 2901
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1

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

[State 810, fatality END variable]
type = varset
trigger1 = !time
var(25) = 0
[State 810, fatality END variable]
type = varset
trigger1 = enemy,life <= 57
trigger1 = roundno>=2
var(25) = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noBG
flag2 = noFG
flag3 = nobardisplay

[State 200, woosh]
type = PlaySnd
trigger1 = !time
value = 2900,0
channel = 1

[State 40, 4]; Rebound in air
type = VelSet
trigger1 = animelemtime(3)=0
x = const(velocity.jump.back.x)/3
y = const(velocity.jump.y)/2.0

[State 280, fall back]
type = VelAdd
trigger1 = animelemtime(5)>=0
Y = 0.45

[State 3000, hit slash helper]
type = helper
trigger1 = animelem=3
helpertype = normal
stateno = 2905
ID = 2905
name = "finisher_1_help"
postype = p1
pos = 0,0
ownpal = 1

[State 810, if P2 killed & end match]
type = TargetState
trigger1 = var(25)=1
value = 2910

[State 810, if P2 not killed - collapse]
type = TargetState
trigger1 = var(25)=0
value = 2907

[State 3000, black/white FLASH helper]
type = helper
trigger1 = !numhelper(2906) ;&& var(25)=1
helpertype = normal
stateno = 2906
ID = 2906
name = "flash"
postype = p1
pos = 0,0
ownpal = 1

[state 1600, Cut in half FX]
type = explod
trigger1 = !numexplod(2904)
anim = 2904
id = 2904
pos = 0,0
postype = P2
sprpriority = 9
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
facing = -1
bindtime = 1

[state 1600, Cut in half FX for P1]
type = explod
trigger1 = numexplod(2904)
anim = 2903
id = 2903
pos = 0,0
postype = P1
sprpriority = 9
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
bindtime = 1

[state 1600, Cut in half overlay FX]
type = null;explod
trigger1 = numhelper(2906)
anim = 2906
id = 2906
pos = 0,0
postype = P2
sprpriority = 9
ontop = 1
ownpal = 1
removetime = -1
persistent = 0
ignorehitpause = 1
scale = 1,10
bindtime = -1

[State 8000, black/white silouette]
type = PalFX
trigger1 = numhelper(2906)
add = 255,255,255
time = 1
under = 1
ignorehitpause = 1

[State 3000, end]
type = changestate
trigger1 = AnimElem = 8
value = 2920
ctrl = 0

;--------------------------------
; P2 hit by slash and not killed

[Statedef 2907]
type    = S
movetype= H
physics = N
velset = 0,0
anim = 5002  ;hit hard anim

[State 8000, black/white silouette]
type = PalFX
trigger1 = enemy,numhelper(2906)
add = 255,255,255
time = 1
under = 1
ignorehitpause = 1

;Common Collapse (Cheap KO)
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = Time = 15
trigger1 = SelfAnimExist(5950)
value = 5950

;Common Collapse (Real Collapse)
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = Time = 15
trigger1 = SelfAnimExist(5955)
value = 5955

;Ironmugen (I hope :P)
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "David Demianoff"
triggerAll = Time = 15
trigger1 = SelfAnimExist(6010)
value = 6010

;KOD, WDA & Sepp
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "K.O.D" || AuthorName = "Sepp" || AuthorName =  "K.O.D & Vans"
triggerAll = Time = 15
trigger1 = SelfAnimExist(5400)
value = 5400

;Fervicante
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "Fervicante"
triggerAll = Time = 15
trigger1 = SelfAnimExist(5800)
value = 5800

;Juke Kisaragi
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "Juke Kisaragi"
triggerAll = Time = 15
trigger1 = SelfAnimExist(9219)
value = 9219

;OrochiKOF97
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "OrochiKOF97"
triggerAll = Time = 15
trigger1 = SelfAnimExist(5130)
value = 5130

[State 2820, ChangeAnim2]
type = ChangeAnim2
triggerAll = Time = 15
trigger1 = Anim != 5950 && Anim != 5955
trigger1 = Anim != 5400
trigger1 = Anim != 9219
trigger1 = Anim != 6010
trigger1 = Anim != 5800
trigger1 = Anim != 5130
value = 2820

[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = Anim != 9219 && Anim != 5002
trigger1 = !AnimTime
trigger2 = AnimElemTime(AnimElemNo(0) + 1) = 0
value = ifElse((Anim = 5950 && SelfAnimExist(5112) || Anim = 5955 && SelfAnimExist(5112) || Anim = 5400 && SelfAnimExist(5112) || Anim = 6010 && SelfAnimExist(5112) || Anim = 5800 && SelfAnimExist(5112) || Anim = 5130 && SelfAnimExist(5112)), 5112, 5110)
persistent = 0

[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = Anim = 9219 && Anim != 5002
trigger1 = !AnimTime
trigger2 = AnimElemTime(AnimElemNo(0) + 1) = 0
value = ifElse((Anim = 9219 && SelfAnimExist(5111)), 5111, 5110)
persistent = 0

[State 901, lie dead and wait]
type = ChangeAnim
triggerAll = Anim = 2820
trigger1 = !AnimTime
trigger2 = AnimElemTime(AnimElemNo(0) + 1) = 0
value = 5110

[State 5100, 10]
type = PlaySnd
trigger1 = anim = 2820 && !AnimTime
value = F7,0
channel = 1

[State 5100, Explod]
type = Explod
trigger1 = anim = 2820 && !AnimTime
anim = F60
pos = 0,0
postype = p1
sprpriority = -3
ownpal = 1

[State 901, alive]
type = SelfState
trigger1 = time > 300
value = 5120

;finisher 1 stuff
[State 8000, black/white silouette]
type = PalFX
triggerall = time > 15
trigger1 = enemy,numhelper(2906)
add = 255,255,255
time = 1
under = 1
ignorehitpause = 1

;[State 901, dead]
;type = SelfState
;triggerall = !alive
;trigger1 = time > 135
;value = 5150

[State 8000, flash]
type = PalFX
triggerall = alive
trigger1 = time > 135
time = 0

;[State 901, alive]
;type = SelfState
;triggerall = alive
;trigger1 = time > 135
;value = 5120


;--------------------------------
; P2 hit by slash and cut in half

; P2 collapse
[StateDef 2910]
type = S
movetype = H
physics = N
velset = 0,0
ctrl = 0
sprpriority = 3

[State 8000, black/white silouette]
type = PalFX
trigger1 = enemy,numhelper(2906)
add = 255,255,255
time = 1
under = 1
ignorehitpause = 1


[State 3000, REAL DEAL cut in half anim - left]
type = changeanim
triggerall = selfanimexist(9037) && selfanimexist(9038)
trigger1 = !time
value = 9037

[State 3000, REAL DEAL cut in half anim - left VEL]
type = velset
triggerall = selfanimexist(9037) && selfanimexist(9038)
trigger1 = !time
X = -0.5

[State 3000, Cut in half anim - right]
type = helper
triggerall = selfanimexist(9037) && selfanimexist(9038)
trigger1 = !numhelper(9038)
helpertype = normal
stateno = 9038
ID = 9038
name = "cut_right"
postype = p1
pos = 0,0
ownpal = 0

;Common Collapse (Cheap KO)
[State 2820, ChangeAnim]
type = ChangeAnim
triggerall = !selfanimexist(9037) && !selfanimexist(9038)
trigger1 = SelfAnimExist(5950)
value = 5950
elem = 1

;Common Collapse (Real Collapse)
[State 2820, ChangeAnim]
type = ChangeAnim
triggerall = !selfanimexist(9037) && !selfanimexist(9038)
trigger1 = SelfAnimExist(5955)
value = 5955
elem = 1

;Ironmugen (I hope :P)
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "David Demianoff"
triggerall = !selfanimexist(9037) && !selfanimexist(9038)
trigger1 = SelfAnimExist(6010)
value = 6010
elem = 1

;KOD, WDA & Sepp
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "K.O.D" || AuthorName = "Sepp" || AuthorName =  "K.O.D & Vans"
triggerall = !selfanimexist(9037) && !selfanimexist(9038)
trigger1 = SelfAnimExist(5400)
value = 5400
elem = 1

;Fervicante
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "Fervicante"
triggerall = !selfanimexist(9037) && !selfanimexist(9038)
trigger1 = SelfAnimExist(5800)
value = 5800
elem = 1

;Juke Kisaragi
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "Juke Kisaragi"
triggerall = !selfanimexist(9037) && !selfanimexist(9038)
trigger1 = SelfAnimExist(9219)
value = 9219
elem = 1

;OrochiKOF97
[State 2820, ChangeAnim]
type = ChangeAnim
triggerAll = AuthorName = "OrochiKOF97"
triggerall = !selfanimexist(9037) && !selfanimexist(9038)
trigger1 = SelfAnimExist(5130)
value = 5130
elem = 1

[State 2820, ChangeAnim2]
type = ChangeAnim2
triggerall = !selfanimexist(9037) && !selfanimexist(9038)
trigger1 = Anim != 5950 && Anim != 5955
trigger1 = Anim != 5400
trigger1 = Anim != 9219
trigger1 = Anim != 6010
trigger1 = Anim != 5800
trigger1 = Anim != 5130
value = 2820
elem = 1

[State 3000, vel Y]
type = velmul
trigger1 = 1
X = 0.92

;--------------------------------
; falling back to ground
[Statedef 2920]
type = A
physics = N
movetype = A
ctrl = 0
sprpriority = 1
facep2 = 1

[State 280, fall back]
type = VelAdd
trigger1 = 1
Y = 0.25

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = numhelper(2906)
flag = noBG
flag2 = noFG
flag3 = nobardisplay

[State 8000, black/white silouette]
type = PalFX
trigger1 = numhelper(2906)
add = 255,255,255
time = 1
under = 1
ignorehitpause = 1

[State 105]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 2921
ctrl = 0

;--------------------------------
; Freeza Land
[Statedef 2921]
type = C
physics = C
movetype = I
anim = 2921
ctrl = 0
velset = 0,0
sprpriority = 1

[State 8000, black/white silouette]
type = PalFX
trigger1 = numhelper(2906)
add = 255,255,255
time = 1
under = 1
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = numhelper(2906)
flag = noBG
flag2 = noFG
flag3 = nobardisplay

[State 0]
type = playsnd
trigger1 = animelemtime(1) = 0
value = 9,1

[state 1215, Land FX]
type = explod
trigger1 = animelemtime(1) = 0
anim = 17200
pos = 0,0
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
ignorehitpause = 1

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

[State 3000, P2 killed, force choke]
type = changestate
trigger1 = !animtime
value = 2925
ctrl = 0


;--------------------------------
; Freeza Force Choke
[Statedef 2925]
type = S
physics = S
movetype = A
anim = 2925
ctrl = 0
velset = 0,0
sprpriority = 1

[State 8000, black/white silouette]
type = PalFX
trigger1 = numhelper(2906)
add = 255,255,255
time = 1
under = 1
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = numhelper(2906)
flag = noBG
flag2 = noFG
flag3 = nobardisplay

[State 13100, Target exploding]
type = TargetState
trigger1 = NumTarget
trigger1 = Anim = 2925 && animelemtime(3)=3
value = ifElse(var(25)=1, 2945, 2935)

[State 13100, P2 locked]
type = playsnd
trigger1 = Anim = 2925 && animelemtime(3)=0
value = 2925,2
volume = 500

[state 1215, Explosion FX]
type = explod
trigger1 = Anim = 2925 && animelemtime(6)=0
anim = 2926
id = 2926
pos = 0,-70
postype = P2
sprpriority = 6
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
bindtime = 1
;scale = 2,2

[State 13100, HitAdd]
type = HitAdd
trigger1 = Anim = 2925 && animelemtime(6)=0
value = 1

[State 13100, explosion sound]
type = playsnd
trigger1 = Anim = 2925 && animelemtime(6)=0
value = 2925,3
volume = 100
persistent = 0

[State 13100, P2 explodes]
type = playsnd
trigger1 = Anim = 2925 && animelemtime(6)=0
value = 2925,1
volume = 500
persistent = 0

[state -2, helper]
type = helper
trigger1 = numtarget
trigger1 = var(25) = 0
trigger1 = Anim = 2925 && animelemtime(6)=0
pos = 0,0
postype = left
stateno = 8600
ID = 8600
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

[State 13100, Target exploding]
type = TargetState
trigger1 = NumTarget
trigger1 = !var(25)
trigger1 = Anim = 2925 && animelemtime(6)=0
value = 2502

[State 13100, shake]
type = envshake
trigger1 = Anim = 2925 && animelemtime(6)=0
time = 10
freq = 180
ampl = 15

[State 13100, Hurt]
type = TargetLifeAdd
trigger1 = Anim = 2925 && animelemtime(6)=0
value = -57 ;-7 ;-57
kill = 1
persistent = 0

[State 13100, Target exploding]
type = TargetState
trigger1 = NumTarget
trigger1 = Anim = 2925 && animelemtime(6)=0 && var(25) = 1
value = 2946

[state 1215, Remove Cut in half overlay FX (Killed)]
type = RemoveExplod
trigger1 = Anim = 2925 && animelemtime(6)=0 && var(25) = 1
id = 2906

[State 13100, blood splatter sound (Killed)]
type = playsnd
trigger1 = var(25)=1
trigger1 = Anim = 2925 && animelemtime(6)=5
value = 2925,0
volume = 500
persistent = 0

[State 3000, debris]
type = helper
trigger1 = var(25)=1
trigger1 = enemy,stateno=2946 && !numhelper(2930)
helpertype = normal
stateno = 2930
ID = 2930
name = "debris"
postype = p2
pos = 0,0
ownpal = 1

;Piccolo compatibility
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !animtime
id = 991901

[State 801, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1



;-------------------------------------
;P2 TK Explosion
[StateDef 2935]
type = A
movetype = H
physics = N

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = SelfAnimExist(5051)
value = 5051

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
trigger1 = !SelfAnimExist(5051)
value = 2821

[State 0, VelSet]
type = VelSet
trigger1 = !Time
y = -4

[State 0, VelAdd]
type = VelAdd
trigger1 = vel y < 0
y = 0.1

[State 0, VelSet]
type = VelSet
trigger1 = vel y >= 0
y = 0

[State 8000, black/white silouette]
type = PalFX
trigger1 = enemy,numhelper(2906)
add = 255,255,255
time = 1
under = 1
ignorehitpause = 1


;-------------------------------------
;P2 TK Explosion (Killed)
[Statedef 2945]
type = A
movetype = H
physics = N
ctrl = 0
velset = 0,0;0.2
facep2 = 1

[State 0, ChangeAnim]
type = ChangeAnim2
trigger1 = Anim != 9037
value = 2910
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = !Time
y = -4

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "vel y = %f"
params = vel y

[State 0, VelAdd]
type = VelAdd
trigger1 = Time < 43
y = 0.1

[State 0, VelAdd]
type = VelSet
trigger1 = Time = 43
y = 0.1

[State 8000, black/white silouette]
type = PalFX
trigger1 = enemy,numhelper(2906)
add = 255,255,255
time = 1
under = 1
ignorehitpause = 1

[State 800, red palfx]
type = null ;PalFX
trigger1 = (time < 62) && (time%10)=0
time = 10
add = 250,0,0
mul = 200,200,200

[State 3025, p2state - killed fatality]
type = changestate
trigger1 = time = 72
value = 2946
ignorehitpause = 1

;---------------------------------------------------------------------------------------
;Prevent Freezing from Force Choke (finisher 1)
[Statedef 2946]
type = S
movetype= H
physics = N
velset = 0,0

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 1,0
value = 1

[State 49999, 1]
type = LifeSet
trigger1 = 1
value = 0

[State 49999, 1]
type = PosSet
trigger1 = time > 40
y = 9000

[State 49999, 5]
type = ChangeAnim2
trigger1 = !time
value = 15999

[State 444, 0]
type = Changestate
trigger1 = time >=60
value = 5150


;===========================================================================
; <<<<<<<<<<<<<<< FINISHER 3 - SUPER NOVA >>>>>>>>>>>>>>>
; P2 State when flying > dizzy					3000 - 3006
; Waiting and black fade out					3010
; Invisible and waiting (+ FX)					3011
; [HELPER] Horizontal lines when P2 flying		3015
; [HELPER] Dizzy stars							2534
; Freeza waiting as soldiers run to P2			3020
; Freeza invisible, 7 soldiers hitting P2		3030
; P2 getting hit by soldiers					3040
; P2 invisible again after getting hit			3041
; Freeza Super Nova Start						3046
; Freeza invisible while P2 held by soldiers	3047
; P2 held by multiple block of soldiers			3050
; P2 invisible									3052
; [HELPER in super.cns] Blue Soldier			3055
; Freeza and his HUGE SUPERNOVA					3060
; Freeza throwing his HUGE SUPERNOVA			3061
; Blue Soldier getting killed					3065
;===========================================================================

;------------------------------------
[Statedef 3000] ;P2 center of screen
type = S
movetype = H
physics = S
velset = 0,0
ctrl = 0
sprpriority = 2

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = globalnoshadow
flag2 = timerfreeze
ignorehitpause = 1

[State 3001, screen]
type = Screenbound
trigger1 = 1
movecamera = 0,0
value = 1

[State 3001, sprpriority]
trigger1 = time = 0
type = SprPriority
value = 2

[State 3001, anim2]
type = null ;Changeanim2
triggerall = time = 0
trigger1 = name != "Goku Z2"
trigger1 = name != "Vegeta Z2"
trigger1 = name != "Gohan Z2"
trigger1 = name != "Satan Z2"
trigger1 = name != "SSJ Goku Z2"
value = 3000  ;2907 in Goku

[State 3001, anim2]
type = Changeanim2
triggerall = time = 0
trigger1 = authorname != "Team Z2"
value = 3000

[State 3001, PosSet]
type = PosSet
trigger1 = !time
x = 50*facing
y = -50

[State 3001, shake]
type = EnvShake
trigger1 = time = 0
time = 85
freq = 100
ampl = 3

[State 3001, PosSet]
type = VelSet
trigger1 = time=20
x = -17
y = 5

[State 3000, state]
type = ChangeState
trigger1 = Pos Y > -12
value = 3001
ctrl = 0

;-------------------------------
;P2 hits ground
[Statedef 3001]
type    = L
movetype= H
physics = N
ctrl = 0

[State -3, GetHit Snd]
type=playsnd
trigger1 = !time
value = 5000,1+(random%5)
ignorehitpause = 1

[State 5100, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State 5100, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
trigger1 = time = 0
value = 5100

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0
[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime=0
value = 3002
ctrl = 0

;---------------------------
;Bouncing to air
[Statedef 3002]
type    = L
movetype= H
physics = N

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5101, 4]
type = PosSet
trigger1 = Time = 0
y = 20

[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = 1
y = .4

[State 5101, 6] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 12
type = ChangeState
value = 3003
ctrl = 0

;---------------------------
;Hit Liedown
[Statedef 3003]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 13] ;Friction
type = ChangeState
trigger1 = time=40
value = 3004
ctrl = 0

;-------------------------------------
;P2 Get up
[Statedef 3004]
type    = L
movetype= H
physics = N

[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5120, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, 2]
type = VelSet
trigger1 = Time = 0
x = 0

[State 5120, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 5120, 4]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5120, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value = SCA
time = 3

[State 5120, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 3005
ctrl = 0

;------------------------------------------------
[StateDef 3005] ;P2 Dizzy
type = S
movetype = H
physics = N
velset = 0,0
ctrl = 0
anim = 5300
sprpriority = -1

[State 5120, 6]
type = NotHitBy
trigger1 = Time < 80
value = SCA

;FUCKING SHIN GOUKI HACK !!! >:(
[State 13200, Anim]
type = ChangeAnim2
trigger1 = Time=0 && name="Shin Gouki" && authorname="Phantom.of.the.Server"
value = 2912

;FUCKING WAR MACHINE HACK !!! >:(
[State 13200, Anim]
type = ChangeAnim2
trigger1 = Time=0 && name="Marvel vs. Capcom's WarMachine" && authorname="One Winged Angel"
value = 2913

[State 13200, Finisher 3 - Anim]
type = ChangeState
trigger1 = Time = 80 && enemy, var(39) >=900
value = 3006

;------------------------------------------------
[StateDef 3006] ; P2 invisible and waiting
type = S
movetype = H
physics = N
velset = 0,0
ctrl = 0

[State 13200, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 15999

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1
[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = globalnoshadow
ignorehitpause = 1

[State 13200, Go to GetHit state by multiple soldiers]
type = ChangeState
trigger1 = enemy,numhelper(3025)   ;P2Stateno = 3030
value = 3029   ;3040

;------------------------------------------------
; Freeza, Starting Finishers 1-3, waiting
[Statedef 3010]
type = S
movetype = I
physics = S
ctrl = 0
velset = 0,0
sprpriority = 2
poweradd = 0

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = globalnoshadow
flag2 = timerfreeze
ignorehitpause = 1

[State 13300, Fadeout]
type = allPalFX
trigger1 = Time < 9
time = 1
add = -25*(Time),-25*(Time),-25*(Time)

[State 13100, go invisible]
type = ChangeState
trigger1 = time=10
value = 3011
ctrl = 0



;------------------------------------------------
; Freeza invisible and waiting

[StateDef 3011] 
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 15999

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

;time counter for fading
[State 2260, bg]
type = Varset
trigger1 = !time
var(4)=0
[State 2260, bg]
type = VarAdd
trigger1 = target,stateno != 2912
var(4)=1

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1
[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = globalnoshadow
ignorehitpause = 1

[State 2201, helper]; Background lines
type = Helper
trigger1 = !time
pos = -640, -480
postype = back
stateno = 3015
helpertype = normal
name = "horizontal_lines_BG"
id = 3015
ownpal = 1
supermovetime = 150
pausemovetime = 150
sprpriority = 4
size.xscale = 5
size.yscale= 5

;Landing Effect when P2 hits ground
[state 17100, 10]
type = Explod
trigger1 = target,stateno = 3001
anim = 17100
pos = 0,0
postype = P2
sprpriority = -6
ownpal = 1
supermovetime = -1
removetime = -2
persistent = 0

;Playsnd when P2 flies
[State 5100, 10]
type = PlaySnd
triggerall = target,name != "Goku Z2"
trigger1 = target,stateno = 3000
value = 2907,0
persistent = 0

;Playsnd when P2 hits the ground
[State 5100, 10]
type = PlaySnd
trigger1 = target,stateno = 3001
value = 15000,1
persistent = 0

;Landing Effect when P2 hits ground
[state 17100, 10]
type = Explod
trigger1 = target,stateno = 3003
anim = 17100
pos = 0,0
postype = P2
sprpriority = -6
ownpal = 1
supermovetime = -1
removetime = -2
persistent = 0

;Playsnd when P2 hits the ground after bounce
[State 5110, 6]
type = PlaySnd
trigger1 = target,stateno = 3003
value = 15000,0
persistent = 0

; Dizzy stars when opponent gets up
[State 3025, dizzyfx]
type = helper
trigger1 = numhelper(2534) < 1
trigger1 = target,stateno = 3005
helpertype = normal
stateno = 2534
ID = 2534
name = "Dizzy FX"
postype = p1
ownpal = 1
facing = -1
size.ground.front = 0
size.ground.back = 0
ignorehitpause = 1
persistent = 0

[State 13100, change to finisher 2]
type = ChangeState
trigger1 = Target,Stateno = 3005 && Target, Time = 80
trigger1 = (var(39)>=600) && (var(39)<900)
value = 2800
ctrl = 0

[State 13100, change to finisher 3 - soldiers running]
type = ChangeState
trigger1 = Target,Stateno = 3006
trigger1 = (var(39)>=900)
value = 3020


;------------------------------------------------
; Freeza with soldiers running

[StateDef 3020]
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 3020
sprpriority = 1

[State 810, fatality END variable]
type = varset
trigger1 = !time
var(25) = 0
[State 810, fatality END variable]
type = varset
trigger1 = enemy,life <= 300
trigger1 = roundno>=2
var(25) = 1

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

[State 182, allow to go out of screen]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 13100, pos]
type = PosSet
trigger1 = !time
x = -70*facing

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1
[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = globalnoshadow
ignorehitpause = 1

[State 115, dash Sound]
type = PlaySnd
trigger1 = time=0
value = 100,0

[State 890, 2];lips
type = Explod
trigger1 = !Time
Anim = 18201
id = 18201
postype = P1
pos = 0,0
bindtime = -1
sprpriority = 4
ownpal = 1
removetime = -2
persistent = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=Japan
trigger1 = !time
value = 196,(random%3)

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=1		;Voice=English
trigger1 = !time
value = 195,3

[State 3000, soldier 1 helper]
type = helper
trigger1 = !time
helpertype = normal
stateno = 3025
ID = 3025
name = "soldier1"
postype = p1
pos = -300,0
ownpal = 1

[State 3000, soldier 2 helper]
type = helper
trigger1 = !time
helpertype = normal
stateno = 3026
ID = 3026
name = "soldier2"
postype = p1
pos = -380,0
ownpal = 1

[State 3000, soldier 3 helper]
type = helper
trigger1 = !time
helpertype = normal
stateno = 3027
ID = 3027
name = "soldier3"
postype = p1
pos = -290,-70
ownpal = 1

[state 1215, stop]
type = velset
trigger1 = time = 35
X = -8

[State 2201, helper]; Background lines
type = Helper
trigger1 = animelem=2 && !numhelper(2937)
pos = -640, -480
postype = back
stateno = 37010
helpertype = normal
name = "horizontal_lines_BG"
id = 2937
ownpal = 1
supermovetime = 9999 ;150
pausemovetime = 9999 ;150
sprpriority = 2
size.xscale = 5
size.yscale= 5

[State 1315, Multiple Sparks]
type = explod
trigger1 = time = 138
trigger2 = time = 156
trigger3 = time = 196
anim = (7020+10*(random%2))
sprpriority = 8
postype = p2
pos = (target,const(size.ground.front)-15),-50
removetime = -2
ownpal = 1
facing = -1
ignorehitpause = 1
persistent = 1
pausemovetime = 100
supermovetime = 100
bindtime = -1

[State 3000, multiple hitsound]
type = PlaySnd
trigger1 = time = 138
trigger2 = time = 156
trigger3 = time = 196
value = 5, 2+ 3*(random%2)

[State 3000, multiple hitadd]
type = HitAdd
trigger1 = time = 138
trigger2 = time = 156
trigger3 = time = 196
value = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time = 215
id = 18201

[State 13100, To invisible again]
type = ChangeState
trigger1 = time = 215
value = 3030
ctrl = 0

;------------------------------------------------
; Soldier 1 running to P2 (yellow, down front)

[StateDef 3025]
type = S
movetype = I
physics = N
velset = 9,0
ctrl = 0
anim = 3025
sprpriority = -1

[State 182, allow to go out of screen]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[state 1215, stop]
type = velset
triggerall = time < 80
trigger1 = abs((facing*(pos X))-50) <= 6
X = 0

[state 1215, move back]
type = PosAdd
trigger1 = time = [80,90]
X = -8

[state 1215, move up]
type = VelAdd
trigger1 = time>143 && vel Y >-4
X = 0.4
Y = -0.12

[State 115, dash Sound]
type = PlaySnd
trigger1 = time=143
value = 100,0

[State 182, end]
type = destroyself
trigger1 = time = 240

;------------------------------------------------
; Soldier 2 running to P2 (green, little back)

[StateDef 3026]
type = S
movetype = I
physics = N
velset = 8,0
ctrl = 0
anim = 3026
sprpriority = 2

[State 182, allow to go out of screen]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[state 1215, stop]
type = velset
triggerall = time < 80
trigger1 = abs((facing*(pos X))+40) <= 6
X = 0

[state 1215, move back]
type = PosAdd
trigger1 = time = [80,90]
X = -8

[state 1215, move up]
type = VelAdd
trigger1 = time>170 && vel Y >-4
X = 0.3
Y = -0.2

[State 115, dash Sound]
type = PlaySnd
trigger1 = time=170
value = 100,0

[State 182, end]
type = destroyself
trigger1 = time = 240

;------------------------------------------------
; Soldier 3 running to P2 (front top, shooting)

[StateDef 3027]
type = S
movetype = I
physics = N
velset = 9.6,0
ctrl = 0
anim = 3027
sprpriority = 3

[State 182, allow to go out of screen]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[state 1215, stop]
type = velset
triggerall = time < 80
trigger1 = abs((facing*(pos X))-60) <= 6
X = 0

[state 1215, move back]
type = PosAdd
trigger1 = time = [80,90]
X = -8

[state 1215, move down]
type = VelAdd
trigger1 = time>125 && vel Y >-4
X = 0.2
Y = 0.2

[State 115, dash Sound]
type = PlaySnd
trigger1 = time=125
value = 100,0

[State 3000, Ki Blast helper]
type = helper
trigger1 = time = 130
helpertype = normal
stateno = 3028
ID = 3028
name = "ki blast"
postype = p1
pos = 75,-57
ownpal = 1

[State 182, end]
type = destroyself
trigger1 = time = 240

;------------------------------------------------
; Ki Blast from Soldier 3

[StateDef 3028]
type = A
movetype = A
physics = N
velset = 10,0
ctrl = 0
anim = 1010
sprpriority = 5

[State 1061, NoShadow]
type = Trans
trigger1 = root,var(2)=0
trans = none
ignorehitpause = 1

[State 200, 1]
type = PlaySnd
trigger1 = time = 0
value = 10,0

[State 182, explod]
type = Changeanim
trigger1 = time = 8
value = 1013

[State 182, explod]
type = Velset
trigger1 = anim = 1013
X = -6

[State 182, end]
type = destroyself
trigger1 = anim=1013 && !animtime

;------------------------------------------------
; P2 coming in to screen to get hit by soldiers

[StateDef 3029]
type = A ;S
movetype = H
physics = N
velset = 0,0
ctrl = 0
sprpriority = -1

[State 182, allow to go out of screen]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 3001, PosSet]
type = PosSet
trigger1 = !time
x = -250*facing
y = -50

[state 1215, stop]
type = velset
trigger1 = time = 123
X = 6

[state 1215, stop]
type = velset
trigger1 = abs((facing*(pos X))) <= 5
X = 0

[State 3001, PosSet]
type = PosSet
trigger1 = abs((facing*(pos X))) <= 5
x = 0
y = -50

[State 0, gethit waiting]
type = changeanim2
trigger1 = time = 0
trigger2 = (anim=[5015,5017]) && !animtime
value = 3040

[State 0, gethit]
type = changeanim
trigger1 = time = 138
trigger2 = time = 156
trigger3 = time = 196
value = 5010 + (random%3)

[State 903, EnvShake]
type = EnvShake
trigger1 = time = 138
trigger2 = time = 156
trigger3 = time = 196
time = 7

[State 0, gethit recovery]
type = changeanim
trigger1 = (anim=[5010,5012]) && !animtime
value = anim + 5

[State 13200, Go to GetHit state by multiple soldiers]
type = ChangeState
trigger1 = P2Stateno = 3030
value = 3040

;------------------------------------------------
; Freeza invisible and waiting as P2 gets multi-hit by soldiers

[StateDef 3030] 
type = A ;S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 15999

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

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1
[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = globalnoshadow
ignorehitpause = 1

[State 1315, Multiple Sparks]
type = explod
trigger1 = time = 12
trigger2 = time = 37
trigger3 = time = 60
trigger4 = time = 77
trigger5 = time = 98
trigger6 = time = 114
trigger7 = time = 136
anim = (7020+10*(random%2))
sprpriority = 8
postype = p2
pos = (target,const(size.ground.front)-15),-70
removetime = -2
ownpal = 1
facing = -1
ignorehitpause = 1
persistent = 1
pausemovetime = 100
supermovetime = 100

[State 3000, multiple hitsound]
type = PlaySnd
trigger1 = time = 12
trigger2 = time = 37
trigger3 = time = 60
trigger4 = time = 77
trigger5 = time = 98
trigger6 = time = 114
trigger7 = time = 136
value = 5, 2+ 3*(random%2)

[State 3000, multiple hitadd]
type = HitAdd
trigger1 = time = 12
trigger2 = time = 37
trigger3 = time = 60
trigger4 = time = 77
trigger5 = time = 98
trigger6 = time = 114
trigger7 = time = 136
value = 1

[State 115, Multiple dash Sound]
type = PlaySnd
trigger1 = time = 5
trigger2 = time = 25
trigger3 = time = 45
trigger4 = time = 65
trigger5 = time = 85
trigger6 = time = 105
trigger7 = time = 125
value = 100,0

[state 17100, soldier 1]
type = Explod
trigger1 = time = 5
anim = 30300
pos = 10,-200
postype = P2
sprpriority = 5
ownpal = 1
supermovetime = -1
removetime = 100
vel = 0,20

[state 17100, soldier 2]
type = Explod
trigger1 = time = 25
anim = 30303
pos = 65,150
postype = P2
sprpriority = 5
ownpal = 1
supermovetime = -1
removetime = 100
vel = -5,-15

[state 17100, soldier 3]
type = Explod
trigger1 = time = 45
anim = 30305
pos = -180,140
postype = P2
sprpriority = 5
ownpal = 1
supermovetime = -1
removetime = 100
vel = 12,-12

[state 17100, soldier 4]
type = Explod
trigger1 = time = 65
anim = 30301
pos = 150,-200
postype = P2
sprpriority = 5
ownpal = 1
supermovetime = -1
removetime = 100
vel = -12,12

[state 17100, soldier 5]
type = Explod
trigger1 = time = 85
anim = 30304
pos = -70,150
postype = P2
sprpriority = 5
ownpal = 1
supermovetime = -1
removetime = 100
vel = 5,-14

[state 17100, soldier 6]
type = Explod
trigger1 = time = 105
anim = 30302
pos = 200,-60
postype = P2
sprpriority = 5
ownpal = 1
supermovetime = -1
removetime = 100
vel = -20,0

[state 17100, soldier 7]
type = Explod
trigger1 = time = 125
anim = 30306
pos = -150,-200
postype = P2
sprpriority = 5
ownpal = 1
supermovetime = -1
removetime = 100
vel = 12,12

[State 13100, Going to crack neck and charge Nova]
type = ChangeState
trigger1 = time = 170
value = 3046
ctrl = 0

;------------------------------------------------
; P2 getting hit by soldiers

[StateDef 3040]
type = A ;S
movetype = H
physics = N
velset = 0,0
ctrl = 0
sprpriority = -1

[State 3001, PosSet]
type = PosSet
trigger1 = 1 ;!time
x = 0
y = -50

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 0, gethit waiting]
type = changeanim2
trigger1 = time = 0
trigger2 = (anim=[5015,5017]) && !animtime
value = 3040

[State 0, gethit]
type = changeanim
trigger1 = time = 12
trigger2 = time = 37
trigger3 = time = 60
trigger4 = time = 77
trigger5 = time = 98
trigger6 = time = 114
trigger7 = time = 136
value = 5010 + (random%3)

[State 903, EnvShake]
type = EnvShake
trigger1 = time = 12
trigger2 = time = 37
trigger3 = time = 60
trigger4 = time = 77
trigger5 = time = 98
trigger6 = time = 114
trigger7 = time = 136
time = 7

[State 0, gethit recovery]
type = changeanim
trigger1 = (anim=[5010,5012]) && !animtime
value = anim + 5

[State 13100, P2 To invisible again]
type = ChangeState
trigger1 = time = 170
value = 3041
ctrl = 0

;------------------------------------------------
[StateDef 3041] ; P2 invisible and waiting
type = S
movetype = H
physics = N
velset = 0,0
ctrl = 0

[State 13200, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 15999

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1
[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = globalnoshadow
ignorehitpause = 1

[State 13200, Go to hold by multiple soldiers]
type = ChangeState
trigger1 = P2Stateno = 3047
value = 3050

;-----------------------------------------
; Charging Super Nova start

[Statedef 3046]
type = S
physics = S
movetype = A
anim = 3046
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1

[State 3001, PosSet]
type = PosSet
trigger1 = !time
x = 0

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

[State 100, jump SND]
type = playsnd
trigger1 = !time
value = 40,1

[state 1215, Rising Effect]
type = explod
trigger1 = !time
anim = 1216
id = 1216
pos = 10,12
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
supermovetime = 9999
pausemovetime = 9999
persistent = 0
ignorehitpause = 0

[State 40, 4]
type = VelSet
trigger1 = Time = 0
x = 0
y = const(velocity.jump.y)/1.2

[State 40, 4]
type = VelSet
trigger1 =  animelemtime(3)=0
x = 0
y = 0

[State 2200, sts]
type = statetypeset
trigger1 = animelemtime(1)>0
physics = N
statetype = A

[State 3001, shake]
type = EnvShake
trigger1 = time = 9
time = 150 - 9
freq = 130
ampl = 6

[state 1215, Super Nova FX]
type = explod
trigger1 = time = 9   ;animelemtime(4) = 0
anim = 30460
id = 30460
pos = -32,-150
postype = P1
sprpriority = 5
ownpal = 1
removetime = -1
supermovetime = 9999
pausemovetime = 9999
persistent = 0
ignorehitpause = 0
scale = 0.01, 0.01

[state 1215, Super Nova FX scale]
type = modifyexplod
trigger1 = time > 9
id = 30460
scale = 0.01+0.0005*(time-9), 0.01+0.0005*(time-9)

[State 250, Super Nova growing]
type = PlaySnd
trigger1 = time = 9
value = 3046,0

[State 3000, go to invisible]
type = changestate
trigger1 = time = 150
value = 3047
ctrl = 0

;------------------------------------------------
; Freeza invisible while P2 held by soldiers

[StateDef 3047] 
type = S
movetype = A
physics = N
velset = 0,0
ctrl = 0
anim = 15999

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

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1
[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = globalnoshadow
ignorehitpause = 1

[State 1315, remove nova]
type = removeexplod
trigger1 = !time
ID = 30460

[State 1315, Soldiers back]
type = explod
trigger1 = !time
anim = 30470
ID = 30470
sprpriority = 1
postype = p2
pos = 0,0
removetime = -1
ownpal = 1
bindtime = 1
ignorehitpause = 1

[State 1315, Soldiers front 1]
type = explod
trigger1 = !time
anim = 30471
ID = 30471
sprpriority = 3
postype = p2
pos = 0,0
removetime = -1
ownpal = 1
bindtime = 1
ignorehitpause = 1

[State 1315, Soldiers front 2]
type = explod
trigger1 = !time
anim = 30472
ID = 30472
sprpriority = 3
postype = p2
pos = 0,0
removetime = -1
ownpal = 1
bindtime = 1
ignorehitpause = 1

[State 3001, hitting sounds from struggling]
type = PlaySnd
trigger1 = time%30=0 ;&& random%2=0
value = 5,3+(random%3)

[State 1315, Soldiers back]
type = ModifyExplod
trigger1 = time = 120
ID = 30470
postype = p2
vel = -3,0
[State 1315, Soldiers front 1]
type = ModifyExplod
trigger1 = time = 120
ID = 30471
postype = p2
vel = -3,0
[State 1315, Soldiers front 2]
type = ModifyExplod
trigger1 = time = 120
ID = 30472
postype = p2
vel = -3,0

[State 3001, shake]
type = EnvShake
trigger1 = time%10=0 ;&& time<200
time = 10
freq = 80
ampl = 4

[State 3000, blue soldier helper]
type = helper
trigger1 = !time
helpertype = normal
stateno = 3055
ID = 3055
name = "blue_soldier"
;postype = p2
ownpal = 1

[State 2201, helper]; Background lines
type = Helper
trigger1 = !numhelper(3048)
trigger1 = time = 120
pos = -640, -480
postype = back
stateno = 3048
helpertype = normal
name = "horizontal_lines_BG"
id = 3048
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
sprpriority = 2
size.xscale = 5
size.yscale= 5

[State 0, goto HUGE SUPERNOVA]
type = Changestate
trigger1 = time = 300
value = 3060

;------------------------------------------------
;BG Horizontal Lines
[Statedef 3048]
type = A
movetype = A
physics = N
anim = 15999
velset = 0,0

[State 2260, push]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 2260, muteki]
type = NotHitBy
trigger1 = 1
value = SCA

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1

[State 2260, flash]
type = PalFX
trigger1 = TimeMod = 4,0
trigger1 = 1
time = 1
invertall = 1
ignorehitpause = 0

[state 3250, speedlines]
type = explod
trigger1 = time = 0
anim = 2923
ID = 2923
postype = back
pos = 0,10
bindtime = -1
supermove = 0
pausemovetime = 9999
sprpriority = 1
ontop = 0
ownpal = 1
ignorehitpause = 1
removetime = -1

[state 3250, speedlines2]
type = explod
trigger1 = time = 0
anim = 2923
ID = 2923
postype = back
pos = 0,240
bindtime = -1
supermove = 0
pausemovetime = 9999
sprpriority = 1
ontop = 0
ownpal = 1
ignorehitpause = 1
removetime = -1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time = 83
id =  2923

[State 1061, End]
type = destroyself
trigger1 = time = 83

;------------------------------------------------
; P2 held by soldiers

[StateDef 3050]
type = S
movetype = H
physics = N
velset = 0,0
ctrl = 0
sprpriority = 2

[State 0, held anim]
type = changeanim2
trigger1 = time = 0
value = 3050

[State 3001, PosSet]
type = PosSet
trigger1 = !time
x = 0
y = -140

[State 3001, Shaking]
type = PosAdd
trigger1 = time=15
trigger2 = time=120
x = -6
y = -6
[State 3001, Shaking]
type = PosAdd
trigger1 = time=30
trigger2 = time=135
x = 12
y = 12
[State 3001, Shaking]
type = PosAdd
trigger1 = time=45
trigger2 = time=150
x = -12
y = 0
[State 3001, Shaking]
type = PosAdd
trigger1 = time=60
trigger2 = time=165
x = 12
y = -12
[State 3001, Shaking]
type = PosAdd
trigger1 = time=75
trigger2 = time=180
x = -12
y = 6
[State 3001, Shaking]
type = PosAdd
trigger1 = time=90
trigger2 = time=195
x = 6
y = -6
[State 3001, Shaking]
type = PosAdd
trigger1 = time=105
trigger2 = time=210
x = 0
y = 12

[State 182, allow to go out of screen]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 0, move]
type = VelSet
trigger1 = time = 120
X = -3

[State 0, go to invisible]
type = Changestate
trigger1 = time = 300
value = 3052

;------------------------------------------------
; P2 invisible while Freeza throws his Nova

[StateDef 3052] 
type = S
movetype = H
physics = N
velset = 0,0
ctrl = 0
;anim = 15999

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !time
value = 15999

[State 182, allow to go out of screen]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 3001, PosSet]
type = PosSet
trigger1 = !time
x = -700*facing
y = -140

[State 0, goto ]
type = Changestate
trigger1 = time = 700
value = 3100

;------------------------------------------------
; Blue Soldier running then getting scared

[StateDef 3055] 
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 71113
p2facing = 1

[State 3001, PosSet]
type = PosSet
trigger1 = !time
x = -500*facing
y = -50

[State 182, allow to go out of screen]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 0, move]
type = VelSet
trigger1 = time = 120
X = 6

[State 20, stop walk]
type = VelSet
trigger1 = abs(pos X)<6
x = 0

[State 20, stop]
type = ChangeAnim
trigger1 = abs(pos X)<6
trigger1 = anim != 71111  ;3055
value = 71111 ;3055

[State 10230, afraid voice]
type = null ;playsnd
trigger1 = anim = 71111
value = 711,20+random%2
persistent = 0

[State 10230, hurt voice]
type = playsnd
trigger1 = anim = 71111
value = 713,0
persistent = 0

[State 0, destroy]
type = DestroySelf
trigger1 = time = 300

;------------------------------------------------
; Freeza and his HUGE SUPERNOVA

[Statedef 3060]
type = S
physics = N
movetype = A
anim = 3060
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1

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

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1
[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = globalnoshadow
ignorehitpause = 1

[State 1315, remove soldiers]
type = removeexplod
trigger1 = !time
ID = 30470
[State 1315, remove soldiers]
type = removeexplod
trigger1 = !time
ID = 30471
[State 1315, remove soldiers]
type = removeexplod
trigger1 = !time
ID = 30472

[State 3001, shake]
type = EnvShake
trigger1 = time%10=0
time = 10
freq = 80
ampl = 6

[State 3001, PosSet]
type = PosSet
trigger1 = !time
x = -50*facing
y = 0

[State 1211, Exclamation]
type = Explod
trigger1 = !time
anim = 19900
id = 19900
pos = 0,0
postype = back
sprpriority = 5
bindtime = -1
scale = .84, 1.07
supermovetime = -1
pausemovetime = -1
ignorehitpause = 1
persistent = 0
ontop = 1

[State 10500, Exclamation snd]
type = playsnd
trigger1 = !time
value = 2774,2

[State 0, scale]
type = angledraw
trigger1  = time < 120
scale = 0.25, 0.25

[state 1215, Super Nova FX]
type = explod
trigger1 = !time
anim = 30600
id = 30600
pos = -32,-35
postype = P1
sprpriority = -1
ownpal = 1
removetime = -1
supermovetime = 9999
pausemovetime = 9999
persistent = 0
ignorehitpause = 0
scale = 1,1
;bindtime = -1

;---------------
; Starting to scale everything

[State 0, scale]
type = angledraw
trigger1 = (time>=120) && (time<32+120)
scale = 0.25*(1+0.25*(time-120)/3), 0.25*(1+0.25*(time-120)/3)   ;takes 32 ticks to scale

[State 0, scale]
type = angledraw
trigger1 = time>=32+120
scale = 1,1

[State 3001, Vel]
type = VelSet
trigger1 = (time>=120) && (time<32+120)
x = 50.0/32
y = -1.5

[State 3001, Vel]
type = VelSet
trigger1 = time>=32+120
x = 0
y = 0

[state 1215, Super Nova FX]
type = ModifyExplod
trigger1 = (time>=120) && (time<32+120)
ID = 30600
scale = (1+0.25*(time-120)/3), (1+0.25*(time-120)/3)
pos = ceil(-32-((time-120.0)*(128.0-32)/32.0)) , ceil(-35-((time-120.0)*(140.0-35)/32.0))
postype = P1

[state 1215, Super Nova FX]
type = ModifyExplod
trigger1 = time>=32+120
ID = 30600
scale = 4,4
pos = -128, -140
postype = P1

;---------------
; Throwing it

[State 200, 1];Here boy, Catch !!!
type = PlaySnd
triggerall = var(55)=1		;Voice=English
trigger1 = time = 150
value = 3060,0

[State 0, goto launching state]
type = Changestate
trigger1 = time = 220
value = 3061

;------------------------------------------------
; Freeza throwing his HUGE SUPERNOVA

[Statedef 3061]
type = S
physics = N
movetype = A
anim = 3061
ctrl = 0
velset = 0,0
sprpriority = 1
facep2 = 1

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

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1
[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = globalnoshadow
ignorehitpause = 1

[state 1215, Super Nova FX]
type = RemoveExplod
trigger1 = time=0
ID = 30600

[State 3000, Super Nova helper]
type = helper
trigger1 = time=0
helpertype = normal
stateno = 3065
ID = 3065
name = "supernova"
ownpal = 1
postype = P1
pos = -128, -140

[State 200, 1];Woosh
type = PlaySnd
trigger1 = animelem = 2
value = 0, 0
channel = 1

[State 200, 1];Super Nova launch SFX
type = PlaySnd
trigger1 = animelem = 3
value = 3061, 0

[State 200, 1];Super Nova launch SFX 2
type = PlaySnd
trigger1 = animelem = 3
value = 3061, 1

[State 2201, helper]; Background lines
type = Helper
trigger1 = animelem=2 && !numhelper(2937)
pos = -640, -480
postype = back
stateno = 37010
helpertype = normal
name = "horizontal_lines_BG"
id = 2937
ownpal = 1
supermovetime = 9999 ;150
pausemovetime = 9999 ;150
sprpriority = 2
size.xscale = 5
size.yscale= 5

[State 0, goto invisible]
type = Changestate
trigger1 = time = 80
value = 3062

;------------------------------------------------
; Freeza moving out while Super Nova advances

[StateDef 3062] 
type = S
movetype = A
physics = N
velset = 0,0
ctrl = 0
;anim = 15999

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

[state 1215, remove charge FX]
type = removeexplod
trigger1 = !time
ID = 30470
[state 1215, remove charge FX]
type = removeexplod
trigger1 = !time
ID = 30471
[state 1215, remove charge FX]
type = removeexplod
trigger1 = !time
ID = 30472

[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = noFG
flag2 = noBG
flag3 = nobardisplay
ignorehitpause = 1
[State 2260, bg]
type = assertspecial
trigger1 = 1
flag = globalnoshadow
ignorehitpause = 1

[State 182, allow to go out of screen]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[state 1215, go out of screen]
type = veladd
triggerall = pos X = [-1000,1000]
trigger1 = (time>0) && (time<500)
X = -0.3
Y = 0.22

[state 1215, stay out of screen]
type = velset
trigger1 = pos X != [-1000,1000]
X = 0
Y = 0

[State 3001, shake]
type = EnvShake
trigger1 = time%10=0
time = 10
freq = 80
ampl = 5

[State 3000, blue soldier helper]
type = helper
trigger1 = time=180   ;!time
helpertype = normal
stateno = 3070
ID = 3070
name = "blue_soldier"
ownpal = 1

;-------- 
; Explods for soldiers and all, when P2 reappears

[State 1315, Soldiers back]
type = explod
trigger1 = enemy,stateno=3100 && !numexplod(30470) && time<500
anim = 30470
ID = 30470
sprpriority = 2
postype = p2
pos = 0,0
removetime = -1
ownpal = 1
bindtime = 1
ignorehitpause = 1
vel = 3,0

[State 1315, Soldiers front 1]
type = explod
trigger1 = enemy,stateno=3100 && !numexplod(30471) && time<500
anim = 30471
ID = 30471
sprpriority = 3
postype = p2
pos = 0,0
removetime = -1
ownpal = 1
bindtime = 1
ignorehitpause = 1
vel = 3,0

[State 1315, Soldiers front 2]
type = explod
trigger1 = enemy,stateno=3100 && !numexplod(30472) && time<500
anim = 30472
ID = 30472
sprpriority = 3
postype = p2
pos = 0,0
removetime = -1
ownpal = 1
bindtime = 1
ignorehitpause = 1
vel = 3,0

[State 3001, hitting sounds from struggling]
type = PlaySnd
trigger1 = enemy,stateno=3100 && time%30=0
trigger1 = time < 560
value = 5,3+(random%3)

[State 3000, multiple hitadd]
type = HitAdd
trigger1 = numexplod(3066) && (gametime%6)=0
value = 1

[State 0, Remove Soldiers]
type = RemoveExplod
trigger1 = time= 531
ID = 30470
[State 0, Remove Soldiers]
type = RemoveExplod
trigger1 = time= 531
ID = 30471
[State 0, Remove Soldiers]
type = RemoveExplod
trigger1 = time= 531
ID = 30472

[State 3000, soldiers back death helper]
type = helper
trigger1 = enemy,stateno=3100
trigger1 = time= 531
helpertype = normal
stateno = 30470
ID = 30470
name = "soldiers back"
ownpal = 1
postype = p2
pos = 0, 10

[State 3000, soldiers front 1 death helper]
type = helper
trigger1 = enemy,stateno=3100
trigger1 = time= 531
helpertype = normal
stateno = 30471
ID = 30471
name = "soldiers front 1"
ownpal = 1
postype = p2
pos = 0, 10

[State 3000, soldiers front 2 death helper]
type = helper
trigger1 = enemy,stateno=3100
trigger1 = time= 531
helpertype = normal
stateno = 30472
ID = 30472
name = "soldiers front 2"
ownpal = 1
postype = p2
pos = 0, 10

[State 13300, Fadeout]
type = allPalFX
trigger1 = Time > 600
time = 1
add = 256,256,256

[State 181,3]
type = AssertSpecial
trigger1 = Time >= 600 && var(25) = 1
flag = NoMusic

[State 0, Position FINISHED YAY !!!!]
type = PosSet
trigger1 = time=600 && var(25) = 0
trigger2 = time=700 && var(25) = 1
X = -80*facing
y = ifElse(var(25) = 1,0, -75)

[State 0, FINISHED YAY !!!!]
type = ChangeState
trigger1 = time=600 && var(25) = 0
trigger2 = time=700 && var(25) = 1
value = ifElse(var(25) = 1, 3064, 3063)


;Finish/Landing from supernova
[Statedef 3063]
type = S
ctrl = 0
anim = 71200
velset = 0,0

[State 3000, debris]
type = helper
trigger1 = var(25)=1
trigger1 = time = 35
helpertype = normal
stateno = 2930
ID = 2930
name = "debris"
postype = p2
pos = 0,0
ownpal = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time < 35
flag = globalnoshadow

[State 13300, Fadeout]
type = allPalFX
trigger1 = Time < 35
time = 1
add = 256 - 25*(Time - 25 ),256 - 25*(Time-25),256 - 25*(Time-25)

[State 3010, gravity]
type = Velset
trigger1 = time = 35
Y = 3

[State 3010, speed down when arriving]
type = Veladd
trigger1 = (Pos Y > -70) && (Pos Y <= 0) && (vel Y > 0.5)
Y = -0.07

[State 1200, landing]
type = ChangeAnim
trigger1 = Pos Y >= 0
trigger1 = Vel Y > 0
value = 19300

[State 1200]
type = PosSet
trigger1 = Pos Y >= 0
Y = 0

[State 1200]
type = VelSet
trigger1 = Anim = 19300
Y = 0

[State 890, 2];Land Dust
type = Explod
triggerall = anim = 19300
trigger1 = animelem = 1
Anim = 17100
postype = P1
pos = -12,0
bindtime = 1
sprpriority = -1
ownpal = 1
removetime = -2
persistent = 0

[State 0];land
type = playsnd
triggerall = anim = 19300
trigger1 = animelem = 1
value = 9,1

[State 0];get up
type = ChangeAnim
triggerall = anim = 19300
trigger1 = animelemtime(3) = 8
value = 19306

[state -2, helper]
type = helper
trigger1 = numtarget
trigger1 = var(25) = 0
trigger1 = (target,movetype=H)
trigger1 = time= 88
pos = 0,0
postype = left
stateno = 8600
ID = 8600
helpertype = normal
name = "Fire"
sprpriority = -5
ownpal = 1
ignorehitpause = 1

;Piccolo compatibility
[State 0, RemoveExplod]
type = RemoveExplod
triggerall = anim = 19306
trigger1 = AnimTime = 0
id = 991901

[State 190, 4] ;Change to stand state
type = ChangeState
triggerall = anim = 19306
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;Finish/Landing from supernova (Fatality)
[Statedef 3064]
type = S
sprpriority = 4

[State 0, Position FINISHED YAY !!!!]
type = PosSet
trigger1 = !time
X = -80*facing
y = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 15999
value = 15999

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

;Piccolo compatibility
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = PrevStateNo = 3062
id = 991901

[State 3711, ChangeState]
type = ChangeState
trigger1 = PrevStateNo = 3062
value = 180
ctrl = 1

[State 13300, SPACE]
type = Explod
trigger1 = !Time && !NumExplod(30640)
anim = 30640
ID = 30640
postype = left
pos = 0,0
bindtime = -1
removetime = -2
ownpal = 1
sprpriority = 3
ignorehitpause = 1
facing = 1

[State 3830, Rock Maker]
type = Helper
trigger1 = !numhelper(30640)
helpertype = Normal
name = "rocks maker"
id = 30640
stateno = 30640
postype =  left
pos = 160, -26


;------------------------------------------------------
;Rock Maker
[Statedef 30640]
type = A
movetype = I
physics = N
anim = 3064
sprpriority = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 35
value = 182,2

[State 1900, lips] ;Lippy lip lips
type = Explod
trigger1 = time = 35
anim = 18600
ID = 18600
postype = pp1
pos = 0,0
bindtime = -1
removetime =122
sprpriority = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = 3064,0

[State 13300, Fadeout]
type = allPalFX
trigger1 = Time < 35
time = 1
add = 256 - 25 * (Time - 25),256 - 25 * (Time-25), 256 - 25 * (Time - 25)

[State 3830, Rocks]
type = Helper
triggerall = numhelper(38020)<20 && numhelper(38021)<20
trigger1 = !(time%10)
helpertype = Normal
name = "rocks"
id = 38020
pos = 160,20
postype = left
facing = 1
stateno = 38020
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999

[State 181,3]
type = AssertSpecial
trigger1 = Time < 450
flag = RoundNotOver

[State 181,3]
type = AssertSpecial
trigger1 = 1
flag = NoMusic



;------------------------------------------------------
;Rocks going up

[Statedef 38020]
type = A
movetype = I
physics = N
anim = 15999

[State 1003, Helper]
type = Helper
trigger1 = !time
helpertype = Normal
name = "rocks"
id = 38021
pos = ((random%320)),10*(random%13)
postype = left
facing = 1
stateno = 38021
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
size.xscale = 1.5
size.yscale = 1.5


[State 1003, Helper]
type = Helper
trigger1 = !time
helpertype = Normal
name = "rocks"
id = 38021
pos = ((random%320)+320),10*(random%13)
postype = left
facing = 1
stateno = 38021
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
size.xscale = 2
size.yscale = 2

[State 1003, Helper]
type = Helper
trigger1 = !time
helpertype = Normal
name = "rocks"
id = 38021
pos = ((random%320)-320),10*(random%13)
postype = left
facing = 1
stateno = 38021
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
size.xscale = .75
size.yscale = .75

[State 1003, DestroySelf]
type = DestroySelf
trigger1 = time=2

;-----------------
;Rocks
[Statedef 38021]
type = A
movetype = I
physics = N
;anim = 15999 ;19890 + random%6
anim = 19890 + random%6
sprpriority = 10 ;-5

[State 0, Explod]
type = null ;Explod
trigger1 = !time
anim = 19890 + random%6
ID =  38021
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = IfElse(random<500,1,-1)
vfacing = IfElse(random<500,1,-1)
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
;ignorehitpause =
;trans =
;persistent =
;supermove = 0
;pausemove = 0

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

[State 1004, vel]
type = velset
trigger1 = !time
y = -1.5-random%3

[State 1004, vel]
type = varset
trigger1 = !time
var(10) = random%2

[State 1004, assert]
type = angledraw
trigger1 = 1
value = ifelse(var(10)=0,2*time,-2*time)

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time > 400
trigger2 = pos Y < -340
trigger3 = root,stateno = 180
trigger4 = root,stateno = 3840
id = 38021
;ignorehitpause =
;persistent =

[State 1004, DestroySelf]
type = DestroySelf
trigger1 = time > 400
trigger2 = pos Y < -340
trigger3 = root,stateno = 180
trigger4 = root,stateno = 3840




;------------------------------------------------
; Soldiers back getting killed

[StateDef 30470]
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 30470
p2facing = 1
sprpriority = 2

[State 13300, Fadeout]
type = PalFX
trigger1 = Time = [0,16]
time = 1
add = -16*(Time),-16*(Time),-16*(Time)

[State 13300, black palFX]
type = PalFX
trigger1 = Time > 16
time = 1
add = -255,-255,-255

[State 1415, Hit Floor]
type = trans
trigger1 = time>16 && time<32
trans = addalpha
alpha = 256-16*(time-16), 16*(time-16)

[State 0, destroy]
type = DestroySelf
trigger1 = time = 32

;------------------------------------------------
; Soldiers front 1 getting killed

[StateDef 30471]
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 30471
p2facing = 1
sprpriority = 4

[State 13300, Fadeout]
type = PalFX
trigger1 = Time = [0,16]
time = 1
add = -16*(Time),-16*(Time),-16*(Time)

[State 13300, black palFX]
type = PalFX
trigger1 = Time > 16
time = 1
add = -255,-255,-255

[State 1415, Hit Floor]
type = trans
trigger1 = time>16 && time<32
trans = addalpha
alpha = 256-16*(time-16), 16*(time-16)

[State 0, destroy]
type = DestroySelf
trigger1 = time = 32

;------------------------------------------------
; Soldiers front 2 getting killed

[StateDef 30472]
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 30472
p2facing = 1
sprpriority = 4

[State 13300, Fadeout]
type = PalFX
trigger1 = Time = [0,16]
time = 1
add = -16*(Time),-16*(Time),-16*(Time)

[State 13300, black palFX]
type = PalFX
trigger1 = Time > 16
time = 1
add = -255,-255,-255

[State 1415, Hit Floor]
type = trans
trigger1 = time>16 && time<32
trans = addalpha
alpha = 256-16*(time-16), 16*(time-16)

[State 0, destroy]
type = DestroySelf
trigger1 = time = 32

;------------------------------------------------
; Super Nova Helper

[StateDef 3065] 
type = A
movetype = I
physics = N
velset = 2,0
ctrl = 0
anim = 15997
p2facing = 1
sprpriority = 1

[State 0, scale]
type = angledraw
trigger1 = 1
scale = 4,4

[State 200, 1];Super Nova approaches SFX
type = PlaySnd
trigger1 = !time
value = 3063, 0
loop = 1
channel = 12

[State 0, Explod]
type = Explod
trigger1 = !Time
anim = 30600
ID = 30600
vel = 2,0
scale = 4,4
sprpriority = 4
removetime= -1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time = 80
id = 30600

[State 0, Explod]
type = Explod
trigger1 = Time = 80
anim = 30600
ID = 30601
vel = 2,0
accel = -0.2544648505254566, 0.23
scale = 4,4
sprpriority = 4
removetime= -1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time = 179
id = 30601

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 179
value = 30601

[State 0, PosSet]
type = PosSet
trigger1 = Time = 179
x = 0
y = 928.11

[State 0, VelSet]
type = VelSet
trigger1 = Time >= 179 && Time < 280
x = 0
y = 0

[state 1215, go forward]
type = veladd
trigger1 = time>=280 && time<310
X = .2

[state 1215, stop]
type = velset
trigger1 = time = [310,580]
X = 0

;------------------
; Super Nova moves again with hitsparks !!!

[State 0, vel]
type = veladd
trigger1 = time >= 580 && vel X < 4
X = 0.1

[State 0, huge explosion sound]
type = PlaySnd
trigger1 = Time = 600
value = 3062,0

[State 0, huge explosion sound]
type = PlaySnd
trigger1 = root,stateno=3062 && root, time = 600
value = 3062,1

[State 13300, white screen fade]
type = Explod
trigger1 = Time = 600
anim = 2907
ID = 2907
postype = left
pos = 0,-50
bindtime = -1
removetime = -2
ownpal = 1
ontop = 1
sprpriority = 8
scale = 2,3
ignorehitpause = 1
facing = 1

[State 0, HitAdd]
type = HitAdd
trigger1 = time>580 && (gametime%6)=0
value = 1

[State 1315, Multiple Sparks]
type = explod
trigger1 = time>580 && (gametime%6)=0
;trigger1 = time<630
trigger1 = root,stateno != 0
anim = (7020+10*(random%2))
ID = 3066
sprpriority = 9
postype = p2
pos = 15-5*(random%6),40-10*(random%7)
removetime = -2
ownpal = 1
facing = -1
ignorehitpause = 1
persistent = 1
pausemovetime = 100
supermovetime = 100

[State 3000, multiple hitsound]
type = PlaySnd
trigger1 = time>580 && (gametime%6)=0
;trigger1 = time<630
value = 5, 2+ 3*(random%2)

[State 0, destroy]
type = StopSnd
trigger1 = root,stateno=3062 && root, time = 600
channel = 12

[State 0, destroy]
type = RemoveExplod
trigger1 = root,stateno=3062 && root, time = 600
ID = 3066

[State 0, destroy]
type = DestroySelf
trigger1 = root,stateno=3062 && root, time = 600

;------------------------------------------------
; Blue Soldier getting killed

[StateDef 3070] 
type = S
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 3055
p2facing = 1
sprpriority = 5

[State 3001, PosSet]
type = PosSet
trigger1 = !time
x = 290*facing
y = -50

[State 182, allow to go out of screen]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 0, move]
type = VelSet
trigger1 = time = 30
X = -2

[State 3001, bacon cooked SFX]
type = PlaySnd
trigger1 = time = 150
value = 3065,0

[State 13300, Fadeout]
type = PalFX
trigger1 = Time = [150,182]
time = 1
add = -8*(Time-150),-8*(Time-150),-8*(Time-150)

[State 13300, black palFX]
type = PalFX
trigger1 = Time > 182
time = 1
add = -255,-255,-255

[State 1415, Hit Floor]
type = trans
trigger1 = time>200 && time<226
trans = addalpha
alpha = 256-10*(time-200), 10*(time-200)

[State 0, destroy]
type = DestroySelf
trigger1 = time = 226

;------------------------------------------------
; P2 held by soldiers - coming back to screen

[StateDef 3100]
type = S
movetype = H
physics = N
velset = 3,0
ctrl = 0
sprpriority = 2

[State 0, held anim]
type = changeanim2
trigger1 = time = 0
value = 3050

[State 3001, PosSet]
type = PosSet
trigger1 = !time
x = -390*facing
y = -140

[State 3001, Shaking]
type = PosAdd
;trigger1 = time=15
trigger1 = time=120
x = -6
y = -6
[State 3001, Shaking]
type = PosAdd
;trigger1 = time=30
trigger1 = time=135
x = 12
y = 12
[State 3001, Shaking]
type = PosAdd
;trigger1 = time=45
trigger1 = time=150
x = -12
y = 0
[State 3001, Shaking]
type = PosAdd
trigger1 = time=60
trigger2 = time=165
x = 12
y = -12
[State 3001, Shaking]
type = PosAdd
trigger1 = time=75
trigger2 = time=180
x = -12
y = 6
[State 3001, Shaking]
type = PosAdd
trigger1 = time=90
trigger2 = time=195
x = 6
y = -6
[State 3001, Shaking]
type = PosAdd
trigger1 = time=105
trigger2 = time=210
x = 0
y = 12

[State 182, allow to go out of screen]
type = screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[state 1215, stop]
type = velset
trigger1 = abs((facing*(pos X))-10) <= 6
X = 0

[State 3001, Damage taken]
type = LifeAdd
trigger1 = time=195
value = -150 ;-100 ;-300

[State 0, PosAdd]
type = PosSet
trigger1 = enemy,stateno=3062 && enemy, time = 600
x = -80*facing
y = ifElse(enemynear, var(25) = 1,0, -1500)

[State 901, alive]
type = ChangeState
;triggerall = alive
trigger1 = enemy,stateno=3062 && enemy, time = 600
value = 3105  ;5120




;------------------------------------------------
;falling
[StateDef 3105]
type = A
physics = N
movetype = H
ctrl = 0
anim = 5061
velSet = 0, ifElse(enemynear, var(25) = 1, 0, -7.5)

[State 13200, Anim]
type = ChangeAnim2
trigger1 = Time = 0
trigger1 = enemynear, var(25) = 1
value = 15999

[State 0, PosAdd]
type = PosSet
trigger1 = !Time
x = -80*facing
y = ifElse(enemynear, var(25) = 1,0, -1500)

[State 1531, End]
type = SelfState
trigger1 = enemynear, var(25) = 1
value = 5150

[State 0, PalFX]
type = PalFX
trigger1 = !Time
time =128
add = 255,50,0
sinadd = -255,-50,0,20

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

[State 1531, VelAdd]
type = VelAdd
Trigger1 = 1
y = 0.49

[State 1531, EnvShake]
type = EnvShake
trigger1 = pos y > -vel y
time = 14
ampl = -4
freq = 120

[State 1531, End]
type = ChangeState
trigger1 = pos y > -vel y
value = 2822
