; _________________________________________
;| Demitri by Jmorphman                    |
; ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
;==============================================================================================
;========================================<SUPER STATES>========================================
;==============================================================================================

;========================<MIDNIGHT BLISS>=============================
[StateDef 3000]
type = S
physics = N
moveType = A
anim = 3000
ctrl = 0
velSet = 0,0
sprPriority = 1
powerAdd = -1000
faceP2 = ifElse((PrevStateNo = [100,106]), 0, 1)

[State 3000, Super Cancel Flag]
type = VarSet
trigger1 = !Time
var(21) = ((PrevStateNo = [1000, 2999]) && var(7))

[State 3000, Corner Push]
type = VarSet
triggerAll = var(40)
trigger1 = Time = 3
fvar(5) = 0

[State 3000, Unguardable]
type = VarSet
triggerAll = var(40)
trigger1 = Time = 3 && NumEnemy
trigger1 = (EnemyNear, StateNo != [120,155])
var(17) = 43

[State 3000, Super Cancel Flash]
type = PalFX
trigger1 = var(21) || var(22)
trigger1 = !(Time % 2) && Time <= 12
time = 1
add = 255,255,255
ignoreHitPause = 1

[State 3000, Super Cancel Juggle]
type = VarSet
trigger1 = !Time
trigger1 = var(21) || var(22)
var(15) = 0
ignoreHitPause = 1

[State 3000, SuperPause FX]
type = Helper
triggerAll = var(40)
trigger1 = Time = 3
helperType = Normal
stateNo = 8500
ID = 8500
name = "Superpause FX"
posType = P1
pos = ceil(21 * const(size.xScale)), ceil(-88 * const(size.yScale))
superMoveTime = 255
size.xScale = 1
size.yScale = 1
ownPal = 1

[State 3000, SuperPause]
type = SuperPause
triggerAll = var(40)
trigger1 = Time = 3
time = 43
moveTime = 0
p2DefMul = 1
unHittable = 1
anim = -1
sound = s8500,0
darken = 0

[State 3000, EX Flash]
type = VarSet
triggerAll = !var(40)
trigger1 = !Time
var(24) = 40

[State 3000, EX FX]
type = Explod
trigger1 = !Time && !var(40)
anim = 8210
sprPriority = 3
posType = p1
pos = ceil(21 * const(size.xScale)), ceil(-88 * const(size.yScale))
scale = 0.5, 0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 3000, EX Startup Sound]
type = PlaySnd
trigger1 = !Time && !var(40)
value = 0,1000
channel = 1

[State 3000, Voice]
type = PlaySnd
trigger1 = !Time
value = 3000,0
channel = 0

[State 3000, Warp sound]
type = PlaySnd
trigger1 = !Time && !var(40)
trigger2 = Time = 4 && var(40)
value = 3000,1
channel = 3

[State 3000, VelSet]
type = VelSet
trigger1 = AnimElem = 2
x = 3.75

[State 3000, HitDef]
type = HitDef
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
trigger1 = !var(38)
attr = S, HT
hitFlag = M
priority = 7, Miss
getPower = 0,0
givePower = 0,0
sparkNo = -1 + 0 * (var(33) := 0)
guard.sparkNo = -1 + 0 * (var(34) := 8001)
sparkXY = -10 + 0 * (var(35) := 40), var(36) := -50
hitSound = -1 +0 * (var(31) := 800)
guardSound = -1 +0 * (var(32) := 0)
fall = 1
fall.recover = 0
numHits = 0
p1StateNo = 3010

[State 3000, VelSet]
type = VelSet
trigger1 = AnimElem = 3
x = 0

[State 3000, StateTypeSet: Idle]
type = StateTypeSet
trigger1 = AnimElemTime(3) >= 0
moveType = I

[State 3000, End]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1


;Success
[StateDef 3010]
type = S
anim = 3010
physics = N
moveType = A
velSet = 0,0

[State 3010, EX Flash]
type = VarSet
triggerAll = !var(40)
trigger1 = !Time
var(24) = 156

[State 3010, Lost Target]
type = ChangeState
trigger1 = !Time && !NumTarget
value = 0
ctrl = 1

[State 3010, TargetState: Standing]
type = TargetState
trigger1 = !Time && NumTarget
value = 3015

[State 3010, Standard Bliss]
type = VarSet
trigger1 = !Time && NumTarget
trigger1 = Target, SelfAnimExist(99020) || Target, SelfAnimExist(9020) || Target, SelfAnimExist(9025) || Target, SelfAnimExist(66660)
var(10) = 2

[State 3010, CFJ Bliss]
type = VarSet
trigger1 = !Time && NumTarget
trigger1 = !(Target, SelfAnimExist(99020)) && !(Target, SelfAnimExist(9020)) && !(Target, SelfAnimExist(9025)) && !(Target, SelfAnimExist(66660))
trigger1 = Target, SelfAnimExist(9021) || Target, SelfAnimExist(9022)
var(10) = 1

[State 3010, Generic Bliss]
type = VarSet
trigger1 = !Time && NumTarget
trigger1 = !(Target, SelfAnimExist(99020)) && !(Target, SelfAnimExist(9020)) && !(Target, SelfAnimExist(9025)) && !(Target, SelfAnimExist(66660))
trigger1 = !(Target, SelfAnimExist(9021)) && !(Target, SelfAnimExist(9022))
var(10) = 0

[State 3010, TargetBind 1]
type = TargetBind
trigger1 = NumTarget
trigger1 = !Time
pos = ceil(60 * const(size.xScale)), 0

[State 3010, Dust cloud 1]
type = Explod
trigger1 = AnimElemTime(2) = 1
anim = 1205
sprPriority = 3
posType = P1
pos = ceil(19 * const(size.xScale)), ceil(-80 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, Dust cloud 1 (Bottom layer)]
type = Explod
trigger1 = AnimElemTime(2) = 1
anim = 1206
sprPriority = 3
posType = P1
pos = ceil(19 * const(size.xScale)), ceil(-80 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, Dust cloud 2]
type = Explod
trigger1 = AnimElemTime(2) = 2
anim = 1205
sprPriority = 3
posType = P1
pos = ceil(87 * const(size.xScale)), ceil(-60 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, Dust cloud 2 (Bottom layer)]
type = Explod
trigger1 = AnimElemTime(2) = 2
anim = 1206
sprPriority = 3
posType = P1
pos = ceil(87 * const(size.xScale)), ceil(-60 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, Dust cloud 3]
type = Explod
trigger1 = AnimElemTime(2) = 3
anim = 1205
sprPriority = 3
posType = P1
pos = ceil(35 * const(size.xScale)), ceil(-32 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, Dust cloud 3 (Bottom layer)]
type = Explod
trigger1 = AnimElemTime(2) = 3
anim = 1206
sprPriority = 3
posType = P1
pos = ceil(35 * const(size.xScale)), ceil(-32 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, Dust cloud 4]
type = Explod
trigger1 = AnimElemTime(2) = 4
anim = 1205
sprPriority = 2
posType = P1
pos = ceil(3 * const(size.xScale)), ceil(-40 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, Dust cloud 4 (Bottom layer)]
type = Explod
trigger1 = AnimElemTime(2) = 4
anim = 1206
sprPriority = 2
posType = P1
pos = ceil(3 * const(size.xScale)), ceil(-40 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, Dust cloud 5]
type = Explod
trigger1 = AnimElemTime(2) = 5
anim = 1205
sprPriority = 2
posType = P1
pos = ceil(99 * const(size.xScale)), ceil(-56 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, Dust cloud 5 (Bottom layer)]
type = Explod
trigger1 = AnimElemTime(2) = 5
anim = 1206
sprPriority = 2
posType = P1
pos = ceil(99 * const(size.xScale)), ceil(-56 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, Dust cloud 5]
type = Explod
trigger1 = AnimElemTime(2) = 6
anim = 1205
sprPriority = 2
posType = P1
pos = ceil(59 * const(size.xScale)), ceil(-16 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, Dust cloud 5 (Bottom layer)]
type = Explod
trigger1 = AnimElemTime(2) = 6
anim = 1206
sprPriority = 2
posType = P1
pos = ceil(59 * const(size.xScale)), ceil(-16 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, TargetState: Transformed, standing]
type = TargetState
trigger1 = AnimElem = 3 && NumTarget
value = 3016

[State 3010, Bliss stand-in]
type = Helper
trigger1 = AnimElem = 3 && NumTarget && !var(10)
trigger1 = var(43) := (Target, ID)
helperType = Normal
stateNo = 19020
ID = 19020
name = "Bliss stand-in"
posType = P2
size.xScale = 1;const(size.xScale)
size.yScale = 1;const(size.yScale)
ownPal = 1
ignoreHitPause = 1

[State 3010, Change to CFJ Bliss]
type = ChangeState
trigger1 = var(10) = 1 && AnimElem = 8
value = 3020

[State 3010, TargetState: Transformed, being drained]
type = TargetState
trigger1 = AnimElem = 8 && NumTarget
value = 3017

[State 3010, TargetBind 2]
type = TargetBind
triggerAll = NumTarget
trigger1 = AnimElemTime(8) >= 0 && AnimElemTime(9) < 0
pos = ceil(51 * const(size.xScale)), ceil(-88 * const(size.yScale))

[State 3010, TargetBind 3]
type = TargetBind
triggerAll = NumTarget
trigger1 = AnimElemTime(9) >= 0 && AnimElemTime(10) < 0
pos = ceil(26 * const(size.xScale)), ceil(-156 * const(size.yScale))

[State 3010, TargetBind 4]
type = TargetBind
triggerAll = NumTarget
trigger1 = AnimElemTime(10) >= 0 && AnimElemTime(14) < 0
trigger2 = AnimElemTime(15) >= 0 && AnimElemTime(16) < 0
pos = ceil(38 * const(size.xScale)), ceil(-144 * const(size.yScale))

[State 3010, TargetBind 5]
type = TargetBind
triggerAll = NumTarget
trigger1 = AnimElemTime(14) >= 0 && AnimElemTime(15) < 0
trigger2 = AnimElemTime(16) >= 0 && AnimElemTime(17) < 0
trigger3 = AnimElemTime(18) >= 0 && AnimElemTime(19) < 0
trigger4 = AnimElemTime(20) >= 0 && AnimElemTime(21) < 0
trigger5 = AnimElemTime(22) >= 0 && AnimElemTime(23) < 0
trigger6 = AnimElemTime(24) >= 0 && AnimElemTime(25) < 0
trigger7 = AnimElemTime(26) >= 0 && AnimElemTime(27) < 0
trigger8 = AnimElemTime(28) >= 0 && AnimElemTime(29) < 0
trigger9 = AnimElemTime(30) >= 0 && AnimElemTime(31) < 0
trigger10 = AnimElemTime(32) >= 0 && AnimElemTime(33) < 0
trigger11 = AnimElemTime(34) >= 0 && AnimElemTime(35) < 0
trigger12 = AnimElemTime(36) >= 0 && AnimElemTime(37) < 0
trigger13 = AnimElemTime(38) >= 0 && AnimElemTime(39) < 0
trigger14 = AnimElemTime(40) >= 0 && AnimElemTime(41) < 0
trigger15 = AnimElemTime(42) >= 0 && AnimElemTime(43) < 0
trigger16 = AnimElemTime(44) >= 0 && AnimElemTime(45) < 0
trigger17 = AnimElemTime(46) >= 0 && AnimElemTime(47) < 0
trigger18 = AnimElemTime(48) >= 0 && AnimElemTime(49) < 0
trigger19 = AnimElemTime(50) >= 0 && AnimElemTime(51) < 0
pos = ceil(37 * const(size.xScale)), ceil(-137 * const(size.yScale))

[State 3010, TargetBind 6]
type = TargetBind
triggerAll = NumTarget
trigger1 = AnimElemTime(17) >= 0 && AnimElemTime(18) < 0
trigger2 = AnimElemTime(19) >= 0 && AnimElemTime(20) < 0
trigger3 = AnimElemTime(21) >= 0 && AnimElemTime(22) < 0
trigger4 = AnimElemTime(23) >= 0 && AnimElemTime(24) < 0
trigger5 = AnimElemTime(25) >= 0 && AnimElemTime(26) < 0
trigger6 = AnimElemTime(27) >= 0 && AnimElemTime(28) < 0
trigger7 = AnimElemTime(29) >= 0 && AnimElemTime(30) < 0
trigger8 = AnimElemTime(31) >= 0 && AnimElemTime(32) < 0
trigger9 = AnimElemTime(33) >= 0 && AnimElemTime(34) < 0
trigger10 = AnimElemTime(35) >= 0 && AnimElemTime(36) < 0
trigger11 = AnimElemTime(37) >= 0 && AnimElemTime(38) < 0
trigger12 = AnimElemTime(39) >= 0 && AnimElemTime(40) < 0
trigger13 = AnimElemTime(41) >= 0 && AnimElemTime(42) < 0
trigger14 = AnimElemTime(43) >= 0 && AnimElemTime(44) < 0
trigger15 = AnimElemTime(45) >= 0 && AnimElemTime(46) < 0
trigger16 = AnimElemTime(47) >= 0 && AnimElemTime(48) < 0
trigger17 = AnimElemTime(49) >= 0 && AnimElemTime(50) < 0
trigger18 = AnimElemTime(51) >= 0
pos = ceil(37 * const(size.xScale)), ceil(-135 * const(size.yScale))

[State 3010, Damage]
type = TargetLifeAdd
triggerAll = NumTarget
trigger1 = AnimElem = 19
trigger2 = AnimElem = 21
trigger3 = AnimElem = 23
trigger4 = AnimElem = 25
trigger5 = AnimElem = 27
trigger6 = AnimElem = 29
trigger7 = AnimElem = 31
trigger8 = AnimElem = 33
trigger9 = AnimElem = 35
trigger10 = AnimElem = 37
trigger11 = AnimElem = 39
trigger12 = AnimElem = 41
trigger13 = AnimElem = 43
trigger14 = AnimElem = 45
trigger15 = AnimElem = 47
trigger16 = AnimElem = 49
trigger17 = AnimElem = 51
value = floor(ifElse(7 * fvar(11) < 7, -7, -7 * fvar(11)))
kill = 0

[State 3010, Midnight Bliss FX]
type = Explod
trigger1 = AnimElemTime(21) = 1
trigger2 = AnimElemTime(25) = 1
trigger3 = AnimElem = 29
trigger4 = AnimElem = 31
trigger5 = AnimElem = 33
trigger6 = AnimElem = 35
trigger7 = AnimElem = 37
trigger8 = AnimElem = 39
trigger9 = AnimElem = 41
trigger10 = AnimElem = 43
trigger11 = AnimElem = 45
anim = 13010
sprPriority = 4
posType = P1
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3010, Blood]
type = Explod
trigger1 = AnimElem = 33
ID = 8052
anim = 8052
sprPriority = 3
posType = P1
pos = ceil(10 * const(size.xScale)), ceil(-116 * const(size.yScale))
removetime = -1
scale = const(size.xScale), const(size.yScale)
ownPal = 1
ignoreHitPause = 1

[State 3010, Blood]
type = Explod
trigger1 = AnimElem = 37
ID = 8053
anim = 8053
sprPriority = 1
posType = P1
scale = const(size.xScale), const(size.yScale)
ownPal = 1
ignoreHitPause = 1

[State 3010, Voice]
type = PlaySnd
trigger1 = AnimElem = 17
value = 3010,0
channel = 0

[State 3010, Blood draining sound]
type = PlaySnd
trigger1 = AnimElem = 17
value = 3010,1
channel = 1

[State 3010, RemoveExplod]
type = RemoveExplod
trigger1 = !AnimTime
ID = 8052

[State 3010, End]
type = ChangeState
trigger1 = !AnimTime
value = 3011


;Finish
[StateDef 3011]
type = S
anim = 3011
physics = N
moveType = A
velSet = 0,0
sprPriority = 5

[State 3011, EX Flash]
type = VarSet
triggerAll = !var(40)
trigger1 = !Time
var(24) = 78

[State 3011, TargetState: Transformed, dead]
type = TargetState
trigger1 = !Time && NumTarget
value = 3018

[State 3011, P2 get hit sound]
type = PlaySnd
trigger1 = !Time && NumTarget && !var(10)
value = 9021,0

[State 3011, TargetBind 1]
type = TargetBind
triggerAll = NumTarget
trigger1 = !Time
pos = ceil(37 * const(size.xScale)), ceil(-137 * const(size.yScale))

[State 3011, TargetBind 1]
type = TargetBind
triggerAll = NumTarget
trigger1 = Time = 18
pos = ceil(37 * const(size.xScale)), ceil(-82 * const(size.yScale))

[State 3011, TargetState: finish]
type = TargetState
trigger1 = Time = 18 && NumTarget
value = 51037

[State 3011, Flames]
type = Helper
trigger1 = Time = 18 && NumTarget
trigger1 = var(43) := (Target, ID)
helperType = Normal
stateNo = 8150
ID = ifElse(Target, SelfAnimExist(7697), 8150, 8155)
name = "Flames"
posType = P2
size.xScale = const(size.xScale) * 0.5
size.yScale = 0.5
ownPal = 1
ignoreHitPause = 1

[State 3011, Damage]
type = TargetLifeAdd
trigger1 = Time = 18 && NumTarget
value = floor(ifElse(91 * fvar(11) < 7, -7, -91 * fvar(11)))

[State 3011, TargetPowerAdd]
type = TargetPowerAdd
trigger1 = Time = 18 && NumTarget
value = 36

[State 3011, HitAdd]
type = HitAdd
trigger1 = Time = 18 && NumTarget
value = 1

[State 3011, VarAdd]
type = VarAdd
trigger1 = Time = 18 && NumTarget
var(13) = 1

[State 3011, Juggle]
type = VarAdd
trigger1 = Time = 18 && NumTarget
var(15) = 1
ignoreHitPause = 1

[State 3011, Juggle]
type = VarSet
trigger1 = Time = 18 && NumTarget
var(16) = 1
ignoreHitPause = 1

[State 3011, Warp sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1200,0
channel = 1

[State 3011, VelSet]
type = VelSet
trigger1 = AnimElem = 3
x = -3.75

[State 3011, VelSet]
type = VelSet
trigger1 = AnimElem = 13
x = 0

[State 3011, Voice]
type = PlaySnd
trigger1 = AnimElem = 11
value = 3011,0
channel = 0

[State 3011, Kiss sound]
type = PlaySnd
trigger1 = AnimElem = 11
value = 3011,1
channel = 3

[State 3011, Heart]
type = Explod
trigger1 = AnimElem = 11
anim = 13011
ID = 13011
bindTime = -1
sprPriority = 6
posType = P1
scale = const(size.xScale), const(size.yScale)
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 3011, End]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1


;CFJ-style Bliss
[StateDef 3020]
type = S
anim = 3020
physics = N
moveType = A
velSet = 0,0

[State 3020, EX Flash]
type = VarSet
triggerAll = !var(40)
trigger1 = !Time
var(24) = 96

[State 3020, Lost Target]
type = ChangeState
trigger1 = !Time && !NumTarget
value = 0
ctrl = 1

[State 3020, Voice]
type = PlaySnd
trigger1 = !Time
value = 3010,0
channel = 0

[State 3020, Cape sound]
type = PlaySnd
trigger1 = !Time
value = 3020,0
channel = 1

[State 3020, AllPalFX]
type = AllPalFX
trigger1 = AnimElem = 6
time = 4
sinAdd = -255, -255, -255, 16

[State 3020, BGPalFX]
type = BGPalFX
trigger1 = AnimElemTime(7) = -1
time = 72
add = -256,-256,-256

[State 3020, AssertSpecial: NoBarDisplay]
type = AssertSpecial
trigger1 = AnimElemTime(7) >= 0 && AnimTime
flag = NoBarDisplay
flag = NoFG
flag = NoBG

[State 3020, TargetState: invisible]
type = TargetState
trigger1 = AnimElem = 7
value = 3025

[State 3020, Bite sound]
type = PlaySnd
trigger1 = AnimElemTime(7) = 5
trigger2 = AnimElemTime(7) = 27
trigger3 = AnimElemTime(7) = 36
value = 3020,1

[State 3020, EnvColor]
type = EnvColor
trigger1 = AnimElemTime(7) = 5
trigger2 = AnimElemTime(7) = 27
trigger3 = AnimElemTime(7) = 36
value = 255,255,255
time = 4
under = 1
ignoreHitPause = 1
persistent = 1

[State 3020, Blood (Upwards spray)]
type = Explod
triggerAll = NumTarget
trigger1 = AnimElemTime(7) = 5
trigger2 = AnimElemTime(7) = 27
trigger3 = AnimElemTime(7) = 36
anim = ifElse(AnimElemTime(7) = 27, 8055, 8054)
sprPriority = 2
posType = P1
pos = ceil(42 * const(size.xScale)), ceil(-81 * const(size.yScale))
scale = const(size.xScale), 1
ownPal = 1
ignoreHitPause = 1

[State 3020, End]
type = ChangeState
trigger1 = !AnimTime
value = 3021


;CFJ-style Finish
[StateDef 3021]
type = S
physics = N
moveType = A
velSet = 0,0

[State 3021, EX Flash]
type = VarSet
triggerAll = !var(40)
trigger1 = !Time
var(24) = 37

[State 3021, TargetState: on the floor]
type = TargetState
trigger1 = !Time
value = 3026

[State 3021, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 3011
elem = 3

[State 3021, Damage]
type = TargetLifeAdd
trigger1 = !Time && NumTarget
value = floor(ifElse(210 * fvar(11) < 7, -7, -210 * fvar(11)))

[State 3021, TargetPowerAdd]
type = TargetPowerAdd
trigger1 = !Time && NumTarget
value = 36

[State 3021, HitAdd]
type = HitAdd
trigger1 = !Time && NumTarget
value = 1

[State 3021, VarAdd]
type = VarAdd
trigger1 = !Time && NumTarget
var(13) = 1

[State 3021, Juggle]
type = VarAdd
trigger1 = !Time && NumTarget
var(15) = 1
ignoreHitPause = 1

[State 3021, Juggle]
type = VarSet
trigger1 = !Time && NumTarget
var(16) = 1
ignoreHitPause = 1

[State 3021, Warp sound]
type = PlaySnd
trigger1 = !Time
value = 1200,0
channel = 1

[State 3021, Dust cloud 1]
type = Explod
trigger1 = !Time
anim = 3025
sprPriority = 3
posType = P1
pos = ceil(19 * const(size.xScale)), ceil(-80 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3021, Dust cloud 1 (Bottom layer)]
type = Explod
trigger1 = !Time
anim = 3026
sprPriority = 3
posType = P1
pos = ceil(19 * const(size.xScale)), ceil(-80 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3021, Dust cloud 2]
type = Explod
trigger1 = !Time
anim = 3025
sprPriority = 3
posType = P1
pos = ceil(87 * const(size.xScale)), ceil(-60 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3021, Dust cloud 2 (Bottom layer)]
type = Explod
trigger1 = !Time
anim = 3026
sprPriority = 3
posType = P1
pos = ceil(87 * const(size.xScale)), ceil(-60 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3021, Dust cloud 3]
type = Explod
trigger1 = AnimElemTime(2) = 3
anim = 3025
sprPriority = 3
posType = P1
pos = ceil(35 * const(size.xScale)), ceil(-32 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3021, Dust cloud 3 (Bottom layer)]
type = Explod
trigger1 = AnimElemTime(2) = 3
anim = 3026
sprPriority = 3
posType = P1
pos = ceil(35 * const(size.xScale)), ceil(-32 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3021, Dust cloud 4]
type = Explod
trigger1 = !Time
anim = 3025
sprPriority = 2
posType = P1
pos = ceil(3 * const(size.xScale)), ceil(-40 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3021, Dust cloud 4 (Bottom layer)]
type = Explod
trigger1 = !Time
anim = 3026
sprPriority = 2
posType = P1
pos = ceil(3 * const(size.xScale)), ceil(-40 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3021, Dust cloud 5]
type = Explod
trigger1 = !Time
anim = 3025
sprPriority = 2
posType = P1
pos = ceil(99 * const(size.xScale)), ceil(-56 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3021, Dust cloud 5 (Bottom layer)]
type = Explod
trigger1 = !Time
anim = 3026
sprPriority = 2
posType = P1
pos = ceil(99 * const(size.xScale)), ceil(-56 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3021, Dust cloud 6]
type = Explod
trigger1 = !Time
anim = 3025
sprPriority = 2
posType = P1
pos = ceil(59 * const(size.xScale)), ceil(-16 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3021, Dust cloud 6 (Bottom layer)]
type = Explod
trigger1 = !Time
anim = 3026
sprPriority = 2
posType = P1
pos = ceil(59 * const(size.xScale)), ceil(-16 * const(size.yScale))
scale = const(size.xScale) * 0.5,0.5
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1
[State 3021, VelSet]
type = VelSet
trigger1 = !Time
x = -3.75

[State 3021, VelSet]
type = VelSet
trigger1 = AnimElem = 13
x = 0

[State 3021, Voice]
type = PlaySnd
trigger1 = AnimElem = 11
value = 3011,0
channel = 0

[State 3021, Kiss sound]
type = PlaySnd
trigger1 = AnimElem = 11
value = 3011,1
channel = 3

[State 3011, End]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1



;===========<MIDNIGHT BLISS (TARGET)>==========
;Standing
[StateDef 3015]
type = S
moveType = H
physics = N
velSet = 0,0
sprPriority = 0

[State 3015, ChangeAnim]
type = ChangeAnim
trigger1 = 1
value = 5000

[State 3015, Turn]
type = Turn
trigger1 = !Time
trigger1 = NumEnemy
trigger1 = Facing = EnemyNear, Facing
ignoreHitPause = 1

[State 3015, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
moveCamera = 0,0
ignoreHitPause = 1


;Transformed, standing
[StateDef 3016]
type = S
moveType = H
physics = N
velSet = 0,0
sprPriority = 0

[State 3016, Generic Bliss]
type = ChangeAnim2
trigger1 = !Time
trigger1 = !(SelfAnimExist(99020)) && !(SelfAnimExist(9020)) && !(SelfAnimExist(9025)) && !(SelfAnimExist(66660))
trigger1 = !(SelfAnimExist(9021)) && !(SelfAnimExist(9022))
value = 1

[State 3016, CFJ Bliss]
type = ChangeAnim
trigger1 = !Time && SelfAnimExist(9021)
trigger2 = Anim = 9021
value = 9021

[State 3016, CFJ Bliss]
type = ChangeAnim
trigger1 = !Time && SelfAnimExist(9022)
trigger2 = Anim = 9022
value = 9022

[State 3016, Standard Bliss]
type = ChangeAnim
trigger1 = !Time && SelfAnimExist(9020)
trigger2 = Anim = 9020
value = 9020
elem = 1

[State 3016, ex-inferis Bliss]
type = ChangeAnim
trigger1 = !Time && SelfAnimExist(66660)
value = 66660

[State 3016, Gal129 Bliss]
type = ChangeAnim
trigger1 = !Time && SelfAnimExist(9025)
value = 9025

[State 3016, VS Bliss]
type = ChangeAnim
trigger1 = !Time && SelfAnimExist(99020)
value = 99020

[State 3016, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
moveCamera = 0,0
ignoreHitPause = 1


;Transformed, being drained
[StateDef 3017]
type = A
moveType = H
physics = N
velSet = 0,0
sprPriority = 0

[State 3017, Standard Bliss]
type = ChangeAnim
trigger1 = Anim = 9020
trigger1 = Time < 38
value = 9020
elem = 2

[State 3017, Standard Bliss]
type = ChangeAnim
trigger1 = Anim = 9020
trigger1 = (Time > 39 && Time <= 41) || (Time > 42 && Time <= 44) || (Time > 45 && Time <= 54) || (Time > 55 && Time <= 57) || (Time > 58 && Time <= 60)
value = 9020
elem = 3

[State 3017, Standard Bliss]
type = ChangeAnim
trigger1 = Anim = 9020
trigger1 = (Time = 39) || (Time = 45) || (Time = 55) || (Time = 58) || (Time = 63) || (Time = 73) || (Time = 76) || (Time = 79) || (Time = 82) || (Time = 85) || (Time = 88)
value = 9020
elem = 4

[State 3017, Standard Bliss]
type = ChangeAnim
trigger1 = Anim = 9020
trigger1 = (Time > 60 && Time <= 62) || (Time > 63 && Time <= 72) || (Time > 73 && Time <= 75) || (Time > 79 && Time <= 82) || (Time > 82 && Time <= 84) || (Time > 85 && Time <= 87) || (Time > 88)
value = 9020
elem = 5

[State 3016, ex-inferis Bliss]
type = ChangeAnim
trigger1 = !Time && SelfAnimExist(66661)
value = 66661

[State 3016, ex-inferis Bliss]
type = ChangeAnim
trigger1 = Anim = 66661 || Anim = 66662
trigger1 = Time = 50
value = 66662

[State 3017, Gal129 Bliss]
type = ChangeAnim
trigger1 = !Time && SelfAnimExist(9026)
value = 9026

[State 3017, Gal129 Bliss]
type = ChangeAnim
trigger1 = Anim = 9026
trigger1 = Time < 8
value = 9026
elem = 1

[State 3017, Gal129 Bliss]
type = ChangeAnim
trigger1 = Anim = 9026
trigger1 = Time >= 8 && Time < 38
value = 9026
elem = 2

[State 3017, Gal129 Bliss]
type = ChangeAnim
trigger1 = Anim = 9026
trigger1 = Time >= 38 && Time < 60
value = 9026
elem = 3

[State 3017, Gal129 Bliss]
type = ChangeAnim
trigger1 = Anim = 9026
trigger1 = Time >= 60
value = 9026
elem = 4

[State 3017, VS Bliss]
type = ChangeAnim
trigger1 = !Time && SelfAnimExist(99021)
value = 99021

[State 3017, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
moveCamera = 0,0
ignoreHitPause = 1


;Transformed, dead
[StateDef 3018]
type = A
moveType = H
physics = N
velSet = 0,0
sprPriority = 0

[State 3018, Standard Bliss]
type = ChangeAnim
trigger1 = Anim = 9020
value = 9020
elem = 6

[State 3016, ex-inferis Bliss]
type = ChangeAnim
trigger1 = Anim = 66662
value = 66662
elem = 4

[State 3018, Gal129 Bliss]
type = ChangeAnim
trigger1 = Anim = 9026
value = 9026
elem = 5

[State 3018, VS Bliss]
type = ChangeAnim
trigger1 = !Time && SelfAnimExist(99022)
value = 99022

[State 3018, Voice]
type = PlaySnd
trigger1 = !Time
value = 9021,0
channel = 0

[State 3018, Voice]
type = PlaySnd
trigger1 = !Time
value = 9020,100
channel = 0

[State 3018, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
moveCamera = 0,0
ignoreHitPause = 1

[State 3018, PalFX]
type = PalFX
trigger1 = Time = 17 && !SelfAnimExist(7697)
time = 40
mul = 128,128,128
sinadd = 96, 96, 96, 4
invertall = 0
color = 256
ignoreHitPause = 1


;CFJ-style, invisible
[StateDef 3025]
type = L
moveType = H
physics = N
velSet = 0,0
sprPriority = 0

[State 3025, Generic Bliss]
type = ChangeAnim2
trigger1 = !Time
value = 1

[State 3025, Voice]
type = PlaySnd
trigger1 = Time = 10
value = 9021,0
channel = 0

[State 3025, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
moveCamera = 0,0
ignoreHitPause = 1


;CFJ-style, on the floor
[StateDef 3026]
type = L
moveType = H
physics = C
velSet = 0,0

[State 3026, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 5080

[State 3026, VarSet]
type = VarSet
trigger1 = !Time
sysvar(0) = 1

[State 3026, ChangeState]
type = ChangeState
trigger1 = Time >= 32 && Alive
value = 3027

[State 3026, SelfState]
type = SelfState
trigger1 = Time >= 32 && !Alive
value = 5150


;Recover
[StateDef 3027]
type = L
moveType = H
physics = N

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

[State 3027, ChangeAnim]
type = ChangeAnim
trigger1 = SelfAnimExist(5110 + (Anim % 10))
trigger1 = Anim = [5081,5089]
value = 5110 + (Anim % 10)
persistent = 0

[State 3027, ChangeAnim]
type = ChangeAnim
triggerAll = !Time
triggerAll = Anim != [5110,5119]
trigger1 = Anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (Anim % 10))
value = 5170

[State 3027, ChangeAnim]
type = ChangeAnim
triggerAll = !Time
triggerAll = Anim != [5110,5119]
trigger1 = Anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (Anim % 10))
value = 5170 + (Anim % 10)

[State 3027, HitFallDamage]
type = HitFallDamage
trigger1 = !Time

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

[State 3027, VarSet]
type = VarSet
trigger1 = !Time
trigger1 = GetHitVar(fall.yVel) != 0
sysvar(1) = floor(vel y)

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

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

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

[State 3027, ChangeAnim]
type = ChangeAnim
triggerAll = Anim = [5171,5179]
triggerAll = SelfAnimExist(5110 + (Anim % 10))
trigger1 = !AnimTime
trigger2 = sysvar(0)
value = 5110 + (Anim % 10)
persistent = 0

[State 3027, ChangeAnim]
type = ChangeAnim
triggerAll = Anim != [5111,5119]
trigger1 = !AnimTime
trigger2 = sysvar(0)
value = 5110
persistent = 0

[State 3027, SelfState]
type = SelfState
triggerAll = !Alive
trigger1 = !AnimTime
trigger2 = sysvar(0)
trigger3 = Anim = [5110,5119]
value = 5150

[State 3027, VarSet]
type = VarSet
trigger1 = sysvar(0)
trigger1 = !Time
sysvar(0) = 0

[State 3027, VelMul]
type = VelMul
trigger1 = 1
x = 0.85

[State 3027, VelSet]
type = VelSet
trigger1 = abs(vel x) < const(movement.down.friction.threshold)
persistent = 0
x = 0

[State 3027, SelfState]
type = SelfState
trigger1 = Time = 82
value = 5120



;========================<DEMON BILLION>=============================
[StateDef 3100]
type = S
physics = N
moveType = A
anim = 3100
ctrl = 0
velSet = 0,0
sprPriority = 1
powerAdd = -1000
faceP2 = ifElse((PrevStateNo = [100,106]), 0, 1)

[State 3100, Super Cancel Flag]
type = VarSet
trigger1 = !Time
var(21) = ((PrevStateNo = [1000,2999]) && var(7))

[State 3100, Corner Push]
type = VarSet
trigger1 = Time = 3
fvar(5) = 0

[State 3100, Unguardable]
type = VarSet
triggerAll = var(40)
trigger1 = Time = 3 && NumEnemy
trigger1 = (EnemyNear, StateNo != [120,155])
var(17) = 43

[State 3100, Super Cancel Flash]
type = PalFX
trigger1 = var(21) || var(22)
trigger1 = !(Time % 2) && Time <= 12
time = 1
add = 255,255,255
ignoreHitPause = 1

[State 3100, Super Cancel Juggle]
type = VarSet
trigger1 = !Time
trigger1 = var(21) || var(22)
var(15) = 0
ignoreHitPause = 1

[State 3100, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(10) < 0
time = 1
value = SCA

[State 3100, Super Pause FX]
type = Helper
triggerAll = var(40)
trigger1 = Time = 3
helperType = Normal
stateNo = 8500
ID = 8500
name = "Superpause FX"
posType = P1
pos = ceil(12 * const(size.xScale)), ceil(-72 * const(size.yScale))
superMoveTime = 255
size.xScale = 1
size.yScale = 1
ownPal = 1

[State 3100, SuperPause]
type = SuperPause
triggerAll = var(40)
trigger1 = Time = 3
time = 43
moveTime = 0
p2DefMul = 1
unHittable = 1
anim = -1
sound = s8500,0
darken = 0

[State 3100, EX FX]
type = Explod
trigger1 = !Time && !var(40)
anim = 8210
sprPriority = 3
posType = p1
pos = ceil(12 * const(size.xScale)), ceil(-72 * const(size.yScale))
scale = 0.5, 0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 3100, EX Startup Sound]
type = PlaySnd
trigger1 = !Time && !var(40)
value = 0,1000
channel = 1

[State 3100, EX Flash]
type = VarSet
triggerAll = !var(40)
trigger1 = !Time
var(24) = 86

[State 3100, Bat Velocity Flag Off]
type = VarSet
trigger1 = !Time
var(10) = 0

[State 3100, Voice]
type = PlaySnd
trigger1 = !Time
value = 3100,0
channel = 0

[State 3100, Bat HitCount Reset]
type = VarSet
trigger1 = !Time
var(41) = 0

[State 3100, Projectile 1]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3105
name = "Demon Billion Projectile 1"
posType = P1
pos = ceil(0 * const(size.xScale)), ceil(0 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 2]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3106
name = "Demon Billion Projectile 2"
posType = P1
pos = ceil(19 * const(size.xScale)), ceil(-12 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 3]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3107
name = "Demon Billion Projectile 3"
posType = P1
pos = ceil(-13 * const(size.xScale)), ceil(-14 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 4]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3108
name = "Demon Billion Projectile 4"
posType = P1
pos = ceil(36 * const(size.xScale)), ceil(-32 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 5]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3109
name = "Demon Billion Projectile 5"
posType = P1
pos = ceil(-2 * const(size.xScale)), ceil(-34 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 6]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3110
name = "Demon Billion Projectile 6"
posType = P1
pos = ceil(-30 * const(size.xScale)), ceil(-36 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 7]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3111
name = "Demon Billion Projectile 7"
posType = P1
pos = ceil(-20 * const(size.xScale)), ceil(-50 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 8]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3112
name = "Demon Billion Projectile 8"
posType = P1
pos = ceil(-52 * const(size.xScale)), ceil(-48 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 9]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3113
name = "Demon Billion Projectile 9"
posType = P1
pos = ceil(12 * const(size.xScale)), ceil(-56 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 10]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3114
name = "Demon Billion Projectile 10"
posType = P1
pos = ceil(-34 * const(size.xScale)), ceil(-64 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 11]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3115
name = "Demon Billion Projectile 11"
posType = P1
pos = ceil(2 * const(size.xScale)), ceil(-68 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 12]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3116
name = "Demon Billion Projectile 12"
posType = P1
pos = ceil(34 * const(size.xScale)), ceil(-70 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 13]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3117
name = "Demon Billion Projectile 13"
posType = P1
pos = ceil(-18 * const(size.xScale)), ceil(-80 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 14]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3118
name = "Demon Billion Projectile 14"
posType = P1
pos = ceil(-50 * const(size.xScale)), ceil(-86 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 15]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3119
name = "Demon Billion Projectile 15"
posType = P1
pos = ceil(18 * const(size.xScale)), ceil(-92 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, Projectile 16]
type = Helper
trigger1 = AnimElem = 5
helperType = Normal
stateNo = 3105
ID = 3120
name = "Demon Billion Projectile 16"
posType = P1
pos = ceil(0 * const(size.xScale)), ceil(-96 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3100, PlayerPush]
type = PlayerPush
trigger1 = AnimElemTime(11) >= 0 && AnimElemTime(14) < -5
value = 0
ignoreHitPause = 1

[State 3100, Bat Velocity Flag On]
type = VarSet
trigger1 = AnimElemTime(12) = 1
var(10) = 1
ignoreHitPause = 1

[State 3100, Flapping wings sound]
type = PlaySnd
trigger1 = AnimElemTime(12) = 1
trigger2 = AnimElemTime(12) = 14
value = 3100,1

[State 3100, VelSet]
type = VelSet
trigger1 = AnimElem = 13
x = 12.5

[State 3100, VelSet]
type = VelSet
trigger1 = AnimElemTime(14) = -5
x = 0

[State 3100, StateTypeSet: Idle]
type = StateTypeSet
trigger1 = AnimElemTime(14) >= -5
moveType = I

[State 3100, End]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1



;========================<DEMON BLAST>=============================
[StateDef 3150]
type = S
physics = N
moveType = A
anim = 3150
ctrl = 0
velSet = 0,0
sprPriority = 1
powerAdd = -1000
faceP2 = ifElse((PrevStateNo = [100,106]), 0, 1)

[State 3150, Super Cancel Flag]
type = VarSet
trigger1 = !Time
var(21) = ((PrevStateNo = [1000,2999]) && var(7))

[State 3150, Corner Push]
type = VarSet
trigger1 = time = 3
fvar(5) = 0

[State 3150, Unguardable]
type = VarSet
triggerAll = var(40)
trigger1 = Time = 3 && NumEnemy
trigger1 = (EnemyNear, StateNo != [120,155])
var(17) = 43

[State 3150, Super Cancel Flash]
type = PalFX
trigger1 = var(21) || var(22)
trigger1 = !(Time % 2) && Time <= 12
time = 1
add = 255,255,255
ignoreHitPause = 1

[State 3150, Super Cancel Juggle]
type = VarSet
trigger1 = !Time
trigger1 = var(21) || var(22)
var(15) = 0
ignoreHitPause = 1

[State 3150, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(4) < 0
time = 1
value = SCA

[State 3150, Super Pause FX]
type = Helper
triggerAll = var(40)
trigger1 = Time = 3
helperType = Normal
stateNo = 8510
ID = 8500
name = "Superpause FX"
posType = P1
pos = ceil(12 * const(size.xScale)), ceil(-72 * const(size.yScale))
superMoveTime = 255
size.xScale = 1
size.yScale = 1
ownpal = 1

[State 3150, Super Pause]
type = SuperPause
triggerAll = var(40)
trigger1 = Time = 3
time = 43
moveTime = 0
p2DefMul = 1
unHittable = 1
anim = -1
sound = s8500,0
darken = 0

[State 3150, EX FX]
type = Explod
trigger1 = !Time && !var(40)
anim = 8210
sprPriority = 3
posType = p1
pos = ceil(12 * const(size.xScale)), ceil(-72 * const(size.yScale))
scale = 0.5, 0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 3150, EX Startup Sound]
type = PlaySnd
trigger1 = !Time && !var(40)
value = 0,1000
channel = 1

[State 3150, EX Flash]
type = VarSet
triggerAll = !var(40)
trigger1 = !Time
var(24) = 82

[State 3150, Voice]
type = PlaySnd
trigger1 = !Time
value = 3150,0
channel = 0

[State 3150, Flapping wings sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = 3100,1
channel = 3

[State 3150, Bat HitCount Reset]
type = VarSet
trigger1 = !Time
var(41) = 0

[State 3150, Projectile 1]
type = Helper
trigger1 = AnimElem = 3
helperType = Normal
stateNo = 3155
ID = 3155
name = "Demon Blast Projectile 1"
posType = P1
pos = ceil(31 * const(size.xScale)), ceil(-46 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3150, Projectile 2]
type = Helper
trigger1 = AnimElem = 3
helperType = Normal
stateNo = 3155
ID = 3156
name = "Demon Blast Projectile 2"
posType = P1
pos = ceil(8 * const(size.xScale)), ceil(-51 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3150, Projectile 3]
type = Helper
trigger1 = AnimElem = 3
helperType = Normal
stateNo = 3155
ID = 3157
name = "Demon Blast Projectile 3"
posType = P1
pos = ceil(11 * const(size.xScale)), ceil(-70 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3150, Projectile 4]
type = Helper
trigger1 = AnimElem = 3
helperType = Normal
stateNo = 3155
ID = 3158
name = "Demon Blast Projectile 4"
posType = P1
pos = ceil(28 * const(size.xScale)), ceil(-91 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3150, Projectile 5]
type = Helper
trigger1 = AnimElem = 3
helperType = Normal
stateNo = 3155
ID = 3159
name = "Demon Blast Projectile 5"
posType = P1
pos = ceil(-44 * const(size.xScale)), ceil(-38 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3150, Projectile 6]
type = Helper
trigger1 = AnimElem = 3
helperType = Normal
stateNo = 3155
ID = 3160
name = "Demon Blast Projectile 6"
posType = P1
pos = ceil(-4 * const(size.xScale)), ceil(-50 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3150, Projectile 7]
type = Helper
trigger1 = AnimElem = 3
helperType = Normal
stateNo = 3155
ID = 3161
name = "Demon Blast Projectile 7"
posType = P1
pos = ceil(-22 * const(size.xScale)), ceil(-75 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3150, Projectile 8]
type = Helper
trigger1 = AnimElem = 3
helperType = Normal
stateNo = 3155
ID = 3162
name = "Demon Blast Projectile 8"
posType = P1
pos = ceil(-63 * const(size.xScale)), ceil(-87 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3150, StateTypeSet: Idle]
type = StateTypeSet
trigger1 = AnimElemTime(50) >= 0
moveType = I

[State 3150, End]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1



;========================<DARKSIDE MASTER>=============================
[StateDef 3200]
type = S
physics = S
moveType = A
anim = ifElse(var(40), 3201, 3200)
ctrl = 0
velSet = 0,0
sprPriority = 1
powerAdd = -1000
faceP2 = ifElse((PrevStateNo = [100,106]), 0, 1)

[State 3200, Super Cancel Flag]
type = VarSet
trigger1 = !Time
var(21) = ((PrevStateNo = [1000, 2999]) && var(7))

[State 3200, Corner Push]
type = VarSet
triggerAll = var(40)
trigger1 = Time = 3
fvar(5) = 0

[State 3200, Unguardable]
type = VarSet
triggerAll = var(40)
trigger1 = Time = 3 && NumEnemy
trigger1 = (EnemyNear, StateNo != [120,155])
var(17) = 43

[State 3200, Super Cancel Flash]
type = PalFX
trigger1 = var(21) || var(22)
trigger1 = !(Time % 2) && Time <= 12
time = 1
add = 255,255,255
ignoreHitPause = 1

[State 3200, Super Cancel Juggle]
type = VarSet
trigger1 = !Time
trigger1 = var(21) || var(22)
var(15) = 0
ignoreHitPause = 1

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

[State 3200, SuperPause FX]
type = Helper
triggerAll = var(40)
trigger1 = Time = 3
helperType = Normal
stateNo = 8500
ID = 8500
name = "Superpause FX"
posType = P1
pos = ceil(5 * const(size.xScale)), ceil(-62 * const(size.yScale))
superMoveTime = 255
size.xScale = 1
size.yScale = 1
ownPal = 1

[State 3200, SuperPause]
type = SuperPause
triggerAll = var(40)
trigger1 = Time = 3
time = 43
moveTime = 43
p2DefMul = 1
unHittable = 1
anim = -1
sound = s8500,0
darken = 0

[State 3200, Voice channel override timer]
type = VarSet
triggerAll = !var(40)
trigger1 = !Time
var(48) = GameTime

[State 3200, Voice]
type = PlaySnd
trigger1 = !Time
value = 3200,0
channel = 0

[State 3200, Voice]
type = PlaySnd
trigger1 = !Time
value = 3200,0
channel = 12

[State 3200, Dark Force sound]
type = PlaySnd
triggerAll = !var(40)
trigger1 = !Time
value = 8400,0
channel = 1

[State 3200, Dark Force FX]
type = Helper
triggerAll = !var(40)
trigger1 = !Time
helperType = Normal
stateNo = 8400
ID = 8400
name = "Dark Force Startup FX"
posType = P1
pos = ceil(5 * const(size.xScale)), ceil(-62 * const(size.yScale))
superMoveTime = 255
size.xScale = 1
size.yScale = 1
ownPal = 1

[State 3200, Dark Force Time]
type = VarSet
trigger1 = Time = 15 && !var(40)
trigger2 = Time = 43 && var(40)
var(20) = 338

[State 3200, Darkside Master Bat Flag]
type = VarSet
trigger1 = Time = 15 && !var(40)
trigger2 = Time = 43 && var(40)
var(49) = 0

[State 3200, Forward Bat]
type = Helper
trigger1 = Time = 15 && !var(40)
trigger2 = Time = 43 && var(40)
helperType = Normal
stateNo = 3205
ID = 3205
name = "Darkside Master Bat (Forward)"
posType = P1
pos = ceil(-40 * const(size.xScale)), ceil(-28 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3200, Rear Bat]
type = Helper
trigger1 = Time = 15 && !var(40)
trigger2 = Time = 43 && var(40)
helperType = Normal
stateNo = 3205
ID = 13205
name = "Darkside Master Bat (Rear)"
posType = P1
pos = ceil(26 * const(size.xScale)), ceil(-72 * const(size.yScale))
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3200, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1


;Finish
[StateDef 3250]
type = S
anim = 3250
ctrl = 0
physics = N
moveType = A
velSet = 0,0

[State 3250, Dark Force Time]
type = VarSet
trigger1 = !Time
var(20) = 0

[State 3250, Darkside Master Deactivation Flag]
type = VarSet
trigger1 = !Time
var(50) = 0
ignoreHitPause = 1

[State 3250, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1



;========================<MIDNIGHT PLEASURE>=============================
[StateDef 3300]
type = S
physics = N
moveType = A
anim = 3300
ctrl = 0
velSet = 0,0
sprPriority = 1
powerAdd = -3000
faceP2 = ifElse((PrevStateNo = [100,106]), 0, 1)

[State 3300, Super Cancel Flag]
type = VarSet
trigger1 = !Time
var(21) = ((PrevStateNo = [1000,2999]) && var(7))

[State 3300, Corner Push]
type = VarSet
triggerAll = var(40)
trigger1 = !Time
fvar(5) = 0

[State 3300, Unguardable]
type = VarSet
triggerAll = var(40)
trigger1 = !Time && NumEnemy
trigger1 = (EnemyNear, StateNo != [120,155])
var(17) = 47

[State 3300, Super Cancel Flash]
type = PalFX
trigger1 = var(21) || var(22)
trigger1 = !(Time % 2) && Time <= 12
time = 1
add = 255,255,255
ignoreHitPause = 1

[State 3300, Super Cancel Juggle]
type = VarSet
trigger1 = !Time
trigger1 = var(21) || var(22)
var(15) = 0
ignoreHitPause = 1

[State 3300, Super Pause FX]
type = Helper
triggerAll = var(40)
trigger1 = !Time
helperType = Normal
stateNo = 8520
ID = 8500
name = "Superpause FX"
posType = p1
pos = ceil(18 * const(size.xScale)), ceil(-79 * const(size.yScale))
superMoveTime = 255
size.xScale = 1
size.yScale = 1
ownpal = 1

[State 3300, Super Pause]
type = SuperPause
triggerAll = var(40)
trigger1 = !Time
time = 47
moveTime = 0
p2DefMul = 1
unHittable = 1
anim = -1
sound = s8500,0
darken = 0

[State 3300, EX Flash]
type = VarSet
triggerAll = !var(40)
trigger1 = !Time
var(24) = 24

[State 3300, EX FX]
type = Explod
trigger1 = !Time && !var(40)
anim = 8210
sprPriority = 3
posType = p1
pos = ceil(18 * const(size.xScale)), ceil(-79 * const(size.yScale))
scale = 0.5, 0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 3300, EX Startup Sound]
type = PlaySnd
trigger1 = !Time && !var(40)
value = 0,1000
channel = 1

[State 3300, Warp sound]
type = PlaySnd
trigger1 = !Time && !var(40)
trigger2 = Time = 1 && var(40)
value = 3000,1
channel = 3

[State 3300, VarSet]
type = VelSet
trigger1 = !Time
x = 3.75

[State 3300, HitDef]
type = HitDef
trigger1 = AnimElemTime(2) >= 0
trigger1 = !var(38)
attr = S, HT
hitFlag = M
priority = 7, Miss
getPower = 0,0
givePower = 0,0
sparkNo = -1 + 0 * (var(33) := 0)
guard.sparkNo = -1 + 0 * (var(34) := 8001)
sparkXY = -10 + 0 * (var(35) := 40), var(36) := -50
hitSound = -1 +0 * (var(31) := 800)
guardSound = -1 +0 * (var(32) := 0)
fall = 0
numHits = 0
p1StateNo = 3310

[State 3300, End]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1


;Success
[StateDef 3310]
type = S
anim = 3310
physics = N
moveType = A
velSet = 0,0

[State 3310, EX Flash]
type = VarSet
triggerAll = !var(40)
trigger1 = !Time
var(24) = 86

[State 3310, Lost Target]
type = ChangeState
trigger1 = !Time && !NumTarget
value = 0
ctrl = 1

[State 3310, TargetState]
type = TargetState
trigger1 = !Time && NumTarget
value = 3315

[State 3310, TargetBind]
type = TargetBind
trigger1 = NumTarget && AnimElemTime(27) < 0
pos = ceil(42 * const(size.xScale)), 0

[State 3310, Damage]
type = TargetLifeAdd
triggerAll = NumTarget
trigger1 = AnimElem = 3 || AnimElem = 6 || AnimElem = 9 || AnimElem = 12 || AnimElem = 15 || AnimElem = 18 || AnimElem = 21 || AnimElem = 24
value = floor(ifElse(21 * fvar(11) < 7, -7, -21 * fvar(11)))
kill = 0

[State 3310, TargetPowerAdd]
type = TargetPowerAdd
triggerAll = NumTarget
trigger1 = HitCount = 1
trigger1 = AnimElem = 3 || AnimElem = 6 || AnimElem = 9 || AnimElem = 12 || AnimElem = 15 || AnimElem = 18 || AnimElem = 21 || AnimElem = 24
value = 36

[State 3310, HitAdd]
type = HitAdd
triggerAll = NumTarget
trigger1 = AnimElem = 3 || AnimElem = 6 || AnimElem = 9 || AnimElem = 12 || AnimElem = 15 || AnimElem = 18 || AnimElem = 21 || AnimElem = 24
value = 1

[State 3310, Hit Count Increment]
type = VarAdd
triggerAll = NumTarget
trigger1 = AnimElem = 3 || AnimElem = 6 || AnimElem = 9 || AnimElem = 12 || AnimElem = 15 || AnimElem = 18 || AnimElem = 21 || AnimElem = 24
var(13) = 1

[State 3310, Hit Sound]
type = PlaySnd
triggerAll = NumTarget
trigger1 = AnimElem = 3 || AnimElem = 6 || AnimElem = 9 || AnimElem = 12 || AnimElem = 15 || AnimElem = 18 || AnimElem = 21 || AnimElem = 24
value = 2,820

[State 3310, Blood (Upwards spray)]
type = Explod
triggerAll = NumTarget
trigger1 = AnimElem = 3 || AnimElem = 9 || AnimElem = 15 || AnimElem = 21
anim = 8054
sprPriority = 2
posType = P1
pos = ceil(42 * const(size.xScale)), ceil(-81 * const(size.yScale))
scale = const(size.xScale), 1
ownPal = 1
ignoreHitPause = 1

[State 3310, Blood (Horizontal spray)]
type = Explod
triggerAll = NumTarget
trigger1 = AnimElem = 6 || AnimElem = 12 || AnimElem = 18 || AnimElem = 24
anim = 8055
sprPriority = 3
posType = P1
pos = ceil(42 * const(size.xScale)), ceil(-81 * const(size.yScale))
scale = const(size.xScale), 1
ownPal = 1
ignoreHitPause = 1

[State 3310, Hit 9]
type = HitDef
trigger1 = !var(16) && var(15) < 1
trigger1 = AnimElem = 27
attr = S, HA
hitFlag = MAF
guardFlag = M
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 49 < 7, 4, fvar(11) * 49)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 8,8
guard.pauseTime = 8,8
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 30
ground.slideTime = 30
guard.hitTime = 30
air.hitTime = 120
ground.velocity = 0,0
ground.cornerPush.velOff = 0
guard.velocity = 0
guard.cornerPush.velOff = 0
air.velocity = -4.32, -7.49
air.cornerPush.velOff = 0
yAccel = 0.58
fall = 0
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1 + 0 * (var(31) := 0)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0*(var(34) := 8001)
sparkXY = -10 + 0 * (var(35) := 76), var(36):= -79
palFX.time = 12 * var(9)
palFX.add = 255, 255, 255
palFX.sinAdd = -255, -255, -255, 48
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
kill = 0

[State 3310, Hit 10]
type = HitDef
trigger1 = !var(16) && var(15) < 1
trigger1 = AnimElem = 29
attr = S, HA
hitFlag = MAF
guardFlag = M
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 49 < 7, 4, fvar(11) * 49)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 4,4
guard.pauseTime = 4,4
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 30
ground.slideTime = 30
guard.hitTime = 30
air.hitTime = 120
ground.velocity = 0,0
ground.cornerPush.velOff = 0
guard.velocity = 0
guard.cornerPush.velOff = 0
air.velocity = -4.32, -7.49
air.cornerPush.velOff = 0
yAccel = 0.58
fall = 0
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1 + 0 * (var(31) := 1)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0*(var(34) := 8001)
sparkXY = -10 + 0 * (var(35) := 47), var(36) := -66
palFX.time = 12 * var(9)
palFX.add = 255, 255, 255
palFX.sinAdd = -255, -255, -255, 48
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
kill = 0

[State 3310, Hit 11]
type = HitDef
trigger1 = !var(16) && var(15) < 1
trigger1 = AnimElem = 33
attr = S, HA
hitFlag = MAF
guardFlag = M
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 49 < 7, 4, fvar(11) * 49)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 4,4
guard.pauseTime = 4,4
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 30
ground.slideTime = 30
guard.hitTime = 30
air.hitTime = 120
ground.velocity = 0,0
ground.cornerPush.velOff = 0
guard.velocity = 0
guard.cornerPush.velOff = 0
air.velocity = -4.32, -7.49
air.cornerPush.velOff = 0
yAccel = 0.58
fall = 0
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1 + 0 * (var(31) := 4)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0*(var(34) := 8001)
sparkXY = -10 + 0 * (var(35) := 75), var(36) := -50
palFX.time = 12 * var(9)
palFX.add = 255, 255, 255
palFX.sinAdd = -255, -255, -255, 48
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
kill = 0

[State 3310, Final Hit]
type = HitDef
trigger1 = !var(16) && var(15) < 1
trigger1 = AnimElem = 38
attr = S, HA
hitFlag = MAF
guardFlag = M
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 70 < 7, 4, fvar(11) * 70)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 8,8
guard.pauseTime = 8,8
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 30
ground.slideTime = 30
guard.hitTime = 30
air.hitTime = 120
ground.velocity = -5, -6.5625
ground.cornerPush.velOff = 0
guard.velocity = -12.64
guard.cornerPush.velOff = 0
air.velocity = -5, -6.5625
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.5126953125
fall = 1
fall.recover = 0
forceStand = 1
hitSound = -1 + 0 * (var(31) := 5)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0*(var(34) := 8001)
sparkXY = -10 + 0 * (var(35) := 73), var(36) := -88
palFX.time = 12 * var(9)
palFX.add = 255, 255, 255
palFX.sinAdd = -255, -255, -255, 48
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120

[State 3310, End]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1



;===========<MIDNIGHT PLEASURE (TARGET)>==========
[StateDef 3315]
type = S
moveType = H
physics = S
velSet = 0,0
sprPriority = 0

[State 3315, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 3315

[State 3315, Turn]
type = Turn
trigger1 = !Time
trigger1 = NumEnemy
trigger1 = Facing = EnemyNear, Facing
ignoreHitPause = 1

[State 3315, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
moveCamera = 0,0
ignoreHitPause = 1

[State 3315, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 3315 && !AnimTime
value = 5012
