freeslot("S_PLAY_COMPLETE_SWIFT", "S_PLAY_COMPLETEEND_SWIFT", "SPR2_VICT", "SFX_SCJUMP", "SFX_SBONK", "SPR2_SLID", "S_PLAY_SLIDE")

states[S_PLAY_COMPLETE_SWIFT] = {
    sprite = SPR_PLAY,
    frame = FF_ANIMATE|SPR2_VICT,
    tics = 10,
    var1 = 3,
    var2 = 4,
    nextstate = S_PLAY_COMPLETEEND_SWIFT
}

states[S_PLAY_COMPLETEEND_SWIFT] = {
    sprite = SPR_PLAY,
    frame = SPR2_VICT|A,
    tics = -1,
    nextstate = S_PLAY_COMPLETEEND_SWIFT
}

states[S_PLAY_SLIDE] = {
    sprite = SPR_PLAY,
    frame = SPR2_SLID|A,
    tics = -1,
    nextstate = S_PLAY_SLIDE
}

addHook("PlayerThink", function(player) -- Misc Player Stuff
    if player and player.mo and player.mo.valid and player.mo.skin == "swift"
    and not player.bot
        if ((player.exiting <= 3*TICRATE and player.exiting != 0) and player.mo.state != S_PLAY_COMPLETE_SWIFT and player.mo.state != S_PLAY_COMPLETEEND_SWIFT)
        and not (multiplayer)
            if P_IsObjectOnGround(player.mo)
                player.mo.state = S_PLAY_COMPLETE_SWIFT -- Strike a Pose!
            end
        end
        
        if (player.mo.state == S_PLAY_COMPLETE_SWIFT or player.mo.state == S_PLAY_COMPLETEEND_SWIFT) and P_IsObjectOnGround(player.mo)
            player.mo.momx = 0
            player.mo.momy = 0
        end
    end
end)