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

;========================<COOL HUNTING>=============================
[StateDef 3000]
type = S
physics = N
moveType = A
anim = ifElse(var(40), 3001, 3000)
ctrl = 0
velSet = 0,0
sprPriority = 1
powerAdd = -1000
faceP2 = ifElse((PrevStateNo = [100,105]), 0, 1)

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

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

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

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

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

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

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

[State 3000, Missile Spawn Counter Reset]
type = VarSet
trigger1 = !Time
var(10) = 0

[State 3000, Projectile HitCount Reset]
type = VarSet
trigger1 = !Time
var(41) = 0
ignoreHitPause = 1

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

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

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

[State 3000, Voice]
type = PlaySnd
trigger1 = !Time && !var(40)
trigger2 = AnimElem = 2 && var(40)
value = 3000,0
channel = 0

[State 3000, Huntsmen]
type = Helper
trigger1 = !Time
helperType = Normal
stateNo = 13000
ID = 13000
name = "Cool Hunting Huntsmen"
posType = P1
pos = ceil(const(size.xScale) * -32), 0
size.xScale = const(size.xScale)
size.yScale = const(size.yScale)
superMoveTime = 43
ownPal = 1

[State 3000, Gunfire sound player]
type = Helper
trigger1 = AnimElem = 8
helperType = Normal
stateNo = 10220
ID = 12900
name = "Gunfire sound player"
posType = P1
ownPal = 1

[State 3000, Camouflage Sheet]
type = Helper
trigger1 = AnimElemTime(5) = 4
helperType = Normal
stateNo = 13005
ID = 13005
name = "Cool Hunting Camouflage Sheet"
posType = P1
pos = ceil(const(size.xScale) * -32), 0
size.xScale = const(size.xScale)
size.yScale = const(size.yScale)
ownPal = 0

[State 3000, Gunfire]
type = Explod
trigger1 = AnimElem = 8
anim = 3003
sprPriority = 1
posType = P1
pos = ceil(const(size.xScale) * 65), -63
scale = const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 3000, Gunfire (Bottom layer)]
type = Explod
trigger1 = AnimElem = 8
anim = 3004
sprPriority = 1
posType = P1
pos = ceil(const(size.xScale) * 65), -63
scale = const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 3000, HitDef]
type = HitDef
triggerAll = !var(16) && var(15) < 1
triggerAll = HitCount < 1
trigger1 = AnimElem = 8 || AnimElem = 10 || AnimElem = 12 || AnimElem = 14 || AnimElem = 16
trigger2 = AnimElem = 18 || AnimElem = 20 || AnimElem = 22 || AnimElem = 24 || AnimElem = 26
trigger3 = AnimElem = 28 || AnimElem = 30 || AnimElem = 32 || AnimElem = 34 || AnimElem = 36
trigger4 = AnimElem = 38 || AnimElem = 40 || AnimElem = 42 || AnimElem = 44 || AnimElem = 46
trigger5 = AnimElem = 48 || AnimElem = 50 || AnimElem = 52 || AnimElem = 54 || AnimElem = 56
trigger6 = AnimElem = 58 || AnimElem = 60
ID = ifElse(P2Dist x <= 60, 3001, 3000) + 10 * (EnemyNear, StateType = A)
attr = S, HA
hitFlag = MAF
guardFlag = M
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 14 < 7, 7, fvar(11) * 14)), 7
getPower = 0,0
givePower = 36, 36
pauseTime = 12,12
guard.pauseTime = 12,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 = -3.49
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 + 0 * (var(31) := 2)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0 * (var(34) := 8001)
sparkXY = -10 + 0 * (var(35) := 110), var(36) := -67
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
p2Facing = 1

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

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

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

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

[State 3000, TargetState (Normal distance)]
type = TargetState
trigger1 = MoveHit && NumTarget(3000) && HitPauseTime = 12
value = 50255
ID = 3000
ignoreHitPause = 1

[State 3000, TargetState (P2 too close to BBH)]
type = TargetState
trigger1 = MoveHit && NumTarget(3001) && HitPauseTime = 12
value = 50255
ID = 3001
ignoreHitPause = 1

[State 3000, TargetState (Normal distance, airborne)]
type = TargetState
trigger1 = MoveHit && NumTarget(3010) && HitPauseTime = 12
value = 50255
ID = 3010
ignoreHitPause = 1

[State 3000, TargetState (P2 too close to BBH + airborne)]
type = TargetState
trigger1 = MoveHit && NumTarget(3011) && HitPauseTime = 12
value = 50255
ID = 3011
ignoreHitPause = 1

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

[State 3000, Flame Particle Timer Set]
type = Null
trigger1 = MoveHit = 1 && NumTarget && HitPauseTime = 12
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 3000, Explosion]
type = Helper
trigger1 = MoveHit = 1 && NumTarget && HitPauseTime = 12
trigger1 = !(Target, HitShakeOver)
trigger1 = var(43) := (Target, ID)
helperType = Normal
stateNo = 13006
ID = 13006
name = "Cool Hunting Explosion"
posType = P2
size.xScale = const(size.xScale) * 0.5
size.yScale = 0.5
ownPal = 1
ignoreHitPause = 1

[State 3000, Left Projectile]
type = Helper
triggerAll = NumHelper(13000) && Time > 0 && var(10) < 9
trigger1 = Helper(13000), AnimElemTime(9) = 1
trigger2 = Helper(13000), AnimElemTime(12) = 1
trigger3 = Helper(13000), AnimElemTime(15) = 0
trigger4 = Helper(13000), AnimElemTime(18) = 1
trigger5 = Helper(13000), AnimElemTime(21) = 1
trigger6 = Helper(13000), AnimElemTime(24) = 1
trigger7 = Helper(13000), AnimElemTime(27) = 1
trigger8 = Helper(13000), AnimElemTime(30) = 0
trigger9 = Helper(13000), AnimElemTime(33) = 1
helperType = Normal
stateNo = 3005
ID = 3005
name = "Cool Hunting Projectile"
posType = P1
pos = ceil(const(size.xScale) * 126), -118
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1
ignoreHitPause = 0

[State 3000, Right Projectile]
type = Helper
triggerAll = NumHelper(13000) && Time > 0 && var(10) < 9
trigger1 = Helper(13000), AnimElemTime(9) = 1
trigger2 = Helper(13000), AnimElemTime(12) = 1
trigger3 = Helper(13000), AnimElemTime(15) = 0
trigger4 = Helper(13000), AnimElemTime(18) = 1
trigger5 = Helper(13000), AnimElemTime(21) = 1
trigger6 = Helper(13000), AnimElemTime(24) = 1
trigger7 = Helper(13000), AnimElemTime(27) = 1
trigger8 = Helper(13000), AnimElemTime(30) = 0
trigger9 = Helper(13000), AnimElemTime(33) = 1
helperType = Normal
stateNo = 3005
ID = 3006
name = "Cool Hunting Projectile"
posType = P1
pos = ceil(const(size.xScale) * 152), -113
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1
ignoreHitPause = 0

[State 3000, Missile Spawn Counter Increment]
type = VarAdd
triggerAll = NumHelper(13000) && Time > 0
trigger1 = Helper(13000), AnimElemTime(9) = 1
trigger2 = Helper(13000), AnimElemTime(12) = 1
trigger3 = Helper(13000), AnimElemTime(15) = 0
trigger4 = Helper(13000), AnimElemTime(18) = 1
trigger5 = Helper(13000), AnimElemTime(21) = 1
trigger6 = Helper(13000), AnimElemTime(24) = 1
trigger7 = Helper(13000), AnimElemTime(27) = 1
trigger8 = Helper(13000), AnimElemTime(30) = 0
trigger9 = Helper(13000), AnimElemTime(33) = 1
var(10) = 1
ignoreHitPause = 0

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

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



;========================<DEADLY HUNTING>=============================
[StateDef 3050]
type = S
physics = N
moveType = A
anim = ifElse(var(40), 3051, 3050)
ctrl = 0
velSet = 0,0
sprPriority = 1
powerAdd = -1000
faceP2 = ifElse((PrevStateNo = [100,105]), 0, 1)

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

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

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

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

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

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

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

[State 3050, Missile Spawn Counter Reset]
type = VarSet
trigger1 = !Time
var(10) = 0

[State 3050, Projectile HitCount Reset]
type = VarSet
trigger1 = !Time
var(41) = 0
ignoreHitPause = 1

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

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

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

[State 3050, Voice]
type = PlaySnd
trigger1 = !Time && !var(40)
trigger2 = AnimElem = 2 && var(40)
value = 3050,0
channel = 0

[State 3050, Huntsmen]
type = Helper
trigger1 = !Time
helperType = Normal
stateNo = 13000
ID = 13000
name = "Cool Hunting Huntsmen"
posType = P1
pos = ceil(const(size.xScale) * -32), 0
size.xScale = const(size.xScale)
size.yScale = const(size.yScale)
superMoveTime = 43
ownPal = 1

[State 3050, Gunfire sound player]
type = Helper
trigger1 = AnimElem = 8
helperType = Normal
stateNo = 10220
ID = 12900
name = "Gunfire sound player"
posType = P1
ownPal = 1

[State 3050, Camouflage Sheet]
type = Helper
trigger1 = AnimElemTime(5) = 4
helperType = Normal
stateNo = 13005
ID = 13005
name = "Cool Hunting Camouflage Sheet"
posType = P1
pos = ceil(const(size.xScale) * -32), 0
size.xScale = const(size.xScale)
size.yScale = const(size.yScale)
ownPal = 0

[State 3050, Gunfire]
type = Explod
trigger1 = AnimElem = 8
anim = 3003
sprPriority = 1
posType = P1
pos = ceil(const(size.xScale) * 65), -63
scale = const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 3050, Gunfire (Bottom layer)]
type = Explod
trigger1 = AnimElem = 8
anim = 3004
sprPriority = 1
posType = P1
pos = ceil(const(size.xScale) * 65), -63
scale = const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 3050, Width]
type = Width
trigger1 = AnimElemTime(8) <= -1
value = 30,0

[State 3050, Projectile]
type = Helper
trigger1 = AnimElem = 8  || AnimElem = 12 || AnimElem = 16
trigger2 = AnimElem = 18 || AnimElem = 22 || AnimElem = 26
trigger3 = AnimElem = 28 || AnimElem = 32 || AnimElem = 36
trigger4 = AnimElem = 38 || AnimElem = 42 || AnimElem = 46
trigger5 = AnimElem = 48 || AnimElem = 52 || AnimElem = 56
trigger6 = AnimElem = 58
helperType = Normal
stateNo = 3055
ID = 3055
name = "Deadly Hunting Projectile"
posType = P1
pos = ceil(55 * const(size.xScale)), -62
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1

[State 3050, Left Huntsmen Projectile]
type = Helper
triggerAll = NumHelper(13000) && Time > 0 && var(10) < 9
trigger1 = Helper(13000), AnimElemTime(9) = 1
trigger2 = Helper(13000), AnimElemTime(12) = 1
trigger3 = Helper(13000), AnimElemTime(15) = 0
trigger4 = Helper(13000), AnimElemTime(18) = 1
trigger5 = Helper(13000), AnimElemTime(21) = 1
trigger6 = Helper(13000), AnimElemTime(24) = 1
trigger7 = Helper(13000), AnimElemTime(27) = 1
trigger8 = Helper(13000), AnimElemTime(30) = 0
trigger9 = Helper(13000), AnimElemTime(33) = 1
helperType = Normal
stateNo = 3005
ID = 13055 + 10 * (Helper(13000), AnimElemTime(24) >= 1)
name = "Deadly Hunting Huntsmen Projectile"
posType = P1
pos = ceil(const(size.xScale) * 126), -118
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1
ignoreHitPause = 0

[State 3050, Right Huntsmen Projectile]
type = Helper
triggerAll = NumHelper(13000) && Time > 0 && var(10) < 9
trigger1 = Helper(13000), AnimElemTime(9) = 1
trigger2 = Helper(13000), AnimElemTime(12) = 1
trigger3 = Helper(13000), AnimElemTime(15) = 0
trigger4 = Helper(13000), AnimElemTime(18) = 1
trigger5 = Helper(13000), AnimElemTime(21) = 1
trigger6 = Helper(13000), AnimElemTime(24) = 1
trigger7 = Helper(13000), AnimElemTime(27) = 1
trigger8 = Helper(13000), AnimElemTime(30) = 0
trigger9 = Helper(13000), AnimElemTime(33) = 1
helperType = Normal
stateNo = 3005
ID = 23055 + 10 * (Helper(13000), AnimElemTime(24) >= 1)
name = "Cool Hunting Huntsmen Projectile"
posType = P1
pos = ceil(const(size.xScale) * 152), -113
size.xScale = const(size.xScale)
size.yScale = 1
ownPal = 1
ignoreHitPause = 0

[State 3050, Missile Spawn Counter Increment]
type = VarAdd
triggerAll = NumHelper(13000) && Time > 0
trigger1 = Helper(13000), AnimElemTime(9) = 1
trigger2 = Helper(13000), AnimElemTime(12) = 1
trigger3 = Helper(13000), AnimElemTime(15) = 0
trigger4 = Helper(13000), AnimElemTime(18) = 1
trigger5 = Helper(13000), AnimElemTime(21) = 1
trigger6 = Helper(13000), AnimElemTime(24) = 1
trigger7 = Helper(13000), AnimElemTime(27) = 1
trigger8 = Helper(13000), AnimElemTime(30) = 0
trigger9 = Helper(13000), AnimElemTime(33) = 1
var(10) = 1
ignoreHitPause = 0

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

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



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

[State 3100, Button Detect]
type = VarSet
trigger1 = !Time && !AILevel
;ifElse((command = "b+c"), 2, ifElse((command = "a+c"), 1, 0))
var(10) = ifElse(((NumExplod(90000240) + NumExplod(90000250)) >= 2 || (NumExplod(90000245) + NumExplod(90000255)) >= 2), 2, ifElse(((NumExplod(90000230) + NumExplod(90000250)) >= 2 || (NumExplod(90000235) + NumExplod(90000255)) >= 2), 1, 0))

[State 3100, Button Detect (AI)]
type = VarSet
trigger1 = !Time && AILevel
var(10) = ifElse((Random < 100 || EnemyNear, StateNo = 150 || EnemyNear, StateNo = 151), 2, ifElse(Random < 200, 1, 0))

[State 3100, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = ifElse(var(10) = 0, 3100, ifElse(var(10) = 1, 3101, 3102))

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

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

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

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

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

[State 3100, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(5) < 0 && !var(10)
trigger2 = AnimElemTime(13) < 0 && var(10) = 1
trigger3 = AnimElemTime(22) < 0 && var(10) = 2
time = 1
value = SCA

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

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

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

[State 3100, Voice]
type = PlaySnd
trigger1 = !Time && !var(40)
trigger2 = Time = 4 && var(40)
value = 3100,0
channel = 0

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

[State 3100, EX Flash]
type = VarSet
triggerAll = !var(40)
trigger1 = !Time
var(24) = ifElse(var(10) = 2, 109, ifElse(var(10), 79, 55))

[State 3100, Grandma + Tear Generator]
type = Helper
trigger1 = !Time
helperType = Normal
stateNo = 13100
ID = 13100
name = "Beautiful Memory Tear Generator"
posType = P1
size.xScale = const(size.xScale)
size.yScale = const(size.yScale)
ownPal = 1

[State 3100, Dash Sound]
type = PlaySnd
trigger1 = AnimElem = 5 && !var(10)
trigger2 = AnimElem = 13 && var(10) = 1
trigger3 = AnimElem = 22 && var(10) = 2
value = 100,1

[State 3100, Dust Helper]
type = Helper
trigger1 = AnimElem = 5 && !var(10)
trigger2 = AnimElem = 13 && var(10) = 1
trigger3 = AnimElem = 22 && var(10) = 2
helperType = Normal
stateNo = 8103
ID = 8100
name = "Beautiful Memory Dash Dust"
posType = P1
pauseMoveTime = 255
superMoveTime = 255
ownPal = 1

[State 3100, VelSet]
type = VelSet
trigger1 = AnimElem = 5 && !var(10)
trigger2 = AnimElem = 13 && var(10) = 1
trigger3 = AnimElem = 22 && var(10) = 2
x = 10 * const(size.xScale)

[State 3100, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(5) > 0 && AnimElemTime(12) < 0 && !var(10)
trigger2 = AnimElemTime(13) > 0 && AnimElemTime(20) < 0 && var(10) = 1
trigger3 = AnimElemTime(22) > 0 && AnimElemTime(29) < 0 && var(10) = 2
x = -0.09765625 * const(size.xScale)

[State 3100, HitDef]
type = HitDef
triggerAll = !var(16) && var(15) < 1
trigger1 = AnimElem = 5 && !var(10)
trigger2 = AnimElem = 13 && var(10) = 1
trigger3 = AnimElem = 22 && var(10) = 2
ID = 3100
attr = A, HA
hitFlag = MAF
guardFlag = M
priority = 4, Hit
damage = ceil(ifElse(fvar(11) * 35 < 7, 7, fvar(11) * 35)), 0
getPower = 0,0
givePower = 36, 36
pauseTime = 12,12
guard.pauseTime = 12,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 = 120
ground.velocity = 0,0
ground.cornerPush.velOff = 0
guard.velocity = -12.64
guard.cornerPush.velOff = 0
air.velocity = -4.32, -7.49
air.cornerPush.velOff = 0
yAccel = 0.58
fall = 0
air.fall = 1
fall.recover = 1
fall.recoverTime = 120
forceStand = 1
hitSound = -1 + 0 * (var(31) := 2)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0*(var(34) := 8001)
sparkXY = -10 + 0 * (var(35) := 24), var(36) := -44
palFX.time = 12 * var(9)
palFX.add = 255, 255, 255
palFX.sinAdd = -255, -255, -255, 48
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
kill = 0

[State 3100, ChangeState]
type = ChangeState
trigger1 = MoveGuarded
value = 3105

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

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

[State 3100, ChangeState]
type = ChangeState
trigger1 = NumTarget(3100)
trigger1 = MoveHit && Target, Alive
value = 3110

[State 3100, VelSet]
type = VelSet
trigger1 = AnimElem = 12 && !var(10)
trigger2 = AnimElem = 20 && var(10) = 1
trigger3 = AnimElem = 29 && var(10) = 2
x = 0

[State 3100, StateTypeSet: Idle]
type = StateTypeSet
trigger1 = AnimElemTime(12) >= 0 && !var(10)
trigger2 = AnimElemTime(20) >= 0 && var(10) = 1
trigger3 = AnimElemTime(29) >= 0 && var(10) = 2
moveType = I

[State 3100, Voice (Missed)]
type = PlaySnd
trigger1 = AnimElem = 12 && !var(10)
trigger2 = AnimElem = 20 && var(10) = 1
trigger3 = AnimElem = 29 && var(10) = 2
value = 800,0
channel = 0

[State 3100, Woosh Sound]
type = PlaySnd
trigger1 = AnimElem = 12 && !var(10)
trigger2 = AnimElem = 20 && var(10) = 1
trigger3 = AnimElem = 29 && var(10) = 2
value = 1,0
channel = 3

[State 3100, Snap Sound]
type = PlaySnd
trigger1 = AnimElem = 13 && !var(10)
trigger2 = AnimElem = 21 && var(10) = 1
trigger3 = AnimElem = 30 && var(10) = 2
value = 800,1
channel = 4

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


;Guarded
[StateDef 3105]
type = A
anim = 3105
physics = N
moveType = I
velSet = 0,0

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

[State 3105, VelSet]
type = VelSet
trigger1 = Time = 1
x = -1.25 * const(size.xScale)
y = -7.5

[State 3105, VelAdd]
type = VelAdd
trigger1 = Time > 1
x = 0.006103515625 * const(size.xScale)
y = 0.390625

[State 3105, ChangeState]
type = ChangeState
trigger1 = pos y > -vel y
value = 3106


;Guarded, Landing
[StateDef 3106]
type = S
anim = 3106
physics = N
moveType = I
velSet = 0,0

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

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

[State 3106, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 8102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 3106, Landing Sound]
type = PlaySnd
trigger1 = !Time
value = 52,0
channel = 5

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


;Success
[StateDef 3110]
type = S
anim = 3110
physics = N
moveType = A
sprPriority = 1

[State 3110, VelSet]
type = VelSet
trigger1 = Time = 1
x = 0
y = 0

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

[State 3110, Right Arm Overlay]
type = Explod
trigger1 = !Time
anim = 3112
sprPriority = 2
posType = P1
scale = const(size.xScale), 1
bindTime = -1
shadow = -1,0,0
ownPal = 0
removeOnGetHit = 0
ignoreHitPause = 0

[State 3110, Tear Overlay]
type = Explod
trigger1 = !Time
anim = 3113
sprPriority = 2
posType = P1
scale = const(size.xScale), 1
bindTime = -1
shadow = -1,0,0
ownPal = 1
removeOnGetHit = 0
ignoreHitPause = 0

[State 3110, Left Arm Overlay]
type = Explod
trigger1 = !Time
anim = 3114
sprPriority = 1
posType = P1
scale = const(size.xScale), 1
bindTime = -1
shadow = -1,0,0
ownPal = 0
removeOnGetHit = 0
ignoreHitPause = 0

[State 3110, PosAdd]
type = PosAdd
trigger1 = NumTarget
trigger1 = AnimElemTime(3) = 1 || AnimElemTime(6) = 1 || AnimElemTime(9) = 1
x = 4 * const(size.xScale)
ignoreHitPause = 1

[State 3110, TargetBind 1]
type = TargetBind
trigger1 = NumTarget && AnimElemTime(34) < 0
pos = ceil(32 * const(size.xScale)), 0

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

[State 3110, Blood]
type = Explod
trigger1 = MoveHit = 1 && NumTarget && AnimElemTime(12) < 0
anim = 8053
sprPriority = 3
posType = P1
pos = ceil(ifElse(P2Dist x < 0, 0, ifElse(P2Dist x < var(35), ceil(P2Dist x), var(35))) * const(size.xScale)), ceil(var(36))
scale = const(size.xScale), 1
ownPal = 1
ignoreHitPause = 1

[State 3110, Voice]
type = PlaySnd
trigger1 = AnimElem = 12
value = 3110,0
channel = 0

[State 3110, Tear Geyser]
type = Helper
trigger1 = AnimElem = 12
helperType = Normal
stateNo = 13110
ID = 13110
posType = P1
size.xScale = const(size.xScale)
size.yScale = const(size.yScale)
size.shadowOffset = 27
name = "Beautiful Memory Tear Geyser"
ownPal = 1

[State 3110, Rock woosh sounds]
type = PlaySnd
trigger1 = AnimElem = 14 || AnimElem = 21 || AnimElem = 28
value = 1,2

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

[State 3110, TargetState (Held above BBH)]
type = TargetState
trigger1 = AnimElem = 34 && NumTarget
value = 3117

[State 3110, Jump Sound]
type = PlaySnd
trigger1 = AnimElem = 39
value = 41,0
channel = 1

[State 3110, StateTypeSet: Air, Physics: None]
type = StateTypeSet
trigger1 = AnimElem = 39
stateType = A
physics = N

[State 3110, Dust Helper]
type = Helper
trigger1 = AnimElem = 39
helperType = Normal
stateNo = 8100
ID = 8100
name = "Beautiful Memory Dust"
posType = P1
ownPal = 1

[State 3110, VelSet (Jumping upwards)]
type = VelSet
trigger1 = AnimElem = 39
y = -3.75

[State 3110, VelAdd (Jumping upwards)]
type = VelAdd
trigger1 = AnimElemTime(39) >= 0 && AnimElemTime(40) < 0
y = 0.048828125

[State 3110, VelSet (End jumping upwards)]
type = VelSet
trigger1 = AnimElem = 40
y = 0

[State 3110, TargetBind 2]
type = TargetBind
trigger1 = NumTarget
trigger1 = AnimElemTime(34) >= 0 && AnimElemTime(35) < 0
pos = ceil(const(size.xScale) * 57),0

[State 3110, TargetBind 3]
type = TargetBind
trigger1 = NumTarget
trigger1 = AnimElemTime(35) >= 0 && AnimElemTime(36) < 0
pos = ceil(const(size.xScale) * 18),-101

[State 3110, TargetBind 4]
type = TargetBind
trigger1 = NumTarget
trigger1 = AnimElemTime(36) >= 0 && AnimElemTime(38) < 0
pos = ceil(const(size.xScale) * 0),-102

[State 3110, TargetBind 5]
type = TargetBind
trigger1 = NumTarget
trigger1 = AnimElemTime(38) >= 0 && AnimElemTime(40) < 0
pos = ceil(const(size.xScale) * -25),-92

[State 3110, TargetBind 6]
type = TargetBind
trigger1 = NumTarget
trigger1 = AnimElemTime(40) >= 0 && AnimElemTime(41) < 0
pos = ceil(const(size.xScale) * -27),-88

[State 3110, TargetBind 7]
type = TargetBind
trigger1 = NumTarget
trigger1 = AnimElemTime(41) >= 0 && AnimElemTime(42) < 0
pos = ceil(const(size.xScale) * 44),-48

[State 3110, Voice 2]
type = PlaySnd
trigger1 = AnimElem = 41
value = 4,1
channel = 0

[State 3110, Throw woosh sound]
type = PlaySnd
trigger1 = AnimElem = 41
value = 1,2
channel = 3

[State 3110, TargetState (Thrown into tear puddle)]
type = TargetState
trigger1 = AnimElem = 42 && NumTarget
value = 3118

[State 3110, VelSet (Falling downward)]
type = VelSet
trigger1 = AnimElem = 42
x = -2.5 * const(size.xScale)
y = -2.5

[State 3110, VelAdd (Falling downward)]
type = VelAdd
trigger1 = AnimElemTime(42) >= 0
x = 0.048828125 * const(size.xScale)
y = 0.1953125

[State 3110, HitAdd]
type = HitAdd
trigger1 = Animelem = 42 && NumTarget
value = 1

[State 3110, End]
type = ChangeState
trigger1 = pos y > -vel y
value = 3111


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

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

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

[State 3111, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 8102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 3111, Landing Sound]
type = PlaySnd
trigger1 = !Time
value = 52,0
channel = 1

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

[State 3111, Clapping sounds]
type = PlaySnd
trigger1 = !Time || AnimElem = 5 || AnimElem = 9
value = 3111,1

[State 3111, Damage]
type = TargetLifeAdd
trigger1 = Time = 1 && NumTarget
value = floor(ifElse(119 * fvar(11) < 7, -7, -119 * fvar(11)))

[State 3111, TargetPowerAdd]
type = TargetPowerAdd
trigger1 = Time = 1 && NumTarget
value = 36

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

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

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

[State 3111, Throw]
type = TargetState
trigger1 = Time = 1 && NumTarget
value = 3119

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



;===========<BEAUTIFUL MEMORY (TARGET)>==========
;Initial hit
[StateDef 3115]
type = S
moveType = H
physics = N
velSet = 0,0

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

[State 3115, HitFallSet]
type = HitFallSet
trigger1 = !Time
value = 0

[State 3115, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 5012

[State 3115, Freeze Anim]
type = ChangeAnim
trigger1 = Time > 0
;but not for Demitri by me
trigger1 = ifElse(Name = "Demitri Maximoff" && AuthorName = "Jmorphman", 0, 1)
;or for B.B. Hood by me
trigger1 = ifElse(Name = "B.B. Hood" && AuthorName = "Jmorphman", 0, 1)
value = Anim

[State 3115, Stop animating through HitPause (Demitri / B.B. Hood)]
type = ChangeAnim
trigger1 = AnimElemTime(4) >= 0 && Anim = 5012 && Name = "B.B. Hood" && AuthorName = "Jmorphman"
trigger1 = AnimElemTime(2) >= 0 && Anim = 5012 && Name = "Demitri Maximoff" && AuthorName = "Jmorphman"
value = Anim
elem = ifElse(Name = "B.B. Hood", 4, 2)

[State 3115, ChangeState]
type = ChangeState
trigger1 = HitShakeOver
value = 3116


;Sliding after hit
[StateDef 3116]
type = S
movetype = H
physics = S

[State 3116, ChangeAnim]
type = ChangeAnim
trigger1 = !AnimTime
value = 5017

[State 3116, DefenceMulSet]
type = DefenceMulSet
trigger1 = HitOver
value = 1

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


;Being Thrown
[StateDef 3117]
type = A
moveType = H
physics = N
velSet = 0,0
sprPriority = 0

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

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

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

[State 3117, HitBy]
type = HitBy
trigger1 = 1
value =
ignoreHitPause = 1

[State 3117, SprPriority]
type = SprPriority
trigger1 = Anim = 3117 && !AnimTime
value = 2

[State 3117, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 3117 && !AnimTime
trigger2 = Anim = 5080
value = 5080


;After Throw (Falling into tear puddle)
[StateDef 3118]
type = A
physics = N
movetype = H
ctrl = 0
;NON-TURBO (on Demitri) x = 3.6875, y = -9.5625
;below isn't accurate but looks better for universal mugen purposes
velSet = 4.609375 * 0.8333333 - 1.25, 11.953125
sprPriority = 2

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

[State 3118, VelSet]
type = VelSet
trigger1 = Time = 15
x = 0
y = 0

[State 3118, AssertSpecial: No Shadow because MUGEN's shadow/reflection is so fucked up]
type = AssertSpecial
trigger1 = Time >= 11 && Time < 15
flag = NoShadow
ignoreHitPause = 1

[State 3118, AssertSpecial: Invisible]
type = AssertSpecial
trigger1 = Time >= 15 && Time < 43
flag = Invisible
ignoreHitPause = 1

[State 3118, PosSet]
type = PosSet
trigger1 = Time = 15
y = -216.75


;Thrown upward by geyser and falling back downwards
[StateDef 3119]
type = A
physics = N
movetype = H
ctrl = 0
velSet = -2.5 * 0.8333333, 0
sprPriority = 0

[State 3119, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 5070

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

[State 3119, VelAdd]
type = VelAdd
trigger1 = 1
x = 0.048828125 * 0.8333333
y = 0.732421875

[State 3119, End]
type = ChangeState
trigger1 = vel y > 0
trigger1 = pos y >= const(movement.air.gethit.groundlevel)
value = 3120


;Hit ground from fall
[StateDef 3120]
type = L
moveType = H
physics = N

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

[State 3120, VarSet]
type = VarSet
trigger1 = !Time
sysvar(1) = floor(vel y)

[State 3120, ChangeAnim]
type = ChangeAnim
triggerAll = !Time
trigger1 = (Anim != [5051,5059]) && (Anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (Anim % 10))
value = 5100

[State 3120, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = (Anim = [5051,5059]) || (Anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (Anim % 10))
value = 5100 + (Anim % 10)

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

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

[State 3120, VelMul]
type = VelMul
trigger1 = !Time
x = 0.75

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

[State 3120, HitFallDamage]
type = HitFallDamage
trigger1 = Time = 3

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

[State 3120, PosFreeze]
type = PosFreeze
trigger1 = 1

[State 3120, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 3121


;Bounce off ground
[Statedef 3121]
type = L
moveType = H
physics = N

[State 3121, ChangeAnim]
type = ChangeAnim
triggerAll = !Time
trigger1 = Anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (Anim % 10))
value = 5160

[State 3121, ChangeAnim]
type = ChangeAnim
triggerAll = !Time = 0
trigger1 = Anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (Anim % 10))
value = 5160 + (Anim % 10)

[State 3121, HitFallVel]
type = HitFallVel
trigger1 = !Time

[State 3121, PosSet]
type = PosSet
trigger1 = !Time
y = const(movement.down.bounce.offset.y)

[State 3121, PosAdd]
type = PosAdd
trigger1 = !Time
x = const(movement.down.bounce.offset.x)

[State 3121, VelAdd]
type = VelAdd
trigger1 = Time > 0
y = const(movement.down.bounce.yaccel)

[State 3121, ChangeState]
type = ChangeState
trigger1 = vel y > 0
trigger1 = pos y >= const(movement.down.bounce.groundlevel)
value = 3122


;Lying down
[Statedef 3122]
type = L
moveType = H
physics = N

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

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

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

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

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

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

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

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

[State 3122, 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 3122, VelSet]
type = VelSet
trigger1 = !Time
y = 0

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

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

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

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

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

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

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



;========================<APPLE FOR YOU>=============================
[StateDef 3200]
type = S
physics = N
moveType = A
anim = 3200
ctrl = 0
velSet = 0,0
sprPriority = 1
powerAdd = -1000
faceP2 = ifElse((PrevStateNo = [100,105]), 0, 1)

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

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

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

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

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

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

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

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

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

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

[State 3200, Apple]
type = Explod
trigger1 = !Time
anim = 13200
ID = 13200
sprPriority = 2
posType = P1
scale = const(size.xScale), 1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 3200, Voice]
type = PlaySnd
trigger1 = AnimElem = 2
value = 3200,0
channel = 0

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

[State 3200, Voice (Missed)]
type = PlaySnd
trigger1 = AnimElem = 7
value = 800,0
channel = 0

[State 3200, Woosh Sound]
type = PlaySnd
trigger1 = AnimElem = 7
value = 1,0
channel = 3

[State 3200, Snap Sound]
type = PlaySnd
trigger1 = AnimElem = 8
value = 800,1
channel = 4

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

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


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

[State 3210, Remove initial Apple]
type = RemoveExplod
trigger1 = !Time
ID = 13200

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

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

[State 3210, TargetState: Standing]
type = TargetState
trigger1 = !Time && NumTarget
value = 3215

[State 3210, Question Mark XY]
type = Null
triggerAll = NumTarget
trigger1 = Target, Name = "B.B. Hood" && Target, AuthorName = "Jmorphman"
trigger1 = var(35) := -18 || var(36) := -90
trigger2 = Target, Name = "Demitri Maximoff" && Target, AuthorName = "Jmorphman"
trigger2 = var(35) := -25 || var(36) := -113
trigger3 = Target, Name = "Joe Higashi" && Target, AuthorName = "Jmorphman"
trigger3 = var(35) := 17 || var(36) := -107
trigger4 = Target, Name = "Chun-Li" && Target, AuthorName = "Jmorphman"
trigger4 = var(35) := -2 || var(36) := -109
trigger5 = Target, Name = "Kyo Kusanagi" && Target, AuthorName = "Jmorphman"
trigger5 = var(35) := -32 || var(36) := -123
trigger6 = Target, Name = "Ken Masters" && Target, AuthorName = "Jmorphman"
trigger6 = var(35) := -15 || var(36) := -120
trigger7 = Target, Name = "Vice" && Target, AuthorName = "Jmorphman"
trigger7 = var(35) := 0 || var(36) := -105
trigger8 = Target, Name = "Guile" && Target, AuthorName = "Jmorphman"
trigger8 = var(35) := -15 || var(36) := -115
trigger9 = Target, Name = "Kim Kaphwan" && Target, AuthorName = "Jmorphman"
trigger9 = var(35) := -15 || var(36) := -118
trigger10 = Target, Name = "Rolento" && Target, AuthorName = "Jmorphman"
trigger10 = var(35) := 5 || var(36) := -111
trigger11 = Target, Name = "King" && Target, AuthorName = "Jmorphman"
trigger11 = var(35) := -14 || var(36) := -111
trigger12 = Target, Name = "Benimaru Nikaido" && Target, AuthorName = "Jmorphman"
trigger12 = var(35) := -21 || var(36) := -131
trigger13 = Target, Name = "Ryo Sakazaki" && Target, AuthorName = "CrazyKoopa"
trigger13 = var(35) := -14 || var(36) := -111
trigger14 = Target, Name = "Eagle" && Target, AuthorName = "CrazyKoopa"
trigger14 = var(35) := -10 || var(36) := -107
trigger15 = Target, Name = "Lei-Lei" && Target, AuthorName = "Phantom.of.the.Server"
trigger15 = var(35) := -17 || var(36) := -86
trigger16 = Target, Name = "Morrigan Aensland" && Target, AuthorName = "Phantom.of.the.Server"
trigger16 = var(35) := -26 || var(36) := -94
trigger17 = 1
trigger17 = var(35) := Target, const(size.head.pos.x) - 20 || var(36) := Target, const(size.head.pos.y) - 20

[State 3210, Question Mark]
type = Explod
trigger1 = !Time && NumTarget
anim = ifElse(Facing = 1, 10858, 11858)
ID = 13210
sprPriority = 2
posType = P2
pos = ceil(var(35) * Target, const(size.xScale)), ceil(var(36) * Target, const(size.yScale))
facing = -1
scale = const(size.xScale), 1
bindTime = -1
ownPal = 0
removeOnGetHit = 1
ignoreHitPause = 0

[State 3210, Apple XY]
type = Null
triggerAll = NumTarget
trigger1 = Target, Name = "B.B. Hood" && Target, AuthorName = "Jmorphman"
trigger1 = var(35) := 39 || var(36) := -67
trigger2 = Target, Name = "Demitri Maximoff" && Target, AuthorName = "Jmorphman"
trigger2 = var(35) := 35 || var(36) := -88
trigger3 = Target, Name = "Joe Higashi" && Target, AuthorName = "Jmorphman"
trigger3 = var(35) := 57 || var(36) := -69
trigger4 = Target, Name = "Chun-Li" && Target, AuthorName = "Jmorphman"
trigger4 = var(35) := 37 || var(36) := -80
trigger5 = Target, Name = "Kyo Kusanagi" && Target, AuthorName = "Jmorphman"
trigger5 = var(35) := 8 || var(36) := -115
trigger6 = Target, Name = "Ken Masters" && Target, AuthorName = "Jmorphman"
trigger6 = var(35) := 45 || var(36) := -90
trigger7 = Target, Name = "Vice" && Target, AuthorName = "Jmorphman"
trigger7 = var(35) := 47 || var(36) := -102
trigger8 = Target, Name = "Guile" && Target, AuthorName = "Jmorphman"
trigger8 = var(35) := 68 || var(36) := -95
trigger9 = Target, Name = "Kim Kaphwan" && Target, AuthorName = "Jmorphman"
trigger9 = var(35) := 45 || var(36) := -78
trigger10 = Target, Name = "Rolento" && Target, AuthorName = "Jmorphman"
trigger10 = var(35) := 57 || var(36) := -67
trigger11 = Target, Name = "King" && Target, AuthorName = "Jmorphman"
trigger11 = var(35) := 19 || var(36) := -91
trigger12 = Target, Name = "Benimaru Nikaido" && Target, AuthorName = "Jmorphman"
trigger12 = var(35) := 26 || var(36) := -95
trigger13 = Target, Name = "Ryo Sakazaki" && Target, AuthorName = "CrazyKoopa"
trigger13 = var(35) := 42 || var(36) := -82
trigger14 = Target, Name = "Eagle" && Target, AuthorName = "CrazyKoopa"
trigger14 = var(35) := 8 || var(36) := -116
trigger15 = Target, Name = "Lei-Lei" && Target, AuthorName = "Phantom.of.the.Server"
trigger15 = var(35) := 44 || var(36) := -54
trigger16 = Target, Name = "Morrigan Aensland" && Target, AuthorName = "Phantom.of.the.Server"
trigger16 = var(35) := 15 || var(36) := -62
trigger17 = Target, Name = "Gloves" && Target, AuthorName = "SquidlyPoli1"
trigger17 = var(35) := -12 || var(36) := -29
trigger18 = 1
trigger18 = var(35) := Target, const(size.mid.pos.x) || var(36) := Target, const(size.mid.pos.y)

[State 3210, Apple SprPriority]
type = Null
triggerAll = NumTarget
trigger1 = Target, AuthorName = "Jmorphman"
trigger1 = Target, Name = "Joe Higashi" || Target, Name = "Kyo Kusanagi" 
trigger1 = var(10) := -1
trigger2 = 1
trigger2 = var(10) := 2

[State 3210, Apple]
type = Explod
trigger1 = !Time && NumTarget
anim = 13210
ID = 13210
sprPriority = var(10)
posType = P2
pos = ceil(var(35) * Target, const(size.xScale)), ceil(var(36) * Target, const(size.yScale))
facing = -1
scale = const(size.xScale), 1
bindTime = -1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 3210, Apple Fuse]
type = Explod
trigger1 = !Time && NumTarget
anim = 23210
ID = 13210
sprPriority = 2
posType = P2
pos = ceil(var(35) * Target, const(size.xScale)), ceil(var(36) * Target, const(size.yScale))
facing = -1
scale = const(size.xScale), 1
bindTime = -1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 0

[State 3210, Jump Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 40,0
channel = 3

[State 3210, StateTypeSet: Air, Physics: None]
type = StateTypeSet
trigger1 = AnimElem = 2
stateType = A
physics = N

[State 3210, Dust Helper]
type = Helper
trigger1 = AnimElem = 2
helperType = Normal
stateNo = 8100
ID = 8100
name = "Apple For You Dust"
posType = P1
ownPal = 1

[State 3210, VelSet]
type = VelSet
trigger1 = AnimElem = 2
x = -6.25 * const(size.xScale)
y = -2.5

[State 3210, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(4) < 1
x = 0.0732421875 * const(size.xScale)
y = 0.390625

[State 3210, VelSet (Hit floor)]
type = VelSet
trigger1 = AnimElemTime(4) = 1
y = 0

[State 3210, PosSet (Start rolling)]
type = PosSet
trigger1 = AnimElem = 5
y = 10

[State 3210, Landing Dust Explod]
type = Explod
trigger1 = AnimElem = 14
anim = 8102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 3210, Landing Sound]
type = PlaySnd
trigger1 = AnimElem = 14
value = 52,0
channel = 4

[State 3210, VelSet (Stop rolling)]
type = VelSet
trigger1 = AnimElem = 14
x = 0

[State 3210, PosSet (Stop rolling)]
type = PosSet
trigger1 = AnimElem = 14
y = 0

[State 3210, Fuse sound]
type = PlaySnd
trigger1 = NumTarget && Time = 40
value = 3210,0
channel = 1

[State 3210, Damage]
type = TargetLifeAdd
trigger1 = Time = 62 && NumTarget
value = floor(ifElse(224 * fvar(11) < 7, -7, -224 * fvar(11)))

[State 3210, TargetPowerAdd]
type = TargetPowerAdd
trigger1 = Time = 62 && NumTarget
value = 36

[State 3210, HitAdd]
type = HitAdd
trigger1 = Time = 62 && NumTarget
value = 1

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

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

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

[State 3210, TargetState: Exploded]
type = TargetState
trigger1 = Time = 62 && NumTarget
value = 826

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

[State 3210, Explosion]
type = Helper
trigger1 = NumTarget && Time = 62
helperType = Normal
stateNo = 21537
ID = 21537
name = "Apple For You Explosion"
posType = P2
pos = ceil(var(35) * Target, const(size.xScale)), ceil(var(36) * Target, const(size.yScale))
size.xScale = const(size.xScale) * 0.5
size.yScale = 0.5
ownPal = 1
ignoreHitPause = 1

[State 3210, HitSound]
type = PlaySnd
trigger1 = NumTarget && Time = 62
value = 2,5
channel = 2

[State 3210, Hit Spark]
type = Helper
trigger1 = NumTarget && Time = 62
stateNo = 8014
ID = 8000
name = "Spark"
posType = P2
pos = ceil(var(35) * Target, const(size.xScale)), ceil(var(36) * Target, const(size.yScale))
ownPal = 1
size.xScale = 1
size.yScale = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

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



;===========<APPLE FOR YOU (TARGET)>==========
;Being Thrown
[StateDef 3215]
type = A
moveType = H
physics = N
velSet = 0,0
sprPriority = 0

[State 3215, ChangeAnim2 (Generic)]
type = ChangeAnim2
trigger1 = !Time
value = 3215

[State 3215, ChangeAnim (Compatible)]
type = ChangeAnim
trigger1 = !Time
trigger1 = (SelfAnimExist(858))
;who picked 858 for this animation standard? it causes situations like this!
trigger1 = !(Name = "Guy" && AuthorName = "Phantom.of.the.Server")
value = 858

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

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



;========================<THE KILLING TIME>=============================
[StateDef 3300]
type = S
physics = S
moveType = A
anim = ifElse(var(40), 3301, 3300)
ctrl = 0
velSet = 0,0
sprPriority = 1
powerAdd = -1000
faceP2 = ifElse((PrevStateNo = [100,105]), 0, 1)

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

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

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

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

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

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

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

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

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

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

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

[State 3300, Dark Force Time]
type = VarSet
trigger1 = AnimElem = 11
var(20) = 355

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


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

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

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

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

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



;========================<APPLE & GUN>=============================
[StateDef 3400]
type = S
physics = N
moveType = A
anim = ifElse(var(40), 3401, 3400)
ctrl = 0
velSet = 0,0
sprPriority = 1
powerAdd = -3000
faceP2 = ifElse((PrevStateNo = [100,105]), 0, 1)

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

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

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

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

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

[State 3400, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(9) < 0 && Anim = 3400
trigger2 = Anim = 3401
time = 1
value = SCA

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

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

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

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

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

[State 3400, Projectile HitCount Reset]
type = VarSet
trigger1 = !Time
var(41) = 0
ignoreHitPause = 1

[State 3400, ChangeAnim]
type = ChangeAnim
trigger1 = Anim = 3401 && !AnimTime
value = 3400
elem = 7

[State 3400, VelSet]
type = VelSet
trigger1 = Anim = 3400 && AnimElem = 6
trigger2 = Anim = 3401 && AnimElemTime(29) = 1
x = 3.75

[State 3400, VelAdd]
type = VelAdd
trigger1 = Anim = 3400 && AnimElemTime(10) >= -3
trigger1 = vel x >= 0
x = -0.1953125

[State 3400, VelSet]
type = VelSet
trigger1 = vel x < 0
x = 0

[State 3400, Voice]
type = PlaySnd
triggerAll = Anim = 3400
trigger1 = AnimElem = 7
value = 219,0
channel = 0

[State 3400, Landing Dust Explod]
type = Explod
triggerAll = Anim = 3400
trigger1 = AnimElem = 9
anim = 8102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 3400, Landing Sound]
type = PlaySnd
triggerAll = Anim = 3400
trigger1 = AnimElem = 9
value = 219,1
channel = 3

[State 3400, HitDef]
type = HitDef
triggerAll = Anim = 3400
trigger1 = AnimElem = 10
trigger1 = !var(38)
ID = 3400
attr = S, HT
hitFlag = M
priority = 7, Miss
damage = ceil(ifElse(fvar(11) * 14 < 7, 7, fvar(11) * 14)), 0
getPower = 0,0
givePower = 36, 36
hitSound = -1 + 0 * (var(31) := 2)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0 * (var(34) := 8001)
sparkXY = -10 + 0 * (var(35) := 65), var(36) := -10
palFX.time = 12 * var(9)
palFX.add = 255, 255, 255
palFX.sinAdd = -255, -255, -255, 48
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
fall = 1
fall.recover = 0
p1StateNo = 3410
kill = 0

[State 3400, StateTypeSet: Idle]
type = StateTypeSet
triggerAll = Anim = 3400
trigger1 = AnimElemTime(20) >= 0
moveType = I

[State 3400, Apple Bomb]
type = Helper
triggerAll = Anim = 3400
trigger1 = AnimElemTime(11) = 0
trigger2 = AnimElemTime(11) = 6
trigger3 = AnimElemTime(11) = 10
trigger4 = AnimElemTime(11) = 19
trigger5 = AnimElemTime(11) = 25
helperType = Normal
stateNo = 13405
ID = ifElse(AnimElemTime(11) = 25, 13406, 13405)
name = "Apple & Gun Bomb (Whiffed)"
posType = P1
pos = ceil(const(size.xScale) * 62), -35
size.xScale = const(size.xScale)
size.yScale = const(size.yScale)
ownPal = 1

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


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

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

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

[State 3410, TargetState]
type = TargetState
trigger1 = !Time && NumTarget
value = 3415

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

[State 3410, Spring sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = 5200,1
channel = 3

[State 3410, StateTypeSet: Air, Physics: None]
type = StateTypeSet
trigger1 = AnimElem = 4
stateType = A
physics = N

[State 3410, Dust Helper]
type = Helper
trigger1 = AnimElem = 4
helperType = Normal
stateNo = 8100
ID = 8100
name = "Apple & Gun Dust"
posType = P1
ownPal = 1

[State 3410, VarSet]
type = VarSet
trigger1 = AnimElem = 5
fvar(0) = (P2dist x / 34)

[State 3410, VelSet]
type = VelSet
trigger1 = AnimElem = 5
x = ifElse(EnemyNear, MoveType = H, fvar(0) - (EnemyNear, vel x) * ifElse(Facing = EnemyNear, Facing, -0.25, 1) / 1.5, fvar(0))
y = -10.03125

[State 3410, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(5) > 0
y = 0.5859375

[State 3410, HitDef]
type = HitDef
trigger1 = AnimElem = 21
ID = 3410
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 = High
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 + 0 * (var(31) := 5)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 9), var(36) := -10
palFX.time = 12 * var(9)
palFX.add = 255, 255, 255
palFX.sinAdd= -255, -255, -255, 48
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
kill = 0

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

[State 3410, TargetBind]
type = TargetBind
triggerAll = NumTarget(3410)
trigger1 = P2Dist x < -15 || P2Dist x > 50
time = 1
ID = 3410
pos = ifElse(P2Dist x > 50, 50, -15),0
ignoreHitPause = 1
persistent = 0

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

[State 3410, Rebound]
type = ChangeState
trigger1 = MoveHit && NumTarget(3410)
value = 3411

[State 3410, End]
type = ChangeState
trigger1 = pos y > -vel y
value = 1502


;Rebounding off opponent
[StateDef 3411]
type = A
physics = N
moveType = A
ctrl = 0
velSet = 0,0
sprPriority = 1
hitCountPersist = 1

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

[State 3411, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 3411
elem = AnimElemNo(0) % 21

[State 3411, BindToTarget]
type = PosAdd
trigger1 = P2Dist x < -20 || P2Dist x > 20
trigger1 = !Time
x = ifElse(P2Dist x > 20, P2dist x - 20, P2dist x + 20)

[State 3411, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 13
value = 3410
elem = AnimElemNo(0) + 20

[State 3411, VelSet]
type = VelSet
trigger1 = !Time
y = -5

[State 3411, VelAdd]
type = VelAdd
trigger1 = Time > 1
y = 0.5859375

[State 3411, HitDef]
type = HitDef
trigger1 = Time >= 13
ID = 3411
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 = High
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 + 0 * (var(31) := 5)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10 + 0 * (var(35) := 9), var(36) := -10
palFX.time = 12 * var(9)
palFX.add = 255, 255, 255
palFX.sinAdd= -255, -255, -255, 48
envShake.time = 18
envShake.ampl = 6
envShake.freq = 120
kill = 0

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

[State 3411, TargetBind]
type = TargetBind
triggerAll = NumTarget(3411)
trigger1 = P2Dist x < -15 || P2Dist x > 50
time = 1
ID = 3411
pos = ifElse(P2Dist x > 50, 50, -15),0
ignoreHitPause = 1
persistent = 0

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

[State 3411, Aerial Shooting]
type = ChangeState
trigger1 = MoveHit && NumTarget(3411)
value = 3412

[State 3411, Missed]
type = ChangeState
trigger1 = Anim = 3410 && Time > 13
trigger1 = pos y > -vel y
value = 1502


;Aerial Shooting
[StateDef 3412]
type = A
physics = N
moveType = A
anim = 3412
ctrl = 0
velSet = 0,0
sprPriority = 1
hitCountPersist = 1

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

[State 3412, BindToTarget]
type = PosAdd
trigger1 = P2Dist x < -20 || P2Dist x > 20
trigger1 = !Time
x = ifElse(P2Dist x > 20, P2dist x - 20, P2dist x + 20)

[State 3412, PosSet (initial)]
type = PosSet
trigger1 = NumTarget(3412)
trigger1 = !Time
x = Target(3412), pos x
y = -7

[State 3412, Gunfire recoil effect (propelled into air)]
type = VelAdd
trigger1 = AnimElem = 3 || AnimElem = 5 || AnimElem = 7 || AnimElem = 9 || AnimElem = 11
y = -6.25

[State 3412, VelAdd (Gunfire)]
type = VelAdd
trigger1 = Anim = 3412
trigger1 = AnimElemTime(3) > 0
y = 1.3671875

[State 3412, Gunfire sound player]
type = Helper
trigger1 = AnimElem = 3
helperType = Normal
stateNo = 10220
ID = 34120
name = "Gunfire sound player"
posType = P1
ownPal = 1

[State 3412, Gunfire]
type = Explod
trigger1 = AnimElem = 3
anim = 13412
ID = 13412
sprPriority = 1
posType = P1
pos = ceil(const(size.xScale) * 59), -66
scale = const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3412, Gunfire (Bottom layer)]
type = Explod
trigger1 = AnimElem = 3
anim = 23412
ID = 13412
sprPriority = 1
posType = P1
pos = ceil(const(size.xScale) * 59), -66
scale = const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3412, ModifyExplod]
type = ModifyExplod
trigger1 = AnimElem = 3 || AnimElem = 11
ID = 13412
posType = P1
pos = ceil(const(size.xScale) * 22), 9
ignoreHitPause = 1

[State 3412, ModifyExplod]
type = ModifyExplod
trigger1 = AnimElem = 5 || AnimElem = 9
ID = 13412
posType = P1
pos = ceil(const(size.xScale) * 32), 6
ignoreHitPause = 1

[State 3412, ModifyExplod]
type = ModifyExplod
trigger1 = AnimElem = 7
ID = 13412
posType = P1
pos = ceil(const(size.xScale) * 43), 1
ignoreHitPause = 1

[State 3412, Spark XY]
type = Null
trigger1 = AnimElem = 3 || AnimElem = 11
trigger1 = var(35) := 21 || var(36) := 18
trigger2 = AnimElem = 5 || AnimElem = 9
trigger2 = var(35) := 34 || var(36) := 12
trigger3 = AnimElem = 7
trigger3 = var(35) := 44 || var(36) := 8

[State 3412, HitDef]
type = HitDef
trigger1 = AnimElem = 3 || AnimElem = 5 || AnimElem = 7 || AnimElem = 9 || AnimElem = 11
ID = 3412
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,2
guard.pauseTime = 0,2
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = High
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 + 0 * (var(31) := 2)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10, -55
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
kill = 0

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

[State 3412, TargetState]
type = TargetState
trigger1 = NumTarget(3412)
trigger1 = MoveContact = 1
value = 1535
ID = 3412
ignoreHitPause = 1

[State 3412, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 3413


;Finish
[StateDef 3413]
type = A
physics = N
moveType = A
anim = 3413
ctrl = 0
velSet = 0,0
sprPriority = 1
hitCountPersist = 1

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

[State 3413, PosSet (initial)]
type = PosSet
trigger1 = !Time
y = -18

[State 3413, PosSet (initial)]
type = PosAdd
trigger1 = !Time
x = -35

[State 3413, Gunfire sound player]
type = Helper
trigger1 = !Time
helperType = Normal
stateNo = 10220
ID = 34130
name = "Gunfire sound player"
posType = P1
ownPal = 1

[State 3413, Gunfire]
type = Explod
trigger1 = !Time
anim = 13413
ID = 13413
sprPriority = 1
posType = P1
pos = ceil(const(size.xScale) * 29), 3
scale = const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3413, Gunfire (Bottom layer)]
type = Explod
trigger1 = !Time
anim = 23413
ID = 13413
sprPriority = 1
posType = P1
pos = ceil(const(size.xScale) * 29), 3
scale = const(size.xScale) * 0.5, 0.5
bindTime = -1
ownPal = 1
removeOnGetHit = 1
ignoreHitPause = 1

[State 3413, ModifyExplod]
type = ModifyExplod
trigger1 = AnimElem = 1 || AnimElem = 9 || AnimElem = 17 || AnimElem = 25
ID = 13413
posType = P1
pos = ceil(const(size.xScale) * 29), 3
ignoreHitPause = 1

[State 3413, ModifyExplod]
type = ModifyExplod
trigger1 = AnimElem = 3 || AnimElem = 7 || AnimElem = 11 || AnimElem = 15 || AnimElem = 19 || AnimElem = 23
ID = 13413
posType = P1
pos = ceil(const(size.xScale) * 39), 1
ignoreHitPause = 1

[State 3413, ModifyExplod]
type = ModifyExplod
trigger1 = AnimElem = 5 || AnimElem = 13 || AnimElem = 21
ID = 13413
posType = P1
pos = ceil(const(size.xScale) * 49), -4
ignoreHitPause = 1

[State 3413, Spark XY]
type = Null
trigger1 = AnimElem = 1 || AnimElem = 9 || AnimElem = 17 || AnimElem = 25
trigger1 = var(35) := 27 || var(36) := 10
trigger2 = AnimElem = 3 || AnimElem = 7 || AnimElem = 11 || AnimElem = 15 || AnimElem = 19 || AnimElem = 23
trigger2 = var(35) := 40 || var(36) := 6
trigger3 = AnimElem = 5 || AnimElem = 13 || AnimElem = 21
trigger3 = var(35) := 49 || var(36) := 2

[State 3413, HitDef]
type = HitDef
trigger1 = AnimElem = 1 || AnimElem = 3 || AnimElem = 5 || AnimElem = 7 || AnimElem = 9 || AnimElem = 11 || AnimElem = 13 || AnimElem = 15 || AnimElem = 17 || AnimElem = 19 || AnimElem = 21 || AnimElem = 23 || AnimElem = 25
ID = 3413
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,2
guard.pauseTime = 0,2
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = High
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 + 0 * (var(31) := 2)
guardSound = -1 + 0 * (var(32) := 0)
sparkNo = -1 + 0 * (var(33) := 8014)
guard.sparkNo = -1 + 0 * (var(34) := 8000)
sparkXY = -10, -55
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
kill = 0

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

[State 3413, TargetState]
type = TargetState
trigger1 = NumTarget(3413)
trigger1 = MoveContact = 1
value = 1535
ID = 3413
ignoreHitPause = 1

[State 3413, Turn]
type = Turn
trigger1 = AnimElem = 26 && FrontEdgeDist >= 75

[State 3413, Voice]
type = PlaySnd
trigger1 = AnimElem = 26
value = 4,1
channel = 0

[State 3413, VelSet (Final)]
type = VelSet
trigger1 = AnimElem = 26
x = -4.0625
y = -11.796875

[State 3413, VelAdd (Final)]
type = VelAdd
trigger1 = AnimElemTime(26) > 0
y = 0.5859375

[State 3413, SprPriority]
type = SprPriority
trigger1 = AnimElem = 27
value = 3

[State 3413, Apple Bomb]
type = Helper
trigger1 = AnimElemTime(27) = 1
trigger2 = AnimElemTime(27) = 3
trigger3 = AnimElemTime(27) = 6
trigger4 = AnimElemTime(27) = 8
trigger5 = AnimElemTime(27) = 11
helperType = Normal
stateNo = 13425
ID = 13425
name = "Apple & Gun Bomb"
posType = P1
size.xScale = const(size.xScale)
size.yScale = const(size.yScale)
ownPal = 1
;total damage: 406

[State 3413, ChangeState]
type = ChangeState
trigger1 = pos y > -vel y
value = 3414


;Landing
[StateDef 3414]
type = S
anim = 3414
physics = N
moveType = I
velSet = 0,0
sprPriority = 1

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

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

[State 3414, Landing Dust Explod]
type = Explod
trigger1 = !Time
anim = 8102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 3414, Landing Sound]
type = PlaySnd
trigger1 = !Time
value = 52,0
channel = 5

[State 3414, Voice 2]
type = PlaySnd
trigger1 = AnimElem = 2
value = 3111,0
channel = 0

[State 3414, Clapping sounds]
type = PlaySnd
trigger1 = AnimElem = 2 || AnimElem = 7 || AnimElem = 11
value = 3111,1

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



;===========<APPLE & BOMB (TARGET)>==========
;Tripped
[StateDef 3415]
type = A
moveType = H
physics = N
velSet = 0,-3.5
sprPriority = 0

[State 3415, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 5070

[State 3415, VelAdd]
type = VelAdd
trigger1 = Time > 0
y = 0.677

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

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

[State 3415, ChangeState]
type = ChangeState
trigger1 = vel y > 0
trigger1 = pos y >= const(movement.air.getHit.trip.groundLevel)
value = 3416


;Hit floor
[StateDef 3416]
type = L
moveType = H
physics = N

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

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

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

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

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

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

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

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

[State 3416, 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 3416, VelSet]
type = VelSet
trigger1 = !Time
y = 0

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

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

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

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

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

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

[State 3416, Get up]
type = SelfState
triggerAll = Alive
trigger1 = Time = 60
value = 5120

