; _________________________________________
;|  Pheromosa  by Vorse_Raidier           |
; ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
;==============================================================================================
;=======================================< HELPER STATES >========================================
;==============================================================================================

;========================<SPARKS>=============================





;Guard Spark (Normal)
[StateDef 8000]
type = A
physics = N
moveType = I
anim = 8000
velset = 0,0
sprPriority = 5

[State 8000, Assert: No Shadow]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
ignoreHitPause = 1

[State 8000, Scale]
type = AngleDraw
trigger1 = 1
scale = 0.125 + (0.046875 * Time), 0.125 + (0.046875 * Time)
ignoreHitPause = 1

[State 8000, Transparency]
type = Trans
trigger1 = Time < 4
trans = AddAlpha
alpha = 256, 256
ignoreHitPause = 1

[State 8000, Transparency]
type = Trans
trigger1 = Time >= 4
trans = AddAlpha
alpha = 256 - 64 * (Time - 4), 256
ignoreHitPause = 1

[State 8000, End]
type = DestroySelf
trigger1 = Time >= 8


;Guard Spark (Special)
[StateDef 8001]
type = A
physics = N
moveType = I
anim = 8001
velSet = 0,0
sprPriority = 5

[State 8001, Assert: NoShadow]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
ignoreHitPause = 1

[State 8001, Scale]
type = AngleDraw
trigger1 = 1
scale = 0.25 + (0.03125 * Time), 0.25 + (0.03125 * Time)
ignoreHitPause = 1

[State 8001, Transparency]
type = Trans
trigger1 = time < 4
trans = AddAlpha
alpha = 256, 256
ignoreHitPause = 1

[State 8001, Transparency]
type = Trans
trigger1 = Time >= 4
trans = AddAlpha
alpha = 256 - 64 * (Time - 4), 256
ignoreHitPause = 1

[State 8001, End]
type = DestroySelf
trigger1 = Time >= 8


;Weak Hit Spark
[StateDef 8010]
type = A
physics = N
moveType = I
anim = 8010
velSet = 0,0
sprPriority = 5

[State 8010, Assert: NoShadow]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
ignoreHitPause = 1

[State 8010, AngleSet]
type = AngleSet
trigger1 = !Time
value = 30 * (Random % 12)

[State 8010, AngleAdd]
type = AngleAdd
trigger1 = 1
value = 30

[State 8010, Scale]
type = AngleDraw
trigger1 = Time < 10
scale = 0.3 - (Time * 0.03), 0.3 - (Time * 0.03)
ignoreHitPause = 1

[State 8010, Scale]
type = AngleDraw
trigger1 = Time >= 10
scale = 0,0
ignoreHitPause = 1

[State 8010, Transparency]
type = Trans
trigger1 = 1
trans = AddAlpha
alpha = 256,256
ignoreHitPause = 1

[State 8010, Center Explod]
type = Explod
trigger1 = !Time
anim = 8011
ID = 1
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 5
removeTime = 16
pauseMoveTime = -1
superMoveTime = -1

[State 8010, Scale Center Explod]
type = ModifyExplod
trigger1 = NumExplod(1)
ID = 1
scale = 0.15 + (0.009375 * Time), 0.15 + (0.009375 * Time)
trans = AddAlpha
alpha = 256 - (16 * Time),256

[State 8010, Streaks Explod]
type = Explod
trigger1 = !Time
anim = 8012
ID = 2
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 5
removeTime = 16
pauseMoveTime = -1
superMoveTime = -1

[State 8010, Scale Streaks Explod]
type = ModifyExplod
trigger1 = NumExplod(2)
ID = 2
scale = 0.15 + (0.009375 * Time), 0.15 + (0.009375 * Time)
trans = AddAlpha
alpha = 256 - (16 * Time), 256

[State 8010, Impact Explod]
type = Explod
trigger1 = !Time
anim = 8014
ID = 4
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 3
removeTime = 8
pauseMoveTime = -1
superMoveTime = -1

[State 8010, Scale Impact Explod]
type = ModifyExplod
trigger1 = NumExplod(4)
ID = 4
scale = 0.3 - (0.0375 * Time), 0.3 - (0.0375 * Time)
trans = AddAlpha
alpha = 128 - (16 * Time), 256

[State 8010, Remove Explods]
type = RemoveExplod
trigger1 = Time >= 16

[State 8010, End]
type = DestroySelf
trigger1 = Time >= 16


;Medium Hit Spark
[StateDef 8011]
type = A
physics = N
moveType = I
anim = 8010
velSet = 0,0
sprPriority = 5

[State 8011, Assert: NoShadow]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
ignoreHitPause = 1

[State 8011, AngleSet]
type = AngleSet
trigger1 = !Time
value = 30 * (Random % 12)

[State 8011, AngleAdd]
type = AngleAdd
trigger1 = 1
value = 30

[State 8011, Scale]
type = AngleDraw
trigger1 = Time < 10
scale = 0.35 - (Time * 0.035), 0.35 - (Time * 0.035)
ignoreHitPause = 1

[State 8011, Scale]
type = AngleDraw
trigger1 = Time >= 10
scale = 0,0
ignoreHitPause = 1

[State 8011, Transparency]
type = Trans
trigger1 = 1
trans = AddAlpha
alpha = 256,256
ignoreHitPause = 1

[State 8011, Center]
type = Explod
trigger1 = !Time
anim = 8011
ID = 1
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 5
removetime = 16
pauseMoveTime = -1
superMoveTime = -1

[State 8011, Scale Center Explod]
type = ModifyExplod
trigger1 = NumExplod(1)
ID = 1
scale = 0.175 + (0.0109375 * Time), 0.175 + (0.0109375 * Time)
trans = AddAlpha
alpha = 256 - (16 * Time), 256

[State 8011, Streaks Explod]
type = Explod
trigger1 = !Time
anim = 8012
ID = 2
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 5
removeTime = 16
pauseMoveTime = -1
superMoveTime = -1

[State 8011, Scale Streaks Explod]
type = ModifyExplod
trigger1 = NumExplod(2)
ID = 2
scale = 0.175 + (0.0109375 * Time), 0.175 + (0.0109375 * Time)
trans = AddAlpha
alpha = 256 - (16 * Time), 256

[State 8011, Impact Explod]
type = Explod
trigger1 = !Time
anim = 8014
ID = 4
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 3
removeTime = 8
pauseMoveTime = -1
superMoveTime = -1

[State 8011, Scale Impact Explod]
type = ModifyExplod
trigger1 = NumExplod(4)
ID = 4
scale = 0.35 - (0.04375 * Time), 0.35 - (0.04375 * Time)
trans = AddAlpha
alpha = 128 - (16 * Time), 256

[State 8011, Remove Explods]
type = RemoveExplod
trigger1 = Time >= 16

[State 8011, End]
type = DestroySelf
trigger1 = Time >= 16


;Strong Hit Spark
[StateDef 8012]
type = A
physics = N
moveType = I
anim = 8010
velSet = 0,0
sprPriority = 5

[State 8012, Assert: NoShadow]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
ignoreHitPause = 1

[State 8012, AngleSet]
type = AngleSet
trigger1 = !Time
value = 30 * (Random % 12)

[State 8012, AngleAdd]
type = AngleAdd
trigger1 = 1
value = 30

[State 8012, Scale]
type = AngleDraw
trigger1 = Time < 10
scale = 0.4 - (Time * 0.04), 0.4 - (Time * 0.04)
ignoreHitPause = 1

[State 8012, Scale]
type = AngleDraw
trigger1 = Time >= 10
scale = 0,0
ignoreHitPause = 1

[State 8012, Transparency]
type = Trans
trigger1 = 1
trans = AddAlpha
alpha = 256,256
ignoreHitPause = 1

[State 8012, Center Explod]
type = Explod
trigger1 = !Time
anim = 8011
ID = 1
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 5
removeTime = 16
pauseMoveTime = -1
superMoveTime = -1

[State 8012, Scale Center Explod]
type = ModifyExplod
trigger1 = NumExplod(1)
ID = 1
scale = 0.2 + (0.0125 * Time), 0.2 + (0.0125 * Time)
trans = AddAlpha
alpha = 256 - (16 * Time), 256

[State 8012, Streaks Explod]
type = Explod
trigger1 = !time
anim = 8012
ID = 2
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 5
removeTime = 16
pauseMoveTime = -1
superMoveTime = -1

[State 8012, Scale Streaks Explod]
type = ModifyExplod
trigger1 = NumExplod(2)
ID = 2
scale = 0.2 + (0.0125 * Time), 0.2 + (0.0125 * Time)
trans = AddAlpha
alpha = 256 - (16 * Time), 256

[State 8012, Impact Explod]
type = Explod
trigger1 = !Time
anim = 8014
ID = 4
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 3
removeTime = 8
pauseMoveTime = -1
superMoveTime = -1

[State 8012, Scale Impact Explod]
type = ModifyExplod
trigger1 = NumExplod(4)
ID = 4
scale = 0.4 - (0.05 * Time), 0.4 - (0.05 * Time)
trans = AddAlpha
alpha = 128 - (16 * Time), 256

[State 8012, Remove Explods]
type = RemoveExplod
trigger1 = Time >= 16

[State 8012, End]
type = DestroySelf
trigger1 = Time >= 16


;Special Move Hit Spark
[StateDef 8013]
type = A
physics = N
moveType = I
anim = 8010
velSet = 0,0
sprPriority = 5

[State 8013, Assert: NoShadow]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
ignoreHitPause = 1

[State 8013, AngleSet]
type = AngleSet
trigger1 = !Time
value = 30 * (Random % 12)

[State 8013, AngleAdd]
type = AngleAdd
trigger1 = 1
value = 30

[State 8013, Scale]
type = AngleDraw
trigger1 = Time < 10
scale = 0.45 - (Time * 0.045), 0.45 - (Time * 0.045)
ignoreHitPause = 1

[State 8012, Scale]
type = AngleDraw
trigger1 = Time >= 10
scale = 0,0
ignoreHitPause = 1

[State 8013, Transparency]
type = Trans
trigger1 = 1
trans = AddAlpha
alpha = 256,256
ignoreHitPause = 1

[State 8013, Center Explod]
type = Explod
trigger1 = !Time
anim = 8011
ID = 1
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 5
removeTime = 16
pauseMoveTime = -1
superMoveTime = -1

[State 8013, Scale Center Explod]
type = ModifyExplod
trigger1 = NumExplod(1)
ID = 1
scale = 0.225 + (0.0140625 * Time), 0.225 + (0.0140625 * Time)
trans = AddAlpha
alpha = 256 - (16 * Time), 256

[State 8013, Streaks Explod]
type = Explod
trigger1 = !Time
anim = 8012
ID = 2
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 5
removeTime = 16
pauseMoveTime = -1
superMoveTime = -1

[State 8013, Scale Streaks Explod]
type = ModifyExplod
trigger1 = NumExplod(2)
ID = 2
scale = 0.225 + (0.0140625 * Time), 0.225 + (0.0140625 * Time)
trans = AddAlpha
alpha = 256 - (16 * Time), 256

[State 8013, P2 Back Explod]
type = Explod
trigger1 = !Time
anim = 8013
ID = 3
posType = P1
facing = -1
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = -3
removeTime = 8
pauseMoveTime = -1
superMoveTime = -1

[State 8013, Scale P2 Back Explod]
type = ModifyExplod
trigger1= NumExplod(3)
ID = 3
scale = 0.4, 0.4
trans = AddAlpha
alpha = 256 - (32 * Time), 256

[State 8013, Impact Explod]
type = Explod
trigger1 = !Time
anim = 8014
ID = 4
posType = P1
facing = ifElse(random < 500, -1, 1)
vFacing = ifElse(random < 500, -1, 1)
sprPriority=3
removeTime=8
pauseMoveTime = -1
superMoveTime = -1

[State 8013, Scale Impact Explod]
type = ModifyExplod
trigger1 = NumExplod(4)
ID = 4
scale = 0.45 - (0.05625 * Time), 0.45 - (0.05625 * Time)
trans = AddAlpha
alpha = 192 - (24 * Time), 256

[State 8013, Remove Explods]
type = RemoveExplod
trigger1 = Time >= 16

[State 8013, End]
type = DestroySelf
trigger1 = Time >= 16


;Super Hit Spark
[StateDef 8014]
type = A
physics = N
moveType = I
anim = 8010
velSet = 0,0
sprPriority = 5

[State 8014, Assert: NoShadow]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
ignoreHitPause = 1

[State 8014, AngleSet]
type = AngleSet
trigger1 = !Time
value = 30 * (Random % 12)

[State 8014, AngleAdd]
type = AngleAdd
trigger1 = 1
value = 30

[State 8014, Scale]
type = AngleDraw
trigger1 = Time < 10
scale = 0.5 - (Time * 0.05), 0.5 - (Time * 0.05)
ignoreHitPause = 1

[State 8014, Scale]
type = AngleDraw
trigger1 = Time >= 10
scale = 0,0
ignoreHitPause = 1

[State 8014, Transparency]
type = Trans
trigger1 = 1
trans = AddAlpha
alpha = 256,256
ignoreHitPause = 1

[State 8014, Center Explod]
type = Explod
trigger1 = !Time
anim = 8011
ID = 1
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 5
removeTime = 16
pauseMoveTime = -1
superMoveTime = -1

[State 8014, Scale Center Explod]
type = ModifyExplod
trigger1 = NumExplod(1)
ID = 1
scale = 0.25 + (0.015625 * Time), 0.25 + (0.015625 * Time)
trans = AddAlpha
alpha = 256 - (16 * Time), 256

[State 8014, Streaks Explod]
type = Explod
trigger1 = !Time
anim = 8012
ID = 2
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 5
removeTime = 16
pauseMoveTime = -1
superMoveTime = -1

[State 8014, Scale Streaks Explod]
type = ModifyExplod
trigger1 = NumExplod(2)
ID = 2
scale = 0.25 + (0.015625 * Time), 0.25 + (0.015625 * Time)
trans = AddAlpha
alpha = 256 - (16 * Time), 256

[State 8014, P2 Back Explod]
type = Explod
trigger1 = !Time
anim = 8013
ID = 3
posType = P1
facing = ifElse((Parent, StateNo = [3000,3999]), -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = -3
removeTime = 8
pauseMoveTime = -1
superMoveTime = -1

[State 8014, Scale P2 Back Explod]
type = ModifyExplod
trigger1 = NumExplod(3)
ID = 3
scale = 0.5,0.5
trans = AddAlpha
alpha = 256 - (32 * Time), 256

[State 8014, Impact Explod]
type = Explod
trigger1 = !Time
anim = 8014
ID = 4
posType = P1
facing = ifElse(Random < 500, -1, 1)
vFacing = ifElse(Random < 500, -1, 1)
sprPriority = 3
removeTime = 8
pauseMoveTime = -1
superMoveTime = -1

[State 8014, Scale Impact Explod]
type = ModifyExplod
trigger1 = NumExplod(4)
ID = 4
scale = 0.5 - (0.0625 * Time), 0.5 - (0.0625 * Time)
trans = AddAlpha
alpha = 256 - (32 * Time),256

[State 8014, Remove Explods]
type = RemoveExplod
trigger1 = time >= 16

[State 8014, End]
type = DestroySelf
trigger1 = Time >= 16


;Reversal Spark
[StateDef 8020]
type = A
physics = N
moveType = I
anim = 8020
velSet = 0,0
sprPriority = 5

[State 8020, Assert: NoShadow]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
ignoreHitPause = 1

[State 8020, Scale]
type = AngleDraw
trigger1 = 1
scale = 0.25 + (0.09375 * Time), 0.25 + (0.09375 * Time)
ignoreHitPause = 1

[State 8020, Transparency]
type = Trans
trigger1 = Time < 4
trans = AddAlpha
alpha = 256, 256
ignoreHitPause = 1

[State 8020, Transparency]
type = Trans
trigger1 = Time >= 4
trans = AddAlpha
alpha = 256 - 64 * (Time - 4), 256
ignoreHitPause = 1

[State 8020, End]
type = DestroySelf
trigger1 = Time >= 8



;Jump dust
[Statedef 8100]
type = S
anim = 1
velset = 0, 0

[State 8100, Bind]
type = bindtoroot
trigger1 = time

[State 8100, Dust]
type = explod
trigger1 = !time
anim = 8100
sprpriority = 3
postype = p1
pos = 0, ceil(pos y)
scale = 0.5, 0.5
pausemovetime = -1
supermovetime = -1
ownpal = 1

[State 8100, Dust]
type = explod
trigger1 = !time || time = 2 || time = 6
anim = 8101
sprpriority = 3
postype = p1
scale = 0.5, 0.5
pausemovetime = -1
supermovetime = -1
ownpal = 1

[State 8100, End]
type = destroyself
trigger1 = anim !=1 
ignorehitpause = 1

[State 8100, End]
type = destroyself
trigger1 = time >= 7

;Dash dust
[Statedef 8103]
type = A
anim = 1
velset = 0, 0
sprpriority = 5

[State 8103, Pos]
type = posset
trigger1 = !time = 0
y = 0

[State 8103, Dust]
type = explod
trigger1 = time = 0 || time = 3 || time = 6
anim = 8103
ID = ifelse((time = 6), 3, ifelse((time = 3), 2, 1))
postype = p1
pos = 0, -4
random = 8, 8
vel = -3 -(random / 1000.0), -2 -(random / 2000.0)
facing = ifelse(random < 500, -1, 1)
vfacing = ifelse(random < 500, -1, 1)
removetime = 16
sprpriority = 3
pausemovetime = -1
supermovetime = -1

[State 8103, Scale]
type = modifyexplod
trigger1 = numexplod(1)
ID = 1
scale = 0.1 + (0.025 * time), 0.1 + (0.025 * time)
trans = addalpha
alpha = 256 -(16 * time), 256

[State 8103, Scale]
type = modifyexplod
trigger1 = numexplod(2)
ID = 2
scale = 0.1 + (0.025 * (time -3)), 0.1 + (0.025 * (time -3))
trans = addalpha
alpha = 256 -(16 * (time -3)), 256

[State 8103, Scale]
type = modifyexplod
trigger1 = numexplod(3)
ID = 3
scale = 0.1 + (0.025 * (time -6)), 0.1 + (0.025 * (time -6))
trans = addalpha
alpha = 256 -(16 * (time -6)), 256

[State 8103, End]
type = removeexplod
trigger1 = time >= 22

[State 8103, End]
type = destroyself
trigger1 = !numexplod

;-----------------------------------
;Ground Impact 
[Statedef 8110]
type = A
anim = 1
velset = 0, 0
sprpriority = 5

[State 8110, FX]
type = explod
trigger1 = !time
anim = 8110
ID = ifelse(time = 8, 3, ifelse(time = 4, 2, 1))
postype = p1
removetime = 8
sprpriority = -4
pausemovetime = -1
supermovetime = -1

[State 8110, FX]
type = explod
trigger1 = !time
anim = 8120
ID = 2
postype = p1
removetime = 8
sprpriority = -4
pausemovetime = -1
supermovetime = -1

[State 8110, Scale]
type = modifyexplod
trigger1 = 1
scale = 0.25 + (0.03125 * time), 0.25 + (0.03125 * time)
trans = addalpha
alpha = ifelse(time < 4, 256, 256 -(64 * (time -4))), 256

[State 8110, End]
type = removeexplod
trigger1 = time >= 8

[State 8110, End]
type = destroyself
trigger1 = !numexplod

;WALL IMPACT DUST
[StateDef 8111]
type = A
anim = 1
velSet = 0,0
sprPriority = 5

[State 8111, Impact Dust Explod 1]
type = Explod
trigger1 = !Time
anim = 8111
ID = ifElse(Time = 8, 3, ifElse(Time = 4, 2, 1))
posType = P1
removeTime = 8
sprPriority = -4
pauseMoveTime = -1
superMoveTime = -1

[State 8111, Impact Dust Explod 2]
type = Explod
trigger1 = !Time
anim = 8121
ID = 2
posType = P1
removeTime = 8
sprPriority = -4
pauseMoveTime = -1
superMoveTime = -1

[State 8111, Scale]
type = ModifyExplod
trigger1 = 1
scale = 0.25 + (0.03125 * Time), 0.25 + (0.03125 * Time)
trans = AddAlpha
alpha = ifElse(Time < 4, 256, 256 - (64 * (Time - 4))), 256

[State 8111, Remove Explods]
type = RemoveExplod
trigger1 = Time >= 8

[State 8111, End]
type = DestroySelf
trigger1 = !NumExplod


;Heavy Ground Impact 
[Statedef 8112]
type = A
anim = 1
velset = 0, 0
sprpriority = 5

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

[State 5000, PlaySnd]
type = PlaySnd
trigger1 = Root,stateno <= 2000
trigger1 = time =0
channel = 2
value = 0,4
loop = 0
volumescale = 255
ignorehitpause =1 
persistent = 0

[State 5000, PlaySnd]
type = PlaySnd
trigger1 = Root,stateno >= 1999
trigger1 = time =0
channel = 2
value = 1,5
loop = 0
volumescale = 255
ignorehitpause =1 
persistent = 0

[State 8110, FX]
type = explod
trigger1 = !time 
anim = 8062
ID = 2
postype = p1
removetime = -2
sprpriority = 4
pausemovetime = -1
supermovetime = -1

[State 8110, Scale]
type = modifyexplod
trigger1 = 1
scale = 2 + (0.03125 * time), .5 + (0.03125 * time)
;trans = addalpha
;alpha = ifelse(time < 4, 256, 256 -(64 * (time -4))), 256

[State 8110, End]
type = removeexplod
trigger1 = time >= 54

[State 8110, End]
type = destroyself
trigger1 = !numexplod


;Heavy Ground Impact meh
[Statedef 8113]
type = A
anim = 1
velset = 0, 0
sprpriority = 5

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

[State 5000, PlaySnd]
type = PlaySnd
trigger1 = Root,stateno <= 2000
trigger1 = time =0
channel = 2
value = 0,4
loop = 0
volumescale = 255
ignorehitpause =1 
persistent = 0

[State 5000, PlaySnd]
type = PlaySnd
trigger1 = Root,stateno >= 1999
trigger1 = time =0
channel = 2
value = 1,5
loop = 0
volumescale = 255
ignorehitpause =1 
persistent = 0

[State 8110, FX]
type = explod
trigger1 = !time 
anim = 8062
ID = 2
postype = p1
removetime = -2
sprpriority = 4
pausemovetime = -1
supermovetime = -1

[State 8110, Scale]
type = modifyexplod
trigger1 = 1
scale = 1.25 + (0.03125 * time), .5 + (0.03125 * time)
;trans = addalpha
;alpha = ifelse(time < 4, 256, 256 -(64 * (time -4))), 256

[State 8110, End]
type = removeexplod
trigger1 = time >= 54

[State 8110, End]
type = destroyself
trigger1 = !numexplod







;FLAMES
[Statedef 8150]
type = A
velset = 0, 0
anim = 1

[State 8150, player]
type = varset
trigger1 = !time
var(0) = parent, var(43)

[State 8150, Pos]
type = posset
trigger1 = playerIDexist(var(0))
x = ceil(playerID(var(0)), pos x)
y = ceil(playerID(var(0)), pos y) + (playerID(var(0)), const(size.mid.pos.y))

[State 8150, Pos]
type = posset
trigger1 = playerIDexist(var(0))
trigger1 = playerID(var(0)), statetype = L
x = ceil(playerID(var(0)), pos x)
y = ceil(playerID(var(0)), pos y) - 20

[State 8150, facing]
type = turn
trigger1 = playerIDexist(var(0))
trigger1 = facing != (playerID(var(0)), facing)

[State 8150, flames]
type = explod
trigger1 = playerIDexist(var(0))
anim = 8150
sprpriority = 3
postype = p1
random = 40, 40
vel = (random / 2000.0), -.5 -(random / 2000.0)
facing = ifelse(random < 500, -1, 1)
vfacing = ifelse(random < 500, -1, 1)
scale = 0.5, 0.5
ownpal = 1

[State 8150, flames]
type = explod
trigger1 = playerIDexist(var(0))
anim = 8150
sprpriority = 3
postype = p1
random = 60, 60
vel = (random / 2000.0), -.5 -(random / 2000.0)
facing = ifelse(random < 500, -1, 1)
vfacing = ifelse(random < 500, -1, 1)
scale = 0.5, 0.5
ownpal = 1

[State 8150, End]
type = destroyself
trigger1 = time >= 600
trigger2 = !playerIDexist(var(0))

[State 8150, End]
type = destroyself
triggerall = playerIDexist(var(0))
trigger1 = playerID(var(0)), ctrl
trigger2 = playerID(var(0)), movetype != H || playerID(var(0)), stateno = 5300
trigger3 = playerID(var(0)), statetype = L && (playerID(var(0)), stateno != [5080, 5081])

;RECOVER FX
[Statedef 8200]
type = A
velset = 0, 0
anim = 8200
sprpriority = 5

[State 8200, No Shadow]
type = assertspecial
trigger1 = 1
flag = noshadow
ignoreHitPause = 1

[State 8200, Scale]
type = angledraw
trigger1 = 1
scale = 0.25 + (0.017 * time), 0.25 + (0.017 * time)
ignoreHitPause = 1

[State 8200, Trans]
type = trans
trigger1 = 1
trans = addalpha
alpha = ceil(256 -17.1 * time), 256
ignoreHitPause = 1

[State 8200, End]
type = destroyself
trigger1 = time >= 15


;COUNTER FX
[Statedef 8290]
type = A
physics = N
velset = 0, 0
anim = 1

[State 8290, Circle]
type = explod
trigger1 = !numexplod(8290)
anim = 8290
ID = 8290
sprpriority = 64
postype = p1
facing = facing
removetime = 32
pausemovetime = -1
supermovetime = -1
ownpal = 1

[State 8290, Scale]
type = modifyexplod
trigger1 = time < 8
ID = 8290
scale = 0.5, 0.5
trans = addalpha
alpha = 256, 0

[State 8290, Scale]
type = modifyexplod
trigger1 = time >= 8
ID = 8290
scale = 0.5 + .0625 * (time -8), 0.5 + .0625 * (time -8)
trans = addalpha
alpha = 256 -32 * (time -8), 32 * (time -8)

[State 8290, Safety]
type = removeexplod
trigger1 = time >= 16

[State 8290, End]
type = destroyself
trigger1 = time >= 16

;MAX MODE TEXT FX
[StateDef 8291]
type = A
physics = N
velSet = 0,0
anim = 1

[State 8291, "Power Up!" Text Explod]
type = Explod
trigger1 = !NumExplod(8291)
anim = 8291
ID = 8291
sprPriority = 64
posType = P1
facing = Facing
removeTime = 32
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 8291, Scale]
type = ModifyExplod
trigger1 = Time < 8
ID = 8291
scale = 0.5, .5
trans = AddAlpha
alpha = 256,0

[State 8291, Scale]
type = ModifyExplod
trigger1 = Time >= 8
ID = 8291
scale = 0.5 + 0.0625 * (Time - 8), 0.5 + 0.0625 * (Time - 8)
trans = AddAlpha
alpha = 256 - 32 * (Time - 8), 32 * (Time - 8)

[State 8291, Safety]
type = RemoveExplod
trigger1 = Time >= 16

[State 8291, End]
type = DestroySelf
trigger1 = Time >= 16

;POWER CHARGE MAIN FX 
[Statedef 8330]
type = A
physics = N
movetype = I
anim = 1
ctrl = 0
velset = 0, 0

[State 8330, Bind]
type = bindtoroot
trigger1 = (root, stateno = 730)
pos = 0,0

[State 8330, Snd]
type = playsnd
trigger1 = !time
value = 730,0
channel = 0

[State 8330, Aura]
type = explod
trigger1 = !numexplod(8330)
ID = 8330
anim = 8330
sprpriority = 3
postype = p1
bindtime = -1
removetime = -1
scale = 0.5, 0.5
pausemovetime = -1
supermovetime = -1
ownpal = 1

[State 8330, Dust]
type = explod
trigger1 = !(time % 6)
anim = 8105
sprpriority = -3
postype = p1
pos = 0, -ceil(pos y)
scale = 0.5, 0.5
pausemovetime = -1
supermovetime = -1
ownpal = 1

[State 8330, FX]
type = modifyexplod
trigger1 = numexplod(8330) && root, power < 3000
ID = 8330
scale = 0.5, 0.1 + 0.4 * (root, power / 3000.0)

[State 8330, FX]
type = modifyexplod
trigger1 = numexplod(8330) && root, power >= 3000
ID = 8330
scale = 0.5, 0.5

[State 8330, End]
type = stopsnd
trigger1 = root, stateno != 730
channel = 0

[State 8330, End]
type = removeexplod
trigger1 = root, stateno != 730

[State 8330, End]
type = destroyself
trigger1 = root, stateno != 730


;POWER CHARGE Particles 
[Statedef 8331]
type = A
physics = N
movetype = I
anim = 1
ctrl = 0
velset = 0, 0

[State 8331, Bind]
type=bindtoroot
trigger1= !(time%8)
pos=ceil(-152.6+(random/3.125)),ceil(10-(random/3.125))



[State 8331, Particle]
type=explod
trigger1= (time%8)=1
anim=8331
sprpriority=ifelse(random<750,5,-1)
postype=p1
vel= ((rootdist x-10)/32.0), ((rootdist y-65)/32.0)
scale= ifelse(random<500,.5,-.5), ifelse(random<500,.5,-.5)
pausemovetime=-1
supermovetime=-1
ownpal=1


[State 8331, End]
type = removeexplod
trigger1 = !numhelper(7100)

[State 8331, End]
type = destroyself
trigger1 = !numhelper(7100)


;ZERO COUNTER PAUSE
[Statedef 8350]
type = A
physics = N
movetype = I
anim = 1
ctrl = 0
velset = 0, 0

[State 8350, BG PalFX]
type = bgpalfx
trigger1 = 1
time = 1
color = 16 * time
mul = 16 * time, 16 * time, 16 * time

[State 8350, Circle]
type = explod
trigger1 = !time
anim = 8350
ID = 1
sprpriority = 3
postype = p1
removetime = 16
supermovetime = -1
ownpal = 1

[State 8350, Scale]
type = modifyexplod
trigger1 = numexplod(1)
ID = 1
scale = (0.0625 * time), (0.0625 * time)
trans = addalpha
alpha = 256 -(16 * time), 256

[State 8350, Lightning]
type = explod
trigger1 = !time
anim = 8351
ID = 2
sprpriority = -2
postype = p1
pos = 0, -ceil(pos y)
supermovetime = -1
ownpal = 1

[State 8350, End]
type = destroyself
trigger1 = time >= 16


;CUSTOM COMBO
[Statedef 8400]
type = A
physics = N
movetype = I
anim = 8400
ctrl = 0
velset = 0, 0
sprpriority = 5

[State 8400, Assert]
type = assertspecial
trigger1 = 1
flag = noshadow
ignoreHitPause = 1

[State 8400, BG PalFX]
type = bgpalfx
trigger1 = time < 25
time = 1
mul = 128, 128, 128

[State 8400, Rotate]
type = angleset
trigger1 = !time
value = 6 * (random % 60)

[State 8400, Rotate]
type = angleadd
trigger1 = 1
value = -6

[State 8400, Scale]
type = angledraw
trigger1 = time < 8
scale = (0.0625 * time), (0.0625 * time)
ignoreHitPause = 1

[State 8400, Scale]
type = angledraw
trigger1 = time >= 8
scale = 0.5, 0.5
ignoreHitPause = 1

[State 8400, Trans]
type = trans
trigger1 = time < 16
trans = addalpha
alpha = 256, 256
ignoreHitPause = 1

[State 8400, Trans]
type = trans
trigger1 = time >= 16
trans = addalpha
alpha = ceil(256 - 25.6 * (time -16)), 256
ignoreHitPause = 1

[State 8400, Lines]
type = explod
trigger1 = !time
anim = 8401
ID = 1
sprpriority = 5
postype = p1
facing = ifelse(random < 500, -1, 1)
vfacing = ifelse(random < 500, -1, 1)
removetime = 16
supermovetime = -1

[State 8400, Scale]
type = modifyexplod
trigger1 = numexplod(1)
ID = 1
scale = 2 -(0.125 * time), 2 -(0.125 * time)
trans = addalpha
alpha = ifelse(time < 4, 64 * time, 256), 256

[State 8400, Circle]
type = explod
trigger1 = time = 16
anim = 8402
ID = 2
sprpriority = 5
postype = p1
removetime = 32
supermovetime = -1

[State 8400, Scale]
type = modifyexplod
trigger1 = numexplod(2)
ID = 2
scale = (0.1 * (time -16)), (0.1 * (time -16))
trans = addalpha
alpha = ceil(256 - 25.6 * (time -16)), 256

[State 8400, Safety]
type = removeexplod
trigger1 = time >= 26

[State 8400, End]
type = destroyself
trigger1 = time >= 26


;========================< SUPERPAUSE FX >=============================
;--- --Level 1 -----
[Statedef 8500]
type = A
velset = 0, 0
anim = 8500
sprpriority = 5

[State 8500, Assert]
type = assertspecial
trigger1 = 1
flag = noshadow
ignoreHitPause = 1

[State 8500, BG PalFX]
type = bgpalfx
trigger1 = time < 39
time = 1
color = 0
mul = 0, 0, 256

[State 8500, Rotate]
type = angleset
trigger1 = !time
value = 6 * (random % 60)

[State 8500, Rotate]
type = angleadd
trigger1 = 1
value = -6

[State 8500, Scale]
type = angledraw
trigger1 = time < 16
scale = (0.03125 * time), (0.03125 * time)
ignoreHitPause = 1

[State 8500, Scale]
type = angledraw
trigger1 = time >= 16
scale = 0.5, 0.5
ignoreHitPause = 1

[State 8500, Trans]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignoreHitPause = 1

[State 8500, Lines]
type = explod
trigger1 = time = 0 || time = 8 || time = 16 || time = 24
anim = 8501
ID = ifelse(time = 24, 4, ifelse(time = 16, 3, ifelse(time = 8, 2, 1)))
sprpriority = 5
postype = p1
facing = ifelse(random < 500, -1, 1)
vfacing = ifelse(random < 500, -1, 1)
removetime = 16
supermovetime = -1

[State 8500, Scale]
type = modifyexplod
trigger1 = numexplod(1)
ID = 1
scale = 1 -(0.0625 * time), 1 -(0.0625 * time)
trans = addalpha
alpha = ifelse(time < 4, 64 * time, 256), 256

[State 8500, Scale]
type = modifyexplod
trigger1 = numexplod(2)
ID = 2
scale = 1 -(0.0625 * (time -8)), 1 -(0.0625 * (time -8))
trans = addalpha
alpha = ifelse((time -8) < 4, 64 * (time -8), 256), 256

[State 8500, Scale]
type = modifyexplod
trigger1 = numexplod(3)
ID = 3
scale = 1 -(0.0625 * (time -16)), 1 -(0.0625 * (time -16))
trans = addalpha
alpha = ifelse((time -16) < 4, 64 * (time -16), 256), 256

[State 8500, Scale]
type = modifyexplod
trigger1 = numexplod(4)
ID = 4
scale = 1 -(0.0625 * (time -24)), 1 -(0.0625 * (time -24))
trans = addalpha
alpha = ifelse((time -24) < 4, 64 * (time -24), 256), 256

[State 8500, Circle]
type = explod
trigger1 = time = 24
anim = 8502
ID = 10
sprpriority = 5
postype = p1
facing = ifelse(random < 500, -1, 1)
vfacing = ifelse(random < 500, -1, 1)
removetime = 32
supermovetime = -1

[State 8500, Scale]
type = modifyexplod
trigger1 = numexplod(10)
ID = 10
scale = 2 -(0.125 * (time -24)), 2 -(0.125 * (time -24))
trans = addalpha
alpha = ifelse((time -24) < 4, 64 * (time -24), 256), 256

[State 8500, Safety]
type = removeexplod
trigger1 = time >= 40

[State 8500, End]
type = destroyself
trigger1 = time >= 40


;--- --Level 2 -----
[Statedef 8510]
type = A
velset = 0, 0
anim = 8510
sprpriority = 5

[State 8510, Assert]
type = assertspecial
trigger1 = 1
flag = noshadow
ignoreHitPause = 1

[State 8510, BG PalFX]
type = bgpalfx
trigger1 = time < 39
time = 1
color = 0
mul = 192, 0, 256

[State 8510, Rotate]
type = angleset
trigger1 = !time
value = 6 * (random % 60)

[State 8510, Rotate]
type = angleadd
trigger1 = 1
value = -6

[State 8510, Scale]
type = angledraw
trigger1 = time < 16
scale = (0.03125 * time), (0.03125 * time)
ignoreHitPause = 1

[State 8510, Scale]
type = angledraw
trigger1 = time >= 16
scale = 0.5, 0.5
ignoreHitPause = 1

[State 8510, Trans]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignoreHitPause = 1

[State 8510, Lines]
type = explod
trigger1 = time = 0 || time = 8 || time = 16 || time = 24
anim = 8511
ID = ifelse(time = 24, 4, ifelse(time = 16, 3, ifelse(time = 8, 2, 1)))
sprpriority = 5
postype = p1
facing = ifelse(random < 500, -1, 1)
vfacing = ifelse(random < 500, -1, 1)
removetime = 16
supermovetime = -1

[State 8510, Scale]
type = modifyexplod
trigger1 = numexplod(1)
ID = 1
scale = 1 -(0.0625 * time), 1 -(0.0625 * time)
trans = addalpha
alpha = ifelse(time < 4, 64 * time, 256), 256

[State 8510, Scale]
type = modifyexplod
trigger1 = numexplod(2)
ID = 2
scale = 1 -(0.0625 * (time -8)), 1 -(0.0625 * (time -8))
trans = addalpha
alpha = ifelse((time -8) < 4, 64 * (time -8), 256), 256

[State 8510, Scale]
type = modifyexplod
trigger1 = numexplod(3)
ID = 3
scale = 1 -(0.0625 * (time -16)), 1 -(0.0625 * (time -16))
trans = addalpha
alpha = ifelse((time -16) < 4, 64 * (time -16), 256), 256

[State 8510, Scale]
type = modifyexplod
trigger1 = numexplod(4)
ID = 4
scale = 1 -(0.0625 * (time -24)), 1 -(0.0625 * (time -24))
trans = addalpha
alpha = ifelse((time -24) < 4, 64 * (time -24), 256), 256

[State 8510, Circle]
type = explod
trigger1 = time = 24
anim = 8512
ID = 10
sprpriority = 5
postype = p1
facing = ifelse(random < 500, -1, 1)
vfacing = ifelse(random < 500, -1, 1)
removetime = 32
supermovetime = -1

[State 8510, Scale]
type = modifyexplod
trigger1 = numexplod(10)
ID = 10
scale = 2 -(0.125 * (time -24)), 2 -(0.125 * (time -24))
trans = addalpha
alpha = ifelse((time -24) < 4, 64 * (time -24), 256), 256

[State 8510, Safety]
type = removeexplod
trigger1 = time >= 40

[State 8510, End]
type = destroyself
trigger1 = time >= 40


;--- --Level 3 -----
[Statedef 8520]
type = A
velset = 0, 0
anim = 8520
sprpriority = 5

[State 8520, Assert]
type = assertspecial
trigger1 = 1
flag = noshadow
ignoreHitPause = 1

[State 8520, Assert]
type = assertspecial
trigger1 = time < 40
flag = nobardisplay
flag2 = noBG
flag3 = noFG
ignorehitpause = 1
[State 8520, Rotate]
type = angleset
trigger1 = !time
value = 6 * (random % 60)

[State 8520, Rotate]
type = angleadd
trigger1 = 1
value = -6

[State 8520, Scale]
type = angledraw
trigger1 = time < 16
scale = (0.03125 * time), (0.03125 * time)
ignoreHitPause = 1

[State 8520, Scale]
type = angledraw
trigger1 = time >= 16
scale = 0.5, 0.5
ignoreHitPause = 1

[State 8520, Trans]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignoreHitPause = 1

[State 8520, Portrait]
type = explod
trigger1 = !time
anim = 8525
ID = 20
sprpriority = -16
postype = back
removetime = 40
supermovetime = -1

[State 8520, Portrait]
type = explod
trigger1 = !time
anim = 8525
ID = 21
sprpriority = -16
postype = back
removetime = 40
supermovetime = -1

[State 8520, Scale]
type = modifyexplod
trigger1 = numexplod(20) && time < 16
ID = 20
postype = back
pos = 160, floor((1.3333333 * gameheight / gamewidth) * 121)
scale = 1 - (0.03125 * time), 1 - (0.03125 * time)
trans = addalpha
alpha = (8 * time), 256

[State 8520, Scale]
type = modifyexplod
trigger1 = numexplod(21) && time < 16
ID = 21
postype = back
pos = 160, floor((1.3333333 * gameheight / gamewidth) * 121)
scale = 2 - (0.09375 * time), 2 - (0.09375 * time)
trans = addalpha
alpha = (8 * time), 256

[State 8520, Scale]
type = modifyexplod
trigger1 = numexplod(20) && (time = [16, 32])
ID = 20
postype = back
pos = 160, floor((1.3333333 * gameheight / gamewidth) * 121)
scale = 0.5, 0.5
trans = addalpha
alpha = 256, 256

[State 8520, Scale Portrait 2b]
type = ModifyExplod
trigger1 = NumExplod(21) && (Time = [16,32])
ID = 21
scale = 0,0

[State 8520, Scale Portrait 1c]
type = ModifyExplod
trigger1 = NumExplod(20) && Time >= 32
ID = 20
posType = Back
pos = 160 + (8 * (Time - 32)), floor((1.3333333 * GameHeight / GameWidth) * 121)
scale = 0.5, 0.5
trans = AddAlpha
alpha = 128 - 16 * (Time - 32), 256

[State 8520, Scale Portrait 2c]
type = ModifyExplod
trigger1 = NumExplod(21) && Time >= 32
ID = 21
posType = Back
pos = 160 - (8 * (Time - 32)), floor((1.3333333 * GameHeight / GameWidth) * 121)
scale = 0.5, 0.5
trans = AddAlpha
alpha = 128 - 16 * (Time - 32), 256

[State 8520, Lines]
type = explod
trigger1 = time = 0 || time = 8 || time = 16 || time = 24
anim = 8521
ID = ifelse(time = 24, 4, ifelse(time = 16, 3, ifelse(time = 8, 2, 1)))
sprpriority = 5
postype = p1
facing = ifelse(random < 500, -1, 1)
vfacing = ifelse(random < 500, -1, 1)
removetime = 16
supermovetime = -1

[State 8520, Scale]
type = modifyexplod
trigger1 = numexplod(1)
ID = 1
scale = 1 -(0.0625 * time), 1 -(0.0625 * time)
trans = addalpha
alpha = ifelse(time < 4, 64 * time, 256), 256

[State 8520, Scale]
type = modifyexplod
trigger1 = numexplod(2)
ID = 2
scale = 1 -(0.0625 * (time -8)), 1 -(0.0625 * (time -8))
trans = addalpha
alpha = ifelse((time -8) < 4, 64 * (time -8), 256), 256

[State 8520, Scale]
type = modifyexplod
trigger1 = numexplod(3)
ID = 3
scale = 1 -(0.0625 * (time -16)), 1 -(0.0625 * (time -16))
trans = addalpha
alpha = ifelse((time -16) < 4, 64 * (time -16), 256), 256

[State 8520, Scale]
type = modifyexplod
trigger1 = numexplod(4)
ID = 4
scale = 1 -(0.0625 * (time -24)), 1 -(0.0625 * (time -24))
trans = addalpha
alpha = ifelse((time -24) < 4, 64 * (time -24), 256), 256

[State 8520, Circle]
type = explod
trigger1 = time = 24
anim = 8522
ID = 10
sprpriority = 5
postype = p1
facing = ifelse(random < 500, -1, 1)
vfacing = ifelse(random < 500, -1, 1)
removetime = 32
supermovetime = -1

[State 8520, Scale]
type = modifyexplod
trigger1 = numexplod(10)
ID = 10
scale = 2 -(0.125 * (time -24)), 2 -(0.125 * (time -24))
trans = addalpha
alpha = ifelse((time -24) < 4, 64 * (time -24), 256), 256

[State 8520, Safety]
type = removeexplod
trigger1 = time >= 40

[State 8520, End]
type = destroyself
trigger1 = time >= 40


;SUPER FINISH
[Statedef 8600]
type = A
velset = 0, 0
anim = 1

[State 8600, Sound]
type = playsnd
trigger1 = !time
value = 400,25
channel = 1

[State 8600, Snd]
type = sndpan
trigger1 = time <= 80
channel = 1
abspan = ceil(sin(gametime / 20.0 * pi) * 160)

[State 8600, BG PalFX]
type = bgpalfx
trigger1 = time < 16
time = 1
mul = 0, 0, 0

[State 8600, BG PalFX]
type = bgpalfx
trigger1 = time = [16, 24)
time = 1
mul = 32 * (time -16), 32 * (time -16), 32 * (time -16)



;------------------------------------------------------------------------------------------------(set these proper)---------------------------------------------------------------------


[State 8600, Move Name: ShadowFury]
type = varset
trigger1 = !time && root, var(23) = 775
var(0) = 1

[State 8600, Move Name: NightShade]
type = varset
trigger1 = !time && (Root, StateNo = [4250,4263]) ;(root, var(23) = [3000, 3099])
var(0) = 2

[State 8600, Move Name: Thorn Garden]
type = varset
trigger1 = !time && (root, StateNo = 4000)
var(0) = 3

[State 8600, Move Name: Angel's Trumpet]
type = varset
trigger1 = !time && (Root, StateNo = [4500,4506]);(root, var(23) = [3200, 3299])
var(0) = 4

[State 8600, Move Name: Cursed Deck Portal Bomb]
type = varset
trigger1 = !time && (Root, StateNo = 3150) || numhelper(13100)  ;(root, var(23) = [3050, 3099])
var(0) = 5

;not used for now
[State 8600, Move Name: Solarbeam]
type = null
varset
trigger1 = !time && Root, StateNo=3252;(root, var(23) = [3252, 3299])
var(0) = 6

;Card of Thorns does not use Super effect it will have it's own
[State 8600, Move Name: Card of Thorns]
type = null
varset
trigger1 = !time && Root, StateNo=3302;(root, var(23) = [3300, 3399])
var(0) = 7



[State 8600, MvC]
type = explod
trigger1 = !time
anim = 8600
ID = 8600
ontop = 1
postype = left
pos = 160, floor((1.3333333 * gameheight / gamewidth) * 120)
scale = 0.5, 0.5 * (1.3333333 * gameheight / gamewidth)
bindtime = -1
removetime = 32
pausemovetime = -1
supermovetime = -1

[State 8600, Fade]
type = modifyexplod
trigger1 = numexplod(8600)
ID = 8600
trans = addalpha
alpha = ifelse(time < 16, 256, 256 -32 * (time -16)), 256



[State 8600, Text Shadowfury]
type = explod
trigger1 = !time && var(0)= 1
anim =  40004
ID = 10
ontop = 1
postype = left
pos = 160, floor((.7 * gameheight / gamewidth) * 360)-100
;scale = 0.5, 0.5 * (1.3333333 * gameheight / gamewidth)120
scale = 1, 1 * (1.3333333 * gameheight / gamewidth)
bindtime = -1
removetime = 90
pausemovetime = -1
supermovetime = -1



[State 8600, Text Nightshade]
type = explod
trigger1 = !time && var(0)= 2
anim =  40000
ID = 10
ontop = 1
postype = left
pos = 175, floor((.7 * gameheight / gamewidth) * 360)-100
;scale = 0.5, 0.5 * (1.3333333 * gameheight / gamewidth)120
scale = 1, 1 * (1.3333333 * gameheight / gamewidth)
bindtime = -1
removetime = 120
pausemovetime = -1
supermovetime = -1




[State 8600, Text Thorn Garden]
type = explod
trigger1 = !time && var(0)= 3
anim =  40003
ID = 10
ontop = 1
postype = left
pos = 130, floor((.5 * gameheight / gamewidth) * 360)-50
;scale = 0.5, 0.5 * (1.3333333 * gameheight / gamewidth)120
scale = 1, 1 * (1.3333333 * gameheight / gamewidth)
bindtime = -1
removetime = 90
pausemovetime = -1
supermovetime = -1





[State 8600, Text Angel's Trumpet]
type = explod
trigger1 = !time && var(0)= 4
anim =  40005
ID = 10
ontop = 1
postype = left
pos = 110, floor((.5 * gameheight / gamewidth) * 360)-50
;scale = 0.5, 0.5 * (1.3333333 * gameheight / gamewidth)120
scale = .8, 1 * (1.3333333 * gameheight / gamewidth)
bindtime = -1
removetime = 90
pausemovetime = -1
supermovetime = -1



[State 8600, Text Cursed Deck Portal Bomb]
type = explod
trigger1 = !time && var(0)= 5
anim =  40001
ID = 10
ontop = 1
postype = left
pos = 170, floor((.5 * gameheight / gamewidth) * 360)-50
;scale = 0.5, 0.5 * (1.3333333 * gameheight / gamewidth)120
scale = .6, .8 * (1.3333333 * gameheight / gamewidth)
bindtime = -1
removetime = 90
pausemovetime = -1
supermovetime = -1





[State 8600, Fade]
type = modifyexplod
trigger1 = numexplod(10)
ID = 10
trans = addalpha
alpha = ifelse(time < 16, 256, 256 -32 * (time -16)), ifelse(time < 16, 0, 32 * (time -16))

[State 8600, Fade]
type = modifyexplod
trigger1 = numexplod(11)
ID = 11
scale = 0.5 + (0.0625 * time), 0.5 + (0.0625 * time)
trans = addalpha
alpha = 256 - (32 * time), 32 * time

[State 8600, Circle]
type = explod
trigger1 = !time
anim = 8601
ID = 8601
under = 1
postype = left
pos = 160, floor((1.3333333 * gameheight / gamewidth) * 120)
bindtime = -1
removetime = 16
pausemovetime = -1
supermovetime = -1

[State 8600, Fade]
type = modifyexplod
trigger1 = numexplod(8601)
ID = 8601
scale = (0.25 * time) * (1.3333333 * gameheight / gamewidth), (0.25 * time) * (1.3333333 * gameheight / gamewidth)
trans = addalpha
alpha = 256 - (16 * time), 256

[State 8600, Assert]
type = assertspecial
trigger1 = time < 16
flag = noFG

[State 8600, Assert]
type = assertspecial
trigger1 = time < 24
flag = nobardisplay

[State 8600, End]
type = removeexplod
trigger1 = time >= 24
trigger2 = roundstate < 3

[State 8600, End]
type = destroyself
trigger1 = roundstate < 3

;CAMERA CONTROL
[Statedef 8999]
type = S
velset = 0, 0
anim = 1

[State 8999, bound]
type = null;screenbound
trigger1 = 1
value = 0
movecamera = 1, 1
ignoreHitPause = 1

[State 8999, End]
type = destroyself
trigger1 = roundstate = 2

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

;superarmor helper
[StateDef 4900]
Type = S
MoveType = I
Physics = S

[State 4900]
Type = ParentVarAdd
Triggerall =(root,stateno != [740,771])
Triggerall = root,palno != 12
Trigger1 = time = 0
V = 47
Value = floor(-.8*Ceil(GetHitVar(Damage)))
IgnoreHitPause = 1


[State 4900]
Type = ParentVarAdd
Triggerall =(root,stateno != [740,771])
Triggerall = root,palno = 12
Trigger1 = Time = 0
FV = 9
Value = floor(Ceil(GetHitVar(Damage)))
IgnoreHitPause = 1

[State 4900]
Type = ChangeAnim
TriggerAll = Time%2 = 0
Trigger1 = SelfAnimExist(Root,Anim)
Value = (Root,Anim)
Elem = (Root,AnimElemNo(0))
IgnoreHitPause = 1

[State 4900]
Type = PlayerPush
Trigger1 = 1
Value = 1
IgnoreHitPause = 1

[State 4900]
Type = HitOverride
Trigger1 = 1
Attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
Slot = 0
StateNo = 4900
Time = 100
ForceAir = 0
IgnoreHitPause = 1


[State 4900]
Type = BindToParent
Trigger1 = 1
Time = 1
Facing = 1
Pos = 0,0
IgnoreHitPause = 1



[State 4900]
Type = SprPriority
Trigger1 = 1
Value = 2
IgnoreHitPause = 1


[State 4900] 
Type = DestroySelf 
Triggerall = root,palno != 12
Triggerall = numhelper
Trigger1 = !numhelper(7050)
Trigger2 = helper(7050), stateno != [7050,7051]
IgnoreHitPause = 1

[State 4900] 
Type = DestroySelf 
Triggerall = root,palno = 12
Trigger1 = root,alive = 0
IgnoreHitPause = 1


;Subsitute helper
[StateDef 7050]
Type = S
MoveType = I
Physics = U

;set hp bar 
;redirect damage to hp bar 
;enter death animation when hp is gone

;make hp bar visable
;immune to damage till phero exits call animation

[State 0, ParentVarSet]
type = ParentVarSet
trigger1 = time = 0
v = 47
value = ceil(Root,lifemax/3)

[State 0, VarSet]
type = ParentVaradd
trigger1 = root,stateno != 7777 ;summon sub
trigger1 = var(47) >= 0
v = 47    
Value = -Ceil(GetHitVar(Damage))

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 0
y = -3
 
[State 0, VelSet]
type = Veladd
trigger1 = time >= 0
trigger1 = pos y <= -10
y = .333

[State 0, PosSet]
type = PosSet
trigger1 = pos y >= -10
y = 0


[State 4900]
Type = ChangeAnim
Trigger1 = time = 0
Value = 18889

[State 4900]
Type = PlayerPush
Trigger1 = 1
Value = 0
IgnoreHitPause = 1
[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1


[State 4900]
Type = null;HitOverride
Trigger1 = 1
Attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
Slot = 0
StateNo = 7051
Time = 1
ForceAir = 0
IgnoreHitPause = 1

[State 4900]
Type = SprPriority
Trigger1 = time = 0
Value = 5
IgnoreHitPause = 1

[State 770, Max Meter V2]
type = Helper
helpertype = Normal
trigger1 = time = 1 && !NumHelper(781)
id = 781
pos = 0,0
postype = left
name = "Sub Meter"
stateno = 781
ignorehitpause = 1
ownpal = 1



[State 0, ChangeState]
type = ChangeState
trigger1 = pos y >= 0
;root,var(47) <= 0
value = 7051
ctrl = 0


;Subsitute helper take damage
[StateDef 7051]
Type = S
MoveType = I
Physics = U

[State 0, VarSet]
type = ParentVaradd
trigger1 = var(47) >= 0
v = 47    
Value = -Ceil(GetHitVar(Damage))


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

[State 4900]
Type = ChangeAnim
Trigger1 = time = 0
Value = 18889

[State 4900]
Type = PlayerPush
Trigger1 = 1
Value = 0
IgnoreHitPause = 1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1


[State 4900]
Type =null; HitOverride
Trigger1 = 1
Attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
Slot = 0
StateNo = 7051
Time = 100
ForceAir = 0
IgnoreHitPause = 1

[State 4900]
Type = SprPriority
Trigger1 = time = 0
Value = 5
IgnoreHitPause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = root,var(47) <= 0
value = 7054
ctrl = 0





;Subsitute helper
[StateDef 7054]
Type = S
MoveType = I
Physics = U


[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

[State 4900]
Type = ChangeAnim
Trigger1 = time = 0
Value = 18890


[State 215, Effect]
type = PalFX
trigger1 = time < 16
time = 1
add = 0-((time-6)*5),0-((time-6)*5),0-((time-6)*5)
persistent = 1

[State 1200, 6]
type = explod
trigger1 = time >= 0
trigger1 = time < 18
trigger1 = time%6 = 3
anim = 36
pos = 0,-50
random = 20,20
facing = 1
sprpriority = 5
bindtime = 1
vel = -5+Random%10,-5+Random%10
ownpal = 1
ignorehitpause = 1
scale = 1,1


[State 1200, 6]
type = explod
trigger1 = time >= 0
trigger1 = time < 18
trigger1 = time%6 = 3
anim = 8101
pos = 0,-50
random = 50,70
facing = 1
sprpriority = 4
bindtime = 1
vel = 0,-1+Random%3
ownpal = 1
ignorehitpause = 1
scale = 1.25,1.25

[State 1300]
type = helper
trigger1 = !time
helpertype = normal
stateno = 7070
ID = 7070
name = "Bloom"
postype = p1
pos = 0, -60
scale = 0,0
ownpal = 1

[State 4900]
Type = PlayerPush
Trigger1 = 1
Value = 0
IgnoreHitPause = 1

[State 4900]
Type = SprPriority
Trigger1 = time = 0
Value = 5
IgnoreHitPause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0



; bye bye sub effect
[Statedef 7070]
type = A
movetype = I
physics = N
sprpriority = 1
anim = 6100
velset = 0,0

[State 21000, T]
type = Trans
trigger1 = time
Trans = Addalpha
alpha = 256,256
ignorehitpause = 1

[State 21000, ASS]
type = AssertSpecial
trigger1 = 1
flag = Noshadow
ignorehitpause = 1

[State 21000, ASS]
type = AssertSpecial
trigger1 = !time
flag = Invisible
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 =time = 0 
value = S24,10
channel = 5



[State 21000, ASS]
type = bindtoroot
trigger1 = 1
pos = 0,-55

[State 1000, AD]
type = AngleDraw
trigger1 = time
value = -time*3
scale = 0+(time*0.0175),0+(time*0.0175)
ignorehitpause = 1

[State 1201, CS]
type = destroyself
triggerall = numhelper
trigger1 = helper(7050),time >= 18
trigger1 = helper(7050),stateno = 7051
trigger2 = helper(7050),stateno != 7051









;-------------------------------------------------------------------------------------------------
;Darkness background
[statedef 9001]
type    = a                   
movetype= a                      
physics = n                
ctrl = 0    
anim = 31203
sprpriority = -90                     

[state 710,6]
type = assertspecial
trigger1 = 1
flag = nobg
flag2 = nofg
flag3 = nobardisplay
ignorehitpause = 1 

              
[state 710,6]
type = posset
trigger1 = time > 0
x = 0
y = 0

[state 4002, super bg]
type = explod
trigger1 = enemynear, numhelper(9002) = 0
trigger1 = numexplod(9003) = 0
trigger1 = time >= 0
anim = 9001
ownpal = 1
id = 9001
bindtime = 9999
removetime = -1
removeongethit = 1
postype = back
pos = 0, 0
sprpriority = -9
persistent = 0

[state 710, 6]
type = removeexplod
trigger1 = parent, movetype != a
trigger2 = parent, movetype = h
ID = 9001

[state 710, 6]
type = Destroyself
trigger1 = parent, movetype != a
trigger2 = numhelper(9001) >=2




;nihilego


;poipole arrives
[Statedef 14250]
type    = A
movetype= I
physics = U
;anim = 555 
ctrl = 0
sprpriority = 5


[State 181, 2]
type = ChangeAnim
trigger1 = time =0
trigger1 = root,palno = 12
trigger1 = anim != 575
value = 575

[State 181, 2]
type = ChangeAnim
trigger1 = time =0
trigger1 = root,palno != 12
trigger1 = anim != 555
value = 555

;wormhole
[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 30
ID = 1550
pos = -3,0
postype = p1  ;p2,front,back,left,right
removetime = 50
pausemovetime = 9999  
scale = 1,1
sprpriority = -5
ontop = 0
ownpal = 1
removeongethit = 0
trans = add


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S30,2
channel = 4



;ultra beast counter
[State 0, VarSet]
type = Varset
trigger1 = time = 0
v = 6  
value = 3

[State 0, Helper]
type = Helper
triggerall = var(6) >= 1
triggerall = numhelper
trigger1 = numhelper(14250)
trigger1 = numhelper(14255) = 0
name = "poi's ammo counter"
ID = 14255
stateno = 14255
pos = 0,0
postype = p1   
facing = 1
ownpal = 1
supermovetime = 9999
pausemovetime = 9999


[State 0, ChangeState]
type = ChangeState
trigger1 = time = 50
ctrl = 0
value =  14251


;poipole Idle
[Statedef 14251]
type    = A
movetype= I
physics = U
ctrl = 0
sprpriority = 5


[State 181, 2]
type = ChangeAnim
trigger1 = time =0
trigger1 = root,palno = 12
trigger1 = anim != 576
value = 576

[State 181, 2]
type = ChangeAnim
trigger1 = time =0
trigger1 = root,palno != 12
trigger1 = anim != 556
value = 556


[State 3412,1]
type = Turn
trigger1 = p2dist X < -10

[State 30000, Stand Hover]	
type = Offset
trigger1 = 1
y = 6*cos(GameTime/24.0)

[State 181, 2]
type = SprPriority
trigger1 = root,movetype != H
value = 5


[State 7000, VarSet]
type = VarSet
trigger1 = 1
fvar(0) = rootdist x+0.0001-50

[State 7000, VarSet]
type = VarSet
trigger1 = 1
fvar(1) = rootdist y+50

[State 105, 1]
type = VelSet
trigger1 = 1
x = 3.333*cos(atan(fvar(1)/fvar(0))+(pi*(fvar(0)<0)))
y = 1.333*sin(atan(fvar(1)/fvar(0))+(pi*(fvar(0)<0)))

[State 1125, Velocity]
type = VelSet
triggerall = root,facing * facing = 1
trigger1 = Vel X > 0
trigger1 = rootdist X < -125
trigger2 = Vel X < 0
trigger2 = rootdist X > 125
x = 0
persistent = 1

[State 1125, Velocity]
type = VelSet

trigger1 = Vel Y > 0
trigger1 = rootdist Y < 140
trigger2 = Vel Y < 0
trigger2 = rootdist Y > 130
y = 0
persistent = 1

;ex shot ai
[State 1702,13]
type = ChangeState
triggerall = ailevel && numenemy
triggerall = p2dist y >= -300
triggerall = power >= 2000
triggerall = numhelper(14260) = 0
triggerall = (root,stateno = [5000,5200]) && root,movetype = h
;help i'm underattack (combo)
trigger1 = (!EnemyNear,HitDefAttr = SCA,HA,HP,HT,AT ) && root,GetHitVar(guarded) = 0
trigger1 = enemy,StateNo != 5100 && enemy,StateNo != 5101 && enemy,StateNo != 5110 && enemy,StateNo != 5120
trigger1 = root,ctrl = 0 && root,alive = 1 && root,movetype = H && Time >= 1
trigger1 =  Random < (10+333*(root,life <= 300)  * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0))) 
;help i'm underattack (projectile)
trigger2 = (root,stateno = [5000,5200]) && root,movetype = h
trigger2 = p2movetype = a && root,life <= 300
trigger2 = Random < (50 + p2dist x * ifelse( (AILevel ** 2 / 64.0) <= .6 , .6, (AILevel ** 2 / 64.0)))
value = 14352

;normal shot 
[State 1702,13]
type = ChangeState
triggerall = numhelper(14260) = 0
trigger1 = root,stateno = 19550
trigger2 = root,stateno = 19551
value = 14252

;attack mode ex 
[State 0, ChangeState]
type = ChangeState
triggerall  = !ailevel
trigger1 = numhelper(14260) = 0
trigger1 = root,command = "z"
trigger1 = root,movetype = h
ctrl = 0
value =  14352

;go away when out of ammo
[State 0, ChangeState]
type = ChangeState
trigger1 = root,var(45) = 0
trigger2 = root,alive = 0
ctrl = 0
value =  14253



;poipole fire's poison dart
[Statedef 14252]
type    = A
movetype= A
physics = U
;anim = 557+20*root,palno = 12
ctrl = 0
sprpriority = 5


[State 181, 2]
type = ChangeAnim
trigger1 = time =0
trigger1 = root,palno = 12
trigger1 = anim != 577
value = 577

[State 181, 2]
type = ChangeAnim
trigger1 = time =0
trigger1 = root,palno != 12
trigger1 = anim != 557
value = 557



[State 14250, remappal]
type = remappal
trigger1 = root,palno = 12
source = 32,0
dest = 32,1

[State 0, Helper]
type = Helper
triggerall = numhelper
trigger1 = animelem = 3
trigger1 = numhelper(14260) = 0
name = "Poison Dart"
ID = 14260
stateno = 14260
pos = 0,0
postype = p1   
facing = 1
ownpal = 1
supermovetime = 9999
pausemovetime = 9999

[State 0, PlaySnd]
type = PlaySnd
triggerall = root,palno = 12
trigger1 = animelemtime(2) = 2
value = S7,25
channel = 3


[State 2300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 2,=0
StateNo = 305
ID = 302
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = 75,0+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 2,=1
StateNo = 305
ID = 303
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = 55,55+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 2,=2
StateNo = 305
ID = 304
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = 0,75+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 2,=3
StateNo = 305
ID = 305
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = -55,55+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 3,=0
StateNo = 305
ID = 306
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = -75,0+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 3,=1
StateNo = 305
ID = 307
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = -55,-55+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 3,=2
StateNo = 305
ID = 308
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = 0,-75+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 3,=3
StateNo = 305
ID = 309
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = 55,-55+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0








;ammo
[State 0, VarAdd]
type = parentVarAdd
trigger1 = animelem = 3
v =  45
value = -1

;back to idle
[State 0, ChangeState]
type = ChangeState
trigger1 = animtime = 0
ctrl = 0
value =  14251


;poipole fire's poison dart ex
[Statedef 14352]
type    = A
movetype= A
physics = U
;anim = 557
ctrl = 0
sprpriority = 5
poweradd = -2000

[State 181, 2]
type = ChangeAnim
trigger1 = time =0
trigger1 = root,palno = 12
trigger1 = anim != 577
value = 577

[State 181, 2]
type = ChangeAnim
trigger1 = time =0
trigger1 = root,palno != 12
trigger1 = anim != 557
value = 557




[State PlaySnd]
type = PlaySnd
trigger1 = Animelem = 1
value = s1,29
channel = 4



[State 0, Helper]
type = Helper
triggerall = numhelper
trigger1 = animelem = 3
trigger1 = numhelper(14265) = 0
name = "Poison Dart"
ID = 14260
stateno = 14260
pos = 0,0
postype = p1   
facing = 1
ownpal = 1
supermovetime = 9999
pausemovetime = 9999

[State 2300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 2,=0
StateNo = 305
ID = 302
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = 75,0+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 2,=1
StateNo = 305
ID = 303
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = 55,55+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 2,=2
StateNo = 305
ID = 304
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = 0,75+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 2,=3
StateNo = 305
ID = 305
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = -55,55+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 3,=0
StateNo = 305
ID = 306
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = -75,0+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 3,=1
StateNo = 305
ID = 307
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = -55,-55+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 3,=2
StateNo = 305
ID = 308
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = 0,-75+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0

[State 300]
Type = Helper
triggerall = root,palno = 12
Trigger1 = Animelem = 3,=3
StateNo = 305
ID = 309
name = "DikaiOshis"
PosType = P2
facing = 1
Pos = 55,-55+EnemyNear(var(52)),Const(Size.Mid.Pos.y)
Ownpal = 1
SprPriority = 1
IgnoreHitPause = 1
Persistent = 0







;ammo
[State 0, VarAdd]
type = parentVarset
trigger1 = animelem = 3
v =  45
value = 0

;back to idle
[State 0, ChangeState]
type = ChangeState
trigger1 = animtime = 0
ctrl = 0
value =  14251




;poipole leaves
[Statedef 14253]
type    = A
movetype= I
physics = U
;anim = 558
ctrl = 0
sprpriority = 5



[State 181, 2]
type = ChangeAnim
trigger1 = time =0
trigger1 = root,palno = 12
trigger1 = anim != 578
value = 578

[State 181, 2]
type = ChangeAnim
trigger1 = time =0
trigger1 = root,palno != 12
trigger1 = anim != 558
value = 558



[State 0, BGPalFX]
type = BGPalFX
trigger1 = time = [0,60]
time = 1
mul = 3*time,3*time,3*time

[State 0, Trans]
type = Trans
trigger1 = Time = [0,50]
trans =  add
alpha = 50-ceil(2*time)+80,256

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S30,3
channel = 4


[State 0, VelSet]
type = VelSet
trigger1 = root,var(45) != 0
x = 0
y = 0
ignorehitpause = 1


;wormhole
[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 30
ID = 1550
pos = -3,0
postype = p1  ;p2,front,back,left,right
removetime = 50
pausemovetime = 9999  
scale = 1,1
sprpriority = -5
ontop = 0
ownpal = 1
removeongethit = 0


[State 0, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0

;ammo counter
[Statedef 14255]
type    = A
movetype= I
physics = U
anim = 1
ctrl = 0
sprpriority = 5
 
[State 0, Turn]
type = Turn
trigger1 = facing = -1



[state 24000,AssertSpecial]
type=AssertSpecial
trigger1=1
flag=noshadow
flag2=invisible


[state 24000,PlayerPush]
type=PlayerPush
trigger1=1
value=0


[state 24000,]
type=NotHitBy
trigger1=1
value=SCA

[State 780, BindToRoot]
type = BindToparent
triggerall =  numhelper(14250)
trigger1 = 1
time = -1
pos = 5,-60

[State 780, Meter BG]
type = Explod
trigger1 = !Time
anim = 780
id = 780
pos = 2,30
postype = p1
bindtime = -1
removetime = -1
scale = .5,.5
sprpriority = -1
ontop = 1
ownpal = 1
removeongethit = 0


[State 780, red Meter Fill]
type = Explod
triggerall = numexplod(15506) = 0
trigger1 = root,var(45) = 1
ID=15506
Anim = 15506
pos = -20,28
postype = p1
bindtime = -1
removetime = -1
scale = .5,.44
sprpriority = 0
ontop = 1
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 780, red Meter Fill]
type = Explod
triggerall = numexplod(15506) = 0
trigger1 = root,var(45) = 3
ID=15506
Anim = 15504
pos = -20,28
postype = p1
bindtime = -1
removetime = -1
scale = .5,.44
sprpriority = 0
ontop = 1
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 780, red Meter Fill]
type = Explod
triggerall = numexplod(15506) = 0
trigger1 = root,var(45) = 2
ID=15506
Anim = 15503
pos = -20,28
postype = p1
bindtime = -1
removetime = -1
scale = .5,.44
sprpriority = 0
ontop = 1
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 780, Meter Container]
type = Explod
trigger1 = Time = 2
anim = 783
id = 783
pos = 0,30
postype = p1
bindtime = -1
removetime = -1
scale = .51,.58
sprpriority = 4
ontop = 1
ownpal = 1
removeongethit = 0
ignorehitpause = 1


[State 780, ModifyExplod]
type = ModifyExplod
trigger1 = root,var(45) = 1
id = 15506 
anim = 15506
scale = .69+(-.23*(3-root,var(45))), .44
ignorehitpause = 1

[State 780, ModifyExplod]
type = ModifyExplod
trigger1 = root,var(45) = 2
id = 15506 
anim = 15503
scale = .69+(-.23*(3-root,var(45))), .44
ignorehitpause = 1

[State 780, ModifyExplod]
type = ModifyExplod
trigger1 = root,var(45) = 3
id = 15506
anim = 15504
scale = .69+(-.23*(3-root,var(45))), .44
ignorehitpause = 1

[state 24000,]
type=RemoveExplod
trigger1 = !numhelper(14250)
trigger2 = root,var(45) = 0
ID=783
ignorehitpause=1

[state 24000,]
type=RemoveExplod
trigger1 = !numhelper(14250)
trigger2 = root,var(45) = 0
ID=780
ignorehitpause=1

[state 24000,]
type=RemoveExplod
trigger1 = !numhelper(14250)
trigger2 = root,var(45) = 0
ID= 15506
ignorehitpause=1


[state 24000,DestroySelf]
type=DestroySelf
trigger1 = !numhelper(14250)






;poipole's poison dart
[Statedef 14260]
type    = A
movetype= A
physics = N
anim = 559
ctrl = 0
sprpriority = 5

[State 0, NotHitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = 1
ignorehitpause = 1

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,NP,SP,HP
stateno = 14261
ignorehitpause = 1
;fires the top pin on it's head that homes in on the player with a poisoning after effect leaving the target vulnerable, projectile is slow


[State 0, Turn]
type = Turn
trigger1 = (P2Dist X < 10) 
trigger1 = time <=3
 

[state a]
type = velset
triggerall = NumEnemy 
trigger1 = time <= 3
x = 20*((p2dist x)/(abs(p2dist x) + abs(p2dist y - 20) + 0.000001)) +2
y = 20*((p2dist y + enemy,const(size.mid.pos.y))/(abs(p2dist x) + abs(p2dist y + enemy,const(size.mid.pos.y)) + 0.000001))




;[State 0, PosSet]
;type = PosSet
;triggerall = numenemy
;trigger1 = enemy,alive = 1
;trigger1 = time = [1,4]
;x = Enemy, Pos x/time
;y = Enemy, pos y +.5*enemy,const(size.head.pos.y)/time


[State 0, PosSet]
type = PosSet
triggerall = numenemy
trigger1 = enemy,alive = 1
trigger1 = time >= 3
trigger1 = !movecontact
trigger1 = Enemy, pos y <= -50
x = Enemy, Pos x
y = Enemy, pos y +.5*enemy,const(size.head.pos.y)




[State 40, projetile]
type = Hitdef
trigger1 = hitcount = 0
attr = A, SP
damage    = 1+100*hitcount,1
animtype  = Hard
getpower  = 30,30
givepower = -500,-500
Hitflag=MAF
guardflag = MA
pausetime = 2,8
sparkno = 560
sparkxy = -10, -10
hitsound   = 2,5
guardsound = 6,0
guard.sparkno = 40
ground.type = High
ground.slidetime = 15
ground.hittime  = 35
ground.velocity = -6
airguard.velocity = -3.5,0
air.type = High
air.velocity = -3.5,-6.5
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
air.fall = 1
envshake.time = 10
envshake.ampl = 5
hitonce =1

[State 40, projetile]
type = Hitdef
trigger1 = hitcount >= 1
attr = A, SP
damage    = 1+100*hitcount,1
animtype  = Hard
getpower  = 30,30
givepower = -500,-500
Hitflag= MAF-
guardflag = MA
pausetime = 4,0
sparkno = 560
sparkxy = -10, -10
hitsound   = 2,5
guardsound = 6,0
guard.sparkno = 40
ground.type = High
ground.slidetime = 0
ground.hittime  = 0
ground.velocity = -6
airguard.velocity = -3.5,0
air.type = High
air.velocity = -3.5,-6.5
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
air.fall = 1
envshake.time = 10
envshake.ampl = 5
hitonce =1

[State Burning helper]
Type = Helper
Trigger1 = movehit
name = "poison"
StateNo =15151
ID =15151
Pos = 0, 0
PosType = P2
OwnPal = 1
Persistent = 0
Size.XScale = 1
Size.YScale = 1

[State 0, TargetState]
type = TargetState
triggerall = NumTarget;()
trigger1 = movehit
value =15153
ID = -1
;ignorehitpause = 
;persistent = 

;on contact
[State 0, ChangeState]
type = ChangeState
triggerall = numtarget
trigger1 = movecontact && target,stateno = 15153
trigger2 = moveguarded
ctrl = 0
value =  14261

;on contact
[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 40
trigger2 = pos y > -vel y
ctrl = 0
value =  14261

[State 0, DestroySelf]
type = DestroySelf
trigger1 = !stateno =[14260,14261]
ignorehitpause =1 




;poipole's poison contact
[Statedef 14261]
type    = A
movetype= I
physics = U
anim = 560
ctrl = 0
sprpriority = 5
velset = 0,0

[State 0, Helper]
type = Helper
trigger1 = time = 0 
helpertype = normal ;player
name = "aoe"
ID = 14262
stateno = 14262
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999


[State 8200, No Shadow]
type = assertspecial
trigger1 = 1
flag = noshadow
ignoreHitPause = 1

[State 8200, Scale]
type = angledraw
trigger1 = 1
scale = 1 + (0.018 * time), 1 + (0.018 * time)
ignoreHitPause = 1 

[State 8200, Trans]
type = trans
trigger1 = 1
trans = addalpha
alpha = ceil(256 -17.1 * time), 256
ignoreHitPause = 1

[State 0, AngleDraw]
type = Angleadd
trigger1 =1
value = 15

[State 0, Trans]
type = Trans
trigger1 = 1
trans = add
ignorehitpause=1

[State 0, NotHitBy]
type = NotHitBy
trigger1 =1
value = SCA

[State 2000, assertspecial]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1


[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 18

;harmless poison aoe
[Statedef 14262]
type = A
velset = 0, 0
anim = 8200
sprpriority = 5

[State 0, PalFXWiz]
type = PalFX
trigger1 = time = 0
time = 18
add = 100,0,100
mul = 120,20,124
sinadd = 85,110,55,10
invertall = 0
color = 0

[State 8200, No Shadow]
type = assertspecial
trigger1 = 1
flag = noshadow
ignoreHitPause = 1

[State 8200, Scale]
type = angledraw
trigger1 = 1
scale = 1 + (0.017 * time), 1 + (0.017 * time)
ignoreHitPause = 1

[State 8200, Trans]
type = trans
trigger1 = 1
trans = addalpha
alpha = ceil(256 -17.1 * time), 256
ignoreHitPause = 1

[State 8200, End]
type = destroyself
trigger1 = time >= 15




;Poison Poison!
[StateDef 15151]
Type = A
MoveType = I
Physics = N
Anim = 830
SprPriority = 3

[State “–g]
Type = ReversalDef
Trigger1 = Time = 0
Reversal.Attr = C,HP
PauseTime = 0,8
SparkNo = -1
NumHits = 0
[State ‰e‚È‚µ]
Type = AssertSpecial
Trigger1 = 1
Flag = NoShadow
IgnoreHitPause = 1

[State –A‚Ì‘å‚«‚³]
Type = VarRandom
Trigger1 = Time%15 = 0
v = 0
Range = 25, 50

[State –A‚ÌXÀ•W]
Type = VarRandom
Trigger1 = numenemy
Trigger1 = Time%15 = 0
v = 1
Range = -Enemy(0),Const(Size.Ground.Back), Enemy(0),Const(Size.Ground.Front)

[State –A‚ÌŽõ–½]
Type = VarRandom
Trigger1 = Time%15 = 0
v = 2
Range = 30, 60

[State –A]
Type = Explod
Trigger1 = numenemy
Trigger1 = Time > 1
Trigger1 = Time%15 = 2
Anim = 835
ID = 835
Scale = Var(0)*0.01, Var(0)*0.01
OnTop = 1
OwnPal = 1
PosType = P2
Pos = Var(1), -Enemy(0),Const(Size.Height)
Random = 0, 8
Vel = 0, -1
RemoveTime = Var(2)

[State “Å‰¹]
Type = PlaySnd
Trigger1 = Time%45 = 15
Value = 830, 0
Channel = 2

[State “Å‰¹]
Type = StopSnd
Trigger1 = Time%45 = 35
Channel = 2


[State ˆÊ’uC³]
Type = PosSet
Trigger1 = numenemy
X = Floor(Enemy(0),Pos X)
Y = Floor(Enemy(0),Pos Y)

[State “–‚½‚Á‚Ä‚È‚¢]
Type = DestroySelf
Trigger1 = Time = 1
Trigger1 = !MoveHit

[State “Åƒ_ƒ[ƒW]
Type = TargetLifeAdd
Trigger1 = Time%6 = 1
Value = -ceil(enemy,const(data.life)*0.001)  
Kill = 0

[State ‰e‚È‚µ]
Type = AssertSpecial
Trigger1 = 1
Flag = NoShadow
IgnoreHitPause = 1


[State Á–Å]
Type = ChangeState
triggerall = numenemy
Trigger1 = Time >= 333		
;Trigger2 = !Root,Alive		;Ž©•ª‚ªŽ€‚ñ‚¾‚çÁ–Å
;Trigger3 = !Enemy(0),Alive		;‘ŠŽè‚ªŽ€‚ñ‚¾‚çÁ–Å
;Trigger4 = Enemy(0),ctrl
;save for pokeball and candy states
;Trigger2 = (Enemy(0),stateno = [4110,4113]) 
;Trigger3 = (Enemy(0),stateno = [7820,7822]) 
value = 15152


;no more poison
[StateDef 15152]
Type = A
MoveType = I
Physics = N

[State ‰e‚È‚µ]
Type = AssertSpecial
Trigger1 = 1
Flag = NoShadow
IgnoreHitPause = 1

[State Šg‘å]
Type = AngleDraw
Trigger1 = 1
Value = 0
Scale = 1+0.05*Time, 1

[State “§‰ß]
Type = Trans
Trigger1 = 1
Trans = AddAlpha
Alpha = 256 - Time*16, 256

[State Á–Å]
Type = DestroySelf
Trigger1 = Time = 16



;Poison Target
[statedef 15153]
type = U
movetype = A
physics = N
ctrl = 0
sprpriority = 1


[State 0, PalFXWiz]
type = PalFX
trigger1 = 1
time = 480
add = 100,0,100
mul = 120,20,124
sinadd = 85,110,55,10
invertall = 0
color = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = time = 1
movetype = H       ;I,A,H

[State 0, HitDef]
type = HitDef
trigger1 = time =0
attr = C,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = f        ;HLAFD+-
guardflag =         ;HLA
;affectteam = E          ;B,E,F
;animtype = light         ;light,medium,hard,back,up,diagup
;air.animtype = light
priority = 4,Hit
damage = 0,0
pausetime = 0 ,0
sparkno = 1
guard.sparkno = 1
sparkxy = 0,0
hitsound = S777,123
guardsound = S777,123
ground.type = none      ;Low,Trip,None


[State 4020, StateTypeSet]
type = StateTypeSet
trigger1 = Time = 0
trigger1 = statetype = S || statetype = C
statetype = S
physics = S
ignorehitpause = 1

[State 4020, StateTypeSet]
type = StateTypeSet
trigger1 = Time = 0
trigger1 = statetype = A || statetype = L
statetype = A 
physics = A
ignorehitpause = 1

[State 4020, PosSet]
type = Posfreeze
trigger1 = 1
ignorehitpause = 1

[State 4020, 1]
type = ChangeAnim2
trigger1 = !time
trigger1 = time = 0;!hitshakeover
value = 3110+(statetype = A || statetype = L)
ignorehitpause = 1


[State 0, VelSet]
type = VelSet
trigger1 = statetype = S || statetype = C
x = -3
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = statetype = a
x = -1
y = -3


[State 0, HitVelSet]
type = hitVelSet
trigger1 = !time
x = 1
y = 1
ignorehitpause = 1 

[State 4020, 2]
type = ChangeAnim
trigger1 =time = 5; HitShakeOver
value = ifelse(statetype = A,5030,5010)
ignorehitpause = 1

[State 4020, 6]
type = SelfState
trigger1 = time = 5;HitShakeOver
value = ifelse(statetype = A,5050,5001)
ignorehitpause = 1









;poipole projectile
[Statedef 4000] ;not 40
type = A
movetype = A
physics = N
anim = 34

;fires the top pin on it's head that homes in on the player with a poisoning after effect leaving the target vulnerable, projectile is slow

[State 40: NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 40: Turn]
type = Turn
trigger1 = (P2Dist X < 10)

[State 40: VelSet]
type = VelSet
trigger1 = (!Time)
x = 3

[State 40: VelAdd]
type = VelAdd
trigger1 = (P2Dist X < 0) && (Vel X > -6)
x = -0.2

[State 40: VelAdd]
type = VelAdd
trigger1 = (P2Dist X > 0) && (Vel X < 6)
x = 0.2

[State 40: VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y > Pos Y) && (Vel Y < 6)
y = 0.2

[State 40: VelAdd]
type = VelAdd
trigger1 = (EnemyNear, Pos Y <= Pos Y) && (Vel Y > -6)
y = -0.2


[State 40, projetile]
type = Hitdef
trigger1 = time=0
attr = S, SP
damage    = 20,10
p2stateno = 6000
animtype  = Hard
getpower  = 30,30
givepower = 50,50
Hitflag=MAF
guardflag = MA
pausetime = 2,8
sparkno = 2
sparkxy = -10, -10
hitsound   = 2,5
;guardsound = 6,0
guard.sparkno = 40
ground.type = High
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -6
airguard.velocity = -3.5,0
air.type = High
air.velocity = -3.5,-6.5
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
air.fall = 1
envshake.time = 10
envshake.ampl = 5

[State 0, ChangeState]
type = ChangeState
trigger1 = movecontact
value = 4001
ctrl = 0


[State 0, ChangeState]
type = ChangeState
trigger1 = time = 300
value = 4002
ctrl = 0

;[State 40: DestroySelf]
;type = DestroySelf
;trigger1 = (MoveContact) || (Time > 300) ;5 seconds
;ignorehitpause = 1

;brittle poipole projectile breaks
[Statedef 4001] ;not 40
type = A
movetype = I
physics = N
anim = 340
velset = 0,0

[State 0, AngleDraw]
type = AngleDraw
trigger1 =1
value = var(10)

[State 0, Trans]
type = Trans
trigger1 = 1
trans = add
ignorehitpause=1

[State 0, NotHitBy]
type = NotHitBy
trigger1 =1
value = SCA

[State 2000, assertspecial]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 2000, end]
type = destroyself
trigger1 = !animtime

;harmless explosion
[Statedef 4002] ;not 40
type = A
movetype = A
physics = N
anim = 341

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S3,5


[State 2000, end]
type = destroyself
trigger1 = animelem =4

;poipole poison effect
[statedef 6000]
type = A
movetype = H
physics = N
anim = 5300
ctrl = 0
velset = 0,0

[State 0, PalFX]
type = PalFX
trigger1 = time = 0
time = 300
add = 100,0,100
mul = 120,25,125
sinadd = 85,110,55,40
invertall = 0
color = 0
ignorehitpause = 0


[state 6000, airgrav]
type = veladd
trigger1 = statetype = A
y = .5

[state 6000, stand]
type = statetypeset
trigger1 = statetype != S && pos y >= 0
statetype = S
physics = S

[state 6000, stopvel]
type = velset
trigger1 = statetype = S && vel x != 0 && vel y != 0
x = 0
y = 0

[state 6000, ypos]
type = posset
trigger1 = pos y != 0 && statetype = S
y = 0


[State 0, LifeAdd]
type = LifeAdd
trigger1 = gametime%4=1
value = -1


[state 6000, end]
type = selfstate
trigger1 = time >= 300
trigger1 = statetype = S
trigger2 = life = 0
value = 0
ctrl = 1




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

;nihilego target  
[Statedef 22510]
type    = A
movetype= H
physics = N
velset = 0,0
sprpriority = 3

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time =0
value = 27777


;shocked
[Statedef 22511]
type    = A
movetype= H
physics = N
velset = 0,0
sprpriority = 3


[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time =0
value = 27778


[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 0, PalFXWiz]
type = PalFX
trigger1 = 1
time = 10
add = 100,100,180
mul = 256,256,256
sinadd = -80,-80,-80,10
invertall = 0
color = 0

[State 0, AngleSet]
type = AngleSet
trigger1 = time%3 = 1 
value = random%15




;nihilego target drop 
[Statedef 22515]
type    = A
movetype= H
physics = A
velset = 0,3
sprpriority = 3


[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time =0
value = 27777


[State 0, SelfState]
type = SelfState
trigger1 = time >=0
value =5050

;target ready to eat
[Statedef 22516]
type    = A
movetype= H
physics = N
ctrl = 0
sprpriority = 3


[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time =0
value = 27777

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 0, PalFXWiz]
type = PalFX
trigger1 = 1
time = 1
add = -100,-100,-100
mul = 250,224,120
sinadd = -10,-10,-10,10
invertall = 0
color = 0


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


;getting nommed
[Statedef 22517]
type    = A
movetype= H
physics = N
ctrl = 0
sprpriority = 3

[State 0, AngleDraw]
type = AngleDraw
trigger1 = time >= 0
trigger1 = time < 10
value = 0
scale = 0.8,0.8

[State 0, AngleDraw]
type = AngleDraw
trigger1 = time >= 10
trigger1 = time < 20
value = 0
scale = 0.6,0.6

[State 0, AngleDraw]
type = AngleDraw
trigger1 = time >= 20
trigger1 = time < 30
value = 0
scale = 0.5 ,0.5

[State 0, AngleDraw]
type = AngleDraw
trigger1 = time >= 30
trigger1 = time < 60
value = 0
scale = 0.3 ,0.3

[State 0, Trans]
type = Trans
trigger1 = Time = [0,62]
trans =  add
alpha = 256-ceil(5*time),0


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

[State 0, ScreenBound]
type = null;ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time =0
value = 27777

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 0, PalFXWiz]
type = PalFX
trigger1 = 1
time = 1
add = -100,-100,-100
mul = 250,224,120
sinadd = -10,-10,-10,10
invertall = 0
color = 0


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


;nihilego eats target
[Statedef 22518]
type    = A
movetype= H
physics = N
ctrl = 0
sprpriority = 3

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

[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 = 1
value = 5150

[State 0, PosSet]
type = PosSet
trigger1 = 1
y = 9999;-9999
persistent = 1

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
ignorehitpause =1
persistent =1


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

[State 0, SelfState]
type = selfState
trigger1 = 1
value = 5150
ctrl = 0

;nilhilego helper summon
[Statedef 22500]
type    = A
movetype= H
physics = N
velset = 0,0
sprpriority = 3
anim = 320

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 1
scale = 1.5,1.5
ignorehitpause = 1
persistent = 1



[State 0, ChangeAnim]
type = ChangeAnim
trigger1 =anim = 320 
trigger1 = !animtime
value = 322

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 25011
ID = 25011
pos = 0,-80
sprpriority = 2
postype = p2
removetime = 45
bindtime = 1

[State 730, Modify]
type = ModifyExplod
trigger1 = time < 10
ID = 25011
scale = 20/(time-.10),20/(time-.10)

[State 0, VelSet]
type = VelSet
trigger1 = anim = 322
trigger1 = time = 0
x = 0
y = 65

[State 0, VelSet]
type = Veladd
trigger1 = 1
y = 3

[State 2501]
type = Turn
trigger1 = Facing = -1

[State 2502]
type = PlaySnd
trigger1 = time =0
value = S30, 3
volume = 255

[State 2501]
type = HitDef
trigger1 = numenemy
trigger1 = !time
trigger1 = enemy,power >=1000
damage = 0,0
attr = S, HT
hitflag = MAFD
numhits = 0
sparkno = -1

[State 2501]
type = TargetBind
trigger1 = movehit
pos = 0,-30

[State 0, ScreenBound]
type =null; ScreenBound
trigger1 = movehit
value = 1
movecamera = 1,0

[State 0, TargetState]
type = TargetState
triggerall = NumTarget;()
trigger1 =movehit
value = 22510

;hit tar
 [State 2502, 1]
type = ChangeState
triggerall = NumTarget;()
trigger1 = movehit
value = 22503


[State 0, HitBy]
type = notHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1
 

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

[State 2502, 1]
type = ChangeState
trigger1 = Pos Y >= 0
value = 22502




;---------------------------------------------------------------------------
;land and summon shockwaves
[Statedef 22502]
type = S
movetype = A
physics = N
sprpriority = 5
anim = 322
velset = 0,0


[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 1
scale = 1.5,1.5
ignorehitpause = 1
persistent = 1



[State 2502, Explod]
type = Explod
trigger1 = time = 0
anim = F62
scale = 7,1
sprpriority = 100

[State 2502, PosSet]
type = PosSet
trigger1 = pos y > 0
y = 0

[State 2502]
type = PlaySnd
trigger1 = time = 0
value = S0,22
volume = 255

[State 2502, EnvShake]
type = EnvShake
trigger1 = Time = 0
Time = 10
ampl = 20

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

[State 2503, 1]
type = ChangeState
trigger1 = time = 15
value = 22505

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

;drop movehit nil
[Statedef 22503]
type = A
movetype = I
physics = N
sprpriority = -5
;velset = 0,-5
anim = 323

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 1
scale = 1.5,1.5
ignorehitpause = 1
persistent = 1


[State 2501]
type = TargetBind
triggerall = numtarget
trigger1 = target,stateno != 22518
trigger1 = target,stateno != 22515
pos = 0,-30

[State 0, ScreenBound]
type = null;ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0

[State 0, VarSet]
type = VarSet
triggerall =numenemy
trigger1 = time =0
v = 21    
value = enemy,power

[State 0, VarSet]
type = VarSet
triggerall =numenemy
trigger1 = time =0
v = 22    
value = ifelse(var(21) >= 5000, 5, floor(var(21)/1000))


[State 0, VelSet]
type = VelSet
triggerall = numhelper
trigger1 = numhelper(22777)
x = 0
y = 0

[State 0, VelSet]
type = VelSet
triggerall = numhelper
trigger1 = !numhelper(22777) 
x = 0
y = -5

[State 0, Helper]
type = Helper
triggerall = !numexplod(22777)
triggerall = numhelper(22777) = 0
trigger1 = time = 3
helpertype = normal ;player
name = "shock caller"
ID = 22777
stateno = 22777
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999



[State 0, TargetLifeAdd]
type = TargetLifeAdd
triggerall = numhelper(22780)
trigger1 = Time%5 =1
trigger1 = time = [3,103]
value = - ceil(var(22) * enemy,lifemax *.007);.010
kill = 0
absolute = 1

[State 0, TargetLifeAdd]
type = Targetpoweradd
triggerall = numhelper(22780)
trigger1 = time >= 4
value = - 9999999


[State 0, PlaySnd]
type = PlaySnd
triggerall = NumTarget
triggerall = numhelper(22780)
;triggerall = Target,stateno = 22511 
trigger1 = Time%5 =1
trigger1 = time = [3,103]
value = S3050,1
volumescale = 225
channel = 5

[State 0, HitAdd]
type = HitAdd
triggerall =numhelper(22780)
trigger1 = Time%5 =1
trigger1 = time = [3,103]
value = 1

;target held
[State 0, TargetState]
type = TargetState
triggerall = NumTarget;()
trigger1 = time = [1,3]
value = 22510;+6*(target,life <=  10)


[State 0, Explod]
type = Explod
triggerall = NumTarget;()
triggerall = Target,stateno = 22516 
trigger1 = time%1 = 1
trigger2 = time%2 =1
anim = 1911
ID = 1911
pos = 0,0
postype = p2 ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,-random%5
accel = 0,-random%2
random = 50,100
removetime = -2
pausemovetime = 0
scale = .5,.5
sprpriority = 5
ontop = 0
ownpal = 1
removeongethit = 0

[State 0, Helper]
type = Helper
triggerall = numtarget
trigger1 = target,stateno = 22518
helpertype = normal ;player
name = "portal 2"
ID = 50121
stateno = 50121
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
scale = 1,1


;target held
[State 0, TargetState]
type = TargetState
triggerall = NumTarget;()
triggerall = Target,stateno = 22510
trigger1 = time > 3 && time <= 103
value = 22511+5*(target,life <=  10)

;target held
[State 0, TargetState]
type = TargetState
triggerall = NumTarget;()
trigger1 = time > 103
value = 22510+6*(target,life <=  10)


;time to eat
[State 0, TargetState]
type = changeState
triggerall = NumTarget;()
trigger1 = time > 120
trigger1 = (target,life <=  10)
value = 22520




;target released
[State 0, TargetState]
type = TargetState
triggerall = NumTarget;()
trigger1 = time >= 150
;trigger1 = time >= 199
value =cond(target,life <=  10,22518,22515)

[State 0, TargetDrop]
type = TargetDrop
triggerall = numtarget
trigger1 = target,stateno = 22515

[State 2503, 3]
type = DestroySelf
trigger1 = time = 180










;return no hit nil
[Statedef 22505]
type = A
movetype = I
physics = N
sprpriority = 5
velset = 0,-5
anim = 323

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 1
scale = 1.5,1.5
ignorehitpause = 1
persistent = 1


[State 2503, 3]
type = DestroySelf
trigger1 = time = 250


;shocker caller
[Statedef 22777]
type = A
movetype = I
physics = N
anim = 41114
sprpriority = -5

[State 0, BindToParent]
type = BindToParent
triggerall = numhelper
trigger1 = numhelper(22500)
time = 1
pos = 0,-20

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 41115
ID = 41115
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 999999
removetime = -1
pausemovetime = 9999
scale = 1,1
sprpriority = 10
ontop = 1
ownpal = 1
removeongethit = 0

[State 0, VarSet]
type = VarSet
triggerall =numenemy
trigger1 = time =0
v = 21    
value = enemy,power

[State 0, VarSet]
type = VarSet
triggerall =numenemy
trigger1 = time =0
v = 22    
value = ifelse(var(21) >= 5000, 20, floor(var(21)/1000))

[State 0, Helper]
type = Helper
trigger1 = Time%5 =1
trigger1 = time = [0,100]
helpertype = normal ;player
name = "shocker atk"
ID = 22780
stateno = 22780
pos = 0,0
postype = p1    
facing = 1
keyctrl = 0
ownpal = 0
supermovetime =9999
pausemovetime = 9999

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time >= 100
id = 41115
ignorehitpause = 1


[State 0, ChangeState]
type = ChangeState
trigger1 = (Time >= 101) 
value = 22778
ctrl = 0

[State 80: DestroySelf]
type = DestroySelf
trigger1 = (stateno = [0,9999])
ignorehitpause = 1

;Nilhilego noms
[Statedef 22520]
type    = A
movetype= A
physics = N
velset = 0,0
sprpriority = 3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 89
value = S7777,1
channel = 3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 49
value = S4000,15
volumescale = 225
channel = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = s8000,0
volumescale = 225
channel = 4

[State 0, AngleDraw]
type = AngleDraw
trigger1 = time = [0,10]
value = 1
scale = 1.5,1.5
ignorehitpause = 1


[State 0, AngleDraw]
type = AngleDraw
trigger1 = time = [11,21]
value = 1
scale = 1.6,1.6
ignorehitpause = 1


[State 0, AngleDraw]
type = AngleDraw
trigger1 = time = [22,31]
value = 1
scale = 1.8,1.8
ignorehitpause = 1


[State 0, AngleDraw]
type = AngleDraw
trigger1 = time = [32,51]
value = 1
scale = 1.7,1.7
ignorehitpause = 1


[State 0, AngleDraw]
type = AngleDraw
trigger1 = time >= 52
value = 1
scale = 1.6,1.6
ignorehitpause = 1


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 323


[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 2501]
type = Turn
trigger1 = Facing = -1

[State 2501]
type = TargetBind
trigger1 = time = [0,10]
pos = 0,-30

[State 2501]
type = TargetBind
trigger1 = time = [11,21]
pos = 0,-40

[State 2501]
type = TargetBind
trigger1 = time = [22,31]
pos = 0,-45

[State 2501]
type = TargetBind
trigger1 = time = [32,41]
pos = 0,-50

[State 2501]
type = TargetBind
trigger1 = time >= 42
pos = 0,-60

[State 0, ScreenBound]
type = ScreenBound
trigger1 = movehit
value = 1
movecamera = 1,1

[State 0, TargetState]
type = TargetState
triggerall = NumTarget;()
trigger1 = time = 0
value = 22517

[State 0, TargetState]
type = TargetState
triggerall = NumTarget;()
trigger1 = time = 50
value = 22518

[State 0, HitBy]
type = notHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1
 
[State 0, Helper]
type = Helper
trigger1 = time = 89
helpertype = normal ;player
name = "portal 2"
ID = 50121
stateno = 50121
pos = 0,-50
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
scale = 1,1


[State 0, Trans]
type = Trans
trigger1 = Time = [90,150]
trans =  add
alpha = 256-ceil(2*time)+90,0

[State 0, Trans]
type = Trans
trigger1 = Time >= 150
trans =  add
alpha = 0,0

[State 0, ChangeState]
type = Changeanim
trigger1 =time >= 180
value =1


[State 0, DestroySelf]
type = DestroySelf
trigger1 = time >= 250





;shocker helper done
[Statedef 22778]
type = A
movetype = I
physics = N
anim = 41116
sprpriority = 10

[State 0, Explod]
type = Explod
trigger1 = time =0
anim = 1
ID = 22277
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 9999999
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0



[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 0, BindToParent]
type = BindToParent
triggerall = numhelper
trigger1 = numhelper(22250)
time = 1
pos = 0,-20
 
[State 80: DestroySelf]
type = DestroySelf
trigger1 = Animtime = 0
trigger2 = !numhelper(22250)
ignorehitpause = 1


;shock attack
[Statedef 22780] 
type = A
movetype = A
physics = N
velset = 0,0
anim = 41118

[State 0, HitDef]
type = HitDef
triggerall = numhelper
triggerall = helper(22777),stateno = 22777
trigger1 = !time
attr = S,HA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = up          ;light,medium,hard,back,up,diagup
air.animtype = light
priority = 20,Hit
damage = ceil(helper(22777),var(22) * enemy,lifemax *.010) ,ceil(helper(22777),var(22) * enemy,lifemax *.001)
givepower = -999999,-1000
pausetime = 0 ,0
sparkno = s1
guard.sparkno = S1
sparkxy = 0,0
hitsound = S3050,1
guardsound = S3050,0
ground.type = High      ;Low,Trip,None
ground.slidetime = 5
ground.hittime = 5
air.hittime = 20
guard.ctrltime = 20
ground.velocity = 0,-2
air.velocity = 0,0
fall = 0
fall.recover = 0
palfx.time = 5
palfx.invertall = 1
palfx.color = 0
palfx.sinadd = -80,-80,-80,10
palfx.mul = 256,256,256
palfx.add = 100,100,180
envshake.time = 0

[State 0, DestroySelf]
type = DestroySelf
triggerall = numhelper
trigger1= helper(22777),stateno = 22778
ignorehitpause =1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time >= 5
trigger2 = movecontact
trigger3 = !numhelper(22777)
ignorehitpause = 1



;=========================================================================
; Air Dash Smoke
;=========================================================================
[Statedef 952]
type = A
movetype = I
physics = N
ctrl = 0
velset = 0, 0
sprpriority = 2

[state 952, Change Animation]
type = changeanim
trigger1 = !time
value = 6010

[state 952, Get Parent Animation]
type = varset
trigger1 = !time
sysvar(1) = parent,sysvar(1)

[state 952, Parent Bind]
type = bindtoparent
trigger1 = !time
pos = 0, parent,const(size.mid.pos.y)*const(size.yscale)*.5

[state 952, Angle]
type = angledraw
trigger1 = var(0) := var(0) + 1
scale = 0.2, 0.4 + (var(0) * 0.035)

[state 952, Transparency]
type= trans
trigger1 = var(0)
trans = addalpha
alpha = 256 - (16 * var(0)), 256

[state 952, Set Velocity]
type = velset
trigger1 = sysvar(1)
x = cond(sysvar(1) = 1, -6.640625, 6.640625) * (0.9 ** time)

[state 952, Destroy]
type = destroyself
trigger1 = time > 16

;=========================================================================
; beam outline
;=========================================================================
[Statedef 953]
type = A
movetype = I
physics = N
ctrl = 0
velset = 0, 0
sprpriority = 2

[state 952, Change Animation]
type = changeanim
trigger1 = !time
value = 6010

[state 952, Get Parent Animation]
type = varset
trigger1 = !time
sysvar(1) = parent,sysvar(1)

[state 952, Parent Bind]
type = bindtoparent
trigger1 = !time
pos = 0, parent,const(size.mid.pos.y)*const(size.yscale)*.5

[state 952, Angle]
type = angledraw
trigger1 = var(0) := var(0) + 1
scale = 0.2, 0.4 + (var(0) * 0.035)

[state 952, Transparency]
type= trans
trigger1 = var(0)
trans = addalpha
alpha = 256 - (16 * var(0)), 256

[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = 5
add = 0,80,0
mul = 256,256,256
sinadd = 0,25,0,5
invertall = 0
color = 0

[state 952, Set Velocity]
type = velset
trigger1 = sysvar(1)
x = cond(sysvar(1) = 1, -6.640625, 6.640625) * (0.9 ** time)

[state 952, Destroy]
type = destroyself
trigger1 = time > 16




;=========================================================================
; Land Smoke
;=========================================================================
[Statedef 6010]
type = A
movetype = I
physics = N
ctrl = 0
velset = 0, 0
sprpriority = 1

[state 6010, Change Animation]
type = changeanim
trigger1 = anim != 1
value = 1

[state 6010, Parent Bind]
type = bindtoparent
trigger1 = !time
pos = 0, 2

[state 6010, Effect]
type = explod
trigger1 = !time
ID = 6010
anim = 6010
postype = p1
pos = 0, 0
bindtime = 1
ownpal = 1
sprpriority = -5
supermovetime = -1
pausemovetime = -1

[state 6010, Modify Effect]
type = modifyexplod
trigger1 = numexplod(6010)
scale = 0.25 + 0.035 * time, 0.05
trans = addalpha
alpha = 256 - 22 * time, 256
ID = 6010

[state 6010, Destroy]
type = removeexplod
trigger1 = time > 12

[state 6010, Destroy]
type = destroyself
trigger1 = time > 12


;========================================================================================================================================================================================================================================================================================================================================================================================================================
; System Helper
;========================================================================================================================================================================================================================================================================================================================================================================================================================
[Statedef 40000]
type = A
movetype = I
physics = N
ctrl = 0
velset = 0, 0
sprpriority = -10

[state 4000, Change Animation]
type = changeanim
trigger1 = anim != 1
value = 1

[state 4000, Parent Bind]
type = bindtoparent
trigger1 = 1
pos = 0, -8

[state 4000, Turn]
type = turn
trigger1 = facing != root,facing

[state 4000, Restrict Air Jump]
type = varset
trigger1 = root,var(39) && !var(0)
trigger1 = root,prevstateno != 945
trigger1 = root,stateno = 50 || root,stateno = 120 || root,stateno = 140 || root,stateno = 5040 || root,stateno = 5210
;trigger1 = root,time = 2
trigger1 = root,ctrl
trigger1 = root,command = "holdup" || root,command = "holddown" || root,command = "holdfwd" || root,command = "holdback"
var(0) = 1

[state 4000, Reset Air Jump]
type = varset
trigger1 = Root,statetype != a
trigger1 = var(0)
trigger1 = root,command != "holdup"
trigger1 = root,command != "holddown"
trigger1 = root,command != "holdfwd"
trigger1 = root,command != "holdback"
var(0) = 0

[state 4000, Restrict Air Jump]
type = varset
trigger1 = root,stateno = 945 || root,prevstateno = 945
var(1) = 1

[state 4000, Reset Air Jump]
type = varset
triggerall = var(1)
trigger1 = root,statetype != A
trigger2 = root,stateno = 5210
trigger2 = root,time <= 1
var(1) = 0

[state 4000, Restrict Air Dash]
type = varset
trigger1 = root,stateno = 950
;trigger1 = root,time <= 1
var(2) = 1

[state 4000, Reset Air Dash]
type = varset
triggerall = var(2)
trigger1 = root,statetype != A
trigger2 = root,stateno = 5210
trigger2 = root,time <= 1
var(2) = 0

[state 4000, Detect Air Chaining]
type = varset
trigger1 = root,var(39)
trigger1 = root,stateno = [200, 699]
trigger1 = root,prevstateno = [200, 699]
var(3) = 1

[state 4000, Reset Air Chaining]
type = varset
triggerall = var(3)
trigger1 = !root,var(39)
trigger2 = root,statetype != A
var(3) = 0

[state 4000, Detect Air Jump Attack or Air Dash Attack]
type = varset
trigger1 = root,var(39)
trigger1 = root,stateno = [200, 699]
trigger1 = var(1) || var(2)
var(4) = 1

[state 4000, Reset Air Dash Attack]
type = varset
triggerall = var(4)
trigger1 = !root,var(39)
trigger2 = root,statetype != A
var(4) = 0

[state 4000, Not the Beginning]
type = varadd
trigger1 = sysvar(0) < 2 && roundstate >= 2
sysvar(0) = 1


[state 4000, Death Sound]
type = varset
trigger1 = root,time >= 2 * !root,alive
sysvar(1) = !root,alive

;portal
[Statedef 50120]
type = A
ctrl = 0
anim = 10120
velset = 0,0
movetype = I
physics = N
sprpriority = -5

[state a]
type = Trans
trigger1 = 1
trans = addalpha
alpha = ifelse((time = [0,130]),256,256-time+80),256

[state a]
type = angledraw
trigger1 = time = [0,100]
scale = (4 * .01*time), (4 * .01*time)

[state a]
type = angledraw
trigger1 = time = [101,120]
scale = 4, 4

[state a]
type = angledraw
trigger1 = time = [121,225]
scale = 4 - (8 * (time-121)*0.00444444), 4 - (8 * (time-121)*0.00444444)

[state a]
type = AssertSpecial
trigger1 = 1
flag = noshadow

;---------------------[当身関係]
[state a]
type = nothitby
trigger1 = 1
value = SCA
time = -1

;---------------------[]
[State 200, 7]
type = destroyself
trigger1 = time = 225

;portal 2
[Statedef 50121]
type = A
ctrl = 0
anim = 10120
velset = 0,0
movetype = I
physics = N
sprpriority = -5

[State 0, BindToParent]
type = BindToParent
trigger1 = numhelper
trigger1 = numhelper(22500)
time = 1
pos = 0,-30


[state a]
type = Trans
trigger1 = 1
trans = addalpha
alpha = ifelse((time = [0,130]),256,256-time+80),256

[state a]
type = angledraw
trigger1 = time = [0,100]
scale = (4 * .01*time), (4 * .01*time)

[state a]
type = angledraw
trigger1 = time = [101,120]
scale = 4, 4

[state a]
type = angledraw
trigger1 = time = [121,225]
scale = 4 - (8 * (time-121)*0.00444444), 4 - (8 * (time-121)*0.00444444)

[state a]
type = AssertSpecial
trigger1 = 1
flag = noshadow

;---------------------[当身関係]
[state a]
type = nothitby
trigger1 = 1
value = SCA
time = -1

;---------------------[]
[State 200, 7]
type = destroyself
trigger1 = time = 225
trigger2 = numhelper(22500) =0


;==========================================================================
;[Info]
;author = "Inktrebuchet" 
;versiondate = 12/13/2018                  
;goal = Detect enemy projectile (helper). For use with AI. ( M.U.G.E.N | IKEMEN )
;       敵の発射物（helper）を検出する。 AIで使用する場合。
;==========================================================================
;                Notes
;==========================================================================
;notes:
;-Enemy projectile now has a PlayerID use PlayerID(helper(33333333),var(3)) as a redirect.
;
;base examples of trigger use: 
;
;;Enemy projectile helper distance from character.
;trigger1 = PlayerIDExist(helper(33333333),var(3))
;trigger1 = PlayerID(helper(33333333),var(3)), p2bodydist x 
;
;;Enemy projectile helper velocity.
;trigger1 = PlayerIDExist(helper(33333333),var(3))
;trigger1 = PlayerID(helper(33333333),var(3)), Vel X
;
;==========================================================================
;                Helper var usage.
;==========================================================================
; numhelper(33333333) Variable usage:
; This is a record of the variables that are used
;
; var(0) - highest playerid + 1
; var(3) - projectile player id while it exists
; 
;==========================================================================
[Statedef 33333333]
type = A
movetype = I
physics = N
ctrl = 0
velset = 0, 0
 
;==========================================================================
;                Config Section
;==========================================================================
anim = 1                   ; blank animation
 
;==========================================================================
[state 33333333, Clipboard] 
type = DisplayToClipboard
trigger1 = 1
text = "Highest Playerid = %d , Projectile helper's PlayerId = %d\nBy Inktrebuchet"
params = var(0)-1, var(3)
 
;==========================================================================
;                Detect Enemy Projectile Helper
;==========================================================================
[State 33333333, 0]
type = Null
trigger1 = var(0) = 0
trigger1 = (var(0) := id)
ignorehitpause = 1
 
[state 33333333, 1] 
type = varadd
trigger1 = PlayerIdExist(var(0)) 
trigger2 = PlayerIdExist(var(0)+1) 
trigger3 = PlayerIdExist(var(0)+2) 
trigger4 = PlayerIdExist(var(0)+3) 
trigger5 = PlayerIdExist(var(0)+4) 
trigger6 = PlayerIdExist(var(0)+5) 
trigger7 = PlayerIdExist(var(0)+6) 
trigger8 = PlayerIdExist(var(0)+7) 
trigger9 = PlayerIdExist(var(0)+8) 
trigger10 = PlayerIdExist(var(0)+9) 
trigger11 = PlayerIdExist(var(0)+10) 
trigger12 = PlayerIdExist(var(0)+11) 
trigger13 = PlayerIdExist(var(0)+12) 
trigger14 = PlayerIdExist(var(0)+13) 
trigger15 = PlayerIdExist(var(0)+14) 
trigger16 = PlayerIdExist(var(0)+15) 
trigger17 = PlayerIdExist(var(0)+16) 
trigger18 = PlayerIdExist(var(0)+17) 
trigger19 = PlayerIdExist(var(0)+18) 
trigger20 = PlayerIdExist(var(0)+19) 
trigger21 = PlayerIdExist(var(0)+20) 
trigger22 = PlayerIdExist(var(0)+21) 
trigger23 = PlayerIdExist(var(0)+22) 
trigger24 = PlayerIdExist(var(0)+23) 
trigger25 = PlayerIdExist(var(0)+24) 
trigger26 = PlayerIdExist(var(0)+25) 
v = 0
value = 1
ignorehitpause = 1
 
[State 33333333, 2]
type = Null
triggerall = PlayerIdExist(Root,ID)
trigger1 = PlayerIdExist(var(0)-1)
trigger1 = IfElse(root,teamside = 1, PlayerID(var(0)-1),teamside = 2, PlayerID(var(0)-1),teamside = 1)
trigger1 = PlayerID(var(0)-1),hitdefattr = ASC, NP, SP, HP
trigger1 = var(3) := (var(0)-1)
trigger2 = PlayerIdExist(var(0)-2)
trigger2 = IfElse(root,teamside = 1, PlayerID(var(0)-2),teamside = 2, PlayerID(var(0)-2),teamside = 1)
trigger2 = PlayerID(var(0)-2),hitdefattr = ASC, NP, SP, HP
trigger2 = var(3) := (var(0)-2)
trigger3 = PlayerIdExist(var(0)-3)
trigger3 = IfElse(root,teamside = 1, PlayerID(var(0)-3),teamside = 2, PlayerID(var(0)-3),teamside = 1)
trigger3 = PlayerID(var(0)-3),hitdefattr = ASC, NP, SP, HP
trigger3 = var(3) := (var(0)-3)
trigger4 = PlayerIdExist(var(0)-4)
trigger4 = IfElse(root,teamside = 1, PlayerID(var(0)-4),teamside = 2, PlayerID(var(0)-4),teamside = 1)
trigger4 = PlayerID(var(0)-4),hitdefattr = ASC, NP, SP, HP
trigger4 = var(3) := (var(0)-4)
trigger5 = PlayerIdExist(var(0)-5)
trigger5 = IfElse(root,teamside = 1, PlayerID(var(0)-5),teamside = 2, PlayerID(var(0)-5),teamside = 1)
trigger5 = PlayerID(var(0)-5),hitdefattr = ASC, NP, SP, HP
trigger5 = var(3) := (var(0)-5)
trigger6 = PlayerIdExist(var(0)-6)
trigger6 = IfElse(root,teamside = 1, PlayerID(var(0)-6),teamside = 2, PlayerID(var(0)-6),teamside = 1)
trigger6 = PlayerID(var(0)-6),hitdefattr = ASC, NP, SP, HP
trigger6 = var(3) := (var(0)-6)
trigger7 = PlayerIdExist(var(0)-7)
trigger7 = IfElse(root,teamside = 1, PlayerID(var(0)-7),teamside = 2, PlayerID(var(0)-7),teamside = 1)
trigger7 = PlayerID(var(0)-7),hitdefattr = ASC, NP, SP, HP
trigger7 = var(3) := (var(0)-7)
trigger8 = PlayerIdExist(var(0)-8)
trigger8 = IfElse(root,teamside = 1, PlayerID(var(0)-8),teamside = 2, PlayerID(var(0)-8),teamside = 1)
trigger8 = PlayerID(var(0)-8),hitdefattr = ASC, NP, SP, HP
trigger8 = var(3) := (var(0)-8)
trigger9 = PlayerIdExist(var(0)-9)
trigger9 = IfElse(root,teamside = 1, PlayerID(var(0)-9),teamside = 2, PlayerID(var(0)-9),teamside = 1)
trigger9 = PlayerID(var(0)-9),hitdefattr = ASC, NP, SP, HP
trigger9 = var(3) := (var(0)-9)
trigger10 = PlayerIdExist(var(0)-10)
trigger10 = IfElse(root,teamside = 1, PlayerID(var(0)-10),teamside = 2, PlayerID(var(0)-10),teamside = 1)
trigger10 = PlayerID(var(0)-10),hitdefattr = ASC, NP, SP, HP
trigger10 = var(3) := (var(0)-10)
ignorehitpause = 1
 
[State 33333333, BindToRoot]
type = BindToRoot
trigger1 = PlayerIdExist(Root,ID)
time = 1
facing = 1
pos =0,-2
ignorehitpause = 1 

;==========================================================================
[Statedef 4444444]
type = A
movetype = I
physics = N
ctrl = 0
velset = 0, 0
 
;==========================================================================
;                Config Section
;==========================================================================
anim = 1                   ; blank animation
 
;==========================================================================

;==========================================================================
;                Detect Enemy Projectile Helper
;==========================================================================
[State 4444444, 0]
type = Null
trigger1 = var(0) = 0
trigger1 = (var(0) := id)
ignorehitpause = 1
 
[state 4444444, 1] 
type = varadd
trigger1 = PlayerIdExist(var(0)) 
trigger2 = PlayerIdExist(var(0)+1) 
trigger3 = PlayerIdExist(var(0)+2) 
trigger4 = PlayerIdExist(var(0)+3) 
trigger5 = PlayerIdExist(var(0)+4) 
trigger6 = PlayerIdExist(var(0)+5) 
trigger7 = PlayerIdExist(var(0)+6) 
trigger8 = PlayerIdExist(var(0)+7) 
trigger9 = PlayerIdExist(var(0)+8) 
trigger10 = PlayerIdExist(var(0)+9) 
trigger11 = PlayerIdExist(var(0)+10) 
trigger12 = PlayerIdExist(var(0)+11) 
trigger13 = PlayerIdExist(var(0)+12) 
trigger14 = PlayerIdExist(var(0)+13) 
trigger15 = PlayerIdExist(var(0)+14) 
trigger16 = PlayerIdExist(var(0)+15) 
trigger17 = PlayerIdExist(var(0)+16) 
trigger18 = PlayerIdExist(var(0)+17) 
trigger19 = PlayerIdExist(var(0)+18) 
trigger20 = PlayerIdExist(var(0)+19) 
trigger21 = PlayerIdExist(var(0)+20) 
trigger22 = PlayerIdExist(var(0)+21) 
trigger23 = PlayerIdExist(var(0)+22) 
trigger24 = PlayerIdExist(var(0)+23) 
trigger25 = PlayerIdExist(var(0)+24) 
trigger26 = PlayerIdExist(var(0)+25) 
v = 0
value = 1
ignorehitpause = 1
 
[State 444444, 2]
type = Null
triggerall = PlayerIdExist(Root,ID)
trigger1 = PlayerIdExist(var(0)-1)
trigger1 = IfElse(root,teamside = 1, PlayerID(var(0)-1),teamside = 2, PlayerID(var(0)-1),teamside = 1)
trigger1 = PlayerID(var(0)-1),hitdefattr = ASC, NT, ST, HT
trigger1 = var(3) := (var(0)-1)
trigger2 = PlayerIdExist(var(0)-2)
trigger2 = IfElse(root,teamside = 1, PlayerID(var(0)-2),teamside = 2, PlayerID(var(0)-2),teamside = 1)
trigger2 = PlayerID(var(0)-2),hitdefattr = ASC, NT, ST, HT
trigger2 = var(3) := (var(0)-2)
trigger3 = PlayerIdExist(var(0)-3)
trigger3 = IfElse(root,teamside = 1, PlayerID(var(0)-3),teamside = 2, PlayerID(var(0)-3),teamside = 1)
trigger3 = PlayerID(var(0)-3),hitdefattr = ASC, NT, ST, HT
trigger3 = var(3) := (var(0)-3)
trigger4 = PlayerIdExist(var(0)-4)
trigger4 = IfElse(root,teamside = 1, PlayerID(var(0)-4),teamside = 2, PlayerID(var(0)-4),teamside = 1)
trigger4 = PlayerID(var(0)-4),hitdefattr = ASC, NT, ST, HT
trigger4 = var(3) := (var(0)-4)
trigger5 = PlayerIdExist(var(0)-5)
trigger5 = IfElse(root,teamside = 1, PlayerID(var(0)-5),teamside = 2, PlayerID(var(0)-5),teamside = 1)
trigger5 = PlayerID(var(0)-5),hitdefattr = ASC, NT, ST, HT
trigger5 = var(3) := (var(0)-5)
trigger6 = PlayerIdExist(var(0)-6)
trigger6 = IfElse(root,teamside = 1, PlayerID(var(0)-6),teamside = 2, PlayerID(var(0)-6),teamside = 1)
trigger6 = PlayerID(var(0)-6),hitdefattr = ASC, NT, ST, HT
trigger6 = var(3) := (var(0)-6)
trigger7 = PlayerIdExist(var(0)-7)
trigger7 = IfElse(root,teamside = 1, PlayerID(var(0)-7),teamside = 2, PlayerID(var(0)-7),teamside = 1)
trigger7 = PlayerID(var(0)-7),hitdefattr = ASC, NT, ST, HT
trigger7 = var(3) := (var(0)-7)
trigger8 = PlayerIdExist(var(0)-8)
trigger8 = IfElse(root,teamside = 1, PlayerID(var(0)-8),teamside = 2, PlayerID(var(0)-8),teamside = 1)
trigger8 = PlayerID(var(0)-8),hitdefattr = ASC, NT, ST, HT
trigger8 = var(3) := (var(0)-8)
trigger9 = PlayerIdExist(var(0)-9)
trigger9 = IfElse(root,teamside = 1, PlayerID(var(0)-9),teamside = 2, PlayerID(var(0)-9),teamside = 1)
trigger9 = PlayerID(var(0)-9),hitdefattr = ASC, NT, ST, HT
trigger9 = var(3) := (var(0)-9)
trigger10 = PlayerIdExist(var(0)-10)
trigger10 = IfElse(root,teamside = 1, PlayerID(var(0)-10),teamside = 2, PlayerID(var(0)-10),teamside = 1)
trigger10 = PlayerID(var(0)-10),hitdefattr = ASC, NT, ST, HT
trigger10 = var(3) := (var(0)-10)
ignorehitpause = 1
 
[State 444444, BindToRoot]
type = BindToRoot
trigger1 = PlayerIdExist(Root,ID)
time = 1
facing = 1
pos =0,-2
ignorehitpause = 1 

;neo star helper
;-------------------------------------------------------------------------------
[Statedef 37130]
type = A
movetype = I
physics = N
juggle = 0
velset = 0,0
ctrl = 0
anim = 36
poweradd = 0

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 45


[State 3425,1]
type = NotHitBy
trigger1 = 1
value = SCA

[State 34223,1]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0

[State 3000,1]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 2412,1]
type = PlaySnd
trigger1 = time = 0
value = s30,4

[State 1900,1]
type = AfterImage
trigger1 = time = 0
time = 20
length = 5
palbright = 50,50,50
palcontrast = 50,50,50
paladd = 0,0,0
palmul = .70,.70,.70
timegap = 3
framegap = 1
trans = add

[State 1211,1]
type = VelSet
trigger1 = time = 0
x = 4
y = -8

[State 1211,2]
type = VelAdd
trigger1 = time > 0
y = .5

[State 1324,2]
type = Changestate
trigger1 = time >= 20
value = 37131




;neo shift
[Statedef 37131]
type = A
movetype = A
physics = N
juggle = 0
velset = 0,0
ctrl = 0
anim = 36
poweradd = 0


[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 45

[State 3425,1]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3000,1]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 3412,1]
type = Turn
trigger1 = p2dist X < -10

[State 2412,1]
type = PlaySnd
trigger1 = timemod = 7,0
value = s0,28

[State 0, Helper]
type = Helper
trigger1 = timemod = 5,0
helpertype = normal ;player
name = "attack stars"
ID = 37132
stateno = 37132
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999



[State 2412,1]
type = DestroySelf
trigger1 = time >= 125

;homing stars
[Statedef 37132]
type = A
movetype = A
physics = N
juggle = 0
velset = 0,0
ctrl = 0
anim = 37
poweradd = 0


[state a]
type = velset
triggerall = NumEnemy 
trigger1 = time <= 3
x = 20*((p2dist x)/(abs(p2dist x) + abs(p2dist y - 20) + 0.000001)) +2
y = 20*((p2dist y + enemy,const(size.mid.pos.y))/(abs(p2dist x) + abs(p2dist y + enemy,const(size.mid.pos.y)) + 0.000001))





[State 0, VarSet]
type = null;VarSet
trigger1 = numenemy
v = 8    ;fv = 10
value = ceil((EnemyNear,Pos X - Pos X)*facing/5)


 [State 0, VelSet]
    type = null;Veladd
    trigger1 = var(8) <= 25
    trigger1 = EnemyNear,Pos x - Pos x != [-20,20]
    trigger1 = time <= 3
 x = floor(cond((var(8) <= 25 && var(8) > 1),5,1))
; x = ifelse(((EnemyNear,Pos X - Pos X)*facing/5) > 25, ifelse(((EnemyNear,Pos X - Pos X)*facing/5) <= 25 && ((EnemyNear,Pos X - Pos X)*facing/5) > 2,15,1))
    y = ceil(((EnemyNear,Pos Y - Pos Y+EnemyNear,Const(size.mid.pos.y))/20)+((EnemyNear,statetype=C)||(EnemyNear,statetype=L)))

 [State 0, VelSet]
    type = null;Veladd
    trigger1 = var(8) > 25
    trigger1 = EnemyNear,Pos x - Pos x != [-20,20]
    trigger1 = time <= 3
    x = abs(var(8))/4
; x = ifelse(((EnemyNear,Pos X - Pos X)*facing/5) > 25, ifelse(((EnemyNear,Pos X - Pos X)*facing/5) <= 25 && ((EnemyNear,Pos X - Pos X)*facing/5) > 2,15,1))
    y = ((EnemyNear,Pos Y - Pos Y+EnemyNear,Const(size.mid.pos.y))/20)+((EnemyNear,statetype=C)||(EnemyNear,statetype=L))

 [State 0, VelSet]
    type = null;Velset
    trigger1 = EnemyNear,Pos x - Pos x = [-20,20]
    trigger1 = time <= 3
    x = EnemyNear,Pos x - Pos x
    y = ((EnemyNear,Pos Y - Pos Y+EnemyNear,Const(size.mid.pos.y))/20)+((EnemyNear,statetype=C)||(EnemyNear,statetype=L))






[State 0, HitDef]
type = HitDef
trigger1 = 1
attr = A,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = light          ;light,medium,hard,back,up,diagup
air.animtype = light
getpower = 0,0
animtype = light
damage = 5,2
pausetime = 0,6
sparkno = -1
guard.sparkno = -1
sparkxy = 0,0
hitsound = s0,27
guardsound = s2,0
ground.type = low
ground.slidetime = 20
ground.hittime = 20
ground.velocity = -3,0
air.velocity = -2,-4
air.fall = 1
fall.recover = 0


[State 0, AfterImage]
type = AfterImage
trigger1 =1
time = -1
length = 10
palcontrast = 200,200,200
paladd = 5,5,5
palmul = 1,1,1
timegap = 1
framegap = 2
trans = "add" ;"none","add1","sub"


[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 200


[State 0, ChangeState]
type = ChangeState
trigger1 = movecontact
trigger2 = (Vel Y > 0) && (Pos Y >= 0)
value =37133
ctrl = 0




;homing stars hit
[Statedef 37133]
type = A
movetype = I
physics = N
velset = 0,0
ctrl = 0
anim = 8210
poweradd = 0


[State 0, DestroySelf]
type = DestroySelf
trigger1 = !animtime





;Weakness Policy guage 
[StateDef 24000]
type=A
velset=0,0
anim=1
ctrl=0


[state 24000,AssertSpecial]
type=AssertSpecial
trigger1=1
flag=noshadow
flag2=invisible


[state 24000,PlayerPush]
type=PlayerPush
trigger1=1
value=0


[state 24000,]
type=NotHitBy
trigger1=1
value=SCA


[state 24000,]
type=RemoveExplod
trigger1=numhelper(7050)
ID=24006
ignorehitpause=1

[state 24000,]
type=RemoveExplod
trigger1=numhelper(7050)
ID=24000
ignorehitpause=1

[state 24000,]
type=Explod
trigger1=!numhelper(7050)&&!numexplod(24006)
ID=24006
anim=15501
sprpriority=-36
postype=Left
pos=ifelse(TeamSide=1,25,300),40;
Facing=ifelse(TeamSide=1,1,-1)
scale=0.75,0.5
bindtime=-1
ownpal=1
ontop=0
removetime=ifelse((RoundState!=2),1,999999999)
supermovetime=1000
pausemovetime=999999999
ignorehitpause=1


[state 24000,]
type=Explod
trigger1=!numhelper(7050) && !numexplod(24000)
ID=24000
anim=15502
sprpriority=-34
postype=Left
pos=ifelse(TeamSide=1,27,298),40
Facing=ifelse(TeamSide=1,1,-1)
scale=0.39,0.5
bindtime=-1
ownpal=1
ontop=0
removetime=ifelse((RoundState!=2),1,999999999)
supermovetime=1000
pausemovetime=999999999
ignorehitpause=1


[state 24000,]
type=Explod
trigger1=!numhelper(7050) && !numexplod(24004)
ID=24004
Anim=15506
Sprpriority=-35
Postype=Left
pos=ifelse(TeamSide=1,30,295),42
Facing=ifelse(TeamSide=1,-1,1)
scale=-.75*(root,var(40)*2000**-1),0.5;.55*(root,var(40)/2000),0.5
trans=add
removetime=1
supermovetime=99999999
pausemovetime=99999999
bindtime=-1
ownpal=1
ontop=0
ignorehitpause=1

[state 24000,]
type=Explod
trigger1=!numhelper(7050)
trigger1=root,var(40) >= 2000
trigger1=time%10 =1
ID=24004
Anim=15505
Sprpriority=-33
Postype=Left
pos=ifelse(TeamSide=1,30,295),42
Facing=ifelse(TeamSide=1,-1,1)
scale=-.75,0.5;.55*(root,var(40)/2000),0.5
trans=add
removetime=1
supermovetime=99999999
pausemovetime=99999999
bindtime=-1
ownpal=1
ontop=0
ignorehitpause=1

[state 24000,]
type=Explod
trigger1=!numhelper(7050)
trigger1=1
ID=24014
Anim=18889
Sprpriority=-33
Postype=Left
pos=ifelse(TeamSide=1,25,295),52
Facing=ifelse(TeamSide=1,-1,1)
scale=.03,0.03;.55*(root,var(40)/2000),0.5
removetime=1
supermovetime=99999999
pausemovetime=99999999
bindtime=-1
ownpal=1
ontop=0
ignorehitpause=1


[state 24000,]
type=RemoveExplod
trigger1=numhelper(7050)
ID=24004
ignorehitpause=1

[state 24000,]
type=RemoveExplod
trigger1=numhelper(7050)
ID=24014
ignorehitpause=1

[state 24000,DestroySelf]
type=DestroySelf
trigger1 = numhelper(7050)
;trigger1 = root,!ailevel





;Catch 22
[Statedef 22222]
type = A
anim = 1
velset = 0, 0

[State 8100, Bind]
type = bindtoroot
trigger1 = time

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 10    ;fv = 10
value = life

[State 0, ParentVarAdd]
type = ParentVarAdd
triggerall = var(10) > root,life
trigger1 = root,stateno = [5000,5300]
trigger2 = root,ctrl = 1 
v =  40  
value = var(10) - root,life 
ignorehitpause =1

[State 8100, End]
type = destroyself
trigger1 = anim !=1 
ignorehitpause = 1

[State 8100, End]
type = destroyself
triggerall = time >= 1
trigger1 = root,stateno = [5000,5300]
trigger2 = root,ctrl = 1 


; Winner
[Statedef 18500]
type = A
ctrl = 0
anim = 1
velset = 0,0
movetype = I
physics = N
sprpriority = 50

[State 18500, Assertspecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1

[State 18500, Assertspecial]
type = AssertSpecial
trigger1 = time >= 0
flag = NoBarDisplay

[State 18500, Bind]
type = bindtoroot
trigger1 = 1
pos = 0,0

[State 18500, Playsnd]
type = PlaySnd
trigger1 = time = 0
value = s9000,1
volumescale = 255

[State 18500, Assertspecial]
type = AssertSpecial
trigger1 = time = [0,720]
flag = roundnotover

[State 18500, Assertspecial]
type = AssertSpecial
trigger1 = time >= 0
flag = nomusic

[State 18500, Varadd]
type = varadd
trigger1 = time <= 0;32
var(1) = 8

[State 18500, Varset]
type = varset
trigger1 = time = 0;32
var(1) = 256

[State 18500, Varadd]
type = varadd
trigger1 = time >= 0;32
trigger1 = time < 64;96
var(1) = -8

[State 18500, Varset]
type = varset
trigger1 = time = 64;96
var(1) = -256

;[State 18500, AllPalfx]
;type = AllPalfx
;trigger1 = time <= 64;96
;time = 1
;add = var(1),var(1),var(1)



[State 18500, FX]
type = Explod
trigger1 = time = 64;96
anim = 7010;8010
id = 18510
sprpriority = 3
postype = left
pos = 0,0
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
scale = 0.5,0.5
ontop = 1

[State 18500, FX]
type = Explod
trigger1 = time = 65;96
anim = 31203
id = 18510
sprpriority = -5
postype = left
pos = 0,0
bindtime = -1
removetime = -2
under = 1
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
scale = 5000,5000
ontop = 0


[State 18500, FX]
type = Explod
trigger1 = time = 64;96
anim = 7011
id = 18511
sprpriority = 3
postype = left
pos = 0,0
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
scale = 0.5,0.5
ontop = 1

[State 18500, FX]
type = Explod
trigger1 = time = 80;112
anim = 7012
id = 18512
sprpriority = 3
postype = left
pos = 0,0
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
scale = 0.5,0.5
ontop = 1

[State 18500, FX]
type = Explod
trigger1 = time = 80;112
anim = 7013
id = 18513
sprpriority = 3
postype = left
pos = 0,0
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
scale = 0.5,0.5
ontop = 1

[State 18500, W]
type = Explod
trigger1 = time = 88;120
anim = 7040
id = 18540
sprpriority = 3
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
ontop = 1

[State 18500, Modify FX]
type = ModifyExplod
trigger1 = 1
ID = 18540
scale = fvar(0),fvar(0)

[State 18500, Varset]
type = varset
trigger1 = time = 0
fvar(0) = 1

[State 18500, Varadd]
type = varadd
trigger1 = time > 88;120
trigger1 = time <= 93;125
fvar(0) = -0.15

[State 18500, I]
type = Explod
trigger1 = time = 93;125
anim = 7041
id = 18541
sprpriority = 3
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
ontop = 1

[State 18500, Modify FX]
type = ModifyExplod
trigger1 = 1
ID = 18541
scale = fvar(1),fvar(1)

[State 18500, Varset]
type = varset
trigger1 = time = 0
fvar(1) = 1

[State 18500, Varadd]
type = varadd
trigger1 = time > 93;125
trigger1 = time <= 98;130
fvar(1) = -0.15

[State 18500, N1]
type = Explod
trigger1 = time = 98;130
anim = 7042
id = 18542
sprpriority = 3
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
ontop = 1

[State 18500, Modify FX]
type = ModifyExplod
trigger1 = 1
ID = 18542
scale = fvar(0),fvar(0)

[State 18500, Varset]
type = varset
trigger1 = time = 97;129
fvar(0) = 1

[State 18500, Varadd]
type = varadd
trigger1 = time > 98;130
trigger1 = time <= 103;135
fvar(0) = -0.15

[State 18500, N2]
type = Explod
trigger1 = time = 103;135
anim = 7042
id = 18543
sprpriority = 3
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
ontop = 1

[State 18500, Modify FX]
type = ModifyExplod
trigger1 = 1
ID = 18543
scale = fvar(1),fvar(1)

[State 18500, Varset]
type = varset
trigger1 = time = 102;134
fvar(1) = 1

[State 18500, Varadd]
type = varadd
trigger1 = time > 103;135
trigger1 = time <= 108;140
fvar(1) = -0.15


[State 18500, E]
type = Explod
trigger1 = time = 108;140
anim = 7043
id = 18544
sprpriority = 3
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
ontop = 1

[state 18500, Modify FX]
type = ModifyExplod
trigger1 = 1
ID = 18544
scale = fvar(0),fvar(0)

[State 18500, Varset]
type = varset
trigger1 = time = 107;139
fvar(0) = 1

[State 18500, Varadd]
type = varadd
trigger1 = time > 108;140
trigger1 = time <= 113;145
fvar(0) = -0.15

[State 18500, R]
type = Explod
trigger1 = time = 113;145
anim = 7044
id = 18545
sprpriority = 3
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
ontop = 1

[State 18500, Modify FX]
type = ModifyExplod
trigger1 = 1
ID = 18545
scale = fvar(1),fvar(1)

[State 18500, Varset]
type = varset
trigger1 = time = 112;144
fvar(1) = 1

[State 18500, Varadd]
type = varadd
trigger1 = time > 113;145
trigger1 = time <= 118;150
fvar(1) = -0.15

[State 18500, FX]
type = Explod
trigger1 = time = 88;120
anim = 7030
id = 18530
sprpriority = 4
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
ontop = 1

[state 18500, Modify FX]
type = ModifyExplod
trigger1 = 1
ID = 18530
scale = fvar(2),fvar(2)

[State 18500, Remove FX]
type = RemoveExplod
trigger1 = time >= 128;140
ID = 18530

[State 18500, Varset]
type = varset
trigger1 = time = 0
fvar(2) = 0

[State 18500, Varadd]
type = varadd
trigger1 = time > 88;120
fvar(2) = 0.05

[State 18500, Win Portrait]
type = Explod
trigger1 = time = 148;180
anim = 7071
id = 18570
sprpriority = 3
postype = left
pos = 80,25
bindtime = -1
ownpal = 1
pausemovetime = 9999
supermovetime = 9999
scale = 0.5,0.5
ontop = 1

[State 18500, W]
type = Explod
trigger1 = time = 148;180
anim = 7050
id = 18550
sprpriority = 4
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0.8,0.8
ontop = 1

[State 18500, I]
type = Explod
trigger1 = time =148; 180
anim = 7051
id = 18551
sprpriority = 4
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0.8,0.8
ontop = 1

[State 18500, N]
type = Explod
trigger1 = time = 148;180
anim = 7052
id = 18552
sprpriority = 4
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0.8,0.8
ontop = 1

[State 18500, N]
type = Explod
trigger1 = time = 148;180
anim = 7053
id = 18553
sprpriority = 4
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0.8,0.8
ontop = 1

[State 18500, E]
type = Explod
trigger1 = time = 148;180
anim = 7054
id = 18554
sprpriority = 4
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0.8,0.8
ontop = 1

[State 18500, N]
type = Explod
trigger1 = time = 148;180
anim = 7055
id = 18555
sprpriority = 4
postype = left
pos = 160,120
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0.8,0.8
ontop = 1

[State 18500, FX]
type = Explod
trigger1 = time = 108;240
anim = 7031
id = 18531
sprpriority = 4
postype = left
pos = -40,0
vel = 0,5
under = 0
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0.8,0.8
ontop = 1

[State 18500, FX]
type = Explod
trigger1 = time = 148;280
anim = 7032
id = 18532
sprpriority = 4
postype = left
pos = -40,240
vel = 0,-5
under = 0
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0.8,0.8
ontop = 1

[State 18500, FX]
type = Explod
trigger1 = time = 108;240
anim = 7020
id = 18520
sprpriority = 3
postype = left
pos = 0,0
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0.5,0.5
ontop = 1

[State 18500, FX]
type = Explod
trigger1 = time = 148;280
anim = 7021
id = 18521
sprpriority = 3
postype = left
pos = 0,0
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0.5,0.5
ontop = 1

[State 18500, WINNER back]
type = null;Explod
trigger1 = time = 160;310
anim = 7045
id = 18547
sprpriority = 3
postype = left
pos = 10,40
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0.3,0.3
ontop = 1

[State 18500, Varrandom]
type = varrandom
trigger1 = time = 0
v = 5
range = 0,7

[State 18500, Dialogue]
type = null;Explod
trigger1 = time = 160;310
anim = 7060+(var(5))
id = 18560
sprpriority = 5
postype = left
pos = 0,0
bindtime = -1
under = 0
ownpal = 1
pausemovetime = 99999
supermovetime = 99999
scale = 0.5,0.5
ontop = 1





