freeslot("S_PLAY_BDOVE", "sfx_vdiv")
//This is for the Hard Drop
addHook("ThinkFrame", function()
for player in players.iterate do
-- initialize custom variables
player.vwaitduration = player.vwaitduration or 0 -- 1 second (35 tics)
player.vwait = player.vwait or false
player.vdivetimer = player.vdivetimer or 0
player.vobwaited = player.vobwaited or false
player.vdiv = player.vdiv or 0

if not player.powers[pw_super] then
player.vwaitduration = 20
player.vdiv = -35 * FRACUNIT
else
player.vwaitduration = 10
player.vdiv = -50 * FRACUNIT
end

if P_IsObjectOnGround(player.mo) then
player.vwait = false -- reset the stalling flag when the player touches down again
player.vdivetimer = 0
player.vobwaited = false
end

if player.mo and player.mo.valid  and not (gametype == GT_LTMMURDERMYSTERY) and player.mo.skin == "vob" then
if (player.cmd.buttons & BT_CUSTOM1) ~= 0 and not player.vwait and not player.vobwaited and (player.pflags & PF_JUMPED) ~= 0 then
player.vwait = true
player.vdivetimer = player.vwaitduration
player.vobwaited = true

-- play the start sound effect for stalling
S_StartSound(player.mo, sfx_vhol)
end

if player.vwait then
P_SetObjectMomZ(player.mo, 2 * FRACUNIT)
player.mo.state = S_PLAY_SPRING

player.vdivetimer = player.vdivetimer - 1
if player.vdivetimer >= 1 and player.speed >= 9 * FRACUNIT and not player.powers[pw_super] then
P_InstaThrust(player.mo, player.mo.angle, FixedMul(8 * FRACUNIT, player.mo.scale))
end

if player.vdivetimer <= 0 then
player.vwait = false
P_SetObjectMomZ(player.mo, player.vdiv)
P_SpawnMobjFromMobj(player.mo, 1 * FRACUNIT, 1 * FRACUNIT, 1 * FRACUNIT, MT_EXPLODE)
P_SpawnMobjFromMobj(player.mo, 1 * FRACUNIT, 1 * FRACUNIT, 1 * FRACUNIT, MT_UWEXPLODE)
P_SpawnThokMobj(player)
player.mo.state = S_PLAY_FALL

-- play the end sound effect when stalling ends
S_StartSound(player.mo, sfx_vdiv)
player.mo.state = S_PLAY_FALL
end	
end

end
end
end)