;---------------------------------------------------------------------------
; Mystic Break Base
[Statedef 4000]
type = S
ctrl = 0
anim = 4000
velset = 0,0
movetype = A
physics = S
sprpriority = (var(13) := 1)
poweradd = -1000

[State 4000, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 7500

[State 4000, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 7501

[State 4000, VarSet]
type = VarSet
trigger1 = time = 0
var(0) = var(24)

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

[State 4000, VarSet]
type = VarSet
trigger1 = numtarget
var(1) = target, gethitvar(hitcount)

[State 4000, VarSet]
type = VarSet
trigger1 = time = 0
fvar(0) = 0

[State 4000, NotHitBy]
type = NotHitBy
trigger1 = time = 0
value = SCA
time = 47

[State 4000, SuperPause]
type = SuperPause
trigger1 = time = 1
time = 46
anim = -1
darken = 0
movetime = 46
p2defmul = 1

[State 4000, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = 2000, 0

[State 4000, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = 180, 0
channel = 0

[State 4000, Explod]
type = Explod
trigger1 = animelem = 3, = 1
postype = p1
anim = 7400
pos = floor(47*const(size.xscale)), floor(-112*const(size.yscale))
bindtime = -1
sprpriority = 5
supermovetime = 99999
persistent = 0
scale = 1.5, 1.5
ownpal = 1

[State 4000, 1]
type = HitDef
triggerall = var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, HA
damage = 20, 4
getpower = 0
animtype = Heavy
guardflag = MA
hitflag = MA
pausetime = 12, 11
sparkno = s17002
guard.sparkno = s17006 + 2*(var(8) - var(6) < 0)
sparkxy = -10, floor(-52*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(var(8) - var(6) < 0)
ground.type = Low
ground.velocity = -10
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
air.hittime = 999
airguard.ctrltime = 999
yaccel = .536

[State 4000, 1]
type = HitDef
triggerall = !var(22)
triggerall = !var(43)
trigger1 = !movecontact && !movereversed
id = 0*(var(14) := stateno + (var(18)%1000)*10000 + id%10) + var(14)
attr = S, HA
damage = 20, 4
getpower = 0
animtype = Heavy
guardflag = MA
hitflag = MA
pausetime = 12, 11
sparkno = 2
sparkxy = -10, floor(-52*const(size.yscale))
hitsound   = s5,2
guardsound = s6,0 + 2*(var(8) - var(6) < 0)
ground.type = Low
ground.velocity = -10
ground.hittime  = 20
ground.slidetime  = 20
guard.hittime = 19
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
air.hittime = 999
airguard.ctrltime = 999
yaccel = .536

[State 4000, 2]
type = ChangeState
trigger1 = anim = 4001
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 4000, Helper]
type = Helper
trigger1 = time = 0
trigger1 = var(0) = 1
name = "fire spawner"
id = 4100
stateno = 4100
persistent = 0
pos = 0, 0
ownpal = 1
supermovetime = 99999

[State 4000, Helper]
type = Helper
trigger1 = time = 0
trigger1 = var(0) = 2
name = "ice spawner"
id = 4200
stateno = 4200
persistent = 0
pos = 0, 0
ownpal = 1
supermovetime = 99999

[State 4000, Helper]
type = Helper
trigger1 = time = 0
trigger1 = var(0) = 3
name = "thunder spawner"
id = 4300
stateno = 4300
persistent = 0
pos = 0, 0
ownpal = 1
supermovetime = 99999

[State 4000, Helper]
type = Helper
trigger1 = time = 0
trigger1 = var(0) = 4
name = "wind spawner"
id = 4400
stateno = 4400
persistent = 0
pos = 0, 0
ownpal = 1
supermovetime = 99999

[State 4000, Helper]
type = Helper
trigger1 = time = 0
trigger1 = var(0) = 5
name = "earth spawner"
id = 4500
stateno = 4500
persistent = 0
pos = 0, 0
ownpal = 1
supermovetime = 99999

[State 4000, Helper]
type = Helper
trigger1 = time = 0
trigger1 = var(0) = 6
name = "poison spawner"
id = 4600
stateno = 4600
persistent = 0
pos = 0, 0
ownpal = 1
supermovetime = 99999

[State 4000, ChangeAnim]
type = ChangeAnim
triggerall = anim = 4000
trigger1 = var(0) = 1
trigger1 = time = 122 || (time > 84 && projcontacttime(4100) = [0, 84])
trigger2 = var(0) = 2
trigger2 = time = 163
trigger3 = var(0) = 3
trigger3 = time = 130
trigger4 = var(0) = 4
trigger4 = time = 160
trigger5 = var(0) = 5
trigger5 = time = 166
trigger6 = var(0) = 6
trigger6 = time = 83
value = 4001

[State Weapon Layer]
type = Null
trigger1 = anim = 4000
trigger1 = animelemno(0) > 2
trigger1 = var(11) := 0 || 1

[State Shield Layer]
type = Null
trigger1 = anim = 4000
trigger1 = animelemno(0) > 2
trigger1 = var(12) := 1
trigger2 = anim = 4001
trigger2 = animelemno(0) = [1, 2]
trigger2 = var(12) := 2

[State 4000, Fire FX]
type = Explod
trigger1 = projhittime(4100) = 0
trigger1 = numtarget(4100)
trigger1 = fvar(0) := !fvar(0)
id = 7050
anim = 7050 + random%3
sprpriority = 2
postype = p2
bindtime = 45 
pos = 0, floor(target(4100), const(size.mid.pos.y))
random = floor((target(4100), const(size.ground.front)+target(4100), const(size.ground.back))*(hitcount != 0)*0.4), floor((target(4100), const(size.mid.pos.y)-target(4100), const(size.head.pos.y))*(hitcount != 0)*0.8)
ignorehitpause = 1

[State 4000, Shock FX]
type = Explod
trigger1 = projhittime(4300) = 0
trigger1 = numtarget(4300)
trigger1 = fvar(0) := !fvar(0)
id = 7070
anim = 7070 + random%5
sprpriority = 2
postype = p2
bindtime = -1
pos = 0, target(4300), const(size.mid.pos.y)
random = floor((target(4300), const(size.ground.front)+target(4300), const(size.ground.back))*(hitcount != 0)*0.4), floor((target(4300), const(size.mid.pos.y)-target(4300), const(size.head.pos.y))*(hitcount != 0)*0.8)
ignorehitpause = 1

[State 4000, FX Sound]
type = PlaySnd
trigger1 = projhittime(4100) = 0
trigger1 = numtarget(4100)
value = 5, 2
abspan = floor(target(4100), pos x)
ignorehitpause = 1
channel = 2

[State 4000, FX Sound]
type = PlaySnd
trigger1 = projhittime(4100) = 0
trigger1 = numtarget(4100)
value = 5, 8
abspan = floor(target(4100), pos x)
ignorehitpause = 1
channel = 3

[State 4000, FX Sound]
type = PlaySnd
trigger1 = projhittime(4300) = 0
trigger1 = numtarget(4300)
value = 5, 2
abspan = floor(target(4300), pos x)
ignorehitpause = 1
channel = 2

[State 4000, FX Sound]
type = PlaySnd
trigger1 = projhittime(4300) = 0
trigger1 = numtarget(4300)
value = 5, 10
abspan = floor(target(4300), pos x)
ignorehitpause = 1
channel = 3

[State Delay Dampening]
type = VarSet
trigger1 = time
var(33) = 1

;======================================================================================
;--------------------------------------------------------------------------------------
; Mystic Break Fire Spawner
[Statedef 4100]
type = A
physics = N
movetype = A
anim = 9999

[State 4100, AssertSpecial]
type = AssertSpecial
trigger1 = numexplod(7501)
trigger2 = numexplod(7502)
trigger3 = numexplod(7503)
flag = NoBG
flag2 = NoFG

[State 4100, ChangeState]
type = ChangeState
trigger1 = parent, anim != 4000
trigger2 = parent, stateno != 4000
trigger3 = parent, movetype != A
trigger4 = parent, statetype != S
value = 4101

[State 4100, Explod]
type = Explod
trigger1 = time = 0
postype = left
id = 7501
anim = 7511
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4100, Explod]
type = Explod
trigger1 = (time - 24)%32 = 0
postype = left
id = 7502
anim = 7512
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4100, VarSet]
type = VarSet
trigger1 = root, time > 43
trigger1 = time%4 = 0
fvar(4) = random*0.006 - 3

[State 4100, VarSet]
type = VarSet
trigger1 = root, time > 43
trigger1 = time%4 = 0
fvar(3) = 0.5 + random*0.0005 - fvar(4)*0.05

[State 4100, Explod]
type = Explod
trigger1 = root, time > 43
trigger1 = time%4 = 0
postype = left
id = 4110
anim = 4110 + 10*(random%2) + (root, var(23) != 0)
bindtime = 1
sprpriority = ifelse(fvar(4) < 0, -4, 3)
scale = fvar(3)*const(size.xscale), fvar(3)*const(size.yscale)
pos = 160, floor(screenpos y + fvar(4) - 5*const(size.yscale))
random = 320, 0
supermovetime = 99999

[State 4100, BindToParent]
type = BindToParent
trigger1 = 1

[State 4100, VarSet]
type = VarSet
trigger1 = !time
trigger1 = root, var(38) > (root, movehit > 0)
var(12) = 1

[State 4100, VarAdd]
type = VarAdd
triggerall = parent, projhittime(4100) = 1
trigger1 = parent, numtarget
trigger1 = var(13) := 1
trigger2 = p2movetype = H
trigger2 = enemynear, time < 1
trigger2 = var(13) := 1
var(12) = 1
ignorehitpause = 1

[State 4100, ParentVarAdd]
type = ParentVarAdd
triggerall = parent, projhittime(4100) = 1
trigger1 = parent, numtarget
trigger1 = var(13) := 1
trigger2 = p2movetype = H
trigger2 = enemynear, time < 1
trigger2 = var(13) := 1
var(38) = 1
ignorehitpause = 1

[State Damage Bonus]
type = AttackMulSet
trigger1 = 1
value = (0.7 + 0.3*root, fvar(13))*ifelse(root, var(20), 1 + (root, var(20) - 1)*root, fvar(15), 1)
ignorehitpause = 1

[State 4100, 1]
type = Projectile
triggerall = root, var(22)
trigger1 = root, time = [43, 85]
trigger1 = (root, time-43)%6 = 0
trigger1 = var(1) := var(1) + 1
projid = 4100
projanim = 4100 + (root, var(23) != 0)
projremovetime = 33
projedgebound = 320
projstagebound = 320
projheightbound = -480, 240
projremove = 0
projpriority = 9999
supermovetime = 99999
offset = floor((28 + 32*var(1))*const(size.xscale)), 0
id = 4100
attr = S, HP
damage = floor(112/(1 + var(12)*0.67)), 14
getpower = 0
animtype = Heavy
guardflag = MA
hitflag = MAF
pausetime = 0, 5
sparkno = s17004
guard.sparkno = s17006
sparkxy = 0, floor(-38*const(size.yscale) + p2dist y*0.8)
hitsound   = -1
guardsound = s6,0
ground.type = Low
ground.velocity = -15
ground.hittime  = 28
ground.slidetime  = 28
guard.hittime = 27
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536
palfx.time = 34
palfx.color = 0
palfx.mul = 256, 64, 0
palfx.sinadd = -64, -64, 0, 20
ignorehitpause = 1

[State 4100, 1]
type = Projectile
triggerall = !root, var(22)
trigger1 = root, time = [43, 85]
trigger1 = (root, time-43)%6 = 0
trigger1 = var(1) := var(1) + 1
projid = 4100
projanim = 4100 + (root, var(23) != 0)
projremovetime = 33
projedgebound = 320
projstagebound = 320
projheightbound = -480, 240
projremove = 0
projpriority = 9999
supermovetime = 99999
offset = floor((28 + 32*var(1))*const(size.xscale)), 0
id = 4100
attr = S, HP
damage = floor(112/(1 + var(12)*0.67)), 14
getpower = 0
animtype = Heavy
guardflag = MA
hitflag = MAF
pausetime = 0, 5
sparkno = 3
sparkxy = 0, floor(-38*const(size.yscale) + p2dist y*0.8)
hitsound   = -1
guardsound = s6,0
ground.type = Low
ground.velocity = -15
ground.hittime  = 28
ground.slidetime  = 28
guard.hittime = 27
guard.kill = 0
air.hittime = 999
airguard.ctrltime = 999
air.type = Low
air.velocity = -3, -6.43
airguard.velocity = -3, -6.43
yaccel = .536
palfx.time = 50
palfx.color = 0
palfx.mul = 256, 64, 0
palfx.sinadd = -64, -64, 0, 20
ignorehitpause = 1

[State 4100, PlaySnd]
type = PlaySnd
trigger1 = root, time = [43, 85]
trigger1 = (root, time-43)%6 = 0
value = 4100, 0
channel = 1

;--------------------------------------------------------------------------------------
; Mystic Break Fire Cleanup
[Statedef 4101]
type = A
physics = N
movetype = A
anim = 9999

[State 4101, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 7501

[State 4101, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 7502

[State 4101, Explod]
type = Explod
trigger1 = !time
postype = left
id = 7503
anim = 7513
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4101, AssertSpecial]
type = AssertSpecial
trigger1 = numexplod(7503)
flag = NoBG
flag2 = NoFG

[State 4101, RemoveExplod]
type = RemoveExplod
trigger1 = !numexplod(7503)
id = 4110

[State 4101, ParentVarAdd]
type = ParentVarAdd
triggerall = parent, projhittime(4100) = 1
trigger1 = parent, numtarget
trigger1 = var(13) := 1
trigger2 = p2movetype = H
trigger2 = enemynear, time < 1
trigger2 = var(13) := 1
var(38) = 1
ignorehitpause = 1

[State 4101, DestroySelf]
type = DestroySelf
trigger1 = !numexplod(7503)

;======================================================================================
;--------------------------------------------------------------------------------------
; Mystic Break Ice Spawner, Warzard centre at -1, -92
[Statedef 4200]
type = A
physics = N
movetype = A
anim = 9999

[State 4200, DestroySelf]
type = DestroySelf
trigger1 = var(21)
trigger1 = !var(20)
trigger1 = !numexplod(7503)

[State 4200, AssertSpecial]
type = AssertSpecial
trigger1 = numexplod(7501)
trigger2 = numexplod(7502)
trigger3 = numexplod(7503)
flag = NoBG
flag2 = NoFG

[State 4200, VarSet]
type = VarSet
trigger1 = parent, anim != 4000
trigger2 = parent, stateno != 4000
trigger3 = parent, movetype != A
trigger4 = parent, statetype != S
var(21) = 1

[State 4200, RemoveExplod]
type = RemoveExplod
trigger1 = var(21)
id = 7501
persistent = 0

[State 4200, RemoveExplod]
type = RemoveExplod
trigger1 = var(21)
id = 7502
persistent = 0

[State 4200, Explod]
type = Explod
trigger1 = var(21)
postype = left
id = 7503
anim = 7523
bindtime = -1
sprpriority = -5
supermovetime = 99999
persistent = 0

[State 4200, RemoveExplod]
type = RemoveExplod
trigger1 = var(21)
trigger1 = !numexplod(7503)
id = 4230
persistent = 0

[State 4200, Explod]
type = Explod
trigger1 = time = 0
postype = left
id = 7501
anim = 7521
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4200, Explod]
type = Explod
trigger1 = !var(21)
trigger1 = (time - 24)%32 = 0
postype = left
id = 7502
anim = 7522
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4200, VarSet]
type = VarSet
trigger1 = !var(21)
trigger1 = root, time > 43
trigger1 = time%5 = 0
fvar(3) = 0.5 + random*0.001

[State 4200, Explod]
type = Explod
trigger1 = !var(21)
trigger1 = root, time > 43
trigger1 = time%5 = 0
postype = left
id = 4230
anim = 4230 + (root, var(23) != 0)
bindtime = 1
sprpriority = -4
scale = fvar(3)*const(size.xscale), fvar(3)*const(size.yscale)
pos = 160, ifelse(root, screenpos y - 10*const(size.yscale) > 240, 120, floor((root, screenpos y - 10*const(size.yscale))*0.5))
random = 320, ifelse(root, screenpos y - 10*const(size.yscale) > 240, 240, floor(root, screenpos y - 10*const(size.yscale)))
supermovetime = 99999

[State 4200, BindToParent]
type = BindToParent
trigger1 = 1
pos = floor(-1*const(size.xscale)), floor(-92*const(size.yscale))
;pos = floor(24*const(size.xscale)), floor(-92*const(size.yscale))

[State 4200, VarSet]
type = VarSet
trigger1 = root, time = 89
trigger1 = var(2) := 1
var(0) = 0

[State 4200, VarSet]
type = VarSet
trigger1 = enemynear, alive || enemynear, statetype != L
fvar(0) = const(size.xscale)*p2dist x

[State 4200, VarSet]
type = VarSet
trigger1 = enemynear, alive || enemynear, statetype != L
fvar(1) = const(size.yscale)*(p2dist y - rootdist y)

[State 4200, VarSet]
type = VarSet
trigger1 = fvar(1)
fvar(2) = atan(fvar(0)/fvar(1)) + ifelse(fvar(1) < 0, ifelse(fvar(0) < 0, -pi, pi), 0)

[State 4200, VarSet]
type = VarSet
trigger1 = fvar(1) = 0
fvar(2) = ifelse(fvar(0) < 0, -0.5*pi, 0.5*pi)

[State 4200, VarSet]
type = VarSet
trigger1 = fvar(0) = 0
trigger1 = fvar(1) < 0
fvar(2) = pi

[State 4200, VarSet]
type = VarSet
trigger1 = 1
fvar(2) = ifelse(floor(80*fvar(2)/pi)%10 < 4, floor(8*fvar(2)/pi), ceil(8*fvar(2)/pi))

[State 4200, VarSet]
type = VarSet
trigger1 = 1
var(1) = ifelse(fvar(2) > 8, 8, floor(fvar(2)))

[State 4200, PlaySnd]
type = PlaySnd
triggerall = !var(21)
trigger1 = root, time = 43
trigger2 = root, time = 44
trigger3 = root, time = 89
trigger4 = root, time = 90
value = 4200, 0
channel = 1

[State 4200, Helper]
type = Helper
triggerall = !var(21)
trigger1 = root, time = 43
trigger2 = root, time = 89
name = "ice spike"
id = 4210 + 5*var(2)
stateno = 4210
pos = 0, 0
ownpal = 1
supermovetime = 99999

[State 4200, Helper]
type = Helper
triggerall = !var(21)
trigger1 = root, time = 43
trigger2 = root, time = 89
name = "ice spike"
id = 4211 + 5*var(2)
stateno = 4210
pos = 0, 0
ownpal = 1
supermovetime = 99999

[State 4200, Helper]
type = Helper
triggerall = !var(21)
trigger1 = root, time = 43
trigger2 = root, time = 89
name = "ice spike"
id = 4212 + 5*var(2)
stateno = 4210
pos = 0, 0
ownpal = 1
supermovetime = 99999

[State 4200, Helper]
type = Helper
triggerall = !var(21)
trigger1 = root, time = 43
trigger2 = root, time = 89
name = "ice spike"
id = 4213 + 5*var(2)
stateno = 4210
pos = 0, 0
ownpal = 1
supermovetime = 99999

[State 4200, Helper]
type = Helper
triggerall = !var(21)
trigger1 = root, time = 43
trigger2 = root, time = 89
name = "ice spike"
id = 4214 + 5*var(2)
stateno = 4210
pos = 0, 0
ownpal = 1
supermovetime = 99999

[State 4200, FX Sound]
type = PlaySnd
trigger1 = var(10) = 1
value = 5, 9
abspan = floor(fvar(11))
channel = 2

[State 4200, FX Sound]
type = PlaySnd
trigger1 = var(10)
trigger1 = var(11)
trigger1 = var(10) := 0 || 1
value = 5, 0
abspan = floor(fvar(11))
channel = 3

[State 4200, FX Sound]
type = PlaySnd
trigger1 = var(10)
trigger1 = !var(11)
trigger1 = var(10) := 0 || 1
value = 6, 0
abspan = floor(fvar(11))
channel = 3

[State 4200, VarSet]
type = VarSet
trigger1 = var(11)
var(13) = 1

[State 4200, VarSet]
type = VarSet
trigger1 = !time
trigger1 = root, var(38) > (root, movehit > 0)
var(12) = 1

[State 4200, VarAdd]
type = VarAdd
trigger1 = var(11)
var(12) = var(11)

[State 4200, ParentVarAdd]
type = ParentVarAdd
trigger1 = var(11)
var(38) = var(11)

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

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

[State Delay Dampening]
type = ParentVarSet
trigger1 = time
var(33) = 1
ignorehitpause = 1

; Mystic Break Ice Formation
;var(0) = id
;var(1) = target facing
;var(2) = facing shift
;var(3) = timer
;var(4) = 2nd wave

[Statedef 4210]
type = A
physics = N
movetype = A
sprpriority = 3

[State 4210, ChangeAnim]
type = ChangeAnim
trigger1 = !anim
value = 4200

[State 4210, Trans]
type = Trans
trigger1 = root, var(23) != 0
trans = addalpha
alpha = 256, 64

[State 4210, NotHitBy]
type = NotHitBy
trigger1 = !root, var(16)
value = SCA
time = -1
ignorehitpause = 1

[State 4210, HitBy]
type = HitBy
trigger1 = root, var(16)
value = SCA, AP
time = -1
ignorehitpause = 1

[State 4210, HitOverride]
type = HitOverride
trigger1 = root, var(16)
attr = SCA, AA, AP, AT
stateno = 4210
time = -1
ignorehitpause = 1

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

[State 4210, HitOverride]
type = HitOverride
trigger1 = !time
attr = SCA, AA, AP, AT
stateno = 4210
time = -1
ignorehitpause = 1

[State Interupted]
type = ChangeState
triggerall = root, movetype = H
trigger1 = root, stateno != [161, 162]
trigger2 = root, anim != 161
trigger2 = root, statetype != S
value = 4212
ignorehitpause = 1

[State 4210, ParentVarAdd]
type = ParentVarAdd
trigger1 = !var(3)
trigger1 = var(0) := parent, var(0) || 1
trigger1 = var(4) := parent, var(2) || 1
var(0) = 1
ignorehitpause = 1

[State 4210, VarSet]
type = VarSet
trigger1 = 1
var(1) = parent, var(1) + var(0) - 2
ignorehitpause = 1

[State 4210, VarSet]
type = VarSet
trigger1 = var(1) < -8
var(1) = 16 + var(1)
ignorehitpause = 1

[State 4210, VarSet]
type = VarSet
trigger1 = var(1) > 8
var(1) = var(1) - 16
ignorehitpause = 1

[State 4210, ChangeAnim]
type = ChangeAnim
trigger1 = animelem = 1 || animelemno(-1) != animelemno(0)
value = 4200 + ifelse(var(1) > -1, Var(1), -Var(1))
elem = animelemno(0)
ignorehitpause = 1

[State 4210, PosSet]
type = PosSet
trigger1 = 1
x = parent, pos x
y = parent, pos y
ignorehitpause = 1

[State 4210, Turn]
type = Turn
triggerall = animelem = 1 || animelemno(-1) != animelemno(0)
trigger1 = var(1) > -1
trigger1 = facing != parent, facing
trigger2 = var(1) < 0
trigger2 = facing = parent, facing
ignorehitpause = 1

[State 4210, PosAdd]
type = PosAdd
trigger1 = anim = 4200
x = 0
y = 7.78*const(size.yscale)*12
ignorehitpause = 1

[State 4210, PosAdd]
type = PosAdd
trigger1 = anim = 4201
x = 3.83*const(size.xscale)*12
y = 7.19*const(size.yscale)*12
ignorehitpause = 1

[State 4210, PosAdd]
type = PosAdd
trigger1 = anim = 4202
x = 7.07*const(size.xscale)*12
y = 5.5*const(size.yscale)*12
ignorehitpause = 1

[State 4210, PosAdd]
type = PosAdd
trigger1 = anim = 4203
x = 9.24*const(size.xscale)*12
y = 2.98*const(size.yscale)*12
ignorehitpause = 1

[State 4210, PosAdd]
type = PosAdd
trigger1 = anim = 4204
x = 10*const(size.xscale)*12
y = 0
ignorehitpause = 1

[State 4210, PosAdd]
type = PosAdd
trigger1 = anim = 4205
x = 9.24*const(size.xscale)*12
y = -2.98*const(size.yscale)*12
ignorehitpause = 1

[State 4210, PosAdd]
type = PosAdd
trigger1 = anim = 4206
x = 7.07*const(size.xscale)*12
y = -5.5*const(size.yscale)*12
ignorehitpause = 1

[State 4210, PosAdd]
type = PosAdd
trigger1 = anim = 4207
x = 3.83*const(size.xscale)*12
y = -7.19*const(size.yscale)*12
ignorehitpause = 1

[State 4210, PosAdd]
type = PosAdd
trigger1 = anim = 4208
x = 0
y = -7.78*const(size.yscale)*12
ignorehitpause = 1

[State 4210, ChangeState]
type = ChangeState
trigger1 = var(0) = 2
trigger1 = var(3) = 25
trigger1 = var(3) := 0 || 1
trigger2 = var(0) = 1 || var(0) = 3
trigger2 = var(3) = 35
trigger2 = var(3) := 0 || 1
trigger3 = var(0) = 0 || var(0) = 4
trigger3 = var(3) = 45
trigger3 = var(3) := 0 || 1
value = 4211
ignorehitpause = 1

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

[State 4211, ChangeAnim]
type = ChangeAnim
trigger1 = root, var(56) != gametime
value = anim
elem = animelemno(-1)
ignorehitpause = 1

; Mystic Break Ice Attack
[Statedef 4211]
type = A
physics = N
movetype = A
movehitpersist = 1

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

[State 4211, Trans]
type = Trans
trigger1 = root, var(23) != 0
trans = addalpha
alpha = 256, 64

[State 4211, ParentVarset]
type = ParentVarSet
trigger1 = 1
var(20) = 1

[State 4211, HitBy]
type = HitBy
trigger1 = 1
value = SCA, AP
time = -1
ignorehitpause = 1

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

[State 4211, Explod]
type = Explod
triggerall = root, var(22)
triggerall = time || prevstateno != 4412
trigger1 = movecontact = 1
postype = p1
anim = ifelse(moveguarded, 17006, 17000)
bindtime = 1
pos = floor(vel x), floor(vel y)
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1
ignorehitpause = 1

[State 4211, Explod]
type = Explod
triggerall = !root, var(22)
triggerall = time || prevstateno != 4412
trigger1 = movecontact = 1
postype = p1
anim = Fifelse(moveguarded, 40, 0)
bindtime = 1
pos = floor(vel x), floor(vel y)
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1
ignorehitpause = 1

[State 4211, ChangeState]
type = ChangeState
triggerall = movecontact = 1
triggerall = time || prevstateno != 4213
triggerall = numtarget || p2movetype = H
trigger1 = numtarget != 1
trigger2 = numtarget = 1
trigger2 = !target, ishelper
value = 4213
ignorehitpause = 1

[State Interupted]
type = ChangeState
triggerall = root, movetype = H
trigger1 = root, stateno != [161, 162]
trigger2 = root, anim != 161
trigger2 = root, statetype != S
value = 4212
ignorehitpause = 1

[State 4211, DestroySelf]
type = DestroySelf
triggerall = var(3) > 16
triggerall = var(2)
trigger1 = screenpos x > 360
trigger1 = facing = 1
trigger2 = screenpos x < -40
trigger2 = facing = -1
trigger3 = screenpos y < -30
trigger3 = vel y < 0
trigger4 = screenpos y > 270
trigger4 = vel y >= 0
ignorehitpause = 1

[State 4211, ChangeState]
type = ChangeState
trigger1 = movereversed = 1
value = 4213
ignorehitpause = 1

[State 4211, Turn]
type = Turn
triggerall = animelemno(-1) != animelemno(0)
triggerall = anim = 4200 || anim = 4208
trigger1 = facing = 1
trigger1 = p2dist x < 0
trigger2 = facing = -1
trigger2 = p2dist x <= 0
ignorehitpause = 1

[State 4211, VarSet]
type = VarSet
trigger1 = enemynear, alive || enemynear, statetype != L
trigger1 = animelemno(-1) != animelemno(0)
fvar(0) = const(size.xscale)*p2dist x
ignorehitpause = 1

[State 4211, VarSet]
type = VarSet
trigger1 = enemynear, alive || enemynear, statetype != L
trigger1 = animelemno(-1) != animelemno(0)
fvar(1) = const(size.yscale)*(p2dist y + ifelse(p2statetype = C, 0.5*enemynear, const(size.mid.pos.y), 0.7*enemynear, const(size.head.pos.y)))
ignorehitpause = 1

[State 4211, VarSet]
type = VarSet
trigger1 = animelemno(-1) != animelemno(0)
trigger1 = fvar(1)
fvar(2) = atan(fvar(0)/fvar(1)) + ifelse(fvar(1) < 0, ifelse(fvar(0) < 0, -pi, pi), 0)
ignorehitpause = 1

[State 4211, VarSet]
type = VarSet
trigger1 = animelemno(-1) != animelemno(0)
trigger1 = fvar(1) = 0
fvar(2) = ifelse(fvar(0) < 0, -0.5*pi, 0.5*pi)
ignorehitpause = 1

[State 4211, VarSet]
type = VarSet
trigger1 = animelemno(-1) != animelemno(0)
trigger1 = fvar(0) = 0
trigger1 = fvar(1) < 0
fvar(2) = pi
ignorehitpause = 1

[State 4211, VarSet]
type = VarSet
trigger1 = animelemno(-1) != animelemno(0)
fvar(2) = ifelse(floor(80*fvar(2)/pi)%10 < 4, floor(8*fvar(2)/pi), ceil(8*fvar(2)/pi))
ignorehitpause = 1

[State 4211, VarSet]
type = VarSet
trigger1 = animelemno(-1) != animelemno(0)
var(1) = ifelse(fvar(2) > 8, 8, floor(fvar(2)))
ignorehitpause = 1

[State 4211, VarSet]
type = VarSet
trigger1 = animelemno(-1) != animelemno(0)
trigger1 = var(1) > -1
var(2) = ifelse(abs(anim - 4200 - var(1)) < 1 + (var(2) = 0), 0, ifelse(anim < 4200 + var(1), 1, -1))
ignorehitpause = 1

[State 4211, VarSet]
type = VarSet
trigger1 = animelemno(-1) != animelemno(0)
trigger1 = var(1) < 0
trigger1 = var(2) = 0
var(2) = ifelse(var(1) > -5, -1, 1)
ignorehitpause = 1

[State 4211, ChangeAnim]
type = ChangeAnim
trigger1 = animelemno(-1) != animelemno(0)
trigger1 = var(3) < 17
value = anim + var(2)
elem = animelemno(0)
ignorehitpause = 1

[State 4211, VelSet]
type = VelSet
trigger1 = anim = 4200
x = 0
y = 7.78*const(size.yscale)
ignorehitpause = 1

[State 4211, VelSet]
type = VelSet
trigger1 = anim = 4201
x = 3.83*const(size.xscale)
y = 7.19*const(size.yscale)
ignorehitpause = 1

[State 4211, VelSet]
type = VelSet
trigger1 = anim = 4202
x = 7.07*const(size.xscale)
y = 5.5*const(size.yscale)
ignorehitpause = 1

[State 4211, VelSet]
type = VelSet
trigger1 = anim = 4203
x = 9.24*const(size.xscale)
y = 2.98*const(size.yscale)
ignorehitpause = 1

[State 4211, VelSet]
type = VelSet
trigger1 = anim = 4204
x = 10*const(size.xscale)
y = 0
ignorehitpause = 1

[State 4211, VelSet]
type = VelSet
trigger1 = anim = 4205
x = 9.24*const(size.xscale)
y = -2.98*const(size.yscale)
ignorehitpause = 1

[State 4211, VelSet]
type = VelSet
trigger1 = anim = 4206
x = 7.07*const(size.xscale)
y = -5.5*const(size.yscale)
ignorehitpause = 1

[State 4211, VelSet]
type = VelSet
trigger1 = anim = 4207
x = 3.83*const(size.xscale)
y = -7.19*const(size.yscale)
ignorehitpause = 1

[State 4211, VelSet]
type = VelSet
trigger1 = anim = 4208
x = 0
y = -7.78*const(size.yscale)
ignorehitpause = 1

[State Damage Bonus]
type = AttackMulSet
trigger1 = 1
value = (0.7 + 0.3*root, fvar(13))*ifelse(root, var(20), 1 + (root, var(20) - 1)*root, fvar(15), 1)
ignorehitpause = 1

[State 4211, 1]
type = HitDef
trigger1 = 1
id = 4200
attr = S, HP
damage = floor(64/(1 + parent, var(12)*0.2)), 8
getpower = 0
numhits = 1
priority = 7, hit
animtype = Back
guardflag = MA
hitflag = MAF
pausetime = 0, 14
guard.pausetime = 0, 13
sparkno = -1
guard.sparkno = -1
hitsound   = -1
guardsound = -1
ground.type = High
ground.velocity = ifelse(rootdist x > 0, 1, -1)*5, -7.5
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = 0
guard.velocity = ifelse(rootdist x > 0, 1, -1)*12.5
guard.hittime = 15
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = ifelse(rootdist x > 0, 1, -1)*5, -6.43
airguard.velocity = ifelse(rootdist x > 0, 1, -1)*5, -6.43
fall = 1
fall.recover = 0
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1
ignorehitpause = 1

[State 4211, 2] ;For combo count
type = Projectile
trigger1 = !movecontact
projid = 4200
projanim = anim + 20
projremovetime = 1
projedgebound = 320
projstagebound = 320
projheightbound = -480, 240
projpriority = 9999
supermovetime = 99999
offset = floor(pos x + vel x - floor(pos x)), floor(pos y + vel y - floor(pos y))
id = 4200
attr = S, HP
getpower = 0
numhits = 0
animtype = Back
guardflag = MA
hitflag = MAF
pausetime = 0, 14
guard.pausetime = 0, 13
sparkno = -1
guard.sparkno = -1
hitsound   = -1
guardsound = -1
ground.type = High
ground.velocity = ifelse(rootdist x > 0, 1, -1)*5, -7.5
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = 0
guard.velocity = ifelse(rootdist x > 0, 1, -1)*12.5
guard.hittime = 15
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = ifelse(rootdist x > 0, 1, -1)*5, -6.43
airguard.velocity = ifelse(rootdist x > 0, 1, -1)*5, -6.43
fall = 1
fall.recover = 0
yaccel = .536
palfx.add = 256, 256, 256
palfx.time = 1
ignorehitpause = 1

[State 4211, PosFreeze]
type = PosFreeze
trigger1 = root, var(56) != gametime
ignorehitpause = 1

[State 4211, ChangeAnim]
type = ChangeAnim
trigger1 = root, var(56) != gametime
value = anim
elem = animelemno(-1)
ignorehitpause = 1

[State 4211, VarAdd]
type = VarAdd
trigger1 = 1
var(3) = 1
ignorehitpause = 1

; Mystic Break Disappear
[Statedef 4212]
type = A
physics = N
movetype = I
anim = anim + 10
ignorehitpause = 1

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

[State 4212, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0
ignorehitpause = 1



; Mystic Break Hit
[Statedef 4213]
type = A
physics = N
movetype = I
anim = 9999
movehitpersist = 1

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

[State 4213, Ice TargetState]
type = TargetState
trigger1 = numtarget
trigger1 = numtarget > 1 || !target, gethitvar(guarded)
value = 5706
ignorehitpause = 1
persistent = 0

[State 4213, Ice FX]
type = Helper
trigger1 = numtarget
trigger1 = target, stateno = [5706, 5708]
trigger1 = target, time = 0
trigger1 = !target, gethitvar(guarded)
trigger1 = var(10) := 1
name = "ice"
id = 7060
stateno = 7060
postype = left
pos = floor(target, pos x - target, facing*10), floor(target, pos y + target, const(size.mid.pos.y))
facing = target, facing
ownpal = 1
random = floor((target, const(size.ground.front)+target, const(size.ground.back))*0.2), floor((target, const(size.mid.pos.y)-target, const(size.head.pos.y))*(movehit != 0)*0.2)
ignorehitpause = 1
persistent = 0

[State 4213, ParentVarset]
type = ParentVarSet
trigger1 = parent, var(10) < 1
var(10) = ifelse(var(10), 1, -1)
ignorehitpause = 1
persistent = 0

[State 4213, ParentVarAdd]
type = ParentVarAdd
triggerall = movehit = 1
trigger1 = numtarget
trigger2 = p2movetype = H
trigger2 = enemynear, time < 1
var(11) = 1
ignorehitpause = 1
persistent = 0

[State 4213, ParentVarset]
type = ParentVarSet
trigger1 = var(10)
trigger1 = numtarget
fvar(10) = target, pos x
ignorehitpause = 1
persistent = 0

[State 4213, ParentVarset]
type = ParentVarSet
trigger1 = var(10)
trigger1 = !numtarget
fvar(10) = enemynear, pos x
ignorehitpause = 1
persistent = 0

[State 4213, DestroySelf]
type = DestroySelf
trigger1 = 1
ignorehitpause = 1

;======================================================================================
;--------------------------------------------------------------------------------------
; Mystic Break Thunder Spawner
[Statedef 4300]
type = A
physics = N
movetype = A
anim = 9999

[State 4300, AssertSpecial]
type = AssertSpecial
trigger1 = numexplod(7501)
trigger2 = numexplod(7502)
trigger3 = numexplod(7503)
flag = NoBG
flag2 = NoFG

[State 4300, ChangeState]
type = ChangeState
trigger1 = parent, anim != 4000
trigger2 = parent, stateno != 4000
trigger3 = parent, movetype != A
trigger4 = parent, statetype != S
value = 4301

[State 4300, Explod]
type = Explod
trigger1 = time = 0
postype = left
id = 7501
anim = 7531
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4300, Explod]
type = Explod
trigger1 = (time - 24)%32 = 0
postype = left
id = 7502
anim = 7532
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4300, Explod]
type = Explod
trigger1 = root, time > 43
trigger1 = time%5 = 0
postype = left
id = 4310
anim = 4310 + (root, var(23) != 0)
bindtime = 1
sprpriority = random%9 - 4
scale = const(size.xscale), const(size.yscale)
pos = 160, floor(screenpos y - 20*const(size.yscale))
random = 320, floor(60/const(size.yscale))
supermovetime = 99999

[State 4300, VarSet]
type = VarSet
trigger1 = !time
trigger1 = root, var(38) > (root, movehit > 0)
var(12) = 1

[State 4300, VarAdd]
type = VarAdd
triggerall = parent, projhittime(4300) = 1
trigger1 = parent, numtarget
trigger1 = var(13) := 1
trigger2 = p2movetype = H
trigger2 = enemynear, time < 1
trigger2 = var(13) := 1
var(12) = 1
ignorehitpause = 1

[State 4300, ParentVarAdd]
type = ParentVarAdd
triggerall = parent, projhittime(4300) = 1
trigger1 = parent, numtarget
trigger1 = var(13) := 1
trigger2 = p2movetype = H
trigger2 = enemynear, time < 1
trigger2 = var(13) := 1
var(38) = 1
ignorehitpause = 1

[State 4300, VarSet]
type = VarSet
trigger1 = root, time > 45
trigger1 = root, time = 46 + var(1)*12 + var(3)
var(2) = ifelse(root, time = 46, floor(p2dist x), ceil(p2dist x + enemynear, facing*facing*enemynear, vel x*2 - 80 + random*0.16))

[State 4300, VarSet]
type = VarSet
trigger1 = var(2) > frontedgedist + 32
var(2) = ceil(p2dist x + random*0.001*(frontedgedist + 32 - p2dist x))

[State 4300, PlaySnd]
type = PlaySnd
trigger1 = root, time > 45
trigger1 = root, time = 46 + var(1)*12 + var(3)
value = 4300, 0
channel = 1

[State Damage Bonus]
type = AttackMulSet
trigger1 = 1
value = (0.7 + 0.3*root, fvar(13))*ifelse(root, var(20), 1 + (root, var(20) - 1)*root, fvar(15), 1)
ignorehitpause = 1

[State 4300, 1]
type = Projectile
triggerall = root, var(22)
trigger1 = root, time = 46 + var(1)*12 + var(3)
projid = 4300
projanim = 4300 + (root, var(23) != 0)
projremovetime = 20
projedgebound = 320
projstagebound = 320
projheightbound = -480, 240
projremove = 0
projpriority = 9999
projsprpriority = random%9 - 4
supermovetime = 99999
offset = var(2), floor((1 - random*0.002)*30.0/const(size.yscale) - 20*const(size.yscale))
id = 4300
attr = S, HP
damage = floor(128/(1 + var(12)*1.3)), 8
getpower = 0
animtype = Back
guardflag = MA
hitflag = MAF
pausetime = 0, 10
guard.pausetime = 0, 9
sparkno = s17002
guard.sparkno = s17006
sparkxy = 0, floor(-50*const(size.yscale) + p2dist y*0.8)
hitsound   = -1
guardsound = s6,0
ground.type = Low
ground.velocity = -6.67, -4.23
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = 0
guard.velocity = -7.5
guard.hittime = 15
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -6.43
airguard.velocity = -5, -6.43
fall = 1
fall.recover = 0
yaccel = .536
palfx.invertall = 1
palfx.time = 50
palfx.color = 0
palfx.add = -64, -96, -160
palfx.sinadd = 64, 96, 128, 10
ignorehitpause = 1

[State 4300, 1]
type = Projectile
triggerall = !root, var(22)
trigger1 = root, time = 46 + var(1)*12 + var(3)
projid = 4300
projanim = 4300 + (root, var(23) != 0)
projremovetime = 20
projedgebound = 320
projstagebound = 320
projheightbound = -480, 240
projremove = 0
projpriority = 9999
projsprpriority = random%9 - 4
supermovetime = 99999
offset = var(2), floor((1 - random*0.002)*30.0/const(size.yscale) - 20*const(size.yscale))
id = 4300
attr = S, HP
damage = floor(136/(1 + var(12)*1.3)), 8
getpower = 0
animtype = Back
guardflag = MA
hitflag = MAF
pausetime = 0, 10
guard.pausetime = 0, 9
sparkno = 3
sparkxy = 0, floor(-50*const(size.yscale) + p2dist y*0.8)
hitsound   = -1
guardsound = s6,0
ground.type = Low
ground.velocity = -6.67, -4.23
ground.hittime  = 16
ground.slidetime  = 16
ground.cornerpush.veloff = 0
guard.velocity = -7.5
guard.hittime = 15
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -6.43
airguard.velocity = -5, -6.43
fall = 1
fall.recover = 0
yaccel = .536
palfx.invertall = 1
palfx.time = 50
palfx.color = 0
palfx.add = -64, -96, -160
palfx.sinadd = 64, 96, 128, 10
ignorehitpause = 1

[State 4300, VarSet]
type = VarSet
trigger1 = root, time > 45
trigger1 = root, time = 46 + var(1)*12 + var(3)
trigger1 = var(1) := var(1) + 1
var(3) = random%12 - 6

[State 4300, BindToParent]
type = BindToParent
trigger1 = 1

;--------------------------------------------------------------------------------------
; Mystic Break Thunder Cleanup
[Statedef 4301]
type = A
physics = N
movetype = A
anim = 9999

[State 4301, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 7501

[State 4301, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 7502

[State 4301, Explod]
type = Explod
trigger1 = !time
postype = left
id = 7503
anim = 7533
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4301, RemoveExplod]
type = RemoveExplod
trigger1 = !numexplod(7503)
id = 4310

[State 4301, AssertSpecial]
type = AssertSpecial
trigger1 = numexplod(7503)
flag = NoBG
flag2 = NoFG

[State 4301, ParentVarAdd]
type = ParentVarAdd
triggerall = parent, projhittime(4300) = 1
trigger1 = parent, numtarget
trigger1 = var(13) := 1
trigger2 = p2movetype = H
trigger2 = enemynear, time < 1
trigger2 = var(13) := 1
var(38) = 1
ignorehitpause = 1

[State 4301, DestroySelf]
type = DestroySelf
trigger1 = !numexplod(7503)

;======================================================================================
;--------------------------------------------------------------------------------------
; Mystic Break Wind Spawner
[Statedef 4400]
type = A
physics = N
movetype = A
anim = 9999

[State 4400, AssertSpecial]
type = AssertSpecial
trigger1 = numexplod(7501)
trigger2 = numexplod(7502)
trigger3 = numexplod(7503)
flag = NoBG
flag2 = NoFG

[State 4400, ChangeState]
type = ChangeState
trigger1 = parent, anim != 4000
trigger2 = parent, stateno != 4000
trigger3 = parent, movetype != A
trigger4 = parent, statetype != S
value = 4401

[State 4400, Explod]
type = Explod
trigger1 = time = 0
postype = left
id = 7501
anim = 7541
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4400, Explod]
type = Explod
trigger1 = (time - 24)%32 = 0
postype = left
id = 7502
anim = 7542
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4400, VarSet]
type = VarSet
trigger1 = root, time > 43
trigger1 = (time-4)%8 = 0
fvar(4) = random*0.006 - 3

[State 4400, VarSet]
type = VarSet
trigger1 = root, time > 43
trigger1 = (time-4)%8 = 0
fvar(3) = 0.5 + random*0.0005 - fvar(4)*0.05

[State 4400, Explod]
type = Explod
trigger1 = root, time > 43
trigger1 = (time-4)%8 = 0
postype = back
id = 4410
anim = 4410 + 10*(random%2) + (root, var(23) != 0)
bindtime = 1
sprpriority = random%8 - 4
scale = fvar(3)*const(size.xscale), fvar(3)*const(size.yscale)
pos = -48, floor(screenpos y*0.5) - 60
vel = 2.5 + random*0.0025, 2.5 + random*0.0025
accel = 0.1, -0.1
random = 0, 150
supermovetime = 99999

[State 4400, PlaySnd]
type = PlaySnd
trigger1 = root, time = 44
value = 4400, 0
channel = 1
persistent = 0

[State 4400, Helper]
type = Helper
trigger1 = root, time = 44
name = "tornado"
id = 4410
stateno = 4410
pos = 0, floor(-160*const(size.yscale))
ownpal = 1
supermovetime = 99999

[State 4400, Helper]
type = Helper
trigger1 = root, time = 45
name = "tornado"
id = 4411
stateno = 4410
pos = 0, floor(-96*const(size.yscale))
ownpal = 1
supermovetime = 99999

[State 4400, Helper]
type = Helper
trigger1 = root, time = 46
name = "tornado"
id = 4412
stateno = 4410
pos = 0, floor(-32*const(size.yscale))
ownpal = 1
supermovetime = 99999

[State 4400, Helper]
type = Helper
trigger1 = root, time = 95
name = "tornado"
id = 4413
stateno = 4410
pos = 0, floor(-144*const(size.yscale))
ownpal = 1
supermovetime = 99999

[State 4400, Helper]
type = Helper
trigger1 = root, time = 96
name = "tornado"
id = 4414
stateno = 4410
pos = 0, floor(-48*const(size.yscale))
ownpal = 1
supermovetime = 99999

[State 4400, BindToParent]
type = BindToParent
trigger1 = 1

[State 4400, FX Sound]
type = PlaySnd
trigger1 = var(10)
trigger1 = var(11)
trigger1 = var(10) := 0 || 1
value = 5, 2
abspan = floor(fvar(11))
channel = 3

[State 4400, FX Sound]
type = PlaySnd
trigger1 = var(10)
trigger1 = !var(11)
trigger1 = var(10) := 0 || 1
value = 6, 0
abspan = floor(fvar(11))
channel = 3

[State 4400, VarSet]
type = VarSet
trigger1 = var(11)
var(13) = 1

[State 4400, VarSet]
type = VarSet
trigger1 = !time
trigger1 = root, var(38) > (root, movehit > 0)
var(12) = 1

[State 4400, VarAdd]
type = VarAdd
trigger1 = var(11)
var(12) = var(11)

[State 4400, ParentVarAdd]
type = ParentVarAdd
trigger1 = var(11)
var(38) = var(11)

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

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

[State Delay Dampening]
type = ParentVarSet
trigger1 = time
var(33) = 1
ignorehitpause = 1

;--------------------------------------------------------------------------------------
; Mystic Break Wind Cleanup
[Statedef 4401]
type = A
physics = N
movetype = A
anim = 9999

[State 4401, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 7501

[State 4401, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 7502

[State 4401, Explod]
type = Explod
trigger1 = !time
postype = left
id = 7503
anim = 7543
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4401, RemoveExplod]
type = RemoveExplod
trigger1 = !numexplod(7503)
id = 4410

[State 4401, AssertSpecial]
type = AssertSpecial
trigger1 = numexplod(7503)
flag = NoBG
flag2 = NoFG

[State 4401, ParentVarAdd]
type = ParentVarAdd
trigger1 = var(11)
var(38) = var(11)

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

[State 4401, DestroySelf]
type = DestroySelf
trigger1 = !numexplod(7503)

;--------------------------------------------------------------------------------------
; Mystic Break Wind Attack
[Statedef 4410]
type = A
physics = N
movetype = A
movehitpersist = 1
sprpriority = 3

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

[State 4410, HitBy]
type = HitBy
trigger1 = 1
value = SCA, AP
time = -1
ignorehitpause = 1

[State 4410, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP, AT
stateno = 4410
time = -1

[State 4410, ParentVarAdd]
type = ParentVarAdd
trigger1 = !var(3)
trigger1 = var(0) := parent, var(0) || 1
var(0) = 1
ignorehitpause = 1

[State 4410, ParentVarset]
type = ParentVarSet
trigger1 = 1
var(20) = 1

[State 4410, HitBy]
type = HitBy
trigger1 = 1
value = SCA, AP
time = -1
ignorehitpause = 1

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

[State 4410, ChangeAnim]
type = ChangeAnim
trigger1 = !var(3)
value = 4400 + 5*(root, var(23) != 0)
ignorehitpause = 1

[State 4410, VelSet]
type = VelSet
trigger1 = !var(3)
x = 3.67
y = 1.25
ignorehitpause = 1

[State 4410, VelAdd]
type = VelAdd
trigger1 = time
x = 0.05
y = -0.05
ignorehitpause = 1

[State 4410, Explod]
type = Explod
triggerall = root, var(22)
triggerall = time || prevstateno != 4412
trigger1 = movecontact = 1
postype = p1
anim = ifelse(moveguarded, 17006, 17002)
bindtime = 1
pos = floor(vel x), floor(vel y)
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1
ignorehitpause = 1

[State 4410, Explod]
type = Explod
triggerall = !root, var(22)
triggerall = time || prevstateno != 4412
trigger1 = movecontact = 1
postype = p1
anim = Fifelse(moveguarded, 40, 3)
bindtime = 1
pos = floor(vel x), floor(vel y)
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1
ignorehitpause = 1

[State 4410, VarSet]
type = VarSet
triggerall = movecontact = 1
triggerall = time || prevstateno != 4412
triggerall = numtarget || p2movetype = H
trigger1 = numtarget != 1
trigger2 = numtarget = 1
trigger2 = !target, ishelper
var(2) = 6
ignorehitpause = 1

[State 4410, VarSet]
type = VarSet
trigger1 = movereversed = 1
var(2) = 6
ignorehitpause = 1

[State 4410, VarAdd]
type = VarAdd
triggerall = time || prevstateno != 4412
trigger1 = var(2) = 6
var(1) = 1
ignorehitpause = 1

[State 4410, ChangeState]
type = ChangeState
triggerall = time || prevstateno != 4412
trigger1 = var(2) = 6
value = 4412
ignorehitpause = 1

[State Interupted]
type = ChangeState
triggerall = root, movetype = H
trigger1 = root, stateno != [161, 162]
trigger2 = root, anim != 161
trigger2 = root, statetype != S
value = 4411
ignorehitpause = 1

[State 4410, DestroySelf]
type = DestroySelf
triggerall = var(3) > 16
trigger1 = screenpos x != [-40, 360]
ignorehitpause = 1

[State 4410, VarAdd]
type = VarAdd
trigger1 = var(2) > 0
var(2) = -1
ignorehitpause = 1

[State Damage Bonus]
type = AttackMulSet
trigger1 = 1
value = (0.7 + 0.3*root, fvar(13))*ifelse(root, var(20), 1 + (root, var(20) - 1)*root, fvar(15), 1)
ignorehitpause = 1

[State 4410, 1]
type = HitDef
trigger1 = !var(2)
id = 4400
attr = S, HP
damage = floor(72/(1 + parent, var(12)*0.2 + var(1))), 4
getpower = 0
numhits = 1
priority = 7, hit
animtype = Up
guardflag = M
hitflag = MAF
pausetime = 0, 9
guard.pausetime = 0, 8
sparkno = -1
guard.sparkno = -1
hitsound   = -1
guardsound = -1
ground.type = Low
ground.velocity = ifelse(var(0) > 2, 1, -1)*0.83, ifelse(var(0) > 2, -15, -12.5)
ground.hittime  = 24
ground.slidetime  = 24
ground.cornerpush.veloff = 0
guard.velocity = -12.5
guard.hittime = 23
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = ifelse(var(0) > 2, 1, -1)*0.83, ifelse(var(0) > 2, -15, -12.5)
airguard.velocity = ifelse(var(0) > 2, 1, -1)*3, -6.43
fall = 1
fall.recover = 0
yaccel = .536
ignorehitpause = 1

[State 4410, 2] ;For combo count
type = Projectile
triggerall = root, projcontacttime(4400 + var(0)) != 1
trigger1 = !var(2)
projid = 4400 + var(0)
projanim = 4402
projremovetime = 1
projedgebound = 320
projstagebound = 320
projheightbound = -480, 240
projpriority = 9999
supermovetime = 99999
offset = floor(pos x + vel x - floor(pos x)), floor(pos y + vel y - floor(pos y))
id = 4400
attr = S, HP
getpower = 0
numhits = 0
animtype = Up
guardflag = M
hitflag = MAF
pausetime = 0, 9
guard.pausetime = 0, 8
sparkno = -1
guard.sparkno = -1
hitsound   = -1
guardsound = -1
ground.type = Low
ground.velocity = ifelse(var(0) > 2, 1, -1)*0.83, ifelse(var(0) > 2, -15, -12.5)
ground.hittime  = 24
ground.slidetime  = 24
ground.cornerpush.veloff = 0
guard.velocity = -12.5
guard.hittime = 23
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = ifelse(var(0) > 2, 1, -1)*0.83, ifelse(var(0) > 2, -15, -12.5)
airguard.velocity = ifelse(var(0) > 2, 1, -1)*3, -6.43
fall = 1
fall.recover = 0
yaccel = .536
ignorehitpause = 1

[State 4410, PosFreeze]
type = PosFreeze
trigger1 = root, var(56) != gametime
ignorehitpause = 1

[State 4410, ChangeAnim]
type = ChangeAnim
trigger1 = root, var(56) != gametime
value = anim
elem = animelemno(-1)
ignorehitpause = 1

[State 4410, VarAdd]
type = VarAdd
trigger1 = 1
var(3) = 1
ignorehitpause = 1


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

; Mystic Break Disappear
[Statedef 4411]
type = A
physics = N
movetype = I
anim = 4401
ignorehitpause = 1

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

[State 4411, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 4401
ignorehitpause = 1

[State 4411, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0
ignorehitpause = 1



; Mystic Break Hit
[Statedef 4412]
type = A
physics = N
movetype = I
movehitpersist = 1

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

[State 4412, ParentVarset]
type = ParentVarSet
triggerall = !time
trigger1 = parent, var(10) < 1
var(10) = ifelse(var(10), 1, -1)
ignorehitpause = 1
persistent = 0

[State 4412, ParentVarAdd]
type = ParentVarAdd
triggerall = !time
triggerall = movehit = 1
trigger1 = numtarget
trigger2 = p2movetype = H
trigger2 = enemynear, time < 1
var(11) = 1
ignorehitpause = 1
persistent = 0

[State 4412, ParentVarset]
type = ParentVarSet
triggerall = !time
trigger1 = var(10)
trigger1 = numtarget
fvar(10) = target, pos x
ignorehitpause = 1
persistent = 0

[State 4412, ParentVarset]
type = ParentVarSet
triggerall = !time
trigger1 = var(10)
trigger1 = !numtarget
fvar(10) = enemynear, pos x
ignorehitpause = 1
persistent = 0

[State 4412, ChangeState]
type = ChangeState
trigger1 = var(1) < 3
value = 4410
ignorehitpause = 1

[State 4412, ChangeAnim]
type = ChangeAnim
trigger1 = anim != 4401
value = 4401
ignorehitpause = 1

[State 4412, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 4401
ignorehitpause = 1

[State 4412, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0
ignorehitpause = 1


;======================================================================================
;--------------------------------------------------------------------------------------
; Mystic Break Earth Spawner
[Statedef 4500]
type = A
physics = N
movetype = A
anim = 9999

[State 4500, RemoveExplod]
type = RemoveExplod
trigger1 = var(21)
id = 7501
persistent = 0

[State 4500, RemoveExplod]
type = RemoveExplod
trigger1 = var(21)
id = 7502
persistent = 0

[State 4500, Explod]
type = Explod
trigger1 = var(21)
postype = left
id = 7503
anim = 7553
bindtime = -1
sprpriority = -5
supermovetime = 99999
persistent = 0

[State 4500, RemoveExplod]
type = RemoveExplod
trigger1 = var(21)
trigger1 = !numexplod(7503)
id = 4510
persistent = 0

[State 4500, DestroySelf]
type = DestroySelf
trigger1 = var(21)
trigger1 = !numexplod(7503)

[State 4500, AssertSpecial]
type = AssertSpecial
trigger1 = numexplod(7501)
trigger2 = numexplod(7502)
trigger3 = numexplod(7503)
flag = NoBG
flag2 = NoFG

[State 4500, VarSet]
type = VarSet
triggerall = !var(21)
trigger1 = parent, anim != 4000
trigger2 = parent, stateno != 4000
trigger3 = parent, movetype != A
trigger4 = parent, statetype != S
var(21) = 1

[State 4500, Explod]
type = Explod
triggerall = !var(21)
trigger1 = time = 0
postype = left
id = 7501
anim = 7551
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4500, Explod]
type = Explod
triggerall = !var(21)
trigger1 = (time - 24)%32 = 0
postype = left
id = 7502
anim = 7552
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4500, VarSet]
type = VarSet
triggerall = !var(21)
trigger1 = root, time = [44, 100]
trigger1 = enemynear, alive || enemynear, statetype != L
fvar(0) = enemynear, pos x - helper(9998), fvar(0)

[State 4500, VarSet]
type = VarSet
triggerall = !var(21)
trigger1 = root, time = [44, 100]
trigger1 = enemynear, alive || enemynear, statetype != L
fvar(1) = enemynear, pos y + enemynear, const(size.mid.pos.y)

[State 4500, PlaySnd]
type = PlaySnd
trigger1 = root, time = [50, 136]
trigger1 = root, time = 52 + var(1)*6 + var(3)
value = 4500, 0
channel = 1

[State 4500, VarSet]
type = VarSet
trigger1 = root, time = [50, 136]
trigger1 = root, time = 52 + var(1)*6 + var(3)
trigger1 = var(1) := var(1) + 1
var(3) = random%6 - 3

[State 4500, Helper]
type = Helper
triggerall = !var(21)
trigger1 = root, time = [44, 100]
trigger1 = (root, time-4)%8 = 0
name = "meteor"
id = 4500
stateno = 4510
pos = 0, floor((-screenpos y - 96)*const(size.yscale))
ownpal = 1
size.xscale = const(size.xscale)*0.25
size.yscale = const(size.yscale)*0.25
supermovetime = 99999

[State 4500, VarSet]
type = VarSet
triggerall = !var(21)
trigger1 = root, time = [44, 100]
trigger1 = (time-3)%8 = 0
fvar(3) = 0.5 + random*0.0005

[State 4500, Explod]
type = Explod
triggerall = !var(21)
trigger1 = root, time = [44, 100]
trigger1 = (time-3)%8 = 0
postype = back
id = 4510
anim = 4550 + 5*(root, var(23) != 0)
bindtime = 1
sprpriority = random%8 - 4
scale = fvar(3)*const(size.xscale), fvar(3)*const(size.yscale)
pos = floor(-256*const(size.xscale)), floor(-224*const(size.yscale))
random = floor(256*const(size.xscale)), floor(192*const(size.yscale))
vel = floor(8*const(size.xscale)), floor(6*const(size.yscale))
supermovetime = 99999

[State 4500, VarSet]
type = VarSet
triggerall = !var(21)
trigger1 = root, time = [44, 100]
trigger1 = (time-2)%6 = 0
fvar(3) = 0.2 + random*0.0001

[State 4500, Explod]
type = Explod
triggerall = !var(21)
trigger1 = root, time = [44, 100]
trigger1 = (time-2)%6 = 0
postype = back
id = 4510
anim = 4551 + random%2
bindtime = 1
sprpriority = -1 - random%4
scale = fvar(3)*const(size.xscale), fvar(3)*const(size.yscale)
pos = floor(-256*const(size.xscale)), floor(-224*const(size.yscale))
random = floor(256*const(size.xscale)), floor(192*const(size.yscale))
vel = floor(8*const(size.xscale)), floor(6*const(size.yscale))
supermovetime = 99999

[State 4500, BindToParent]
type = BindToParent
trigger1 = 1

[State 4500, FX Sound]
type = PlaySnd
trigger1 = var(10) = 1
value = 5, 8
abspan = floor(fvar(11))
channel = 2

[State 4500, FX Sound]
type = PlaySnd
trigger1 = var(10)
trigger1 = var(11)
trigger1 = var(10) := 0 || 1
value = 5, 2
abspan = floor(fvar(11))
channel = 3

[State 4500, FX Sound]
type = PlaySnd
trigger1 = var(10)
trigger1 = !var(11)
trigger1 = var(10) := 0 || 1
value = 6, 0
abspan = floor(fvar(11))
channel = 3

[State 4500, VarSet]
type = VarSet
trigger1 = var(11)
var(13) = 1

[State 4500, VarSet]
type = VarSet
trigger1 = !time
trigger1 = root, var(38) > (root, movehit > 0)
var(12) = 1

[State 4500, VarAdd]
type = VarAdd
trigger1 = var(11)
var(12) = var(11)

[State 4500, ParentVarAdd]
type = ParentVarAdd
trigger1 = var(11)
var(38) = var(11)

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

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

[State Delay Dampening]
type = ParentVarSet
trigger1 = time
var(33) = 1
ignorehitpause = 1

;--------------------------------------------------------------------------------------
; Mystic Break Earth Attack
[Statedef 4510]
type = A
physics = N
movetype = A
movehitpersist = 1
anim = 4500 + 10*(random%2)
sprpriority = 3

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

[State 4510, HitBy]
type = HitBy
trigger1 = 1
value = SCA, AP
time = -1
ignorehitpause = 1

[State 4510, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP, AT
stateno = 4510
time = -1

[State 4510, ParentVarset]
type = ParentVarSet
trigger1 = 1
var(20) = 1

[State 4510, HitBy]
type = HitBy
trigger1 = 1
value = SCA, AP
time = -1
ignorehitpause = 1

[State 4510, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP, AT
stateno = 4510
time = -1

[State 4510, VarSet]
type = VarSet
trigger1 = !prevstateno
trigger1 = time = 0
trigger1 = parent, fvar(1) - pos y != 0
fvar(0) = atan((parent, fvar(0) - pos x + helper(9998), fvar(0))/(parent, fvar(1) - pos y))

[State 4510, VarSet]
type = VarSet
trigger1 = !prevstateno
trigger1 = time = 0
trigger1 = parent, fvar(1) - pos y = 0
fvar(0) = pi*0.5

[State 4510, VarAdd]
type = VarAdd
trigger1 = !prevstateno
trigger1 = time = 0
fvar(0) = (random - 500)*0.0003

[State 4510, VelSet]
type = VelSet
trigger1 = !prevstateno
trigger1 = time = 0
x = 10*sin(fvar(0))*facing
y = 10*cos(fvar(0))

[State 4510, PosAdd]
type = PosAdd
trigger1 = !prevstateno
trigger1 = time = 0
x = (random*0.064 - 128)*const(size.xscale)
y = (random*0.048 - 96)*const(size.yscale)

[State 4510, Explod]
type = Explod
triggerall = root, var(22)
triggerall = time || prevstateno != 4412
trigger1 = movecontact = 1
postype = p1
anim = ifelse(moveguarded, 17006, 17004)
bindtime = 1
pos = floor(vel x), floor(vel y)
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1
ignorehitpause = 1

[State 4510, Explod]
type = Explod
triggerall = !root, var(22)
triggerall = time || prevstateno != 4412
trigger1 = movecontact = 1
postype = p1
anim = Fifelse(moveguarded, 40, 3)
bindtime = 1
pos = floor(vel x), floor(vel y)
sprpriority = 5
pausemovetime = 99999
supermovetime = 99999
ownpal = 1
ignorehitpause = 1

[State 4510, ChangeState]
type = ChangeState
triggerall = movecontact = 1
triggerall = time || prevstateno != 4512
triggerall = numtarget || p2movetype = H
trigger1 = numtarget != 1
trigger2 = numtarget = 1
trigger2 = !target, ishelper
value = 4512
ignorehitpause = 1

[State 4510, ChangeState]
type = ChangeState
trigger1 = movereversed = 1
value = 4512
ignorehitpause = 1

[State Interupted]
type = ChangeState
triggerall = root, movetype = H
trigger1 = root, stateno != [161, 162]
trigger2 = root, anim != 161
trigger2 = root, statetype != S
value = 4511
ignorehitpause = 1

[State 4510, ChangeState]
type = ChangeState
trigger1 = root, anim != 4000
trigger2 = root, stateno != 4000
trigger3 = root, movetype != A
trigger4 = root, statetype != S
trigger5 = pos y > 0
value = 4511

[State 4510, DestroySelf]
type = DestroySelf
trigger1 = pos y > 30
trigger1 = screenpos y > 270
ignorehitpause = 1

[State Damage Bonus]
type = AttackMulSet
trigger1 = 1
value = (0.7 + 0.3*root, fvar(13))*ifelse(root, var(20), 1 + (root, var(20) - 1)*root, fvar(15), 1)
ignorehitpause = 1

[State 4510, 1]
type = HitDef
trigger1 = 1
id = 4500
attr = S, HP
damage = floor(200/(1 + parent, var(12)*1.7)), 12
getpower = 0
numhits = 1
priority = 7, hit
animtype = Back
guardflag = HA
hitflag = MAF
pausetime = 0, 11
sparkno = -1
guard.sparkno = -1
hitsound   = -1
guardsound = -1
ground.type = Low
ground.velocity = -5, -7.5
ground.hittime  = 24
ground.slidetime  = 24
ground.cornerpush.veloff = 0
guard.velocity = -12.5
guard.hittime = 23
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -6.43
airguard.velocity = -5, -6.43
air.type = Low
fall = 1
fall.recover = 0
yaccel = .536
palfx.time = 50
palfx.color = 0
palfx.mul = 256, 64, 0
palfx.sinadd = -64, -64, 0, 20
ignorehitpause = 1

[State 4510, 2] ;For combo count
type = Projectile
trigger1 = 1
projid = 4500
projanim = anim + 1
projremovetime = 1
projedgebound = 320
projstagebound = 320
projheightbound = -480, 240
projpriority = 9999
supermovetime = 99999
offset = floor(pos x + vel x - floor(pos x)), floor(pos y + vel y - floor(pos y))
id = 4400
attr = S, HP
getpower = 0
numhits = 0
animtype = Back
guardflag = HA
hitflag = MAF
pausetime = 0, 11
sparkno = -1
guard.sparkno = -1
hitsound   = -1
guardsound = -1
ground.type = Low
ground.velocity = -5, -7.5
ground.hittime  = 24
ground.slidetime  = 24
ground.cornerpush.veloff = 0
guard.velocity = -12.5
guard.hittime = 23
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -6.43
airguard.velocity = -5, -6.43
air.type = Low
fall = 1
fall.recover = 0
yaccel = .536
palfx.time = 50
palfx.color = 0
palfx.mul = 256, 64, 0
palfx.sinadd = -64, -64, 0, 20
ignorehitpause = 1

[State 4510, PosFreeze]
type = PosFreeze
trigger1 = root, var(56) != gametime
ignorehitpause = 1

[State 4510, ChangeAnim]
type = ChangeAnim
trigger1 = root, var(56) != gametime
value = anim
elem = animelemno(-1)
ignorehitpause = 1

[State 4510, VarAdd]
type = VarAdd
trigger1 = 1
var(3) = 1
ignorehitpause = 1

; Mystic Break Disappear
[Statedef 4511]
type = A
physics = N
movetype = I
anim = 9999
ignorehitpause = 1

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

[State 4511, Explod]
type = Explod
trigger1 = !time
anim = 4520 + 10*(random%3)
id = 4510
bindtime = 1
accel = 0, 0.4
vel = 3, 4
sprpriority = 2
scale = const(size.xscale), const(size.yscale)

[State 4511, Explod]
type = Explod
trigger1 = !time
anim = 4520 + 10*(random%3)
id = 4510
bindtime = 1
accel = 0, 0.4
vel = 4, -3
sprpriority = 2
scale = const(size.xscale), const(size.yscale)

[State 4511, Explod]
type = Explod
trigger1 = !time
anim = 4520 + 10*(random%3)
id = 4510
bindtime = 1
accel = 0, 0.4
vel = -3, 4
sprpriority = 2
scale = const(size.xscale), const(size.yscale)

[State 4511, Explod]
type = Explod
trigger1 = !time
anim = 4520 + 10*(random%3)
id = 4510
bindtime = 1
accel = 0, 0.4
vel = -4, -3
sprpriority = 2
scale = const(size.xscale), const(size.yscale)

[State 4511, DestroySelf]
type = DestroySelf
trigger1 = time
ignorehitpause = 1


; Mystic Break Hit
[Statedef 4512]
type = A
physics = N
movetype = I
anim = 9999
movehitpersist = 1

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

[State 4512, Fire FX]
type = Explod
trigger1 = !time
trigger1 = !(parent, var(12)%2)
trigger1 = numtarget
trigger1 = !target, gethitvar(guarded)
id = 7050
anim = 7050 + random%3
sprpriority = 2
postype = p2
bindtime = 45 
pos = 0, floor(target, const(size.mid.pos.y))
random = floor((target, const(size.ground.front)+target, const(size.ground.back))*(parent, var(12) != 0)*0.4), floor((target, const(size.mid.pos.y)-target, const(size.head.pos.y))*(parent, var(12) != 0)*0.8)
ignorehitpause = 1
ownpal = 1
persistent = 0

[State 4512, ParentVarset]
type = ParentVarSet
triggerall = !time
trigger1 = parent, var(10) < 1
var(10) = ifelse(movehit = 1, 1, -1)
ignorehitpause = 1
persistent = 0

[State 4512, ParentVarAdd]
type = ParentVarAdd
triggerall = !time
triggerall = movehit = 1
trigger1 = numtarget
trigger2 = p2movetype = H
trigger2 = enemynear, time < 1
var(11) = 1
ignorehitpause = 1
persistent = 0

[State 4512, ParentVarset]
type = ParentVarSet
triggerall = !time
trigger1 = var(10)
trigger1 = numtarget
fvar(10) = target, pos x
ignorehitpause = 1
persistent = 0

[State 4512, ParentVarset]
type = ParentVarSet
triggerall = !time
trigger1 = var(10)
trigger1 = !numtarget
fvar(10) = enemynear, pos x
ignorehitpause = 1
persistent = 0

[State 4512, Explod]
type = Explod
trigger1 = !time
anim = 4520 + 10*(random%3)
id = 4510
bindtime = 1
accel = 0, 0.4
vel = 3, 4
sprpriority = 2
scale = const(size.xscale), const(size.yscale)

[State 4512, Explod]
type = Explod
trigger1 = !time
anim = 4520 + 10*(random%3)
id = 4510
bindtime = 1
accel = 0, 0.4
vel = 4, -3
sprpriority = 2
scale = const(size.xscale), const(size.yscale)

[State 4512, Explod]
type = Explod
trigger1 = !time
anim = 4520 + 10*(random%3)
id = 4510
bindtime = 1
accel = 0, 0.4
vel = -3, 4
sprpriority = 2
scale = const(size.xscale), const(size.yscale)

[State 4512, Explod]
type = Explod
trigger1 = !time
anim = 4520 + 10*(random%3)
id = 4510
bindtime = 1
accel = 0, 0.4
vel = -4, -3
sprpriority = 2
scale = const(size.xscale), const(size.yscale)

[State 4512, DestroySelf]
type = DestroySelf
trigger1 = time
ignorehitpause = 1

;======================================================================================
;--------------------------------------------------------------------------------------
; Mystic Break Poison Spawner
[Statedef 4600]
type = A
physics = N
movetype = A
anim = 9999

[State 4600, AssertSpecial]
type = AssertSpecial
trigger1 = numexplod(7501)
trigger2 = numexplod(7502)
trigger3 = numexplod(7503)
flag = NoBG
flag2 = NoFG

[State 4600, ChangeState]
type = ChangeState
trigger1 = parent, anim != 4000
trigger2 = parent, stateno != 4000
trigger3 = parent, movetype != A
trigger4 = parent, statetype != S
value = 4601

[State 4600, Explod]
type = Explod
trigger1 = time = 0
postype = left
id = 7501
anim = 7561
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4600, Explod]
type = Explod
trigger1 = (time - 24)%32 = 0
postype = left
id = 7502
anim = 7562
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4600, VarSet]
type = VarSet
trigger1 = root, time > 43
trigger1 = time%5 = 0
fvar(3) = 0.5 + random*0.001

[State 4600, Explod]
type = Explod
trigger1 = root, time > 43
trigger1 = time%5 = 0
postype = left
id = 4610
anim = 4640 + (root, var(23) != 0)
bindtime = 1
sprpriority = -4
scale = fvar(3)*const(size.xscale), fvar(3)*const(size.yscale)
pos = 160, floor(root, screenpos y - 120)
random = 320, 240
supermovetime = 99999

[State 4600, VarSet]
type = VarSet
trigger1 = root, time = [44, 71]
trigger1 = (root, time+10)%9 = 0
var(0) = 64 + 64*((root, time-44)/9)

[State 4600, Explod]
type = Explod
trigger1 = root, time = [44, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := 0 || 1
postype = p1
id = 4610
anim = ifelse(root, time = 44, 4600, ifelse(root, time = 71, 4620, 4610)) + (root, var(23) != 0)
bindtime = 1
sprpriority = 3
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [62, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*0.125
postype = p1
id = 4610
anim = ifelse(root, time = 71, 4620, 4610) + (root, var(23) != 0)
bindtime = 1
sprpriority = 3
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [62, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*1.875
postype = p1
id = 4610
anim = ifelse(root, time = 71, 4620, 4610) + (root, var(23) != 0)
bindtime = 1
sprpriority = 3
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [44, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*0.25
postype = p1
id = 4610
anim = ifelse(root, time = 44, 4600, ifelse(root, time = 71, 4620, 4610)) + (root, var(23) != 0)
bindtime = 1
sprpriority = 3
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [44, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*1.75
postype = p1
id = 4610
anim = ifelse(root, time = 44, 4600, ifelse(root, time = 71, 4620, 4610)) + (root, var(23) != 0)
bindtime = 1
sprpriority = 3
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [62, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*0.375
postype = p1
id = 4610
anim = ifelse(root, time = 71, 4620, 4610) + (root, var(23) != 0)
bindtime = 1
sprpriority = 3
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [62, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*1.625
postype = p1
id = 4610
anim = ifelse(root, time = 71, 4620, 4610) + (root, var(23) != 0)
bindtime = 1
sprpriority = 3
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [44, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*0.5
postype = p1
id = 4610
anim = ifelse(root, time = 44, 4600, ifelse(root, time = 71, 4620, 4610)) + (root, var(23) != 0)
bindtime = 1
sprpriority = 3
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [44, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*1.5
postype = p1
id = 4610
anim = ifelse(root, time = 44, 4600, ifelse(root, time = 71, 4620, 4610)) + (root, var(23) != 0)
bindtime = 1
sprpriority = 3
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [62, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*0.625
postype = p1
id = 4610
anim = ifelse(root, time = 71, 4620, 4610) + (root, var(23) != 0)
bindtime = 1
sprpriority = -2
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [62, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*1.375
postype = p1
id = 4610
anim = ifelse(root, time = 71, 4620, 4610) + (root, var(23) != 0)
bindtime = 1
sprpriority = -2
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [44, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*0.75
postype = p1
id = 4610
anim = ifelse(root, time = 44, 4600, ifelse(root, time = 71, 4620, 4610)) + (root, var(23) != 0)
bindtime = 1
sprpriority = -2
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [44, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*1.25
postype = p1
id = 4610
anim = ifelse(root, time = 44, 4600, ifelse(root, time = 71, 4620, 4610)) + (root, var(23) != 0)
bindtime = 1
sprpriority = -2
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [62, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*0.875
postype = p1
id = 4610
anim = ifelse(root, time = 71, 4620, 4610) + (root, var(23) != 0)
bindtime = 1
sprpriority = -2
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [62, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi*1.125
postype = p1
id = 4610
anim = ifelse(root, time = 71, 4620, 4610) + (root, var(23) != 0)
bindtime = 1
sprpriority = -2
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, Explod]
type = Explod
trigger1 = root, time = [44, 71]
trigger1 = (root, time+10)%9 = 0
trigger1 = fvar(3) := pi
postype = p1
id = 4610
anim = ifelse(root, time = 44, 4600, ifelse(root, time = 71, 4620, 4610)) + (root, var(23) != 0)
bindtime = 1
sprpriority = -2
pos = floor(var(0)*sin(fvar(3))*const(size.xscale)), floor(0.1*var(0)*cos(fvar(3))*const(size.yscale))
supermovetime = 99999
scale = 1.33, 1.33

[State 4600, PlaySnd]
type = PlaySnd
trigger1 = root, time = 44
value = 4600, 0
channel = 1
persistent = 0

[State 4600, Helper]
type = Helper
trigger1 = root, time = 44
name = "clouds"
id = 4600
stateno = 4610
ownpal = 1
supermovetime = 99999

[State 4600, Helper]
type = Helper
trigger1 = root, time = [53, 71]
trigger1 = (root, time+10)%9 = 0
name = "clouds"
id = 4600
stateno = 4610
ownpal = 1
pos = 0, -6 -3*((root, time-44)/9)
supermovetime = 99999

[State 4600, Helper]
type = Helper
trigger1 = root, time = [53, 71]
trigger1 = (root, time+10)%9 = 0
name = "clouds"
id = 4600
stateno = 4610
ownpal = 1
pos = 0, 4 + 2*((root, time-44)/9)
supermovetime = 99999

[State 4600, BindToParent]
type = BindToParent
trigger1 = 1
pos = floor(8*const(size.xscale)), 0

[State 4600, FX Sound]
type = PlaySnd
trigger1 = var(10) = 1
value = 5, 11
abspan = floor(fvar(11))
channel = 2

[State 4600, FX Sound]
type = PlaySnd
trigger1 = var(10)
trigger1 = var(11)
trigger1 = var(10) := 0 || 1
value = 5, 2
abspan = floor(fvar(11))
channel = 3

[State 4600, FX Sound]
type = PlaySnd
trigger1 = var(10)
trigger1 = !var(11)
trigger1 = var(10) := 0 || 1
value = 6, 0
abspan = floor(fvar(11))
channel = 3

[State 4600, VarSet]
type = VarSet
trigger1 = var(11)
var(13) = 1

[State 4600, VarSet]
type = VarSet
trigger1 = !time
trigger1 = root, var(38) > (root, movehit > 0)
var(12) = 1

[State 4600, VarAdd]
type = VarAdd
trigger1 = var(11)
var(12) = var(11)

[State 4600, ParentVarAdd]
type = ParentVarAdd
trigger1 = var(11)
var(38) = var(11)

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

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

;--------------------------------------------------------------------------------------
; Mystic Break Poison Cleanup
[Statedef 4601]
type = A
physics = N
movetype = A
anim = 9999

[State 4601, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 7501

[State 4601, RemoveExplod]
type = RemoveExplod
trigger1 = !time
id = 7502

[State 4601, Explod]
type = Explod
trigger1 = !time
postype = left
id = 7503
anim = 7563
bindtime = -1
sprpriority = -5
supermovetime = 99999

[State 4601, RemoveExplod]
type = RemoveExplod
trigger1 = !numexplod(7503)
id = 4610

[State 4601, AssertSpecial]
type = AssertSpecial
trigger1 = numexplod(7503)
flag = NoBG
flag2 = NoFG

[State 4601, ParentVarAdd]
type = ParentVarAdd
trigger1 = var(11)
var(38) = var(11)

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

[State 4601, DestroySelf]
type = DestroySelf
trigger1 = !numexplod(7503)
value = prevstateno

;--------------------------------------------------------------------------------------
; Mystic Break Poison Attack
[Statedef 4610]
type = A
physics = N
movetype = A
movehitpersist = 1
sprpriority = 3

[State 4610, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0
ignorehitpause = 1

[State 4610, DestroySelf]
type = DestroySelf
triggerall = root, movetype = H
trigger1 = root, stateno != [161, 162]
trigger2 = root, anim != 161
trigger2 = root, statetype != S
ignorehitpause = 1

[State 4610, ChangeAnim]
type = ChangeAnim
trigger1 = !var(3)
value = 4602 + ((root, time-44)/9)

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

[State 4610, HitBy]
type = HitBy
trigger1 = 1
value = SCA, AP
time = -1
ignorehitpause = 1

[State 4610, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP, AT
stateno = 4610
time = -1

[State 4610, ParentVarset]
type = ParentVarSet
trigger1 = 1
var(20) = 1

[State 4610, HitBy]
type = HitBy
trigger1 = 1
value = SCA, AP
time = -1
ignorehitpause = 1

[State 4610, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AP, AT
stateno = 4610
time = -1

[State 4610, ChangeState]
type = ChangeState
triggerall = movecontact = 1
triggerall = time || prevstateno != 4612
triggerall = numtarget || p2movetype = H
trigger1 = numtarget != 1
trigger2 = numtarget = 1
trigger2 = !target, ishelper
value = 4612
ignorehitpause = 1

[State 4610, ChangeState]
type = ChangeState
trigger1 = movereversed = 1
value = 4612
ignorehitpause = 1

[State Damage Bonus]
type = AttackMulSet
trigger1 = 1
value = (0.7 + 0.3*root, fvar(13))*ifelse(root, var(20), 1 + (root, var(20) - 1)*root, fvar(15), 1)
ignorehitpause = 1

[State 4610, 1]
type = HitDef
trigger1 = root, var(22)
id = 4600
attr = S, HP
damage = floor(64/(1 + parent, var(12)*0.2)), 6
getpower = 0
givepower = -floor(64/(1 + parent, var(12)*0.2)), floor(0.3*(56/(1 + parent, var(12)*0.2)))
numhits = 1
priority = 7, hit
animtype = Back
guardflag = LA
hitflag = MAF
pausetime = 0, 19
guard.pausetime = 0, 9
sparkno = s17002
guard.sparkno = s17006
sparkxy = floor((ifelse(pos y < 0, 16, -16) - (anim%100)*16)*const(size.xscale)), floor(-8*const(size.xscale))
hitsound   = -1
guardsound = -1
ground.type = Low
ground.velocity = -5, -7.5
ground.hittime  = 24
ground.slidetime  = 24
ground.cornerpush.veloff = 0
guard.velocity = -12.5
guard.hittime = 23
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -7.5
airguard.velocity = -3, -6.43
air.type = Low
fall = 1
fall.recover = 0
fall.animtype = Heavy
yaccel = .536
palfx.time = 50
palfx.color = 128
palfx.mul = 128, 64, 160
palfx.add = 160, 0, 128
palfx.sinadd = 64, 64, 64, 20
ignorehitpause = 1

[State 4610, 1]
type = HitDef
trigger1 = !root, var(22)
id = 4600
attr = S, HP
damage = floor(64/(1 + parent, var(12)*0.2)), 6
getpower = 0
givepower = -floor(64/(1 + parent, var(12)*0.2)), floor(0.3*(56/(1 + parent, var(12)*0.2)))
numhits = 1
priority = 7, hit
animtype = Back
guardflag = LA
hitflag = MAF
pausetime = 0, 19
guard.pausetime = 0, 9
sparkno = 3
sparkxy = floor((ifelse(pos y < 0, 16, -16) - (anim%100)*16)*const(size.xscale)), floor(-8*const(size.xscale))
hitsound   = -1
guardsound = -1
ground.type = Low
ground.velocity = -5, -7.5
ground.hittime  = 24
ground.slidetime  = 24
ground.cornerpush.veloff = 0
guard.velocity = -12.5
guard.hittime = 23
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -7.5
airguard.velocity = -3, -6.43
air.type = Low
fall = 1
fall.recover = 0
fall.animtype = Heavy
yaccel = .536
palfx.time = 50
palfx.color = 128
palfx.mul = 128, 64, 160
palfx.add = 160, 0, 128
palfx.sinadd = 64, 64, 64, 20
ignorehitpause = 1

[State 4610, 2] ;For combo count
type = Projectile
trigger1 = animelemno(0) = 2
projid = 4600
projanim = anim + 4
projremovetime = 1
projedgebound = 320
projstagebound = 320
projheightbound = -480, 240
projpriority = 9999
supermovetime = 99999
id = 4600
attr = S, HP
getpower = 0
numhits = 0
animtype = Back
guardflag = LA
hitflag = MAF
pausetime = 0, 19
guard.pausetime = 0, 9
sparkno = -1
guard.sparkno = -1
hitsound   = -1
guardsound = -1
ground.type = Low
ground.velocity = -5, -7.5
ground.hittime  = 24
ground.slidetime  = 24
ground.cornerpush.veloff = 0
guard.velocity = -12.5
guard.hittime = 23
;air.hittime = 999
airguard.ctrltime = 999
air.velocity = -5, -7.5
airguard.velocity = -3, -6.43
air.type = Low
fall = 1
fall.recover = 0
fall.animtype = Heavy
yaccel = .536
palfx.time = 50
palfx.color = 128
palfx.mul = 128, 64, 160
palfx.add = 160, 0, 128
palfx.sinadd = 64, 64, 64, 20
ignorehitpause = 1

[State 4610, VarAdd]
type = VarAdd
trigger1 = 1
var(3) = 1
ignorehitpause = 1

; Mystic Break Hit
[Statedef 4612]
type = A
physics = N
movetype = I
anim = 9999
movehitpersist = 1

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

[State 4612, Poison FX]
type = Explod
trigger1 = !time
trigger1 = pos y < 1
trigger1 = numtarget
trigger1 = !target, gethitvar(guarded)
id = 7080
anim = 7080 + random%3
sprpriority = 2
postype = p2
bindtime = 53
pos = 0, target, const(size.head.pos.y)/2
random = floor((target, const(size.ground.front)+target, const(size.ground.back))*(parent, var(12) != 0)*0.4), floor(-target, const(size.head.pos.y)*(parent, var(12) != 0)*0.7)
ignorehitpause = 1
ownpal = 1
persistent = 0

[State 4612, ParentVarset]
type = ParentVarSet
triggerall = !time
trigger1 = parent, var(10) < 1
var(10) = ifelse(movehit = 1, 1, -1)
ignorehitpause = 1
persistent = 0

[State 4612, ParentVarAdd]
type = ParentVarAdd
triggerall = !time
triggerall = movehit = 1
trigger1 = numtarget
trigger2 = p2movetype = H
trigger2 = enemynear, time < 1
var(11) = 1
ignorehitpause = 1
persistent = 0

[State 4612, ParentVarset]
type = ParentVarSet
triggerall = !time
trigger1 = var(10)
trigger1 = numtarget
fvar(10) = target, pos x
ignorehitpause = 1
persistent = 0

[State 4612, ParentVarset]
type = ParentVarSet
triggerall = !time
trigger1 = var(10)
trigger1 = !numtarget
fvar(10) = enemynear, pos x
ignorehitpause = 1
persistent = 0

[State 4612, DestroySelf]
type = DestroySelf
trigger1 = time
ignorehitpause = 1

