; _________________________________________
;| B.B. Hood by Jmorphman                  |
; ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
;==============================================================================================
;=======================================<HELPER STATES>========================================
;==============================================================================================

;=====================<FLOWERS (CROUCHING)>=========================
[StateDef 10011]
type = S
physics = N
moveType = I
anim = 10011
ctrl = 0
velSet = 0,0
sprPriority = 1

[State 10011, BindToRoot]
type = BindToRoot
trigger1 = 1
ignoreHitPause = 1

[State 10011, DestroySelf]
type = DestroySelf
trigger1 = Root, StateNo != 11 && Root, StateNo != 13
trigger2 = Root, Anim != 11
ignoreHitPause = 1



;=====================<FLOWERS (INTRO)>=========================
[StateDef 11191]
type = S
physics = N
moveType = I
anim = ifElse(IsHelper(11191), 11191, 12191)
ctrl = 0
velSet = 0,0
sprPriority = ifElse(IsHelper(11191), -2, 5)

[State 11191, DestroySelf]
type = DestroySelf
trigger1 = !AnimTime
ignoreHitPause = 1



;=====================<FLOWERS (WIN 4/5/6)>=========================
[StateDef 11184]
type = S
physics = N
moveType = I
anim = ifElse(IsHelper(11184), 11184, 12184)
ctrl = 0
velSet = 0,0
sprPriority = ifElse(IsHelper(11184), -2, 5)

[State 11184, DestroySelf]
type = DestroySelf
trigger1 = Root, StateNo != [184,186]
ignoreHitPause = 1



;=====================<GUNFIRE SOUND PLAYER>=========================
[StateDef 10220]
type = A
physics = N
moveType = I
anim = 1
velSet = 0,0
ctrl = 0

[State 10220, Gunfire sound]
type = PlaySnd
trigger1 = (Root, StateNo != [3000, 3050]) && Root, StateNo != 3413
trigger1 = !Time
value = 220,0
channel = 0

[State 10220, Gunfire sound (Cool Hunting)]
type = PlaySnd
trigger1 = (Root, StateNo = [3000, 3050]) || Root, StateNo = 3413
trigger1 = !Time
value = 3000, 1
channel = 0
loop = 1

[State 10220, StopSnd]
type = StopSnd
trigger1 = Root, StateNo = 220 || Root, StateNo = 420
trigger1 = Root, AnimElemTime(18) = 6
trigger2 = Root, StateNo = 620
trigger2 = Root, AnimElem = 9
trigger3 = Root, StateNo = 621
trigger3 = Root, AnimElemTime(9) = 6
trigger4 = (Root, StateNo = 1501 && Root, Anim = 1501) || (Root, StateNo = 1531 && Root, Anim = 1531)
trigger4 = Root, AnimElem = 13
trigger5 = Root, StateNo = 1532
trigger5 = Root, AnimElem = 13
trigger6 = Root, StateNo = 2900
trigger6 = Root, AnimElem = 10
trigger7 = Root, StateNo = 3000 || Root, StateNo = 3050
trigger7 = Root, AnimElem = 61
trigger8 = Root, StateNo = 3412
trigger8 = Root, AnimElem = 12
trigger9 = Root, StateNo = 3413
trigger9 = Root, AnimElem = 26
trigger10 = Root, StateNo != 220
trigger10 = Root, StateNo != 420
trigger10 = Root, StateNo != 620
trigger10 = Root, StateNo != 621
trigger10 = Root, StateNo != 1501
trigger10 = Root, StateNo != 1531
trigger10 = Root, StateNo != 1532
trigger10 = Root, StateNo != 2900
trigger10 = Root, StateNo != 3000 && Root, StateNo != 3050
trigger10 = Root, StateNo != 3412
trigger10 = Root, StateNo != 3413
channel = 0
ignoreHitPause = 1

[State 10220, DestroySelf]
type = DestroySelf
trigger1 = Root, StateNo != 220
trigger1 = Root, StateNo != 420
trigger1 = Root, StateNo != 620
trigger1 = Root, StateNo != 621
trigger1 = Root, StateNo != 1501
trigger1 = Root, StateNo != [1531, 1532]
trigger1 = Root, StateNo != 2900
trigger1 = Root, StateNo != 3000 && Root, StateNo != 3050
trigger1 = Root, StateNo != 3412
trigger1 = Root, StateNo != 3413
ignoreHitPause = 1



;====================<STANDING HEAVY KICK MINE>=========================
;Falling
[StateDef 10250]
type = A
physics = N
moveType = A
ctrl = 0
anim = 10250
sprPriority = 2

[State 10250, Mine sound 1]
type = PlaySnd
trigger1 = !Time
value = 10250,0
channel = 1

[State 10250, VelSet]
type = VelSet
trigger1 = Time = 1
y = 2.5

[State 10250, VelAdd]
type = VelAdd
trigger1 = Time > 1
y = 1.5625

[State 10250, ChangeState]
type = ChangeState
trigger1 = pos y > -vel y
value = 10251


;Hitting the floor
[StateDef 10251]
type = S
physics = N
moveType = A
velSet = 0,0
sprPriority = 1

[State 10251, BBH is not hit]
type = VarSet
trigger1 = !Time
var(0) = 0

[State 10251, BBH is hit]
type = VarSet
trigger1 = Root, MoveType = H && Root, StateNo != [120,155]
var(0) = 1
ignoreHitPause = 1

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

[State 10251, Mine sound 2]
type = PlaySnd
trigger1 = !Time
value = 10250,1
channel = 3

[State 10251, ChangeState]
type = ChangeState
trigger1 = Anim = 10250 && AnimElem = 9 && !var(0)
value = 10255

[State 10251, HitBy]
type = HitBy
trigger1 = 1
value =
time = -1
ignoreHitPause = 1

[State 10251, Disappear if BBH gets hit]
type = ChangeAnim
trigger1 = Anim = 10250 && AnimElemTime(9) > 0 && var(0)
value = 10251

[State 10251, Disappear if BBH gets hit]
type = Trans
trigger1 = Anim = 10251
trans = AddAlpha
alpha = 256 - (16 * AnimElemTime(1)), 16 * AnimElemTime(1)
ignoreHitPause = 1

[State 10251, Disappear if BBH gets hit]
type = DestroySelf
trigger1 = Anim = 10251 && !AnimTime


;Active Frames
[StateDef 10255]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 1

[State 10255, Mine sound (Double Reflected)]
type = PlaySnd
trigger1 = !Time && PrevStateNo != 10251
value = 10250,1
channel = 1

[State 10255, Turn (Double Reflected)]
type = Turn
trigger1 = !Time && PrevStateNo != 10251

[State 10255, ChangeAnim (Double Reflected)]
type = ChangeAnim
trigger1 = !Time && PrevStateNo != 10251
value = 11250

[State 10255, VelSet (Initial, Double Reflected)]
type = VelSet
trigger1 = !Time && PrevStateNo != 10251
x = 3.75 * Root, const(size.xScale)
y = -1.875

[State 10255, Advance AnimElem (Double Reflected)]
type = ChangeAnim
trigger1 = AnimElemTime(2) < 0 && PrevStateNo != 10251
trigger1 = pos y > -vel y
value = 11250
elem = 2

[State 10255, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 10255, Set reflected StateNo]
type = VarSet
trigger1 = 1
sysvar(1) = 11255

[State 10255, BBH is hit]
type = VarSet
trigger1 = Root, MoveType = H && Root, StateNo != [120,155]
var(0) = 1
ignoreHitPause = 1

[State 10255, VelSet (Initial)]
type = VelSet
trigger1 = AnimElem = 10
x = 3.75 * Root, const(size.xScale)
y = -1.875

[State 10255, VelSet (Bounce off floor)]
type = VelSet
trigger1 = AnimElem = 11 && Anim = 10250
trigger2 = AnimElem = 2 && Anim = 11250
y = -vel y

[State 10255, x VelAdd]
type = VelAdd
trigger1 = AnimElemTime(10) > 0 && AnimElemTime(18) < 0 && Anim = 10250
trigger2 = AnimElemTime(9) < 0 && Anim = 11250
x = -0.048828125 * Root, const(size.xScale)

[State 10255, y VelAdd]
type = VelAdd
trigger1 = AnimElemTime(10) > 0 && AnimElemTime(11) < 0 && Anim = 10250
trigger2 = AnimElemTime(11) > 0 && AnimElemTime(17) < 0 && Anim = 10250

trigger3 = AnimElemTime(2) < 0 && Anim = 11250
trigger4 = AnimElemTime(2) > 0 && AnimElemTime(8) < 0 && Anim = 11250
y = 0.390625

[State 10255, VelSet (Final landing)]
type = VelSet
trigger1 = AnimElem = 17 && Anim = 10250
trigger2 = AnimElem = 8 && Anim = 11250
y = 0

[State 10255, VelSet (End of all movement)]
type = VelSet
trigger1 = AnimElem = 18 && Anim = 10250
trigger2 = AnimElem = 9 && Anim = 11250
x = 0

[State 10255, PosSet]
type = PosSet
trigger1 = AnimElem = 11 && Anim = 10250
trigger2 = AnimElem = 17 && Anim = 10250
trigger3 = AnimElem = 2 && Anim = 11250
trigger4 = AnimElem = 8 && Anim = 11250
y = 0

[State 10255, HitOverride]
type = HitOverride
trigger1 = !var(0)
attr = SCA,AA,AP,AT
time = -1
stateno = 10257
ignoreHitPause = 1

[State 10255, HitBy]
type = HitBy
trigger1 = !var(0)
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 10255, HitBy]
type = HitBy
trigger1 = var(0)
value =
time = -1
ignoreHitPause = 1

[State 10255, Counter Flag]
type = VarSet
trigger1 = !var(0)
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 10255, Dampener]
type = VarSet
trigger1 = !var(0)
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 10255, Miss]
type = HitDef
trigger1 = !var(0)
attr = S,NP
hitFlag =
sparkXY = -10,0

[State 10255, HitDef]
type = HitDef
trigger1 = !(Root, var(16)) && (Root, var(15) < 1)
trigger1 = !var(0)
ID = 10255
attr = S,NP
hitFlag = MAF
guardFlag = M
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 84 < 7, 7, fvar(11) * 84)), 0
getPower = ifElse(!(Root, var(13)), 144, 72) * !(Root, var(20)), 36 * !(Root, var(20))
givePower = 36, 36
pauseTime = 0,12
guard.pauseTime = 0,12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 30
ground.slideTime = 30
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
sprPriority = 2

[State 10255, StateTypeSet: Idle]
type = StateTypeSet
trigger1 = var(0)
moveType = I
ignoreHitPause = 1

[State 10255, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(10255) > 1
ID = 10255
keepOne = 1
excludeID = 10255
ignoreHitPause = 1

[State 10255, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(10255)
value = 50255
ID = 10255
ignoreHitPause = 1
persistent = 0

[State 10255, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 10256
ignoreHitPause = 1

[State 10255, ChangeState]
type = ChangeState
triggerAll = !var(0)
trigger1 = MoveReversed
trigger2 = !AnimTime
value = 10257
ignoreHitPause = 1

[State 10255, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100

[State 10255, Disappear if BBH gets hit]
type = Trans
trigger1 = var(0)
trigger1 = AnimElemTime(17) > 0
trans = AddAlpha
alpha = 256 - (16 * (AnimElemTime(17) - 1)), 16 * (AnimElemTime(17) - 1)
ignoreHitPause = 1

[State 10255, Disappear if BBH gets hit]
type = DestroySelf
trigger1 = var(0)
trigger1 = !AnimTime


;Hit Pause
[StateDef 10256]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 2
moveHitPersist = 1

[State 10256, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1

[State 10256, HitSound]
type = PlaySnd
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
value = ifElse(MoveGuarded, 3, 2), ifElse(MoveGuarded, 0, 5)
channel = 2
ignoreHitPause = 1

[State 10256, HitSpark]
type = Helper
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = ifElse(MoveGuarded, 8000, 8012)
ID = 8000
name = "Spark"
posType = P1
pos = 0, 0
facing = ifElse(PrevStateNo = 3205 || PrevStateNo = 3215, 1, -1)
ownPal = 1
size.xScale = 1
size.yScale = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 10256, Counter FX]
type = Helper
trigger1 = MoveContact = 1 && NumTarget && var(9)
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = 8290
ID = 8290
name = "Counter FX"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 10256, HitCount]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(13) = 1

[State 10256, Juggle Points]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
trigger1 = !(HitDefAttr = SCA,AT)
var(15) = 1

[State 10256, Flames]
type = Helper
trigger1 = MoveHit = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
trigger1 = var(43) := (Target, ID)
helperType = Normal
stateNo = 8150
ID = ifElse(Target, SelfAnimExist(7697), 8150, 8155)
name = "Flames"
posType = P2
facing = ifElse(PrevStateNo = 11255 || PrevStateNo = 11459 || PrevStateNo = 11655, -1, 1)
size.xScale = Root, const(size.xScale) * 0.5
size.yScale = 0.5
ownPal = 1
ignoreHitPause = 1

[State 10256, Turn]
type = Turn
trigger1 = MoveContact
trigger1 = Root, NumProjID(262144)
ignoreHitPause = 1
persistent = 0

[State 10256, ChangeState]
type = ChangeState
trigger1 = MoveContact
trigger1 = Root, NumProjID(262144)
value = sysvar(1)
ignoreHitPause = 1

[State 10256, End]
type = ChangeState
trigger1 = Time >= 0
value = 10257


;Disappear/Wait
[StateDef 10257]
type = A
physics = N
moveType = I
anim = 1
ctrl = 0
velSet = 0,0
sprPriority = 2
moveHitPersist = 1

[State 10257, Aerial Mine BindToRoot (if BBH turned after landing)]
type = BindToRoot
triggerAll = PrevStateNo = 10655
trigger1 = Root, P2dist x < 0 && Root, PrevStateNo = 650 && Root, AnimElemTime(1) >= 1
;no (anim)timing restrictions if root StateNo is not 650 AND PrevStateNo is not 650 (BBH got hit on same tick landed, I guess)
trigger2 = Root, P2dist x < 0 && Root, StateNo != 650 && Root, PrevStateNo != 650
trigger3 = Facing != Root, Facing
pos = ceil(Root, const(size.xScale) * -18) - fvar(0), -38 + fvar(1)
ignoreHitPause = 1

[State 10257, Explosion FX (Top layer)]
type = Explod
trigger1 = !Time
ID = 10256
anim = 10256
sprPriority = 3
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 10257, Explosion FX (Bottom layer)]
type = Explod
trigger1 = !Time
ID = 10256
anim = 10257
sprPriority = 3
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 10257, Explosion sound]
type = PlaySnd
trigger1 = !Time
value = 10256,0
ignorehitPause = 1

[State 10257, End]
type = DestroySelf
triggerAll = !NumExplod(10256)
trigger1 = !NumTarget
trigger2 = NumTarget
trigger2 = Target, Time <= 1 && !(Target, HitShakeOver)



;====================<MINE/MISSILE/FLAMES (TARGET)>=========================
;Hit shake
[StateDef 50255]
type = S
moveType = H
physics = N
velset = 0,0

[State 50255, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = GetHitVar(AnimType) != [3,5]
value = ifElse((GetHitVar(GroundType) = 1), 5000, 5010) + GetHitVar(AnimType)

[State 50255, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = GetHitVar(AnimType) = [3,5]
value = 5030

[State 50255, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = (GetHitVar(AnimType) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(AnimType)))
value = 5047 + GetHitVar(AnimType)

[State 50255, ChangeAnim]
type = ChangeAnim
trigger1 = Time > 0
value = Anim

[State 50255, StateTypeSet]
type = StateTypeSet
trigger1 = !Time
trigger1 = GetHitVar(yVel) != 0 || GetHitVar(fall)
trigger2 = pos y != 0
StateType = A

[State 50255, ChangeState]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yVel) = 0 && !GetHitVar(fall)
value = 50256

[State 50255, SelfState]
type = ChangeState
trigger1 = HitShakeOver
value = 50257


;Knocked back
[StateDef 50256]
type = S
moveType = H
physics = S

[State 50256, HitVelSet]
type = HitVelSet
trigger1 = !Time
x = 1

[State 50256, ChangeAnim]
type = ChangeAnim
trigger1 = !AnimTime && Anim = (ifElse((GetHitVar(GroundType) = 1), 5000, 5010) + GetHitVar(AnimType))
value = ifElse(SelfAnimExist(7697), 7697, 5005 + GetHitVar(AnimType) + (GetHitVar(GroundType) = 2) * 10)

[State 50256, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 40 && Anim = 7697
;it's supposed to be the weak recover anim, actually
;value = 5005 + GetHitVar(AnimType) + (GetHitVar(GroundType) = 2) * 10
value = 5005 + (GetHitVar(GroundType) = 2) * 10

[State 50256, VelMul]
type = VelMul
trigger1 = Time >= GetHitVar(SlideTime)
x = 0.6

[State 50256, VelSet]
type = VelSet
trigger1 = HitOver
x = 0

[State 50256, DefenseMulSet]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 50256, SelfState]
type = SelfState
trigger1 = HitOver
value = 0
ctrl = 1


;Knocked into air
[StateDef 50257]
type = A
physics = N
movetype = H
ctrl = 0
velSet = 0,0
sprPriority = 1

[State 50257, VelSet (Normal)]
type = VelSet
trigger1 = !Time
x = -3.75 * 0.8333333
y = -10

[State 50257, VelSet (Cool Hunting)]
type = VelSet
triggerAll = !Time
trigger1 = GetHitVar(chainID) = [3000,3011]
trigger2 = GetHitVar(chainID) = [13055,13056]
x = ifElse(GetHitVar(chainID) = 3001 || GetHitVar(chainID) = 3011 || GetHitVar(chainID) = 13056, -7, -4.75) * 0.8333333
y = ifElse(GetHitVar(chainID) = 13056 || (GetHitVar(chainID) = [3010,3011]), -5, -10)

[State 50257, VelSet (Apple & Gun Bomb)]
type = VelSet
trigger1 = !Time && GetHitVar(chainID) = 13426
x = 3.75 * 0.8333333 * ifElse(Facing = EnemyNear, Facing, 1, -1)
y = -15

[State 50257, ChangeAnim]
type = ChangeAnim
trigger1 = SelfAnimExist(7697) && Anim != 7697
value = 7697

[State 50257, ChangeAnim]
type = ChangeAnim
trigger1 = !SelfAnimExist(7697)
trigger1 = Anim != [5000, 5199]
trigger1 = SelfAnimExist(5030)
value = 5030

[State 50257, ChangeAnim]
type = ChangeAnim
trigger1 = !SelfAnimExist(7697) && Time < 26
trigger1 = Anim = 5030 && AnimElemTime(AnimElemNo(0)+1) = 0
value = 5030
elem = AnimElemNo(0)

[State 50257, ChangeAnim]
type = ChangeAnim
trigger1 = !SelfAnimExist(7697) && Time >= 26
trigger1 = Anim = 5030
trigger1 = SelfAnimExist(5035)
value = 5035

[State 50257, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 5035 && !AnimTime
trigger2 = !SelfAnimExist(5035)
trigger2 = Anim = 5030 && Time >= 26
value = 5050

[State 50257, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = [5050,5059]
trigger1 = vel y >= ifElse(Anim = 5050, Const720p(4), Const720p(-8))
trigger1 = SelfAnimExist(Anim + 10)
value = Anim + 10
persistent = 0

[State 50257, VelAdd]
type = VelAdd
trigger1 = Time < 14
x = 0.048828125 * 0.8333333
y = 0.732421875

[State 50257, multi-hit fix]
type = VelAdd
trigger1 = GetHitVar(chainID) = 1231 || GetHitVar(chainID) = 1281
trigger1 = Time = 0
x = 0.048828125 * 0.8333333
y = 0.732421875

[State 50257, VelSet]
type = VelSet
trigger1 = Time = 14
x = 0
y = 0

[State 50257, PosFreeze]
type = PosFreeze
trigger1 = Time = [14,26]
value = 1
ignoreHitPause = 1

[State 50257, HitBy]
type = HitBy
trigger1 = Time > 26
value =
time = 1

[State 50257, VelAdd]
type = VelAdd
trigger1 = Time > 26
y = 0.6944417953

[State 50257, Recover]
type = SelfState
trigger1 = Alive
trigger1 = command = "recovery"
trigger1 = vel y > 0 && pos y >= const(movement.air.getHit.groundRecover.ground.threshold)
value = 5200

[State 50257, ChangeState]
type = ChangeState
trigger1 = pos y > -vel y && Time > 26
value = ifElse(EnemyNear, StateNo = 820, 818, 50258)


;Hit ground from fall (fast get up)
[StateDef 50258]
type = L
moveType = H
physics = N

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[State 50258, Get up]
type = SelfState
trigger1 = Time = const(data.lieDown.time)
trigger2 = Time >= 13
value = 5120



;====================<STANDING HEAVY KICK MINE (REFLECTED)>=========================
[StateDef 11255]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 1

[State 11255, Mine sound]
type = PlaySnd
trigger1 = !Time && PrevStateNo != 11255
value = 10250,1
channel = 1

[State 11255, Turn]
type = Turn
trigger1 = !Time && PrevStateNo != 11255

[State 11255, ChangeAnim]
type = ChangeAnim
trigger1 = !Time && PrevStateNo != 11255
value = 11250

[State 11255, VelSet (Initial)]
type = VelSet
trigger1 = !Time && PrevStateNo != 11255
x = 3.75 * Root, const(size.xScale)
y = -1.875

[State 11255, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 11255, Set reflected StateNo]
type = VarSet
trigger1 = 1
sysvar(1) = 10255

[State 11255, Advance AnimElem]
type = ChangeAnim
trigger1 = AnimElemTime(2) < 0
trigger1 = pos y > -vel y
value = 11250
elem = 2

[State 11255, VelSet (Bounce off floor)]
type = VelSet
trigger1 = AnimElem = 2
y = -vel y

[State 11255, x VelAdd]
type = VelAdd
trigger1 = AnimElemTime(9) < 0
x = -0.048828125 * Root, const(size.xScale)

[State 11255, y VelAdd]
type = VelAdd
trigger1 = AnimElemTime(2) < 0
trigger2 = AnimElemTime(2) > 0 && AnimElemTime(8) < 0
y = 0.390625

[State 11255, VelSet (Final landing)]
type = VelSet
trigger1 = AnimElem = 8
y = 0

[State 11255, VelSet (End of all movement)]
type = VelSet
trigger1 = AnimElem = 9
x = 0

[State 11255, PosSet]
type = PosSet
trigger1 = AnimElem = 2
trigger2 = AnimElem = 8
y = 0

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

[State 11255, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 11255, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 11255, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 11255, Miss]
type = HitDef
trigger1 = 1
ID = sysvar(0)
affectTeam = F
attr = S,NP
hitFlag =
sparkXY = -10,0

[State 11255, HitDef]
type = HitDef
trigger1 = 1
ID = sysvar(0)
affectTeam = F
attr = S,NP
hitFlag = MAF
guardFlag = M
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 84 < 7, 7, fvar(11) * 84)), 0
getPower = ifElse(!(Root, var(13)), 144, 72) * !(Root, var(20)), 36 * !(Root, var(20))
givePower = 36, 36
pauseTime = 0,12
guard.pauseTime = 0,12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 30
ground.slideTime = 30
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
sprPriority = 2

[State 10255, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(sysvar(0)) > 1
ID = sysvar(0)
keepOne = 1
excludeID = sysvar(0)
ignoreHitPause = 1

[State 11255, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(sysvar(0))
value = 50255
ID = sysvar(0)
ignoreHitPause = 1
persistent = 0

[State 11255, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 10256
ignoreHitPause = 1

[State 11255, ChangeState]
type = ChangeState
trigger1 = MoveReversed
trigger2 = !AnimTime
value = 10257
ignoreHitPause = 1

[State 11255, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100



;====================<MALICE & MINE MINE>=========================
;Being held
[StateDef 10458]
type = A
physics = N
moveType = A
ctrl = 0
anim = 10459
sprPriority = 2

[State 10458, Disappear if BBH gets hit]
type = DestroySelf
trigger1 = Root, MoveType = H

[State 10458, ChangeState]
type = ChangeState
trigger1 = AnimElem = 2
value = 10459


;Active Frames
[StateDef 10459]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 1

[State 10459, Mine sound (Double Reflected)]
type = PlaySnd
trigger1 = !Time && PrevStateNo != 10458
value = 10250,0
channel = 1

[State 10459, Turn (Double Reflected)]
type = Turn
trigger1 = !Time && PrevStateNo != 10458

[State 10459, ChangeAnim (Double Reflected)]
type = ChangeAnim
trigger1 = !Time && PrevStateNo != 10458
value = 10459
elem = 3

[State 10459, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 10459, Set reflected StateNo]
type = VarSet
trigger1 = 1
sysvar(1) = 11459

[State 10459, BBH is hit]
type = VarSet
trigger1 = Root, MoveType = H && Root, StateNo != [120,155]
var(0) = 1
ignoreHitPause = 1

[State 10459, VelSet (Initial]
type = VelSet
trigger1 = AnimElem = 3
x = 3.75 * Root, const(size.xScale)
y = -1.875

[State 10459, x VelAdd]
type = VelAdd
trigger1 = AnimElemTime(3) > 0 && AnimElemTime(7) < 0
x = -0.048828125 * Root, const(size.xScale)

[State 10459, y VelAdd]
type = VelAdd
trigger1 = AnimElemTime(3) > 0 && AnimElemTime(7) < 0
y = 0.390625

[State 10459, VelSet (End of all movement)]
type = VelSet
trigger1 = AnimElem = 7
x = 0
y = 0

[State 10459, PosSet]
type = PosSet
trigger1 = AnimElem = 7
y = 0

[State 10459, Mine sound (Landing)]
type = PlaySnd
trigger1 = AnimElem = 7
value = 10250,1
channel = 1

[State 10459, HitOverride]
type = HitOverride
trigger1 = !var(0)
attr = SCA,AA,AP,AT
time = -1
stateno = 10257
ignoreHitPause = 1

[State 10459, HitBy]
type = HitBy
trigger1 = !var(0)
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 10459, HitBy]
type = HitBy
trigger1 = var(0)
value =
time = -1
ignoreHitPause = 1

[State 10459, Counter Flag]
type = VarSet
trigger1 = !var(0)
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 10459, Dampener]
type = VarSet
trigger1 = !var(0)
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 10459, Miss]
type = HitDef
trigger1 = !var(0)
attr = S,NP
hitFlag =
sparkXY = -10,0

[State 10459, HitDef]
type = HitDef
trigger1 = !(Root, var(16)) && (Root, var(15) < 1)
trigger1 = !var(0)
ID = 10255
attr = S,NP
hitFlag = MAF
guardFlag = M
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 84 < 7, 7, fvar(11) * 84)), 0
getPower = ifElse(!(Root, var(13)), 144, 72) * !(Root, var(20)), 36 * !(Root, var(20))
givePower = 36, 36
pauseTime = 0,12
guard.pauseTime = 0,12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 30
ground.slideTime = 30
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
sprPriority = 2

[State 10459, StateTypeSet: Idle]
type = StateTypeSet
trigger1 = var(0)
moveType = I
ignoreHitPause = 1

[State 10459, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(10255) > 1
ID = 10255
keepOne = 1
excludeID = 10255
ignoreHitPause = 1

[State 10459, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(10255)
value = 50255
ID = 10255
ignoreHitPause = 1
persistent = 0

[State 10459, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 10256
ignoreHitPause = 1

[State 10459, ChangeState]
type = ChangeState
triggerAll = !var(0)
trigger1 = MoveReversed
trigger2 = !AnimTime
value = 10257
ignoreHitPause = 1

[State 10459, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100

[State 10459, Disappear if BBH gets hit]
type = Trans
trigger1 = var(0)
trigger1 = AnimElemTime(7) > 0
trans = AddAlpha
alpha = 256 - (12 * (AnimElemTime(7) - 1)), 12 * (AnimElemTime(7) - 1)
ignoreHitPause = 1

[State 10459, Disappear if BBH gets hit]
type = DestroySelf
triggerAll = var(0)
trigger1 = !AnimTime
trigger2 = AnimElemTime(3) < 0



;====================<MALICE & MINE MINE (REFLECTED)>=========================
[StateDef 11459]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 1

[State 11459, Mine sound]
type = PlaySnd
trigger1 = !Time && PrevStateNo != 11459
value = 10250,0
channel = 1

[State 11459, Turn]
type = Turn
trigger1 = !Time && PrevStateNo != 11459

[State 11459, ChangeAnim]
type = ChangeAnim
trigger1 = !Time && PrevStateNo != 11459
value = 11459
elem = 3

[State 11459, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 11459, Set reflected StateNo]
type = VarSet
trigger1 = 1
sysvar(1) = 10459

[State 11459, VelSet (Initial]
type = VelSet
trigger1 = AnimElem = 3
x = 3.75 * Root, const(size.xScale)
y = -1.875

[State 11459, x VelAdd]
type = VelAdd
trigger1 = AnimElemTime(3) > 0 && AnimElemTime(7) < 0
x = -0.048828125 * Root, const(size.xScale)

[State 11459, y VelAdd]
type = VelAdd
trigger1 = AnimElemTime(3) > 0 && AnimElemTime(7) < 0
y = 0.390625

[State 11459, Frame Advance]
type = ChangeAnim
trigger1 = AnimElemTime(7) < 0
trigger1 = pos y > -vel y
value = 11459
elem = 7

[State 11459, VelSet (End of all movement)]
type = VelSet
trigger1 = AnimElem = 7
x = 0
y = 0

[State 11459, PosSet]
type = PosSet
trigger1 = AnimElem = 7
y = 0

[State 11459, Mine sound (Landing)]
type = PlaySnd
trigger1 = AnimElem = 7
value = 10250,1
channel = 1

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

[State 11459, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 11459, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 11459, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 11459, Miss]
type = HitDef
trigger1 = 1
ID = sysvar(0)
affectTeam = F
attr = S,NP
hitFlag =
sparkXY = -10,0

[State 11459, HitDef]
type = HitDef
trigger1 = 1
ID = sysvar(0)
affectTeam = F
attr = S,NP
hitFlag = MAF
guardFlag = M
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 84 < 7, 7, fvar(11) * 84)), 0
getPower = ifElse(!(Root, var(13)), 144, 72) * !(Root, var(20)), 36 * !(Root, var(20))
givePower = 36, 36
pauseTime = 0,12
guard.pauseTime = 0,12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 30
ground.slideTime = 30
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
sprPriority = 2

[State 11459, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(sysvar(0)) > 1
ID = sysvar(0)
keepOne = 1
excludeID = sysvar(0)
ignoreHitPause = 1

[State 11459, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(sysvar(0))
value = 50255
ID = sysvar(0)
ignoreHitPause = 1
persistent = 0

[State 11459, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 10256
ignoreHitPause = 1

[State 11459, ChangeState]
type = ChangeState
trigger1 = MoveReversed
trigger2 = !AnimTime
value = 10257
ignoreHitPause = 1

[State 11459, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100



;====================<JUMPING HEAVY KICK MINE>=========================
;Pre-attack state
[StateDef 10650]
type = A
physics = N
moveType = A
ctrl = 0
anim = 10650
sprPriority = 1

[State 10650, ChangeState]
type = ChangeState
triggerAll = Root, MoveType != H
trigger1 = AnimElem = 8
trigger1 = Root, StateNo = 650
value = 10655

[State 10650, Simulated x velocity]
type = VarAdd
trigger1 = Time >= 1
fvar(0) = 2.5 * const(size.xScale)
ignoreHitPause = 1

[State 10650, Simulated y velocity]
type = VarAdd
trigger1 = Time >= 1
fvar(1) = 1.25
ignoreHitPause = 1

[State 10650, BindToRoot]
type = BindToRoot
trigger1 = 1
pos = ceil(Root, const(size.xScale) * 18) + fvar(0), -38 + fvar(1)
ignoreHitPause = 1

[State 10650, BindToRoot (if BBH turned after landing)]
type = BindToRoot
trigger1 = Root, P2dist x < 0 && Root, PrevStateNo = 650 && Root, AnimElemTime(1) >= 1
;no (anim)timing restrictions if root StateNo is not 650 AND PrevStateNo is not 650 (BBH got hit on same tick landed, I guess)
trigger2 = Root, P2dist x < 0 && Root, StateNo != 650 && Root, PrevStateNo != 650
trigger3 = Facing != Root, Facing
value = 1200
pos = ceil(Root, const(size.xScale) * -18) - fvar(0), -38 + fvar(1)
ignoreHitPause = 1

[State 10650, HitBy]
type = HitBy
trigger1 = 1
value =
time = -1
ignoreHitPause = 1

[State 10650, Disappear if BBH gets hit/no longer in j.HK state]
type = Trans
trigger1 = Root, MoveType = H
trigger2 = Root, StateNo != 650
trans = AddAlpha
alpha = 256 - (23 * (AnimElemTime(1))), 23 * (AnimElemTime(1))
ignoreHitPause = 1

[State 10650, Disappear if BBH gets hit]
type = DestroySelf
trigger1 = !AnimTime


;Active Frames
[StateDef 10655]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 1

[State 10655, Mine sound (Double Reflected)]
type = PlaySnd
trigger1 = !Time && PrevStateNo != 10650
value = 10250,1
channel = 1

[State 10655, Turn (Double Reflected)]
type = Turn
trigger1 = !Time && PrevStateNo != 10650

[State 10655, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 10655, Set reflected StateNo]
type = VarSet
trigger1 = 1
sysvar(1) = 11655

[State 10655, BBH is hit]
type = VarSet
trigger1 = Root, MoveType = H && Root, StateNo != [120,155]
var(0) = 1
ignoreHitPause = 1

[State 10650, BindToRoot]
type = BindToRoot
trigger1 = 1
pos = ceil(Root, const(size.xScale) * 18) + fvar(0), -38 + fvar(1)
ignoreHitPause = 1

[State 10655, HitOverride]
type = HitOverride
trigger1 = !var(0)
attr = SCA,AA,AP,AT
time = -1
stateno = 10257
ignoreHitPause = 1

[State 10655, HitBy]
type = HitBy
trigger1 = !var(0)
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 10655, HitBy]
type = HitBy
trigger1 = var(0)
value =
time = -1
ignoreHitPause = 1

[State 10655, Counter Flag]
type = VarSet
trigger1 = !var(0)
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 10655, Dampener]
type = VarSet
trigger1 = !var(0)
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 10655, Miss]
type = HitDef
trigger1 = !var(0)
attr = S,NP
hitFlag =
sparkXY = -10,0

[State 10655, HitDef]
type = HitDef
trigger1 = !(Root, var(16)) && (Root, var(15) < 1)
trigger1 = !var(0)
ID = 10255
attr = S,NP
hitFlag = MAF
guardFlag = M
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 77 < 7, 7, fvar(11) * 77)), 0
getPower = ifElse(!(Root, var(13)), 144, 72) * !(Root, var(20)), 36 * !(Root, var(20))
givePower = 36, 36
pauseTime = 0,12
guard.pauseTime = 0,12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 30
ground.slideTime = 30
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
sprPriority = 2

[State 10655, StateTypeSet: Idle]
type = StateTypeSet
trigger1 = var(0)
moveType = I
ignoreHitPause = 1

[State 10655, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(10255) > 1
ID = 10255
keepOne = 1
excludeID = 10255
ignoreHitPause = 1

[State 10655, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(10255)
value = 50255
ID = 10255
ignoreHitPause = 1
persistent = 0

[State 10655, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 10256
ignoreHitPause = 1

[State 10655, ChangeState]
type = ChangeState
triggerAll = !var(0)
trigger1 = MoveReversed
trigger2 = !AnimTime
value = 10257
ignoreHitPause = 1

[State 10655, VelSet (double reflection)]
type = VelSet
trigger1 = PrevStateNo != 10650
x = 10 * const(size.xScale)
y = 5

[State 10655, Simulated x velocity]
type = VarAdd
trigger1 = PrevStateNo = 10650
fvar(0) = ifElse(Root, AnimElemTime(9) < 0, 2.5, 8) * const(size.xScale)
ignoreHitPause = 1

[State 10655, Simulated y velocity]
type = VarAdd
trigger1 = PrevStateNo = 10650
fvar(1) = ifElse(Root, AnimElemTime(9) < 0, 1.25, 4)
ignoreHitPause = 1

[State 10655, BindToRoot]
type = BindToRoot
trigger1 = PrevStateNo = 10650
pos = ceil(Root, const(size.xScale) * 18) + fvar(0), -38 + fvar(1)
ignoreHitPause = 1

[State 10655, BindToRoot (if BBH turned after landing)]
type = BindToRoot
triggerAll = PrevStateNo = 10650
trigger1 = Root, P2dist x < 0 && Root, PrevStateNo = 650 && Root, AnimElemTime(1) >= 1
;no (anim)timing restrictions if root StateNo is not 650 AND PrevStateNo is not 650 (BBH got hit on same tick landed, I guess)
trigger2 = Root, P2dist x < 0 && Root, StateNo != 650 && Root, PrevStateNo != 650
trigger3 = Facing != Root, Facing
pos = ceil(Root, const(size.xScale) * -18) - fvar(0), -38 + fvar(1)
ignoreHitPause = 1

[State 10655, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100

[State 10655, Disappear if BBH gets hit]
type = Trans
trigger1 = var(0)
trans = AddAlpha
alpha = 256 - (25 * (AnimElemTime(1))), 25 * (AnimElemTime(1))
ignoreHitPause = 1

[State 10655, Disappear if BBH gets hit]
type = DestroySelf
triggerAll = var(0)
trigger1 = !AnimTime



;====================<JUMPING HEAVY KICK MINE (REFLECTED)>=========================
[StateDef 11655]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 1

[State 11655, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 11655
elem = AnimElemNo(0)
ignoreHitPause = 1

[State 11655, Mine sound]
type = PlaySnd
trigger1 = !Time && PrevStateNo != 11655
value = 10250,1
channel = 1

[State 11655, Turn]
type = Turn
trigger1 = !Time && PrevStateNo != 11655

[State 11655, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 11655, Set reflected StateNo]
type = VarSet
trigger1 = 1
sysvar(1) = 10655

[State 11655, VelSet]
type = VelSet
trigger1 = 1
x = 2.5 * const(size.xScale)
y = 1.25

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

[State 11655, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 11655, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 11655, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 11655, Miss]
type = HitDef
trigger1 = 1
ID = sysvar(0)
affectTeam = F
attr = S,NP
hitFlag =
sparkXY = -10,0

[State 11655, HitDef]
type = HitDef
trigger1 = 1
ID = sysvar(0)
affectTeam = F
attr = S,NP
hitFlag = MAF
guardFlag = M
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 77 < 7, 7, fvar(11) * 77)), 0
getPower = ifElse(!(Root, var(13)), 144, 72) * !(Root, var(20)), 36 * !(Root, var(20))
givePower = 36, 36
pauseTime = 0,12
guard.pauseTime = 0,12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 30
ground.slideTime = 30
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
sprPriority = 2

[State 11655, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(sysvar(0)) > 1
ID = sysvar(0)
keepOne = 1
excludeID = sysvar(0)
ignoreHitPause = 1

[State 11655, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(sysvar(0))
value = 50255
ID = sysvar(0)
ignoreHitPause = 1
persistent = 0

[State 11655, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 10256
ignoreHitPause = 1

[State 11655, ChangeState]
type = ChangeState
trigger1 = MoveReversed
trigger2 = Time >= 4
value = 10257
ignoreHitPause = 1

[State 11655, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100



;====================<DOLL & BOMB DOLL BOMB>=========================
;Falling
[StateDef 10820]
type = A
physics = N
moveType = A
ctrl = 0
anim = 10820
sprPriority = 2

[State 10250, VelSet]
type = VelSet
trigger1 = !Time
y = 3.75

[State 10250, VelAdd]
type = VelAdd
trigger1 = Time > 0
y = 1.5625

[State 10250, ChangeState]
type = ChangeState
trigger1 = pos y > -vel y
value = 10821


;Hitting the floor
[StateDef 10821]
type = S
physics = N
moveType = A
velSet = 0,0
sprPriority = 2

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

[State 10821, ChangeState]
type = ChangeState
trigger1 = AnimElem = 4
value = 10822


;In air
[StateDef 10822]
type = A
physics = N
moveType = A
velSet = 0,0
sprPriority = 1

[State 10822, Doll jingle sound]
type = PlaySnd
trigger1 = !Time
value = 10820,0
channel = 0

[State 10822, VelSet]
type = VelSet
trigger1 = !Time
x = 2.5 * const(size.xScale) + 0.5 ;to make it go a little further
y = -5.625

[State 10822, VelAdd]
type = VelAdd
trigger1 = 1
x = -0.03051757813 * const(size.xScale)
y = 0.29296875

[State 10822, ChangeState]
type = ChangeState
trigger1 = pos y > -vel y
value = 10823


;Final landing
[StateDef 10823]
type = S
physics = N
moveType = A
velSet = 0,0
sprPriority = 2

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

[State 10823, HitSound]
type = PlaySnd
trigger1 = !AnimTime
value = 2,5
channel = 2

[State 10823, Hit Spark]
type = Helper
trigger1 = !AnimTime
stateNo = 8012
ID = 8000
name = "Spark"
posType = P1
pos = ifElse(P2Dist x < -64, -64, ifElse(P2Dist x < 64, ceil(P2Dist x), 64)), 0
ownPal = 1
size.xScale = 1
size.yScale = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 10823, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 21537



;====================<SMILE & MISSILE PROJECTILE>=========================
[StateDef 1005]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3

[State 1005, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 1005, Set reflected StateNo (horizontal reflection)]
type = VarSet
trigger1 = !(Enemy, NumExplod(262141)) && !(Enemy, NumExplod(262143)) && !(Enemy, NumExplod(262144))
sysvar(1) = 1015

[State 1005, Set reflected StateNo (diagonally-downwards reflection)]
type = VarSet
trigger1 = Enemy, NumExplod(262143)
sysvar(1) = 1115

[State 1005, Set reflected StateNo (diagonally-upwards reflection)]
type = VarSet
trigger1 = Enemy, NumExplod(262141)
trigger1 = var(1) := 262141
trigger2 = Enemy, NumExplod(262144)
trigger2 = var(1) := 262144
sysvar(1) = 1155

[State 1005, Timer Setup (so at Time = 0, timer = 0 too)]
type = VarSet
trigger1 = !Time && !PrevStateNo
var(12) = -1

[State 1005, Exhaust/Trail Helper]
type = Helper
trigger1 = !Time && !PrevStateNo
helperType = Normal
stateNo = 11005
ID = 11005
name = "Missile Exhaust Trail"
posType = P1
size.xScale = Root, const(size.xScale)
size.yScale = 1

[State 1005, Button Detect]
type = VarSet
trigger1= !Time && !PrevStateNo
var(10) = Root, var(10)

[State 1005, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1005 && Anim != 1015 && Anim != 1025
value = 1005 + 10 * var(10)

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

[State 1005, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 1005, VelSet]
type = VelSet
trigger1 = 1
x = ifElse(var(10) = 2, 6.25, ifElse(var(10) = 1, 5, 3.75)) * Root, const(size.xScale)
y = 0

[State 1005, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 1005, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 1005, Projectile Flag On]
type = ParentVarAdd
trigger1 = !Time && !PrevStateNo
var(39) = 1

[State 1005, Miss]
type = HitDef
trigger1 = 1
attr = S,SP
hitFlag =
sparkXY = -10,0

[State 1005, HitDef]
type = HitDef
trigger1 = !(Root, var(16)) && (Root, var(15) < 1)
ID = 1005
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 84 < 7, 7, fvar(11) * 84)), 7
getPower = ifElse(!(Root, var(13)), 144, 72) * !(Root, var(20)), 36 * !(Root, var(20))
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 14
envShake.ampl = 4
envShake.freq = 120
sprPriority = 3

[State 1005, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(1005) > 1
ID = 1005
keepOne = 1
excludeID = 1005
ignoreHitPause = 1

[State 1005, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(1005)
value = 50255
ID = 1005
ignoreHitPause = 1
persistent = 0

[State 1005, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 1006
ignoreHitPause = 1

[State 1005, Timer]
type = VarAdd
trigger1 = 1
var(12) = 1

[State 1005, Projectile Flag Off]
type = ParentVarAdd
trigger1 = MoveReversed
trigger2 = var(12) > 37
var(39) = -1

[State 1005, Projectile Dissipate]
type = ChangeState
trigger1 = MoveReversed
trigger2 = var(12) > 37
value = 1007
ignoreHitPause = 1

[State 1005, Projectile Flag Off]
type = ParentVarAdd
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100
var(39) = -1


;Hit Pause
[StateDef 1006]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3
moveHitPersist = 1

[State 1006, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1

[State 1006, HitSound]
type = PlaySnd
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
value = ifElse(MoveGuarded, 3, 2), ifElse(MoveGuarded, 0, 5)
channel = 2
ignorehitPause = 1

[State 1006, HitSpark]
type = Helper
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = ifElse(MoveGuarded, 8001, 8013)
ID = 8000
name = "Spark"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
facing = -1
ownPal = 1
size.xScale = 1
size.yScale = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 1006, Counter FX]
type = Helper
trigger1 = MoveContact = 1 && NumTarget && var(9)
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = 8290
ID = 8290
name = "Counter FX"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 1006, HitCount]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(13) = 1

[State 1006, Juggle Points]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
trigger1 = !(HitDefAttr = SCA,AT)
var(15) = 1

[State 1006, ProjContact]
type = VarSet
trigger1 = MoveContact && NumTarget
var(18) = 1

[State 1006, ProjContact]
type = ParentVarSet
triggerAll = MoveContact && NumTarget
trigger1 = Root, StateNo = [1000,1080]
var(18) = 1

[State 1006, Flames]
type = Helper
trigger1 = MoveHit = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
trigger1 = var(43) := (Target, ID)
helperType = Normal
stateNo = 8150
ID = ifElse(Target, SelfAnimExist(7697), 8150, 8155)
name = "Flames"
posType = P2
facing = ifElse(PrevStateNo = 1015 || PrevStateNo = 1115 || PrevStateNo = 1155, -1, 1)
size.xScale = Root, const(size.xScale) * 0.5
size.yScale = 0.5
ownPal = 1
ignoreHitPause = 1

[State 1006, Turn]
type = Turn
trigger1 = MoveContact
trigger1 = Root, NumProjID(262144)
ignoreHitPause = 1
persistent = 0

[State 1006, ChangeState]
type = ChangeState
trigger1 = MoveContact
trigger1 = Root, NumProjID(262144)
value = sysvar(1)
ignoreHitPause = 1

[State 1006, EnvShake]
type = EnvShake
trigger1 = Time = 1 && PrevStateNo = 1015 && !MoveGuarded
time = 14
ampl = 4
freq = 120
ignoreHitPause = 1

[State 1006, End]
type = ChangeState
trigger1 = Time >= 0 && PrevStateNo != 1015
trigger2 = Time >= 1
value = 1007


;Disappear/Wait
[StateDef 1007]
type = A
physics = N
moveType = A
anim = 1
ctrl = 0
velSet = 0,0
sprPriority = 3
moveHitPersist = 1

[State 1007, Explosion FX (Top layer)]
type = Explod
trigger1 = !Time
ID = 10256
anim = 10256
sprPriority = 4
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 1007, Explosion FX (Bottom layer)]
type = Explod
trigger1 = !Time
ID = 10256
anim = 10257
sprPriority = 4
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 1007, Projectile Flag Off]
type = ParentVarAdd
triggerAll = PrevStateNo != 3056
trigger1 = MoveHit && NumTarget
trigger1 = Target, StateNo != [50255, 50257]
trigger2 = MoveGuarded
trigger3 = IsHelper(1105) || IsHelper(1135)
var(39) = -1
persistent = 0

[State 1007, Explosion sound]
type = PlaySnd
trigger1 = !Time
value = 10256,0
ignorehitPause = 1

[State 1007, End]
type = DestroySelf
triggerAll = !NumExplod(10256)
triggerAll = PrevStateNo = 3056 || var(11) = -1 ;death flag, safe to die if child helper is done with explods
trigger1 = !NumTarget
trigger2 = NumTarget
trigger2 = Target, Time <= 1 && !(Target, HitShakeOver)



;====================<SMILE & MISSILE PROJECTILE (REFLECTED)>=========================
[StateDef 1015]
type = A
physics = N
moveType = A
anim = 1005 + 10 * var(10)
ctrl = 0
sprPriority = 3

[State 1015, Turn]
type = Turn
trigger1 = !Time && PrevStateNo != 1015

[State 1015, Timer Setup (lasts 1 tick longer than non-reflected for some reason)]
type = VarSet
trigger1 = !Time && PrevStateNo != 1015
var(12) = -2

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

[State 1015, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 1015, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1005
value = 1005

[State 1015, VelSet]
type = VelSet
trigger1 = 1
x = ifElse(var(10) = 2, 6.25, ifElse(var(10) = 1, 5, 3.75)) * Root, const(size.xScale)
y = 0

[State 1015, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 1015, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 1015, Projectile Flag Off]
type = ParentVarAdd
trigger1 = !Time && PrevStateNo != 1015
var(39) = -1

[State 1015, Miss]
type = HitDef
trigger1 = 1
ID = 1015
affectTeam = F
attr = S,SP
hitFlag =
sparkXY = -10,0

[State 1015, HitDef]
type = HitDef
trigger1 = 1
ID = 1015
affectTeam = F
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 84 < 7, 7, fvar(11) * 84)), 7
getPower = 0, 0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
envShake.time = 14
envShake.ampl = 4
envShake.freq = 120
sprPriority = 3

[State 1015, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(1015) > 1
ID = 1015
keepOne = 1
excludeID = 1015
ignoreHitPause = 1

[State 1015, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(1015)
value = 50255
ID = 1015
ignoreHitPause = 1
persistent = 0

[State 1015, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 1006
ignoreHitPause = 1

[State 1015, Timer]
type = VarAdd
trigger1 = 1
var(12) = 1

[State 1015, Projectile Dissipate]
type = ChangeState
trigger1 = MoveReversed
trigger2 = var(12) > 37
value = 1007
ignoreHitPause = 1



;====================<SMILE & MISSILE EXHAUST TRAIL>=========================
[StateDef 11005]
type = A
physics = N
moveType = I
anim = 1006
ctrl = 0
anim = 1
sprPriority = 3

[State 11005, AssertSpecial: Invisible]
type = AssertSpecial
trigger1 = 1
flag = Invisible
ignoreHitPause = 1

[State 11005, RemoveExplod]
type = RemoveExplod
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100
ID = 1006
ignoreHitPause = 1

[State 11005, Exhaust (Top layer)]
type = Explod
trigger1 = !Time
anim = 1006
ID = 1006
sprPriority = 15
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
removeTime = -1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 11005, Exhaust (Bottom layer)]
type = Explod
trigger1 = !Time
anim = 1007
ID = 1006
sprPriority = 15
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
removeTime = -1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 11005, Exhaust XY (Horizontal movement)]
type = Null
triggerAll = Parent, StateNo < 1105
trigger1 = Parent, AnimElemTime(2) < 0
trigger1 = var(35) := -16 || var(36) := 15
trigger2 = Parent, AnimElemTime(2) >= 0 && Parent, AnimElemTime(3) < 0
trigger2 = var(35) := -19 || var(36) := 10
trigger3 = Parent, AnimElemTime(3) >= 0 && Parent, AnimElemTime(4) < 0
trigger3 = var(35) := -21 || var(36) := 5
trigger4 = Parent, AnimElemTime(4) >= 0
trigger4 = var(35) := -21 || var(36) := 1

[State 11005, Exhaust XY (Diagonal movement)]
type = Null
triggerAll = Parent, StateNo >= 1105 || Parent, PrevStateNo = 1135 || Parent, PrevStateNo = 1145 || Parent, PrevStateNo = 1185
trigger1 = !(Parent, var(10))
;it won't let me use AnimElem for some reason?!?! whatever...
trigger1 = var(35) := ifElse(AnimElemNo(0) = 2 || AnimElemNo(0) = 4, -3, 1) || var(36) := ifElse(AnimElemNo(0) = 2 || AnimElemNo(0) = 4, -18, -22)
trigger2 = Parent, var(10) = 1
trigger2 = var(35) := ifElse(AnimElemNo(0) = 2 || AnimElemNo(0) = 4, -7, -6) || var(36) := ifElse(AnimElemNo(0) = 2 || AnimElemNo(0) = 4, -15, -20)
trigger3 = Parent, var(10) = 2
trigger3 = var(35) := ifElse(AnimElemNo(0) = 2 || AnimElemNo(0) = 4, -12, -10) || var(36) := ifElse(AnimElemNo(0) = 2 || AnimElemNo(0) = 4, -14, -17)
trigger4 = Parent, var(10) = 3
trigger4 = var(35) := ifElse(AnimElemNo(0) = 2 || AnimElemNo(0) = 4, -17, -16) || var(36) := ifElse(AnimElemNo(0) = 2 || AnimElemNo(0) = 4, -13, -14)

[State 11005, Exhaust XY (Diagonal-upward movement fix)]
type = Null
trigger1 = Parent, StateNo = 1155 || Parent, StateNo = 1185 || Parent, PrevStateNo = 1185
trigger1 = var(36) := var(36) * -1

[State 11005, Exhaust XY (P2 side reversed diagonal movement fix)]
type = Null
triggerAll = Parent, Facing = 1
triggerAll = Parent, StateNo = 1115 || Parent, StateNo = 1145 || (Parent, var(1) = 262141 && (Parent, StateNo = 1155 || Parent, StateNo = 1185))
trigger1 = !(Parent, var(10))
trigger1 = var(35) := ifElse(AnimElemNo(0) = 2 || AnimElemNo(0) = 4, -16, -23)
trigger2 = Parent, var(10) = 1
trigger2 = var(35) := ifElse(AnimElemNo(0) = 2 || AnimElemNo(0) = 4, -20, -30)
trigger3 = Parent, var(10) = 2
trigger3 = var(35) := ifElse(AnimElemNo(0) = 2 || AnimElemNo(0) = 4, -24, -34)
trigger4 = Parent, var(10) = 3
trigger4 = var(35) := ifElse(AnimElemNo(0) = 2 || AnimElemNo(0) = 4, -29, -40)

[State 11005, Align exhaust to missile]
type = ModifyExplod
trigger1 = 1
ID = 1006
posType = P1
pos = ceil(var(35) * Root, const(size.xScale)), var(36)

[State 11005, Trail SprPriority Level (Re)Set]
type = VarSet
trigger1 = !Time
trigger2 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 16, ifElse(Parent, var(10), 19, 22))
trigger3 = Parent, StateNo = 1015 && Parent, Time = 1
trigger4 = Parent, StateNo = 1005 && Parent, Time = 1 && Parent, PrevStateNo = 1006
trigger5 = Parent, StateNo = 1045 && Parent, Time = 1
trigger6 = Parent, StateNo = 1035 && Parent, Time = 1 && Parent, PrevStateNo = 1036
var(0) = 3

[State 11005, Self-Timer/Trail Flag Set]
type = VarSet
trigger1 = !Time
var(12) = -1

;if self's var(12) and parent's var(12) don't match, then don't spawn more trail explods
[State 11005, Self-Timer/Trail Flag Increment]
type = VarAdd
trigger1 = 1
var(12) = 1

;LP - 1, 6, 12, 22, 27, 33
;MP - 1, 5, 10, 19, 24, 28, 33
;HP - 1, 5, 9, 16, 20, 24, 28, 32, 36
;ES - 1, 5, 9, 16, 20, 24, 28, 32, 36, 40, 44
[State 11005, Trail (Top layer)]
type = Explod
triggerAll = Parent, StateNo = 1005 || Parent, StateNo = 1015 || Parent, StateNo = 1035 || Parent, StateNo = 1045
triggerAll = var(12) = Parent, var(12)
trigger1 = Parent, var(12) = 1
trigger2 = Parent, var(12) = ifElse(Parent, var(10), 5, 6)
trigger3 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 9, ifElse(Parent, var(10), 10, 12))
trigger4 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 16, ifElse(Parent, var(10), 19, 22))
trigger5 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 20, ifElse(Parent, var(10), 24, 27))
trigger6 = Parent, var(12) = 24 && Parent, var(10) >= 2
trigger7 = Parent, var(12) = 28 && Parent, var(10)
trigger8 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 32, 33)
trigger9 = Parent, var(12) = 36 && Parent, var(10) >= 2
trigger10 = Parent, var(12) = 40 && Parent, var(10) = 3
trigger11 = Parent, var(12) = 44 && Parent, var(10) = 3
anim = 11006
ID = 11006
sprPriority = var(0)
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
pos = ceil(-37 * Root, const(size.xScale)), 0
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 11005, Trail (Bottom layer)]
type = Explod
triggerAll = Parent, StateNo = 1005 || Parent, StateNo = 1015 || Parent, StateNo = 1035 || Parent, StateNo = 1045
triggerAll = var(12) = Parent, var(12)
trigger1 = Parent, var(12) = 1
trigger2 = Parent, var(12) = ifElse(Parent, var(10), 5, 6)
trigger3 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 9, ifElse(Parent, var(10), 10, 12))
trigger4 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 16, ifElse(Parent, var(10), 19, 22))
trigger5 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 20, ifElse(Parent, var(10), 24, 27))
trigger6 = Parent, var(12) = 24 && Parent, var(10) >= 2
trigger7 = Parent, var(12) = 28 && Parent, var(10)
trigger8 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 32, 33)
trigger9 = Parent, var(12) = 36 && Parent, var(10) >= 2
trigger10 = Parent, var(12) = 40 && Parent, var(10) = 3
trigger11 = Parent, var(12) = 44 && Parent, var(10) = 3
anim = 11007
ID = 11006
sprPriority = var(0)
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
pos = ceil(-37 * Root, const(size.xScale)), 0
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 11005, Trail SprPriority Level Increment]
type = VarAdd
triggerAll = Parent, StateNo = 1005 || Parent, StateNo = 1015 || Parent, StateNo = 1035 || Parent, StateNo = 1045
triggerAll = var(12) = Parent, var(12)
trigger1 = Parent, var(12) = 1
trigger2 = Parent, var(12) = ifElse(Parent, var(10), 5, 6)
trigger3 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 9, ifElse(Parent, var(10), 10, 12))
trigger4 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 16, ifElse(Parent, var(10), 19, 22))
trigger5 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 20, ifElse(Parent, var(10), 24, 27))
trigger6 = Parent, var(12) = 24 && Parent, var(10) >= 2
trigger7 = Parent, var(12) = 28 && Parent, var(10)
trigger8 = Parent, var(12) = ifElse(Parent, var(10) >= 2, 32, 33)
trigger9 = Parent, var(12) = 36 && Parent, var(10) >= 2
trigger10 = Parent, var(12) = 40 && Parent, var(10) = 3
trigger11 = Parent, var(12) = 44 && Parent, var(10) = 3
var(0) = 1

[State 11005, Diagonal Trail XY]
type = Null
trigger1 = (Parent, StateNo = 1105 || Parent, StateNo = 1115 || Parent, StateNo = 1155) && !(Parent, var(10))
trigger1 = var(37) := -19 || var(38) := -24
trigger2 = (Parent, StateNo = 1105 || Parent, StateNo = 1115 || Parent, StateNo = 1155) && Parent, var(10) = 1
trigger2 = var(37) := -22 || var(38) := -22
trigger3 = (Parent, StateNo = 1105 || Parent, StateNo = 1115 || Parent, StateNo = 1155) && Parent, var(10) = 2
trigger3 = var(37) := -25 || var(38) := -20
;trigger3 = var(37) := -21 || var(38) := -23 the original weird-looking VS coordinates
trigger4 = (Parent, StateNo = 1135 || Parent, StateNo = 1145 || Parent, StateNo = 1185)
trigger4 = var(37) := -28 || var(38) := -18
;trigger4 = var(37) := -23 || var(38) := -22 the original weird-looking VS coordinates

[State 11005, Trail XY (Diagonal-upward movement fix)]
type = Null
trigger1 = Parent, StateNo = 1155 || Parent, StateNo = 1185
trigger1 = var(38) := var(38) * -1

;LP/MP - 4, 8, 12, 16, 20, 24
;HP    - 4, 8, 12, 16, 20, 24, 28, 32
;ES    - 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52
[State 11005, Diagonal Trail (Top layer)]
type = Explod
triggerAll = Parent, StateNo = 1105 || Parent, StateNo = 1115 || Parent, StateNo = 1135 || Parent, StateNo = 1145 || Parent, StateNo = 1155 || Parent, StateNo = 1185
triggerAll = var(12) = Parent, var(12)
trigger1 = Parent, var(12) = 4
trigger2 = Parent, var(12) = 8
trigger3 = Parent, var(12) = 12
trigger4 = Parent, var(12) = 16
trigger5 = Parent, var(12) = 20
trigger6 = Parent, var(12) = 24
trigger7 = Parent, var(12) = 28 && Parent, var(10) >= 2
trigger8 = Parent, var(12) = 32 && Parent, var(10) >= 2
trigger9 = Parent, var(12) = 36 && Parent, var(10) = 3
trigger10 = Parent, var(12) = 40 && Parent, var(10) = 3
trigger11 = Parent, var(12) = 44 && Parent, var(10) = 3
trigger12 = Parent, var(12) = 48 && Parent, var(10) = 3
trigger13 = Parent, var(12) = 52 && Parent, var(10) = 3
anim = 11106
ID = 11006
sprPriority = var(0)
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
pos = ceil(var(37) * Root, const(size.xScale)), var(38)
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 11005, Diagonal Trail (Bottom layer)]
type = Explod
triggerAll = Parent, StateNo = 1105 || Parent, StateNo = 1115 || Parent, StateNo = 1135 || Parent, StateNo = 1145 || Parent, StateNo = 1155 || Parent, StateNo = 1185
triggerAll = var(12) = Parent, var(12)
trigger1 = Parent, var(12) = 4
trigger2 = Parent, var(12) = 8
trigger3 = Parent, var(12) = 12
trigger4 = Parent, var(12) = 16
trigger5 = Parent, var(12) = 20
trigger6 = Parent, var(12) = 24
trigger7 = Parent, var(12) = 28 && Parent, var(10) >= 2
trigger8 = Parent, var(12) = 32 && Parent, var(10) >= 2
trigger9 = Parent, var(12) = 36 && Parent, var(10) = 3
trigger10 = Parent, var(12) = 40 && Parent, var(10) = 3
trigger11 = Parent, var(12) = 44 && Parent, var(10) = 3
trigger12 = Parent, var(12) = 48 && Parent, var(10) = 3
trigger13 = Parent, var(12) = 52 && Parent, var(10) = 3
anim = 11107
ID = 11006
sprPriority = var(0)
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
pos = ceil(var(37) * Root, const(size.xScale)), var(38)
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 11005, Diagonal Trail SprPriority Level Increment]
type = VarAdd
triggerAll = Parent, StateNo = 1105 || Parent, StateNo = 1115 || Parent, StateNo = 1135 || Parent, StateNo = 1145 || Parent, StateNo = 1155 || Parent, StateNo = 1185
triggerAll = var(12) = Parent, var(12)
trigger1 = Parent, var(12) = 4
trigger2 = Parent, var(12) = 8
trigger3 = Parent, var(12) = 12
trigger4 = Parent, var(12) = 16
trigger5 = Parent, var(12) = 20
trigger6 = Parent, var(12) = 24
trigger7 = Parent, var(12) = 28 && Parent, var(10) >= 2
trigger8 = Parent, var(12) = 32 && Parent, var(10) >= 2
trigger9 = Parent, var(12) = 36 && Parent, var(10) = 3
trigger10 = Parent, var(12) = 40 && Parent, var(10) = 3
trigger11 = Parent, var(12) = 44 && Parent, var(10) = 3
trigger12 = Parent, var(12) = 48 && Parent, var(10) = 3
trigger13 = Parent, var(12) = 52 && Parent, var(10) = 3
var(0) = 1

;update self's var(12) with parent's, in case they resume being in sync
[State 11005, Self-Timer/Trail Flag Update (from Parent)]
type = VarSet
trigger1 = 1
var(12) = Parent, var(12)

[State 11005, Turn]
type = Turn
trigger1 = Parent, StateNo = 1015 && Parent, Time = 1
trigger2 = Parent, StateNo = 1045 && Parent, Time = 1 && Parent, PrevStateNo != [1045,1046]
trigger3 = Parent, StateNo = 1115 && Parent, Time = 1
trigger4 = Parent, StateNo = 1145 && Parent, Time = 1 && Parent, PrevStateNo != 1046 && Parent, PrevStateNo != 1145
trigger5 = Parent, StateNo = 1155 && Parent, Time = 1 && Parent, var(1) = 262141
trigger6 = Parent, StateNo = 1185 && Parent, Time = 1 && Parent, PrevStateNo != 1046 && Parent, PrevStateNo != 1185 && Parent, var(1) = 262141

[State 11005, RemoveExplod]
type = RemoveExplod
trigger1 = !Root, NumHelper(1005) && !Root, NumHelper(1035) && !Root, NumHelper(1105) && !Root, NumHelper(1135)
trigger2 = (Parent, StateNo != [1005,1006]) && Parent, StateNo != 1015
trigger2 = (Parent, StateNo != [1035,1036]) && (Parent, StateNo != [1045,1046])
trigger2 = Parent, StateNo != 1105 && Parent, StateNo != 1115 && Parent, StateNo != 1155
trigger2 = Parent, StateNo != 1135 && Parent, StateNo != 1145 && Parent, StateNo != 1185
ID = 1006
ignoreHitPause = 1

[State 11005, Trip Parent Death Flag]
type = ParentVarSet
trigger1 = !NumExplod(1006)
trigger1 = !NumExplod(11006)
var(11) = -1
ignoreHitPause = 1

[State 11005, End]
type = DestroySelf
trigger1 = !NumExplod(1006)
trigger1 = !NumExplod(11006)
ignoreHitPause = 1

[State 11005, BindToParent]
type = BindToParent
trigger1 = 1
ignoreHitPause = 1



;====================<ES SMILE & MISSILE PROJECTILE>=========================
[StateDef 1035]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3
hitCountPersist = 1

[State 1035, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 1035, Set reflected StateNo (horizontal reflection)]
type = VarSet
trigger1 = !(Enemy, NumExplod(262141)) && !(Enemy, NumExplod(262143)) && !(Enemy, NumExplod(262144))
sysvar(1) = 1045

[State 1035, Set reflected StateNo (diagonally-downwards reflection)]
type = VarSet
trigger1 = Enemy, NumExplod(262143)
sysvar(1) = 1145

[State 1035, Set reflected StateNo (diagonally-upwards reflection)]
type = VarSet
trigger1 = Enemy, NumExplod(262141)
trigger1 = var(1) := 262141
trigger2 = Enemy, NumExplod(262144)
trigger2 = var(1) := 262144
sysvar(1) = 1185

[State 1035, Projectile Health]
type = VarSet
trigger1 = !Time && !PrevStateNo
var(0) = 3

[State 1035, Projectile Health Decrement]
type = VarAdd
trigger1 = !Time && PrevStateNo
var(0) = -1
ignoreHitPause = 1
persistent = 0

[State 1035, Timer Setup (so at Time = 0, timer = 0 too)]
type = VarSet
trigger1 = !Time && !PrevStateNo
var(12) = -1

[State 1035, Exhaust/Trail Helper]
type = Helper
trigger1 = !Time && !PrevStateNo
helperType = Normal
stateNo = 11005
ID = 11005
name = "Missile Exhaust Trail"
posType = P1
size.xScale = Root, const(size.xScale)
size.yScale = 1

[State 1035, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
time = -1
stateNo = ifElse(var(0) > 0, 1035, 1007)
ignoreHitPause = 1

[State 1035, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 1035, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1035 && !PrevStateNo
value = 1035

[State 1035, AngleDraw]
type = AngleDraw
trigger1 = AnimElemTime(2) < 0
value = 35

[State 1035, AngleDraw]
type = AngleDraw
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
value = 25

[State 1035, AngleDraw]
type = AngleDraw
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
value = 12

[State 1035, AngleDraw]
type = AngleDraw
trigger1 = AnimElemTime(4) >= 0
value = 0

[State 1035, Button Detect]
type = VarSet
trigger1= !Time && !PrevStateNo
var(10) = 3

[State 1035, VelSet]
type = VelSet
trigger1 = 1
x = ifElse(Time < 2 && var(0) < 3, 1, 7.5) * Root, const(size.xScale)
y = 0

[State 1035, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 1035, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 1035, Projectile Flag On]
type = ParentVarAdd
trigger1 = !Time && !PrevStateNo
var(39) = 1

[State 1035, Miss]
type = HitDef
trigger1 = 1
attr = S,SP
hitFlag =
sparkXY = -10,0

[State 1035, HitDef]
type = HitDef
trigger1 = !(Root, var(16)) && (Root, var(15) < (1 + HitCount))
trigger1 = var(0) > 1
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 42 < 7, 7, fvar(11) * 42)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -10.52, 0
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 0
air.fall = 1
fall.recover = 1
fall.recoverTime = 34
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 14
envShake.ampl = 4
envShake.freq = 120
sprPriority = 3

[State 1035, Final Hit]
type = HitDef
trigger1 = !(Root, var(16)) && (Root, var(15) < (1 + HitCount))
trigger1 = var(0) = 1
ID = 1035
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 49 < 7, 7, fvar(11) * 49)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 0, 4
guard.pauseTime = 0, 4
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 14
envShake.ampl = 4
envShake.freq = 120
sprPriority = 3

[State 1035, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(1035) > 1
ID = 1035
keepOne = 1
excludeID = 1035
ignoreHitPause = 1

[State 1035, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(1035)
value = 50255
ID = 1035
ignoreHitPause = 1
persistent = 0

[State 1035, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = ifElse(NumTarget, 1036, 1035)
ignoreHitPause = 1

[State 1035, Timer]
type = VarAdd
trigger1 = 1
var(12) = ifElse(Time < 2 && var(0) < 3, 0, 1)

[State 1035, Projectile Flag Off]
type = ParentVarAdd
trigger1 = MoveReversed
trigger2 = var(12) > 47
var(39) = -1

[State 1035, ChangeState]
type = ChangeState
trigger1 = MoveReversed
value = ifElse(var(0) > 0, 1035, 1007)
ignoreHitPause = 1

[State 1035, Projectile Dissipate]
type = ChangeState
trigger1 = var(12) > 47
value = 1007
ignoreHitPause = 1

[State 1035, End]
type = ChangeState
trigger1 = !var(0) && PrevStateNo && Time = 2
value = 1007
ignoreHitPause = 1

[State 1035, Projectile Flag Off]
type = ParentVarAdd
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100
var(39) = -1


;Hit Pause
[StateDef 1036]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3
moveHitPersist = 1
hitCountPersist = 1

[State 1036, AngleDraw]
type = AngleDraw
trigger1 = IsHelper(1035)
trigger1 = AnimElemTime(2) < 0
value = 35

[State 1036, AngleDraw]
type = AngleDraw
trigger1 = IsHelper(1035)
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
value = 25

[State 1036, AngleDraw]
type = AngleDraw
trigger1 = IsHelper(1035)
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
value = 12

[State 1036, AngleDraw]
type = AngleDraw
trigger1 = IsHelper(1035)
trigger1 = AnimElemTime(4) >= 0
value = 0

[State 1036, AngleDraw]
type = AngleDraw
trigger1 = IsHelper(1135)
value = -30

[State 1036, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1

[State 1036, HitSound]
type = PlaySnd
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
value = ifElse(MoveGuarded, 3, 2), ifElse(MoveGuarded, 0, 5)
channel = 2
ignorehitPause = 1

[State 1036, HitSpark]
type = Helper
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = ifElse(MoveGuarded, 8001, 8013)
ID = 8000
name = "Spark"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
facing = -1
ownPal = 1
size.xScale = 1
size.yScale = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 1036, Counter FX]
type = Helper
trigger1 = MoveContact = 1 && NumTarget && var(9)
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = 8290
ID = 8290
name = "Counter FX"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 1036, HitCount]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(13) = 1

[State 1036, Juggle Points]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
trigger1 = !(HitDefAttr = SCA,AT)
var(15) = 1

[State 1036, ProjContact]
type = VarSet
trigger1 = MoveContact && NumTarget
var(18) = 1

[State 1036, ProjContact]
type = ParentVarSet
triggerAll = MoveContact && NumTarget
trigger1 = Root, StateNo = [1000,1080]
var(18) = 1

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

[State 1036, End]
type = ChangeState
trigger1 = Time >= 3 && var(0) > 1
trigger2 = Time >= 0 && var(0) <= 1
value = ifElse(var(0) <= 1, 1007, PrevStateNo)



;====================<ES SMILE & MISSILE PROJECTILE (REFLECTED)>=========================
[StateDef 1045]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3
hitCountPersist = 1

[State 1045, Turn]
type = Turn
trigger1 = !Time && PrevStateNo != [1045,1046]

[State 1045, Projectile Health Fix]
type = VarAdd
trigger1 = !Time && PrevStateNo != [1045,1046]
trigger2 = Time = 1 && PrevStateNo = 1045
trigger2 = Root, NumProjID(262144)
var(0) = ifElse(Root, NumProjID(262144), 2, 1)
ignoreHitPause = 1

[State 1045, Projectile Health Decrement]
type = VarAdd
trigger1 = !Time && PrevStateNo
var(0) = -1
ignoreHitPause = 1
persistent = 0

[State 1045, Timer Setup (lasts 1 tick longer than non-reflected for some reason)]
type = VarSet
trigger1 = !Time && PrevStateNo != [1045,1046]
var(12) = -2
persistent = 0

[State 1045, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
time = -1
stateNo = ifElse(var(0) > 0, 1045, 1007)
ignoreHitPause = 1

[State 1045, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 1045, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1035
trigger2 = !Time && PrevStateNo != [1045,1046]
value = 1035

[State 1045, AngleDraw]
type = AngleDraw
trigger1 = AnimElemTime(2) < 0
value = 35

[State 1045, AngleDraw]
type = AngleDraw
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
value = 25

[State 1045, AngleDraw]
type = AngleDraw
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
value = 12

[State 1045, AngleDraw]
type = AngleDraw
trigger1 = AnimElemTime(4) >= 0
value = 0

[State 1045, Button Detect]
type = VarSet
trigger1= !Time && !PrevStateNo
var(10) = 3

[State 1045, VelSet]
type = VelSet
trigger1 = 1
x = ifElse(Time < 2 && var(0) < 3, 1, 7.5) * Root, const(size.xScale)
y = 0

[State 1045, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 1045, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 1045, Projectile Flag Off]
type = ParentVarAdd
trigger1 = !Time && PrevStateNo != [1045,1046]
var(39) = -1

[State 1045, Miss]
type = HitDef
trigger1 = 1
ID = 1045
affectTeam = F
attr = S,SP
hitFlag =
sparkXY = -10,0

[State 1045, HitDef]
type = HitDef
trigger1 = var(0) > 1
affectTeam = F
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 42 < 7, 7, fvar(11) * 42)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -10.52, 0
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 0
air.fall = 1
fall.recover = 1
fall.recoverTime = 34
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
envShake.time = 14
envShake.ampl = 4
envShake.freq = 120
sprPriority = 3

[State 1045, Final Hit]
type = HitDef
trigger1 = var(0) = 1
ID = 1045
affectTeam = F
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 49 < 7, 7, fvar(11) * 49)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 0, 4
guard.pauseTime = 0, 4
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
sprPriority = 3

[State 1045, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(1045) > 1
ID = 1045
keepOne = 1
excludeID = 1045
ignoreHitPause = 1

[State 1045, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(1045)
value = 50255
ID = 1045
ignoreHitPause = 1
persistent = 0

[State 1045, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = ifElse(NumTarget, 1046, 1045)
ignoreHitPause = 1

[State 1045, Timer]
type = VarAdd
trigger1 = 1
var(12) = ifElse(Time < 2 && var(0) < 3, 0, 1)

[State 1045, ChangeState]
type = ChangeState
trigger1 = MoveReversed
value = ifElse(var(0) > 0, 1045, 1007)
ignoreHitPause = 1

[State 1045, Projectile Dissipate]
type = ChangeState
trigger1 = var(12) > 47
value = 1007
ignoreHitPause = 1

[State 1045, End]
type = ChangeState
trigger1 = !var(0) && PrevStateNo && Time = 2
value = 1007
ignoreHitPause = 1


;Hit Pause
[StateDef 1046]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3
moveHitPersist = 1
hitCountPersist = 1

[State 1046, AngleDraw]
type = AngleDraw
trigger1 = PrevStateNo = 1045
trigger1 = AnimElemTime(2) < 0
value = 35

[State 1046, AngleDraw]
type = AngleDraw
trigger1 = PrevStateNo = 1045
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
value = 25

[State 1046, AngleDraw]
type = AngleDraw
trigger1 = PrevStateNo = 1045
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) < 0
value = 12

[State 1046, AngleDraw]
type = AngleDraw
trigger1 = PrevStateNo = 1045
trigger1 = AnimElemTime(4) >= 0
value = 0

[State 1046, AngleDraw]
type = AngleDraw
trigger1 = PrevStateNo = 1145
value = -30

[State 1046, AngleDraw]
type = AngleDraw
trigger1 = PrevStateNo = 1185
value = 30

[State 1046, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1

[State 1046, HitSound]
type = PlaySnd
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
value = ifElse(MoveGuarded, 3, 2), ifElse(MoveGuarded, 0, 5)
channel = 2
ignorehitPause = 1

[State 1046, HitSpark]
type = Helper
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = ifElse(MoveGuarded, 8001, 8013)
ID = 8000
name = "Spark"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
facing = -1
ownPal = 1
size.xScale = 1
size.yScale = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 1046, Counter FX]
type = Helper
trigger1 = MoveContact = 1 && NumTarget && var(9)
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = 8290
ID = 8290
name = "Counter FX"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 1046, HitCount]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(13) = 1

[State 1046, Juggle Points]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
trigger1 = !(HitDefAttr = SCA,AT)
var(15) = 1

[State 1046, ProjContact]
type = VarSet
trigger1 = MoveContact && NumTarget
var(18) = 1

[State 1046, ProjContact]
type = ParentVarSet
triggerAll = MoveContact && NumTarget
trigger1 = Root, StateNo = [1000,1080]
var(18) = 1

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

[State 1046, EnvShake]
type = EnvShake
trigger1 = MoveHit && NumTarget
time = 14
ampl = 4
freq = 120
ignoreHitPause = 1

[State 1046, End]
type = ChangeState
trigger1 = Time >= 3 && var(0) > 1
trigger2 = Time >= 0 && var(0) <= 1
value = ifElse(var(0) <= 1, 1007, PrevStateNo)



;====================<HAPPY & MISSILE PROJECTILE>=========================
[StateDef 1105]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3

[State 1105, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 1105, Set reflected StateNo (horizontal reflection)]
type = VarSet
trigger1 = !(Enemy, NumExplod(262141)) && !(Enemy, NumExplod(262143)) && !(Enemy, NumExplod(262144))
sysvar(1) = 1015

[State 1105, Set reflected StateNo (diagonally-downwards reflection)]
type = VarSet
trigger1 = Enemy, NumExplod(262143)
sysvar(1) = 1115

[State 1105, Set reflected StateNo (diagonally-upwards reflection)]
type = VarSet
trigger1 = Enemy, NumExplod(262141)
trigger1 = var(1) := 262141
trigger2 = Enemy, NumExplod(262144)
trigger2 = var(1) := 262144
sysvar(1) = 1155

[State 1105, Timer Setup (so at Time = 0, timer = 0 too)]
type = VarSet
trigger1 = !Time && !PrevStateNo
var(12) = -1

[State 1105, Exhaust/Trail Helper]
type = Helper
trigger1 = !Time && !PrevStateNo
helperType = Normal
stateNo = 11005
ID = 11005
name = "Missile Exhaust Trail"
posType = P1
size.xScale = Root, const(size.xScale)
size.yScale = 1

[State 1105, Button Detect]
type = VarSet
trigger1= !Time && !PrevStateNo
var(10) = Root, var(10)

[State 1105, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1105 && Anim != 1015 && Anim != 1025
value = 1105 + 10 * var(10)

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

[State 1105, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 1105, VelSet]
type = VelSet
trigger1 = 1
x = ifElse(var(10) = 2, 5.625, ifElse(var(10) = 1, 5, 2.1875)) * Root, const(size.xScale)
y = ifElse(var(10) = 2, 3.75, 5)

[State 1105, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 1105, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 1105, Projectile Flag On]
type = ParentVarAdd
trigger1 = !Time && !PrevStateNo
var(39) = 1

[State 1105, Miss]
type = HitDef
trigger1 = 1
attr = S,SP
hitFlag =
sparkXY = -10,0

[State 1105, HitDef]
type = HitDef
trigger1 = !(Root, var(16)) && (Root, var(15) < 1)
ID = 1105
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 84 < 7, 7, fvar(11) * 84)), 7
getPower = ifElse(!(Root, var(13)), 144, 72) * !(Root, var(20)), 36 * !(Root, var(20))
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 14
envShake.ampl = 4
envShake.freq = 120
sprPriority = 3

[State 1105, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(1105) > 1
ID = 1105
keepOne = 1
excludeID = 1105
ignoreHitPause = 1

[State 1105, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(1105)
value = 50255
ID = 1105
ignoreHitPause = 1
persistent = 0

[State 1105, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 1006
ignoreHitPause = 1

[State 1105, Timer]
type = VarAdd
trigger1 = 1
var(12) = 1

[State 1105, Projectile Flag Off]
type = ParentVarAdd
trigger1 = MoveReversed
trigger2 = pos y - 5 > -vel y
var(39) = -1

[State 1105, Projectile Dissipate]
type = ChangeState
trigger1 = MoveReversed
trigger2 = pos y - 5 > -vel y
value = 1007
ignoreHitPause = 1

[State 1105, Projectile Flag Off]
type = ParentVarAdd
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100
var(39) = -1



;====================<HAPPY & MISSILE PROJECTILE (REFLECTED)>=========================
[StateDef 1115]
type = A
physics = N
moveType = A
anim = 1105 + 10 * var(10)
ctrl = 0
sprPriority = 3

[State 1115, Turn]
type = Turn
trigger1 = !Time && PrevStateNo != 1115

[State 1115, Timer Setup (lasts 1 tick longer than non-reflected for some reason)]
type = VarSet
trigger1 = !Time && PrevStateNo != 1115
var(12) = -2

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

[State 1115, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 1115, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1105 && Anim != 1115 && Anim != 1125
value = 1105 + 10 * var(10)

[State 1115, VelSet]
type = VelSet
trigger1 = 1
x = ifElse(var(10) = 2, 5.625, ifElse(var(10) = 1, 5, 2.1875)) * Root, const(size.xScale)
y = ifElse(var(10) = 2, 3.75, 5)

[State 1115, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 1115, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 1115, Projectile Flag On]
type = ParentVarAdd
trigger1 = !Time && !PrevStateNo != 1115
var(39) = -1

[State 1115, Miss]
type = HitDef
trigger1 = 1
ID = 1115
affectTeam = F
attr = S,SP
hitFlag =
sparkXY = -10,0

[State 1115, HitDef]
type = HitDef
trigger1 = 1
ID = 1115
affectTeam = F
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 84 < 7, 7, fvar(11) * 84)), 7
getPower = 0, 0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
envShake.time = 14
envShake.ampl = 4
envShake.freq = 120
sprPriority = 3

[State 1115, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(1115) > 1
ID = 1115
keepOne = 1
excludeID = 1115
ignoreHitPause = 1

[State 1115, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(1115)
value = 50255
ID = 1115
ignoreHitPause = 1
persistent = 0

[State 1115, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 1006
ignoreHitPause = 1

[State 1115, Timer]
type = VarAdd
trigger1 = 1
var(12) = 1

[State 1115, Projectile Dissipate]
type = ChangeState
trigger1 = MoveReversed
trigger2 = pos y - 5 > -vel y
value = 1007
ignoreHitPause = 1



;====================<ES HAPPY & MISSILE PROJECTILE>=========================
[StateDef 1135]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3
hitCountPersist = 1

[State 1135, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 1135, Set reflected StateNo (horizontal reflection)]
type = VarSet
trigger1 = !(Enemy, NumExplod(262141)) && !(Enemy, NumExplod(262143)) && !(Enemy, NumExplod(262144))
sysvar(1) = 1045

[State 1135, Set reflected StateNo (diagonally-downwards reflection)]
type = VarSet
trigger1 = Enemy, NumExplod(262143)
sysvar(1) = 1145

[State 1135, Set reflected StateNo (diagonally-upwards reflection)]
type = VarSet
trigger1 = Enemy, NumExplod(262141)
trigger1 = var(1) := 262141
trigger2 = Enemy, NumExplod(262144)
trigger2 = var(1) := 262144
sysvar(1) = 1185

[State 1135, Projectile Health]
type = VarSet
trigger1 = !Time && !PrevStateNo
var(0) = 3

[State 1135, Projectile Health Decrement]
type = VarAdd
trigger1 = !Time && PrevStateNo
var(0) = -1
ignoreHitPause = 1
persistent = 0

[State 1135, Timer Setup (so at Time = 0, timer = 0 too)]
type = VarSet
trigger1 = !Time && !PrevStateNo
var(12) = -1

[State 1135, Exhaust/Trail Helper]
type = Helper
trigger1 = !Time && !PrevStateNo
helperType = Normal
stateNo = 11005
ID = 11005
name = "Missile Exhaust Trail"
posType = P1
size.xScale = Root, const(size.xScale)
size.yScale = 1

[State 1135, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
time = -1
stateNo = ifElse(var(0) > 0, 1135, 1007)
ignoreHitPause = 1

[State 1135, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 1135, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1035 && !PrevStateNo
value = 1035

[State 1135, AngleDraw]
type = AngleDraw
trigger1 = 1
value = -30

[State 1135, Button Detect]
type = VarSet
trigger1= !Time && !PrevStateNo
var(10) = 3

[State 1135, VelSet]
type = VelSet
trigger1 = 1
x = ifElse(Time < 2 && var(0) < 3, 1, 7.5) * Root, const(size.xScale)
y = 2.5

[State 1135, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 1135, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 1135, Projectile Flag On]
type = ParentVarAdd
trigger1 = !Time && !PrevStateNo
var(39) = 1

[State 1135, Miss]
type = HitDef
trigger1 = 1
attr = S,SP
hitFlag =
sparkXY = -10,0

[State 1135, HitDef]
type = HitDef
trigger1 = !(Root, var(16)) && (Root, var(15) < (1 + HitCount))
trigger1 = var(0) > 1
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 42 < 7, 7, fvar(11) * 42)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -10.52, 0
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 0
air.fall = 1
fall.recover = 1
fall.recoverTime = 34
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 14
envShake.ampl = 4
envShake.freq = 120
sprPriority = 3

[State 1135, Final Hit]
type = HitDef
trigger1 = !(Root, var(16)) && (Root, var(15) < (1 + HitCount))
trigger1 = var(0) = 1
ID = 1135
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 49 < 7, 7, fvar(11) * 49)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 0, 4
guard.pauseTime = 0, 4
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 14
envShake.ampl = 4
envShake.freq = 120
sprPriority = 3

[State 1135, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(1135) > 1
ID = 1135
keepOne = 1
excludeID = 1135
ignoreHitPause = 1

[State 1135, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(1135)
value = 50255
ID = 1135
ignoreHitPause = 1
persistent = 0

[State 1135, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = ifElse(NumTarget, 1036, 1135)
ignoreHitPause = 1

[State 1135, Timer]
type = VarAdd
trigger1 = 1
var(12) = ifElse(Time < 2 && var(0) < 3, 0, 1)

[State 1135, Projectile Flag Off]
type = ParentVarAdd
trigger1 = MoveReversed
trigger2 = pos y - 5 > -vel y
var(39) = -1

[State 1135, ChangeState]
type = ChangeState
trigger1 = MoveReversed
value = ifElse(var(0) > 0, 1135, 1007)
ignoreHitPause = 1

[State 1135, Projectile Dissipate]
type = ChangeState
trigger1 = pos y - 5 > -vel y
value = 1007
ignoreHitPause = 1

[State 1135, End]
type = ChangeState
trigger1 = !var(0) && PrevStateNo && Time = 2
value = 1007
ignoreHitPause = 1

[State 1135, Projectile Flag Off]
type = ParentVarAdd
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100
var(39) = -1



;====================<ES HAPPY & MISSILE PROJECTILE (REFLECTED)>=========================
[StateDef 1145]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3
hitCountPersist = 1

[State 1145, Turn]
type = Turn
trigger1 = !Time && PrevStateNo != 1145 && PrevStateNo != 1046

[State 1145, Projectile Health Fix]
type = VarAdd
trigger1 = !Time && PrevStateNo != 1145 && PrevStateNo != 1046
trigger2 = Time = 1 && PrevStateNo = 1145
trigger2 = Root, NumProjID(262144)
var(0) = ifElse(Root, NumProjID(262144), 2, 1)
ignoreHitPause = 1

[State 1145, Projectile Health Decrement]
type = VarAdd
trigger1 = !Time && PrevStateNo
var(0) = -1
ignoreHitPause = 1
persistent = 0

[State 1145, Timer Setup (lasts 1 tick longer than non-reflected for some reason)]
type = VarSet
trigger1 = !Time && PrevStateNo != 1145 && PrevStateNo != 1046
var(12) = -2
persistent = 0

[State 1145, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
time = -1
stateNo = ifElse(var(0) > 0, 1145, 1007)
ignoreHitPause = 1

[State 1145, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 1145, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1035
value = 1035

[State 1145, AngleDraw]
type = AngleDraw
trigger1 = 1
value = -30

[State 1145, Button Detect]
type = VarSet
trigger1= !Time && !PrevStateNo
var(10) = 3

[State 1145, VelSet]
type = VelSet
trigger1 = 1
x = ifElse(Time < 2 && var(0) < 3, 1, 7.5) * Root, const(size.xScale)
y = 2.5

[State 1145, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 1145, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 1145, Projectile Flag Off]
type = ParentVarAdd
trigger1 = !Time && PrevStateNo != 1145 && PrevStateNo != 1046
var(39) = -1

[State 1145, Miss]
type = HitDef
trigger1 = 1
ID = 1145
affectTeam = F
attr = S,SP
hitFlag =
sparkXY = -10,0

[State 1145, HitDef]
type = HitDef
trigger1 = var(0) > 1
affectTeam = F
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 42 < 7, 7, fvar(11) * 42)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -10.52, 0
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 0
air.fall = 1
fall.recover = 1
fall.recoverTime = 34
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
envShake.time = 14
envShake.ampl = 4
envShake.freq = 120
sprPriority = 3

[State 1145, Final Hit]
type = HitDef
trigger1 = var(0) = 1
ID = 1145
affectTeam = F
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 49 < 7, 7, fvar(11) * 49)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 0, 4
guard.pauseTime = 0, 4
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
sprPriority = 3

[State 1145, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(1145) > 1
ID = 1145
keepOne = 1
excludeID = 1145
ignoreHitPause = 1

[State 1145, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(1145)
value = 50255
ID = 1145
ignoreHitPause = 1
persistent = 0

[State 1145, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = ifElse(NumTarget, 1046, 1145)
ignoreHitPause = 1

[State 1145, Timer]
type = VarAdd
trigger1 = 1
var(12) = ifElse(Time < 2 && var(0) < 3, 0, 1)

[State 1145, ChangeState]
type = ChangeState
trigger1 = MoveReversed
value = ifElse(var(0) > 0, 1145, 1007)
ignoreHitPause = 1

[State 1145, Projectile Dissipate]
type = ChangeState
trigger1 = pos y - 5 > -vel y
value = 1007
ignoreHitPause = 1

[State 1145, End]
type = ChangeState
trigger1 = !var(0) && PrevStateNo && Time = 2
value = 1007
ignoreHitPause = 1



;====================<HAPPY & MISSILE PROJECTILE (REFLECTED UPWARDS)>=========================
[StateDef 1155]
type = A
physics = N
moveType = A
anim = 1155 + 10 * var(10)
ctrl = 0
sprPriority = 3

[State 1155, Turn (only for diag-up reflection)]
type = Turn
trigger1 = !Time && PrevStateNo != 1155 && var(1) = 262141

[State 1155, Timer Setup (lasts 1 tick longer than non-reflected for some reason)]
type = VarSet
trigger1 = !Time && PrevStateNo != 1155
var(12) = -2

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

[State 1155, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 1115, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1155 && Anim != 1165 && Anim != 1175
value = 1155 + 10 * var(10)

[State 1155, VelSet]
type = VelSet
trigger1 = 1
x = ifElse(var(10) = 2, 5.625, ifElse(var(10) = 1, 5, 2.1875)) * Root, const(size.xScale)
y = ifElse(var(10) = 2, -3.75, -5)

[State 1155, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 1155, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 1155, Projectile Flag On]
type = ParentVarAdd
trigger1 = !Time && !PrevStateNo != 1155
var(39) = -1

[State 1155, Miss]
type = HitDef
trigger1 = 1
ID = 1155
affectTeam = F
attr = S,SP
hitFlag =
sparkXY = -10,0

[State 1155, HitDef]
type = HitDef
trigger1 = 1
ID = 1155
affectTeam = F
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 84 < 7, 7, fvar(11) * 84)), 7
getPower = 0, 0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
envShake.time = 14
envShake.ampl = 4
envShake.freq = 120
sprPriority = 3

[State 1155, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(1155) > 1
ID = 1155
keepOne = 1
excludeID = 1155
ignoreHitPause = 1

[State 1155, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(1155)
value = 50255
ID = 1155
ignoreHitPause = 1
persistent = 0

[State 1155, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 1006
ignoreHitPause = 1

[State 1155, Timer]
type = VarAdd
trigger1 = 1
var(12) = 1

[State 1155, Projectile Dissipate]
type = ChangeState
trigger1 = MoveReversed
trigger2 = var(12) > 37
value = 1007
ignoreHitPause = 1



;====================<ES HAPPY & MISSILE PROJECTILE (REFLECTED UPWARDS )>=========================
[StateDef 1185]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3
hitCountPersist = 1

[State 1185, Turn]
type = Turn
trigger1 = !Time && PrevStateNo != 1185 && PrevStateNo != 1046 && var(1) = 262141

[State 1185, Projectile Health Fix]
type = VarAdd
trigger1 = !Time && PrevStateNo != 1185 && PrevStateNo != 1046
trigger2 = Time = 1 && PrevStateNo = 1185
trigger2 = Root, NumProjID(262144)
var(0) = ifElse(Root, NumProjID(262144), 2, 1)
ignoreHitPause = 1

[State 1185, Projectile Health Decrement]
type = VarAdd
trigger1 = !Time && PrevStateNo
var(0) = -1
ignoreHitPause = 1
persistent = 0

[State 1185, Timer Setup (lasts 1 tick longer than non-reflected for some reason)]
type = VarSet
trigger1 = !Time && PrevStateNo != 1185 && PrevStateNo != 1046
var(12) = -2
persistent = 0

[State 1185, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
time = -1
stateNo = ifElse(var(0) > 0, 1185, 1007)
ignoreHitPause = 1

[State 1185, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 1185, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1035
value = 1035

[State 1185, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 30

[State 1185, Button Detect]
type = VarSet
trigger1= !Time && !PrevStateNo
var(10) = 3

[State 1185, VelSet]
type = VelSet
trigger1 = 1
x = ifElse(Time < 2 && var(0) < 3, 1, 7.5) * Root, const(size.xScale)
y = -2.5

[State 1185, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 1185, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 1185, Projectile Flag Off]
type = ParentVarAdd
trigger1 = !Time && PrevStateNo != 1185 && PrevStateNo != 1046
var(39) = -1

[State 1185, Miss]
type = HitDef
trigger1 = 1
ID = 1185
affectTeam = F
attr = S,SP
hitFlag =
sparkXY = -10,0

[State 1185, HitDef]
type = HitDef
trigger1 = var(0) > 1
affectTeam = F
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 42 < 7, 7, fvar(11) * 42)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -10.52, 0
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 0
air.fall = 1
fall.recover = 1
fall.recoverTime = 34
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
envShake.time = 14
envShake.ampl = 4
envShake.freq = 120
sprPriority = 3

[State 1185, Final Hit]
type = HitDef
trigger1 = var(0) = 1
ID = 1185
affectTeam = F
attr = S,SP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 49 < 7, 7, fvar(11) * 49)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 0, 4
guard.pauseTime = 0, 4
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
sprPriority = 3

[State 1185, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(1185) > 1
ID = 1185
keepOne = 1
excludeID = 1185
ignoreHitPause = 1

[State 1185, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(1185)
value = 50255
ID = 1185
ignoreHitPause = 1
persistent = 0

[State 1185, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = ifElse(NumTarget, 1046, 1185)
ignoreHitPause = 1

[State 1185, Timer]
type = VarAdd
trigger1 = 1
var(12) = ifElse(Time < 2 && var(0) < 3, 0, 1)

[State 1185, ChangeState]
type = ChangeState
trigger1 = MoveReversed
value = ifElse(var(0) > 0, 1185, 1007)
ignoreHitPause = 1

[State 1185, Projectile Dissipate]
type = ChangeState
trigger1 = var(12) > 47
value = 1007
ignoreHitPause = 1

[State 1185, End]
type = ChangeState
trigger1 = !var(0) && PrevStateNo && Time = 2
value = 1007
ignoreHitPause = 1



;====================<CHEER & FIRE PROJECTILE SHIELD>=========================
[StateDef 21205]
type = A
physics = N
moveType = A
ctrl = 0
anim = ifElse(IsHelper(21285), 21285, ifElse(IsHelper(21235), 21235, ifElse(IsHelper(21255), 21255, 21205)))
sprPriority = 3

[State 21205, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 21205, Set reflected StateNo (horizontal reflection)]
type = VarSet
trigger1 = !(Enemy, NumExplod(262141)) && !(Enemy, NumExplod(262143)) && !(Enemy, NumExplod(262144))
sysvar(1) = 21205

[State 21205, BindToRoot]
type = BindToRoot
trigger1 = 1
ignoreHitPause = 1

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

[State 21205, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 21205, Miss]
type = HitDef
trigger1 = 1
attr = S, SP
hitFlag =
sparkXY = -10,0

[State 21205, End]
type = DestroySelf
trigger1 = Root, StateNo != [1200,1280]
trigger2 = Root, MoveType = H
trigger3 = (IsHelper(21205) || IsHelper(21255)) && Root, AnimElemTime(16) >= 0
trigger4 = IsHelper(21235) && Root, AnimElemTime(25) >= 0
trigger5 = IsHelper(21285) && Root, AnimElemTime(22) >= 0



;=====================<SHYNESS & STRIKE BASKET>=========================
;Charging
[StateDef 1304]
type = S
physics = N
moveType = I
anim = 1304
ctrl = 0
velSet = 0,0
sprPriority = 2

[State 1304, BindToRoot]
type = BindToRoot
trigger1 = 1
ignoreHitPause = 1

[State 1304, SprPriority]
type = SprPriority
trigger1 = AnimElem = 4 || AnimElem = 7 || AnimElem = 10 || AnimElem = 13 || AnimElem = 16 || AnimElem = 19
trigger2 = AnimElem = 22 || AnimElem = 25 || AnimElem = 28 || AnimElem = 31 || AnimElem = 34
value = 3

[State 1304, SprPriority]
type = SprPriority
trigger1 = AnimElem = 3 || AnimElem = 6 || AnimElem = 9 || AnimElem = 12 || AnimElem = 15 || AnimElem = 18
trigger2 = AnimElem = 21 || AnimElem = 24 || AnimElem = 27 || AnimElem = 30 || AnimElem = 33 || AnimElem = 36
value = 1

[State 1304, ChangeState]
type = ChangeState
trigger1 = Root, StateNo = 1301
value = 1305

[State 1304, DestroySelf]
type = DestroySelf
trigger1 = Root, StateNo != 1300
ignoreHitPause = 1


;Attack
[StateDef 1305]
type = S
physics = N
moveType = I
anim = ifElse(IsHelper(1335), 1335, ifElse(Root, var(10) >= 20, 1325, ifElse(Root, var(10) >= 10, 1315, 1305)))
ctrl = 0
velSet = 0,0
sprPriority = 2

[State 1305, BindToRoot]
type = BindToRoot
trigger1 = 1
ignoreHitPause = 1

[State 1305, Hold AnimElem]
type = ChangeAnim
trigger1 = Root, StateNo = 1301 && Root, AnimElemTime(7) < 0 && AnimElemTime(5) >= 0
value = ifElse(Root, var(10) >= 20, 1325, ifElse(Root, var(10) >= 10, 1315, 1305))
elem = 4

[State 1305, Advance AnimElem]
type = ChangeAnim
trigger1 = Root, StateNo = 1301 && Root, AnimElemTime(7) >= 0 && AnimElemTime(5) < 0
value = ifElse(Root, var(10) >= 20, 1325, ifElse(Root, var(10) >= 10, 1315, 1305))
elem = 5

[State 1305, ES Hold AnimElem]
type = ChangeAnim
trigger1 = Root, StateNo = 1330 && Root, AnimElemTime(12) < 0 && AnimElemTime(8) >= 0
value = 1335
elem = 7

[State 1305, ES Advance AnimElem]
type = ChangeAnim
trigger1 = Root, StateNo = 1330 && Root, AnimElemTime(12) >= 0 && AnimElemTime(8) < 0
value = 1335
elem = 8

[State 1305, SprPriority]
type = SprPriority
trigger1 = AnimElem = 3
trigger2 = IsHelper(1335) && AnimElem = 6
value = 1

[State 1305, SprPriority]
type = SprPriority
trigger1 = IsHelper(1335) && AnimElem = 4
value = 2

[State 1305, DestroySelf]
type = DestroySelf
trigger1 = !AnimTime
trigger2 = Root, StateNo != 1301 && Root, StateNo != 1330
ignoreHitPause = 1



;=====================<SENTIMENTAL TYPHOON AFTERIMAGE>=========================
[StateDef 1413]
type = S
physics = N
moveType = I
anim = ifElse(IsHelper(1413), 1413, 1443)
ctrl = 0
velSet = 0,0
sprPriority = 1

[State 1413, AssertSpecial: NoShadow]
type = AssertSpecial
trigger1 = 1
flag = NoShadow

[State 1413, PalFX]
type = PalFX
trigger1 = 1
time = 1
mul = 128,128,256

[State 1413, Save center position]
type = VarSet
trigger1 = !Time
fvar(0) = pos x

[State 1413, BindToTarget (11 o'clock)]
type = PosSet
trigger1 = IsHelper(1413)
trigger1 = AnimElem = 3 || AnimElem = 8 || AnimElem = 13
trigger2 = IsHelper(1443)
trigger2 = AnimElem = 2 || AnimElem = 6 || AnimElem = 10 || AnimElem = 14 || AnimElem = 18 || AnimElem = 22 || AnimElem = 26 || AnimElem = 30 || AnimElem = 34
x = ceil(const(size.xScale) * ifElse(Facing = -1, 29, -31) + fvar(0))
y = -2

[State 1413, BindToTarget (1 o'clock)]
type = PosSet
trigger1 = IsHelper(1413)
trigger1 = AnimElem = 6 || AnimElem = 11 || AnimElem = 16
trigger2 = IsHelper(1443)
trigger2 = AnimElem = 9 || AnimElem = 17 || AnimElem = 25 || AnimElem = 33 || AnimElem = 36
x = ceil(const(size.xScale) * ifElse(Facing = -1, -30.5, 28) + fvar(0))
y = -2

[State 1413, BindToTarget (3 o'clock)]
type = PosSet
trigger1 = IsHelper(1413)
trigger1 = AnimElem = 4 || AnimElem = 9 || AnimElem = 14
trigger2 = IsHelper(1443)
trigger2 = AnimElem = 3 || AnimElem = 7 || AnimElem = 11 || AnimElem = 15 || AnimElem = 19 || AnimElem = 23 || AnimElem = 27 || AnimElem = 31 || AnimElem = 35
x = ceil(const(size.xScale) * ifElse(Facing = -1, -64.5, 63) + fvar(0))
y = 11

[State 1413, BindToTarget (6 o'clock)]
type = PosSet
trigger1 = IsHelper(1413)
trigger1 = AnimElem = 2 || AnimElem = 7 || AnimElem = 12
trigger2 = IsHelper(1443)
trigger2 = AnimElem = 5 || AnimElem = 13 || AnimElem = 21 || AnimElem = 29
x = ceil(fvar(0) - 1 * (Facing = -1))
y = 21

[State 1413, BindToTarget (9 o'clock)]
type = PosSet
trigger1 = IsHelper(1413)
trigger1 = AnimElem = 5 || AnimElem = 10 || AnimElem = 15
trigger2 = IsHelper(1443)
trigger2 = AnimElem = 4 || AnimElem = 8 || AnimElem = 12 || AnimElem = 16 || AnimElem = 20 || AnimElem = 24 || AnimElem = 28 || AnimElem = 32
x = ceil(const(size.xScale) * ifElse(Facing = -1, 64, -65.5) + fvar(0))
y = 11

[State 1413, SprPriority]
type = SprPriority
trigger1 = 1
value = 0

[State 1413, SprPriority]
type = SprPriority
triggerAll = IsHelper(1413)
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) < 0
trigger2 = AnimElemTime(4) >= 0 && AnimElemTime(6) < 0
trigger3 = AnimElemTime(7) >= 0 && AnimElemTime(8) < 0
trigger4 = AnimElemTime(9) >= 0 && AnimElemTime(11) < 0
trigger5 = AnimElemTime(12) >= 0 && AnimElemTime(13) < 0
trigger6 = AnimElemTime(14) >= 0 && AnimElemTime(16) < 0
value = 3

[State 1413, ES SprPriority]
type = SprPriority
triggerAll = IsHelper(1443)
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(6) < 0
trigger2 = AnimElemTime(7) >= 0 && AnimElemTime(9) < 0
trigger3 = AnimElemTime(11) >= 0 && AnimElemTime(14) < 0
trigger4 = AnimElemTime(15) >= 0 && AnimElemTime(17) < 0
trigger5 = AnimElemTime(19) >= 0 && AnimElemTime(22) < 0
trigger6 = AnimElemTime(23) >= 0 && AnimElemTime(25) < 0
trigger7 = AnimElemTime(27) >= 0 && AnimElemTime(30) < 0
trigger8 = AnimElemTime(31) >= 0 && AnimElemTime(33) < 0
trigger9 = AnimElemTime(35) >= 0 && AnimElemTime(36) < 0
value = 3

[State 1413, DestroySelf]
type = DestroySelf
trigger1 = Root, StateNo != 1410 && Root, StateNo != 1440
trigger2 = !AnimTime



;====================<ES LAW OF THE BULLET BOMB>=========================
[StateDef 21535]
type = A
physics = N
moveType = A
anim = 21535
ctrl = 0
sprPriority = 3

[State 21535, VelSet]
type = VelSet
trigger1 = !Time
x = 2.71875 * const(size.xScale)
y = -5

[State 21535, VelAdd]
type = VelAdd
trigger1 = Time > 0
y = 0.78125

[State 21535, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 21535, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 21535, Projectile Flag On]
type = ParentVarAdd
trigger1 = !Time && !PrevStateNo
var(39) = 1

[State 21535, Miss]
type = HitDef
trigger1 = 1
attr = S,SA
hitFlag =
sparkXY = -10,0

[State 21535, HitDef]
type = HitDef
trigger1 = 1
ID = 21535
attr = A,SA
hitFlag = FD
guardFlag = L
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 14 < 7, 7, fvar(11) * 14)), 0
getPower = 0,0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 18
ground.slideTime = 18
guard.hitTime = 18
air.hitTime = 18
ground.velocity = 0, 0
ground.cornerPush.velOff = 0
guard.velocity = 0
guard.cornerPush.velOff = 0
air.velocity = 0, -7.73
air.cornerPush.velOff = 0
down.velocity = 0, 0
down.cornerpush.veloff = 0
yAccel = 0.58
fall = 0
fall.recover = 1
fall.recoverTime = 18
hitSound = -1
guardSound = -1
sparkNo = -1
guard.sparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255, 255, 255
palFX.sinAdd = -255, -255, -255, 48
envshake.time = 14
envshake.ampl = 4
envshake.freq = 120
sprPriority = 3

[State 21535, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(21535) > 1
ID = 21535
keepOne = 1
excludeID = 21535
ignoreHitPause = 1

[State 21535, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(21535)
value = 1505
ID = 21535
ignoreHitPause = 1
persistent = 0

[State 21535, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 21536
ignoreHitPause = 1

[State 21535, ChangeState]
type = ChangeState
trigger1 = pos y > -vel y
value = 10251


;Hit Pause
[StateDef 21536]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3
moveHitPersist = 1

[State 21536, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1

[State 21536, HitSound]
type = PlaySnd
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
value = ifElse(MoveGuarded, 3, 2), ifElse(MoveGuarded, 0, 5)
channel = 2
ignorehitPause = 1

[State 21536, HitSpark]
type = Helper
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = ifElse(MoveGuarded, 8001, 8013)
ID = 8000
name = "Spark"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
facing = -1
ownPal = 1
size.xScale = 1
size.yScale = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 21536, Counter FX]
type = Helper
trigger1 = MoveContact = 1 && NumTarget && var(9)
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = 8290
ID = 8290
name = "Counter FX"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 21536, HitCount]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(13) = 1

[State 21536, Juggle Points]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
trigger1 = !(HitDefAttr = SCA,AT)
var(15) = 1

[State 21536, ChangeState]
type = ChangeState
trigger1 = MoveContact
trigger1 = Root, NumProjID(262144)
value = sysvar(1)
ignoreHitPause = 1

[State 21536, EnvShake]
type = EnvShake
trigger1 = Time = 1 && !MoveGuarded
time = 14
ampl = 4
freq = 120
ignoreHitPause = 1

[State 21536, End]
type = ChangeState
trigger1 = Time >= 0
value = 21537


;Disappear/Wait (also Cool Hunting projectile guarded/get hit)
[StateDef 21537]
type = A
physics = N
moveType = A
anim = 1
ctrl = 0
velSet = 0,0
sprPriority = 3
moveHitPersist = 1

[State 21537, PosSet (if guarded)]
type = PosSet
trigger1 = MoveGuarded && !Time && PrevStateNo != [13405, 13436]
x = ceil(EnemyNear, pos x)
;explosion spawns at feet in VS for some reason? instead, spawn at mid
y = ceil(EnemyNear, pos y) + (EnemyNear, const(size.mid.pos.y))

[State 21537, Big Explosion FX (Top layer)]
type = Explod
trigger1 = !Time
ID = 21536
anim = 21536
sprPriority = 4
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 21537, Big Explosion FX (Bottom layer)]
type = Explod
trigger1 = !Time
ID = 21536
anim = 21537
sprPriority = 4
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 21537, Small Explosion FX (Bottom right, Top layer)]
type = Explod
trigger1 = Time = 4
ID = 21536
anim = 31536
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * 29), 32
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 21537, Small Explosion FX (Bottom right, Bottom layer)]
type = Explod
trigger1 = Time = 4
ID = 21536
anim = 31537
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * 29), 32
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 0
ignoreHitPause = 0

[State 21537, Small Explosion FX (Bottom left, Top layer)]
type = Explod
trigger1 = Time = 8
ID = 21536
anim = 31536
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * -35), 32
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 21537, Small Explosion FX (Bottom left, Bottom layer)]
type = Explod
trigger1 = Time = 8
ID = 21536
anim = 31537
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * -35), 32
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 0
ignoreHitPause = 0

[State 21537, Small Explosion FX (Top left, Top layer)]
type = Explod
trigger1 = Time = 10
ID = 21536
anim = 31536
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * -51), -16
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 21537, Small Explosion FX (Top left, Bottom layer)]
type = Explod
trigger1 = Time = 10
ID = 21536
anim = 31537
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * -51), -16
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 0
ignoreHitPause = 0

[State 21537, Small Explosion FX (Top right, Top layer)]
type = Explod
trigger1 = Time = 12
ID = 21536
anim = 31536
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * 45), -32
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 21537, Small Explosion FX (Top right, Bottom layer)]
type = Explod
trigger1 = Time = 12
ID = 21536
anim = 31537
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * 45), -32
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 0
ignoreHitPause = 0

[State 21537, Explosion sound]
type = PlaySnd
trigger1 = !Time
trigger2 = Time = 3 && (PrevStateNo = 21536 || !PrevStateNo)
trigger3 = Time = 6 && (PrevStateNo = 21536 || !PrevStateNo)
value = 13210,1
ignorehitPause = 1

[State 21537, End]
type = DestroySelf
triggerAll = Time > 0
triggerAll = !NumExplod(21536)
trigger1 = !NumTarget
trigger2 = NumTarget
trigger2 = Target, Time <= 1 && !(Target, HitShakeOver)



;=====================<JEALOUSY & FAKE CAMOUFLAGE SHEET>=========================
[StateDef 2915]
type = S
physics = N
moveType = I
anim = 2915
ctrl = 0
velSet = 0,0
sprPriority = 0

[State 2915, VelSet]
type = VelSet
trigger1 = AnimElem = 2
x = -1.25
y = -3.75

[State 2915, VelSet]
type = VelAdd
trigger1 = AnimElemTime(2) > 0
y = 0.1953125

[State 2915, Fade away]
type = Trans
trigger1 = AnimElemTime(3) >= 0
trans = AddAlpha
alpha = 256 - (28 * AnimElemTime(3)), 28 * AnimElemTime(3)
ignoreHitPause = 1

[State 2915, DestroySelf]
type = DestroySelf
trigger1 = !AnimTime



;=====================<JEALOUSY & FAKE DOLL>=========================
[StateDef 12915]
type = S
physics = N
moveType = I
anim = 12915
ctrl = 0
velSet = 0,0
sprPriority = 1

[State 12915, SprPriority level]
type = VarSet
trigger1 = Time < 8
var(10) = 3 + Random % 8

[State 12915, Dust Cloud 1 (Top layer)]
type = Explod
trigger1 = !Time
anim = 12910
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(-31 * const(size.xScale)), -79
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Cloud 1 (Bottom layer)]
type = Explod
trigger1 = !Time
anim = 22910
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(-31 * const(size.xScale)), -79
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Cloud 2 (Top layer)]
type = Explod
trigger1 = Time = 1
anim = 12910
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(37 * const(size.xScale)), -59
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Cloud 2 (Bottom layer)]
type = Explod
trigger1 = Time = 1
anim = 22910
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(37 * const(size.xScale)), -59
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Cloud 3 (Top layer)]
type = Explod
trigger1 = Time = 2
anim = 12910
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(-15 * const(size.xScale)), -31
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Cloud 3 (Bottom layer)]
type = Explod
trigger1 = Time = 2
anim = 22910
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(-15 * const(size.xScale)), -31
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Cloud 4 (Top layer)]
type = Explod
trigger1 = Time = 4
anim = 12910
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(-47 * const(size.xScale)), -39
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Cloud 4 (Bottom layer)]
type = Explod
trigger1 = Time = 4
anim = 22910
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(-47 * const(size.xScale)), -39
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Cloud 5 (Top layer)]
type = Explod
trigger1 = Time = 5
anim = 12910
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(49 * const(size.xScale)), -55
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Cloud 5 (Bottom layer)]
type = Explod
trigger1 = Time = 5
anim = 22910
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(49 * const(size.xScale)), -55
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Cloud 6 (Top layer)]
type = Explod
trigger1 = Time = 7
anim = 12910
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(9 * const(size.xScale)), -15
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Cloud 6 (Bottom layer)]
type = Explod
trigger1 = Time = 7
anim = 22910
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(9 * const(size.xScale)), -15
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Puff 1 (Top layer)]
type = Explod
trigger1 = Time = 3
anim = 12911
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(48 * const(size.xScale)), -83
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Puff 1 (Bottom layer)]
type = Explod
trigger1 = Time = 3
anim = 22911
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(48 * const(size.xScale)), -83
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Puff 2 (Top layer)]
type = Explod
trigger1 = Time = 6
anim = 12911
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(-48 * const(size.xScale)), -23
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Dust Puff 2 (Bottom layer)]
type = Explod
trigger1 = Time = 6
anim = 22911
ID = 12910
sprPriority = var(10)
posType = P1
pos = ceil(-48 * const(size.xScale)), -23
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
superMoveTime = 65535
removeOnGetHit = 1
ignoreHitPause = 0

[State 12915, Turn]
type = Turn
trigger1 = AnimElem = 13

[State 12915, VelSet]
type = VelSet
trigger1 = AnimElemTime(13) = 1
x = 3.75 * const(size.xScale)

[State 12915, DestroySelf]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100



;====================<COOL HUNTING PROJECTILE>=========================
[StateDef 3005]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3

[State 3005, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 3005, Set reflected StateNo (horizontal reflection)]
type = VarSet
trigger1 = 1
sysvar(1) = 3015

[State 3005, ChangeAnim]
type = ChangeAnim
trigger1 = IsHelper(3005) || IsHelper(3006)
trigger1 = Anim != 3005
value = 3005
elem = ifElse(!Time && IsHelper(3005), 2, 1)

[State 3005, ChangeAnim (Deadly Hunting)]
type = ChangeAnim
trigger1 = IsHelper(13055) || IsHelper(23055) || IsHelper(13065) || IsHelper(23065)
trigger1 = Anim != 13055
value = 13055
elem = ifElse(!Time && (IsHelper(13055) || IsHelper(13065)), 2, 1)

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

[State 3005, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 3005, VelSet]
type = VelSet
trigger1 = 1
x = 10 * const(size.xScale)
y = 0

[State 3005, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 3005, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 3005, Miss]
type = HitDef
trigger1 = 1
attr = S,HP
hitFlag =
sparkXY = -10,0

[State 3005, HitDef]
type = HitDef
trigger1 = !(Root, var(16)) && Root, var(15) < (1 + Root, var(41) + Root, HitCount)
ID = 3005
attr = S,HP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * ifElse(IsHelper(13065) || IsHelper(23065), 7, 14) < 7, 7, fvar(11) * ifElse(IsHelper(13065) || IsHelper(23065), 7, 14))), 3
getPower = 0, 0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
sprPriority = 3
p2Facing = 1

[State 3005, Cool Hunting Projectile HitCount Increment]
type = ParentVarAdd
trigger1 = MoveContact && NumTarget
var(41) = 1
ignoreHitPause = 1

[State 3005, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(3005) > 1
ID = 3005
keepOne = 1
excludeID = 3005
ignoreHitPause = 1

[State 3005, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(3005)
value = 50255
ID = 3005
ignoreHitPause = 1
persistent = 0

[State 3005, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 3006
ignoreHitPause = 1

[State 3005, ChangeState]
type = ChangeState
trigger1 = MoveReversed
value = 21537
ignoreHitPause = 1

[State 3005, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100


;Hit Pause
[StateDef 3006]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3
moveHitPersist = 1

[State 3006, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1

[State 3006, HitSound]
type = PlaySnd
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
value = ifElse(MoveGuarded, 3, 2), ifElse(MoveGuarded, 0, 5)
channel = 2
ignorehitPause = 1

[State 3006, HitSpark]
type = Helper
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = ifElse(MoveGuarded, 8001, 8014)
ID = 8000
name = "Spark"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
facing = -1
ownPal = 1
size.xScale = 1
size.yScale = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 3006, Counter FX]
type = Helper
trigger1 = MoveContact = 1 && NumTarget && var(9)
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = 8290
ID = 8290
name = "Counter FX"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 3006, HitCount]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(13) = 1

[State 3006, Juggle Points]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
trigger1 = !(HitDefAttr = SCA,AT)
var(15) = 1

[State 3006, ProjContact]
type = VarSet
trigger1 = MoveContact && NumTarget
var(18) = 1

[State 3006, ProjContact]
type = ParentVarSet
triggerAll = MoveContact && NumTarget
trigger1 = Root, StateNo = [3000,3050]
var(18) = 1

[State 3006, Flames (particles only)]
type = Helper
trigger1 = MoveHit = 1 && NumTarget
trigger1 = !(Target, HitShakeOver) && !(Target, SelfAnimExist(7697))
trigger1 = var(43) := (Target, ID)
helperType = Normal
stateNo = 8150
ID = 38155
name = "Flames"
posType = P2
size.xScale = Root, const(size.xScale) * 0.5
size.yScale = 0.5
ownPal = 1
ignoreHitPause = 1

[State 3006, Flame Particle Timer Set]
type = Null
trigger1 = MoveHit = 1 && NumTarget
trigger1 = !(Target, HitShakeOver) && !(Target, SelfAnimExist(7697))
trigger1 = NumHelper(38155)
trigger1 = Cond(NumHelper(38155), Helper(38155), Cond(1, var(44) := 35, 0), 0)
ignoreHitPause = 1

[State 3006, Explosion]
type = Helper
trigger1 = MoveHit = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
trigger1 = var(43) := (Target, ID)
helperType = Normal
stateNo = 13006
ID = 13006
name = "Cool Hunting Explosion"
posType = P2
size.xScale = Root, const(size.xScale) * 0.5
size.yScale = 0.5
ownPal = 1
ignoreHitPause = 1

[State 3006, Turn]
type = Turn
trigger1 = MoveContact
trigger1 = Root, NumProjID(262144)
ignoreHitPause = 1
persistent = 0

[State 3006, ChangeState]
type = ChangeState
trigger1 = MoveContact
trigger1 = Root, NumProjID(262144)
value = sysvar(1)
ignoreHitPause = 1

[State 3006, EnvShake]
type = EnvShake
trigger1 = Time = 1 && PrevStateNo = 3015 && !MoveGuarded
time = 18
ampl = 6
freq = 120
ignoreHitPause = 1

[State 3006, End (Normal end)]
type = ChangeState
triggerAll = MoveHit = 1 && NumTarget
triggerAll = !(Target, HitShakeOver)
trigger1 = Time >= 0 && PrevStateNo != 3015
trigger2 = Time >= 1
value = 3007

[State 3006, End (still need big explosion)]
type = ChangeState
triggerAll = MoveHit != 1 || !NumTarget
trigger1 = Time >= 0 && PrevStateNo != 3015
trigger2 = Time >= 1
value = 21537


;Disappear/Wait
[StateDef 3007]
type = A
physics = N
moveType = I
anim = 1
ctrl = 0
velSet = 0,0
sprPriority = 3
moveHitPersist = 1

[State 3007, End]
type = DestroySelf
triggerAll = Time > 0
trigger1 = !NumTarget
trigger2 = NumTarget
trigger2 = Target, Time <= 1 && !(Target, HitShakeOver)



;====================<COOL HUNTING PROJECTILE (RELFECTED)>=========================
[StateDef 3015]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3

[State 3015, Turn]
type = Turn
trigger1 = !Time && PrevStateNo != 3015

[State 3015, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 3015, Set reflected StateNo]
type = VarSet
trigger1 = 1
sysvar(1) = 3005

[State 3015, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != ifElse(IsHelper(13055) || IsHelper(23055) || IsHelper(13065) || IsHelper(23065), 13055, 3005)
value = ifElse(IsHelper(13055) || IsHelper(23055) || IsHelper(13065) || IsHelper(23065), 13055, 3005)
elem = 2

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

[State 3015, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 3015, VelSet]
type = VelSet
trigger1 = 1
x = 10 * const(size.xScale)
y = 0

[State 3015, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 3015, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 3015, Miss]
type = HitDef
trigger1 = 1
attr = S,HP
affectTeam = F
hitFlag =
sparkXY = -10,0

[State 3015, HitDef]
type = HitDef
trigger1 = 1
ID = sysvar(0)
affectTeam = F
attr = S,HP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * ifElse(IsHelper(13065) || IsHelper(23065), 7, 14) < 7, 7, fvar(11) * ifElse(IsHelper(13065) || IsHelper(23065), 7, 14))), 3
getPower = 0, 0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
sprPriority = 3
p2Facing = 1

[State 3015, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(sysvar(0)) > 1
ID = sysvar(0)
keepOne = 1
excludeID = sysvar(0)
ignoreHitPause = 1

[State 3015, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(sysvar(0))
value = 50255
ID = sysvar(0)
ignoreHitPause = 1
persistent = 0

[State 3015, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 3006
ignoreHitPause = 1

[State 3015, ChangeState]
type = ChangeState
trigger1 = MoveReversed
value = 21537
ignoreHitPause = 1

[State 3015, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100



;=====================<COOL HUNTING HUNTSMEN>=========================
[StateDef 13000]
type = S
physics = N
moveType = I
anim = ifElse(Root, var(40), 13001, 13000)
ctrl = 0
velSet = 0,0
sprPriority = 0

[State 13000, BindToRoot]
type = BindToRoot
trigger1 = 1
pos = ceil(Root, const(size.xScale) * -32), 0
ignoreHitPause = 1

[State 13000, Voice]
type = PlaySnd
trigger1 = AnimElem = 4
value = 13000,0
channel = 0

[State 13000, Left Muzzle Flash (Top layer)]
type = Explod
trigger1 = AnimElemTime(9) = 2
anim = 13003
ID = 13003
sprPriority = 3
posType = P1
pos = ceil(const(size.xScale) * 128), -118
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Left Muzzle Flash (Bottom layer)]
type = Explod
trigger1 = AnimElemTime(9) = 2
anim = 13004
ID = 13003
sprPriority = 3
posType = P1
pos = ceil(const(size.xScale) * 128), -118
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Left Muzzle Exhaust (Top layer)]
type = Explod
trigger1 = AnimElem = 10
anim = 23003
ID = 13003
sprPriority = 2
posType = P1
pos = ceil(const(size.xScale) * 128), -118
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Left Muzzle Exhaust (Bottom layer)]
type = Explod
trigger1 = AnimElem = 10
anim = 23004
ID = 13003
sprPriority = 2
posType = P1
pos = ceil(const(size.xScale) * 128), -118
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Right Muzzle Flash (Top layer)]
type = Explod
trigger1 = AnimElemTime(9) = 1
anim = 33003
ID = 13003
sprPriority = 3
posType = P1
pos = ceil(const(size.xScale) * 154), -113
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Right Muzzle Flash (Bottom layer)]
type = Explod
trigger1 = AnimElemTime(9) = 1
anim = 33004
ID = 13003
sprPriority = 3
posType = P1
pos = ceil(const(size.xScale) * 154), -113
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Right Muzzle Exhaust (Top layer)]
type = Explod
trigger1 = AnimElemTime(9) = 4
anim = 43003
ID = 13003
sprPriority = 2
posType = P1
pos = ceil(const(size.xScale) * 154), -113
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Right Muzzle Exhaust (Bottom layer)]
type = Explod
trigger1 = AnimElemTime(9) = 4
anim = 43004
ID = 13003
sprPriority = 2
posType = P1
pos = ceil(const(size.xScale) * 154), -113
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13006, RemoveExplod (remove existing flash/exhaust)]
type = RemoveExplod
triggerAll = NumExplod(13003)
trigger1 = Root, AnimElemTime(61) < 0
trigger1 = AnimElemTime(35) = 0
trigger2 = Root, AnimElemTime(61) >= 0
trigger2 = AnimElemTime(35) < 0
id = 13003

[State 13000, Repeated Final Shot Left Muzzle Flash (Top layer)]
type = Explod
trigger1 = Root, AnimElemTime(61) < 0
trigger1 = AnimElemTime(35) = 0
anim = 13013
ID = 13003
sprPriority = 3
posType = P1
pos = ceil(const(size.xScale) * 128), -118
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Repeated Final Shot Left Muzzle Flash (Bottom layer)]
type = Explod
trigger1 = Root, AnimElemTime(61) < 0
trigger1 = AnimElemTime(35) = 0
anim = 13014
ID = 13003
sprPriority = 3
posType = P1
pos = ceil(const(size.xScale) * 128), -118
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Repeated Final Shot Left Muzzle Exhaust (Top layer)]
type = Explod
trigger1 = Root, AnimElemTime(61) < 0
trigger1 = AnimElemTime(35) = 0
anim = 23013
ID = 13003
sprPriority = 2
posType = P1
pos = ceil(const(size.xScale) * 128), -118
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Repeated Final Shot Left Muzzle Exhaust (Bottom layer)]
type = Explod
trigger1 = Root, AnimElemTime(61) < 0
trigger1 = AnimElemTime(35) = 0
anim = 23014
ID = 13003
sprPriority = 2
posType = P1
pos = ceil(const(size.xScale) * 128), -118
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Repeated Final Shot Right Muzzle Flash (Top layer)]
type = Explod
trigger1 = Root, AnimElemTime(61) < 0
trigger1 = AnimElemTime(35) = 0
anim = 33013
ID = 13003
sprPriority = 3
posType = P1
pos = ceil(const(size.xScale) * 154), -113
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Repeated Final Shot Right Muzzle Flash (Bottom layer)]
type = Explod
trigger1 = Root, AnimElemTime(61) < 0
trigger1 = AnimElemTime(35) = 0
anim = 33014
ID = 13003
sprPriority = 3
posType = P1
pos = ceil(const(size.xScale) * 154), -113
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Repeated Final Shot Right Muzzle Exhaust (Top layer)]
type = Explod
trigger1 = Root, AnimElemTime(61) < 0
trigger1 = AnimElemTime(35) = 0
anim = 43013
ID = 13003
sprPriority = 2
posType = P1
pos = ceil(const(size.xScale) * 154), -113
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Repeated Final Shot Right Muzzle Exhaust (Bottom layer)]
type = Explod
trigger1 = Root, AnimElemTime(61) < 0
trigger1 = AnimElemTime(35) = 0
anim = 43014
ID = 13003
sprPriority = 2
posType = P1
pos = ceil(const(size.xScale) * 154), -113
scale = const(size.xScale) * 0.5, 0.5
ownPal = 1
bindTime = -1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13000, Repeat final shot]
type = ChangeAnim
trigger1 = Root, AnimElemTime(61) < 0
trigger1 = AnimElemTime(35) = 0
value = Anim
elem = 32
ignoreHitPause = 1

[State 13000, Skip to end]
type = ChangeAnim
trigger1 = Root, AnimElemTime(61) >= 0
trigger1 = AnimElemTime(35) < 0
value = Anim
elem = 35
ignoreHitPause = 1

[State 13000, Gunshot Sound]
type = PlaySnd
trigger1 = AnimElemTime(9) = 1
trigger2 = AnimElemTime(12) = 1
trigger3 = AnimElemTime(15) = 0
trigger4 = AnimElemTime(18) = 1
trigger5 = AnimElemTime(21) = 1
trigger6 = AnimElemTime(24) = 1
trigger7 = AnimElemTime(27) = 1
trigger8 = AnimElemTime(30) = 0
trigger9 = AnimElemTime(33) = 1
value = 1000,1
channel = 1

[State 13000, RemoveExplod (BBH got interrupted)]
type = RemoveExplod
trigger1 = NumExplod(13003)
trigger1 = Root, StateNo != 3000 && Root, StateNo != 3050
id = 13003

[State 13000, DestroySelf]
type = DestroySelf
trigger1 = !AnimTime
trigger2 = Root, StateNo != 3000 && Root, StateNo != 3050
ignoreHitPause = 1



;=====================<COOL HUNTING CAMOUFLAGE SHEET>=========================
[StateDef 13005]
type = S
physics = N
moveType = I
anim = 13005
ctrl = 0
velSet = 0,0
sprPriority = 6

[State 13005, Simulated x velocity (going up)]
type = VarAdd
trigger1 = Time >= 2 && AnimElemTime(6) < 0
fvar(0) = -2.5 * const(size.xScale)
ignoreHitPause = 1

[State 13005, Simulated y velocity (going up)]
type = VarAdd
trigger1 = Time >= 2 && AnimElemTime(6) < 0
fvar(1) = -7.5 + 0.390625 * (Time - 2)
ignoreHitPause = 1

[State 13005, BindToRoot (Going up)]
type = BindToRoot
trigger1 = AnimElemTime(6) < 0
pos = ceil(Root, const(size.xScale) * -32 + fvar(0)), ceil(fvar(1))
ignoreHitPause = 1

[State 13005, Fade away (Going up)]
type = Trans
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(6) < 0
trans = AddAlpha
alpha = 256 - (37 * AnimElemTime(4)), 37 * AnimElemTime(4)
ignoreHitPause = 1

[State 13005, Hold blank frame]
type = ChangeAnim
trigger1 = AnimElemTime(6) >= 0
trigger1 = Root, AnimElemTime(61) < 0
value = 13005
elem = 6

[State 13005, Camouflage sheet sound]
type = PlaySnd
trigger1 = AnimElem = 7
value = 13005,0
channel = 0

[State 13005, SprPriority]
type = SprPriority
trigger1 = AnimElem = 7
value = -1

[State 13005, BindToRoot (Held in Huntsman's hand)]
type = BindToRoot
trigger1 = AnimElemTime(7) >= 0 && AnimElemTime(9) < 0
pos = ceil(Root, const(size.xScale) * -135), -333
ignoreHitPause = 1

[State 13005, SprPriority]
type = SprPriority
trigger1 = AnimElem = 9
trigger1 = 1 || fvar(0) := 0
trigger1 = 1 || fvar(1) := 0
value = 6

[State 13005, Simulated x velocity (Coming down)]
type = VarAdd
trigger1 = AnimElemTime(9) > 0
fvar(0) = 2.5 * const(size.xScale)
ignoreHitPause = 1

[State 13005, Simulated y velocity (Coming down)]
type = VarAdd
trigger1 = AnimElemTime(9) > 0
fvar(1) = 7.5 - 0.390625 * (AnimElemTime(9) - 1)
ignoreHitPause = 1

[State 13005, BindToRoot (Coming down)]
type = BindToRoot
trigger1 = AnimElemTime(9) >= 0
pos = ceil(Root, const(size.xScale) * -84 + fvar(0)), ceil(-241 + fvar(1))
ignoreHitPause = 1

[State 13005, Fade away (Going up)]
type = Trans
trigger1 = AnimElemTime(12) >= 0
trans = AddAlpha
alpha = 256 - (37 * AnimElemTime(12)), 37 * AnimElemTime(12)
ignoreHitPause = 1

[State 13005, DestroySelf]
type = DestroySelf
trigger1 = !AnimTime
trigger2 = Root, StateNo != 3000 && Root, StateNo != 3050
ignoreHitPause = 1



;=====================<COOL HUNTING EXPLOSION>=========================
[StateDef 13006]
type = A
physics = N
moveType = A
anim = 1
ctrl = 0
velSet = 0,0
sprPriority = 4
moveHitPersist = 1

[State 13006, Player]
type = VarSet
trigger1 = !Time
var(0) = Parent, var(43)

[State 13006, PosSet]
type = PosSet
trigger1 = PlayerIDexist(var(0))
x = ceil(PlayerID(var(0)), pos x)
;explosion spawns at feet in VS for some reason? instead, spawn at mid
y = ceil(PlayerID(var(0)), pos y) + (PlayerID(var(0)), const(size.mid.pos.y))

[State 13006, Big Explosion FX (Top layer)]
type = Explod
trigger1 = !Time
ID = 13006
anim = 13006
sprPriority = 4
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 13006, Big Explosion FX (Bottom layer)]
type = Explod
trigger1 = !Time
ID = 13006
anim = 13007
sprPriority = 4
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 13006, Small Explosion FX (Bottom left, Top layer)]
type = Explod
trigger1 = Time = 1
ID = 13006
anim = 23006
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * 29), 32
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 13006, Small Explosion FX (Bottom left, Bottom layer)]
type = Explod
trigger1 = Time = 1
ID = 13006
anim = 23007
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * 29), 32
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 0
ignoreHitPause = 0

[State 13006, Small Explosion FX (Bottom left, Top layer)]
type = Explod
trigger1 = Time = 4
ID = 13006
anim = 23006
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * -35), 32
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 13006, Small Explosion FX (Bottom left, Bottom layer)]
type = Explod
trigger1 = Time = 4
ID = 13006
anim = 23007
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * -35), 32
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 0
ignoreHitPause = 0

[State 13006, Small Explosion FX (Top right, Top layer)]
type = Explod
trigger1 = Time = 5
ID = 13006
anim = 23006
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * -51), -16
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 13006, Small Explosion FX (Top right, Bottom layer)]
type = Explod
trigger1 = Time = 5
ID = 13006
anim = 23007
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * -51), -16
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 0
ignoreHitPause = 0

[State 13006, Small Explosion FX (Top left, Top layer)]
type = Explod
trigger1 = Time = 6
ID = 13006
anim = 23006
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * 45), -32
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
ignoreHitPause = 0

[State 13006, Small Explosion FX (Top left, Bottom layer)]
type = Explod
trigger1 = Time = 6
ID = 13006
anim = 23007
sprPriority = 4
posType = P1
pos = ceil(Root, const(size.xScale) * 45), -32
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 0
ignoreHitPause = 0

[State 13006, Explosion sound]
type = PlaySnd
trigger1 = !Time
value = 13210,1
ignorehitPause = 1

[State 13006, RemoveExplod]
type = RemoveExplod
trigger1 = var(1) = -1
id = 13006

[State 13006, End]
type = DestroySelf
trigger1 = !NumExplod(13006)
trigger2 = var(1) = -1



;====================<DEADLY HUNTING PROJECTILE>=========================
[StateDef 3055]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3

[State 3055, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 3055, Set reflected StateNo]
type = VarSet
trigger1 = 1
sysvar(1) = 3065

[State 3055, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1005
value = 1005
elem = 4

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

[State 3055, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 3055, VelSet]
type = VelSet
trigger1 = 1
x = 32 * const(size.xScale)
y = 0

[State 3055, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 3055, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 3055, Miss]
type = HitDef
trigger1 = 1
attr = S,HP
hitFlag =
sparkXY = -10,0

[State 3055, HitDef (First Three Hits)]
type = HitDef
triggerAll = Root, var(41) < 3
trigger1 = !(Root, var(16)) && Root, var(15) < (1 + Root, var(41))
ID = ifElse(Root, P2Dist x <= 100, 13056, 13055)
attr = S,HP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 7 < 7, 7, fvar(11) * 7)), 3
getPower = 0,0
givePower = 36, 36
pauseTime = 0,1 + 11 * (Root, P2Dist y <= -25) ;increase hitpause if p2 is high enough up to get hit by big projectiles
guard.pauseTime = 0,1 + 11 * (Root, P2Dist y <= -25) ;increase hitpause if p2 is high enough up to get hit by big projectiles
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
sprPriority = 3
p2Facing = 1

[State 3055, HitDef (Subsequent Hits)]
type = HitDef
triggerAll = Root, var(41) >= 3
trigger1 = !(Root, var(16)) && Root, var(15) < (1 + Root, var(41))
ID = 13057
attr = S,HP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 7 < 7, 7, fvar(11) * 7)), 3
getPower = 0,0
givePower = 36, 36
pauseTime = 0,12
guard.pauseTime = 0,12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
sprPriority = 3
p2Facing = 1

[State 3055, Cool Hunting Projectile HitCount Increment]
type = ParentVarAdd
trigger1 = MoveContact && NumTarget
var(41) = 1
ignoreHitPause = 1

[State 3055, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(13055) > 1
ID = 13055
keepOne = 1
excludeID = 13055
ignoreHitPause = 1

[State 3055, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(13056) > 1
ID = 13056
keepOne = 1
excludeID = 13056
ignoreHitPause = 1

[State 3055, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(13057) > 1
ID = 13057
keepOne = 1
excludeID = 13057
ignoreHitPause = 1

[State 3055, TargetState (First three hits, Normal distance)]
type = TargetState
trigger1 = MoveHit && NumTarget(13055)
value = 50255
ID = 13055
ignoreHitPause = 1
persistent = 0

[State 3055, TargetState (First three hits, P2 too close to BBH)]
type = TargetState
trigger1 = MoveHit && NumTarget(13056)
value = 50255
ID = 13056
ignoreHitPause = 1
persistent = 0

[State 3055, TargetState (Subsequent hits)]
type = TargetState
trigger1 = MoveHit && NumTarget(13057)
value = 50255
ID = 13057
ignoreHitPause = 1
persistent = 0

[State 3055, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 3056
ignoreHitPause = 1

[State 3055, Projectile Dissipate]
type = ChangeState
trigger1 = MoveReversed
value = 1007
ignoreHitPause = 1

[State 3055, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100


;Hit Pause
[StateDef 3056]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3
moveHitPersist = 1

[State 3056, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1

[State 3056, HitSound]
type = PlaySnd
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
value = ifElse(MoveGuarded, 3, 2), ifElse(MoveGuarded, 0, 5)
channel = 2
ignorehitPause = 1

[State 3056, HitSpark]
type = Helper
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = ifElse(MoveGuarded, 8001, 8014)
ID = 8000
name = "Spark"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
facing = 1
ownPal = 1
size.xScale = 1
size.yScale = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 3056, Counter FX]
type = Helper
trigger1 = MoveContact = 1 && NumTarget && var(9)
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = 8290
ID = 8290
name = "Counter FX"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 3056, HitCount]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(13) = 1

[State 3056, Juggle Points]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
trigger1 = !(HitDefAttr = SCA,AT)
var(15) = 1

[State 3056, ProjContact]
type = VarSet
trigger1 = MoveContact && NumTarget
var(18) = 1

[State 3056, ProjContact]
type = ParentVarSet
triggerAll = MoveContact && NumTarget
trigger1 = Root, StateNo = 3050
var(18) = 1

[State 3056, Flames]
type = Helper
trigger1 = MoveHit = 1 && NumTarget
trigger1 = !(Target, HitShakeOver) && !(Target, SelfAnimExist(7697))
trigger1 = var(43) := (Target, ID)
helperType = Normal
stateNo = 8150
ID = 38155
name = "Flames"
posType = P2
size.xScale = Root, const(size.xScale) * 0.5
size.yScale = 0.5
ownPal = 1
ignoreHitPause = 1

[State 3056, Flame Particle Timer Set]
type = Null
trigger1 = MoveHit = 1 && NumTarget
trigger1 = !(Target, HitShakeOver) && !(Target, SelfAnimExist(7697))
trigger1 = NumHelper(38155)
trigger1 = Cond(NumHelper(38155), Helper(38155), Cond(1, var(44) := 35, 0), 0)
ignoreHitPause = 1

[State 3056, Turn]
type = Turn
trigger1 = MoveContact
trigger1 = Root, NumProjID(262144)
ignoreHitPause = 1
persistent = 0

[State 3056, ChangeState]
type = ChangeState
trigger1 = MoveContact
trigger1 = Root, NumProjID(262144)
value = sysvar(1)
ignoreHitPause = 1

[State 3056, EnvShake]
type = EnvShake
trigger1 = Time = 1 && PrevStateNo = 3065 && !MoveGuarded
time = 18
ampl = 6
freq = 120
ignoreHitPause = 1

[State 3056, End]
type = ChangeState
trigger1 = Time >= 0 && PrevStateNo != 3065
trigger2 = Time >= 1
value = 1007



;====================<DEADLY HUNTING PROJECTILE (REFLECTED)>=========================
[StateDef 3065]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 3

[State 3065, Turn]
type = Turn
trigger1 = !Time && PrevStateNo != 3015

[State 3065, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 3065, Set reflected StateNo]
type = VarSet
trigger1 = 1
sysvar(1) = 3065

[State 3065, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 1005
value = 1005
elem = 4

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

[State 3065, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 3065, VelSet]
type = VelSet
trigger1 = 1
x = 32 * const(size.xScale)
y = 0

[State 3065, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 3065, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 3065, Miss]
type = HitDef
trigger1 = 1
attr = S,HP
affectTeam = F
hitFlag =
sparkXY = -10,0

[State 3065, HitDef]
type = HitDef
trigger1 = 1
ID = sysvar(0)
affectTeam = F
attr = S,HP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 7 < 7, 7, fvar(11) * 7)), 3
getPower = 0,0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
sprPriority = 3
p2Facing = 1

[State 3065, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(sysvar(0)) > 1
ID = sysvar(0)
keepOne = 1
excludeID = sysvar(0)
ignoreHitPause = 1

[State 3065, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(sysvar(0))
value = 50255
ID = sysvar(0)
ignoreHitPause = 1
persistent = 0

[State 3065, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 3056
ignoreHitPause = 1

[State 3065, Projectile Dissipate]
type = ChangeState
trigger1 = MoveReversed
value = 1007
ignoreHitPause = 1

[State 3065, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100



;=====================<BEAUTIFUL MEMORY TEAR GENERATOR>=========================
[StateDef 13100]
type = S
physics = N
moveType = I
anim = 1
ctrl = 0
velSet = 0,0
sprPriority = 0

[State 13100, EX Flash]
type = PalFX
trigger1 = Root, var(24)
time = 1
mul = 256 + ceil(cos(GameTime / 10.0 * pi) * 128), 256 + ceil(sin(GameTime / 10.0 * pi) * 128), 256 + ceil(-cos(GameTime / 10.0 * pi) * 128)
color = 0
ignoreHitPause = 1

[State 13100, EX Flash Blink]
type = PalFX
trigger1 = ((GameTime % 14) = 0 || (GameTime % 14) = 13) && Root, var(24)
time = 1
ignoreHitPause = 1

[State 13100, Grandma]
type = Explod
trigger1 = !Time && Root, var(40) = 0
trigger2 = Time = 4 && Root, var(40) = 1
anim = 23100
ID = 23100
sprPriority = -5
posType = P1
scale = const(size.xScale), 1
ownPal = 0
removeOnGetHit = 0
ignoreHitPause = 0

[State 13100, BindToRoot]
type = BindToRoot
trigger1 = 1
pos = 0,0
ignoreHitPause = 1

;i can't get random positions to look right so w/e
[State 13100, Tears 1]
type = Explod
trigger1 = Time = 12
anim = 13100
ID = 13100
sprPriority = -4
posType = P1
pos = ceil(4 * const(size.xScale)), -126
scale = const(size.xScale), 1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13100, Tears 2]
type = Explod
trigger1 = Time = 15
anim = 13100
ID = 13100
sprPriority = -4
posType = P1
pos = ceil(61 * const(size.xScale)), -93
scale = const(size.xScale), 1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13100, Tears 3]
type = Explod
trigger1 = Time = 17
anim = 13101
ID = 13100
sprPriority = -4
posType = P1
pos = ceil(54 * const(size.xScale)), -127
scale = const(size.xScale), 1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13100, Tears 4]
type = Explod
trigger1 = Time = 20
anim = 13100
ID = 13100
sprPriority = -4
posType = P1
pos = ceil(12 * const(size.xScale)), -131
scale = const(size.xScale), 1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13100, Tears 5]
type = Explod
trigger1 = Time = 22
anim = 13101
ID = 13100
sprPriority = -4
posType = P1
pos = ceil(-10 * const(size.xScale)), -80
scale = const(size.xScale), 1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13100, Tears 6]
type = Explod
trigger1 = Time = 24
anim = 13100
ID = 13100
sprPriority = -4
posType = P1
pos = ceil(96 * const(size.xScale)), -85
scale = const(size.xScale), 1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13100, Tears 7]
type = Explod
trigger1 = Time = 27
anim = 13101
ID = 13100
sprPriority = -4
posType = P1
pos = ceil(71 * const(size.xScale)), -102
scale = const(size.xScale), 1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13100, Tears 8]
type = Explod
trigger1 = Time = 29
anim = 13101
ID = 13100
sprPriority = -4
posType = P1
pos = ceil(24 * const(size.xScale)), -124
scale = const(size.xScale), 1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 13100, RemoveExplod]
type = RemoveExplod
trigger1 = Root, StateNo != [3100,3110]
ID = 13100
ignoreHitPause = 1

[State 13100, DestroySelf]
type = DestroySelf
trigger1 = Time < 12 && Root, StateNo != [3100,3110]
trigger2 = Time >= 12 && !NumExplod(13100) && !NumExplod(23100)



;=====================<BEAUTIFUL MEMORY TEAR GEYSER>=========================
[StateDef 13110]
type = S
physics = N
moveType = I
anim = 13110
ctrl = 0
velSet = 0,0
sprPriority = 3

[State 13110, Water splash sound]
type = PlaySnd
trigger1 = AnimElem = 71
value = 13110,0
channel = 0

[State 13110, DestroySelf]
type = DestroySelf
trigger1 = !AnimTime
ignoreHitPause = 1



;====================<APPLE & GUN BOMB (WHIFFED)>=========================
[StateDef 13405]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 2

[State 13405, Fuse]
type = Helper
trigger1 = !Time && !PrevStateNo
helperType = Normal
stateNo = 23405
ID = 23405
name = "Apple & Gun Bomb Fuse"
posType = P1
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 13405, Initial y-vel]
type = Null
triggerAll = !Time
trigger1 = Root, AnimElemTime(11) = 0
trigger1 = fvar(0) := -10.3125
trigger2 = Root, AnimElemTime(11) = 6
trigger2 = fvar(0) := -12.5
trigger3 = Root, AnimElemTime(11) = 10
trigger3 = fvar(0) := -8.75
trigger4 = Root, AnimElemTime(11) = 19
trigger4 = fvar(0) := -10
trigger5 = Root, AnimElemTime(11) = 25
trigger5 = fvar(0) := -12.5

[State 13405, VelSet]
type = VelSet
trigger1 = Time = 1
x = 7.890625
y = fvar(0)

[State 13405, VelAdd]
type = VelAdd
trigger1 = Time > 1 && fvar(0) < 0
y = 1.171875

[State 13405, Landing]
type = VelSet
trigger1 = pos y + 7 > -vel y
trigger1 = 1 || fvar(0) := 0
x = 0
y = 0

[State 13405, PosSet]
type = PosSet
trigger1 = fvar(0) = 0
y = -23

[State 13405, Landing Dust Explod]
type = Explod
trigger1 = fvar(0) = 0
anim = 8102
sprPriority = -3
posType = P1
pos = 0, ceil(-pos y)
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 13405, Landing Sound]
type = PlaySnd
trigger1 = fvar(0) = 0
value = 52,0
channel = 1

[State 13405, Rebound off floor (after 1 tick on ground)]
type = VelSet
trigger1 = IsHelper(13406) && fvar(0) = 1
trigger1 = 1 || fvar(0) := -5.9375
x = 7.890625
y = fvar(0)
persistent = 0

[State 13405, Landing timer]
type = VarAdd
trigger1 = fvar(0) >= 0
fvar(0) = 1

[State 13405, End]
type = ChangeState
trigger1 = fvar(0) >= 16
value = 21537

[State 13405, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 13405, Set reflected StateNo (horizontal reflection)]
type = VarSet
trigger1 = 1
sysvar(1) = 13415

[State 13405, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 13405
value = 13405

[State 13405, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
time = -1
stateNo = 21537
ignoreHitPause = 1

[State 13405, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 13405, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 13405, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 13405, Miss]
type = HitDef
trigger1 = 1
attr = S,HP
hitFlag =
sparkXY = -10,0

[State 13405, HitDef]
type = HitDef
trigger1 = !(Root, var(16)) && Root, var(15) < (1 + Root, var(41) + Root, HitCount)
ID = 13405
attr = S,HP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 28 < 7, 7, fvar(11) * 28)), 7
getPower = 0, 0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
sprPriority = 3

[State 13405, Apple & Bomb Projectile HitCount Increment]
type = ParentVarAdd
trigger1 = MoveContact && NumTarget
var(41) = 1
ignoreHitPause = 1

[State 13405, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(13405) > 1
ID = 13405
keepOne = 1
excludeID = 13405
ignoreHitPause = 1

[State 13405, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(13405)
value = 50255
ID = 13405
ignoreHitPause = 1
persistent = 0

[State 13405, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 13406
ignoreHitPause = 1

[State 13405, ChangeState]
type = ChangeState
trigger1 = MoveReversed
value = 21537
ignoreHitPause = 1

[State 13405, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100


;Hit Pause
[StateDef 13406]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 2
moveHitPersist = 1

[State 13406, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1

[State 13406, HitSound]
type = PlaySnd
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
value = ifElse(MoveGuarded, 3, 2), ifElse(MoveGuarded, 0, 5)
channel = 2
ignorehitPause = 1

[State 13406, HitSpark]
type = Helper
trigger1 = MoveContact = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = ifElse(MoveGuarded, 8001, 8014)
ID = 8000
name = "Spark"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
facing = -1
ownPal = 1
size.xScale = 1
size.yScale = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 13406, Counter FX]
type = Helper
trigger1 = MoveContact = 1 && NumTarget && var(9)
trigger1 = !(Target, HitShakeOver)
helperType = Normal
stateNo = 8290
ID = 8290
name = "Counter FX"
posType = P1
pos = ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < 20, ceil(P2Dist x), 20)), 0
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 13406, HitCount]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(13) = 1

[State 13406, Juggle Points]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
trigger1 = !(HitDefAttr = SCA,AT)
var(15) = 1

[State 13406, ProjContact]
type = VarSet
trigger1 = MoveContact && NumTarget
var(18) = 1

[State 13406, ProjContact]
type = ParentVarSet
triggerAll = MoveContact && NumTarget
trigger1 = Root, StateNo = [3000,3050]
var(18) = 1

[State 13406, Flames]
type = Helper
trigger1 = MoveHit = 1 && NumTarget
trigger1 = !(Target, HitShakeOver)
trigger1 = var(43) := (Target, ID)
helperType = Normal
stateNo = 8150
ID = ifElse(Target, SelfAnimExist(7697), 8150, 8155)
name = "Flames"
posType = P2
facing = ifElse(PrevStateNo = 13415, -1, 1)
size.xScale = Root, const(size.xScale) * 0.5
size.yScale = 0.5
ownPal = 1
ignoreHitPause = 1

[State 13406, Flame Disappear Flag Set]
type = Null
triggerAll = MoveHit = 1 && NumTarget
triggerAll = !(Target, HitShakeOver)
trigger1 = NumHelper(8150)
trigger1 = Cond(NumHelper(8150), Helper(8150), Cond(1, var(44) := 1, 0), 0)
trigger2 = NumHelper(8155)
trigger2 = Cond(NumHelper(8155), Helper(8155), Cond(1, var(44) := 1, 0), 0)
ignoreHitPause = 1

[State 13406, Turn]
type = Turn
trigger1 = MoveContact
trigger1 = Root, NumProjID(262144)
ignoreHitPause = 1
persistent = 0

[State 13406, ChangeState]
type = ChangeState
trigger1 = MoveContact
trigger1 = Root, NumProjID(262144)
value = sysvar(1)
ignoreHitPause = 1

[State 13406, EnvShake]
type = EnvShake
trigger1 = Time = 1 && PrevStateNo = 13415 && !MoveGuarded
time = 18
ampl = 6
freq = 120
ignoreHitPause = 1

[State 13406, End]
type = ChangeState
trigger1 = Time >= 0 && PrevStateNo != 13415
trigger2 = Time >= 1
value = 21537



;====================<APPLE & GUN BOMB (WHIFFED, REFLECTED)>=========================
[StateDef 13415]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 2

[State 13415, Turn]
type = Turn
trigger1 = !Time && PrevStateNo != 13415

[State 13415, Reverse x vel]
type = VelSet
trigger1 = !Time && PrevStateNo != 13415
x = 7.890625

[State 13415, VelSet]
type = VelSet
trigger1 = !Time && vel y = 0 && fvar(0) < 0
x = 7.890625
y = fvar(0)

[State 13415, VelAdd]
type = VelAdd
trigger1 = fvar(0) < 0
y = 1.171875

[State 13415, Landing]
type = VelSet
trigger1 = pos y + 7 > -vel y
trigger1 = 1 || fvar(0) := 0
x = 0
y = 0

[State 13415, PosSet]
type = PosSet
trigger1 = fvar(0) = 0
y = -23

[State 13415, Landing Dust Explod]
type = Explod
trigger1 = fvar(0) = 0
anim = 8102
sprPriority = -3
posType = P1
pos = 0, ceil(-pos y)
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 13415, Landing Sound]
type = PlaySnd
trigger1 = fvar(0) = 0
value = 52,0
channel = 1

[State 13415, Rebound off floor (after 1 tick on ground)]
type = VelSet
trigger1 = IsHelper(13406) && fvar(0) = 1
trigger1 = 1 || fvar(0) := -5.9375
x = 7.890625
y = fvar(0)
persistent = 0

[State 13415, Landing timer]
type = VarAdd
trigger1 = fvar(0) >= 0
fvar(0) = 1

[State 13415, End]
type = ChangeState
trigger1 = fvar(0) >= 16
value = 21537

[State 13415, Projectile reflection compatibility detection]
type = VarSet
trigger1 = 1
sysvar(0) = 131072

[State 13415, Set reflected StateNo (horizontal reflection)]
type = VarSet
trigger1 = 1
sysvar(1) = 13415

[State 13415, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 13405
value = 13405

[State 13415, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
time = -1
stateNo = 21537
ignoreHitPause = 1

[State 13415, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 13415, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 13415, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 13415, Miss]
type = HitDef
trigger1 = 1
ID = sysvar(0)
affectTeam = F1
attr = S,HP
hitFlag =
sparkXY = -10,0

[State 13415, HitDef]
type = HitDef
trigger1 = 1
ID = sysvar(0)
affectTeam = F
attr = S,HP
hitFlag = MAF
guardFlag = MA
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 28 < 7, 7, fvar(11) * 28)), 7
getPower = 0, 0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 8
ground.slideTime = 8
guard.hitTime = 8
air.hitTime = 60
airGuard.ctrlTime = 16
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255,255,255
palFX.sinAdd = -255,-255,-255,48
sprPriority = 3

[State 13415, Apple & Bomb Projectile HitCount Increment]
type = ParentVarAdd
trigger1 = MoveContact && NumTarget
var(41) = 1
ignoreHitPause = 1

[State 13415, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(sysvar(0)) > 1
ID = sysvar(0)
keepOne = 1
excludeID = sysvar(0)
ignoreHitPause = 1

[State 13415, TargetState]
type = TargetState
trigger1 = MoveHit && NumTarget(sysvar(0))
value = 50255
ID = sysvar(0)
ignoreHitPause = 1
persistent = 0

[State 13415, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 13406
ignoreHitPause = 1

[State 13415, ChangeState]
type = ChangeState
trigger1 = MoveReversed
value = 21537
ignoreHitPause = 1

[State 13415, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100



;====================<APPLE & GUN BOMB FUSE>=========================
[StateDef 23405]
type = S
physics = N
moveType = A
ctrl = 0
anim = 23405
sprPriority = 3

[State 23405, Fuse sound]
type = PlaySnd
trigger1 = !Time
value = 3210,0
channel = 0

[State 23405, StopSnd]
type = StopSnd
trigger1 = !Root, NumHelper(13405) && !Root, NumHelper(13406) && !Root, NumHelper(13425)
trigger2 = Parent, FrontEdgeDist < -100 || Parent, BackEdgeDist < -100 || pos y > 50 || ScreenPos y >= 360
trigger3 = FrontEdgeDist < -100 || BackEdgeDist < -100 || pos y > 100
trigger4 = (Parent, StateNo != [13405,13425]) && Parent, Anim != 13405 && Parent, Anim != 13425
channel = 0

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

[State 23405, End]
type = DestroySelf
trigger1 = !Root, NumHelper(13405) && !Root, NumHelper(13406) && !Root, NumHelper(13425)
trigger2 = Parent, FrontEdgeDist < -100 || Parent, BackEdgeDist < -100 || pos y > 50 || ScreenPos y >= 360
trigger3 = FrontEdgeDist < -100 || BackEdgeDist < -100 || pos y > 100
trigger4 = (Parent, StateNo != [13405,13425]) && Parent, Anim != 13405 && Parent, Anim != 13425

[State 23405, Turn]
type = Turn
trigger1 = Parent, StateNo = 13415 && Parent, Time = 2
trigger2 = Parent, StateNo = 13405 && Parent, Time = 1 && Parent, PrevStateNo = 13406

[State 23405, BindToParent]
type = BindToParent
trigger1 = 1
ignoreHitPause = 1



;====================<APPLE & GUN BOMB>=========================
[StateDef 13425]
type = A
physics = N
moveType = A
anim = 13425
ctrl = 0
sprPriority = 2

[State 13425, Fuse]
type = Helper
trigger1 = !Time && !PrevStateNo
helperType = Normal
stateNo = 23405
ID = 23405
name = "Apple & Gun Bomb Fuse"
posType = P1
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 13425, Initial y-vel]
type = Null
triggerAll = !Time
trigger1 = Root, AnimElemTime(27) = 1
trigger1 = fvar(0) := 5.517575 || fvar(1) := -2.3266625
trigger2 = Root, AnimElemTime(27) = 3
trigger2 = fvar(0) := 4.6484375 || fvar(1) := -2.3632875
trigger3 = Root, AnimElemTime(27) = 6
trigger3 = fvar(0) := 3.7793 || fvar(1) := -2.5317375
trigger4 = Root, AnimElemTime(27) = 8
trigger4 = fvar(0) := 2.9101625 || fvar(1) := -2.8320375
trigger5 = Root, AnimElemTime(27) = 11
trigger5 = fvar(0) := 2.041025 || fvar(1) := -2.7954125

[State 13425, VelSet]
type = VelSet
trigger1 = Time = 1
x = fvar(0)
y = fvar(1)

[State 13425, VelAdd]
type = VelAdd
trigger1 = Time > 1 && fvar(1) < 0
y = 1.171875

[State 13425, Landing]
type = VelSet
trigger1 = pos y + 7 > -vel y
trigger1 = 1 || fvar(1) := 0
x = 0
y = 0

[State 13425, PosSet]
type = PosSet
trigger1 = fvar(1) = 0
y = -23

[State 13425, Landing Dust Explod]
type = Explod
trigger1 = fvar(1) = 0
anim = 8102
sprPriority = -3
posType = P1
pos = 0, ceil(-pos y)
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 13425, Landing Sound]
type = PlaySnd
trigger1 = fvar(1) = 0
value = 52,0
channel = 1

[State 13425, Switch to a lower hitbox]
type = ChangeAnim
trigger1 = fvar(1) = 0
value = 13426
elem = AnimElemNo(0)

[State 13425, Landing timer]
type = VarAdd
trigger1 = fvar(1) >= 0
fvar(1) = 1

[State 13425, End]
type = ChangeState
trigger1 = fvar(1) >= 16
value = 21537

[State 13425, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AP,AT
time = -1
stateNo = 21537
ignoreHitPause = 1

[State 13425, HitBy]
type = HitBy
trigger1 = 1
value = SCA,NP,SP,HP
time = -1
ignoreHitPause = 1

[State 13425, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 13425, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 13425, Miss]
type = HitDef
trigger1 = 1
attr = S,HA
hitFlag =
sparkXY = -10,0

[State 13425, HitDef (First 4 hits)]
type = HitDef
trigger1 = Root, var(41) < 4
ID = 13425
attr = S,HA
hitFlag = FD
guardFlag = L
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 21 < 7, 7, fvar(11) * 21)), 0
getPower = 0, 0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 18
ground.slideTime = 18
guard.hitTime = 18
air.hitTime = 18
ground.velocity = 0, 0
ground.cornerPush.velOff = 0
guard.velocity = 0
guard.cornerPush.velOff = 0
air.velocity = 0, -7.73
air.cornerPush.velOff = 0
down.velocity = 0, 0
down.cornerpush.veloff = 0
yAccel = 0.58
fall = 0
fall.recover = 1
fall.recoverTime = 18
hitSound = -1
guardSound = -1
sparkNo = -1
guard.sparkNo = -1
sparkXY = -10, -32
palFX.time = 12 * var(9)
palFX.add = 255, 255, 255
palFX.sinAdd = -255, -255, -255, 48
envshake.time = 14
envshake.ampl = 4
envshake.freq = 120
sprPriority = 3

[State 13425, Final hit]
type = HitDef
trigger1 = Root, var(41) >= 4
ID = 13426
attr = S,HA
hitFlag = FD
guardFlag = L
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 28 < 7, 7, fvar(11) * 28)), 0
getPower = 0, 0
givePower = 36, 36
pauseTime = 0, 12
guard.pauseTime = 0, 12
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = Low
air.type = Low
ground.hitTime = 18
ground.slideTime = 18
guard.hitTime = 18
air.hitTime = 18
ground.velocity = -4.31, -7.36
ground.cornerPush.velOff = 0
guard.velocity = -10.52
guard.cornerPush.velOff = 0
air.velocity = -4.31, -7.36
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
yAccel = 0.58
fall = 1
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1
guardSound = -1
sparkNo = -1
guard.SparkNo = -1
sparkXY = -10, -32
palFX.time = ifElse(EnemyNear, SelfAnimExist(7697), 12 * var(9), 35)
palFX.add = ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0), ifElse(EnemyNear, SelfAnimExist(7697), 255, 0)
palFX.mul = ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128), ifElse(EnemyNear, SelfAnimExist(7697), 256, 128)
palFX.sinAdd = ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), -255, 96), ifElse(EnemyNear, SelfAnimExist(7697), 48, 4)
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
sprPriority = 3

[State 21535, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(13425) > 1
ID = 13425
keepOne = 1
excludeID = 13425
ignoreHitPause = 1

[State 21535, TargetDrop]
type = TargetDrop
trigger1 = NumTarget(13426) > 1
ID = 13426
keepOne = 1
excludeID = 13426
ignoreHitPause = 1

[State 21535, TargetState (first 4 hits)]
type = TargetState
trigger1 = MoveHit && NumTarget(13425)
value = 1505
ID = 13425
ignoreHitPause = 1
persistent = 0

[State 13425, TargetState (final hit)]
type = TargetState
trigger1 = MoveHit && NumTarget(13426)
value = 50255
ID = 13426
ignoreHitPause = 1
persistent = 0

[State 13425, Apple & Bomb Projectile HitCount Increment]
type = ParentVarAdd
trigger1 = MoveContact && NumTarget
var(41) = 1
ignoreHitPause = 1

[State 13425, ChangeState]
type = ChangeState
trigger1 = MoveContact
value = 13406
ignoreHitPause = 1

[State 13425, ChangeState]
type = ChangeState
trigger1 = MoveReversed
value = 21537
ignoreHitPause = 1

[State 13425, End]
type = DestroySelf
trigger1 = FrontEdgeDist < -100 || BackEdgeDist < -100



;====================<BURNED KNIFE & GRENADE>=========================
[StateDef 17697]
type = A
physics = N
moveType = I
anim = ifElse(IsHelper(17697), 17697, 27697)
velSet = 0,0
ctrl = 0
sprPriority = -1

[State 17697, BindToRoot]
type = BindToRoot
trigger1 = Time <= 7
pos = ceil(const(size.xScale) * ifElse(IsHelper(17697), 29, -21)), ifElse(IsHelper(17697), -64, -50) + ifElse(Time <= 4, 4 - Time, 0)
ignoreHitPause = 1

[State 17697, VelAdd]
type = VelAdd
trigger1 = Time > 7
y = 1.171875
ignoreHitPause = 1

[State 17697, SprPriority]
type = SprPriority
trigger1 = Time = 9
value = 2
ignoreHitPause = 1

[State 17697, DestroySelf]
type = DestroySelf
trigger1 = pos y > -vel y
ignoreHitPause = 1



;=====================<HARRY (STANDING)>=========================
[StateDef 18000]
type = S
physics = N
moveType = I
anim = 18000
ctrl = 0
velSet = 0,0
sprPriority = -1

[State 18000, BindToRoot]
type = BindToRoot
trigger1 = !Time && !PrevStateNo
pos = ceil(Root, const(size.xScale) * -79), 0

[State 18000, Reset position to 0 (needed during turns mode)]
type = PosSet
trigger1 = pos y != 0
y = 0

[State 18000, Turn]
type = ChangeAnim
trigger1 = RootDist x < 0
value = 18005

[State 18000, Turn]
type = Turn
trigger1 = RootDist x < 0

[State 18000, Return to standing animation]
type = ChangeAnim
triggerAll = !AnimTime
trigger1 = Anim = 18001
trigger2 = Anim = 18005
value = 18000

[State 18000, Change to panting animation]
type = ChangeAnim
trigger1 = Anim = 18000 && (AnimElem = 1 || AnimElemTime(14) = 0)
trigger1 = Random < 250
value = 18001

[State 18000, BBH dead]
type = ChangeState
trigger1 = !(Root, Alive)
value = 18510

[State 18000, BBH hurt]
type = ChangeState
trigger1 = Root, MoveType = H && Root, Alive && Root, StateNo != [120,155]
value = 18500

[State 18000, Change to crouching]
type = ChangeState
trigger1 = Root, StateType = C
value = 18010

[State 18000, Lose]
type = ChangeState
trigger1 = Root, StateNo = 170
value = 18170

[State 18000, Win 3]
type = ChangeState
trigger1 = Root, StateNo = 183
value = 18183

[State 18000, Win 4/5/6]
type = ChangeState
trigger1 = Root, StateNo = [184,186]
value = 18184

[State 18000, Intro 2]
type = ChangeState
trigger1 = Root, StateNo = 191
value = 18191

[State 18000, Intro 3]
type = ChangeState
trigger1 = Root, StateNo = 192
value = 18192

[State 18000, Taunt]
type = ChangeState
trigger1 = Root, StateNo = 195 && Root, Anim = 195
value = 18195

[State 18000, Scared by normal]
type = ChangeState
trigger1 = Root, StateNo = 219
trigger2 = Root, StateNo = 220
trigger3 = Root, StateNo = 250
trigger4 = Root, StateNo = 420
trigger5 = Root, StateNo = 459
trigger6 = Root, StateNo = 620 && Root, AnimElemTime(10) < 0
trigger7 = Root, StateNo = 621 && Root, AnimElemTime(10) < 0
trigger8 = Root, StateNo = 650 && Root, AnimElemTime(14) < 0
trigger9 = Root, StateNo = 810
trigger10 = Root, StateNo = 820
trigger11 = Root, StateNo = 860
trigger12 = Root, StateNo = 2900
value = 18200

[State 18000, Scared by special/super (also win 1/2)]
type = ChangeState
trigger1 = Root, StateNo = [1000,1099]
trigger2 = (Root, StateNo = [1100,1130]) && Root, AnimElemTime(19) < 0
trigger3 = Root, StateNo = 1150 && Root, AnimElemTime(12) < 0
trigger4 = Root, StateNo = [1200,1299]
trigger5 = (Root, StateNo = 1410 || Root, StateNo = 1440) && Root, AnimElemTime(16) >= 0
trigger6 = Root, StateNo = [1500,1599]
trigger7 = Root, StateNo = [3000,3099]
trigger8 = Root, StateNo = 3110
trigger9 = Root, StateNo = 3210 && Root, AnimElemTime(14) >= 0
trigger10 = Root, StateNo = [3300,3399]
trigger11 = Root, StateNo = 3400 && Root, Anim = 3400 && Root, AnimElemTime(7) >= 0
trigger12 = Root, StateNo = [181,182]
value = 18201

[State 18000, Walk forward timer reset]
type = VarSet
trigger1 = !Time
var(10) = 0

[State 18000, Walk forward timer increment]
type = VarAdd
trigger1 = RootDist x >= (79 * Root, const(size.xScale))
trigger2 = Facing != Root, Facing
var(10) = 1

[State 18000, walk forward]
type = ChangeState
;if traveled only a short distance previously, return to walk forward fairly fast
trigger1 = fvar(0) < 50
trigger1 = var(10) >= 16 + 16 * (PrevStateNo = 18020)
;if traveled a long distance previously, wait a bit before return to walk forward
trigger2 = fvar(0) >= 50
trigger2 = var(10) >= 64
;immediately return to walk forward if just left certain states
trigger3 = PrevStateNo = 18500 || (PrevStateNo = [18010, 18012]) || PrevStateNo = 18195 || PrevStateNo = 18200 || PrevStateNo = 18201
trigger3 = RootDist x >= (79 * Root, const(size.xScale))
value = 18020

[State 18000, Walk backwards timer reset]
type = VarSet
trigger1 = !Time
var(11) = 0

[State 18000, Walk backwards timer increment]
type = VarAdd
trigger1 = RootDist x <= (18 * Root, const(size.xScale)) && Facing = Root, Facing && Anim != 18005
var(11) = 1

[State 18000, walk backwards]
type = ChangeState
trigger1 = var(11) >= 7
value = 18021



;=====================<HARRY (STAND TO CROUCHING)>=========================
[StateDef 18010]
type = S
physics = N
moveType = I
anim = 18010
ctrl = 0
velSet = 0,0
sprPriority = 0

[State 18010, BBH dead]
type = ChangeState
trigger1 = !(Root, Alive)
value = 18510

[State 18010, BBH hurt]
type = ChangeState
trigger1 = Root, MoveType = H && Root, Alive && Root, StateNo != [120,155]
value = 18500

[State 18010, Scared by normal]
type = ChangeState
trigger1 = Root, StateNo = 219
trigger2 = Root, StateNo = 220
trigger3 = Root, StateNo = 250
trigger4 = Root, StateNo = 420
trigger5 = Root, StateNo = 459
trigger6 = Root, StateNo = 620 && Root, AnimElemTime(10) < 0
trigger7 = Root, StateNo = 621 && Root, AnimElemTime(10) < 0
trigger8 = Root, StateNo = 650 && Root, AnimElemTime(14) < 0
trigger9 = Root, StateNo = 810
trigger10 = Root, StateNo = 820
trigger11 = Root, StateNo = 860
trigger12 = Root, StateNo = 2900
value = 18200

[State 18010, Scared by special/super]
type = ChangeState
trigger1 = Root, StateNo = [1000,1099]
trigger2 = (Root, StateNo = [1100,1130]) && Root, AnimElemTime(19) < 0
trigger3 = Root, StateNo = 1150 && Root, AnimElemTime(12) < 0
trigger4 = Root, StateNo = [1200,1299]
trigger5 = (Root, StateNo = 1410 || Root, StateNo = 1440) && Root, AnimElemTime(16) >= 0
trigger6 = Root, StateNo = [1500,1599]
trigger7 = Root, StateNo = [3000,3099]
trigger8 = Root, StateNo = 3110
trigger9 = Root, StateNo = 3210 && Root, AnimElemTime(14) >= 0
trigger10 = Root, StateNo = [3300,3399]
trigger11 = Root, StateNo = 3400 && Root, Anim = 3400 && Root, AnimElemTime(7) >= 0
value = 18201

[State 18010, return to standing]
type = ChangeState
trigger1 = Root, StateType != C
value = 18012

[State 18010, crouching]
type = ChangeState
trigger1 = !AnimTime
value = 18011



;=====================<HARRY (CROUCHING)>=========================
[StateDef 18011]
type = S
physics = N
moveType = I
anim = 18011
ctrl = 0
velSet = 0,0
sprPriority = 0

[State 18011, VarSet]
type = VarSet
trigger1 = !Time
var(10) = 0

[State 18000, Return to standing animation]
type = ChangeAnim
triggerAll = !AnimTime
trigger1 = Anim = 18013
value = 18011

[State 18000, Change to panting animation]
type = ChangeAnim
trigger1 = Random < 4 && Anim = 18011 && !var(10)
trigger1 = var(10) := 1
value = 18013

[State 18011, BBH dead]
type = ChangeState
trigger1 = !(Root, Alive)
value = 18510

[State 18011, BBH hurt]
type = ChangeState
trigger1 = Root, MoveType = H && Root, Alive && Root, StateNo != [120,155]
value = 18500

[State 18011, Scared by normal]
type = ChangeState
trigger1 = Root, StateNo = 219
trigger2 = Root, StateNo = 220
trigger3 = Root, StateNo = 250
trigger4 = Root, StateNo = 420
trigger5 = Root, StateNo = 459
trigger6 = Root, StateNo = 620 && Root, AnimElemTime(10) < 0
trigger7 = Root, StateNo = 621 && Root, AnimElemTime(10) < 0
trigger8 = Root, StateNo = 650 && Root, AnimElemTime(14) < 0
trigger9 = Root, StateNo = 810
trigger10 = Root, StateNo = 820
trigger11 = Root, StateNo = 860
trigger12 = Root, StateNo = 2900
value = 18200

[State 18011, Scared by special/super]
type = ChangeState
trigger1 = Root, StateNo = [1000,1099]
trigger2 = (Root, StateNo = [1100,1130]) && Root, AnimElemTime(19) < 0
trigger3 = Root, StateNo = 1150 && Root, AnimElemTime(12) < 0
trigger4 = Root, StateNo = [1200,1299]
trigger5 = (Root, StateNo = 1410 || Root, StateNo = 1440) && Root, AnimElemTime(16) >= 0
trigger6 = Root, StateNo = [1500,1599]
trigger7 = Root, StateNo = [3000,3099]
trigger8 = Root, StateNo = 3110
trigger9 = Root, StateNo = 3210 && Root, AnimElemTime(14) >= 0
trigger10 = Root, StateNo = [3300,3399]
trigger11 = Root, StateNo = 3400 && Root, Anim = 3400 && Root, AnimElemTime(7) >= 0
value = 18201

[State 18011, crouching to stand]
type = ChangeState
trigger1 = Root, StateType != C
value = 18012



;=====================<HARRY (CROUCHING TO STAND)>=========================
[StateDef 18012]
type = S
physics = N
moveType = I
anim = 18012
ctrl = 0
velSet = 0,0
sprPriority = 0

[State 18012, BBH dead]
type = ChangeState
trigger1 = !(Root, Alive)
value = 18510

[State 18012, BBH hurt]
type = ChangeState
trigger1 = Root, MoveType = H && Root, Alive && Root, StateNo != [120,155]
value = 18500

[State 18012, Scared by normal]
type = ChangeState
trigger1 = Root, StateNo = 219
trigger2 = Root, StateNo = 220
trigger3 = Root, StateNo = 250
trigger4 = Root, StateNo = 420
trigger5 = Root, StateNo = 459
trigger6 = Root, StateNo = 620 && Root, AnimElemTime(10) < 0
trigger7 = Root, StateNo = 621 && Root, AnimElemTime(10) < 0
trigger8 = Root, StateNo = 650 && Root, AnimElemTime(14) < 0
trigger9 = Root, StateNo = 810
trigger10 = Root, StateNo = 820
trigger11 = Root, StateNo = 860
trigger12 = Root, StateNo = 2900
value = 18200

[State 18012, Scared by special/super]
type = ChangeState
trigger1 = Root, StateNo = [1000,1099]
trigger2 = (Root, StateNo = [1100,1130]) && Root, AnimElemTime(19) < 0
trigger3 = Root, StateNo = 1150 && Root, AnimElemTime(12) < 0
trigger4 = Root, StateNo = [1200,1299]
trigger5 = (Root, StateNo = 1410 || Root, StateNo = 1440) && Root, AnimElemTime(16) >= 0
trigger6 = Root, StateNo = [1500,1599]
trigger7 = Root, StateNo = [3000,3099]
trigger8 = Root, StateNo = 3110
trigger9 = Root, StateNo = 3210 && Root, AnimElemTime(14) >= 0
trigger10 = Root, StateNo = [3300,3399]
trigger11 = Root, StateNo = 3400 && Root, Anim = 3400 && Root, AnimElemTime(7) >= 0
value = 18201

[State 18012, switch back to crouching]
type = ChangeState
trigger1 = Root, StateType = C
value = 18010

[State 18012, return to standing]
type = ChangeState
trigger1 = !AnimTime
value = 18000



;=====================<HARRY (WALKING FORWARD)>=========================
[StateDef 18020]
type = S
physics = N
moveType = I
anim = 18020
ctrl = 0
velSet = 0,0
sprPriority = 0

[State 18020, Distance traveled reset]
type = VarSet
trigger1 = !Time
fvar(0) = 0

[State 18020, VelSet]
type = VelSet
trigger1 = Time = 1
x = 5 * Root, const(size.xScale)

[State 18020, Distance traveled]
type = VarAdd
trigger1 = Time
fvar(0) = 5 * Root, const(size.xScale)

[State 18020, Return to standing]
type = ChangeState
trigger1 = RootDist x <= (79 * Root, const(size.xScale)) && Facing = Root, Facing
trigger2 = RootDist x <= (-48 * Root, const(size.xScale)) && Facing != Root, Facing
value = 18000

[State 18020, BBH dead]
type = ChangeState
trigger1 = !(Root, Alive)
value = 18510

[State 18020, BBH hurt]
type = ChangeState
trigger1 = Root, MoveType = H && Root, Alive && Root, StateNo != [120,155]
value = 18500

[State 18020, Change to crouching]
type = ChangeState
trigger1 = Root, StateType = C
value = 18010

[State 18020, Lose]
type = ChangeState
trigger1 = Root, StateNo = 170
value = 18170

[State 18020, Win 3]
type = ChangeState
trigger1 = Root, StateNo = 183
value = 18183

[State 18020, Win 4]
type = ChangeState
trigger1 = Root, StateNo = 184
value = 18184

[State 18020, Taunt]
type = ChangeState
trigger1 = Root, StateNo = 195 && Root, Anim = 195
value = 18195

[State 18020, Scared by normal]
type = ChangeState
trigger1 = Root, StateNo = 219
trigger2 = Root, StateNo = 220
trigger3 = Root, StateNo = 250
trigger4 = Root, StateNo = 420
trigger5 = Root, StateNo = 459
trigger6 = Root, StateNo = 620 && Root, AnimElemTime(10) < 0
trigger7 = Root, StateNo = 621 && Root, AnimElemTime(10) < 0
trigger8 = Root, StateNo = 650 && Root, AnimElemTime(14) < 0
trigger9 = Root, StateNo = 810
trigger10 = Root, StateNo = 820
trigger11 = Root, StateNo = 860
trigger12 = Root, StateNo = 2900
value = 18200

[State 18020, Scared by special/super (also win 1/2)]
type = ChangeState
trigger1 = Root, StateNo = [1000,1099]
trigger2 = (Root, StateNo = [1100,1130]) && Root, AnimElemTime(19) < 0
trigger3 = Root, StateNo = 1150 && Root, AnimElemTime(12) < 0
trigger4 = Root, StateNo = [1200,1299]
trigger5 = (Root, StateNo = 1410 || Root, StateNo = 1440) && Root, AnimElemTime(16) >= 0
trigger6 = Root, StateNo = [1500,1599]
trigger7 = Root, StateNo = [3000,3099]
trigger8 = Root, StateNo = 3110
trigger9 = Root, StateNo = 3210 && Root, AnimElemTime(14) >= 0
trigger10 = Root, StateNo = [3300,3399]
trigger11 = Root, StateNo = 3400 && Root, Anim = 3400 && Root, AnimElemTime(7) >= 0
trigger12 = Root, StateNo = [181,182]
value = 18201



;=====================<HARRY (WALKING BACKWARDS)>=========================
[StateDef 18021]
type = S
physics = N
moveType = I
anim = 18021
ctrl = 0
velSet = 0,0
sprPriority = 0

[State 18021, VelSet]
type = VelSet
trigger1 = Time = 1
x = -3.75 * Root, const(size.xScale)

[State 18021, Return to standing]
type = ChangeState
trigger1 = RootDist x >= (75 * Root, const(size.xScale)) && Facing = Root, Facing
trigger2 = RootDist x >= (-44 * Root, const(size.xScale)) && Facing != Root, Facing
value = 18000

[State 18021, BBH dead]
type = ChangeState
trigger1 = !(Root, Alive)
value = 18510

[State 18021, BBH hurt]
type = ChangeState
trigger1 = Root, MoveType = H && Root, Alive && Root, StateNo != [120,155]
value = 18500

[State 18021, Change to crouching]
type = ChangeState
trigger1 = Root, StateType = C
value = 18010

[State 18021, Lose]
type = ChangeState
trigger1 = Root, StateNo = 170
value = 18170

[State 18021, Win 3]
type = ChangeState
trigger1 = Root, StateNo = 183
value = 18183

[State 18021, Win 4]
type = ChangeState
trigger1 = Root, StateNo = 184
value = 18184

[State 18021, Taunt]
type = ChangeState
trigger1 = Root, StateNo = 195 && Root, Anim = 195
value = 18195

[State 18021, Scared by normal]
type = ChangeState
trigger1 = Root, StateNo = 219
trigger2 = Root, StateNo = 220
trigger3 = Root, StateNo = 250
trigger4 = Root, StateNo = 420
trigger5 = Root, StateNo = 459
trigger6 = Root, StateNo = 620 && Root, AnimElemTime(10) < 0
trigger7 = Root, StateNo = 621 && Root, AnimElemTime(10) < 0
trigger8 = Root, StateNo = 650 && Root, AnimElemTime(14) < 0
trigger9 = Root, StateNo = 810
trigger10 = Root, StateNo = 820
trigger11 = Root, StateNo = 860
trigger12 = Root, StateNo = 2900
value = 18200

[State 18021, Scared by special/super (also win 1/2)]
type = ChangeState
trigger1 = Root, StateNo = [1000,1099]
trigger2 = (Root, StateNo = [1100,1130]) && Root, AnimElemTime(19) < 0
trigger3 = Root, StateNo = 1150 && Root, AnimElemTime(12) < 0
trigger4 = Root, StateNo = [1200,1299]
trigger5 = (Root, StateNo = 1410 || Root, StateNo = 1440) && Root, AnimElemTime(16) >= 0
trigger6 = Root, StateNo = [1500,1599]
trigger7 = Root, StateNo = [3000,3099]
trigger8 = Root, StateNo = 3110
trigger9 = Root, StateNo = 3210 && Root, AnimElemTime(14) >= 0
trigger10 = Root, StateNo = [3300,3399]
trigger11 = Root, StateNo = 3400 && Root, Anim = 3400 && Root, AnimElemTime(7) >= 0
trigger12 = Root, StateNo = [181,182]
value = 18201



;=====================<HARRY (LOSE)>=========================
[StateDef 18170]
type = S
physics = N
moveType = I
anim = 18170
ctrl = 0
velSet = 0,0
sprPriority = 0

[State 18170, Null because need at least one sctrl]
type = Null
trigger1 = 1



;=====================<HARRY (WIN 3)>=========================
[StateDef 18183]
type = S
physics = N
moveType = I
anim = 18013
ctrl = 0
velSet = 0,0
sprPriority = -2

[State 18183, ChangeAnimElem]
type = ChangeAnim
trigger1 = AnimElemTime(23) >= 0
value = 18013
elem = 23



;=====================<HARRY (WIN 4/5/6)>=========================
[StateDef 18184]
type = S
physics = N
moveType = I
anim = 18184
ctrl = 0
velSet = 0,0
sprPriority = -3

[State 18184, Flag for walking backwards during win 5]
type = VarSet
trigger1 = !Time
var(10) = ifElse(BackEdgeDist >= 125, 1, 0)

[State 18184, ChangeAnim to walk backwards]
type = ChangeAnim
trigger1 = var(10)
trigger1 = Root, StateNo = 185 && Time = 201
value = 18021

[State 18184, walk backwards]
type = VelSet
trigger1 = Anim = 18021
x = -3 * Root, const(size.xScale)

[State 18184, ChangeAnim to walk forward]
type = ChangeAnim
trigger1 = Root, StateNo = 185 && Time = 314
value = 18020

[State 18184, walk forward]
type = VelSet
trigger1 = Anim = 18020
x = 4 * Root, const(size.xScale)

[State 18184, ChangeAnim to Stand]
type = ChangeAnim
triggerAll = Time = 201
trigger1 = Root, StateNo = 185 && !var(10)
trigger2 = Root, StateNo = 186
value = 18000

[State 18184, VelSet]
type = VelSet
trigger1 = Root, StateNo = 185 && Time = 261
trigger2 = Root, StateNo = 185 && Time = 338
x = 0

[State 18184, ChangeAnim to scared by special/super]
type = ChangeAnim
trigger1 = (Root, StateNo = [185,186]) && Time = 261
trigger2 = Root, StateNo = 185 && Time = 338
trigger3 = Root, StateNo = 186 && Time = 314
value = 18201



;=====================<HARRY (INTRO 2)>=========================
[StateDef 18191]
type = S
physics = N
moveType = I
anim = 18191
ctrl = 0
velSet = 0,0
sprPriority = -3

[State 18191, BindToRoot]
type = BindToRoot
trigger1 = !Time
pos = ceil(Root, const(size.xScale) * 58), 0

[State 18191, return to standing]
type = ChangeState
trigger1 = !AnimTime || Root, StateNo != 191
value = 18000



;=====================<HARRY (INTRO 3)>=========================
[StateDef 18192]
type = S
physics = N
moveType = I
anim = 18192
ctrl = 0
velSet = 0,0
sprPriority = 1

[State 18192, BindToRoot]
type = BindToRoot
trigger1 = 1
pos = ceil(Root, const(size.xScale) * -48), 0

[State 18192, return to standing]
type = ChangeState
trigger1 = !AnimTime || Root, StateNo != 192
value = 18000



;=====================<HARRY (TAUNT)>=========================
[StateDef 18195]
type = S
physics = N
moveType = I
anim = 18195
ctrl = 0
velSet = 0,0
sprPriority = -1

[State 18195, return to standing]
type = ChangeState
trigger1 = !AnimTime
value = 18000

[State 18195, BBH dead]
type = ChangeState
trigger1 = !(Root, Alive)
value = 18510

[State 18195, BBH hurt]
type = ChangeState
trigger1 = Root, MoveType = H && Root, Alive && Root, StateNo != [120,155]
value = 18500



;=====================<HARRY (SCARED BY NORMAL)>=========================
[StateDef 18200]
type = S
physics = N
moveType = I
anim = 18200
ctrl = 0
velSet = 0,0
sprPriority = -1

[State 18200, return to standing]
type = ChangeState
trigger1 = Root, StateNo != 219
trigger1 = Root, StateNo != 220
trigger1 = Root, StateNo != 250
trigger1 = Root, StateNo != 420
trigger1 = Root, StateNo != 459
trigger1 = Root, StateNo != 620
trigger1 = Root, StateNo != 621
trigger1 = Root, StateNo != 650
trigger1 = Root, StateNo != [810, 811]
trigger1 = Root, StateNo != 820
trigger1 = Root, StateNo != 860
trigger1 = Root, StateNo != 2900
trigger2 = (Root, StateNo = [620,621]) && Root, AnimElemTime(10) >= 0
trigger3 = Root, StateNo = 650 && Root, AnimElemTime(14) >= 0
value = 18000



;=====================<HARRY (SCARED BY SPECIAL/SUPER)>=========================
[StateDef 18201]
type = S
physics = N
moveType = I
anim = 18201
ctrl = 0
velSet = 0,0
sprPriority = -1

[State 18201, return to standing]
type = ChangeState
trigger1 = Root, StateNo != [1000,1299]
trigger1 = (Root, StateNo != [1410,1411]) && Root, StateNo != 1440
trigger1 = Root, StateNo != [1500,1599]
trigger1 = Root, StateNo != [3000,3099]
trigger1 = Root, StateNo != [3110,3199]
trigger1 = Root, StateNo != 3210
trigger1 = Root, StateNo != [3300,3499]
trigger1 = Root, StateNo != [181,182]
trigger2 = (Root, StateNo = [1100,1130]) && Root, AnimElemTime(19) >= 0
trigger3 = Root, StateNo = 1150 && Root, AnimElemTime(12) >= 0
value = 18000



;=====================<HARRY (BBH HURT)>=========================
[StateDef 18500]
type = S
physics = N
moveType = I
anim = 18500
ctrl = 0
velSet = 0,0
sprPriority = -5

[State 18500, BBH dead]
type = ChangeState
trigger1 = !(Root, Alive)
value = 18510

[State 18500, return to standing]
type = ChangeState
trigger1 = Root, MoveType != H && Root, Alive
value = 18000



;=====================<HARRY (BBH DEAD)>=========================
[StateDef 18510]
type = S
physics = N
moveType = I
anim = 18510
ctrl = 0
velSet = 0,0
sprPriority = -5

[State 18510, return to standing]
type = ChangeState
trigger1 = Root, MoveType != H && Root, Alive
value = 18500



;====================<BUTTERFLY>=========================
[StateDef 19000]
type = A
physics = N
moveType = I
ctrl = 0
sprPriority = 5

;var(0)   : boundary flag (0 = outside; 1 = inside)
;var(4)   : left (back) boundary wall
;var(2)   : bottom boundary wall
;var(6)   : right (forward) boundary wall
;var(8)   : top boundary wall
;var(10)  : x midpoint of boundary walls / point destination
;var(11)  : y midpoint of boundary walls / point destination
;var(15)  : bottom rear butterfly's fast return flag (0 = normal operation; 1 = use bottom forward's midpoint for speedup calculation)
;var(20)  : current travel point
;var(21)  : travel point timer
;fvar(0)  : current angle/direction butterfly is moving in
;fvar(1)  : return angle tweak (a small random variance to the return angle)
;fvar(10) : pos x (relative to root)
;fvar(11) : pos y (relative to root)

;the bottom rear butterfly will distractingly race forward suddenly if BBH is far away enough and then suddenly turns.
;this happens because when BBH turns, the bottom rear butterfly's bounary wall also shifts to be much further away, which tends to
;activate the extra speedup functionality that triggers whenever a butterfly is extremely far from the midpoint of its boundary walls.
;this looks bad, so to avoid this, the bottom rear butterfly will use the bottom forward butterfly's x-midpoint as its test for whether
;it should speed up or not, instead of its actual real midpoint.

;first, as a precaution, reset var(15) to 0 whenever entering this state
[State 19000, Reset bottom rear butterfly's fast return flag]
type = VarSet
trigger1 = !Time
var(15) = 0

;whenever BBH turns, the disable flag should be turned on for the bottom rear butterfly. it's possible that the flag might be turned off
;on the same tick it is turned on, but first, the butterfly has to wait until it itself turns around and recalculates its new boundary
;wall midpoint.
[State 19000, Turn on the bottom rear butterfly's fast return flag]
type = VarSet
trigger1 = IsHelper(19001)
trigger1 = Facing != Root, Facing
var(15) = 1

[State 19000, Turn]
type = Turn
trigger1 = Facing != Root, Facing

[State 19000, Crouching]
type = ChangeState
triggerAll = Root, MoveType != H
triggerAll = Root, StateNo = 11 && Root, Anim = 11
trigger1 = Root, Time >= 8
trigger2 = Root, PrevStateNo != 10 && Root, PrevStateNo != 12
value = 19011

[State 19000, Homing in on single point]
type = ChangeState
triggerAll = Root, MoveType != H
;winpose 1
trigger1 = Root, StateNo = 181 && Root, AnimElemTime(10) < 0
;winpose 2, fist punch
trigger2 = Root, StateNo = 182 && Root, AnimElemTime(4) >= 0 && Root, AnimElemTime(11) < 0
;winpose 2, second punch
trigger3 = Root, StateNo = 182 && Root, AnimElemTime(14) >= 0 && Root, AnimElemTime(21) < 0
;winpose 2, final punch
trigger4 = Root, StateNo = 182 && Root, AnimElemTime(24) >= 0 && Root, AnimElemTime(30) <= 13
;winpose 5/6, punch
trigger5 = (Root, StateNo = [185,186]) && Root, AnimElemTime(50) >= 0 && Root, AnimElemTime(59) < 0
;turns intro
trigger6 = Root, Anim = 6901 && Root, AnimElemTime(10) < 0
;bottom forward butterfly, stand (far/close) light punch
trigger7 = IsHelper(19000) && Root, StateNo = [200, 205]
;bottom two butterflies, stand far medium punch
trigger8 = (IsHelper(19000) || IsHelper(19001)) && Root, StateNo = 210 && Root, AnimElemTime(5) < 0
;bottom two butterflies, stand close medium punch
trigger9 = (IsHelper(19000) || IsHelper(19001)) && Root, StateNo = 215 && Root, AnimElemTime(8) < 0
;bottom forward butterfly, stand (far/close) light kick
trigger10 = IsHelper(19000) && Root, StateNo = [230, 235]
;surprise & hop
trigger11 = Root, StateNo = 248 || (Root, StateNo = 249 && Root, AnimElemTime(3) < 0)
;bottom forward butterfly, crouching light punch
trigger12 = IsHelper(19000) && Root, StateNo = 400 && Root, AnimElemTime(4) < 0
;bottom two butterflies, crouching medium punch
trigger13 = (IsHelper(19000) || IsHelper(19001)) && Root, StateNo = 410 && Root, AnimElemTime(6) < 0
;bottom forward butterfly, crouching light kick
trigger14 = IsHelper(19000) && Root, StateNo = 430
;bottom forward butterfly, crouching medium kick
trigger15 = IsHelper(19000) && Root, StateNo = 440 && Root, AnimElemTime(6) < 0
;(es) smile & missile (high)
trigger16 = (Root, StateNo = [1000,1030]) && Root, AnimElemTime(17) < 0
;(es) happy & missile
trigger17 = (Root, StateNo = [1100,1130]) && Root, AnimElemTime(2) >= 0 && Root, AnimElemTime(17) < 0
;happy & missile (The Killing Time)
trigger18 = Root, StateNo = 1150 && Root, AnimElemTime(10) < 0
value = 19200

[State 19000, Cycling between three points]
type = ChangeState
triggerAll = Root, MoveType != H
;win 5/6, low missile
trigger1 = (Root, StateNo = [185,186]) && (Root, AnimElemTime(24) >= 0 && Root, AnimElemTime(40) < 0)
;win 5, duck and cover
trigger2 = Root, StateNo = 185 && Root, AnimElemTime(66) >= 0
;win 6, final pose
trigger3 = Root, StateNo = 186 && Root, AnimElemTime(60) >= 0
;stand heavy punch
trigger4 = Root, StateNo = 220 && Root, AnimElemTime(21) < 0
;stand medium kick
trigger5 = Root, StateNo = 240 && Root, AnimElemTime(6) < 0
;stand heavy kick
trigger6 = Root, StateNo = 250 && Root, AnimElemTime(7) < 0
;crouch heavy punch
trigger7 = Root, StateNo = 420 && Root, AnimElemTime(21) < 0
;crouch heavy punch
trigger7 = Root, StateNo = 420 && Root, AnimElemTime(21) < 0
;crouch heavy kick
trigger8 = Root, StateNo = 450 && Root, AnimElemTime(7) < 0
;malice & mine
trigger9 = Root, StateNo = 459 && Root, AnimElemTime(7) < 0
;doll & bomb
trigger10 = Root, StateNo = 820 && Root, AnimElemTime(13) >= 0 && Root, AnimElemTime(16) < 0
;(es) smile & missile (low)
trigger11 = Root, StateNo = [1050,1080]
;cool/deadly hunting
trigger12 = (Root, StateNo = [3000,3050]) && Root, AnimElemTime(73) < 0
;beautiful memory
trigger13 = Root, StateNo = 3110 && Root, AnimElemTime(34) < 0
;apple for you
trigger14 = Root, StateNo = 3210 && Root, AnimElemTime(2) >= 0 && Root, AnimElemTime(16) < 0
;apple & gun
trigger15 = Root, StateNo = 3414 && Root, AnimElemTime(3) < 0
value = 19201

[State 19000, Cycling between four points]
type = ChangeState
triggerAll = Root, MoveType != H
;(es) cheer & fire
trigger1 = Root, StateNo = [1200,1280]
value = 19202

[State 19000, Update position relative to Root]
type = Null
trigger1 = fvar(10) := (pos x - Root, pos x) * Root, Facing || fvar(11) := (pos y - Root, pos y)

[State 19000, Set boundary walls]
type = Null
;Bottom forward butterfly
trigger1 = IsHelper(19000)
;trigger1 = Root, StateType != C && Root, StateType != A && Root, StateType != L
trigger1 = 1 || var(4) := ceil(0 * const(size.xScale)) || var(2) := -16 || var(6) := ceil(65 * const(size.xScale)) || var(8) := -78
trigger1 = var(10) := ceil(32.5 * const(size.xScale))  || var(11) := -47
;Bottom rear butterfly
trigger2 = IsHelper(19001)
trigger2 = 1 || var(4) := ceil(-69 * const(size.xScale)) || var(2) := -17 || var(6) := ceil(-12 * const(size.xScale)) || var(8) := -85
trigger2 = var(10) := ceil(-40.5 * const(size.xScale))  || var(11) := -51
;Top butterfly
trigger3 = IsHelper(19002)
trigger3 = 1 || var(4) := ceil(-35 * const(size.xScale)) || var(2) := -39 || var(6) := ceil(15 * const(size.xScale)) || var(8) := -108
trigger3 = var(10) := ceil(-10 * const(size.xScale))  || var(11) := -74

[State 19000, Adjust boundary walls upon attack start]
type = Null
;bottom rear butterfly, stand (far/close) light punch
trigger1 = IsHelper(19001)
trigger1 = (Root, StateNo = [200,205]) || (Root, StateNo = [230,235]) || (Root, StateNo = 400 && Root, AnimElemTime(4) < 0) || Root, StateNo = 430 || (Root, StateNo = 440 && Root, AnimElemTime(6))
trigger1 = 1 || var(4) := ceil(-84 * const(size.xScale)) || var(2) := -32 || var(6) := ceil(-27 * const(size.xScale)) || var(8) := -100
trigger1 = var(10) := ceil(-55.5 * const(size.xScale))  || var(11) := -66
;top butterfly, stand (far/close) light punch, stand (far/close) medium punch
trigger2 = IsHelper(19002)
trigger2 = (Root, StateNo = [200,205]) || (Root, StateNo = 210 && Root, AnimElemTime(5) < 0) || (Root, StateNo = 215 && Root, AnimElemTime(8) < 0) || (Root, StateNo = [230,235]) || (Root, StateNo = 400 && Root, AnimElemTime(4) < 0) || (Root, StateNo = 410 && Root, AnimElemTime(6) < 0) || Root, StateNo = 430 || (Root, StateNo = 440 && Root, AnimElemTime(6))
trigger2 = 1 || var(4) := ceil(-50 * const(size.xScale)) || var(2) := -54 || var(6) := ceil(0 * const(size.xScale)) || var(8) := -123
trigger2 = var(10) := ceil(-25 * const(size.xScale))  || var(11) := -89

[State 19000, Reset anim upon attack start/end]
type = ChangeAnim
;only activate if inside boundary
triggerAll = var(0)
trigger1 = !IsHelper(19000) && ((Root, StateNo = [200,205]) || Root, PrevStateNo = [200,205]) && Root, Time = 1
trigger2 = IsHelper(19002) && Root, StateNo = 210 && (Root, Time = 1 || Root, AnimElem = 5)
trigger3 = IsHelper(19002) && Root, StateNo = 215 && (Root, Time = 1 || Root, AnimElem = 8)
trigger4 = !IsHelper(19000) && ((Root, StateNo = [230,235]) || Root, PrevStateNo = [230,235]) && Root, Time = 1
trigger5 = !IsHelper(19000) && (Root, StateNo = 400) && (Root, Time = 1 || Root, AnimElem = 4)
trigger6 = IsHelper(19002) && Root, StateNo = 410 && (Root, Time = 1 || Root, AnimElem = 6)
trigger7 = !IsHelper(19000) && (Root, StateNo = 430 || Root, PrevStateNo = 430) && Root, Time = 1
trigger8 = !IsHelper(19000) && (Root, StateNo = 440) && (Root, Time = 1 || Root, AnimElem = 6)
value = Anim
elem = 1

[State 19000, Set boundary flag (inside)]
type = VarSet
trigger1 = 1
var(0) = 1

[State 19000, Set boundary flag (outside)]
type = VarSet
trigger1 = fvar(10) <= var(4) || fvar(10) >= var(6) || fvar(11) >= var(2) || fvar(11) <= var(8)
var(0) = 0

[State 19000, Angle set (random roaming within boundary)]
type = VarSet
;only activate if inside boundary
triggerAll = var(0)
trigger1 = AnimElemNo(0) = 1 || AnimElemNo(0) = 11 || AnimElemNo(0) = 21
fvar(0) = Random % 360 * (pi/180)

[State 19000, Angle set (returning to boundary from outside)]
type = Null
;only activate if outside boundary
triggerAll = !var(0)
;avoid using arctan if either x or y is 0
trigger1 = abs((var(10) - fvar(10))) != 0 && abs(var(11) - fvar(11)) != 0
;arctan(x distance / y distance), using absolute values for both
trigger1 = 1 || fvar(0) := atan( abs((var(10) - fvar(10))) / abs(var(11) - fvar(11)) )
;if x is 0 then the angle should be 0 (might also be 180, depending on sign of x/y)
trigger2 = abs((var(10) - fvar(10))) = 0
trigger2 = 1 || fvar(0) := 0
;if y is 0 then the angle should be 90 (or 270, depending on signs)
trigger3 = abs(var(11) - fvar(11)) = 0
trigger3 = 1 || fvar(0) := pi/2

[State 19000, Fix angle if returning (based on sign of components)]
type = Null
;only activate if outside boundary
triggerAll = !var(0)
;quadrant II (upper left)
trigger1 = var(10) - fvar(10) <= 0 && var(11) - fvar(11) <= 0
trigger1 = fvar(0) := 2 * pi - fvar(0)
;quadrant III (lower left)
trigger2 = var(10) - fvar(10) <= 0 && var(11) - fvar(11) >= 0
trigger2 = fvar(0) := pi + fvar(0)
;quadrant IV (lower right)
trigger3 = var(10) - fvar(10) >= 0 && var(11) - fvar(11) >= 0
trigger3 = fvar(0) := pi - fvar(0)

[State 19000, Add small randomness to angle if returning]
type = VarSet
;only activate if outside boundary
triggerAll = !var(0)
trigger1 = AnimElemNo(0) = 1 || AnimElemNo(0) = 11 || AnimElemNo(0) = 21
fvar(1) = ((Random % 60) - 30) * pi/180

[State 19000, Add small randomness to angle if returning]
type = VarSet
;only activate if outside boundary
trigger1 = !var(0)
fvar(0) = ifElse(fvar(0) + fvar(1) < 0, 0, ifElse(fvar(0) + fvar(1) > 6.28318530718, 6.28318530718, fvar(0) + fvar(1)))

[State 19000, Emergency angle set (reset animation back to elem 1)]
type = ChangeAnim
;only activate if inside boundary
triggerAll = var(0)
trigger1 = fvar(10) + vel x <= var(4) || fvar(10) + vel x >= var(6)
trigger2 = fvar(11) + vel y >= var(2) || fvar(11) + vel y <= var(8)
value = Anim
elem = 1

[State 19000, Emergency angle set (try moving 90 degrees)]
type = VarSet
triggerAll = var(0)
trigger1 = fvar(10) + vel x <= var(4) || fvar(10) + vel x >= var(6)
trigger2 = fvar(11) + vel y >= var(2) || fvar(11) + vel y <= var(8)
fvar(0) = ifElse(fvar(0) + pi/2 <= 2*pi, fvar(0) + pi/2, (pi/2) - (2*pi - fvar(0)))

[State 19000, Turn off the bottom rear butterfly's fast return flag]
type = VarSet
;now that the butterfly has turned around and recalculated its new boundary midpoint, it can decide whether to return to its
;normal operation or not. if the flag is on and the butterfly is now close enough to its (real) x-midpoint, then turn off this flag
trigger1 = var(15) && abs((var(10) - fvar(10))) <= 90
var(15) = 0

[State 19000, Use bottom forward butterfly's boundary midpoint for bottom rear butterfly's speedup calculation]
type = VarSet
;if the fast return flag is still on at this point, then the butterfly is still too far from its boundary, and will definitely activate
;the extra speedup. to avoid a sudden and drastic speedup based solely on BBH turning, the bottom rear butterfly will set its x-midpoint
;to the same value as the bottom forward's; this will immediately be reset to the actual value on the next tick, and thus will only be
;used in the VelSet controller immediately below. since BBH has recently turned around, the bottom forward butterfly's x-midpoint will
;be in the same general location that the bottom rear's was, before the turn happened. as a result of all this, the bottom rear butterfly
;will essentially be tricked into thinking BBH has not yet turned, but only for the purposes of the speedup calculation; this ensures it won't
;speedup unnecessarily as a result of BBH turning around, but also won't impede it from speeding up entirely; if it was already too far away
;from BBH when the turn happened, or if BBH moves further away while the flag is still on, the butterfly can still speed up.
trigger1 = var(15) && NumHelper(19000)
var(10) = Helper(19000), var(10)

[State 19000, VelSet]
type = VelSet
trigger1 = 1
;this setup ensures 0 degrees = straight up, 90 = straight right, etc
x = ifElse(abs((var(10) - fvar(10))) > 90, 5, 2.5) * sin(fvar(0)) * const(size.xScale)
;x and y vels gets extra speedup if really far away horizontally/vertically respectively
y = ifElse(abs((var(11) - fvar(11))) > 90, -2.5, -1.25) * cos(fvar(0))

[State 19000, ChangeAnim: up]
type = ChangeAnim
;less than 22.5 degrees (45/2) or greater than 337.5 (360 - 45/2)
trigger1 = fvar(0) < 0.392699 || fvar(0) > 5.8904862
value = 19008
elem = AnimElemNo(0)

[State 19000, ChangeAnim: up-right]
type = ChangeAnim
;greater than 22.5 degrees (45/2) and less than 67.5 (90 - 45/2)
trigger1 = fvar(0) >= 0.392699 && fvar(0) < 1.178097
value = 19009
elem = AnimElemNo(0)

[State 19000, ChangeAnim: right]
type = ChangeAnim
;greater than 67.5 degrees (90 - 45/2) and less than 112.5 (90 + 45/2)
trigger1 = fvar(0) >= 1.178097 && fvar(0) < 1.9634954
value = 19006
elem = AnimElemNo(0)

[State 19000, ChangeAnim: down-right]
type = ChangeAnim
;greater than 112.5 degrees (90 + 45/2) and less than 157.5 (180 - 45/2)
trigger1 = fvar(0) >= 1.9634954 && fvar(0) < 2.7488936
value = 19003
elem = AnimElemNo(0)

[State 19000, ChangeAnim: down]
type = ChangeAnim
;greater than 157.5 degrees (180 - 45/2) and less than 202.5 (180 + 45/2)
trigger1 = fvar(0) >= 2.7488936 && fvar(0) < 3.5342917
value = 19002
elem = AnimElemNo(0)

[State 19000, ChangeAnim: down-left]
type = ChangeAnim
;greater than 202.5 degrees (180 + 45/2) and less than 247.5 (270 - 45/2)
trigger1 = fvar(0) >= 3.5342917 && fvar(0) < 4.3196899
value = 19001
elem = AnimElemNo(0)

[State 19000, ChangeAnim: left]
type = ChangeAnim
;greater than 247.5 degrees (270 - 45/2) and less than 247.5 (270 + 45/2)
trigger1 = fvar(0) >= 4.3196899 && fvar(0) < 5.1050881
value = 19004
elem = AnimElemNo(0)

[State 19000, ChangeAnim: up-left]
type = ChangeAnim
;greater than 292.5 degrees (270 + 45/2) and less than 337.5 (360 - 45/2)
trigger1 = fvar(0) >= 5.1050881 && fvar(0) < 5.8904862
value = 19007
elem = AnimElemNo(0)



;====================<BUTTERFLY (CROUCHING)>=========================
[StateDef 19011]
type = A
physics = N
moveType = I
anim = 19006
ctrl = 0
velSet = 0,0
sprPriority = 5

[State 19011, Turn]
type = Turn
trigger1 = Facing != Root, Facing

[State 19011, Update Position Relative to Root]
type = Null
trigger1 = fvar(10) := (pos x - Root, pos x) * Root, Facing || fvar(11) := (pos y - Root, pos y)

[State 19011, Set Boundary Walls]
type = Null
trigger1 = Time < 78
;head sitting
trigger1 = var(10) := ceil(8 * const(size.xScale)) || var(11) := -47
;flower hovering
trigger2 = Time >= 78
trigger2 = 1 || var(4) := ceil(28 * const(size.xScale)) || var(2) := -23 || var(6) := ceil(34 * const(size.xScale)) || var(8) := -27
trigger2 = var(10) := ceil(31 * const(size.xScale)) || var(11) := -25

[State 19011, VelSet: Travel to BBH's head]
type = VelSet
trigger1 = Time < 20
x = (var(10) - fvar(10))/9
y = (var(11) - fvar(11))/9

[State 19011, VelSet: Travel to BBH's head]
type = VelSet
trigger1 = Time >= 20
x = (var(10) - fvar(10))/2
y = (var(11) - fvar(11))/2

[State 19011, VelSet: Reached BBH's head]
type = VelSet
trigger1 = abs(var(10) - fvar(10)) < 1 && abs(var(11) - fvar(11)) < 1
x = 0
y = 0

[State 19011, Hold AnimElem]
type = ChangeAnim
trigger1 = Time >= 20 && Time < 78
value = Anim
elem = 1

[State 19011, Randomize AnimElem]
type = ChangeAnim
trigger1 = Time = 78
value = Anim
elem = Random % 30

[State 19011, Set boundary flag (inside)]
type = VarSet
trigger1 = Time >= 78
var(0) = 1

[State 19011, Set boundary flag (outside)]
type = VarSet
trigger1 = Time >= 78
trigger1 = fvar(10) <= var(4) || fvar(10) >= var(6) || fvar(11) >= var(2) || fvar(11) <= var(8)
var(0) = 0

[State 19011, Angle set (random roaming within boundary)]
type = VarSet
;only activate if inside boundary (and if past head sitting portion)
triggerAll = var(0) && Time >= 78
trigger1 = AnimElemNo(0) = 1 || AnimElemNo(0) = 11 || AnimElemNo(0) = 21
fvar(0) = Random % 360 * (pi/180)

[State 19011, Angle set (returning to boundary from outside)]
type = Null
;only activate if outside boundary (or if not past head sitting portion)
triggerAll = !var(0) || Time < 78
;avoid using arctan if either x or y is 0
trigger1 = abs((var(10) - fvar(10))) != 0 && abs(var(11) - fvar(11)) != 0
;arctan(x distance / y distance), using absolute values for both
trigger1 = 1 || fvar(0) := atan( abs((var(10) - fvar(10))) / abs(var(11) - fvar(11)) )
;if x is 0 then the angle should be 0 (might also be 180, depending on sign of x/y)
trigger2 = abs((var(10) - fvar(10))) = 0
trigger2 = 1 || fvar(0) := 0
;if y is 0 then the angle should be 90 (or 270, depending on signs)
trigger3 = abs(var(11) - fvar(11)) = 0
trigger3 = 1 || fvar(0) := pi/2

[State 19011, Fix angle if returning (based on sign of components)]
type = Null
;only activate if outside boundary (or if not past head sitting portion)
triggerAll = !var(0) || Time < 78
;quadrant II (upper left)
trigger1 = var(10) - fvar(10) <= 0 && var(11) - fvar(11) <= 0
trigger1 = fvar(0) := 2 * pi - fvar(0)
;quadrant III (lower left)
trigger2 = var(10) - fvar(10) <= 0 && var(11) - fvar(11) >= 0
trigger2 = fvar(0) := pi + fvar(0)
;quadrant IV (lower right)
trigger3 = var(10) - fvar(10) >= 0 && var(11) - fvar(11) >= 0
trigger3 = fvar(0) := pi - fvar(0)

[State 19011, Emergency angle set (try moving 90 degrees)]
type = VarSet
;only activate if inside boundary (and if past head sitting portion)
triggerAll = var(0) && Time >= 78
trigger1 = fvar(10) + vel x <= var(4) || fvar(10) + vel x >= var(6)
trigger2 = fvar(11) + vel y >= var(2) || fvar(11) + vel y <= var(8)
fvar(0) = ifElse(fvar(0) + pi/2 <= 2*pi, fvar(0) + pi/2, (pi/2) - (2*pi - fvar(0)))

[State 19011, VelSet (flower hovering)]
type = VelSet
;only activate if past the head sitting portion
trigger1 = Time >= 78
;this setup ensures 0 degrees = straight up, 90 = straight right, etc
x = ifElse(Time < 86, 5, 2.5) * sin(fvar(0)) * const(size.xScale)
y = ifElse(Time < 86, -2.5, -1.25) * cos(fvar(0))

[State 19011, ChangeAnim: up]
type = ChangeAnim
;less than 22.5 degrees (45/2) or greater than 337.5 (360 - 45/2)
trigger1 = fvar(0) < 0.392699 || fvar(0) > 5.8904862
value = 19008
elem = AnimElemNo(0)

[State 19011, ChangeAnim: up-right]
type = ChangeAnim
;greater than 22.5 degrees (45/2) and less than 67.5 (90 - 45/2)
trigger1 = fvar(0) >= 0.392699 && fvar(0) < 1.178097
value = 19009
elem = AnimElemNo(0)

[State 19011, ChangeAnim: right]
type = ChangeAnim
;greater than 67.5 degrees (90 - 45/2) and less than 112.5 (90 + 45/2)
trigger1 = fvar(0) >= 1.178097 && fvar(0) < 1.9634954
value = 19006
elem = AnimElemNo(0)

[State 19011, ChangeAnim: down-right]
type = ChangeAnim
;greater than 112.5 degrees (90 + 45/2) and less than 157.5 (180 - 45/2)
trigger1 = fvar(0) >= 1.9634954 && fvar(0) < 2.7488936
value = 19003
elem = AnimElemNo(0)

[State 19011, ChangeAnim: down]
type = ChangeAnim
;greater than 157.5 degrees (180 - 45/2) and less than 202.5 (180 + 45/2)
trigger1 = fvar(0) >= 2.7488936 && fvar(0) < 3.5342917
value = 19002
elem = AnimElemNo(0)

[State 19011, ChangeAnim: down-left]
type = ChangeAnim
;greater than 202.5 degrees (180 + 45/2) and less than 247.5 (270 - 45/2)
trigger1 = fvar(0) >= 3.5342917 && fvar(0) < 4.3196899
value = 19001
elem = AnimElemNo(0)

[State 19011, ChangeAnim: left]
type = ChangeAnim
;greater than 247.5 degrees (270 - 45/2) and less than 247.5 (270 + 45/2)
trigger1 = fvar(0) >= 4.3196899 && fvar(0) < 5.1050881
value = 19004
elem = AnimElemNo(0)

[State 19011, ChangeAnim: up-left]
type = ChangeAnim
;greater than 292.5 degrees (270 + 45/2) and less than 337.5 (360 - 45/2)
trigger1 = fvar(0) >= 5.1050881 && fvar(0) < 5.8904862
value = 19007
elem = AnimElemNo(0)

[State 19011, ChangeState]
type = ChangeState
trigger1 = Root, StateNo != 11
trigger2 = Root, StateNo = 11 && Root, Anim != 11
trigger3 = Root, MoveType = H
value = 19000



;====================<BUTTERFLY (HOMING IN ON SINGLE POINT)>=========================
[StateDef 19200]
type = A
physics = N
moveType = I
anim = 19006
ctrl = 0
velSet = 0,0
sprPriority = 5

[State 19200, Turn]
type = Turn
trigger1 = Facing != Root, Facing

[State 19200, Update position relative to root]
type = Null
trigger1 = fvar(10) := (pos x - Root, pos x) * Root, Facing || fvar(11) := (pos y - Root, pos y)

[State 19200, Set destination]
type = Null
;all three, winpose 1 / turns intro (converging on single point)
trigger1 = (Root, StateNo = 181 || Root, Anim = 6901) && (Root, AnimElemTime(8) < 0 || Root, AnimElemTime(9) >= 0)
trigger1 = var(10) := ceil(17 * const(size.xScale)) || var(11) := -60
;lower forward, winpose 1 (scattering apart)
trigger2 = IsHelper(19000) && (Root, StateNo = 181 || Root, Anim = 6901) && Root, AnimElemTime(8) >= 0 && Root, AnimElemTime(9) < 0
trigger2 = var(10) := ceil(42 + 15 * const(size.xScale)) || var(11) := (-52 + 5)
;lower rear, winpose 1 (scattering apart)
trigger3 = IsHelper(19001) && (Root, StateNo = 181 || Root, Anim = 6901) && Root, AnimElemTime(8) >= 0 && Root, AnimElemTime(9) < 0
trigger3 = var(10) := ceil(-18 - 15 * const(size.xScale)) || var(11) := (-52 + 5)
;top, winpose 1 (scattering apart)
trigger4 = IsHelper(19002) && (Root, StateNo = 181 || Root, Anim = 6901) && Root, AnimElemTime(8) >= 0 && Root, AnimElemTime(9) < 0
trigger4 = var(10) := ceil(18 + 5 * const(size.xScale)) || var(11) := (-87 - 15)
;all three, winpose 2 (converging on single point)
trigger5 = Root, StateNo = 182 && (Root, AnimElemTime(9) < 0 || (Root, AnimElemTime(14) >= 0 && Root, AnimElemTime(19) < 0) || (Root, AnimElemTime(24) >= 0 && Root, AnimElemTime(29) < 0))
trigger5 = var(10) := ceil(17 * const(size.xScale)) || var(11) := -60
;lower forward, winpose 2 (scattering apart)
trigger6 = IsHelper(19000) && Root, StateNo = 182 && ((Root, AnimElemTime(9) >= 0 && Root, AnimElemTime(11) < 0) || (Root, AnimElemTime(19) >= 0 && Root, AnimElemTime(21) < 0) || (Root, AnimElemTime(29) >= 0 && Root, AnimElemTime(30) <= 13))
trigger6 = var(10) := ceil(42 + 15 * const(size.xScale)) || var(11) := (-52 + 5)
;lower rear, winpose 2 (scattering apart)
trigger7 = IsHelper(19001) && Root, StateNo = 182 && ((Root, AnimElemTime(9) >= 0 && Root, AnimElemTime(11) < 0) || (Root, AnimElemTime(19) >= 0 && Root, AnimElemTime(21) < 0) || (Root, AnimElemTime(29) >= 0 && Root, AnimElemTime(30) <= 13))
trigger7 = var(10) := ceil(-18 - 15 * const(size.xScale)) || var(11) := (-52 + 5)
;top, winpose 2 (scattering apart)
trigger8 = IsHelper(19002) && Root, StateNo = 182 && ((Root, AnimElemTime(9) >= 0 && Root, AnimElemTime(11) < 0) || (Root, AnimElemTime(19) >= 0 && Root, AnimElemTime(21) < 0) || (Root, AnimElemTime(29) >= 0 && Root, AnimElemTime(30) <= 13))
trigger8 = var(10) := ceil(18 + 5 * const(size.xScale)) || var(11) := (-87 - 15)
;all three, winpose 5/6 (converging on single point)
trigger9 = (Root, StateNo = [185,186]) && (Root, AnimElemTime(57) < 0 || Root, AnimElemTime(58) >= 0)
trigger9 = var(10) := ceil(-17 * const(size.xScale)) || var(11) := -60
;lower forward, winpose 5/6 (scattering apart)
trigger10 = IsHelper(19000) && (Root, StateNo = [185,186]) && Root, AnimElemTime(57) >= 0 && Root, AnimElemTime(58) < 0
trigger10 = var(10) := ceil(18 + 15 * const(size.xScale)) || var(11) := (-52 + 5)
;lower rear, winpose 5/6 (scattering apart)
trigger11 = IsHelper(19001) && (Root, StateNo = [185,186]) && Root, AnimElemTime(57) >= 0 && Root, AnimElemTime(58) < 0
trigger11 = var(10) := ceil(-42 - 15 * const(size.xScale)) || var(11) := (-52 + 5)
;top, winpose 5/6 (scattering apart)
trigger12 = IsHelper(19002) && (Root, StateNo = [185,186]) && Root, AnimElemTime(57) >= 0 && Root, AnimElemTime(58) < 0
trigger12 = var(10) := ceil(-18 - 5 * const(size.xScale)) || var(11) := (-87 - 15)
;lower forward, standing (far/close) light punch
trigger13 = IsHelper(19000) && Root, StateNo = [200, 205]
trigger13 = var(10) := ceil(75 * const(size.xScale)) || var(11) := -72
;lower forward, standing (far/close) medium punch
trigger14 = IsHelper(19000) && Root, StateNo = [210, 215]
trigger14 = var(10) := ceil(-55 - 10 * const(size.xScale)) || var(11) := (-72 - 5)
;lower rear, standing (far/close) medium punch
trigger15 = IsHelper(19001) && Root, StateNo = [210, 215]
trigger15 = var(10) := ceil(41 + 10 * const(size.xScale)) || var(11) := (-53 + 5)
;lower forward, standing (far/close) light punch
trigger16 = IsHelper(19000) && Root, StateNo = [230, 235]
trigger16 = var(10) := ceil(68 * const(size.xScale)) || var(11) := -86
;lower forward, suprise & hop
trigger17 = IsHelper(19000) && Root, StateNo = [248,249]
trigger17 = var(10) := ceil(16 + 15 * const(size.xScale)) || var(11) := (-49 + 5)
;lower rear, suprise & hop
trigger18 = IsHelper(19001) && Root, StateNo = [248,249]
trigger18 = var(10) := ceil(9 + 15 * const(size.xScale)) || var(11) := (-38 + 5)
;top, suprise & hop
trigger19 = IsHelper(19002) && Root, StateNo = [248,249]
trigger19 = var(10) := ceil(13 + 5 * const(size.xScale)) || var(11) := (-45 - 15)
;lower forward, crouching light punch
trigger20 = IsHelper(19000) && Root, StateNo = 400
trigger20 = var(10) := ceil(84 * const(size.xScale)) || var(11) := -36
;lower forward, crouching medium punch
trigger21 = IsHelper(19000) && Root, StateNo = 410
trigger21 = var(10) := ceil(-37 - 10 * const(size.xScale)) || var(11) := (-36 - 5)
;lower rear, crouching medium punch
trigger22 = IsHelper(19001) && Root, StateNo = 410
trigger22 = var(10) := ceil(52 + 10 * const(size.xScale)) || var(11) := (-36 + 5)
;lower forward, crouching light kick
trigger23 = IsHelper(19000) && Root, StateNo = 430
trigger23 = var(10) := ceil(45 * const(size.xScale)) || var(11) := -40
;lower forward, crouching medium kick
trigger24 = IsHelper(19000) && Root, StateNo = 440
trigger24 = var(10) := ceil(-60 * const(size.xScale)) || var(11) := -37
;all three, smile & missile (high) / happy & missile
trigger25 = Root, StateNo = 1000 || Root, StateNo = 1030 || Root, StateNo = 1100 || Root, StateNo = 1130 || Root, StateNo = 1150
trigger25 = var(10) := ceil(11 * const(size.xScale)) || var(11) := -7

[State 19200, VelSet (travel to destination)]
type = VelSet
trigger1 = 1
x = (var(10) - fvar(10))/11
y = (var(11) - fvar(11))/11

[State 19200, VelSet (faster travel)]
type = VelSet
trigger1 = Root, StateNo = 1000 || Root, StateNo = 1030 || Root, StateNo = 1100 || Root, StateNo = 1130 || Root, StateNo = 1150
x = (var(10) - fvar(10))/6
y = (var(11) - fvar(11))/6

[State 19200, VelSet (fastest travel)]
type = VelSet
trigger1 = Root, StateNo = 248
x = (var(10) - fvar(10))/6
y = (var(11) - fvar(11))/4

[State 19200, Angle set (returning to boundary from outside)]
type = Null
;avoid using arctan if either x or y is 0
trigger1 = abs((var(10) - fvar(10))) != 0 && abs(var(11) - fvar(11)) != 0
;arctan(x distance / y distance), using absolute values for both
trigger1 = 1 || fvar(0) := atan( abs((var(10) - fvar(10))) / abs(var(11) - fvar(11)) )
;if x is 0 then the angle should be 0 (might also be 180, depending on sign of x/y)
trigger2 = abs((var(10) - fvar(10))) = 0
trigger2 = 1 || fvar(0) := 0
;if y is 0 then the angle should be 90 (or 270, depending on signs)
trigger3 = abs(var(11) - fvar(11)) = 0
trigger3 = 1 || fvar(0) := pi/2

[State 19200, Fix angle if returning (based on sign of components)]
type = Null
;quadrant II (upper left)
trigger1 = var(10) - fvar(10) <= 0 && var(11) - fvar(11) <= 0
trigger1 = fvar(0) := 2 * pi - fvar(0)
;quadrant III (lower left)
trigger2 = var(10) - fvar(10) <= 0 && var(11) - fvar(11) >= 0
trigger2 = fvar(0) := pi + fvar(0)
;quadrant IV (lower right)
trigger3 = var(10) - fvar(10) >= 0 && var(11) - fvar(11) >= 0
trigger3 = fvar(0) := pi - fvar(0)

[State 19200, ChangeAnim: up]
type = ChangeAnim
;less than 22.5 degrees (45/2) or greater than 337.5 (360 - 45/2)
trigger1 = fvar(0) < 0.392699 || fvar(0) > 5.8904862
value = 19008
elem = AnimElemNo(0)

[State 19200, ChangeAnim: up-right]
type = ChangeAnim
;greater than 22.5 degrees (45/2) and less than 67.5 (90 - 45/2)
trigger1 = fvar(0) >= 0.392699 && fvar(0) < 1.178097
value = 19009
elem = AnimElemNo(0)

[State 19200, ChangeAnim: right]
type = ChangeAnim
;greater than 67.5 degrees (90 - 45/2) and less than 112.5 (90 + 45/2)
trigger1 = fvar(0) >= 1.178097 && fvar(0) < 1.9634954
value = 19006
elem = AnimElemNo(0)

[State 19200, ChangeAnim: down-right]
type = ChangeAnim
;greater than 112.5 degrees (90 + 45/2) and less than 157.5 (180 - 45/2)
trigger1 = fvar(0) >= 1.9634954 && fvar(0) < 2.7488936
value = 19003
elem = AnimElemNo(0)

[State 19200, ChangeAnim: down]
type = ChangeAnim
;greater than 157.5 degrees (180 - 45/2) and less than 202.5 (180 + 45/2)
trigger1 = fvar(0) >= 2.7488936 && fvar(0) < 3.5342917
value = 19002
elem = AnimElemNo(0)

[State 19200, ChangeAnim: down-left]
type = ChangeAnim
;greater than 202.5 degrees (180 + 45/2) and less than 247.5 (270 - 45/2)
trigger1 = fvar(0) >= 3.5342917 && fvar(0) < 4.3196899
value = 19001
elem = AnimElemNo(0)

[State 19200, ChangeAnim: left]
type = ChangeAnim
;greater than 247.5 degrees (270 - 45/2) and less than 247.5 (270 + 45/2)
trigger1 = fvar(0) >= 4.3196899 && fvar(0) < 5.1050881
value = 19004
elem = AnimElemNo(0)

[State 19200, ChangeAnim: up-left]
type = ChangeAnim
;greater than 292.5 degrees (270 + 45/2) and less than 337.5 (360 - 45/2)
trigger1 = fvar(0) >= 5.1050881 && fvar(0) < 5.8904862
value = 19007
elem = AnimElemNo(0)

[State 19200, Change to straight up if reached destination]
type = ChangeAnim
trigger1 = (Root, StateNo = [200,205]) || Root, StateNo = 230 || Root, StateNo = 400 || Root, StateNo = 430 || Root, StateNo = 440 || Root, StateNo = [1000, 1030]
trigger1 = abs((var(10) - fvar(10))) < 5 && abs((var(11) - fvar(11))) < 5
value = 19008
elem = AnimElemNo(0)

[State 19200, ChangeState]
type = ChangeState
trigger1 = Root, StateNo != 181
trigger1 = Root, StateNo != 182
trigger1 = Root, StateNo != [185,186]
trigger1 = Root, Anim != 6901
trigger1 = Root, StateNo != [200,215]
trigger1 = Root, StateNo != [230,235]
trigger1 = Root, StateNo != [248,249]
trigger1 = Root, StateNo != 400
trigger1 = Root, StateNo != 410
trigger1 = Root, StateNo != 430
trigger1 = Root, StateNo != 440
trigger1 = Root, StateNo != 1000
trigger1 = Root, StateNo != 1030
trigger1 = Root, StateNo != 1100
trigger1 = Root, StateNo != 1130
trigger1 = Root, StateNo != 1150
trigger2 = (Root, StateNo = 181 || Root, Anim = 6901) && Root, AnimElem = 10
trigger3 = Root, StateNo = 182 && (Root, AnimElem = 11 || Root, AnimElem = 21 || Root, AnimElemTime(30) > 13)
trigger4 = (Root, StateNo = [185,186]) && Root, AnimElem = 59
trigger5 = Root, StateNo = 210 && Root, AnimElem = 5
trigger6 = Root, StateNo = 215 && Root, AnimElem = 8
trigger7 = Root, StateNo = 249 && Root, AnimElem = 3
trigger8 = Root, StateNo = 400 && Root, AnimElem = 4
trigger9 = Root, StateNo = 410 && Root, AnimElem = 6
trigger10 = Root, StateNo = 440 && Root, AnimElem = 6
trigger11 = (Root, StateNo = [1000,1030]) && Root, AnimElem = 17
trigger12 = (Root, StateNo = [1100,1130]) && Root, AnimElem = 17
trigger13 = Root, StateNo = 1150 && Root, AnimElem = 10
trigger14 = Root, MoveType = H
value = 19000



;====================<BUTTERFLY (CYCLING BETWEEN THREE POINTS)>=========================
[StateDef 19201]
type = A
physics = N
moveType = I
anim = 19006
ctrl = 0
velSet = 0,0
sprPriority = 5

[State 19201, Turn]
type = Turn
trigger1 = Facing != Root, Facing

[State 19201, Update position relative to root]
type = Null
trigger1 = fvar(10) := (pos x - Root, pos x) * Root, Facing || fvar(11) := (pos y - Root, pos y)

[State 19201, Point select]
type = Null
;each butterfly gets a randomly chosen point
trigger1 = !Time
trigger1 = 1 || var(20) := Random % 3
;also reset the timer
trigger1 = var(21) := 0
;switch points when close enough to current one and if timer has elapsed long enough
trigger2 = abs((var(10) - fvar(10))) < 3.5 && abs((var(11) - fvar(11))) < 3.5 && var(21) > 8
trigger2 = 1 || var(20) := (var(20) + 1) % 3
;also reset the timer
trigger2 = var(21) := 0

[State 19201, Set destination]
type = Null
;standard cycling
trigger1 = var(20) = 0 && (((Root, StateNo = [185, 186]) && Root, AnimElemTime(40) < 0) || Root, StateNo = 220 || Root, StateNo = 250 || (Root, StateNo = [1050,1080]) || (Root, StateNo = [3000,3050]) || Root, StateNo = 3110)
trigger1 = var(10) := ceil(-41 * const(size.xScale)) || var(11) := (-92 + 2)
trigger2 = var(20) = 1 && (((Root, StateNo = [185, 186]) && Root, AnimElemTime(40) < 0) || Root, StateNo = 220 || Root, StateNo = 250 || (Root, StateNo = [1050,1080]) || (Root, StateNo = [3000,3050]) || Root, StateNo = 3110)
trigger2 = var(10) := ceil(-42 * const(size.xScale)) || var(11) := -97
trigger3 = var(20) = 2 && (((Root, StateNo = [185, 186]) && Root, AnimElemTime(40) < 0) || Root, StateNo = 220 || Root, StateNo = 250 || (Root, StateNo = [1050,1080]) || (Root, StateNo = [3000,3050]) || Root, StateNo = 3110)
trigger3 = var(10) := ceil(-54 * const(size.xScale)) || var(11) := (-109 - 2)
;crouch cycling
trigger4 = var(20) = 0 && (Root, StateNo = 420 || Root, StateNo = 459)
trigger4 = var(10) := ceil(-39 * const(size.xScale)) || var(11) := (-62 + 2)
trigger5 = var(20) = 1 && (Root, StateNo = 420 || Root, StateNo = 459)
trigger5 = var(10) := ceil(-40 * const(size.xScale)) || var(11) := -65
trigger6 = var(20) = 2 && (Root, StateNo = 420 || Root, StateNo = 459)
trigger6 = var(10) := ceil(-52 * const(size.xScale)) || var(11) := (-77 - 2)
;lying down cycling
trigger7 = var(20) = 0 && (Root, StateNo = 185 || Root, StateNo = 820 || Root, StateNo = 3210 || Root, StateNo = 3414)
trigger7 = var(10) := ceil(-75 * const(size.xScale)) * ifElse(Root, StateNo = 185 || Root, StateNo = 820, -1, 1) || var(11) := (-13 + 2)
trigger8 = var(20) = 1 && (Root, StateNo = 185 || Root, StateNo = 820 || Root, StateNo = 3210 || Root, StateNo = 3414)
trigger8 = var(10) := ceil(-76 * const(size.xScale)) * ifElse(Root, StateNo = 185 || Root, StateNo = 820, -1, 1) || var(11) := -16
trigger9 = var(20) = 2 && (Root, StateNo = 185 || Root, StateNo = 820 || Root, StateNo = 3210 || Root, StateNo = 3414)
trigger9 = var(10) := ceil(-88 * const(size.xScale)) * ifElse(Root, StateNo = 185 || Root, StateNo = 820, -1, 1) || var(11) := (-28 - 2)
;win 6 final pose cycling
trigger10 = var(20) = 0 && Root, StateNo = 186
trigger10 = var(10) := ceil(-8 * const(size.xScale)) || var(11) := (-74 + 2)
trigger11 = var(20) = 1 && Root, StateNo = 186
trigger11 = var(10) := ceil(-4 * const(size.xScale)) || var(11) := -86
trigger12 = var(20) = 2 && Root, StateNo = 186
trigger12 = var(10) := ceil(-21 * const(size.xScale)) || var(11) := (-93 - 2)
;stand medium kick cycling
trigger13 = var(20) = 0 && Root, StateNo = 240
trigger13 = var(10) := ceil(-70 * const(size.xScale)) || var(11) := (-38 + 2)
trigger14 = var(20) = 1 && Root, StateNo = 240
trigger14 = var(10) := ceil(-71 * const(size.xScale)) || var(11) := -43
trigger15 = var(20) = 2 && Root, StateNo = 240
trigger15 = var(10) := ceil(-83 * const(size.xScale)) || var(11) := (-55 - 2)
;crouching heavy kick cycling
trigger16 = var(20) = 0 && Root, StateNo = 450
trigger16 = var(10) := ceil(16 * const(size.xScale)) * ifElse(Root, StateNo = 185 || Root, StateNo = 820, -1, 1) || var(11) := (-31 + 2)
trigger17 = var(20) = 1 && Root, StateNo = 450
trigger17 = var(10) := ceil(15 * const(size.xScale)) * ifElse(Root, StateNo = 185 || Root, StateNo = 820, -1, 1) || var(11) := -34
trigger18 = var(20) = 2 && Root, StateNo = 450
trigger18 = var(10) := ceil(29 * const(size.xScale)) * ifElse(Root, StateNo = 185 || Root, StateNo = 820, -1, 1) || var(11) := (-46 - 2)

[State 19201, VelSet: travel to destination]
type = VelSet
trigger1 = 1
x = (var(10) - fvar(10))/6
y = (var(11) - fvar(11))/6

[State 19201, Angle set (returning to boundary from outside)]
type = Null
;avoid using arctan if either x or y is 0
trigger1 = abs((var(10) - fvar(10))) != 0 && abs(var(11) - fvar(11)) != 0
;arctan(x distance / y distance), using absolute values for both
trigger1 = 1 || fvar(0) := atan( abs((var(10) - fvar(10))) / abs(var(11) - fvar(11)) )
;if x is 0 then the angle should be 0 (might also be 180, depending on sign of x/y)
trigger2 = abs((var(10) - fvar(10))) = 0
trigger2 = 1 || fvar(0) := 0
;if y is 0 then the angle should be 90 (or 270, depending on signs)
trigger3 = abs(var(11) - fvar(11)) = 0
trigger3 = 1 || fvar(0) := pi/2

[State 19201, Fix angle if returning (based on sign of components)]
type = Null
;quadrant II (upper left)
trigger1 = var(10) - fvar(10) <= 0 && var(11) - fvar(11) <= 0
trigger1 = fvar(0) := 2 * pi - fvar(0)
;quadrant III (lower left)
trigger2 = var(10) - fvar(10) <= 0 && var(11) - fvar(11) >= 0
trigger2 = fvar(0) := pi + fvar(0)
;quadrant IV (lower right)
trigger3 = var(10) - fvar(10) >= 0 && var(11) - fvar(11) >= 0
trigger3 = fvar(0) := pi - fvar(0)

[State 19201, ChangeAnim: up]
type = ChangeAnim
;less than 22.5 degrees (45/2) or greater than 337.5 (360 - 45/2)
trigger1 = fvar(0) < 0.392699 || fvar(0) > 5.8904862
value = 19008
elem = AnimElemNo(0)

[State 19201, ChangeAnim: up-right]
type = ChangeAnim
;greater than 22.5 degrees (45/2) and less than 67.5 (90 - 45/2)
trigger1 = fvar(0) >= 0.392699 && fvar(0) < 1.178097
value = 19009
elem = AnimElemNo(0)

[State 19201, ChangeAnim: right]
type = ChangeAnim
;greater than 67.5 degrees (90 - 45/2) and less than 112.5 (90 + 45/2)
trigger1 = fvar(0) >= 1.178097 && fvar(0) < 1.9634954
value = 19006
elem = AnimElemNo(0)

[State 19201, ChangeAnim: down-right]
type = ChangeAnim
;greater than 112.5 degrees (90 + 45/2) and less than 157.5 (180 - 45/2)
trigger1 = fvar(0) >= 1.9634954 && fvar(0) < 2.7488936
value = 19003
elem = AnimElemNo(0)

[State 19201, ChangeAnim: down]
type = ChangeAnim
;greater than 157.5 degrees (180 - 45/2) and less than 202.5 (180 + 45/2)
trigger1 = fvar(0) >= 2.7488936 && fvar(0) < 3.5342917
value = 19002
elem = AnimElemNo(0)

[State 19201, ChangeAnim: down-left]
type = ChangeAnim
;greater than 202.5 degrees (180 + 45/2) and less than 247.5 (270 - 45/2)
trigger1 = fvar(0) >= 3.5342917 && fvar(0) < 4.3196899
value = 19001
elem = AnimElemNo(0)

[State 19201, ChangeAnim: left]
type = ChangeAnim
;greater than 247.5 degrees (270 - 45/2) and less than 247.5 (270 + 45/2)
trigger1 = fvar(0) >= 4.3196899 && fvar(0) < 5.1050881
value = 19004
elem = AnimElemNo(0)

[State 19201, ChangeAnim: up-left]
type = ChangeAnim
;greater than 292.5 degrees (270 + 45/2) and less than 337.5 (360 - 45/2)
trigger1 = fvar(0) >= 5.1050881 && fvar(0) < 5.8904862
value = 19007
elem = AnimElemNo(0)

[State 19201, Timer]
type = VarAdd
trigger1 = 1
var(21) = 1

[State 19201, ChangeState]
type = ChangeState
trigger1 = Root, StateNo != [185,186]
trigger1 = Root, StateNo != 220
trigger1 = Root, StateNo != 240
trigger1 = Root, StateNo != 250
trigger1 = Root, StateNo != 420
trigger1 = Root, StateNo != 450
trigger1 = Root, StateNo != 459
trigger1 = Root, StateNo != 820
trigger1 = Root, StateNo != [1050,1080]
trigger1 = Root, StateNo != [3000,3050]
trigger1 = Root, StateNo != 3110
trigger1 = Root, StateNo != 3210
trigger1 = Root, StateNo != 3414
trigger2 = (Root, StateNo = [185,186]) && Root, AnimElem = 40
trigger3 = Root, StateNo = 220 && Root, AnimElem = 21
trigger4 = Root, StateNo = 240 && Root, AnimElem = 6
trigger5 = Root, StateNo = 250 && Root, AnimElem = 7
trigger6 = Root, StateNo = 420 && Root, AnimElem = 21
trigger7 = Root, StateNo = 450 && Root, AnimElem = 7
trigger8 = Root, StateNo = 459 && Root, AnimElem = 7
trigger9 = Root, StateNo = 820 && Root, AnimElem = 16
trigger10 = (Root, StateNo = [3000,3050]) && Root, AnimElem = 73
trigger11 = Root, StateNo = 3110 && Root, AnimElem = 34
trigger12 = Root, StateNo = 3210 && Root, AnimElem = 16
trigger13 = Root, StateNo = 3414 && Root, AnimElem = 3
trigger14 = Root, MoveType = H
value = 19000



;====================<BUTTERFLY (CYCLING BETWEEN FOUR POINTS)>=========================
[StateDef 19202]
type = A
physics = N
moveType = I
anim = 19006
ctrl = 0
velSet = 0,0
sprPriority = 5

[State 19202, Turn]
type = Turn
trigger1 = Facing != Root, Facing

[State 19202, Update position relative to root]
type = Null
trigger1 = fvar(10) := (pos x - Root, pos x) * Root, Facing || fvar(11) := (pos y - Root, pos y)

[State 19202, Point select]
type = Null
;each butterfly gets a randomly chosen point
trigger1 = !Time
trigger1 = 1 || var(20) := Random % 4
;also reset the timer
trigger1 = var(21) := 0
;switch points when close enough to current one and if timer has elapsed long enough
trigger2 = abs((var(10) - fvar(10))) < 3.5 && abs((var(11) - fvar(11))) < 3.5 && var(21) > 2
trigger2 = 1 || var(20) := (var(20) + 1) % 4
;also reset the timer
trigger2 = var(21) := 0

[State 19202, Set destination]
type = Null
;vertical cheer & fire cycling
trigger1 = var(20) = 0 && Root, StateNo = [1200, 1230]
trigger1 = var(10) := ceil(50 * const(size.xScale)) || var(11) := -102
trigger2 = var(20) = 1 && Root, StateNo = [1200, 1230]
trigger2 = var(10) := ceil(55 * const(size.xScale)) || var(11) := -71
trigger3 = var(20) = 2 && Root, StateNo = [1200, 1230]
trigger3 = var(10) := ceil(29 * const(size.xScale)) || var(11) := -116
trigger4 = var(20) = 3 && Root, StateNo = [1200, 1230]
trigger4 = var(10) := ceil(16 * const(size.xScale)) || var(11) := -80
;horizontal cheer & fire cycling
trigger5 = var(20) = 0 && Root, StateNo = [1250, 1280]
trigger5 = var(10) := ceil(63 * const(size.xScale)) || var(11) := -67
trigger6 = var(20) = 1 && Root, StateNo = [1250, 1280]
trigger6 = var(10) := ceil(68 * const(size.xScale)) || var(11) := -36
trigger7 = var(20) = 2 && Root, StateNo = [1250, 1280]
trigger7 = var(10) := ceil(42 * const(size.xScale)) || var(11) := -81
trigger8 = var(20) = 3 && Root, StateNo = [1250, 1280]
trigger8 = var(10) := ceil(29 * const(size.xScale)) || var(11) := -45

[State 19202, VelSet: travel to destination]
type = VelSet
trigger1 = 1
x = (var(10) - fvar(10))/6
y = (var(11) - fvar(11))/6

[State 19202, Angle set (returning to boundary from outside)]
type = Null
;avoid using arctan if either x or y is 0
trigger1 = abs((var(10) - fvar(10))) != 0 && abs(var(11) - fvar(11)) != 0
;arctan(x distance / y distance), using absolute values for both
trigger1 = 1 || fvar(0) := atan( abs((var(10) - fvar(10))) / abs(var(11) - fvar(11)) )
;if x is 0 then the angle should be 0 (might also be 180, depending on sign of x/y)
trigger2 = abs((var(10) - fvar(10))) = 0
trigger2 = 1 || fvar(0) := 0
;if y is 0 then the angle should be 90 (or 270, depending on signs)
trigger3 = abs(var(11) - fvar(11)) = 0
trigger3 = 1 || fvar(0) := pi/2

[State 19202, Fix angle if returning (based on sign of components)]
type = Null
;quadrant II (upper left)
trigger1 = var(10) - fvar(10) <= 0 && var(11) - fvar(11) <= 0
trigger1 = fvar(0) := 2 * pi - fvar(0)
;quadrant III (lower left)
trigger2 = var(10) - fvar(10) <= 0 && var(11) - fvar(11) >= 0
trigger2 = fvar(0) := pi + fvar(0)
;quadrant IV (lower right)
trigger3 = var(10) - fvar(10) >= 0 && var(11) - fvar(11) >= 0
trigger3 = fvar(0) := pi - fvar(0)

[State 19202, ChangeAnim: up]
type = ChangeAnim
;less than 22.5 degrees (45/2) or greater than 337.5 (360 - 45/2)
trigger1 = fvar(0) < 0.392699 || fvar(0) > 5.8904862
value = 19008
elem = AnimElemNo(0)

[State 19202, ChangeAnim: up-right]
type = ChangeAnim
;greater than 22.5 degrees (45/2) and less than 67.5 (90 - 45/2)
trigger1 = fvar(0) >= 0.392699 && fvar(0) < 1.178097
value = 19009
elem = AnimElemNo(0)

[State 19202, ChangeAnim: right]
type = ChangeAnim
;greater than 67.5 degrees (90 - 45/2) and less than 112.5 (90 + 45/2)
trigger1 = fvar(0) >= 1.178097 && fvar(0) < 1.9634954
value = 19006
elem = AnimElemNo(0)

[State 19202, ChangeAnim: down-right]
type = ChangeAnim
;greater than 112.5 degrees (90 + 45/2) and less than 157.5 (180 - 45/2)
trigger1 = fvar(0) >= 1.9634954 && fvar(0) < 2.7488936
value = 19003
elem = AnimElemNo(0)

[State 19202, ChangeAnim: down]
type = ChangeAnim
;greater than 157.5 degrees (180 - 45/2) and less than 202.5 (180 + 45/2)
trigger1 = fvar(0) >= 2.7488936 && fvar(0) < 3.5342917
value = 19002
elem = AnimElemNo(0)

[State 19202, ChangeAnim: down-left]
type = ChangeAnim
;greater than 202.5 degrees (180 + 45/2) and less than 247.5 (270 - 45/2)
trigger1 = fvar(0) >= 3.5342917 && fvar(0) < 4.3196899
value = 19001
elem = AnimElemNo(0)

[State 19202, ChangeAnim: left]
type = ChangeAnim
;greater than 247.5 degrees (270 - 45/2) and less than 247.5 (270 + 45/2)
trigger1 = fvar(0) >= 4.3196899 && fvar(0) < 5.1050881
value = 19004
elem = AnimElemNo(0)

[State 19202, ChangeAnim: up-left]
type = ChangeAnim
;greater than 292.5 degrees (270 + 45/2) and less than 337.5 (360 - 45/2)
trigger1 = fvar(0) >= 5.1050881 && fvar(0) < 5.8904862
value = 19007
elem = AnimElemNo(0)

[State 19202, Timer]
type = VarAdd
trigger1 = 1
var(21) = 1

[State 19202, ChangeState]
type = ChangeState
trigger1 = Root, StateNo != [1200,1299]
trigger2 = Root, MoveType = H
value = 19000



;========================<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.65, (0.3 - (Time * 0.03)) * 0.65
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.65, (0.15 + (0.009375 * Time)) * 0.65
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.65, (0.15 + (0.009375 * Time)) * 0.65
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.65, (0.3 - (0.0375 * Time)) * 0.65
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.65, (0.35 - (Time * 0.035)) * 0.65
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.65, (0.175 + (0.0109375 * Time)) * 0.65
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.65, (0.175 + (0.0109375 * Time)) * 0.65
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.65, (0.35 - (0.04375 * Time)) * 0.65
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.65, (0.4 - (Time * 0.04)) * 0.65
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.65, (0.2 + (0.0125 * Time)) * 0.65
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.65, (0.2 + (0.0125 * Time)) * 0.65
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.65, (0.4 - (0.05 * Time)) * 0.65
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.65, (0.45 - (Time * 0.045)) * 0.65
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.65, (0.225 + (0.0140625 * Time)) * 0.65
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.65, (0.225 + (0.0140625 * Time)) * 0.65
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.65, (0.4) * 0.65
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.65, (0.45 - (0.05625 * Time)) * 0.65
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.65, (0.5 - (Time * 0.05)) * 0.65
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.65, (0.25 + (0.015625 * Time)) * 0.65
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.65, (0.25 + (0.015625 * Time)) * 0.65
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.65, (0.5) * 0.65
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.65, (0.5 - (0.0625 * Time)) * 0.65
trans = AddAlpha
alpha = 256 - (32 * Time),256

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

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


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

[State 8015, Rotating Spark]
type = Helper
trigger1 = !Time
helperType = Normal
stateNo = 8115
ID = 8115
name = "Slash Spark (Rotation)"
postype = P1
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

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

[State 8015, AngleSet]
type = AngleSet
trigger1 = !Time
value = 15 * (Random % 24)

[State 8015, Scale]
type = AngleDraw
trigger1 = Time < 10
scale = ((0.3 + (Time * 0.15)) / 4) * 0.65, ((1 - (Time * 0.1)) / 4) * 0.65
ignoreHitPause = 1

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

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

[State 8015, 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 8015, Scale Streaks Explod]
type = ModifyExplod
trigger1 = NumExplod(2)
ID = 2
scale = (0.15 + (0.009375 * Time)) * 0.65, (0.15 + (0.009375 * Time)) * 0.65
trans = AddAlpha
alpha = 256 - (16 * Time), 256

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

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


;Medium Slash Spark
[StateDef 8016]
type = A
physics = N
moveType = I
anim = 8015
velSet = 0,0
sprPriority = 5

[State 8016, Rotating Spark]
type = Helper
trigger1 = !Time
helperType = Normal
stateNo = 8115
ID = 8115
name = "Slash Spark (Rotation)"
postype = P1
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

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

[State 8016, AngleSet]
type = AngleSet
trigger1 = !Time
value = 15 * (Random % 24)

[State 8016, Scale]
type = AngleDraw
trigger1 = Time < 10
scale = ((0.35 + (Time * 0.15)) / 3.5) * 0.65, ((1 - (Time * 0.1)) / 3.5) * 0.65
ignoreHitPause = 1

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

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

[State 8016, 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 8016, Scale Streaks Explod]
type = ModifyExplod
trigger1 = NumExplod(2)
ID = 2
scale = (0.175 + (0.0109375 * Time)) * 0.65, (0.175 + (0.0109375 * Time)) * 0.65
trans = AddAlpha
alpha = 256 - (16 * Time), 256

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

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


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

[State 8017, Rotating Spark]
type = Helper
trigger1 = !Time
helperType = Normal
stateNo = 8115
ID = 8115
name = "Slash Spark (Rotation)"
postype = P1
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

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

[State 8017, AngleSet]
type = AngleSet
trigger1 = !Time
value = 15 * (Random % 24)

[State 8017, Scale]
type = AngleDraw
trigger1 = Time < 10
scale = ((0.4 + (Time * 0.15)) / 3) * 0.65, ((1 - (Time * 0.1)) / 3) * 0.65
ignoreHitPause = 1

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

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

[State 8017, 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 8017, Scale Streaks Explod]
type = ModifyExplod
trigger1 = NumExplod(2)
ID = 2
scale = (0.2 + (0.0125 * Time)) * 0.65, (0.2 + (0.0125 * Time)) * 0.65
trans = AddAlpha
alpha = 256 - (16 * Time), 256

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

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


;Special Move Slash Spark
[StateDef 8018]
type = A
physics = N
moveType = I
anim = 8015
velSet = 0,0
sprPriority = 5

[State 8018, Rotating Spark]
type = Helper
trigger1 = !Time
helperType = Normal
stateNo = 8115
ID = 8115
name = "Slash Spark (Rotation)"
postype = P1
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

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

[State 8018, AngleSet]
type = AngleSet
trigger1 = !Time
value = 15 * (Random % 24)

[State 8018, Scale]
type = AngleDraw
trigger1 = Time < 10
scale = ((0.45 + (Time * 0.15)) / 2.5) * 0.65, ((1 - (Time * 0.1)) / 2.5) * 0.65
ignoreHitPause = 1

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

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

[State 8018, Circle]
type = Explod
trigger1 = !Time
anim = 8018
ID = 8018
posType = p1
removeTime = 10
sprPriority = 5
pauseMoveTime = -1
superMoveTime = -1

[State 8018, Circle Scale]
type = ModifyExplod
trigger1 = NumExplod(8018)
ID = 8018
scale = (0.25 + (0.025 * Time)) * 0.65, (0.25 + (0.025 * Time)) * 0.65
trans = AddAlpha
alpha = ceil(256 - 25.6 * Time), 256

[State 8018, 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 8018, Scale Streaks Explod]
type = ModifyExplod
trigger1 = NumExplod(2)
ID = 2
scale = (0.225 + (0.0140625 * Time)) * 0.65, (0.225 + (0.0140625 * Time)) * 0.65
trans = AddAlpha
alpha = 256 - (16 * Time), 256

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

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


;Super Slash Spark
[StateDef 8019]
type = A
physics = N
moveType = I
anim = 8015
velSet = 0,0
sprPriority = 5

[State 8019, Rotating Spark]
type = Helper
trigger1 = !Time
helperType = Normal
stateNo = 8115
ID = 8115
name = "Slash Spark (Rotation)"
postype = P1
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

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

[State 8019, AngleSet]
type = AngleSet
trigger1 = !Time
value = 15 * (Random % 24)

[State 8019, Scale]
type = AngleDraw
trigger1 = Time < 10
scale = ((0.5 + (Time * 0.15)) / 2) * 0.65, ((1 - (Time * 0.1)) / 2) * 0.65
ignoreHitPause = 1

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

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

[State 8019, Circle]
type = Explod
trigger1 = !Time
anim = 8018
ID = 8018
posType = P1
removeTime = 10
sprPriority = 5
pauseMoveTime = -1
superMoveTime = -1

[State 8019, Circle Scale]
type = ModifyExplod
trigger1 = NumExplod(8018)
ID = 8018
scale = (0.3 + (0.03 * Time)) * 0.65, (0.3 + (0.03 * Time)) * 0.65
trans = AddAlpha
alpha = ceil(256 - 25.6 * Time), 256

[State 8019, 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 8019, Scale Streaks Explod]
type = ModifyExplod
trigger1 = NumExplod(2)
ID = 2
scale = (0.25 + (0.015625 * Time)) * 0.65, (0.25 + (0.015625 * Time)) * 0.65
trans = AddAlpha
alpha = 256 - (16 * Time), 256

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

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


;Slash Rotating Spark
[StateDef 8115]
type = A
physics = N
moveType = I
anim = 8010
velSet = 0,0
sprPriority = 5

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

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

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

[State 8115, Scale Amount]
type = Null
trigger1 = Parent, StateNo = 8015
trigger1 = fvar(0) := ((0.15 - (Time * 0.015)) * 0.65)
trigger2 = Parent, StateNo = 8016
trigger2 = fvar(0) := ((0.175 - (Time * 0.0175)) * 0.65)
trigger3 = Parent, StateNo = 8017
trigger3 = fvar(0) := ((0.2 - (Time * 0.02)) * 0.65)
trigger4 = Parent, StateNo = 8018
trigger4 = fvar(0) := ((0.225 - (Time * 0.0225)) * 0.65)
trigger5 = Parent, StateNo = 8019
trigger5 = fvar(0) := ((0.25 - (Time * 0.025)) * 0.65)

[State 8115, Scale]
type = AngleDraw
trigger1 = Time < 10
scale = fvar(0), fvar(0)
ignoreHitPause = 1

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

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

[State 8115, End]
type = DestroySelf
trigger1 = Time >= 10


;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.65, (0.25 + (0.09375 * Time)) * 0.65
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, Floor 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, Player 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 = Time >= 7



;======================<DASH DUST>===========================
[StateDef 8103]
type = A
anim = 1
velSet = 0,0
sprPriority = 5

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

[State 8103, Dash 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 Explod 1]
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 Explod 2]
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 Explod 3]
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, Remove Explods]
type = RemoveExplod
trigger1 = Time >= 22

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



;======================<IMPACT DUST>===========================
[StateDef 8110]
type = A
anim = 1
velSet = 0,0
sprPriority = 5

[State 8110, Impact Dust Explod 1]
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, Impact Dust Explod 2]
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.5, 0.25 + (0.03125 * Time) * 0.5
trans = AddAlpha
alpha = ifElse(Time < 4, 256, 256 - (64 * (Time - 4))), 256

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

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



;========================<FLAMES>=============================
[StateDef 8150]
type = A
physics = N
moveType = I
ctrl = 0
anim = ifElse(IsHelper(38155), 1, 8150)
sprPriority = 4

[State 8150, Flames (Bottom Layer)]
type = Explod
trigger1 = !NumExplod(8151) && Anim = 8150
anim = 8151
ID = 8151
sprPriority = 3
posType = P1
scale = Root, const(size.xScale) * 0.5, 0.5
bindTime = -1
removeTime = -1

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

[State 8150, Flames sound]
type = PlaySnd
trigger1 = !IsHelper(38155)
trigger1 = Time = 1 || Time = 10 || Time = 17; || Time = 24
value = 2, 8150
ignorehitPause = 1

[State 8150, Player]
type = VarSet
trigger1 = !Time
var(0) = Parent, var(43)

[State 8150, PosSet]
type = PosSet
trigger1 = PlayerIDexist(var(0))
x = ceil(PlayerID(var(0)), pos x)
y = ceil(PlayerID(var(0)), pos y)

[State 8150, Facing]
type = Turn
trigger1 = PlayerIDexist(var(0))
trigger1 = Facing != (PlayerID(var(0)), Facing)

[State 8150, Flame Explod 1]
type = Explod
trigger1 = PlayerIDexist(var(0)) && IsHelper(8155) && AnimElemTime(3) >= 0 && AnimElemTime(16) < 0
trigger2 = PlayerIDexist(var(0)) && IsHelper(38155)
ID = 18150
anim = 8155
sprPriority = 3
posType = P1
pos = 0, ceil((PlayerID(var(0)), const(size.mid.pos.y)))
random = 40,40
vel = (Random / 2000.0), -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 Explod 2]
type = Explod
trigger1 = PlayerIDexist(var(0)) && IsHelper(8155) && AnimElemTime(3) >= 0 && AnimElemTime(16) < 0
trigger2 = PlayerIDexist(var(0)) && IsHelper(38155)
ID = 18155
anim = 8155
sprPriority = 3
posType = P1
pos = 0, ceil((PlayerID(var(0)), const(size.mid.pos.y)))
random = 60,60
vel = (Random / 2000.0), -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, ChangeAnim]
type = ChangeAnim
trigger1 = IsHelper(8155) && !AnimTime
value = 1

[State 8150, Remove bottom layer]
type = RemoveExplod
trigger1 = !AnimTime || Anim = 1
trigger2 = !PlayerIDexist(var(0))
;multi-hit projectile flame remover for non-final hits
trigger3 = (Parent, StateNo = 1036 || Parent, StateNo = 1046 || (Parent, StateNo = 1007 && Parent, PrevStateNo = 1036) || (Parent, StateNo = 1007 && Parent, PrevStateNo = 1046)) && Parent, Time = 1 && Time >= 2
;flame remover for multi-hit attacks
trigger4 = Time > 0
trigger4 = (Root, StateNo = 1230 || Root, StateNo = 1280) && Root, MoveHit = 1
;flame remover for Apple & Gun (multiple, single-hit projectiles)
trigger5 = Time > 0 && var(44) = 1
;EMERGENCY, break glass to kill flames if two or more projectiles hit simultaneously
trigger6 = Root, StateNo = 3400 && Time > 0 && (Root, NumHelper(8150) >= 2 || Root, NumHelper(8155) >= 2)
ID = 8151

[State 8150, Remove bottom layer]
type = RemoveExplod
triggerAll = PlayerIDexist(var(0))
trigger1 = PlayerID(var(0)), StateType = L && (PlayerID(var(0)), StateNo != [5080,5081])
ID = 8151

[State 8150, Flame Remover for multi-hit attacks]
type = ChangeState
triggerAll = Time > 0
trigger1 = Root, StateNo = 1230 && Root, MoveHit = 1
trigger2 = Root, StateNo = 1280 && Root, MoveHit = 1
value = 8150

[State 8150, End]
type = DestroySelf
trigger1 = !AnimTime
trigger2 = !PlayerIDexist(var(0))
;multi-hit projectile flame remover for non-final hits
trigger3 = (Parent, StateNo = 1036 || Parent, StateNo = 1046 || (Parent, StateNo = 1007 && Parent, PrevStateNo = 1036) || (Parent, StateNo = 1007 && Parent, PrevStateNo = 1046)) && Parent, Time = 1 && Time >= 2
trigger4 = IsHelper(38155)
trigger4 = !var(44)
;flame remover for Apple & Gun (multiple, single-hit projectiles)
trigger5 = Time > 0 && var(44) = 1
;EMERGENCY, break glass to kill flames if two or more projectiles hit simultaneously
trigger6 = Root, StateNo = 3400 && Time > 0 && (Root, NumHelper(8150) >= 2 || Root, NumHelper(8155) >= 2)

[State 8150, End]
type = DestroySelf
triggerAll = PlayerIDexist(var(0))
trigger1 = PlayerID(var(0)), StateType = L && (PlayerID(var(0)), StateNo != [5080,5081])

[State 8150, Timer Decrement]
type = VarAdd
trigger1 = 1
var(44) = -1


;========================<RECOVER FX>=============================
[StateDef 8200]
type = A
velSet = 0,0
anim = 8200
sprPriority = 5

[State 8200, Assert: NoShadow]
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, Transparency]
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, "Counter!" Text Explod]
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, .5
trans = AddAlpha
alpha = 256,0

[State 8290, Scale]
type = ModifyExplod
trigger1 = Time >= 8
ID = 8290
scale = 0.5 + 0.0625 * (Time - 8), 0.5 + 0.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



;==================<ZERO COUNTER FX>==================
[StateDef 8350]
type = A
physics = N
moveType = I
anim = 1
ctrl = 0
velSet = 0,0

[State 8350, bgPalFX]
type = bgPalFX
trigger1 = 1
time = 1
color = 16 * Time
mul = 16 * Time, 16 * Time, 16 * Time

[State 8350, Circle Explod]
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 Explod]
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



;========================<DARK FORCE STARTUP FX>=============================
[StateDef 8400]
type = A
physics = N
moveType = I
anim = 1
ctrl = 0
velSet = 0,0
sprPriority = 5

[State 8400, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
ignoreHitPause = 1

[State 8400, BindToRoot]
type = BindToRoot
trigger1 = 1
time = 1
pos = ceil(5 * Root, const(size.xScale)), ceil(-62 * Root, const(size.yScale))
ignoreHitPause = 1

[State 8400, PalFX]
type = PalFX
trigger1 = Time = 15
time = 30
sinAdd = -255, -255, -255, 120
persistent = 0

[State 8400, Bat]
type = Explod
trigger1 = !Time
anim = 8400
ID = 8400
sprPriority = -5
posType = Left
pos = 160, 120
bindTime = -1
ownPal = 1

[State 8400, Lines]
type = Explod
trigger1 = !Time
anim = 8401
ID = 8401
sprPriority = 5
posType = P1
bindTime = -1
removeTime = 15
ownPal = 1

[State 8400, Circle (Bottom)]
type = Explod
trigger1 = Time = 15
anim = 8402
ID = 8402
sprPriority = 5
posType = P1
bindTime = -1

[State 8400, Circle (Top)]
type = Explod
trigger1 = Time = 15
anim = 8403
ID = 8402
sprPriority = -1
posType = P1
bindTime = -1

[State 8400, Shrink Bat]
type = ModifyExplod
trigger1 = Time < 10
ID = 8400
scale = 5 - (0.4 * Time), 5 - (0.4 * Time)

[State 8400, Shrink Bat]
type = ModifyExplod
trigger1 = time >= 10
ID = 8400
scale = 1, 1

[State 8400, Shrink Lines]
type = ModifyExplod
trigger1 = 1
ID = 8401
scale = 3 - (0.2 * Time), 3 - (0.2 * Time)

[State 8400, Shrink Circle]
type = ModifyExplod
trigger1 = 1
ID = 8402
scale = 3 - (0.2 * Time), 3 - (0.2 * Time)

[State 8400, Shrink Circle]
type = ModifyExplod
trigger1 = 1
ID = 8402
scale = 0.09 * (Time - 15), 0.015 * (Time - 15)

[State 8400, Remove Explods]
type = RemoveExplod
trigger1 = Time >= 29

[State 8400, End]
type = DestroySelf
trigger1 = Time >= 29



;========================<DARK FORCE TIMER>=============================
[StateDef 8450]
type = A
physics = N
moveType = I
anim = 1
ctrl = 0
velSet = 0,0
sprPriority = 5

[State 8450, NoShadow]
type = AssertSpecial
trigger1 = 1
flag = NoShadow
ignoreHitPause = 1

[State 8450, BindToRoot]
type = BindToRoot
trigger1 = 1
time = 1
pos = -20 * (Root, Facing), 4
ignoreHitPause = 1

[State 8450, Turn]
type = Turn
trigger1 = Facing = -1

[State 8450, Timer Bar (Empty)]
type = Explod
trigger1 = !Time
trigger2 = !NumExplod(8451)
trigger2 = !(Root, StateNo = 3020 && Root, AnimElemTime(7) >= 0)
anim = 8451
ID = 8451
posType = P1
bindTime = -1
onTop = 1
ownPal = 1

[State 8450, Timer Bar (Full)]
type = Explod
trigger1 = !Time
trigger2 = !NumExplod(8452)
trigger2 = !(Root, StateNo = 3020 && Root, AnimElemTime(7) >= 0)
anim = 8452
ID = 8452
posType = P1
bindTime = -1
onTop = 1
ownPal = 1

[State 8450, Timer Frame]
type = Explod
trigger1 = !Time
trigger2 = !NumExplod(8450)
trigger2 = !(Root, StateNo = 3020 && Root, AnimElemTime(7) >= 0)
anim = 8450
ID = 8450
posType = P1
bindTime = -1
onTop = 1
ownPal = 1

[State 8450, Scale Timer Bar (Empty)]
type = ModifyExplod
triggerAll = NumExplod(8452)
trigger1 = Root, var(20) > 0
ID = 8452
scale = (Root, var(20) * 0.99) / (338 * 0.99), 1

[State 8450, Remove Explods]
type = RemoveExplod
triggerAll = NumExplod(8450)
trigger1 = !(Root, var(20))
trigger2 = Root, StateNo = 3020 && Root, AnimElemTime(7) >= 0

[State 8450, End]
type = DestroySelf
trigger1 = !(Root, var(20))



;========================<SUPER PAUSE FX>=============================
;Level 1 Super FX
[StateDef 8500]
type = A
velSet = 0,0
anim = 8500
sprPriority = 5

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

[State 8500, BGpalFX]
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, Transparency]
type = Trans
trigger1 = 1
trans = AddAlpha
alpha = 256,256
ignoreHitPause = 1

[State 8500, Lines Explod]
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 Lines Explod 1]
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 Lines Explod 2]
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 Lines Explod 3]
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 Lines Explod 3]
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 Explod]
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 Circle Explod]
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, Remove Explods]
type = RemoveExplod
trigger1 = Time >= 40

[State 8500, End]
type = DestroySelf
trigger1 = Time >= 40


;Level 2 Super FX
[StateDef 8510]
type = A
velSet = 0,0
anim = 8510
sprPriority = 5

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

[State 8510, BGpalFX]
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, Transparency]
type = Trans
trigger1 = 1
trans = AddAlpha
alpha = 256,256
ignoreHitPause = 1

[State 8510, Lines Explod]
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 Lines Explod 1]
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 Lines Explod 2]
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 Lines Explod 3]
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 Lines Explod 4]
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 Explod]
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, Remove Explods]
type = RemoveExplod
trigger1 = Time >= 40

[State 8510, End]
type = DestroySelf
trigger1 = Time >= 40


;Level 3 Super FX
[StateDef 8520]
type = A
velset = 0,0
anim = 8520
sprPriority = 5

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

[State 8520, Assert: NoBarDisplay, NoBG, NoFG]
type = AssertSpecial
trigger1 = Time < 40
flag = NoBarDisplay
flag2 = NoBG
flag3 = NoFG

[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, Transparency]
type = Trans
trigger1 = 1
trans = AddAlpha
alpha = 256,256
ignoreHitPause = 1

[State 8520, Portrait 1]
type = Explod
trigger1 = !Time
anim = 8525
ID = 20
sprPriority = -16
posType = Back
removeTime = 40
superMoveTime = -1

[State 8520, Portrait 2]
type = Explod
trigger1 = !Time
anim = 8525
ID = 21
sprPriority = -16
posType = Back
removeTime = 40
superMoveTime = -1

[State 8520, Scale Portrait 1a]
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 Portrait 2a]
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 Portrait 1b]
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 Explod]
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 Lines Explod 1]
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 Lines Explod 2]
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 Lines Explod 3]
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 Lines Explod 4]
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 Explod]
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 Circle Explod]
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, Remove Explods]
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, Super Finish Sound]
type = PlaySnd
trigger1 = !Time
value = 8600,0
channel = 1

[State 8600, SndPan]
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)

[State 8600, Move Name: The Killing Time]
type = VarSet
trigger1= !Time && Root, var(23) = 3300
var(0) = 1

[State 8600, Move Name: Cool Hunting]
type = VarSet
trigger1 = !Time && (Root, var(23) = [3000,3049])
var(0) = 2

[State 8600, Move Name: Deadly Hunting]
type = VarSet
trigger1 = !Time && (Root, var(23) = [3050,3099])
var(0) = 3

[State 8600, Move Name: Beautiful Memory]
type = VarSet
trigger1 = !Time && (Root, var(23) = [3100,3199])
var(0) = 4

[State 8600, Move Name: Apple For You]
type = VarSet
trigger1 = !Time && (Root, var(23) = [3200,3299])
var(0) = 5

[State 8600, Move Name: Apple & Gun]
type = VarSet
trigger1= !Time && (Root, var(23) = [3400,3499])
var(0) = 6

[State 8600, Super Finish Explod]
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, Super Finish Explod Fade]
type = ModifyExplod
trigger1 = NumExplod(8600)
ID = 8600
trans = AddAlpha
alpha = ifElse(Time < 16, 256, 256 - 32 * (Time - 16)), 256

[State 8600, Text 1]
type = Explod
trigger1 = !Time && var(0)
anim = 8610 + var(0)
ID = 10
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, Text 2]
type = Explod
trigger1 = !Time && var(0)
anim = 8610 + var(0)
ID = 11
onTop = 1
posType = left
pos = 160, floor((1.3333333 * GameHeight / GameWidth) * 120)
scale = 0.5, 0.5 * (1.3333333 * GameHeight / GameWidth)
bindTime = -1
removeTime = 8
pauseMoveTime = -1
superMoveTime = -1

[State 8600, Text 1 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, Text 2 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 Explod]
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, Circle 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: NoFG]
type = AssertSpecial
trigger1 = Time < 16
flag = NoFG

[State 8600, Assert: NoBarDisplay]
type = AssertSpecial
trigger1 = Time < 24
flag = NoBarDisplay

[State 8600, RemoveExplod]
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, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
moveCamera = 1,1
ignoreHitPause = 1

[State 8999, End]
type = DestroySelf
trigger1 = RoundState = 2



;========================<EXPLODSIVE BUFFERING HELPER>=============================
[StateDef 90000005]
type = A
physics = N
moveType = I
anim = 1
velSet = 0,0
ctrl = 0

[State 90000005, Turn]
type = Turn
trigger1 = (Root, NumExplod(94646464) || Root, NumExplod(92468246)) && !var(0)
trigger2 = !Root, NumExplod(94646464) && !Root, NumExplod(92468246) && var(0)
ignoreHitPause = 1

[State 90000005, Reverse Left/Right]
type = VarSet
trigger1 = (Root, NumExplod(94646464) || Root, NumExplod(92468246)) && !var(0)
var(0) = 1
ignoreHitPause = 1

[State 90000005, Reset Turn Variable]
type = VarSet
trigger1 = !Root, NumExplod(94646464) && !Root, NumExplod(92468246) && var(0)
var(0) = 0
ignoreHitPause = 1

[State 90000005, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "by JustMorphPointman"
ignoreHitPause = 1
