local plys = player.GetAll()
for k,v in pairs(plys) do
    local p = {}
    p.ply = v
    p.alyx = ClientsideRagdoll( "models/player/alyx.mdl" )
    p.alyx:SetNoDraw( false )
    p.alyx:DrawShadow( true )
    p.alyx:ManipulateBoneAngles(1, Angle(0,15,0))
    p.alyx:ManipulateBoneAngles(2, Angle(0,15,0))
    p.alyx:ManipulateBoneAngles(3, Angle(0,15,0))
    p.alyx:ManipulateBoneAngles(4, Angle(0,15,0))
    p.alyx:ManipulateBoneAngles(5, Angle(0,15,0))
    p.alyx:ManipulateBoneAngles(6, Angle(0,45,0))
    p.alyx:ManipulateBoneAngles(8, Angle(0,15,0))
    p.alyx:ManipulateBoneAngles(9, Angle(0,0,0))

    p.breen = ClientsideRagdoll( "models/player/breen.mdl" )
    p.breen:SetNoDraw( false )
    p.breen:DrawShadow( true )

    p.breen:ManipulateBoneAngles(1, Angle(0,-5,0))
    p.breen:ManipulateBoneAngles(2, Angle(0,-5,0))
    p.breen:ManipulateBoneAngles(3, Angle(0,-5,0))
    p.breen:ManipulateBoneAngles(4, Angle(0,-5,0))
    p.breen:ManipulateBoneAngles(5, Angle(0,-5,0))
    p.breen:ManipulateBoneAngles(6, Angle(0,45,0))
    p.breen:ManipulateBoneAngles(8, Angle(0,15,0))
    p.breen:ManipulateBoneAngles(9, Angle(0,0,0))


    p.breen:ManipulateBoneAngles(0, Angle(0,0,-10))

    plys[k] = p
end

local sounds = {
    "vo/npc/alyx/coverme01.wav",
    "vo/npc/alyx/gasp02.wav",
    "vo/npc/alyx/gasp03.wav",
    "vo/npc/alyx/hurt04.wav",
    "vo/npc/alyx/hurt05.wav",
    "vo/npc/alyx/hurt06.wav",
    "vo/npc/alyx/hurt08.wav",
    "vo/npc/alyx/no03.wav",
    "vo/npc/alyx/ohgod01.wav",

    "vo/npc/alyx/ohno_startle01.wav",
    "vo/npc/alyx/ohno_startle03.wav",
    "vo/npc/alyx/uggh01.wav",
    "vo/npc/alyx/uggh02.wav",
    "vo/npc/female01/mygut02.wav",
}

surface.PlaySound("vo/npc/alyx/coverme01.wav")
hook.Add("PostDrawTranslucentRenderables", "sexchams", function()
    cam.IgnoreZ(true)
    for k,v in ipairs(plys) do
        v.ply:SetNoDraw(true)
        local pos = v.ply:GetPos()
        local ang = v.ply:GetAngles()
        v.alyx:SetPos(pos + ang:Forward() * 10)
        v.breen:SetPos(pos)

        v.breen:ManipulateBoneAngles(0, LerpAngle(math.sin(SysTime())*2, Angle(0,0,2), Angle(0,0,-2)))
        ang.x, ang.z = 0,0 
        v.alyx:SetAngles(ang)
        v.breen:SetAngles(ang)
        v.breen:DrawModel()
        v.alyx:DrawModel()
    end
    cam.IgnoreZ(false)
end)

local last = SysTime()
hook.Add("Think", "sexsounds", function()
    if SysTime() - last < 1 then return end
    last = SysTime()
    local sound = sounds[math.random(1, #sounds)]
    surface.PlaySound(sound)
end)