; Helpers
;---------------------------------------------------------------------------
; Sabre Slash Short Blade
[Statedef 245]
statetype = A
movetype = A
physics = N
juggle = 10
sprpriority = 20
velset = 3 * const(size.xscale),0
anim = 245
ctrl = 0

[State 245, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 0
value = 1.25

[State 245, VarAdd]
type = VarAdd
trigger1 = Time > 5
trigger1 = FVar(0) < 2
fv = 0
value = 0.05

[State 245, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 1
value = 1

[State 245, VarAdd]
type = VarAdd
trigger1 = Time > 5
trigger1 = FVar(1) > 0
fv = 1
value = -0.1

[State 245, AttackMulSet]
type = AttackMulSet
trigger1 = Root, Var(55) > 0
ignorehitpause = 1
value = 0.5

[State 245, NotHitBy]
type = NotHitBy
trigger1 = 1
ignorehitpause = 1
value = SCA
time = 1

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

[State 245, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 20

[State 245, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 245, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 245, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 245, 2]
type = HitDef
trigger1 = Time <= 0
attr = A, SP
damage = 60, 0
animtype = Medium
guardflag = MA
hitflag = MAF-
priority = 3, Hit
pausetime = Ifelse(Root, Var(55) > 0, 0, 1), Ifelse(Root, Var(55) > 0, 0, 5)
sparkno = 2
sparkxy = ceil(-10 * Const(size.xscale)), 0
hitsound = S2, 1
guardsound = S2, 0
ground.type = Low
ground.slidetime = 10
ground.hittime = 10
ground.velocity = -6
airguard.velocity = -2,-1
air.type = Low
air.velocity = -3,-2
air.hittime = 10

[State 245, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = FVar(0), FVar(1)

[State 245, VelMul]
type = VelMul
trigger1 = Time > 5
x = .9

[State 245, Destroy]
type = DestroySelf
triggerall = Time > 0
trigger1 = BackEdgeBodyDist <= -1000
trigger2 = FrontEdgeBodyDist <= -100
trigger3 = AnimTime = 0
trigger4 = FVar(1) < 0
trigger5 = Vel X <= 0
trigger6 = Time > 15

;---------------------------------------------------------------------------
; Boulder Trigger
[Statedef 265]
sprpriority = 10
movetype = A
anim = 6666
ctrl = 0

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

[State 265, VarSet]
type = VarSet
trigger1 = Time <= 0
trigger1 = Root, Facing = 1
v = 0
value = 1

[State 265, VarSet]
type = VarSet
trigger1 = Time <= 0
trigger1 = Root, Facing = -1
v = 0
value = -1

[State 265, VarRandom]
type = VarRandom
trigger1 = Var(0) > 0
v = 1
range = 0,90

[State 265, VarRandom]
type = VarRandom
trigger1 = Var(0) < 0
v = 1
range = -90,0

[State 265, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
flag2 = Invisible

[State 265, PosSet]
type = PosSet
trigger1 = Time <= 0
x = Root, Pos X + Var(1) * Const(size.xscale)
y = -250

[State 265, Helper]
type = Helper
trigger1 = Time <= 0
helpertype = normal
name = "Starting X Position"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
persistent = 0
id = 266
pos = 0, 0
postype = P1
stateno = 266
keyctrl = 0
ownpal = 1

[State 265, PosSet]
type = PosSet
trigger1 = Time > 0
trigger1 = NumHelper(266) > 0
x = Helper(266), Pos X + Var(1) * Const(size.xscale)
y = -250

;====================
; Boulders
;====================
;---------------
; Boulder 1
;---------------
[State 265, Helper]
type = Helper
trigger1 = Time = 0
helpertype = normal
name = "Boulder"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
persistent = 0
id = 270
pos = 0, 0
postype = P1
stateno = 270
keyctrl = 0
ownpal = 1

[State 265, PlaySnd]
type = PlaySnd
triggerall = Time > 0
triggerall = NumHelper(270) > 0
trigger1 = Helper(270), PrevStateNo = 270
trigger2 = Helper(270), Pos Y >= 0
trigger2 = Helper(270), Vel Y >= 0
persistent = 0
value = 6, 0
channel = 5

;---------------
; Boulder 2
;---------------
[State 265, Helper]
type = Helper
trigger1 = Time = 20
helpertype = normal
name = "Boulder"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
persistent = 0
id = 271
pos = 0, 0
postype = P1
stateno = 270
keyctrl = 0
ownpal = 1

[State 265, PlaySnd]
type = PlaySnd
triggerall = Time > 20
triggerall = NumHelper(271) > 0
trigger1 = Helper(271), PrevStateNo = 270
trigger2 = Helper(271), Pos Y >= 0
trigger2 = Helper(271), Vel Y >= 0
persistent = 0
value = 6, 0
channel = 5

;---------------
; Boulder 3
;---------------
[State 265, Helper]
type = Helper
trigger1 = Time = 40
helpertype = normal
name = "Boulder"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
persistent = 0
id = 272
pos = 0, 0
postype = P1
stateno = 270
keyctrl = 0
ownpal = 1

[State 265, PlaySnd]
type = PlaySnd
triggerall = Time > 40
triggerall = NumHelper(272) > 0
trigger1 = Helper(272), PrevStateNo = 270
trigger2 = Helper(272), Pos Y >= 0
trigger2 = Helper(272), Vel Y >= 0
persistent = 0
value = 6, 0
channel = 5
;---------------
;====================

[State 265, Destroy]
type = DestroySelf
triggerall = Time > 0
trigger1 = NumHelper(270) <= 0
trigger1 = NumHelper(271) <= 0
trigger1 = NumHelper(272) <= 0

;---------------------------------------------------------------------------
; Starting X Position
[Statedef 266]
sprpriority = 10
movetype = A
anim = 6666
ctrl = 0

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

[State 265, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
flag2 = Invisible

[State 265, PosSet]
type = PosSet
trigger1 = Time <= 0
x = Root, Pos X
y = -250

[State 265, Destroy]
type = DestroySelf
triggerall = Time > 0
trigger1 = NumHelper(265) <= 0
trigger1 = NumHelper(270) <= 0
trigger1 = NumHelper(271) <= 0
trigger1 = NumHelper(272) <= 0

;---------------------------------------------------------------------------
; Boulder Fall
[Statedef 270]
sprpriority = 15
movetype = A
velset = 0,0
juggle = 10
anim = 270
ctrl = 0

[State 270, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AT, AP
ignorehitpause = 1
stateno = 272
time = 1

[State 270, VelAdd]
type = VelAdd
trigger1 = Root, Var(55) <= 0
y = 0.25 * Const(size.yscale)

[State 270, VelAdd]
type = VelAdd
trigger1 = Root, Var(55) > 0
y = 0.5 * Const(size.yscale)

[State 270, AttackMulSet]
type = AttackMulSet
trigger1 = Root, Var(55) > 0
ignorehitpause = 1
value = 0.5

[State 270, HitDef]
type = HitDef
trigger1 = Time <= 0
attr = A, SA
damage = 60, 0
animtype = Heavy
hitflag = MAFD-
guardflag = HA
priority = 3, Hit
pausetime = Ifelse(Root, Var(55) > 0, 0, 1), Ifelse(Root, Var(55) > 0, 0, 1)
sparkno = 2
sparkxy = ceil(-5 * const(size.xscale)), ceil(5 * const(size.yscale))
;hitsound = S2, 1
;guardsound = S2, 0
ground.type = High
ground.slidetime = 40
ground.hittime = 40
ground.velocity = -3,-6
airguard.velocity = -2,-3
air.type = Low
air.velocity = -3,-6
air.hittime = 40
fall.recover = 0
air.fall = 1
fall = 1

;----- Hit Impact -----
[State 270, Hit]
type = PlaySnd
trigger1 = MoveHit
ignorehitpause = 1
value = 2, 1
channel = 2

[State 270, Guard]
type = PlaySnd
trigger1 = MoveGuarded
ignorehitpause = 1
value = 2, 0
channel = 3

[State 270, Reset]
type = MoveHitReset
trigger1 = MoveContact
ignorehitpause = 1
;--------------------

[State 270, PosSet]
type = PosSet
trigger1 = Time > 0
trigger1 = Pos Y >= 0
trigger1 = Vel Y >= 0
y = 0

[State 270, VelSet]
type = VelSet
trigger1 = Time > 0
trigger1 = Pos Y >= 0
trigger1 = Vel Y >= 0
y = 0

[State 270, State]
type = ChangeState
trigger1 = Time > 0
trigger1 = Pos Y >= 0
trigger1 = Vel Y >= 0
value = 271

;---------------------------------------------------------------------------
; Boulder Hit Floor
[Statedef 271]
sprpriority = 15
movetype = A
velset = 0,0
ctrl = 0

[State 270, NotHitBy]
type = NotHitBy
trigger1 = 1
ignorehitpause = 1
value = SCA
time = 1

[State 270, PosSet]
type = PosSet
trigger1 = 1
y = 0

[State 270, EnvShake]
type = EnvShake
trigger1 = Time <= 0
time = 5
freq = 50
ampl = -10
phase = 10

[State 270, Helper]
type = Helper
trigger1 = Time <= 0
helpertype = normal
name = "Rock"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 277
pos = 0, 0
postype = P1
stateno = 275
keyctrl = 0
ownpal = 1

[State 270, Helper]
type = Helper
trigger1 = Time <= 0
helpertype = normal
name = "Rock"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 276
pos = 0, 0
postype = P1
stateno = 275
keyctrl = 0
ownpal = 1

[State 270, Helper]
type = Helper
trigger1 = Time <= 0
helpertype = normal
name = "Rock"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 275
pos = 0, 0
postype = P1
stateno = 275
keyctrl = 0
ownpal = 1

[State 270, Destroy]
type = DestroySelf
trigger1 = 1

;---------------------------------------------------------------------------
; Boulder Hit
[Statedef 272]
sprpriority = -15
movetype = H
velset = 0,0
ctrl = 0

[State 270, NotHitBy]
type = NotHitBy
trigger1 = 1
ignorehitpause = 1
value = SCA
time = 1

[State 270, PlaySnd]
type = PlaySnd
trigger1 = Time <= 0
value = 6, 0
channel = 5

[State 270, Helper]
type = Helper
trigger1 = Time <= 0
helpertype = normal
name = "Rock"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 277
pos = 0, 0
postype = P1
stateno = 275
keyctrl = 0
ownpal = 1

[State 270, Helper]
type = Helper
trigger1 = Time <= 0
helpertype = normal
name = "Rock"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 276
pos = 0, 0
postype = P1
stateno = 275
keyctrl = 0
ownpal = 1

[State 270, Helper]
type = Helper
trigger1 = Time <= 0
helpertype = normal
name = "Rock"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 275
pos = 0, 0
postype = P1
stateno = 275
keyctrl = 0
ownpal = 1

[State 270, Destroy]
type = DestroySelf
trigger1 = 1

;---------------------------------------------------------------------------
; Rocks
[Statedef 275]
sprpriority = 20
velset = 0,0
anim = 275
ctrl = 0

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

[State 275, Anim]
type = ChangeAnim
triggerall = IsHelper(276)
trigger1 = Anim != 276
trigger1 = Time <= 0
value = 276

[State 275, Anim]
type = ChangeAnim
triggerall = IsHelper(277)
trigger1 = Anim != 277
trigger1 = Time <= 0
value = 277

[State 275, AssertSpecial]
type = AssertSpecial
trigger1 = Time > 0
trigger1 = TimeMod = 2,0
flag = Invisible

[State 275, VelSet]
type = VelSet
trigger1 = Time <= 0
x = (-2 + (Random / 300.25)) * Const(size.xscale)
y = (-2 - (Random % 4)) * Const(size.yscale)

[State 275, VelAdd]
type = VelAdd
trigger1 = Time > 0
y = 0.2 * Const(size.yscale)

[State 275, Destroy]
type = DestroySelf
trigger1 = Time > 0
trigger1 = Pos Y >= 0
trigger1 = Vel Y >= 0

;---------------------------------------------------------------------------
; Small Rocks
[Statedef 280]
sprpriority = 20
velset = 0,0
anim = 280
ctrl = 0

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

[State 280, Anim]
type = ChangeAnim
triggerall = IsHelper(281)
trigger1 = Anim != 281
trigger1 = Time <= 0
value = 281

[State 280, Anim]
type = ChangeAnim
triggerall = IsHelper(285)
trigger1 = Anim != 285
trigger1 = Time <= 0
value = 285

[State 280, Anim]
type = ChangeAnim
triggerall = IsHelper(286)
trigger1 = Anim != 286
trigger1 = Time <= 0
value = 286

[State 280, Anim]
type = ChangeAnim
triggerall = IsHelper(287)
trigger1 = Anim != 287
trigger1 = Time <= 0
value = 287

[State 280, Anim]
type = ChangeAnim
triggerall = IsHelper(288)
trigger1 = Anim != 288
trigger1 = Time <= 0
value = 288

[State 280, Anim]
type = ChangeAnim
triggerall = IsHelper(289)
trigger1 = Anim != 289
trigger1 = Time <= 0
value = 289

[State 280, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 20

[State 280, BindToRoot]
type = BindToRoot
trigger1 = Time <= 0
facing = 1
pos = ceil(35 * const(size.xscale)), 0
time = 1

[State 280, VelSet]
type = VelSet
trigger1 = Time <= 0
x = (-1 + (Random / 300.25)) * Const(size.xscale)
y = (-2 - (Random % 6)) * Const(size.yscale)

[State 280, VelAdd]
type = VelAdd
trigger1 = 1
y = 0.2 * Const(size.yscale)

[State 280, Destroy]
type = DestroySelf
trigger1 = Time > 0
trigger1 = Pos Y >= 0
trigger1 = Vel Y >= 0

;---------------------------------------------------------------------------
; Small Shot
[Statedef 310]
statetype = A
movetype = A
physics = N
sprpriority = 20
velset = 4 * const(size.xscale),0
juggle = 10
anim = 310
ctrl = 0

[State 310, AttackMulSet]
type = AttackMulSet
trigger1 = Root, Var(55) > 0
ignorehitpause = 1
value = 0.5

[State 310, VelSet]
type = VelSet
trigger1 = Root, Var(55) > 0
trigger1 = Time <= 0
ignorehitpause = 1
persistent = 0
x = Vel X * 2

[State 310, NotHitBy]
type = NotHitBy
trigger1 = 1
ignorehitpause = 1
value = SCA
time = 1

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

[State 310, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 20

[State 310, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 310, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 310, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 310, 2]
type = HitDef
trigger1 = Time <= 0
attr = A, SP
damage = 30, 0
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = Ifelse(Root, Var(55) > 0, 0, 1), Ifelse(Root, Var(55) > 0, 0, 5)
sparkno = 0
sparkxy = 0,0
hitsound = S2, 1
guardsound = S2, 0
ground.type = High
ground.slidetime = 10
ground.hittime = 10
ground.velocity = -6
airguard.velocity = -2,-1
air.type = Low
air.velocity = -3,-2
air.hittime = 10

[State 310, Destroy]
type = DestroySelf
trigger1 = BackEdgeBodyDist <= -1000
trigger2 = FrontEdgeBodyDist <= -100
trigger3 = MoveContact
ignorehitpause = 1

;---------------------------------------------------------------------------
; Charged Medium Shot
[Statedef 320]
statetype = A
movetype = A
physics = N
sprpriority = 15
juggle = 10
anim = 320
ctrl = 0

[State 320, NotHitBy]
type = NotHitBy
trigger1 = 1
ignorehitpause = 1
value = SCA
time = 1

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

[State 320, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 15

[State 320, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 320, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 320, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 320, BindToRoot]
type = null ;BindToRoot
trigger1 = Anim = 320
trigger1 = AnimElem = 4, < 0
facing = 1
pos = ceil(30 * const(size.xscale)), ceil(-25 * const(size.yscale))
time = 1

[State 320, AttackMulSet]
type = AttackMulSet
trigger1 = Root, Var(55) > 0
ignorehitpause = 1
value = 0.5

[State 320, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 320, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 320, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

[State 320, VelSet]
type = VelSet
trigger1 = AnimElem = 4
ignorehitpause = 1
x = 4 * const(size.xscale)

[State 330, VelSet]
type = VelSet
trigger1 = Root, Var(55) > 0
trigger1 = AnimElem = 4
ignorehitpause = 1
x = Vel X * 2

[State 330, 2]
type = HitDef
trigger1 = Time <= 0
attr = A, SP
damage = 60, 0
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = Ifelse(Root, Var(55) > 0, 0, 1), Ifelse(Root, Var(55) > 0, 0, 5)
sparkno = 1
sparkxy = 0,0
hitsound = S2, 1
guardsound = S2, 0
ground.type = High
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -8
airguard.velocity = -3,-2
air.type = Low
air.velocity = -4,-2
air.hittime = 15

[State 320, Destroy]
type = DestroySelf
trigger1 = BackEdgeBodyDist <= -1000
trigger2 = FrontEdgeBodyDist <= -100

;---------------------------------------------------------------------------
; Charged Mega Shot
[Statedef 330]
statetype = A
movetype = A
physics = N
sprpriority = 15
juggle = 10
anim = 330
ctrl = 0

[State 330, VarRandom]
type = VarRandom
trigger1 = 1
ignorehitpause = 1
v = 0
range = -10,10

[State 330, NotHitBy]
type = NotHitBy
trigger1 = 1
ignorehitpause = 1
value = SCA
time = 1

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

[State 330, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 15

[State 330, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 330, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 330, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 330, BindToRoot]
type = null ;BindToRoot
trigger1 = Anim = 330
trigger1 = AnimElem = 5, < 0
facing = 1
pos = ceil(30 * const(size.xscale)), ceil(-25 * const(size.yscale))
time = 1

[State 330, Helper]
type = Helper
trigger1 = Time > 0
trigger1 = TimeMod = 4,0
helpertype = normal
name = "Particle"
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 331
pos = ceil(-15 * const(size.xscale)), ceil(Var(0) * const(size.yscale))
postype = P1
stateno = 331
keyctrl = 0
ownpal = 1

[State 330, AttackMulSet]
type = AttackMulSet
trigger1 = Root, Var(55) > 0
ignorehitpause = 1
value = 0.5

[State 330, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 330, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 330, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

[State 330, VelSet]
type = VelSet
trigger1 = AnimElem = 5
ignorehitpause = 1
x = 4 * const(size.xscale)

[State 330, VelSet]
type = VelSet
trigger1 = Root, Var(55) > 0
trigger1 = AnimElem = 5
ignorehitpause = 1
x = Vel X * 2

[State 330, 2]
type = HitDef
trigger1 = Time <= 0
attr = A, SP
damage = 90, 0
animtype = Heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = Ifelse(Root, Var(55) > 0, 0, 1), Ifelse(Root, Var(55) > 0, 0, 5)
sparkno = 2
sparkxy = 0,0
hitsound = S2, 1
guardsound = S2, 0
ground.type = High
ground.slidetime = 20
ground.hittime = 20
ground.velocity = -10
airguard.velocity = -4,-1
air.type = Low
air.velocity = -5,-2
air.hittime = 20

[State 330, Destroy]
type = DestroySelf
trigger1 = BackEdgeBodyDist <= -1000
trigger2 = FrontEdgeBodyDist <= -100

;---------------------------------------------------------------------------
; Mega Shot Particle
[Statedef 331]
sprpriority = 20
movetype = A
anim = 331
ctrl = 0

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

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

[State 330, SprPriority]
type = SprPriority
trigger1 = 1
value = 20

[State 330, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 330, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 330, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 330, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 330, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 330, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

[State 330, Destroy]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Sabre Blade
[Statedef 370]
statetype = A
movetype = A
physics = N
sprpriority = 20
velset = 4 * const(size.xscale),0
juggle = 10
anim = 370
ctrl = 0

[State 370, AttackMulSet]
type = AttackMulSet
trigger1 = Root, Var(55) > 0
ignorehitpause = 1
value = 0.5

[State 370, VelSet]
type = VelSet
trigger1 = Root, Var(55) > 0
trigger1 = Time <= 0
ignorehitpause = 1
persistent = 0
x = Vel X * 2

[State 370, NotHitBy]
type = NotHitBy
trigger1 = 1
ignorehitpause = 1
value = SCA
time = 1

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

[State 370, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 20

[State 370, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 370, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 370, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 370, 2]
type = HitDef
trigger1 = Time <= 0
attr = A, SP
damage = 90, 0
animtype = Heavy
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = Ifelse(Root, Var(55) > 0, 0, 1), Ifelse(Root, Var(55) > 0, 0, 5)
sparkno = 2
sparkxy = ceil(-10 * Const(size.xscale)), ceil(-20 * Const(size.yscale))
hitsound = S2, 1
guardsound = S2, 0
ground.type = High
ground.slidetime = 20
ground.hittime = 20
ground.velocity = -10
airguard.velocity = -4,-1
air.type = Low
air.velocity = -5,-2
air.hittime = 20

[State 370, Destroy]
type = DestroySelf
trigger1 = BackEdgeBodyDist <= -1000
trigger2 = FrontEdgeBodyDist <= -100

;---------------------------------------------------------------------------
; Player Inner Charge
[Statedef 390]
sprpriority = 20
anim = 390
ctrl = 0

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

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

[State 390, SprPriority]
type = SprPriority
trigger1 = 1
value = 20

[State 390, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 390, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 390, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 390, BindToRoot]
type = BindToRoot
trigger1 = Root, Facing = 1
facing = 1
pos = 0, 0
time = 1

[State 390, BindToRoot]
type = BindToRoot
trigger1 = Root, Facing = -1
facing = -1
pos = 0, 0
time = 1

[State 390, PosSet]
type = null ;PosSet
trigger1 = 1
x = Root, Pos X
y = Root, Pos Y

[State 390, PlaySnd]
type = PlaySnd
trigger1 = Time <= 0
value = 5, 0
channel = 1

[State 390, PlaySnd]
type = PlaySnd
trigger1 = AnimTime = 0
value = 5, 1
channel = 1

[State 390, Anim]
type = ChangeAnim
triggerall = Anim = 390
trigger1 = Time >= 40
trigger2 = Root, Var(55) > 0
trigger2 = Time >= 20
value = Anim + 1
elem = AnimElemNo(0)

[State 390, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 390, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 390, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

[State 390, Destroy]
type = DestroySelf
trigger1 = IsHelper(390)
trigger1 = Root, Var(30) <= 0
trigger2 = IsHelper(391)
trigger2 = Root, Var(31) <= 0
trigger3 = Root, Var(20) < 0
trigger4 = RoundState != 2

;---------------------------------------------------------------------------
; CPU Inner Charge
[Statedef 391]
sprpriority = 20
anim = 390
ctrl = 0

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

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

[State 390, SprPriority]
type = SprPriority
trigger1 = 1
value = 20

[State 390, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 390, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 390, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 390, BindToRoot]
type = null ;BindToRoot
trigger1 = Root, Facing = 1
facing = 1
pos = 0, 0
time = 1

[State 390, BindToRoot]
type = null ;BindToRoot
trigger1 = Root, Facing = -1
facing = -1
pos = 0, 0
time = 1

[State 390, PosSet]
type = PosSet
trigger1 = 1
x = Root, Pos X
y = Root, Pos Y

[State 390, PlaySnd]
type = PlaySnd
trigger1 = Time <= 0
value = 5, 0
channel = 1

[State 390, PlaySnd]
type = PlaySnd
trigger1 = AnimTime = 0
value = 5, 1
channel = 1

[State 390, Anim]
type = ChangeAnim
triggerall = Anim = 390
trigger1 = Time >= 20
trigger2 = Root, Var(55) > 0
trigger2 = Time >= 10
value = Anim + 1
elem = AnimElemNo(0)

[State 390, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 390, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 390, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

[State 390, Destroy]
type = DestroySelf
trigger1 = Root, Anim >= 200
trigger2 = Root, Var(20) > 0
trigger3 = RoundState != 2

;---------------------------------------------------------------------------
; Player Outer Charge
[Statedef 395]
sprpriority = 25
anim = 395
ctrl = 0

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

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

[State 395, SprPriority]
type = SprPriority
trigger1 = 1
value = 25

[State 395, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 395, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 395, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 395, BindToRoot]
type = BindToRoot
trigger1 = Root, Facing = 1
facing = 1
pos = 0, 0
time = 1

[State 395, BindToRoot]
type = BindToRoot
trigger1 = Root, Facing = -1
facing = -1
pos = 0, 0
time = 1

[State 395, PosSet]
type = null ;PosSet
trigger1 = 1
x = Root, Pos X
y = Root, Pos Y

[State 395, Anim]
type = ChangeAnim
triggerall = Anim = 395 
trigger1 = Time >= 40
trigger2 = Root, Var(55) > 0
trigger2 = Time >= 20
value = Anim + 1
elem = AnimElemNo(0)

[State 395, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 395, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 395, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

[State 395, Destroy]
type = DestroySelf
trigger1 = IsHelper(395)
trigger1 = Root, Var(30) <= 0
trigger2 = IsHelper(396)
trigger2 = Anim = 395
trigger2 = Root, Var(31) <= 0
trigger3 = IsHelper(396)
trigger3 = Anim != 395
trigger3 = Root, Anim = 301 || Root, Var(1) >= 20
trigger4 = Root, Var(20) < 0
trigger5 = RoundState != 2

;---------------------------------------------------------------------------
; CPU Outer Charge
[Statedef 396]
sprpriority = 25
anim = 395
ctrl = 0

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

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

[State 395, SprPriority]
type = SprPriority
trigger1 = 1
value = 25

[State 395, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 395, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 395, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 395, BindToRoot]
type = null ;BindToRoot
trigger1 = Root, Facing = 1
facing = 1
pos = 0, 0
time = 1

[State 395, BindToRoot]
type = null ;BindToRoot
trigger1 = Root, Facing = -1
facing = -1
pos = 0, 0
time = 1

[State 395, PosSet]
type = PosSet
trigger1 = 1
x = Root, Pos X
y = Root, Pos Y

[State 395, Anim]
type = ChangeAnim
triggerall = Anim = 395 
trigger1 = Time >= 20
trigger2 = Root, Var(55) > 0
trigger2 = Time >= 10
value = Anim + 1
elem = AnimElemNo(0)

[State 395, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 395, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 395, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

[State 395, Destroy]
type = DestroySelf
triggerall = Root, Anim != 300
trigger1 = Root, Anim >= 200
trigger2 = Root, Var(20) > 0
trigger3 = RoundState != 2

;---------------------------------------------------------------------------
; Beam Front
[Statedef 500]
type = A
movetype = A
physics = N
velset = 0,0
sprpriority = 5
anim = 500
ctrl = 0

[State 500, VarSet]
type = VarSet
trigger1 = Time <= 0
v = 10
value = 200

[State 500, VarAdd]
type = VarAdd
trigger1 = Var(10) > 0
v = 10
value = -25

[State 500, PalFX]
type = BGPalFX
trigger1 = Time < 10
time = 1
add = var(10),Var(10),Var(10)

[State 500, PalFX]
type = BGPalFX
trigger1 = Time > 5
trigger1 = Var(10) = 0
trigger1 = TimeMod = 4,0
trigger1 = NumHelper(520) > 0
trigger1 = Helper(520), StateNo = 520
time = 2
add = 50,50,50

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

[State 500, Invisible]
type = AssertSpecial
trigger1 = 1
flag = Invisible

[State 500, Explod]
type = Explod
trigger1 = Time <= 0
sprpriority = 5
pausemovetime = -1
supermovetime = -1
removetime = -1
bindtime = -1
postype = p1
;shadow = 100,100,100
scale = 2 * const(size.xscale), 2 * const(size.yscale)
anim = 500
pos = ceil(0*const(size.xscale)), ceil(-0*const(size.yscale))
id = 500

[State 500, BindToRoot]
type = BindToRoot
trigger1 = 1
facing = 1
pos = ceil(40 * const(size.xscale)), ceil(-25 * const(size.yscale))
time = 1

[State 500, Helper]
type = Helper
trigger1 = NumHelper(520) = 0
trigger1 = AnimElem = 5
helpertype = normal
pausemovetime = 100000000
supermovetime = 100000000
ignorehitpause = 1
name = "Beam"
id = 520
facing = 1
pos = 0,0
postype = P1
stateno = 520
keyctrl = 0
ownpal = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0

;----- Beam Stretching -----
[State 500, Explod]
type = Explod
triggerall = Time < 20
trigger1 = Facing = 1
trigger1 = NumExplod(510) = 0
trigger1 = NumHelper(520) > 0
sprpriority = 9
pausemovetime = -1
supermovetime = -1
removetime = -1
bindtime = -1
postype = p1
;shadow = 100,100,100
scale = 2 * const(size.xscale), 2 * const(size.yscale)
anim = 510
pos = ceil(6 * const(size.xscale)), ceil(-0 * const(size.yscale))
id = 510

[State 500, Explod]
type = Explod
triggerall = Time < 20
trigger1 = Facing = -1
trigger1 = NumExplod(510) = 0
trigger1 = NumHelper(520) > 0
sprpriority = 9
pausemovetime = -1
supermovetime = -1
removetime = -1
bindtime = -1
postype = p1
;shadow = 100,100,100
scale = 2 * const(size.xscale), 2 * const(size.yscale)
anim = 511
pos = ceil(5 * const(size.xscale)), ceil(-0 * const(size.yscale))
id = 510

[State 500, Explod]
type = ModifyExplod 
triggerall = NumHelper(520) > 0
trigger1 = ifelse(facing = -1, Helper(520), Pos X <= Pos X, Helper(520), Pos X >= Pos X)
scale = Helper(520), ParentDist X - (Helper(520), Vel X), 2 * const(size.yscale)
id = 510

[State 500, Explod]
type = ModifyExplod
triggerall = NumHelper(520) > 0
trigger1 = ifelse(facing = -1, Helper(520), Pos X > Pos X, Helper(520), Pos X < Pos X)
scale = 2 * const(size.xscale), 2 * const(size.yscale)
id = 510
;-------------------------

;----- Beam Dissapearing -----
;-Resize-
[State 500, Explod]
type = ModifyExplod
trigger1 = NumHelper(520) > 0
trigger1 = Helper(520), StateNo = 521
scale = 2 * const(size.xscale), (Helper(520),Var(0)-1) * .20
id = 500

[State 500, Explod]
type = ModifyExplod
trigger1 = NumHelper(520) > 0
trigger1 = Helper(520), StateNo = 521
scale = Helper(520), ParentDist X - 2, (Helper(520),Var(0)-1) * .20
id = 510
;----------
;-------------------------

[State 500, Explod]
type = RemoveExplod
trigger1 = Time >= 10
trigger1 = NumHelper(520) = 0
trigger2 = NumHelper(520) > 0
trigger2 = Helper(520), StateNo = 521
trigger2 = Helper(520), Time >= 10 
trigger3 = Root, MoveType != A

[State 500, Destroy]
type = DestroySelf
trigger1 = Time >= 10
trigger1 = NumHelper(520) = 0
trigger2 = NumHelper(520) > 0
trigger2 = Helper(520), StateNo = 521
trigger2 = Helper(520), Time >= 10 
trigger3 = Root, MoveType != A

;---------------------------------------------------------------------------
; Beam Shot
[Statedef 520]
type = A
movetype = A
physics = N
velset = 20 * const(size.xscale),0
sprpriority = 10
juggle = 5
anim = 520
ctrl = 0

[State 520, 0]
type = ChangeAnim
trigger1 = BackEdgeBodyDist <= -100 * const(size.xscale)
trigger2 = FrontEdgeBodyDist <= -100 * const(size.xscale)
trigger3 = AnimElem = 20, >= 0
ignorehitpause = 1
value = Anim
elem = AnimElemNo(0) - 1

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

[State 520, Invisible]
type = AssertSpecial
trigger1 = 1
flag = Invisible

[State 520, PosSet]
type = PosSet
trigger1 = NumHelper(500) > 0
ignorehitpause = 1
y = Helper(500), Pos Y

[State 520, VarSet]
type = VarSet
trigger1 = Time <= 0
var(0) = 0

[State 520, Explod]
type = Explod
trigger1 = Time <= 0
sprpriority = 10
pausemovetime = -1
supermovetime = -1
removetime = -1
bindtime = -1
postype = p1
;shadow = 100,100,100
scale = (2 * const(size.xscale)), (2 * const(size.yscale))
anim = 521
pos = ceil(0 * const(size.xscale)),ceil (-0 * const(size.yscale))
id = 520

[State 520, VelSet]
type = VelSet
trigger1 = BackEdgeBodyDist <= -100 * const(size.xscale)
trigger2 = FrontEdgeBodyDist <= -100 * const(size.xscale)
trigger3 = AnimElem = 20, >= 0
ignorehitpause = 1
x = 0

[State 520, AttackMulSet]
type = AttackMulSet
trigger1 = Root, Var(55) > 0
ignorehitpause = 1
value = 0.5

[State 520, 2]
type = HitDef
trigger1 = TimeMod = 4,0
attr = A, HA
damage = 60, 0
getpower = 0,0
animtype = Heavy
guardflag = MA
hitflag = MAFD
priority = 3, Hit
pausetime = Ifelse(Root, Var(55) > 0, 0, 1), Ifelse(Root, Var(55) > 0, 0, 5)
sparkno = 3
sparkxy = ceil(-5 * const(size.xscale)), 0
hitsound = S2, 1
guardsound = S2, 0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -20,-4
airguard.velocity = -10,-1
air.type = High
air.velocity = -20,-2
air.hittime = 20
fall.recover = 0
air.fall = 1
fall = 1

[State 520, VarAdd]
type = VarAdd
trigger1 = MoveContact
ignorehitpause = 1
var(0) = 1

[State 520, Reset]
type = MoveHitReset
trigger1 = MoveContact
trigger1 = HitPauseTime = 0
ignorehitpause = 1

[State 520, Explod]
type = RemoveExplod
trigger1 = Root, MoveType != A

[State 520, Destroy]
type = DestroySelf
trigger1 = Root, MoveType != A

[State 520, 2]
type = ChangeState
trigger1 = Time >= 100
trigger2 = Var(0) >= 20
value = 521

;---------------------------------------------------------------------------
; Beam Destroy
[Statedef 521]
type = A
movetype = A
physics = N
velset = 0,0
sprpriority = 5
anim = 520
ctrl = 0

[State 520, Invisible]
type = AssertSpecial
trigger1 = 1
flag = Invisible

[State 520, PosSet]
type = PosSet
trigger1 = NumHelper(500) > 0
y = Helper(500), Pos Y

[State 520, Anim]
type = ChangeAnim
trigger1 = 1
value = Anim

;----- Beam Dissapearing -----
;-Resize-
[State 520, VarSet]
type = VarSet
trigger1 = Time <= 0
var(0) = 10

[State 520, VarAdd]
type = VarAdd
trigger1 = Time > 0
var(0) = -1

[State 520, Explod]
type = ModifyExplod
trigger1 = 1
scale = 2 * const(size.xscale), Var(0)*.20
id = 520
;----------
;-------------------------

[State 520, Explod]
type = RemoveExplod
trigger1 = Time >= 10
trigger2 = Root, MoveType != A

[State 520, Destroy]
type = DestroySelf
trigger1 = Time >= 10
trigger2 = Root, MoveType != A

;---------------------------------------------------------------------------
; Super Beam Front
[Statedef 550]
type = A
movetype = A
physics = N
velset = 0,0
sprpriority = 5
anim = 550
ctrl = 0

[State 550, VarSet]
type = VarSet
trigger1 = Time <= 0
v = 10
value = 200

[State 550, VarAdd]
type = VarAdd
trigger1 = Var(10) > 0
v = 10
value = -25

[State 550, PalFX]
type = BGPalFX
trigger1 = Time < 10
time = 1
add = var(10),Var(10),Var(10)

[State 550, PalFX]
type = BGPalFX
trigger1 = Time > 5
trigger1 = Var(10) = 0
trigger1 = TimeMod = 4,0
trigger1 = NumHelper(570) > 0
trigger1 = Helper(570), StateNo = 570
time = 2
add = 50,50,50

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

[State 550, Invisible]
type = AssertSpecial
trigger1 = 1
flag = Invisible

[State 550, Explod]
type = Explod
trigger1 = Time <= 0
sprpriority = 5
pausemovetime = -1
supermovetime = -1
removetime = -1
bindtime = -1
postype = p1
;shadow = 100,100,100
scale = 0.5 * const(size.xscale), 0.5 * const(size.yscale)
anim = 550
pos = ceil(0*const(size.xscale)), ceil(-0*const(size.yscale))
id = 550

[State 550, BindToRoot]
type = BindToRoot
trigger1 = 1
facing = 1
pos = ceil(50 * const(size.xscale)), ceil(-25 * const(size.yscale))
time = 1

[State 550, Helper]
type = Helper
trigger1 = NumHelper(570) = 0
trigger1 = AnimElem = 1
helpertype = normal
pausemovetime = 100000000
supermovetime = 100000000
ignorehitpause = 1
name = "Super Beam"
id = 570
facing = 1
pos = 0, 0
postype = P1
stateno = 570
keyctrl = 0
ownpal = 1
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0

[State 550, Explod]
type = Explod
trigger1 = AnimElem = 3
sprpriority = 10
pausemovetime = -1
supermovetime = -1
bindtime = -1
postype = p1
;shadow = 100,100,100
scale = 0.5 * const(size.xscale), 0.5 * const(size.yscale)
anim = 555
pos = ceil(0*const(size.xscale)), ceil(-0*const(size.yscale))
id = 555

;----- Beam Stretching -----
[State 550, Explod]
type = Explod
triggerall = Time < 20
trigger1 = Facing = 1
trigger1 = NumExplod(560) = 0
trigger1 = NumHelper(570) > 0
sprpriority = 9
pausemovetime = -1
supermovetime = -1
removetime = -1
bindtime = -1
postype = p1
;shadow = 100,100,100
scale = 0.5 * const(size.xscale), 0.5 * const(size.yscale)
anim = 560
pos = ceil(0.5 * const(size.xscale)), ceil(-0 * const(size.yscale))
id = 560

[State 550, Explod]
type = Explod
triggerall = Time < 20
trigger1 = Facing = -1
trigger1 = NumExplod(560) = 0
trigger1 = NumHelper(570) > 0
sprpriority = 9
pausemovetime = -1
supermovetime = -1
removetime = -1
bindtime = -1
postype = p1
;shadow = 100,100,100
scale = 0.5 * const(size.xscale), 0.5 * const(size.yscale)
anim = 561
pos = ceil(0 * const(size.xscale)), ceil(-0 * const(size.yscale))
id = 560

[State 550, Explod]
type = ModifyExplod 
triggerall = Time > 0
triggerall = NumHelper(570) > 0
trigger1 = ifelse(facing = -1, Helper(570), Pos X <= Pos X, Helper(570), Pos X >= Pos X)
scale = Helper(570), ParentDist X - (Helper(570), Vel X), 0.5 * const(size.yscale)
id = 560

[State 550, Explod]
type = ModifyExplod
triggerall = Time > 0
triggerall = NumHelper(570) > 0
trigger1 = ifelse(facing = -1, Helper(570), Pos X > Pos X, Helper(570), Pos X < Pos X)
scale = 0.5 * const(size.xscale), 0.5 * const(size.yscale)
id = 560
;-------------------------

;----- Beam Dissapearing -----
;-Resize-
[State 550, Explod]
type = ModifyExplod
triggerall = Time > 0
trigger1 = NumHelper(570) > 0
trigger1 = Helper(570), StateNo = 571
scale = 0.5 * const(size.xscale), (Helper(570),FVar(0)-0.5) * .20
id = 550

[State 550, Explod]
type = ModifyExplod
triggerall = Time > 0
trigger1 = NumHelper(570) > 0
trigger1 = Helper(570), StateNo = 571
scale = Helper(570), ParentDist X - 2, (Helper(570),FVar(0)-0.5) * .20
id = 560
;----------
;-------------------------

[State 550, Explod]
type = RemoveExplod
trigger1 = Time >= 10
trigger1 = NumHelper(570) = 0
trigger2 = NumHelper(570) > 0
trigger2 = Helper(570), StateNo = 521
trigger2 = Helper(570), Time >= 10 
trigger3 = Root, MoveType != A

[State 550, Destroy]
type = DestroySelf
trigger1 = Time >= 10
trigger1 = NumHelper(570) = 0
trigger2 = NumHelper(570) > 0
trigger2 = Helper(570), StateNo = 571
trigger2 = Helper(570), Time >= 10 
trigger3 = Root, MoveType != A

;---------------------------------------------------------------------------
; Super Beam Shot
[Statedef 570]
type = A
movetype = A
physics = N
velset = 0, 0
sprpriority = 10
juggle = 5
anim = 570
ctrl = 0

[State 570, 0]
type = ChangeAnim
trigger1 = BackEdgeBodyDist <= -100 * const(size.xscale)
trigger2 = FrontEdgeBodyDist <= -100 * const(size.xscale)
trigger3 = AnimElem = 20, >= 0
ignorehitpause = 1
value = Anim
elem = AnimElemNo(0) - 1

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

[State 570, Invisible]
type = AssertSpecial
trigger1 = 1
flag = Invisible

[State 570, PosSet]
type = PosSet
trigger1 = NumHelper(550) > 0
ignorehitpause = 1
y = Helper(550), Pos Y

[State 570, VarSet]
type = VarSet
trigger1 = Time <= 0
var(0) = 0

[State 570, Explod]
type = Explod
trigger1 = Time <= 0
sprpriority = 10
pausemovetime = -1
supermovetime = -1
removetime = -1
bindtime = -1
postype = p1
;shadow = 100,100,100
scale = (0.5 * const(size.xscale)), (0.5 * const(size.yscale))
anim = 571
pos = ceil(0 * const(size.xscale)),ceil (-0 * const(size.yscale))
id = 520

[State 570, VelSet]
type = VelSet
trigger1 = AnimElem = 2
ignorehitpause = 1
x = 20 * const(size.xscale)

[State 570, VelSet]
type = VelSet
trigger1 = BackEdgeBodyDist <= -100 * const(size.xscale)
trigger2 = FrontEdgeBodyDist <= -100 * const(size.xscale)
trigger3 = AnimElem = 20, >= 0
ignorehitpause = 1
x = 0

[State 570, AttackMulSet]
type = AttackMulSet
trigger1 = Root, Var(55) > 0
ignorehitpause = 1
value = 0.5

[State 570, 2]
type = HitDef
trigger1 = TimeMod = 4,0
attr = A, HA
damage = 60, 0
getpower = 0,0
animtype = Heavy
guardflag = MA
hitflag = MAFD
priority = 3, Hit
pausetime = Ifelse(Root, Var(55) > 0, 0, 1), Ifelse(Root, Var(55) > 0, 0, 5)
sparkno = 3
sparkxy = ceil(-5 * const(size.xscale)), 0
hitsound = S2, 1
guardsound = S2, 0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -20,-4
airguard.velocity = -10,-1
air.type = High
air.velocity = -20,-2
air.hittime = 20
fall.recover = 0
air.fall = 1
fall = 1

[State 570, VarAdd]
type = VarAdd
trigger1 = MoveContact
ignorehitpause = 1
var(0) = 1

[State 570, Reset]
type = MoveHitReset
trigger1 = MoveContact
trigger1 = HitPauseTime = 0
ignorehitpause = 1

[State 570, Explod]
type = RemoveExplod
trigger1 = Root, MoveType != A

[State 570, Destroy]
type = DestroySelf
trigger1 = Root, MoveType != A

[State 570, 2]
type = ChangeState
trigger1 = Time >= 200
trigger2 = Var(0) >= 20
value = 571

;---------------------------------------------------------------------------
; Beam Destroy
[Statedef 571]
type = A
movetype = A
physics = N
velset = 0,0
sprpriority = 5
anim = 570
ctrl = 0

[State 570, Invisible]
type = AssertSpecial
trigger1 = 1
flag = Invisible

[State 570, PosSet]
type = PosSet
trigger1 = NumHelper(550) > 0
y = Helper(550), Pos Y

[State 570, Anim]
type = ChangeAnim
trigger1 = 1
value = Anim

;----- Beam Dissapearing -----
;-Resize-
[State 570, VarSet]
type = VarSet
trigger1 = Time <= 0
fvar(0) = 5

[State 570, VarAdd]
type = VarAdd
trigger1 = Time > 0
trigger1 = FVar(0) > 0
fvar(0) = -0.5

[State 570, Explod]
type = ModifyExplod
trigger1 = 1
scale = 0.5 * const(size.xscale), FVar(0)*.20
id = 520
;----------
;-------------------------

[State 570, Explod]
type = RemoveExplod
trigger1 = Time >= 10
trigger2 = Root, MoveType != A

[State 570, Destroy]
type = DestroySelf
trigger1 = Time >= 10
trigger2 = Root, MoveType != A

;---------------------------------------------------------------------------
; Spark Blade
[Statedef 630]
statetype = A
movetype = A
physics = N
sprpriority = 20
juggle = 10
anim = 630
ctrl = 0

[State 630, NotHitBy]
type = NotHitBy
trigger1 = 1
ignorehitpause = 1
value = SCA
time = 1

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

[State 630, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 20

[State 630, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 630, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 630, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

;-------------------------
; Spark Blade Setup
[State 630, AngleSet]
type = AngleSet
trigger1 = IsHelper(630)
value = 0

[State 630, AngleSet]
type = AngleSet
trigger1 = IsHelper(631)
value = -30

[State 630, AngleSet]
type = AngleSet
trigger1 = IsHelper(632)
value = -60

[State 630, AngleSet]
type = AngleSet
trigger1 = IsHelper(633)
value = -90

[State 630, AngleSet]
type = AngleSet
trigger1 = IsHelper(634)
value = -40

[State 630, AngleSet]
type = AngleSet
trigger1 = IsHelper(635)
value = -20

[State 630, VelSet]
type = VelSet
triggerall = Time <= 0
trigger1 = IsHelper(630)
x = 2 * const(size.xscale) + (0.25 * const(size.xscale))
y = 0

[State 630, VelSet]
type = VelSet
triggerall = Time <= 0
trigger1 = IsHelper(631)
trigger2 = IsHelper(635)
x = 1.5 * const(size.xscale) + (0.25 * const(size.xscale))
y = 0.75 * const(size.yscale) + (0.25 * const(size.xscale))

[State 630, VelSet]
type = VelSet
triggerall = Time <= 0
trigger1 = IsHelper(632)
trigger2 = IsHelper(634)
x = 1 * const(size.xscale) + (0.25 * const(size.xscale))
y = 1.5 * const(size.yscale) + (0.25 * const(size.xscale))

[State 630, VelSet]
type = VelSet
triggerall = Time <= 0
trigger1 = IsHelper(633)
x = 0 
y = 2 * const(size.yscale) + (0.25 * const(size.xscale))
;-------------------------

[State 630, AttackMulSet]
type = AttackMulSet
trigger1 = Root, Var(55) > 0
ignorehitpause = 1
value = 0.5

[State 630, VelSet]
type = VelSet
trigger1 = Root, Var(55) > 0
trigger1 = Time <= 0
ignorehitpause = 1
persistent = 0
x = Vel X * 2
y = Vel Y * 2

[State 630, AngleDraw]
type = AngleDraw
trigger1 = 1
ignorehitpause = 1

[State 630, AssertSpecial]
type = AssertSpecial
trigger1 = Pos Y >= 0
ignorehitpause = 1
flag = NoShadow

[State 630, 2]
type = HitDef
trigger1 = Time <= 0
attr = A, SP
damage = 30, 0
animtype = Heavy
guardflag = HA
hitflag = MAF-
priority = 3, Hit
pausetime = Ifelse(Root, Var(55) > 0, 0, 1), Ifelse(Root, Var(55) > 0, 0, 5)
sparkno = 2
sparkxy = 0,0
hitsound = S2, 1
guardsound = S2, 0
ground.type = High
ground.slidetime = 20
ground.hittime = 20
ground.velocity = -10
airguard.velocity = -4,-1
air.type = Low
air.velocity = -5,-2
air.hittime = 20

[State 630, Destroy]
type = DestroySelf
trigger1 = BackEdgeBodyDist <= -1000
trigger2 = FrontEdgeBodyDist <= -100
trigger3 = Pos Y >= 50

;---------------------------------------------------------------------------
; Powering Up Aura
[Statedef 990]
statetype = A
movetype = I
physics = N
sprpriority = -20
anim = 990
ctrl = 0

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

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

[State 990, SprPriority]
type = SprPriority
trigger1 = 1
value = -20

[State 990, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 990, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 990, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 990, BindToRoot]
type = BindToRoot
trigger1 = 1
facing = 1
pos = 0,0
time = 1

[State 990, AssertSpecial]
type = AssertSpecial
trigger1 = TimeMod = 2,0
flag = Invisible

[State 990, Anim]
type = ChangeAnim
trigger1 = IsHelper(995)
trigger1 = Anim != 995
trigger1 = Time <= 0
persistent = 0
value = 995

[State 990, Sound]
type = PlaySnd
trigger1 = Time <= 0
value = 5, 6
channel = 1
loop = 1

[State 990, Anim]
type = ChangeAnim
trigger1 = Root, Var(55) <= 0
trigger2 = RoundState != 2
persistent = 0
value = Anim + 1

[State 990, StopSnd]
type = StopSnd
trigger1 = Anim = 990 || Anim = 995
trigger1 = Root, Var(55) <= 0
trigger2 = Anim = 991 || Anim = 996
trigger2 = AnimElem = 1
trigger3 = RoundState != 2
persistent = 0
value = 5, 6
channel = 1

[State 990, PlaySnd]
type = PlaySnd
trigger1 = Anim = 990 || Anim = 995
trigger1 = Root, Var(55) <= 0
trigger2 = Anim = 991 || Anim = 996
trigger2 = AnimElem = 1
trigger3 = RoundState != 2
persistent = 0
value = 5, 11
channel = 1

[State 990, Destroy]
type = DestroySelf
trigger1 = Anim = 991 || Anim = 996
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Light Spark
[Statedef 1010]
sprpriority = 10
movetype = A
anim = 1010
ctrl = 0

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

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

[State 1010, SprPriority]
type = SprPriority
trigger1 = 1
value = 10

[State 1010, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 1010, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 1010, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 1010, BindToRoot]
type = BindToRoot
trigger1 = 1
facing = 1
pos = 0,0
time = 1

[State 1010, VarSet]
type = VarSet
triggerall = Time > 0
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 1010, VarAdd]
type = VarAdd
triggerall = Time > 0
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 1010, Speed]
type = ChangeAnim
triggerall = Time > 0
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

[State 1010, Destroy]
type = DestroySelf
trigger1 = AnimTime = 0
trigger2 = Root, Anim = 1000
trigger2 = Root, AnimElem = 7, >= 0
trigger3 = Root, Anim != 1000

;---------------------------------------------------------------------------
; Charge Spark
[Statedef 1011]
sprpriority = 20
movetype = A
anim = 1011
ctrl = 0

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

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

[State 1010, SprPriority]
type = SprPriority
trigger1 = 1
value = 20

[State 1010, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 1010, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 1010, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 1010, BindToRoot]
type = BindToRoot
trigger1 = 1
facing = 1
pos = ceil(25 * const(size.xscale)), ceil(-25 * const(size.yscale))
time = 1

[State 1010, Destroy]
type = DestroySelf
trigger1 = AnimTime = 0
trigger2 = Root, Anim != 300
trigger3 = Root, Anim = 300
trigger3 = Root, AnimElem = 3, >= 0
trigger4 = Root, MoveType != A

;---------------------------------------------------------------------------
; Light Beam Object
[Statedef 1015]
sprpriority = 30
movetype = A
anim = 1015
ctrl = 0

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

[State 1015, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = Invisible

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

[State 1015, BindToRoot]
type = BindToRoot
trigger1 = 1
facing = 1
pos = 0,1000
time = 1

[State 1015, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 1015, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 1015, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

;====================
; Light Beams
;====================
;---------------
; - Foreground -
;---------------
[State 1015, Helper]
type = Helper
triggerall = NumHelper(1020) = 0
trigger1 = Time <= 0
helpertype = normal
name = "Light Beam"
size.yscale = -10000
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 1020
pos = 0, 0
postype = P1
stateno = 1020
keyctrl = 0

[State 1015, Helper]
type = Helper
triggerall = NumHelper(1021) = 0
trigger1 = Time <= 0
helpertype = normal
name = "Light Beam"
size.yscale = -10000
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 1021
pos = 0, 0
postype = P1
stateno = 1020
keyctrl = 0

[State 1015, Helper]
type = Helper
triggerall = NumHelper(1022) = 0
trigger1 = Time <= 0
helpertype = normal
name = "Light Beam"
size.yscale = -10000
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 1022
pos = 0, 0
postype = P1
stateno = 1020
keyctrl = 0

;---------------
; - Background -
;---------------
[State 1015, Helper]
type = Helper
triggerall = NumHelper(1023) = 0
trigger1 = Time <= 0
helpertype = normal
name = "Light Beam"
size.yscale = -10000
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 1023
pos = 0, 0
postype = P1
stateno = 1020
keyctrl = 0

[State 1015, Helper]
type = Helper
triggerall = NumHelper(1024) = 0
trigger1 = Time <= 0
helpertype = normal
name = "Light Beam"
size.yscale = -10000
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 1024
pos = 0, 0
postype = P1
stateno = 1020
keyctrl = 0

[State 1015, Helper]
type = Helper
triggerall = NumHelper(1025) = 0
trigger1 = Time <= 0
helpertype = normal
name = "Light Beam"
size.yscale = -10000
size.ground.back = 0
size.ground.front = 0
size.air.back = 0
size.air.front = 0
id = 1025
pos = 0, 0
postype = P1
stateno = 1020
keyctrl = 0
;---------------
;====================

[State 1015, Sound]
type = PlaySnd
trigger1 = Time <= 0
persistent = 0
value = 9, 0
channel = 0

[State 1015, Anim]
type = ChangeAnim
trigger1 = Root, Anim != 1000
trigger2 = NumHelper(1020) > 0
trigger2 = Helper(1020), StateNo = 1025 || Helper(1020), Anim = 1025
value = Anim
elem = 1

[State 1015, Destroy]
type = DestroySelf
trigger1 = NumHelper(1020) <= 0
trigger1 = NumHelper(1021) <= 0
trigger1 = NumHelper(1022) <= 0
trigger1 = NumHelper(1023) <= 0
trigger1 = NumHelper(1024) <= 0
trigger1 = NumHelper(1025) <= 0
trigger1 = Time > 0

;---------------------------------------------------------------------------
; Light Beam Appear
[Statedef 1020]
movetype = A
anim = 1020
ctrl = 0

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

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

[State 1020, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 1020, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 1020, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 1020, VarSet]
type = VarSet
trigger1 = Time <= 0
fvar(0) = 0

[State 1020, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 1020, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 1020, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

;-------------------------
; Setup Light Beams
;-------------------------
[State 1020, BindToParent]
type = BindToParent
triggerall = Root, MoveType = A
trigger1 = IsHelper(1020)
trigger2 = IsHelper(1023)
facing = 1
pos = 0,100
time = 1

[State 1020, BindToParent]
type = BindToParent
triggerall = Root, MoveType = A
trigger1 = IsHelper(1021)
trigger2 = IsHelper(1024)
facing = 1
pos = ceil(-20 * const(size.xscale)),1000
time = 1

[State 1020, BindToParent]
type = BindToParent
triggerall = Root, MoveType = A
trigger1 = IsHelper(1022)
trigger2 = IsHelper(1025)
facing = 1
pos = ceil(20 * const(size.xscale)),1000
time = 1

[State 1020, SprPriority]
type = SprPriority
trigger1 = IsHelper(1020)
trigger2 = IsHelper(1021)
trigger3 = IsHelper(1022)
value = 20

[State 1020, SprPriority]
type = SprPriority
trigger1 = IsHelper(1023)
trigger2 = IsHelper(1024)
trigger3 = IsHelper(1025)
value = -20
;-------------------------

[State 1020, Anim]
type = ChangeAnim
trigger1 = Anim = 1020
trigger1 = AnimTime = 0
value = 1021

[State 1020, State]
type = ChangeState
triggerall = IsHelper(1020) || IsHelper(1021) || IsHelper(1022)
trigger1 = Anim != 1020
value = 1021

[State 1020, State]
type = ChangeState
triggerall = IsHelper(1023) || IsHelper(1024) || IsHelper(1025)
trigger1 = Anim != 1020
value = 1022

[State 1020, State]
type = ChangeState
trigger1 = Root, Anim != 1000
value = 1025

[State 1020, Destroy]
type = DestroySelf
trigger1 = NumHelper(1015) <= 0

;---------------------------------------------------------------------------
; Light Beam Move Forward
[Statedef 1021]
sprpriority = 20
movetype = A
juggle = 10
ctrl = 0

[State 1020, SprPriority]
type = SprPriority
trigger1 = 1
value = 20

[State 1020, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 1020, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 1020, Anim]
type = ChangeAnim
trigger1 = Anim != 1021
value = 1021

[State 1020, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 1020, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 1020, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

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

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

[State 1020, VarAdd]
type = VarAdd
trigger1 = Parent, Facing = 1
fvar(0) = 2 * const(size.xscale)

[State 1020, VarAdd]
type = VarAdd
trigger1 = Parent, Facing = -1
fvar(0) = -2 * const(size.xscale)

;-------------------------
; Binding to Parent
[State 1020, BindToParent]
type = null ;BindToParent
trigger1 = IsHelper(1020)
trigger2 = IsHelper(1023)
facing = 1
pos = 0 + FVar(0),100
time = 1

[State 1020, BindToParent]
type = null ;BindToParent
trigger1 = IsHelper(1021)
trigger2 = IsHelper(1024)
facing = 1
pos = ceil(-20 * const(size.xscale)) + FVar(0),1000
time = 1

[State 1020, BindToParent]
type = null ;BindToParent
trigger1 = IsHelper(1022)
trigger2 = IsHelper(1025)
facing = 1
pos = ceil(20 * const(size.xscale)) + FVar(0),1000
time = 1
;-------------------------

;-------------------------
; Position Set to Parent
[State 1020, PosSet]
type = PosSet
trigger1 = IsHelper(1020)
trigger2 = IsHelper(1023)
x = Parent, Pos X + FVar(0)

[State 1020, PosSet]
type = PosSet
trigger1 = IsHelper(1021)
trigger2 = IsHelper(1024)
x = (-20 * const(size.xscale)) + Parent, Pos X + FVar(0)

[State 1020, PosSet]
type = PosSet
trigger1 = IsHelper(1022)
trigger2 = IsHelper(1025)
x = (20 * const(size.xscale)) + Parent, Pos X + FVar(0)
;-------------------------

[State 1020, AttackMulSet]
type = AttackMulSet
trigger1 = Root, Var(55) > 0
ignorehitpause = 1
value = 0.5

[State 1020, HitDef]
type = HitDef
trigger1 = NumEnemy > 0
trigger1 = EnemyNear, MoveType != H
attr = A, SP
damage = 30, 0
animtype = Heavy
guardflag = MA
hitflag = MAF-
priority = 3, Hit
pausetime = Ifelse(Root, Var(55) > 0, 0, 1), Ifelse(Root, Var(55) > 0, 0, 5)
sparkno = -1
guard.sparkno = -1
sparkxy = 0, 0
hitsound = S2, 1
guardsound = S2, 0
ground.type = High
ground.slidetime = 20
ground.hittime = 20
ground.velocity = -10
airguard.velocity = -4,-1
air.type = Low
air.velocity = -5,-2
air.hittime = 20

[State 1020, State]
type = ChangeState
trigger1 = ParentDist X < -25 * const(size.xscale)
value = 1022

[State 1020, State]
type = ChangeState
trigger1 = Root, Anim != 1000
value = 1025

[State 1020, Destroy]
type = DestroySelf
trigger1 = NumHelper(1015) <= 0

;---------------------------------------------------------------------------
; Light Beam Move Back
[Statedef 1022]
sprpriority = -20
movetype = A
juggle = 10
ctrl = 0

[State 1020, SprPriority]
type = SprPriority
trigger1 = 1
value = -20

[State 1020, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 1020, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 1020, Anim]
type = ChangeAnim
trigger1 = Anim != 1021
value = 1021

[State 1020, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 1020, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 1020, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

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

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

[State 1020, VarAdd]
type = VarAdd
trigger1 = Parent, Facing = 1
fvar(0) = -2 * const(size.xscale)

[State 1020, VarAdd]
type = VarAdd
trigger1 = Parent, Facing = -1
fvar(0) = 2 * const(size.xscale)

;-------------------------
; Binding to Parent
[State 1020, BindToParent]
type = null ;BindToParent
trigger1 = IsHelper(1020)
trigger2 = IsHelper(1023)
facing = 1
pos = 0 + FVar(0),100
time = 1

[State 1020, BindToParent]
type = null ;BindToParent
trigger1 = IsHelper(1021)
trigger2 = IsHelper(1024)
facing = 1
pos = ceil(-20 * const(size.xscale)) + FVar(0),1000
time = 1

[State 1020, BindToParent]
type = null ;BindToParent
trigger1 = IsHelper(1022)
trigger2 = IsHelper(1025)
facing = 1
pos = ceil(20 * const(size.xscale)) + FVar(0),1000
time = 1
;-------------------------

;-------------------------
; Position Set to Parent
[State 1020, PosSet]
type = PosSet
trigger1 = IsHelper(1020)
trigger2 = IsHelper(1023)
x = Parent, Pos X + FVar(0)

[State 1020, PosSet]
type = PosSet
trigger1 = IsHelper(1021)
trigger2 = IsHelper(1024)
x = (-20 * const(size.xscale)) + Parent, Pos X + FVar(0)

[State 1020, PosSet]
type = PosSet
trigger1 = IsHelper(1022)
trigger2 = IsHelper(1025)
x = (20 * const(size.xscale)) + Parent, Pos X + FVar(0)
;-------------------------

[State 1020, AttackMulSet]
type = AttackMulSet
trigger1 = Root, Var(55) > 0
ignorehitpause = 1
value = 0.5

[State 1020, HitDef]
type = HitDef
trigger1 = NumEnemy > 0
trigger1 = EnemyNear, MoveType != H
attr = A, SP
damage = 30, 0
animtype = Heavy
guardflag = MA
hitflag = MAF-
priority = 3, Hit
pausetime = Ifelse(Root, Var(55) > 0, 0, 1), Ifelse(Root, Var(55) > 0, 0, 5)
sparkno = -1
guard.sparkno = -1
sparkxy = 0,0
hitsound = S2, 1
guardsound = S2, 0
ground.type = High
ground.slidetime = 20
ground.hittime = 20
ground.velocity = -10
airguard.velocity = -4,-1
air.type = Low
air.velocity = -5,-2
air.hittime = 20

[State 1020, State]
type = ChangeState
trigger1 = ParentDist X > 25 * const(size.xscale)
value = 1021

[State 1020, State]
type = ChangeState
trigger1 = Root, Anim != 1000
value = 1025

[State 1020, Destroy]
type = DestroySelf
trigger1 = NumHelper(1015) <= 0

;---------------------------------------------------------------------------
; Light Beam End
[Statedef 1025]
movetype = A
velset = 0,0
anim = 1025
ctrl = 0

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

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

[State 1020, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 1020, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 1020, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 1020, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 1020, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

;-------------------------
; Binding to Parent
[State 1020, BindToParent]
type = null ;BindToParent
triggerall = Root, MoveType = A
trigger1 = IsHelper(1020)
trigger2 = IsHelper(1023)
facing = 1
pos = 0 + FVar(0),100
time = 1

[State 1020, BindToParent]
type = null ;BindToParent
triggerall = Root, MoveType = A
trigger1 = IsHelper(1021)
trigger2 = IsHelper(1024)
facing = 1
pos = ceil(-20 * const(size.xscale)) + FVar(0),1000
time = 1

[State 1020, BindToParent]
type = null ;BindToParent
triggerall = Root, MoveType = A
trigger1 = IsHelper(1022)
trigger2 = IsHelper(1025)
facing = 1
pos = ceil(20 * const(size.xscale)) + FVar(0),1000
time = 1
;-------------------------

;-------------------------
; Position Set to Parent
[State 1020, PosSet]
type = PosSet
triggerall = Root, MoveType = A
trigger1 = IsHelper(1020)
trigger2 = IsHelper(1023)
x = Parent, Pos X + FVar(0)

[State 1020, PosSet]
type = PosSet
triggerall = Root, MoveType = A
trigger1 = IsHelper(1021)
trigger2 = IsHelper(1024)
x = (-20 * const(size.xscale)) + Parent, Pos X + FVar(0)

[State 1020, PosSet]
type = PosSet
triggerall = Root, MoveType = A
trigger1 = IsHelper(1022)
trigger2 = IsHelper(1025)
x = (20 * const(size.xscale)) + Parent, Pos X + FVar(0)
;-------------------------

[State 1020, Destroy]
type = DestroySelf
trigger1 = AnimTime = 0
trigger2 = NumHelper(1015) <= 0

;---------------------------------------------------------------------------
; Spark Projectile
[Statedef 1030]
statetype = A
movetype = A
physics = N
sprpriority = 10
juggle = 10
anim = 1030
ctrl = 0

[State 1030, NotHitBy]
type = NotHitBy
trigger1 = 1
ignorehitpause = 1
value = SCA
time = 1

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

[State 1030, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 10

[State 1030, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 1030, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 1030, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

;-------------------------
; Spark Projectile Setup
[State 1030, AngleSet]
type = AngleSet
trigger1 = IsHelper(1030)
value = 0

[State 1030, AngleSet]
type = AngleSet
trigger1 = IsHelper(1031)
value = 45

[State 1030, AngleSet]
type = AngleSet
trigger1 = IsHelper(1032)
value = 90

[State 1030, AngleSet]
type = AngleSet
trigger1 = IsHelper(1033)
value = 135

[State 1030, AngleSet]
type = AngleSet
trigger1 = IsHelper(1034)
value = 180

[State 1030, VelSet]
type = VelSet
triggerall = Time <= 0
trigger1 = IsHelper(1030)
x = 2.5 * const(size.xscale)
y = 0

[State 1030, VelSet]
type = VelSet
triggerall = Time <= 0
trigger1 = IsHelper(1031)
x = 2 * const(size.xscale)
y = -2 * const(size.yscale)

[State 1030, VelSet]
type = VelSet
triggerall = Time <= 0
trigger1 = IsHelper(1032)
x = 0 
y = -2.5 * const(size.yscale)

[State 1030, VelSet]
type = VelSet
triggerall = Time <= 0
trigger1 = IsHelper(1033)
x = -2 * const(size.xscale)
y = -2 * const(size.yscale)

[State 1030, VelSet]
type = VelSet
triggerall = Time <= 0
trigger1 = IsHelper(1034)
x = -2.5 * const(size.xscale)
y = 0
;-------------------------

[State 1030, AttackMulSet]
type = AttackMulSet
trigger1 = Root, Var(55) > 0
ignorehitpause = 1
value = 0.5

[State 1030, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 1030, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 1030, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

[State 1030, VelSet]
type = VelSet
trigger1 = Root, Var(55) > 0
trigger1 = Time <= 0
ignorehitpause = 1
persistent = 0
x = Vel X * 2
y = Vel Y * 2

[State 1030, AngleDraw]
type = AngleDraw
trigger1 = 1
ignorehitpause = 1

[State 1030, 2]
type = HitDef
trigger1 = Time <= 0
attr = A, SP
damage = 30, 0
animtype = Heavy
guardflag = MA
hitflag = MAF-
priority = 3, Hit
pausetime = Ifelse(Root, Var(55) > 0, 0, 1), Ifelse(Root, Var(55) > 0, 0, 5)
sparkno = 2
sparkxy = 0,0
hitsound = S2, 1
guardsound = S2, 0
ground.type = High
ground.slidetime = 20
ground.hittime = 20
ground.velocity = -10
airguard.velocity = -4,-1
air.type = Low
air.velocity = -5,-2
air.hittime = 20

[State 1030, Destroy]
type = DestroySelf
trigger1 = BackEdgeBodyDist <= -1000
trigger2 = FrontEdgeBodyDist <= -100
trigger3 = Pos Y < -250

;---------------------------------------------------------------------------
; Spark
[Statedef 1050]
sprpriority = 10
movetype = A
anim = 1050
ctrl = 0

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

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

[State 1050, SprPriority]
type = SprPriority
trigger1 = 1
value = 10

[State 1050, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 1050, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 1050, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 1050, BindToRoot]
type = BindToRoot
trigger1 = 1
facing = 1
pos = 0,0
time = 1

[State 1050, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 1050, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 1050, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

[State 1050, Destroy]
type = DestroySelf
trigger1 = Root, Anim = 1000
trigger1 = Root, AnimElem = 7, >= 0
trigger2 = Root, Anim != 1000

;---------------------------------------------------------------------------
; Ground Pound Spark
[Statedef 1055]
sprpriority = 20
movetype = A
anim = 1055
ctrl = 0

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

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

[State 1055, SprPriority]
type = SprPriority
trigger1 = 1
value = 20

[State 1055, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 1055, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 5
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 1055, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 1055, BindToRoot]
type = BindToRoot
trigger1 = 1
facing = 1
pos = 0,0
time = 1

[State 1055, VarSet]
type = VarSet
triggerall = Root, Var(55) > 0
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State 1055, VarAdd]
type = VarAdd
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State 1055, Speed]
type = ChangeAnim
triggerall = Root, Var(55) > 0
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

[State 1055, Destroy]
type = DestroySelf
trigger1 = AnimTime = 0
trigger2 = Root, Anim != 1000

;---------------------------------------------------------------------------
; Boundary
[Statedef 2010]
type = S
movetype = I
physics = N
anim = 2010
velset = 0,0

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

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

[State 2010, Push]
type = PlayerPush
trigger1 = 1
value = 1

[State 2010, Width]
type = Width
trigger1 = 1
value = 10 * Ceil(Const(size.xscale)),0

;--------------------
; Binding to Parent
[State 2010, BindToParent]
type = BindToParent
trigger1 = IsHelper(2010)
facing = 1
pos = 5 * Const(size.xscale), 0
time = 1

[State 2010, BindToParent]
type = BindToParent
trigger1 = !IsHelper(2010)
facing = -1
pos = 55 * Const(size.xscale), 0
time = 1
;--------------------

[State 2010, Destroy]
type = DestroySelf
trigger1 = Parent, StateNo != 2001 

;---------------------------------------------------------------------------
; Giant Mettaur
[Statedef 2510]
type = A
movetype = A
phsics = N
sprpriority = 10
velset = 0,0
juggle = 10
anim = 2511
ctrl = 0

[State 2510, 1]
type = AssertSpecial
trigger1 = 1
ignorehitpause = 1
flag = NoKOSlow

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

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

[State 2510, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 10

[State 2510, VelAdd]
type = VelAdd
trigger1 = Pos Y < 0
y = .5

[State 2510, 2]
type = HitDef
trigger1 = Vel Y > 0
trigger1 = MoveContact = 0
trigger1 = P2StateType != L
trigger1 = P2MoveType != H
attr = A, HA
damage = 0, 0
animtype = Heavy
hitflag = MAF
priority = 3, Hit
pausetime = 1, 1
getpower  = 0
sparkno = -1
sparkxy = 0, 0
hitsound = S2,6
ground.type = High
ground.slidetime = 10
ground.hittime  = 20
ground.velocity = 0,Vel Y * 2
airguard.velocity = 0,0
air.type = High
down.velocity = 0,0
down.hittime = 100
fall.yvelocity = 0
air.velocity = 0,Vel Y * 2
air.hittime = 10
fall.recover = 0
p2stateno = 5025
air.fall = 1
numhits = 0
fall = 1

[State 2510, 5]
type = ChangeState
trigger1 = Time > 0
trigger1 = Pos Y > 0
trigger1 = Vel Y >= 0
value = 2511

;---------------------------------------------------------------------------
; Giant Mettaur Land
[Statedef 2511]
type = S
movetype = A
phsics = N
sprpriority = 10
velset = 0,0
juggle = 10
anim = 2512
ctrl = 0

[State 2510, 1]
type = AssertSpecial
trigger1 = 1
ignorehitpause = 1
flag = NoKOSlow

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

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

[State 2510, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 10

[State 2510, PosSet]
type = PosSet
trigger1 = 1
y = 0

[State 2510, PlaySnd]
type = PlaySnd
trigger1 = Anim = 2512
trigger1 = AnimElem = 1
persistent = 0
value = 7, 0
channel = 1

[State 2510, EnvShake]
type = EnvShake
trigger1 = Time <= 0
time = 20
freq = 100
ampl = -10
phase = 10

;----- Ground Spark -----
[State 2510, Spark]
type = Explod
trigger1 = Time <= 0
scale = 2,1
anim = F60
pos = 0,0
postype = P1
facing = 1
sprpriority = 5

[State 2510, Spark]
type = Explod
trigger1 = Time <= 0
scale = 2,1
anim = F61
pos = 0,0
postype = P1
facing = 1
sprpriority = 5

[State 2510, Spark]
type = Explod
trigger1 = Time <= 0
scale = 2,1
anim = F62
pos = 0,0
postype = P1
facing = 1
sprpriority = 5
;-------------------------

;----- Ground Waves -----
[State 2510, Explod]
type = Explod
trigger1 = Time <= 0
sprpriority = 10
supermovetime = -1
pausemovetime = -1
removeongethit = 1
facing = 1
scale = const(size.xscale) * 2, const(size.yscale)
postype = P1
ownpal = 1
ontop = 1
anim = 111
pos = ceil(-40 * const(size.xscale)),0
ID = 110

[State 2510, Explod]
type = Explod
trigger1 = Time <= 0
sprpriority = 10
supermovetime = -1
pausemovetime = -1
removeongethit = 1
facing = -1
scale = const(size.xscale) * 2, const(size.yscale)
postype = P1
ownpal = 1
ontop = 1
anim = 111
pos = ceil(40 * const(size.xscale)),0
ID = 111
;-------------------------

;----- Smoke -----
[State 2510, Smoke]
type = Explod
trigger1 = Time <= 0
sprpriority = 20
scale = const(size.xscale), const(size.yscale)
anim = F120
pos = ceil(-50 * const(size.xscale)),0	;-100,0
supermovetime = -1
pausemovetime = -1
removeongethit = 1
postype = p1
facing = 1
ontop = 1

[State 2510, Smoke]
type = Explod
trigger1 = Time <= 0
sprpriority = 20
scale = const(size.xscale), const(size.yscale)
anim = F120
pos = ceil(-37.5 * const(size.xscale)),0	;-75,0
supermovetime = -1
pausemovetime = -1
removeongethit = 1
postype = p1
facing = 1
ontop = 1

[State 2510, Smoke]
type = Explod
trigger1 = Time <= 0
sprpriority = 20
scale = const(size.xscale), const(size.yscale)
anim = F120
pos = ceil(-25 * const(size.xscale)),0	;-50,0
supermovetime = -1
pausemovetime = -1
removeongethit = 1
postype = p1
facing = 1
ontop = 1

[State 2510, Smoke]
type = Explod
trigger1 = Time <= 0
sprpriority = 20
scale = const(size.xscale), const(size.yscale)
anim = F120
pos = ceil(-12.5 * const(size.xscale)),0	;-25,0
supermovetime = -1
pausemovetime = -1
removeongethit = 1
postype = p1
facing = 1
ontop = 1

[State 2510, Smoke]
type = Explod
trigger1 = Time <= 0
sprpriority = 20
scale = const(size.xscale), const(size.yscale)
anim = F120
pos = 0,0
supermovetime = -1
pausemovetime = -1
removeongethit = 1
postype = p1
facing = 1
ontop = 1

[State 2510, Smoke]
type = Explod
trigger1 = Time <= 0
sprpriority = 20
scale = const(size.xscale), const(size.yscale)
anim = F120
pos = ceil(12.5 * const(size.xscale)),0	;25,0
supermovetime = -1
pausemovetime = -1
removeongethit = 1
postype = p1
facing = 1
ontop = 1

[State 2510, Smoke]
type = Explod
trigger1 = Time <= 0
sprpriority = 20
scale = const(size.xscale), const(size.yscale)
anim = F120
pos = ceil(25 * const(size.xscale)),0	;50,0
supermovetime = -1
pausemovetime = -1
removeongethit = 1
postype = p1
facing = 1
ontop = 1

[State 2510, Smoke]
type = Explod
trigger1 = Time <= 0
sprpriority = 20
scale = const(size.xscale), const(size.yscale)
anim = F120
pos = ceil(37.5 * const(size.xscale)),0	;75,0
supermovetime = -1
pausemovetime = -1
removeongethit = 1
postype = p1
facing = 1
ontop = 1

[State 2510, Smoke]
type = Explod
trigger1 = Time <= 0
sprpriority = 20
scale = const(size.xscale), const(size.yscale)
anim = F120
pos = ceil(50 * const(size.xscale)),0	;100,0
supermovetime = -1
pausemovetime = -1
removeongethit = 1
postype = p1
facing = 1
ontop = 1
;--------------------

[State 2510, EnvColor]
type = EnvColor
trigger1 = MoveContact
value = 250,250,250
ignorehitpause = 1
persistent = 0
under = 0
time = 2

[State 2510, HitDef]
type = HitDef
trigger1 = MoveContact = 0
trigger1 = P2StateType = L
attr = A, HA
damage = 900000, 900000
animtype = Heavy
hitflag = FD
priority = 3, Hit
pausetime = 5, 5
getpower  = 0
sparkno = -1
sparkxy = 0, 0
hitsound = S2,7
ground.type = High
ground.slidetime = 10
ground.hittime  = 20
ground.velocity = 0,0
airguard.velocity = 0,0
air.type = High
down.velocity = 0,0
down.hittime = 50
fall.yvelocity = 0
air.velocity = 0,0
air.hittime = 10
fall.recover = 0
p2stateno = 5085
air.fall = 1
numhits = 0
fall = 1

[State 2510, Anim]
type = ChangeAnim
trigger1 = Anim = 2512
trigger1 = AnimTime = 0
value = 2510

[State 2510, State]
type = ChangeState
triggerall = Time >= 25
triggerall = P2Life != 0
triggerall = Anim != 2512 
trigger1 = P2StateType != L 
trigger2 = P2StateNo >= 5120
value = 2515

;---------------------------------------------------------------------------
; Giant Metool Jump
[Statedef 2515]
type = A
movetype = I
physics = N
sprpriority = 10
velset = 0,0
anim = 2515
ctrl = 0

[State 2515, 1]
type = AssertSpecial
trigger1 = 1
ignorehitpause = 1
flag = NoKOSlow

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

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

[State 2515, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 10

[State 2515, PosSet]
type = PosSet
trigger1 = Time <= 0
y = 0

[State 2515, 1]
type = PlaySnd
trigger1 = Anim = 2515
trigger1 = AnimElem = 4
value = 7, 1
channel = 1

[State 2515, 0]
type = VelSet
trigger1 = Anim = 2515
trigger1 = AnimElem = 5
x = 15
y = -10

[State 2515, 1]
type = VelAdd
trigger1 = Pos Y != 0
y = .5

[State 2515, Anim]
type = ChangeAnim
trigger1 = Time > 0
trigger1 = Vel Y > 0
trigger1 = Pos Y != 0
trigger1 = Anim = 2515
trigger1 = AnimElem = 5, >= 0
persistent = 0
value = 2511

[State 2515, Destroy]
type = DestroySelf
triggerall = Time > 0
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0

;---------------------------------------------------------------------------
; AI Control System
[Statedef 6666]
velset = 0,0
anim = 6666
ctrl = 0

[State 6666, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
flag2 = Invisible

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

[State 6666, Turn]
type = Turn
trigger1 = Facing != Parent, Facing
trigger2 = Facing = 1 && Parent, Facing = -1
trigger3 = Facing = -1 && Parent, Facing = 1

;----- Charge Fix -----
[State 6666, VarSet]
type = VarSet
trigger1 = 1
var(30) = 0

[State 6666, VarSet]
type = VarSet
trigger1 = 1
var(31) = 0
;-------------------------

;----- AI Control Set -----
[State 6666, CPU]
type = ParentVarSet
triggerall = Var(0) >= 0		; Control Buffer (Parent/Player)
triggerall = Var(1) <= 0		; StateNo Buffer (Parent/Player)
triggerall = Var(2) > 0			; StateTime Buffer (Parent/Player)
triggerall = Var(3) = Var(4)		; Facing Buffer (Helper/Self = Parent/Player)
triggerall = Var(5) <= 0		; Direction Buffer (Helper/Self)
triggerall = Var(5) = Var(6)		; Direction Buffer (Helper/Self = Parent/Player)
triggerall = Var(6) <= 0		; Direction Buffer (Parent/Player)
triggerall = Var(7) <= 0		; Button Buffer (Helper/Self)
triggerall = Var(7) = Var(8)		; Button Buffer (Helper/Self = Parent/Player)
triggerall = Var(8) <= 0		; Button Buffer (Parent/Player)
triggerall = Var(9) < 0			; AI Match Buffer
triggerall = RoundState = 2
trigger1 = Parent, Command = "fwd"
trigger2 = Parent, Command = "back"
trigger3 = Parent, Command = "down"
trigger4 = Parent, Command = "up"
trigger5 = Parent, Command = "x"
trigger6 = Parent, Command = "y"
trigger7 = Parent, Command = "z"
trigger8 = Parent, Command = "a"
trigger9 = Parent, Command = "b"
trigger10 = Parent, Command = "c"
trigger11 = Parent, Command = "s"
var(20) = -1

[State 6666, Player]
type = ParentVarSet
triggerall = Var(0) >= 0		; Control Buffer (Parent/Player)
triggerall = Var(1) <= 0		; StateNo Buffer (Parent/Player)
triggerall = Var(2) > 0			; StateTime Buffer (Parent/Player)
triggerall = Var(3) = Var(4)		; Facing Buffer (Helper/Self = Parent/Player)
triggerall = Var(5) <= 0		; Direction Buffer (Helper/Self)
triggerall = Var(5) = Var(6)		; Direction Buffer (Helper/Self = Parent/Player)
triggerall = Var(6) <= 0		; Direction Buffer (Parent/Player)
triggerall = Var(7) <= 0		; Button Buffer (Helper/Self)
triggerall = Var(7) = Var(8)		; Button Buffer (Helper/Self = Parent/Player)
triggerall = Var(8) <= 0		; Button Buffer (Parent/Player)
triggerall = Var(9) < 0			; AI Match Buffer
triggerall = RoundState = 2
trigger1 = Command = "fwd"
trigger1 = Parent, Command = "fwd"
trigger2 = Command = "back"
trigger2 = Parent, Command = "back"
trigger3 = Command = "down"
trigger3 = Parent, Command = "down"
trigger4 = Command = "up"
trigger4 = Parent, Command = "up"
trigger5 = Command = "x"
trigger5 = Parent, Command = "x"
trigger6 = Command = "y"
trigger6 = Parent, Command = "y"
trigger7 = Command = "z"
trigger7 = Parent, Command = "z"
trigger8 = Command = "a"
trigger8 = Parent, Command = "a"
trigger9 = Command = "b"
trigger9 = Parent, Command = "b"
trigger10 = Command = "c"
trigger10 = Parent, Command = "c"
trigger11 = Command = "s"
trigger11 = Parent, Command = "s"
var(20) = 1
;-------------------------

;===== BUFFER SYSTEM =====
;----- Control Buffer -----
[State 6666, VarSet]
type = VarSet
trigger1 = Parent, Ctrl = 0
var(0) = -1

[State 6666, VarAdd]
type = VarAdd
trigger1 = Parent, Ctrl = 1
var(0) = 1
;-------------------------

;----- State Buffer -----
[State 6666, VarSet]
type = VarSet
trigger1 = 1
var(1) = Parent, StateNo
;-------------------------

;------ Time Buffer ------
[State 6666, VarSet]
type = VarSet
trigger1 = 1
var(2) = Parent, Time
;-------------------------

;----- Facing Buffer -----
[State 6666, VarSet]
type = VarSet
trigger1 = 1
var(3) = Facing

[State 6666, VarSet]
type = VarSet
trigger1 = 1
var(4) = Parent, Facing
;-------------------------

;----- Command Buffer -----
[State 6666, Directions]
type = VarSet
trigger1 = Var(5) > 0
trigger2 = Var(6) > 0
trigger3 = Var(7) > 0
trigger4 = Var(8) > 0
var(5) = -1

[State 6666, Directions]
type = VarAdd
triggerall = Var(5) < 0
triggerall = Var(6) < 0
triggerall = Var(7) < 0
triggerall = Var(8) < 0
trigger1 = Command = "holdfwd"
trigger2 = Command = "holdback"
trigger3 = Command = "holddown"
trigger4 = Command = "holdup"
var(5) = 1

[State 6666, Directions]
type = VarSet
trigger1 = Var(5) > 0
trigger2 = Var(6) > 0
trigger3 = Var(7) > 0
trigger4 = Var(8) > 0
var(6) = -1

[State 6666, Directions]
type = VarAdd
triggerall = Var(5) < 0
triggerall = Var(6) < 0
triggerall = Var(7) < 0
triggerall = Var(8) < 0
trigger1 = Parent, Command = "holdfwd"
trigger2 = Parent, Command = "holdback"
trigger3 = Parent, Command = "holddown"
trigger4 = Parent, Command = "holdup"
var(6) = 1

[State 6666, Buttons]
type = VarSet
trigger1 = Var(5) > 0
trigger2 = Var(6) > 0
trigger3 = Var(7) > 0
trigger4 = Var(8) > 0
var(7) = -1

[State 6666, Buttons]
type = VarAdd
triggerall = Var(5) < 0
triggerall = Var(6) < 0
triggerall = Var(7) < 0
triggerall = Var(8) < 0
trigger1 = Command = "hold_x"
trigger2 = Command = "hold_y"
trigger3 = Command = "hold_z"
trigger4 = Command = "hold_a"
trigger5 = Command = "hold_b"
trigger6 = Command = "hold_c"
trigger7 = Command = "hold_s"
var(7) = 1

[State 6666, Buttons]
type = VarSet
trigger1 = Var(5) > 0
trigger2 = Var(6) > 0
trigger3 = Var(7) > 0
trigger4 = Var(8) > 0
var(8) = -1

[State 6666, Buttons]
type = VarAdd
triggerall = Var(5) < 0
triggerall = Var(6) < 0
triggerall = Var(7) < 0
triggerall = Var(8) < 0
trigger1 = Parent, Command = "hold_x"
trigger2 = Parent, Command = "hold_y"
trigger3 = Parent, Command = "hold_z"
trigger4 = Parent, Command = "hold_a"
trigger5 = Parent, Command = "hold_b"
trigger6 = Parent, Command = "hold_c"
trigger7 = Parent, Command = "hold_s"
var(8) = 1
;-------------------------

;----- AI Match Buffer -----
[State 6666, VarSet]
type = VarSet
trigger1 = Var(20) = Parent, Var(20)
var(9) = -1

[State 6666, VarAdd]
type = VarAdd
trigger1 = Var(20) != Parent, Var(20)
var(9) = 1
;-------------------------
;=========================

;----- Control Method -----
[State 6666, VarSet]
type = VarSet
trigger1 = 1
var(20) = Parent, Var(20)

[State 6666, Variables]
type = DisplayToClipboard
trigger1 = Var(20) = 0
trigger2 = Parent, Var(20) = 0
text = "AI Trigger:"

[State 6666, Variables]
type = DisplayToClipboard
trigger1 = Var(20) > 0
trigger2 = Parent, Var(20) > 0
text = "AI Trigger: Player"

[State 6666, Variables]
type = DisplayToClipboard
trigger1 = Var(20) < 0
trigger2 = Parent, Var(20) < 0
text = "AI Trigger: CPU"
;-------------------------

[State 6666, Destroy]
type = DestroySelf
trigger1 = RoundState != 2
trigger2 = Parent, Alive = 0
trigger3 = Parent, Life <= 0
trigger4 = Parent, PalNo > 6
trigger5 = Parent, IsHomeTeam = 1
trigger5 = Parent, TeamSide = 2
trigger6 = Parent, IsHomeTeam = 1
trigger6 = Parent, MatchNo > 1

;---------------------------------------------------------------------------
; Death Explodes (Helper)
[Statedef 6900]
statetype = A
movetype = I
physics = N
sprpriority = 50
velset = 0, 0
anim = 6900
ctrl = 0

[State 6900, AssertSpecial]
type = AssertSpecial
trigger1 = Time <= 0
flag = Invisible
flag2 = NoShadow

[State 6900, Trans]
type = Trans
trigger1 = 1
ignorehitpause = 1
trans = add1

[State 6900, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 50

[State 6900, BindToRoot]
type = BindToRoot
trigger1 = Time <= 0
trigger1 = Root, Facing = 1
facing = 1
pos = 0, ceil(-25 * const(size.yscale))
time = 1

[State 6900, BindToRoot]
type = BindToRoot
trigger1 = Time <= 0
trigger1 = Root, Facing = -1
facing = -1
pos = 0, ceil(-25 * const(size.yscale))
time = 1

[State 6900, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 0
value = 1

[State 6900, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 1
value = 0

[State 6900, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 2
value = 0

[State 6900, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 3
value = 0

[State 6900, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 4
value = 0

[State 6900, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 0
value = 0.02 + FVar(1) + FVar(2) + FVar(3)

[State 6900, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 1
value = 0.004

[State 6900, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 2
value = 0.0006

[State 6900, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 3
value = 0.00008

[State 6900, Pos X]
type = VarRandom
trigger1 = Time <= 0
v = 0
range = -25,25

[State 6900, Pos Y]
type = VarRandom
trigger1 = Time <= 0
v = 1
range = -25,25

[State 6900, BindToRoot]
type = BindToRoot
trigger1 = Time <= 0
trigger1 = Root, Facing = 1
facing = 1
pos = Var(0) * Const(size.xscale), ceil(-25 * const(size.yscale)) + (Var(1) * const(size.yscale))
time = 1

[State 6900, BindToRoot]
type = BindToRoot
trigger1 = Time <= 0
trigger1 = Root, Facing = -1
facing = -1
pos = Var(0) * Const(size.xscale), ceil(-25 * const(size.yscale)) + (Var(1) * const(size.yscale))
time = 1

[State 6900, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = FVar(0) / 2, FVar(0) / 2

;----- Velocities -----
[State 6900, VelAdd]
type = VelAdd
triggerall = NumHelper(7020) > 0
trigger1 = Pos X > Helper(7020), Pos X + (5 * const(size.xscale))
x = 0.1 * Const(size.xscale)

[State 6900, VelAdd]
type = VelAdd
triggerall = NumHelper(7020) > 0
trigger1 = Pos X < Helper(7020), Pos X - (5 * const(size.xscale))
x = -0.1 * Const(size.xscale)

[State 6900, VelAdd]
type = VelAdd
triggerall = NumHelper(7020) > 0
trigger1 = Pos Y > Helper(7020), Pos Y + (5 * const(size.yscale))
y = 0.1 * Const(size.yscale)

[State 6900, VelAdd]
type = VelAdd
triggerall = NumHelper(7020) > 0
trigger1 = Pos Y < Helper(7020), Pos Y - (5 * const(size.yscale))
y = -0.1 * Const(size.yscale)
;--------------------

[State 6900, Destroy]
type = DestroySelf
triggerall = Time > 0
trigger1 = NumHelper(7020) <= 0
trigger2 = AnimTime = 0
trigger3 = Time >= 30

;---------------------------------------------------------------------------
; Death Explodes (Explod)
[Statedef 6905]
statetype = A
movetype = I
physics = N
sprpriority = 50
velset = 0, 0
anim = 6900
ctrl = 0

[State 6905, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = Invisible
flag2 = NoShadow

[State 6905, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 50

[State 6905, BindToRoot]
type = BindToRoot
trigger1 = Time <= 0
trigger1 = Root, Facing = 1
facing = 1
pos = 0, ceil(-25 * const(size.yscale))
time = 1

[State 6905, BindToRoot]
type = BindToRoot
trigger1 = Time <= 0
trigger1 = Root, Facing = -1
facing = -1
pos = 0, ceil(-25 * const(size.yscale))
time = 1

[State 6905, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 0
value = 1

[State 6905, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 1
value = 0

[State 6905, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 2
value = 0

[State 6905, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 3
value = 0

[State 6905, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 4
value = 0

[State 6905, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 0
value = 0.02 + FVar(1) + FVar(2) + FVar(3)

[State 6905, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 1
value = 0.004

[State 6905, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 2
value = 0.0006

[State 6905, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 3
value = 0.00008

[State 6905, Pos X]
type = VarRandom
trigger1 = Time <= 0
v = 0
range = -25,25

[State 6905, Pos Y]
type = VarRandom
trigger1 = Time <= 0
v = 1
range = -25,25

[State 6905, BindToRoot]
type = BindToRoot
trigger1 = Time <= 0
trigger1 = Root, Facing = 1
facing = 1
pos = Var(0) * Const(size.xscale), ceil(-25 * const(size.yscale)) + (Var(1) * const(size.yscale))
time = 1

[State 6905, BindToRoot]
type = BindToRoot
trigger1 = Time <= 0
trigger1 = Root, Facing = -1
facing = -1
pos = Var(0) * Const(size.xscale), ceil(-25 * const(size.yscale)) + (Var(1) * const(size.yscale))
time = 1

;----- Explodes -----
[State 6905, Explod]
type = Explod
trigger1 = Time <= 0
trigger1 = Root, Facing = 1
scale = Const(size.xscale), Const(size.yscale)
pausemovetime = -1
supermovetime = -1
sprpriority = 50
trans = add1
facing = 1
pos = 0, 0
postype = p1
anim = 6900
id = 6900

[State 6905, Explod]
type = Explod
trigger1 = Time <= 0
trigger1 = Root, Facing = -1
scale = Const(size.xscale), Const(size.yscale)
pausemovetime = -1
supermovetime = -1
sprpriority = 50
bindtime = -1
trans = add1
facing = -1
pos = 0, 0
postype = p1
anim = 6900
id = 6900

[State 6905, Explod]
type = ModifyExplod
trigger1 = NumExplod(6900) > 0
trigger1 = Root, Facing = 1
scale = (Const(size.xscale) * FVar(0)) / 2, (Const(size.yscale) * FVar(0)) / 2
sprpriority = 50
bindtime = -1
trans = add1
facing = 1
id = 6900

[State 6905, Explod]
type = ModifyExplod
trigger1 = NumExplod(6900) > 0
trigger1 = Root, Facing = -1
scale = (Const(size.xscale) * FVar(0)) / 2, (Const(size.yscale) * FVar(0)) / 2
sprpriority = 50
bindtime = -1
trans = add1
facing = -1
id = 6900
;--------------------

;----- Velocities -----
[State 6905, VelAdd]
type = VelAdd
triggerall = NumHelper(7020) > 0
trigger1 = Pos X > Helper(7020), Pos X + (5 * const(size.xscale))
x = 0.1 * Const(size.xscale)

[State 6905, VelAdd]
type = VelAdd
triggerall = NumHelper(7020) > 0
trigger1 = Pos X < Helper(7020), Pos X - (5 * const(size.xscale))
x = -0.1 * Const(size.xscale)

[State 6905, VelAdd]
type = VelAdd
triggerall = NumHelper(7020) > 0
trigger1 = Pos Y > Helper(7020), Pos Y + (5 * const(size.yscale))
y = 0.1 * Const(size.yscale)

[State 6905, VelAdd]
type = VelAdd
triggerall = NumHelper(7020) > 0
trigger1 = Pos Y < Helper(7020), Pos Y - (5 * const(size.yscale))
y = -0.1 * Const(size.yscale)
;--------------------

[State 6905, Destroy]
type = DestroySelf
triggerall = Time > 0
trigger1 = NumHelper(7020) <= 0
trigger2 = AnimTime = 0
trigger3 = Time >= 30

;---------------------------------------------------------------------------
; Death KO Lines
[Statedef 7000]
statetype = A
movetype = I
physics = N
sprpriority = 10
velset = 0, 0
anim = 7000
ctrl = 0

[State 7000, Anim]
type = ChangeAnim
triggerall = IsHelper(7000)
trigger1 = Anim != 7000
trigger1 = Time <= 0
value = 7000

[State 7000, Anim]
type = ChangeAnim
triggerall = IsHelper(7001)
trigger1 = Anim != 7001
trigger1 = Time <= 0
value = 7001

[State 7000, Anim]
type = ChangeAnim
triggerall = IsHelper(7002)
trigger1 = Anim != 7002
trigger1 = Time <= 0
value = 7002

[State 7000, Anim]
type = ChangeAnim
triggerall = IsHelper(7003)
trigger1 = Anim != 7003
trigger1 = Time <= 0
value = 7003

[State 7000, Anim]
type = ChangeAnim
triggerall = IsHelper(7004)
trigger1 = Anim != 7004
trigger1 = Time <= 0
value = 7004

[State 7000, Anim]
type = ChangeAnim
triggerall = IsHelper(7005)
trigger1 = Anim != 7005
trigger1 = Time <= 0
value = 7005

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

[State 7000, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 20

[State 7000, BindToRoot]
type = BindToRoot
trigger1 = Root, Facing = 1
facing = 1
pos = 0, ceil(-25 * const(size.yscale))
time = 1

[State 7000, BindToRoot]
type = BindToRoot
trigger1 = Root, Facing = -1
facing = -1
pos = 0, ceil(-25 * const(size.yscale))
time = 1

[State 7000, Trans]
type = Trans
trigger1 = 1
ignorehitpause = 1
trans = addalpha
alpha = 250,250

[State 7000, VarSet]
type = VarSet
trigger1 = NumHelper(7010) <= 0
v = 0
value = 0

[State 7000, VarAdd]
type = VarAdd
trigger1 = NumHelper(7010) > 0
v = 0
value = 10

[State 7000, VarSet]
type = VarSet
trigger1 = Var(0) >= 250
v = 0
value = 250

[State 7000, PalFX]
type = PalFX
trigger1 = NumHelper(7010) > 0
time = 1
add = -250 + Var(0),-250 + Var(0),-250 + Var(0)

[State 7000, Destroy]
type = DestroySelf
triggerall = Time > 0
trigger1 = AnimTime = 0
trigger2 = NumHelper(7020) > 0

;---------------------------------------------------------------------------
; Death KO Implosion
[Statedef 7010]
statetype = A
movetype = I
physics = N
sprpriority = 20
velset = 0, 0
anim = 7010
ctrl = 0

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

[State 7010, AssertSpecial]
type = AssertSpecial
trigger1 = Time <= 0
flag = Invisible

[State 7010, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 0
value = 15

[State 7010, VarAdd]
type = VarAdd
trigger1 = Time > 0
trigger1 = FVar(0) > 2
fv = 0
value = -0.5

[State 7010, VarAdd]
type = VarAdd
trigger1 = Time > 0
trigger1 = FVar(0) <= 2
trigger1 = FVar(0) > 1
fv = 0
value = -0.25

[State 7010, VarAdd]
type = VarAdd
trigger1 = Time > 0
trigger1 = FVar(0) <= 1
trigger1 = FVar(0) > 0
fv = 0
value = -0.1

[State 7010, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 20

[State 7010, BindToRoot]
type = BindToRoot
trigger1 = Root, Facing = 1
facing = 1
pos = 0, ceil(-25 * const(size.yscale))
time = 1

[State 7010, BindToRoot]
type = BindToRoot
trigger1 = Root, Facing = -1
facing = -1
pos = 0, ceil(-25 * const(size.yscale))
time = 1

[State 7010, Trans]
type = Trans
trigger1 = 1
ignorehitpause = 1
trans = addalpha
alpha = 250,250

[State 7010, VarSet]
type = VarSet
trigger1 = Time <= 0
v = 0
value = 0

[State 7010, VarAdd]
type = VarAdd
trigger1 = Time > 0
v = 0
value = 10

[State 7010, VarSet]
type = VarSet
trigger1 = Var(0) >= 250
v = 0
value = 250

[State 7010, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = -250 + Var(0),-250 + Var(0),-250 + Var(0)

[State 7010, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = FVar(0), FVar(0)

[State 7010, Destroy]
type = DestroySelf
triggerall = Time > 0
trigger1 = FVar(0) < 0

;---------------------------------------------------------------------------
; Death KO Explosion
[Statedef 7020]
statetype = A
movetype = I
physics = N
sprpriority = 30
velset = 0, 0
anim = 7020
ctrl = 0

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

[State 7020, AssertSpecial]
type = AssertSpecial
trigger1 = Time <= 0
flag = Invisible

[State 7020, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 0
value = 1

[State 7020, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 1
value = 0

[State 7020, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 2
value = 0

[State 7020, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 3
value = 0

[State 7020, VarSet]
type = VarSet
trigger1 = Time <= 0
fv = 4
value = 0

[State 7020, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 0
value = 0.001 + FVar(1) + FVar(2) + FVar(3) + FVar(4)

[State 7020, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 1
value = 0.0002

[State 7020, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 2
value = 0.00003

[State 7020, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 3
value = 0.000004

[State 7020, VarAdd]
type = VarAdd
trigger1 = Time > 0
fv = 4
value = 0.0000005

[State 7020, SprPriority]
type = SprPriority
trigger1 = 1
ignorehitpause = 1
value = 30

[State 7020, BindToRoot]
type = BindToRoot
trigger1 = Root, Facing = 1
facing = 1
pos = 0, ceil(-25 * const(size.yscale))
time = 1

[State 7020, BindToRoot]
type = BindToRoot
trigger1 = Root, Facing = -1
facing = -1
pos = 0, ceil(-25 * const(size.yscale))
time = 1

[State 7020, Trans]
type = Trans
trigger1 = 1
ignorehitpause = 1
trans = addalpha
alpha = 250,250

[State 7020, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = FVar(0), FVar(0)

[State 7020, Destroy]
type = DestroySelf
triggerall = Time > 0
trigger1 = Time >= 200
trigger2 = FVar(0) > 5

;---------------------------------------------------------------------------
; Aura Shadow
[Statedef 9999]
sprpriority = -5
movetype = I
ctrl = 0

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

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

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

[State 9999, AssertSpecial]
type = AssertSpecial
trigger1 = Time <= 0
trigger2 = !SelfAnimExist(Root, Anim)
trigger3 = !AnimExist(Root, Anim)
trigger4 = Root, StateNo >= 160
trigger4 = Root, StateNo < 5000
trigger4 = Root, MoveType = H
trigger5 = Root, StateNo >= 6000
trigger5 = Root, MoveType = H
trigger6 = Root, Anim >= 160
trigger6 = Root, Anim < 5000
trigger6 = Root, MoveType = H
trigger7 = Root, Anim >= 6000
trigger7 = Root, MoveType = H
flag = Invisible

[State 9999, SprPriority]
type = SprPriority
trigger1 = 1
value = -5

[State 9999, BindToRoot]
type = BindToRoot
trigger1 = 1
facing = 1
pos = 0,0
time = 1

[State 9999, PalFX]
type = PalFX
trigger1 = 1
time = 1
color = 0
add = 255,255,255
mul = 255,255,255

[State 9999, PalFX]
type = PalFX
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
time = 1
color = 0
add = 150,150,150
mul = 150,150,150

;----- Set Animation -----
[State 9999, VarSet]		; Binded Animation Fix
type = VarSet
trigger1 = Root, HitPauseTime = 0
var(0) = Root, AnimElemNo(0)

[State 9999, Anim]
type = ChangeAnim
triggerall = SelfAnimExist(Root, Anim)
triggerall = AnimExist(Root, Anim)
trigger1 = Root, Anim < 6000
value = Root, Anim
elem = Var(0)

[State 9999, Anim]
type = ChangeAnim
triggerall = SelfAnimExist(Root, Anim)
triggerall = AnimExist(Root, Anim)
triggerall = Root, StateNo >= 2102
triggerall = Root, StateNo < 2105
triggerall = Root, HitPauseTime > 0
trigger1 = Root, AnimElemNo(0) > AnimElemNo(0)
value = Root, Anim
elem = Root, AnimElemNo(0)
;-------------------------

;----- Scale Timer -----
[State 9999, VarAdd]
type = VarAdd
trigger1 = Time > 0
var(10) = 1

[State 9999, VarSet]
type = VarSet
trigger1 = Time <= 0
trigger2 = Var(10) >= 300
var(10) = 0
;-------------------------

;===== Twitch Size X,Y =====
;----- Size X Scale -----
[State 9999, VarSet]
type = VarSet
trigger1 = Time <= 0
trigger2 = FVar(0) < 1.15
fvar(0) = 1.25

[State 9999, VarAdd]
type = VarAdd
trigger1 = FVar(0) >= 1.15
fvar(0) = -0.05
;-------------------------

;----- Size Y Scale -----
[State 9999, VarSet]
type = VarSet
trigger1 = Time <= 0
trigger2 = FVar(1) <= 1.05
fvar(1) = 1.15

[State 9999, VarAdd]
type = VarAdd
trigger1 = FVar(1) > 1.05
fvar(1) = -0.05
;-------------------------
;==============================

;===== Grow/Shrink X,Y =====
;----- Resize X Scale -----
; -=[ Grow ]=-
[State 9999, VarAdd]
type = VarAdd
triggerall = TimeMod = 5,0
triggerall = FVar(10) < 0.150
trigger1 = Var(10) >= 100
trigger1 = Var(10) <= 150
fvar(10) = 0.025 / 2

; -=[ Shrink ]=-
[State 9999, VarAdd]
type = VarAdd
triggerall = TimeMod = 5,0
triggerall = FVar(10) > 0
trigger1 = Var(10) >= 250
trigger1 = Var(10) <= 300
fvar(10) = -0.025 / 2

; -=[ Reset ]=-
[State 9999, VarSet]
type = VarSet
trigger1 = Time <= 0
trigger2 = FVar(10) <= 0
trigger3 = Var(10) <= 0
fvar(10) = 0.025
;-------------------------

;----- Resize Y Scale -----
; -=[ Grow ]=-
[State 9999, VarAdd]
type = VarAdd
triggerall = TimeMod = 5,0
triggerall = FVar(11) < 0.125
trigger1 = Var(10) >= 100
trigger1 = Var(10) <= 150
fvar(11) = 0.025 / 2

; -=[ Shrink ]=-
[State 9999, VarAdd]
type = VarAdd
triggerall = TimeMod = 5,0
triggerall = FVar(11) > 0
trigger1 = Var(10) >= 250
trigger1 = Var(10) <= 300
fvar(11) = -0.025 / 2

; -=[ Reset ]=-
[State 9999, VarSet]
type = VarSet
trigger1 = Time <= 0
trigger2 = FVar(11) <= 0
trigger3 = Var(10) <= 0
fvar(11) = 0
;-------------------------
;==============================

;===== Scale X,Y Difference =====
;----- Size X Difference -----
[State 9999, VarSet]
type = VarSet
trigger1 = Time <= 0
trigger2 = Root, Alive
trigger3 = FVar(20) > 0
fvar(20) = 0

[State 9999, VarAdd]
type = VarAdd
trigger1 = Root, Alive = 0
fvar(20) = -0.0025
;-------------------------

;----- Size Y Difference -----
[State 9999, VarSet]
type = VarSet
trigger1 = Time <= 0
trigger2 = Root, Alive
trigger3 = FVar(21) > 0
fvar(21) = 0

[State 9999, VarAdd]
type = VarAdd
trigger1 = Root, Alive = 0
fvar(21) = -0.0025
;-------------------------
;==============================

;----- Size Scale Draw -----
[State 9999, AngleDraw]
type = AngleDraw
trigger1 = Time < 145
trigger1 = Root, Alive
scale = FVar(0) - 0.05, FVar(1) - 0.05

[State 9999, AngleDraw]
type = AngleDraw
trigger1 = Time >= 145
trigger1 = Root, Alive
scale = (FVar(0) + FVar(10)) - 0.025, (FVar(1) + FVar(11)) - 0.025

[State 9999, AngleDraw]
type = AngleDraw
trigger1 = Root, Alive = 0
scale = (FVar(0) + FVar(10) + FVar(20)) - 0.0125, (FVar(1) + FVar(11) + FVar(21)) - 0.0125
;-------------------------

[State 9999, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 9999, AfterImage]
type = AfterImage
triggerall = Time > 0
triggerall = Name = "Shadow Omega Zero"
triggerall = AuthorName = "N-Mario"
trigger1 = RoundState >= 2
ignorehitpause = 1
persistent = 0
Time = 0
TimeGap = 1
FrameGap = 1
Length = 10
PalColor = 0
PalBright = 0,0,0
PalContrast = 0,0,0
Trans = add

[State 9999, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 9999, Variables]
type = DisplayToClipboard
trigger1 = 1
text = "Scale X:  %f     Scale Y:  %f     Timer: %d \nSize X:   %f     Size Y:   %f"
params = FVar(0), FVar(1), Var(10), FVar(10), FVar(11)

[State 9999, Destroy]
type = DestroySelf
trigger1 = Anim = 185
trigger1 = AnimElem = 10, >= 0
trigger2 = FVar(20) <= -0.15 || FVar(21) <= -0.15
trigger3 = Root, Anim = 5150

;---------------------------------------------------------------------------
; Sabre Slash Object
[Statedef 10000]
sprpriority = 10
movetype = A
ctrl = 0

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

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

[State 10000, SprPriority]
type = SprPriority
trigger1 = 1
value = 10

[State 10000, Trans]
type = Trans
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
trans = addalpha
alpha = 200,200

[State 10000, AfterImage]
type = AfterImage
trigger1 = Time <= 0
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 0
TimeGap = 1
FrameGap = 1
length = 10
PalBright = 200,0,200
PalContrast = 200,0,200
Trans = add

[State 10000, AfterImage]
type = AfterImageTime
trigger1 = Name = "Shadow Omega Zero"
trigger1 = AuthorName = "N-Mario"
ignorehitpause = 1
time = 2

[State 10000, BindToRoot]
type = BindToRoot
trigger1 = 1
facing = 1
pos = 0,0
time = 1

[State 10000, VarSet]		; Binded Animation Fix
type = VarSet
trigger1 = Root, HitPauseTime = 0
var(0) = Root, AnimElemNo(0)

[State 10000, Anim]
type = ChangeAnim
trigger1 = AnimExist(Root, Anim + 10000)
value = Root, Anim + 10000
elem = Var(0)

[State 10000, Anim]
type = ChangeAnim
triggerall = Root, StateNo >= 2102
triggerall = Root, StateNo < 2105
triggerall = Root, HitPauseTime > 0
trigger1 = AnimExist(Root, Anim + 10000)
trigger1 = Root, AnimElemNo(0) > AnimElemNo(0)
value = Root, Anim + 10000
elem = Root, AnimElemNo(0)

[State 10000, Destroy]
type = DestroySelf
trigger1 = Root, AnimTime = 0
trigger1 = Root, StateType != A
trigger2 = Anim != Root, Anim + 10000
trigger3 = !AnimExist(Root, Anim + 10000)

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