;===============================================================
;Coin Spawner
; vars 11, 12, 26, 48 used by 9999
; var	30 = round timer
;	31 = root, starting life
;	32 = root, last attack state - set in 9999
;	33 = match playing
;	38 = root prev combo count
;	39 = coin xp
;	40 = coin pos x

[Statedef 19999]
type = S
physics = N
anim = 9999
ctrl = 0

[State 19999, ChangeState]
type = ChangeState
trigger1 = time
value = 9999

[State 19999, VarSet]
type = VarSet
triggerall = roundstate < 3
trigger1 = !var(30)
var(31) = root, life

[State 19999, VarAdd]
type = VarAdd
triggerall = roundstate < 3
trigger1 = var(33)
trigger1 = var(30) < 6000
var(30) = 1

[State 19999, VarAdd]
type = VarSet
triggerall = roundstate < 3
trigger1 = !var(33)
var(30) = 0

[State 19999, VarAdd]
type = VarSet
triggerall = !var(33)
triggerall = roundstate < 3
trigger1 = root, ctrl
trigger2 = root, movetype != I
trigger3 = root, statetype != S
trigger4 = root, stateno != 0
trigger4 = root, stateno != [190, 199]
var(33) = 1

[State 19999, VarAdd]
type = VarSet
trigger1 = roundstate > 2
var(33) = 0

[State Debug Info]
type = DisplayToClipboard
trigger1 = 1
text = "time %d"
params = var(30)
ignorehitpause = 1

[State 19999, PlaySnd]
type = PlaySnd
trigger1 = var(39)
value = 6000, 1
abspan = var(40)
channel = 8

[State 19999, ParentVarAdd]
type = ParentVarAdd
trigger1 = var(39)
var(19) = var(39)

[State 19999, VarSet]
type = VarSet
trigger1 = var(39)
var(39) = 0

[State 19999, VarSet]
type = VarSet
trigger1 = !var(38)
trigger1 = root, var(38) > 1
var(38) = 1

[State 19999, PlaySnd]
type = PlaySnd
trigger1 = var(38)
trigger1 = root, var(38) > 1
trigger1 = var(38) < root, var(38)
value = 6000, 0
abspan = floor(root, fvar(18))
channel = 7

[State 19999, Coin]
type = Helper
trigger1 = var(38)
trigger1 = root, var(38) > 1
trigger1 = var(38) < root, var(38)
name = "c"
id = 20000
stateno = 19999 + ifelse(var(38) > 9, 9, var(38))
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
postype = left
pos = floor(root, fvar(18)), floor(root, fvar(19))
size.xscale = 1
size.yscale = 1

[State 19999, Coin]
type = Helper
trigger1 = var(38)
trigger1 = root, var(38) > 1
trigger1 = var(38) + 1 < root, var(38)
name = "c"
id = 20000
stateno = 19999 + ifelse(var(38) + 1 > 9, 9, var(38) + 1)
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
postype = left
pos = floor(root, fvar(18)), floor(root, fvar(19))
size.xscale = 1
size.yscale = 1

[State 19999, Coin]
type = Helper
trigger1 = var(38)
trigger1 = root, var(38) > 1
trigger1 = var(38) + 1 < root, var(38)
name = "c"
id = 20000
stateno = 19999 + ifelse(var(38) + 2 > 9, 9, var(38) + 2)
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
postype = left
pos = floor(root, fvar(18)), floor(root, fvar(19))
size.xscale = 1
size.yscale = 1

[State 19999, VarSet]
type = VarSet
trigger1 = 1
var(38) = root, var(38)

[State 19999, VarSet]
type = VarSet
trigger1 = 1
var(38) = root, var(38)

;===============================================================
;Coins
; var 0: 0 = 100, 1 = 200, 2 = 300, 3 = 400, 4 = 500, 5 = 1000,
;				6 = 2000, 7 = 3000, 8 = 5000
; var 1 = collection timer
; fvar 10 = player sweep collision mod

[Statedef 20000]
type = S
physics = N
anim = 6000 + var(0)
velset = 1.67 + random*0.0017 + abs(root, pos x - pos x)*(1 + (pos y - root, pos y)*0.00002)*(1 + random*0.005)*0.002, -7.5 - abs(root, pos x - pos x)*0.002 - random*0.0025
sprpriority = -2

[State 20000, VelMul]
type = VelMul
triggerall = !time
trigger1 = root, pos x < pos x
trigger1 = root, stateno != 701
trigger2 = root, stateno = 701
trigger2 = root, facing = 1
x = -1

[State 20000, PosAdd]
type = PosAdd
trigger1 = !time
x = random*0.01*ifelse(random%2, -1, 1)
y = 10 + random*0.02*ifelse(random%2, -1, 1)

[State 20000, VarAdd]
type = VarAdd
trigger1 = var(1)
trigger1 = root, var(56) = gametime
var(1) = 1

[State 20000, VarSet]
type = VarSet
trigger1 = vel y > 0.83
trigger2 = pos y >= 0
trigger2 = vel y > 0
var(1) = 1
persistent = 0

[State 20000, VarSet]
type = VarSet
trigger1 = 1
fvar(10) = 0

[State 20000, VarSet]
type = VarSet
triggerall = pos y > -24*root, const(size.yscale)
trigger1 = root, stateno = 420
trigger1 = root, animelemno(0) = 5
fvar(10) = 96*root, const(size.xscale)

[State 20000, VarSet]
type = VarSet
triggerall = pos y > -24*root, const(size.yscale)
trigger1 = root, stateno = 430
trigger1 = root, animelemno(0) = 7
fvar(10) = 64*root, const(size.xscale)

[State 20000, VarSet]
type = VarSet
triggerall = pos y > -24*root, const(size.yscale)
trigger1 = root, stateno = 450
trigger1 = root, animelemno(0) = 5
trigger2 = root, stateno = 460
trigger2 = root, animelemno(0) = 4
fvar(10) = 128*root, const(size.xscale)

[State 20000, ChangeState]
type = ChangeState
triggerall = var(1)
triggerall = root, pos y - pos y = [48*root, const(size.yscale)*(root, statetype = A), 64*(root, const(size.xscale))*(0.25 + 0.75*(root, statetype != L) + 0.25*(root, statetype != C))]
trigger1 = root, facing = 1
trigger1 = screenpos x = [root, backedgebodydist - 30, 360 - root, frontedgebodydist + fvar(10)]
trigger2 = root, facing = -1
trigger2 = screenpos x = [root, frontedgebodydist - fvar(10) - 40, 350 - root, backedgebodydist]
value = 20010

[State 20000, Invisible]
type = AssertSpecial
trigger1 = var(1) > 120
trigger1 = var(1)%4 < 2
flag = Invisible

[State 20000, DestroySelf]
type = DestroySelf
trigger1 = var(1) = 180

[State 20000, VelMul]
type = VelMul
trigger1 = vel x > 0
trigger1 = screenpos x + vel x > 350
trigger2 = vel x < 0
trigger2 = screenpos x + vel x  < 10
x = -1

[State 20000, VelMul]
type = VelMul
trigger1 = pos y >= 0
trigger1 = vel y > 0
x = 0.5
y = -0.5

[State 20000, ChangeState]
type = ChangeState
triggerall = roundstate > 2
trigger1 = pos y >= 0
trigger1 = vel y > -2.5
value = 20010

[State 20000, VelSet]
type = VelSet
trigger1 = pos y >= 0
trigger1 = vel y > -2.5
x = 0
y = 0

[State 20000, VelAdd]
type = VelAdd
trigger1 = vel y
y = 0.536

[State 20000, PosSet]
type = PosSet
trigger1 = pos y + vel y >= 0
y = 0

[State 20000, VelSet]
type = VelSet
triggerall = screenpos x < 5
trigger1 = vel x < (5 - screenpos x)*0.5
trigger2 = vel x < 4
x = ifelse((5 - screenpos x)*0.5 < 4, (5 - screenpos x)*0.5, 4)

[State 20000, VelSet]
type = VelSet
triggerall = screenpos x > 315
trigger1 = vel x > (315 - screenpos x)*0.5
trigger2 = vel x > -4
x = ifelse((315 - screenpos x)*0.5 > -4, (315 - screenpos x)*0.5, -4)

[State 20000, VelSet]
type = VelSet
triggerall = screenpos x != [5, 315]
trigger1 = pos y + vel y >= 0
y = -5

[State 20000, PosAdd]
type = PosAdd
trigger1 = screenpos x < 5
x =  5 - screenpos x

[State 20000, PosAdd]
type = PosAdd
trigger1 = screenpos x > 315
x = 315 - screenpos x

[State 20000, PosFreeze]
type = PosFreeze
trigger1 = pos y + vel y >= 0

;---------------------------------------------------------------
; Init
[Statedef 20001]
type = S
physics = N
anim = 9999

[State 20001, VarSet]
type = VarSet
trigger1 = 1
var(0) = 1

[State 20001, ChangeState]
type = ChangeState
trigger1 = 1
value = 20000

[Statedef 20002]
type = S
physics = N
anim = 9999

[State 20002, VarSet]
type = VarSet
trigger1 = 1
var(0) = 2

[State 20002, ChangeState]
type = ChangeState
trigger1 = 1
value = 20000

[Statedef 20003]
type = S
physics = N
anim = 9999

[State 20003, VarSet]
type = VarSet
trigger1 = 1
var(0) = 3

[State 20003, ChangeState]
type = ChangeState
trigger1 = 1
value = 20000

[Statedef 20004]
type = S
physics = N
anim = 9999

[State 20004, VarSet]
type = VarSet
trigger1 = 1
var(0) = 4

[State 20004, ChangeState]
type = ChangeState
trigger1 = 1
value = 20000

[Statedef 20005]
type = S
physics = N
anim = 9999

[State 20005, VarSet]
type = VarSet
trigger1 = 1
var(0) = 5

[State 20005, ChangeState]
type = ChangeState
trigger1 = 1
value = 20000

[Statedef 20006]
type = S
physics = N
anim = 9999

[State 20006, VarSet]
type = VarSet
trigger1 = 1
var(0) = 6

[State 20006, ChangeState]
type = ChangeState
trigger1 = 1
value = 20000

[Statedef 20007]
type = S
physics = N
anim = 9999

[State 20007, VarSet]
type = VarSet
trigger1 = 1
var(0) = 7

[State 20007, ChangeState]
type = ChangeState
trigger1 = 1
value = 20000

[Statedef 20008]
type = S
physics = N
anim = 9999

[State 20008, VarSet]
type = VarSet
trigger1 = 1
var(0) = 8

[State 20008, ChangeState]
type = ChangeState
trigger1 = 1
value = 20000

;---------------------------------------------------------------
; Collected
[Statedef 20010]
type = S
physics = N
velset = 0, -20 - var(0)*1.5
sprpriority = 5

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

[State 20010, ParentVarAdd]
type = ParentVarAdd
trigger1 = !time
trigger1 = var(0) < 5
var(39) = 100 + var(0)*100

[State 20010, ParentVarAdd]
type = ParentVarAdd
trigger1 = !time
trigger1 = var(0) = [5, 7]
var(39) = 1000*(var(0) - 4)

[State 20010, ParentVarAdd]
type = ParentVarAdd
trigger1 = !time
trigger1 = var(0) = 8
var(39) = 5000

[State 20010, ParentVarSet]
type = ParentVarSet
trigger1 = !time
var(40) = floor(pos x)

[State 20010, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 6010 + var(0)
elem = 1 + (gametime%20)/4

[State 20010, ChangeAnim]
type = ChangeAnim
trigger1 = gametime%4 = 0
value = anim
elem = animelemno(-1) + 1
persistent = 0

[State 20010, VelMul]
type = VelMul
trigger1 = 1
y = 0.7

[State 20010, DestroySelf]
type = DestroySelf
trigger1 = time > 15 + var(0)

;===============================================================
; End of Round Report
; var	0 = power score
;	1 = time score
;	2 = life score
;	3 = finish score
; 	4 = total score
;	5 = root initial level
;	6 = root new level
;	7 = new elemental weapon
;	10 = displaytime

[Statedef 30000]
type = S
physics = N
anim = 9999

[State 30000, ParentVarSet]
type = ParentVarSet
trigger1 = !time
trigger1 = root, var(20) > 15
trigger1 = numhelper(4100)
trigger1 = !((root, var(21)%100)/10)
trigger1 = var(7) := 1
var(21) = parent, var(21) + (1 - (parent, var(21)%100)/10)*10
persistent = 0

[State 30000, ParentVarSet]
type = ParentVarSet
trigger1 = !time
trigger1 = root, var(20) > 15
trigger1 = numhelper(4200)
trigger1 = !((root, var(21)%1000)/100)
trigger1 = var(7) := 1
var(21) = parent, var(21) + (1 - (parent, var(21)%1000)/100)*100
persistent = 0

[State 30000, ParentVarSet]
type = ParentVarSet
trigger1 = !time
trigger1 = root, var(20) > 15
trigger1 = numhelper(4300)
trigger1 = !((root, var(21)%10000)/1000)
trigger1 = var(7) := 1
var(21) = parent, var(21) + (1 - (parent, var(21)%10000)/1000)*1000
persistent = 0

[State 30000, RoundNotOver]
type = AssertSpecial
trigger1 = root, var(20) < root, var(40) || var(7)
flag = RoundNotOver

[State 30000, VarSet]
type = VarSet
trigger1 = !time
trigger1 = root, var(20) < root, var(40)
var(0) = root, power

[State 30000, VarSet]
type = VarSet
trigger1 = !time
trigger1 = root, var(20) < root, var(40)
trigger1 = numhelper(9999)
var(1) = 20000 - (helper(9999), var(30)/60)*200

[State 30000, VarSet]
type = VarSet
triggerall = root, var(20) < root, var(40)
trigger1 = root, wintime
var(1) = 0

[State 30000, VarSet]
type = VarSet
trigger1 = !time
trigger1 = root, var(20) < root, var(40)
trigger1 = numhelper(9999)
trigger1 = root, life < helper(9999), var(31)
var(2) = root, life*30000/helper(9999), var(31)

[State 30000, VarSet]
type = VarSet
trigger1 = !time
trigger1 = root, var(20) < root, var(40)
trigger1 = !numhelper(9999)
trigger1 = root, life < root, lifemax
var(2) = root, life*30000/root, lifemax

[State 30000, VarSet]
type = VarSet
triggerall = !time
triggerall = root, var(20) < root, var(40)
trigger1 = numhelper(9999)
trigger1 = root, life >= helper(9999), var(31)
trigger2 = !numhelper(9999)
trigger2 = root, life >= root, lifemax
var(2) = 50000

[State 30000, VarSet]
type = VarSet
trigger1 = !time
trigger1 = root, var(20) < root, var(40)
var(3) = 1000

[State 30000, VarSet]
type = VarSet
triggerall = !time
triggerall = root, var(20) < root, var(40)
triggerall = numhelper(9999)
trigger1 = helper(9999), var(32) = 210
trigger2 = helper(9999), var(32) = 240
trigger3 = helper(9999), var(32) = 410
trigger4 = helper(9999), var(32) = 440
trigger5 = helper(9999), var(32) = 610
trigger6 = helper(9999), var(32) = 660
trigger7 = helper(9999), var(32) = 640
trigger8 = helper(9999), var(32) = 670
trigger9 = helper(9999), var(32) = 900
trigger10 = helper(9999), var(32) = 910
var(3) = 2000

[State 30000, VarSet]
type = VarSet
triggerall = !time
triggerall = root, var(20) < root, var(40)
triggerall = numhelper(9999)
trigger1 = helper(9999), var(32) = 220
trigger2 = helper(9999), var(32) = 250
trigger3 = helper(9999), var(32) = 260
trigger4 = helper(9999), var(32) = 420
trigger5 = helper(9999), var(32) = 450
trigger6 = helper(9999), var(32) = 460
trigger7 = helper(9999), var(32) = 620
trigger8 = helper(9999), var(32) = 650
trigger9 = helper(9999), var(32) = 680
var(3) = 3000

[State 30000, VarSet]
type = VarSet
triggerall = root, var(20) < root, var(40)
trigger1 = helper(9999), var(32) = [800, 899]
var(3) = 5000

[State 30000, VarSet]
type = VarSet
triggerall = !time
triggerall = root, var(20) < root, var(40)
triggerall = numhelper(9999)
trigger1 = helper(9999), var(32) = [1000, 1999]
var(3) = 10000

[State 30000, VarSet]
type = VarSet
triggerall = !time
triggerall = root, var(20) < root, var(40)
triggerall = numhelper(9999)
trigger1 = helper(9999), var(32) = [2000, 2199]
trigger2 = helper(9999), var(32) = 4000
var(3) = 30000

[State 30000, VarSet]
type = VarSet
triggerall = !time
triggerall = root, var(20) < root, var(40)
triggerall = numhelper(9999)
trigger1 = helper(9999), var(32) = [2200, 2299]
var(3) = 50000

[State 30000, VarSet]
type = VarSet
triggerall = root, var(20) < root, var(40)
trigger1 = root, wintime
var(3) = 0

[State 30000, ParentVarAdd]
type = ParentVarAdd
trigger1 = root, var(20) < root, var(40)
var(19) = -var(4)

[State 30000, VarSet]
type = VarSet
trigger1 = root, var(20) < root, var(40)
var(4) = var(0) + var(1) + var(2) + var(3)

[State 30000, ParentVarAdd]
type = ParentVarAdd
trigger1 = root, var(20) < root, var(40)
var(19) = var(4)

[State 30000, VarSet]
type = VarSet
triggerall = root, var(20) < root, var(40)
trigger1 = root, stateno = [180, 181]
trigger1 = root, time = 70
var(5) = root, var(20)

[State 30000, ChangeState]
type = ChangeState
triggerall = root, var(20) < root, var(40)
trigger1 = root, stateno = [180, 181]
trigger1 = root, time = 70
trigger1 = root, var(19) >= ceil(root, var(39)*(root, fvar(17)**(root,var(20)-1)))
value = 30001

[State 30000, ChangeState]
type = ChangeState
triggerall = root, var(20) < root, var(40) || var(7)
trigger1 = root, stateno = [180, 181]
trigger1 = root, time = 70
value = 30002 + (root, var(20) >= root, var(40))

[State 30000, DestroySelf]
type = DestroySelf
trigger1 = roundstate < 3

;---------------------------------------------------------------
; Level Up Loop
[Statedef 30001]
type = S
physics = N
anim = 9999

[State 30001, ParentVarAdd]
type = ParentVarAdd
trigger1 = root, var(20) < root, var(40)
var(19) = -ceil(root, var(39)*(root, fvar(17)**(root,var(20)-1)))

[State 30001, ParentVarAdd]
type = ParentVarAdd
trigger1 = root, var(20) < root, var(40)
var(20) = 1

[State 30001, ParentVarSet]
type = ParentVarSet
trigger1 = root, var(20) >= root, var(40)
var(19) = 0

[State 30001, ChangeState]
type = ChangeState
trigger1 = root, var(19) >= ceil(root, var(39)*(root, fvar(17)**(root,var(20)-1)))
value = 30001

[State 30001, ChangeState]
type = ChangeState
trigger1 = 1
value = 30002

;---------------------------------------------------------------
; Report Display
[Statedef 30002]
type = S
physics = N
anim = 9999

[State Report, VarSet]
type = VarSet
trigger1 = !time
var(6) = root, var(20)

[State Report, RoundNotOver]
type = AssertSpecial
trigger1 = 1
flag = RoundNotOver

[State Report, PosAdd]
type = PosAdd
trigger1 = 1
x = -screenpos x + 24
y = -screenpos y + 56

[State Report, PlaySnd]
type = PlaySnd
trigger1 = var(10) = 0
value = 6500, 0
abspan = 0
channel = 0

[State Report, Explod]
type = Explod
trigger1 = var(10) = 0
anim = 6100
id = 6100
bindtime = -1
pos = 96, 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (0, 10]
id = 6100
scale = 1, 0.1*(var(10) - 0)

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 10
id = 6100
scale = 1, 1
persistent = 0

[State Report, PlaySnd]
type = PlaySnd
trigger1 = var(10) > 29
value = 6500, 0
abspan = 0
persistent = 0
channel = 0

[State Report, Explod]
type = Explod
trigger1 = var(10) > 29
anim = 6106
id = 6116
bindtime = -1
pos = 127, 14
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0, 1
ownpal = 1
persistent = 0

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (30, 40]
id = 6116
scale = 0.1*(var(10) - 30), 1

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 39
id = 6116
scale = 1, 1
persistent = 0

[State Report, Explod]
type = Explod
trigger1 = var(10) > 29
anim = 6101
id = 6101
bindtime = -1
pos = 16, 32
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Power]
type = Explod
trigger1 = var(10) > 29
anim = 6110 + var(0)%10
id = 6101
bindtime = -1
pos = 224, 32
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Power]
type = Explod
triggerall = var(0) > 9
trigger1 = var(10) > 29
anim = 6110 + (var(0)/10)%10
id = 6101
bindtime = -1
pos = 208, 32
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Power]
type = Explod
trigger1 = var(10) > 29
trigger1 = var(0) > 99
anim = 6110 + (var(0)/100)%10
id = 6101
bindtime = -1
pos = 192, 32
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Power]
type = Explod
trigger1 = var(10) > 29
trigger1 = var(0) > 999
anim = 6110 + (var(0)/1000)%10
id = 6101
bindtime = -1
pos = 176, 32
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Power]
type = Explod
trigger1 = var(10) > 29
trigger1 = var(0) > 9999
anim = 6110 + (var(0)/10000)%10
id = 6101
bindtime = -1
pos = 160, 32
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Power]
type = Explod
trigger1 = var(10) > 29
trigger1 = var(0) > 99999
anim = 6110 + (var(0)/100000)%10
id = 6101
bindtime = -1
pos = 144, 32
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (30, 40]
id = 6101
scale = 1, 0.1*(var(10) - 30)

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 39
id = 6101
scale = 1, 1
persistent = 0

[State Report, PlaySnd]
type = PlaySnd
trigger1 = var(10) > 59
value = 6500, 0
abspan = 0
persistent = 0
channel = 0

[State Report, Explod]
type = Explod
trigger1 = var(10) > 59
anim = 6102
id = 6102
bindtime = -1
pos = 16, 48
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Time]
type = Explod
trigger1 = var(10) > 59
anim = 6110 + var(1)%10
id = 6102
bindtime = -1
pos = 224, 48
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Time]
type = Explod
triggerall = var(1) > 9
trigger1 = var(10) > 59
anim = 6110 + (var(1)/10)%10
id = 6102
bindtime = -1
pos = 208, 48
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Time]
type = Explod
trigger1 = var(10) > 59
trigger1 = var(1) > 99
anim = 6110 + (var(1)/100)%10
id = 6102
bindtime = -1
pos = 192, 48
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Time]
type = Explod
trigger1 = var(10) > 59
trigger1 = var(1) > 999
anim = 6110 + (var(1)/1000)%10
id = 6102
bindtime = -1
pos = 176, 48
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Time]
type = Explod
trigger1 = var(10) > 59
trigger1 = var(1) > 9999
anim = 6110 + (var(1)/10000)%10
id = 6102
bindtime = -1
pos = 160, 48
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Time]
type = Explod
trigger1 = var(10) > 59
trigger1 = var(1) > 99999
anim = 6110 + (var(1)/100000)%10
id = 6102
bindtime = -1
pos = 144, 48
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (60, 70]
id = 6102
scale = 1, 0.1*(var(10) - 60)

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 69
id = 6102
scale = 1, 1
persistent = 0

[State Report, PlaySnd]
type = PlaySnd
trigger1 = var(10) > 89
value = 6500, 0
abspan = 0
persistent = 0
channel = 0

[State Report, Explod]
type = Explod
trigger1 = var(10) > 89
anim = 6103
id = 6103
bindtime = -1
pos = 16, 64
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Life]
type = Explod
trigger1 = var(10) > 89
anim = 6110 + var(2)%10
id = 6103
bindtime = -1
pos = 224, 64
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Life]
type = Explod
triggerall = var(2) > 9
trigger1 = var(10) > 89
anim = 6110 + (var(2)/10)%10
id = 6103
bindtime = -1
pos = 208, 64
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Life]
type = Explod
trigger1 = var(10) > 89
trigger1 = var(2) > 99
anim = 6110 + (var(2)/100)%10
id = 6103
bindtime = -1
pos = 192, 64
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Life]
type = Explod
trigger1 = var(10) > 89
trigger1 = var(2) > 999
anim = 6110 + (var(2)/1000)%10
id = 6103
bindtime = -1
pos = 176, 64
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Life]
type = Explod
trigger1 = var(10) > 89
trigger1 = var(2) > 9999
anim = 6110 + (var(2)/10000)%10
id = 6103
bindtime = -1
pos = 160, 64
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Life]
type = Explod
trigger1 = var(10) > 89
trigger1 = var(2) > 99999
anim = 6110 + (var(2)/100000)%10
id = 6103
bindtime = -1
pos = 144, 64
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (90, 100]
id = 6103
scale = 1, 0.1*(var(10) - 90)

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 99
id = 6103
scale = 1, 1
persistent = 0

[State Report, PlaySnd]
type = PlaySnd
trigger1 = var(10) > 119
value = 6500, 0
abspan = 0
persistent = 0
channel = 0

[State Report, Explod]
type = Explod
trigger1 = var(10) > 119
anim = 6104
id = 6104
bindtime = -1
pos = 16, 80
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Finish]
type = Explod
trigger1 = var(10) > 119
anim = 6110 + var(3)%10
id = 6104
bindtime = -1
pos = 224, 80
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Finish]
type = Explod
triggerall = var(3) > 9
trigger1 = var(10) > 119
anim = 6110 + (var(3)/10)%10
id = 6104
bindtime = -1
pos = 208, 80
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Finish]
type = Explod
trigger1 = var(10) > 119
trigger1 = var(3) > 99
anim = 6110 + (var(3)/100)%10
id = 6104
bindtime = -1
pos = 192, 80
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Finish]
type = Explod
trigger1 = var(10) > 119
trigger1 = var(3) > 999
anim = 6110 + (var(3)/1000)%10
id = 6104
bindtime = -1
pos = 176, 80
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Finish]
type = Explod
trigger1 = var(10) > 119
trigger1 = var(3) > 9999
anim = 6110 + (var(3)/10000)%10
id = 6104
bindtime = -1
pos = 160, 80
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Finish]
type = Explod
trigger1 = var(10) > 119
trigger1 = var(3) > 99999
anim = 6110 + (var(3)/100000)%10
id = 6104
bindtime = -1
pos = 144, 80
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (120, 130]
id = 6104
scale = 1, 0.1*(var(10) - 120)

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 129
id = 6104
scale = 1, 1
persistent = 0

[State Report, PlaySnd]
type = PlaySnd
trigger1 = var(10) > 149
value = 6500, 0
abspan = 0
persistent = 0
channel = 0

[State Report, Explod]
type = Explod
trigger1 = var(10) > 149
anim = 6105
id = 6105
bindtime = -1
pos = 0, 112
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Total]
type = Explod
trigger1 = var(10) > 149
anim = 6110 + var(4)%10
id = 6105
bindtime = -1
pos = 224, 112
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Total]
type = Explod
triggerall = var(4) > 9
trigger1 = var(10) > 149
anim = 6110 + (var(4)/10)%10
id = 6105
bindtime = -1
pos = 208, 112
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Total]
type = Explod
trigger1 = var(10) > 149
trigger1 = var(4) > 99
anim = 6110 + (var(4)/100)%10
id = 6105
bindtime = -1
pos = 192, 112
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Total]
type = Explod
trigger1 = var(10) > 149
trigger1 = var(4) > 999
anim = 6110 + (var(4)/1000)%10
id = 6105
bindtime = -1
pos = 176, 112
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Total]
type = Explod
trigger1 = var(10) > 149
trigger1 = var(4) > 9999
anim = 6110 + (var(4)/10000)%10
id = 6105
bindtime = -1
pos = 160, 112
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Total]
type = Explod
trigger1 = var(10) > 149
trigger1 = var(4) > 99999
anim = 6110 + (var(4)/100000)%10
id = 6105
bindtime = -1
pos = 144, 112
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, Total]
type = Explod
trigger1 = var(10) > 149
trigger1 = var(4) > 999999
anim = 6110 + (var(4)/1000000)%10
id = 6105
bindtime = -1
pos = 128, 112
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (150, 160]
id = 6105
scale = 1, 0.1*(var(10) - 150)

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 160
id = 6105
scale = 1, 1
persistent = 0

[State Report, Explod]
type = Explod
trigger1 = var(10) > 149
anim = 6106
id = 6106
bindtime = -1
pos = 127, 94
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0, 1
ownpal = 1
persistent = 0

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (150, 160]
id = 6106
scale = 0.1*(var(10) - 150), 1

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 159
id = 6106
scale = 1, 1
persistent = 0

[State Report, Text]
type = Helper
trigger1 = var(5) < var(6)
trigger1 = var(10) > 179
name = "l"
id = 30010
stateno = 30010
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
postype = left
pos = floor(root, screenpos x), floor(root, pos y) - 8
persistent = 0
size.xscale = 1
size.yscale = 1

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(20) = [1, 3)
var(21) = parent, var(21) - parent, var(21)%10 + 1
persistent = 0

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(20) = [3, 10)
var(21) = parent, var(21) - parent, var(21)%10 + 2
persistent = 0

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(20) = [10, 19)
var(21) = parent, var(21) - parent, var(21)%10 + 3
persistent = 0

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(20) = [19, 32)
var(21) = parent, var(21) - parent, var(21)%10 + 4
persistent = 0

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(20) = [1, 28)
trigger1 = ((root, var(21)%100000)/10000)
var(21) = parent, var(21) - ((parent, var(21)%100000)/10000)*10000

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(20) > 27
trigger1 = !((root, var(21)%100000)/10000)
var(21) = parent, var(21) + (1 - (parent, var(21)%100000)/10000)*10000
persistent = 0

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(20) > 31
var(21) = parent, var(21) - parent, var(21)%10 + 5
persistent = 0

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(9) < 6
var(9) = parent, var(21)%10
persistent = 0

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(9) = 9
trigger1 = !((root, var(21)%100000)/10000)
var(9) = parent, var(21)%10
persistent = 0

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(20) = [1, 6)
var(10) = 1
persistent = 0

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(20) = [6, 14)
var(10) = 2
persistent = 0

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(20) = [14, 25)
var(10) = 3
persistent = 0

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(20) = [25, 30)
var(10) = 4
persistent = 0

[State Report, ParentVarSet]
type = ParentVarSet
trigger1 = var(10) > 179
trigger1 = parent, var(20) > 29
var(10) = 5
persistent = 0

[State Report, ChangeState]
type = ChangeState
trigger1 = var(10) > 209
value = 30003

[State Report, VarAdd]
type = VarAdd
trigger1 = 1
var(10) = 1

[State Report, VarAdd]
type = VarAdd
trigger1 = root, command = "holddown"
trigger2 = root, command = "holdback"
trigger3 = root, command = "holdfwd"
trigger4 = root, command = "holdup"
trigger5 = root, command = "holda"
trigger6 = root, command = "holdb"
trigger7 = root, command = "holdc"
trigger8 = root, command = "holdx"
trigger9 = root, command = "holdy"
trigger10 = root, command = "holdz"
var(10) = 1

[State Report, VarAdd]
type = VarAdd
triggerall = var(10) < 150
triggerall = var(10)%30 > 10
trigger1 = root, command = "holddown"
trigger2 = root, command = "holdback"
trigger3 = root, command = "holdfwd"
trigger4 = root, command = "holdup"
trigger5 = root, command = "holda"
trigger6 = root, command = "holdb"
trigger7 = root, command = "holdc"
trigger8 = root, command = "holdx"
trigger9 = root, command = "holdy"
trigger10 = root, command = "holdz"
var(10) = 30 - var(10)%30

;---------------------------------------------------------------
; Level Display
[Statedef 30003]
type = S
physics = N
anim = 9999

[State Level, VarSet]
type = VarSet
trigger1 = !time
var(10) = 0

[State Level, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 6100

[State Level, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 6101

[State Level, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 6102

[State Level, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 6103

[State Level, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 6104

[State Level, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 6105

[State Level, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 6106

[State Level, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 6116

[State Level, RoundNotOver]
type = AssertSpecial
trigger1 = var(10) < 300
flag = RoundNotOver

[State Level, PosAdd]
type = PosAdd
trigger1 = 1
x = -screenpos x + 24
y = -screenpos y + 56

[State Level, PlaySnd]
type = PlaySnd
trigger1 = var(10) = 0
value = 6500, 0
abspan = 0
channel = 0

[State Level, Explod]
type = Explod
trigger1 = var(10) = 0
anim = 6107
id = 6107
bindtime = -1
pos = 80 - 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1

[State Level, Level]
type = Explod
trigger1 = 1
anim = 6110 + root, var(20)%10
id = 6107
bindtime = -1
pos = 172 + 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, Level]
type = Explod
trigger1 = root, var(20) > 9
anim = 6110 + (root, var(20)/10)%10
id = 6107
bindtime = -1
pos = 156 + 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, Level]
type = Explod
trigger1 = root, var(20) > 99
anim = 6110 + (root, var(20)/100)%10
id = 6107
bindtime = -1
pos = 140 + 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, Level]
type = Explod
trigger1 = root, var(20) > 999
anim = 6110 + (root, var(20)/1000)%10
id = 6107
bindtime = -1
pos = 124 + 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (0, 10]
id = 6107
scale = 1, 0.1*(var(10) - 0)

[State Level, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 10
id = 6107
scale = 1, 1
persistent = 0

[State Level, PlaySnd]
type = PlaySnd
trigger1 = var(10) > 29
value = 6500, 0
abspan = 0
persistent = 0
channel = 0

[State Level, Explod]
type = Explod
trigger1 = var(10) > 29
anim = 6106
id = 6106
bindtime = -1
pos = 127, 14
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0, 1
ownpal = 1
persistent = 0

[State Level, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (30, 40]
id = 6106
scale = 0.1*(var(10) - 30), 1

[State Level, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 39
id = 6106
scale = 1, 1
persistent = 0

[State Level, Weapon]
type = Explod
trigger1 = var(10) > 29
anim = 6200 + (((root, var(21)%100)/10) != 0)
id = 6200
bindtime = -1
pos = 72, 53
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0, 0
ownpal = 1
persistent = 0

[State Level, Weapon]
type = Explod
trigger1 = var(10) > 29
anim = 6202 + (((root, var(21)%1000)/100) != 0)
id = 6200
bindtime = -1
pos = 104, 53
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0, 0
ownpal = 1
persistent = 0

[State Level, Weapon]
type = Explod
trigger1 = var(10) > 29
anim = 6204 + (((root, var(21)%10000)/1000) != 0)
id = 6200
bindtime = -1
pos = 136, 53
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0, 0
ownpal = 1
persistent = 0

[State Level, Weapon]
type = Explod
trigger1 = var(10) > 29
anim = 6206 + (((root, var(21)%100000)/10000) != 0)
id = 6200
bindtime = -1
pos = 168, 53
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0, 0
ownpal = 1
persistent = 0

[State Level, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (30, 40]
id = 6200
scale = 0.05*(var(10) - 30), 0.05*(var(10) - 30)

[State Level, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 39
id = 6200
scale = 0.5, 0.5
persistent = 0

[State Level, PlaySnd]
type = PlaySnd
trigger1 = var(10) > 59
value = 6500, 0
abspan = 0
persistent = 0
channel = 0

[State Level, Explod]
type = Explod
trigger1 = var(10) > 59
anim = 6106
id = 6108
bindtime = -1
pos = 127, 78
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0, 1
ownpal = 1
persistent = 0

[State Level, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (60, 70]
id = 6108
scale = 0.1*(var(10) - 60), 1

[State Level, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 69
id = 6108
scale = 1, 1
persistent = 0

[State Level, Achilles Rush]
type = Explod
trigger1 = var(10) > 59
anim = 6300 + (root, var(20) > 7)
id = 6300
bindtime = -1
pos = 16, 88
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, Achilles Revenge]
type = Explod
trigger1 = var(10) > 59
anim = 6302 + (root, var(20) > 19)
id = 6300
bindtime = -1
pos = 16, 96
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, Gaia]
type = Explod
trigger1 = var(10) > 59
anim = 6304 + (root, var(20) > 30 || (root, var(16) && root, var(20) > 22))
id = 6300
bindtime = -1
pos = 16, 104
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, Gigas]
type = Explod
triggerall = var(10) > 59
trigger1 = !numhelper(9998)
trigger2 = !helper(9998), var(4)
anim = 6306 + (root, var(20) > 31 || (root, var(16) && root, var(20) > 25))
id = 6300
bindtime = -1
pos = 16, 112
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, Gigas]
type = Explod
trigger1 = var(10) > 59
trigger1 = numhelper(9998)
trigger1 = helper(9998), var(4)
anim = 6308 + (root, var(20) > 31 || (root, var(16) && root, var(20) > 26))
id = 6300
bindtime = -1
pos = 16, 112
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, P Charge]
type = Explod
trigger1 = root, var(16)
trigger1 = var(10) > 59
anim = 6310 + (root, var(20) > 11)
id = 6300
bindtime = -1
pos = 16, 120
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, P Tackle]
type = Explod
trigger1 = root, var(16)
trigger1 = var(10) > 59
anim = 6312 + (root, var(20) > 14)
id = 6300
bindtime = -1
pos = 16, 128
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, Apollo]
type = Explod
trigger1 = root, var(16)
trigger1 = var(10) > 59
anim = 6314 + (root, var(20) > 4)
id = 6300
bindtime = -1
pos = 16, 136
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, Jupiter]
type = Explod
trigger1 = root, var(16)
trigger1 = var(10) > 59
anim = 6316 + (root, var(21)%10 > 4)
id = 6300
bindtime = -1
pos = 16, 144
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1
persistent = 0

[State Level, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) = (60, 70]
id = 6300
scale = 1, 0.1*(var(10) - 60)

[State Level, ModifyExplod]
type = ModifyExplod
trigger1 = var(10) > 69
id = 6300
scale = 1, 1
persistent = 0

[State Level, VarAdd]
type = VarAdd
trigger1 = 1
var(10) = 1

[State Level, VarAdd]
type = VarAdd
trigger1 = root, command = "holddown"
trigger2 = root, command = "holdback"
trigger3 = root, command = "holdfwd"
trigger4 = root, command = "holdup"
trigger5 = root, command = "holda"
trigger6 = root, command = "holdb"
trigger7 = root, command = "holdc"
trigger8 = root, command = "holdx"
trigger9 = root, command = "holdy"
trigger10 = root, command = "holdz"
var(10) = 1

[State Level, VarAdd]
type = VarAdd
triggerall = var(10) < 150
triggerall = var(10)%30 > 10
trigger1 = root, command = "holddown"
trigger2 = root, command = "holdback"
trigger3 = root, command = "holdfwd"
trigger4 = root, command = "holdup"
trigger5 = root, command = "holda"
trigger6 = root, command = "holdb"
trigger7 = root, command = "holdc"
trigger8 = root, command = "holdx"
trigger9 = root, command = "holdy"
trigger10 = root, command = "holdz"
var(10) = 30 - var(10)%30

;---------------------------------------------------------------
; Level Up Text
[Statedef 30010]
type = S
physics = N
anim = 6020
velset = 0, -5
sprpriority = 5

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

[State 30010, PosAdd]
type = PosAdd
trigger1 = !time
x = 4

[State 30010, PosAdd]
type = PosAdd
trigger1 = !time
trigger1 = root, anim = 180
x = 48*root, const(size.xscale)*root, facing

[State 30010, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 6500, 1

[State 30010, DestroySelf]
type = DestroySelf
trigger1 = time > 70

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

[State 30010, AngleDraw]
type = AngleDraw
trigger1 = time = (50, 70]
scale = 1 + 0.05*(time - 50), (70 - time)*0.05

;---------------------------------------------------------------
; Leveler
; var(0) = continuing
; var(1) = round start delay
; var(2) = 1 random elemental sword
; var(3) = 2 random elemental swords

[Statedef 30099]
type = S
physics = N
anim = 9999

[State 30099, ChangeState]
type = ChangeState
trigger1 = var(0) := 1
trigger1 = var(2) := random%3 || 1
trigger1 = var(3) := random%3 || 1
value = 30100

[Statedef 30100]
type = S
physics = N
anim = 9999

[State 30100, ChangeState]
type = ChangeState
trigger1 = root, var(19) >= ceil(root, var(39)*(root, fvar(17)**(root,var(20)-1)))
value = 30101

[State 30100, ChangeState]
type = ChangeState
trigger1 = 1
value = 30102

[Statedef 30101]
type = S
physics = N
anim = 9999

[State 30101, ParentVarAdd]
type = ParentVarAdd
trigger1 = root, var(20) < root, var(40)
var(19) = -ceil(root, var(39)*(root, fvar(17)**(root,var(20)-1)))

[State 30101, ParentVarAdd]
type = ParentVarAdd
trigger1 = root, var(20) < root, var(40)
var(20) = 1

[State 30101, ParentVarSet]
type = ParentVarSet
trigger1 = root, var(20) >= root, var(40)
var(19) = 0

[State 30101, ChangeState]
type = ChangeState
trigger1 = root, var(19) >= ceil(root, var(39)*(root, fvar(17)**(root,var(20)-1)))
value = 30101

[State 30101, ChangeState]
type = ChangeState
trigger1 = 1
value = 30102

[Statedef 30102]
type = S
physics = N
anim = 9999

[State 30102, BindToParent]
type = BindToParent
trigger1 = 1
facing = parent, facing
pos = -8*root, const(size.xscale), -48*root, const(size.yscale)

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(20) = [1, 3)
var(21) = parent, var(21) - parent, var(21)%10 + 1

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(20) = [3, 10)
var(21) = parent, var(21) - parent, var(21)%10 + 2

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(20) = [10, 19)
var(21) = parent, var(21) - parent, var(21)%10 + 3

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(20) = [19, 32)
var(21) = parent, var(21) - parent, var(21)%10 + 4

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(20) = [1, 28)
trigger1 = ((root, var(21)%100000)/10000)
var(21) = parent, var(21) - ((parent, var(21)%100000)/10000)*10000

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(20) > 27
trigger1 = !((root, var(21)%100000)/10000)
var(21) = parent, var(21) + (1 - (parent, var(21)%100000)/10000)*10000

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(20) > 31
var(21) = parent, var(21) - parent, var(21)%10 + 5

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(9) < 6
var(9) = parent, var(21)%10

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(9) = 9
trigger1 = !((root, var(21)%100000)/10000)
var(9) = parent, var(21)%10

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(20) = [1, 6)
var(10) = 1

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(20) = [6, 14)
var(10) = 2

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(20) = [14, 25)
var(10) = 3

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(20) = [25, 30)
var(10) = 4

[State 30102, ParentVarSet]
type = ParentVarSet
trigger1 = parent, var(20) > 29
var(10) = 5

[State 30102, VarAdd]
type = VarAdd
trigger1 = root, command = "holdup"
var(4) = 1

[State 30102, VarAdd]
type = VarAdd
trigger1 = root, command = "holddown"
var(4) = -1

[State 30102, VarSet]
type = VarSet
trigger1 = var(4) > 0
trigger1 = root, command != "holdup" || root, command = "holddown"
trigger2 = var(4) < 0
trigger2 = root, command != "holddown" || root, command = "holdup"
var(4) = 0

[State 30102, PlaySnd]
type = PlaySnd
triggerall = var(0)
trigger1 = root, command = "up" || root, command = "holdup" && (var(4) > 30 && var(4)%5 = 0)
trigger1 = parent, var(20) < parent, var(40)
trigger2 = root, command = "down" || root, command = "holddown" && (var(4) < -30 && (-var(4))%5 = 0)
trigger2 = parent, var(20) > 1
value = 6500, 0
abspan = 0
channel = 0

[State 30102, ParentVarAdd]
type = ParentVarAdd
triggerall = var(0)
trigger1 = root, command = "up"
trigger1 = parent, var(20) < parent, var(40)
trigger1 = var(1) := 60
var(20) = 1

[State 30102, ParentVarAdd]
type = ParentVarAdd
triggerall = var(0)
trigger1 = root, command = "holdup" && (var(4) > 30 && var(4)%5 = 0)
trigger1 = parent, var(20) < parent, var(40)
trigger1 = var(1) := 60
var(20) = ifelse((parent, var(20) + parent, var(40)/50 < parent, var(40)), (1 + parent, var(40)/50), (parent, var(40) - parent, var(20)))

[State 30102, ParentVarAdd]
type = ParentVarAdd
triggerall = var(0)
trigger1 = root, command = "down"
trigger1 = parent, var(20) > 1
trigger1 = var(1) := 60
var(20) = -1

[State 30102, ParentVarAdd]
type = ParentVarAdd
triggerall = var(0)
trigger1 = root, command = "holddown" && (var(4) < -30 && (-var(4))%5 = 0)
trigger1 = parent, var(20) > 1
trigger1 = var(1) := 60
var(20) = ifelse((parent, var(20) - parent, var(40)/50 > 1), (-1 - parent, var(40)/50), (1 - parent, var(20)))

[State 30102, ParentVarSet]
type = ParentVarSet
triggerall = var(0)
trigger1 = parent, var(20) < 18
trigger1 = (root, var(21)%10000)/10
var(21) = parent, var(21)%10 + (parent, var(21)/10000)*10000

[State 30102, ParentVarSet]
type = ParentVarSet
triggerall = var(0)
trigger1 = parent, var(20) = [18, 22)
trigger1 = var(2) = 0
var(21) = parent, var(21)%10 + (parent, var(21)/10000)*10000 + 10

[State 30102, ParentVarSet]
type = ParentVarSet
triggerall = var(0)
trigger1 = parent, var(20) = [18, 22)
trigger1 = var(2) = 1
var(21) = parent, var(21)%10 + (parent, var(21)/10000)*10000 + 100

[State 30102, ParentVarSet]
type = ParentVarSet
triggerall = var(0)
trigger1 = parent, var(20) = [18, 22)
trigger1 = var(2) = 2
var(21) = parent, var(21)%10 + (parent, var(21)/10000)*10000 + 1000

[State 30102, ParentVarSet]
type = ParentVarSet
triggerall = var(0)
trigger1 = parent, var(20) = [22, 26)
trigger1 = var(3) = 0
var(21) = parent, var(21)%10 + (parent, var(21)/10000)*10000 + 110

[State 30102, ParentVarSet]
type = ParentVarSet
triggerall = var(0)
trigger1 = parent, var(20) = [22, 26)
trigger1 = var(3) = 1
var(21) = parent, var(21)%10 + (parent, var(21)/10000)*10000 + 1010

[State 30102, ParentVarSet]
type = ParentVarSet
triggerall = var(0)
trigger1 = parent, var(20) = [22, 26)
trigger1 = var(3) = 2
var(21) = parent, var(21)%10 + (parent, var(21)/10000)*10000 + 1100

[State 30102, ParentVarSet]
type = ParentVarSet
triggerall = var(0)
trigger1 = parent, var(20) > 25
var(21) = parent, var(21)%10 + (parent, var(21)/10000)*10000 + 1110

[State 30102, Intro]
type = AssertSpecial
trigger1 = var(1)
flag = Intro

[State 30102, VarAdd]
type = VarAdd
trigger1 = var(1)
var(1) = -1

[State 30102, RemoveExplod]
type = RemoveExplod
triggerall = var(0)
trigger1 = var(1) != root, var(20)
trigger2 = roundstate > 1
id = 6100

[State 30102, Explod]
type = Explod
triggerall = var(0)
trigger1 = var(1) != root, var(20)
anim = 6107
id = 6100
bindtime = -1
pos = -48 - 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 1
ownpal = 1

[State 30102, Level]
type = Explod
triggerall = var(0)
trigger1 = var(1) != root, var(20)
anim = 6110 + root, var(20)%10
id = 6100
bindtime = -1
pos = 44 + 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 1
ownpal = 1

[State 30102, Level]
type = Explod
triggerall = var(0)
trigger1 = var(1) != root, var(20)
trigger1 = root, var(20) > 9
anim = 6110 + (root, var(20)/10)%10
id = 6100
bindtime = -1
pos = 28 + 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 1
ownpal = 1

[State 30102, Level]
type = Explod
triggerall = var(0)
trigger1 = var(1) != root, var(20)
trigger1 = root, var(20) > 99
anim = 6110 + (root, var(20)/100)%10
id = 6100
bindtime = -1
pos = 12 + 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 1
ownpal = 1

[State 30102, Level]
type = Explod
triggerall = var(0)
trigger1 = var(1) != root, var(20)
trigger1 = root, var(20) > 999
anim = 6110 + (root, var(20)/1000)%10
id = 6100
bindtime = -1
pos = -4 + 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 1
ownpal = 1

[State 30102, VarSet]
type = VarSet
trigger1 = var(0)
var(1) = root, var(20)

[State 30102, DestroySelf]
type = DestroySelf
trigger1 = roundstate > 1

;---------------------------------------------------------------
; Continue Display
[Statedef 30200]
type = S
physics = N
anim = 9999

[State 30200, PosAdd]
type = PosAdd
trigger1 = teamside = 1
x = -screenpos x + 56 + 8*floor(log(10, (root, var(20))))
y = -screenpos y + 64

[State 30200, PosAdd]
type = PosAdd
trigger1 = teamside = 2
x = -screenpos x + 252 - 8*floor(log(10, (root, var(20))))
y = -screenpos y + 96

[State 30200, Explod]
type = Explod
trigger1 = time = 0
anim = 6107
id = 6100
bindtime = -1
pos = -48 - 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1

[State 30200, Level]
type = Explod
trigger1 = time = 0
anim = 6110 + root, var(20)%10
id = 6100
bindtime = -1
pos = 44 + 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1

[State 30200, Level]
type = Explod
trigger1 = time = 0
trigger1 = root, var(20) > 9
anim = 6110 + (root, var(20)/10)%10
id = 6100
bindtime = -1
pos = 28 + 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1

[State 30200, Level]
type = Explod
trigger1 = time = 0
trigger1 = root, var(20) > 99
anim = 6110 + (root, var(20)/100)%10
id = 6100
bindtime = -1
pos = 12 + 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1

[State 30200, Level]
type = Explod
trigger1 = time = 0
trigger1 = root, var(20) > 999
anim = 6110 + (root, var(20)/1000)%10
id = 6100
bindtime = -1
pos = -4 + 8*floor(log(10, (root, var(20)))), 0
ontop = 1
pausemovetime = 99999
supermovetime = 99999
scale = 1, 0
ownpal = 1

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = time = (0, 10]
id = 6100
scale = 1, 0.1*(time - 0)

[State Report, ModifyExplod]
type = ModifyExplod
trigger1 = time > 10
id = 6100
scale = 1, 1
persistent = 0

