freeslot("S_PLAY_COMPLETE", "S_PLAY_COMPLETEEND", "SPR2_VICT")

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

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

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 and player.mo.state != S_PLAY_COMPLETEEND)
        and not (multiplayer)
            if P_IsObjectOnGround(player.mo)
                player.mo.state = S_PLAY_COMPLETE -- Strike a Pose!
            end
        end
        
        if (player.mo.state == S_PLAY_COMPLETE or player.mo.state == S_PLAY_COMPLETEEND) and P_IsObjectOnGround(player.mo)
            player.mo.momx = 0
            player.mo.momy = 0
        end
    end
end)