Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 58.66 KB | None | 0 0
  1. GM.FontFace = "Myriad Pro";
  2.  
  3.  
  4.  
  5. GM.FontHeight = { };
  6.  
  7.  
  8.  
  9. function surface.CreateFontCC( name, tab )
  10.  
  11.  
  12.  
  13. surface.CreateFont( name, tab );
  14.  
  15. GM.FontHeight[name] = tab.size;
  16.  
  17.  
  18.  
  19. end
  20.  
  21.  
  22.  
  23. surface.CreateFontCC("CombineControl.Window", {
  24.  
  25.  
  26.  
  27. font = GM.FontFace,
  28.  
  29.  
  30.  
  31. size = 14,
  32.  
  33.  
  34.  
  35. weight = 500})
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43. surface.CreateFontCC("CombineControl.GUIClose", {
  44.  
  45.  
  46.  
  47. font = GM.FontFace,
  48.  
  49.  
  50.  
  51. size = 16,
  52.  
  53.  
  54.  
  55. weight = 900})
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. surface.CreateFontCC("CombineControl.LabelTiny", {
  64.  
  65.  
  66.  
  67. font = GM.FontFace,
  68.  
  69.  
  70.  
  71. size = 12,
  72.  
  73.  
  74.  
  75. weight = 500})
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. surface.CreateFontCC("CombineControl.LabelSmall", {
  84.  
  85.  
  86.  
  87. font = GM.FontFace,
  88.  
  89.  
  90.  
  91. size = 14,
  92.  
  93.  
  94.  
  95. weight = 500 })
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103. surface.CreateFontCC("CombineControl.LabelSmallItalic", {
  104.  
  105.  
  106.  
  107. font = GM.FontFace,
  108.  
  109.  
  110.  
  111. size = 14,
  112.  
  113.  
  114.  
  115. weight = 500,
  116.  
  117.  
  118.  
  119. italic = true })
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127. surface.CreateFontCC("CombineControl.LabelMedium", {
  128.  
  129.  
  130.  
  131. font = GM.FontFace,
  132.  
  133.  
  134.  
  135. size = 16,
  136.  
  137.  
  138.  
  139. weight = 500 })
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147. surface.CreateFontCC("CombineControl.LabelBig", {
  148.  
  149.  
  150.  
  151. font = GM.FontFace,
  152.  
  153.  
  154.  
  155. size = 18,
  156.  
  157.  
  158.  
  159. weight = 500 })
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167. surface.CreateFontCC("CombineControl.LabelGiant", {
  168.  
  169.  
  170.  
  171. font = GM.FontFace,
  172.  
  173.  
  174.  
  175. size = 22,
  176.  
  177.  
  178.  
  179. weight = 500 })
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187. surface.CreateFontCC("CombineControl.LabelMassive", {
  188.  
  189.  
  190.  
  191. font = GM.FontFace,
  192.  
  193.  
  194.  
  195. size = 30,
  196.  
  197.  
  198.  
  199. weight = 500 })
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207. surface.CreateFontCC("CombineControl.LabelStupid", {
  208.  
  209.  
  210.  
  211. font = GM.FontFace,
  212.  
  213.  
  214.  
  215. size = 50,
  216.  
  217.  
  218.  
  219. weight = 500 })
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227. surface.CreateFontCC("CombineControl.ChatSmall", {
  228.  
  229.  
  230.  
  231. font = GM.FontFace,
  232.  
  233.  
  234.  
  235. size = 14,
  236.  
  237.  
  238.  
  239. weight = 100 })
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247. surface.CreateFontCC("CombineControl.ChatSmallItalic", {
  248.  
  249.  
  250.  
  251. font = GM.FontFace,
  252.  
  253.  
  254.  
  255. size = 14,
  256.  
  257.  
  258.  
  259. weight = 500,
  260.  
  261.  
  262.  
  263. italic = true })
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. surface.CreateFontCC("CombineControl.ChatNormal", {
  272.  
  273.  
  274.  
  275. font = "DermaDefault",
  276.  
  277.  
  278.  
  279. size = 18,
  280.  
  281.  
  282.  
  283. weight = 550 })
  284.  
  285.  
  286.  
  287.  
  288.  
  289. surface.CreateFontCC("CombineControl.ChatRadio", {
  290.  
  291.  
  292.  
  293. font = "DermaDefault",
  294.  
  295.  
  296.  
  297. size = 16,
  298.  
  299.  
  300.  
  301. weight = 550 })
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309. surface.CreateFontCC("CombineControl.CombineCamera", {
  310.  
  311.  
  312.  
  313. font = "Lucida Sans Typewriter",
  314.  
  315.  
  316.  
  317. antialias = false,
  318.  
  319.  
  320.  
  321. outline = true,
  322.  
  323.  
  324.  
  325. weight = 800,
  326.  
  327.  
  328.  
  329. size = 18 })
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337. surface.CreateFontCC("CombineControl.CombineCameraSmall", {
  338.  
  339.  
  340.  
  341. font = "Courier New",
  342.  
  343.  
  344.  
  345. size = 15,
  346.  
  347.  
  348.  
  349. weight = 500 })
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357. surface.CreateFontCC("CombineControl.ChatBig", {
  358.  
  359.  
  360.  
  361. font = "DermaDefault",
  362.  
  363.  
  364.  
  365. size = 19,
  366.  
  367.  
  368.  
  369. weight = 700 })
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377. surface.CreateFontCC("CombineControl.ChatBigItalic", {
  378.  
  379.  
  380.  
  381. font = GM.FontFace,
  382.  
  383.  
  384.  
  385. size = 21,
  386.  
  387.  
  388.  
  389. weight = 700,
  390.  
  391.  
  392.  
  393. italic = true })
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401. surface.CreateFontCC("CombineControl.ChatHuge", {
  402.  
  403.  
  404.  
  405. font = GM.FontFace,
  406.  
  407.  
  408.  
  409. size = 20,
  410.  
  411.  
  412.  
  413. weight = 700 })
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421. surface.CreateFontCC("CombineControl.HL2CreditText", {
  422.  
  423.  
  424.  
  425. font = "Trebuchet MS",
  426.  
  427.  
  428.  
  429. size = 20,
  430.  
  431.  
  432.  
  433. weight = 900 })
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441. surface.CreateFontCC("CombineControl.PlayerFont", {
  442.  
  443.  
  444.  
  445. font = GM.FontFace,
  446.  
  447.  
  448.  
  449. size = 17,
  450.  
  451.  
  452.  
  453. weight = 700 })
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461. surface.CreateFontCC("CombineControl.HUDAmmo", {
  462.  
  463.  
  464.  
  465. font = GM.FontFace,
  466.  
  467.  
  468.  
  469. size = 50,
  470.  
  471.  
  472.  
  473. weight = 500 })
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481. surface.CreateFontCC("CombineControl.HUDAmmoSmall", {
  482.  
  483.  
  484.  
  485. font = GM.FontFace,
  486.  
  487.  
  488.  
  489. size = 30,
  490.  
  491.  
  492.  
  493. weight = 500 })
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501. surface.CreateFontCC("CombineControl.WepSelectHeader", {
  502.  
  503.  
  504.  
  505. font = GM.FontFace,
  506.  
  507.  
  508.  
  509. size = 20,
  510.  
  511.  
  512.  
  513. weight = 700 })
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521. surface.CreateFontCC("CombineControl.WepSelectWep", {
  522.  
  523.  
  524.  
  525. font = GM.FontFace,
  526.  
  527.  
  528.  
  529. size = 18,
  530.  
  531.  
  532.  
  533. weight = 500 })
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541. surface.CreateFontCC("CombineControl.WepSelectInfo", {
  542.  
  543.  
  544.  
  545. font = GM.FontFace,
  546.  
  547.  
  548.  
  549. size = 16,
  550.  
  551.  
  552.  
  553. weight = 500 })
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561. surface.CreateFontCC("CombineControl.Written", {
  562.  
  563.  
  564.  
  565. font = "Comic Sans MS",
  566.  
  567.  
  568.  
  569. size = 20,
  570.  
  571.  
  572.  
  573. weight = 700 })
  574.  
  575.  
  576.  
  577.  
  578.  
  579. surface.CreateFontCC( "CombineControl.ChatNormalItalic", {
  580.  
  581.  
  582.  
  583. font = "DermaDefault",
  584.  
  585.  
  586.  
  587. size = 18,
  588.  
  589.  
  590.  
  591. weight = 550,
  592.  
  593.  
  594.  
  595. italic = false } );
  596.  
  597. language.Add( "npc_clawscanner", "Claw Scanner" );
  598. language.Add( "npc_combine_camera", "Combine Camera" );
  599. language.Add( "npc_helicopter", "Helicopter" );
  600. language.Add( "npc_barnacle_tongue_tip", "Barnacle Tongue Tip" );
  601. language.Add( "prop_vehicle_apc", "APC" );
  602. language.Add( "npc_fisherman", "Fisherman" );
  603.  
  604. function draw.DrawTextShadow( text, font, x, y, col1, col2, align )
  605.  
  606. if( align != 0 ) then
  607.  
  608. draw.DrawText( text, font, x + 1, y + 1, col2, align ); -- Less efficient than surface, so we only use this if we need special alignment stuff.
  609. draw.DrawText( text, font, x, y, col1, align );
  610.  
  611. else
  612.  
  613. surface.SetFont( font );
  614.  
  615. surface.SetTextColor( col2 );
  616. surface.SetTextPos( x + 1, y + 1 );
  617. surface.DrawText( text );
  618. surface.SetTextColor( col1 );
  619. surface.SetTextPos( x, y );
  620. surface.DrawText( text );
  621.  
  622. end
  623.  
  624. end
  625.  
  626. function draw.drawTextShadowNew(text, font, x, y, col, bgCol, align, replaceCol)
  627.  
  628.  
  629.  
  630. local tab = {col}
  631.  
  632.  
  633.  
  634. if replaceCol then
  635.  
  636.  
  637.  
  638. local strStart, strEnd = string.find(text, replaceCol[1], 1, true)
  639.  
  640.  
  641.  
  642. local preCol = tab[#tab]
  643.  
  644.  
  645.  
  646. if not strStart or not strEnd then
  647.  
  648.  
  649.  
  650. table.insert(tab, text)
  651.  
  652.  
  653.  
  654. else
  655.  
  656.  
  657.  
  658. table.Add(tab, {string.sub(text, 1, strStart - 1), replaceCol[2], replaceCol[1], preCol, string.sub(text, strEnd + 1)})
  659.  
  660.  
  661.  
  662. end
  663.  
  664.  
  665.  
  666. end
  667.  
  668.  
  669.  
  670. if align ~= 0 then
  671.  
  672.  
  673.  
  674. return
  675.  
  676.  
  677.  
  678. else
  679.  
  680.  
  681.  
  682. surface.SetFont(font)
  683.  
  684.  
  685.  
  686. surface.SetTextPos(x + 1, y + 1)
  687.  
  688.  
  689.  
  690. surface.SetTextColor(bgCol)
  691.  
  692.  
  693.  
  694. for _, v in pairs(tab) do
  695.  
  696.  
  697.  
  698. if type(v) == "string" then
  699.  
  700.  
  701.  
  702. surface.DrawText(v)
  703.  
  704.  
  705.  
  706. end
  707.  
  708.  
  709.  
  710. end
  711.  
  712.  
  713.  
  714. surface.SetTextPos(x, y)
  715.  
  716.  
  717.  
  718. for _, v in pairs(tab) do
  719.  
  720.  
  721.  
  722. if type(v) == "string" then
  723.  
  724.  
  725.  
  726. surface.DrawText(v)
  727.  
  728.  
  729.  
  730. else
  731.  
  732.  
  733.  
  734. surface.SetTextColor(v)
  735.  
  736.  
  737.  
  738. end
  739.  
  740.  
  741.  
  742. end
  743.  
  744.  
  745.  
  746. end
  747.  
  748.  
  749.  
  750. end
  751.  
  752. local matBlurScreen = Material( "pp/blurscreen" );
  753.  
  754. function draw.DrawBackgroundBlur( frac )
  755.  
  756. DisableClipping( true );
  757.  
  758. surface.SetMaterial( matBlurScreen );
  759. surface.SetDrawColor( 255, 255, 255, 255 );
  760.  
  761. for i = 1, 3 do
  762.  
  763. matBlurScreen:SetFloat( "$blur", frac * 5 * ( i / 3 ) )
  764. matBlurScreen:Recompute();
  765. render.UpdateScreenEffectTexture();
  766. surface.DrawTexturedRect( 0, 0, ScrW(), ScrH() );
  767.  
  768. end
  769.  
  770. DisableClipping( false );
  771.  
  772. end
  773.  
  774. GM.ThirdCurPos = Vector();
  775. GM.ThirdCurAng = Angle();
  776. GM.ThirdDestPos = Vector();
  777. GM.ThirdDestAng = Angle();
  778.  
  779. function GM:ShouldDoThirdPerson( ply )
  780.  
  781. local wep = ply:GetActiveWeapon();
  782.  
  783. if( wep and wep:IsValid() and wep != NULL ) then
  784.  
  785. if( wep.InScope and wep:InScope() ) then
  786.  
  787. return false;
  788.  
  789. end
  790.  
  791. end
  792.  
  793. if( ply:GetMoveType() == MOVETYPE_NOCLIP ) then
  794.  
  795. return false;
  796.  
  797. end
  798.  
  799. if( ply:GetViewEntity() != ply ) then
  800.  
  801. return false;
  802.  
  803. end
  804.  
  805. return true;
  806.  
  807. end
  808.  
  809. GM.IntroCamDelay = 15;
  810.  
  811. function GM:StartIntroCam()
  812.  
  813. if( !self.IntroCamData ) then return end
  814.  
  815. self.IntroCamStart = CurTime();
  816. self:PlayMusic( self.IntroCinematicMusic or "music/hl2_song26_trainstation1.mp3", 0 );
  817.  
  818. end
  819.  
  820. function nIntroStart()
  821.  
  822. local force = net.ReadBit();
  823.  
  824. if( force == 0 and GAMEMODE.QuizEnabled ) then
  825.  
  826. if( cookie.GetNumber( "cc_doneintro", 0 ) < 2 ) then
  827.  
  828. GAMEMODE:CreateQuiz();
  829.  
  830. end
  831.  
  832. else
  833.  
  834. if( GAMEMODE.IntroCinematicEnabled ) then
  835.  
  836. GAMEMODE:StartIntroCam();
  837.  
  838. else
  839.  
  840. GAMEMODE.QueueCharCreate = false;
  841. cookie.Set( "cc_doneintro", 2 );
  842.  
  843. GAMEMODE:CreateCharEditor();
  844.  
  845. end
  846.  
  847. end
  848.  
  849. end
  850. net.Receive( "nIntroStart", nIntroStart );
  851.  
  852. function GM:InIntroCam()
  853.  
  854. if( !self.IntroCamData ) then return false end
  855.  
  856. if( self.IntroCamStart and CurTime() - self.IntroCamStart < self.IntroCamDelay * #self.IntroCamText ) then
  857.  
  858. return true;
  859.  
  860. end
  861.  
  862. return false;
  863.  
  864. end
  865.  
  866. function GM:CalcView( ply, pos, ang, fov, znear, zfar )
  867.  
  868. local view = self.BaseClass:CalcView( ply, pos, ang, fov, znear, zfar );
  869.  
  870. if( self.CombineCameraView and self.CombineCameraView:IsValid() ) then
  871.  
  872. local n = self.CombineCameraView;
  873. local attach = n:GetAttachment( 2 );
  874.  
  875. if( n:GetClass() == "npc_combine_camera" ) then
  876.  
  877. attach.Ang:RotateAroundAxis( attach.Ang:Forward(), -90 );
  878. attach.Ang:RotateAroundAxis( attach.Ang:Up(), -90 );
  879.  
  880. end
  881.  
  882. attach.Pos = attach.Pos + attach.Ang:Forward() * 5;
  883.  
  884. view.origin = attach.Pos;
  885. view.angles = attach.Ang;
  886.  
  887. return view;
  888.  
  889. end
  890.  
  891. if( LocalPlayer():APC() and LocalPlayer():APC():IsValid() ) then
  892.  
  893. local mn, mx = LocalPlayer():APC():GetRenderBounds();
  894. local radius = ( mn - mx ):Length();
  895.  
  896. local target = LocalPlayer():APC():GetPos() + ( mn + mx ) / 2 + view.angles:Forward() * -radius;
  897.  
  898. local trace = { };
  899. trace.start = view.origin;
  900. trace.endpos = target;
  901. trace.filter = { LocalPlayer():APC(), LocalPlayer() }
  902. trace.mins = Vector( -4, -4, -4 );
  903. trace.maxs = Vector( 4, 4, 4 );
  904. local tr = util.TraceHull( trace );
  905.  
  906. view.origin = tr.HitPos;
  907. view.drawviewer = true;
  908.  
  909. if( tr.Hit and !tr.StartSolid ) then
  910.  
  911. view.origin = view.origin + tr.HitNormal * 4;
  912.  
  913. end
  914.  
  915. return view;
  916.  
  917. end
  918.  
  919. if( self.IntroCamStart and self.IntroCamData ) then
  920.  
  921. if( CurTime() - self.IntroCamStart < self.IntroCamDelay * #self.IntroCamText ) then
  922.  
  923. local stage = math.Clamp( math.ceil( ( CurTime() - self.IntroCamStart ) / self.IntroCamDelay ), 1, #self.IntroCamText );
  924.  
  925. if( self.IntroCamData ) then
  926.  
  927. local p1, p2, a1, a2;
  928.  
  929. if( self.IntroCamData[stage] ) then
  930.  
  931. p1 = self.IntroCamData[stage][1][1];
  932. p2 = self.IntroCamData[stage][1][2];
  933. a1 = self.IntroCamData[stage][2][1];
  934. a2 = self.IntroCamData[stage][2][2];
  935.  
  936. else
  937.  
  938. p1 = self.IntroCamData[#self.IntroCamData][1][1];
  939. p2 = self.IntroCamData[#self.IntroCamData][1][2];
  940. a1 = self.IntroCamData[#self.IntroCamData][2][1];
  941. a2 = self.IntroCamData[#self.IntroCamData][2][2];
  942.  
  943. end
  944.  
  945. local mul = ( ( CurTime() - self.IntroCamStart ) / self.IntroCamDelay ) - ( stage - 1 );
  946.  
  947. view.origin = LerpVector( mul, p1, p2 );
  948. view.angles = LerpAngle( mul, a1, a2 );
  949.  
  950. return view;
  951.  
  952. end
  953.  
  954. end
  955.  
  956. end
  957.  
  958. if( self.CharCreate or CCP.Quiz ) then
  959.  
  960. if( self.GetHL2CamPos ) then
  961.  
  962. tab = self:GetHL2CamPos();
  963.  
  964. self.ThirdCurPos = view.origin;
  965. self.ThirdCurAng = view.angles;
  966.  
  967. view.origin = tab[1];
  968. view.angles = tab[2];
  969.  
  970. return view;
  971.  
  972. end
  973.  
  974. end
  975.  
  976. if( cookie.GetNumber( "cc_headbob", 0 ) == 1 ) then
  977.  
  978. local hmul = 0;
  979. local len2d = ply:GetVelocity():Length2D();
  980.  
  981. if( len2d > 5 and ply:GetMoveType() != MOVETYPE_NOCLIP and ply:OnGround() ) then
  982.  
  983. hmul = math.Clamp( len2d / 200, 0, 1 );
  984.  
  985. end
  986.  
  987. if( hmul > 0 ) then
  988.  
  989. view.angles.p = view.angles.p + math.sin( CurTime() * 5 ) * hmul;
  990. view.angles.y = view.angles.y + math.cos( CurTime() * 4 ) * 0.5 * hmul;
  991.  
  992. end
  993.  
  994. end
  995.  
  996. if( cookie.GetNumber( "cc_thirdperson", 0 ) == 1 and ply:Alive() ) then
  997.  
  998. if( self:ShouldDoThirdPerson( ply ) ) then
  999.  
  1000. local hitpos = ply:GetEyeTrace().HitPos;
  1001. local targetpos = view.origin;
  1002.  
  1003. local distance = 50;
  1004.  
  1005. local wep = ply:GetActiveWeapon();
  1006.  
  1007. if( !ply:Holstered() and wep and wep:IsValid() and wep != NULL ) then
  1008.  
  1009. if( ply:KeyDown( IN_ATTACK2 ) and wep.IronMode ) then
  1010.  
  1011. distance = 25;
  1012.  
  1013. end
  1014.  
  1015. end
  1016.  
  1017. self.ThirdDestAng = view.angles;
  1018. self.ThirdDestPos = targetpos - self.ThirdDestAng:Forward() * distance;
  1019.  
  1020. local trace = { };
  1021. trace.start = view.origin;
  1022. trace.endpos = self.ThirdDestPos;
  1023. trace.filter = ply;
  1024.  
  1025. local tr = util.TraceLine( trace );
  1026.  
  1027. self.ThirdDestPos = view.origin + tr.Normal * ( distance - 2 ) * tr.Fraction;
  1028.  
  1029. self.ThirdCurPos = LerpVector( 0.08, self.ThirdCurPos, self.ThirdDestPos );
  1030. self.ThirdCurAng = LerpAngle( 0.08, self.ThirdCurAng, self.ThirdDestAng );
  1031.  
  1032. view.angles = self.ThirdCurAng;
  1033. view.origin = self.ThirdCurPos;
  1034.  
  1035. else
  1036.  
  1037. self.ThirdCurPos = view.origin;
  1038. self.ThirdCurAng = view.angles;
  1039.  
  1040. end
  1041.  
  1042. else
  1043.  
  1044. self.ThirdCurPos = view.origin;
  1045. self.ThirdCurAng = view.angles;
  1046.  
  1047. end
  1048.  
  1049. local wep = ply:GetActiveWeapon();
  1050.  
  1051. if( wep and wep:IsValid() ) then
  1052.  
  1053. if( wep.TranslateFOV ) then
  1054.  
  1055. view.fov = wep:TranslateFOV( view.fov );
  1056.  
  1057. end
  1058.  
  1059. end
  1060.  
  1061. return view;
  1062.  
  1063. end
  1064.  
  1065. function GM:ShouldDrawLocalPlayer( ply )
  1066.  
  1067. if( self:InIntroCam() ) then
  1068.  
  1069. return true;
  1070.  
  1071. end
  1072.  
  1073. if( self.CombineCameraView and self.CombineCameraView:IsValid() ) then
  1074.  
  1075. return true;
  1076.  
  1077. end
  1078.  
  1079. if( cookie.GetNumber( "cc_thirdperson", 0 ) == 1 ) then
  1080.  
  1081. return self:ShouldDoThirdPerson( ply );
  1082.  
  1083. end
  1084.  
  1085. return false;
  1086.  
  1087. end
  1088.  
  1089. function GM:DrawCharCreate()
  1090.  
  1091. if( self.CharCreate ) then
  1092.  
  1093. if( !self.GetHL2CamPos ) then
  1094.  
  1095. surface.SetDrawColor( Color( 0, 0, 0, 255 ) );
  1096. surface.DrawRect( 0, 0, ScrW(), ScrH() );
  1097.  
  1098. else
  1099.  
  1100. draw.DrawBackgroundBlur( 1 );
  1101.  
  1102. end
  1103.  
  1104. end
  1105.  
  1106. end
  1107.  
  1108. function GM:DrawFancyIntro()
  1109.  
  1110. if( self.IntroCamStart and self.IntroCamData ) then
  1111.  
  1112. if( CurTime() - self.IntroCamStart < self.IntroCamDelay * #self.IntroCamText ) then
  1113.  
  1114. local stage = math.Clamp( math.ceil( ( CurTime() - self.IntroCamStart ) / self.IntroCamDelay ), 1, #self.IntroCamText );
  1115.  
  1116. if( self.IntroCamText[stage] ) then
  1117.  
  1118. local timesince = ( CurTime() - self.IntroCamStart ) - ( ( stage - 1 ) * self.IntroCamDelay );
  1119. local a = 1;
  1120.  
  1121. if( timesince < 2.5 ) then
  1122.  
  1123. a = timesince / 2.5;
  1124.  
  1125. end
  1126.  
  1127. if( timesince > self.IntroCamDelay - 1 ) then
  1128.  
  1129. a = 1 - ( timesince - ( self.IntroCamDelay - 1 ) );
  1130.  
  1131. end
  1132.  
  1133. local _, h = surface.GetTextSize( self.IntroCamText[stage] );
  1134.  
  1135. h = h + 20;
  1136.  
  1137. draw.RoundedBox( 0, 0, ScrH() * ( 360 / 480 ) - 10, ScrW(), h, Color( 30, 30, 30, a * 200 ) );
  1138.  
  1139. draw.DrawText( self.IntroCamText[stage], "CombineControl.HL2CreditText", ScrW() * ( 96 / 640 ), ScrH() * ( 360 / 480 ), Color( 255, 255, 255, a * 128 ), 0 );
  1140.  
  1141. end
  1142.  
  1143. end
  1144.  
  1145. end
  1146.  
  1147. end
  1148.  
  1149. function GM:DrawQuiz()
  1150.  
  1151. draw.DrawBackgroundBlur( 1 );
  1152.  
  1153. end
  1154.  
  1155. function GM:DrawCombineCamera()
  1156.  
  1157. local text = "REC " .. os.date( "!%m/%d/%y %H:%M:%S" );
  1158.  
  1159. local pos = self.CombineCameraView:GetPos();
  1160. pos.x = math.floor( pos.x );
  1161. pos.y = math.floor( pos.y );
  1162. pos.z = math.floor( pos.z );
  1163.  
  1164. local attach = self.CombineCameraView:GetAttachment( 2 );
  1165.  
  1166. if( self.CombineCameraView:GetClass() == "npc_combine_camera" ) then
  1167.  
  1168. attach.Ang:RotateAroundAxis( attach.Ang:Forward(), -90 );
  1169. attach.Ang:RotateAroundAxis( attach.Ang:Up(), -90 );
  1170.  
  1171. end
  1172.  
  1173. attach.Ang.p = math.floor( attach.Ang.p );
  1174. attach.Ang.y = math.floor( attach.Ang.y );
  1175. attach.Ang.r = math.floor( attach.Ang.r );
  1176.  
  1177. text = text .. "\nCAMERA #" .. self.CombineCameraView:EntIndex() .. "-18";
  1178. text = text .. "\nCOORD " .. pos.x .. " " .. pos.y .. " " .. pos.z;
  1179. text = text .. "\nANG " .. attach.Ang.p .. " " .. attach.Ang.y .. " " .. attach.Ang.r;
  1180.  
  1181. draw.DrawText( text, "CombineControl.CombineCamera", 10, 10, Color( 255, 0, 0, 255 ), 0 );
  1182.  
  1183. for _, v in pairs( player.GetAll() ) do
  1184.  
  1185. local poss = ( v:EyePos() + Vector( 0, 0, 10 ) ):ToScreen();
  1186.  
  1187. if( v:Ragdoll() and v:Ragdoll():IsValid() ) then
  1188.  
  1189. poss = ( v:Ragdoll():EyePos() + Vector( 0, 0, 10 ) ):ToScreen();
  1190.  
  1191. end
  1192.  
  1193. if( ( poss.visible and GAMEMODE:CanSeePos( pos, v:EyePos(), { self.CombineCameraView, v } ) and pos:Distance( v:GetPos() ) < 1024 ) and v:Alive() ) then
  1194.  
  1195. draw.DrawText( v:VisibleRPName(), "CombineControl.CombineCameraSmall", poss.x, poss.y, Color( 200, 200, 200, 255 ), 1 );
  1196.  
  1197. end
  1198.  
  1199. end
  1200.  
  1201. end
  1202.  
  1203. function GM:DrawConsciousness()
  1204.  
  1205. if( !LocalPlayer():PassedOut() and LocalPlayer():Consciousness() < 60 ) then
  1206.  
  1207. draw.DrawBackgroundBlur( 1 - LocalPlayer():Consciousness() / 60 );
  1208.  
  1209. surface.SetDrawColor( Color( 0, 0, 0, 150 * ( 1 - LocalPlayer():Consciousness() / 60 ) ) );
  1210. surface.DrawRect( 0, 0, ScrW(), ScrH() );
  1211.  
  1212. end
  1213.  
  1214. if( LocalPlayer().DrawWakeUp and CurTime() - LocalPlayer().DrawWakeUp <= 3 ) then
  1215.  
  1216. local frac = ( CurTime() - LocalPlayer().DrawWakeUp ) / 3;
  1217.  
  1218. draw.DrawBackgroundBlur( 1 - frac );
  1219.  
  1220. surface.SetDrawColor( Color( 0, 0, 0, 255 * ( 1 - frac ) ) );
  1221. surface.DrawRect( 0, 0, ScrW(), ScrH() );
  1222.  
  1223. end
  1224.  
  1225. end
  1226.  
  1227. function GM:DrawTimedProgress()
  1228.  
  1229. local yc = 0;
  1230.  
  1231. if( !self.TimedProgressBars ) then self.TimedProgressBars = { } end
  1232.  
  1233. for k, v in pairs( self.TimedProgressBars ) do
  1234.  
  1235. if( v.Start and CurTime() < v.End ) then
  1236.  
  1237. if( !v.Player or !v.Player:IsValid() or v.Player:GetPos():Distance( LocalPlayer():GetPos() ) > 100 or v.Player:GetVelocity():Length() > 5 or LocalPlayer():GetVelocity():Length() > 5 ) then
  1238.  
  1239. table.remove( self.TimedProgressBars, k );
  1240. continue;
  1241.  
  1242. end
  1243.  
  1244. surface.SetDrawColor( 30, 30, 30, 200 );
  1245. surface.DrawRect( ScrW() / 2 - 400 / 2, ScrH() / 2 + 40 + yc, 400, 40 );
  1246.  
  1247. surface.SetDrawColor( 150, 20, 20, 255 );
  1248. surface.DrawRect( ScrW() / 2 - 400 / 2 + 1, ScrH() / 2 + 40 + 1 + yc, ( 400 - 2 ) * math.min( ( CurTime() - v.Start ) / ( v.End - v.Start ), 1 ), 40 - 2 );
  1249.  
  1250. local y = self.FontHeight["CombineControl.LabelBig"];
  1251.  
  1252. draw.DrawText( v.Text, "CombineControl.LabelBig", ScrW() / 2, ScrH() / 2 + 40 + y / 2 + yc, Color( 200, 200, 200, 255 ), 1 );
  1253.  
  1254. end
  1255.  
  1256. if( v.End and CurTime() >= v.End ) then
  1257.  
  1258. v.CB( self );
  1259.  
  1260. table.remove( self.TimedProgressBars, k );
  1261.  
  1262. end
  1263.  
  1264. yc = yc + 60;
  1265.  
  1266. end
  1267.  
  1268. end
  1269.  
  1270. function GM:DrawPassedOut()
  1271.  
  1272. if( LocalPlayer():PassedOut() ) then
  1273.  
  1274. if( !LocalPlayer():Alive() ) then
  1275.  
  1276. surface.SetDrawColor( Color( 0, 0, 0, 255 ) );
  1277. surface.DrawRect( 0, 0, ScrW(), ScrH() );
  1278.  
  1279. draw.DrawText( "You have died.", "CombineControl.LabelGiant", ScrW() / 2, ScrH() / 2, Color( 200, 200, 200, 255 ), 1 );
  1280.  
  1281. return;
  1282.  
  1283. end
  1284.  
  1285. surface.SetDrawColor( Color( 0, 0, 0, 255 ) );
  1286. surface.DrawRect( 0, 0, ScrW(), ScrH() );
  1287.  
  1288. draw.DrawText( "You are unconscious.", "CombineControl.LabelGiant", ScrW() / 2, ScrH() / 2, Color( 200, 200, 200, 255 ), 1 );
  1289.  
  1290. surface.SetDrawColor( 30, 30, 30, 150 );
  1291. surface.DrawRect( ScrW() / 2 - 400 / 2, ScrH() / 2 + 40, 400, 40 );
  1292.  
  1293. surface.SetDrawColor( 20, 20, 20, 100 );
  1294. surface.DrawOutlinedRect( ScrW() / 2 - 400 / 2, ScrH() / 2 + 40, 400, 40 );
  1295.  
  1296. surface.SetDrawColor( 150, 20, 20, 255 );
  1297. surface.DrawRect( ScrW() / 2 - 400 / 2 + 1, ScrH() / 2 + 40 + 1, ( 400 - 2 ) * math.min( LocalPlayer():Consciousness() / 100, 1 ), 40 - 2 );
  1298.  
  1299. local y = self.FontHeight["CombineControl.LabelBig"];
  1300.  
  1301. if( LocalPlayer():Ragdoll() and LocalPlayer():Ragdoll():IsValid() ) then
  1302.  
  1303. if( LocalPlayer():Ragdoll():GetVelocity():Length() > 15 ) then
  1304.  
  1305. draw.DrawText( "You're being moved.", "CombineControl.LabelBig", ScrW() / 2, ScrH() / 2 + 40 + y / 2, Color( 200, 200, 200, 255 ), 1 );
  1306. return;
  1307.  
  1308. end
  1309.  
  1310. end
  1311.  
  1312. draw.DrawText( tostring( LocalPlayer():Consciousness() ) .. "%", "CombineControl.LabelBig", ScrW() / 2, ScrH() / 2 + 40 + y / 2, Color( 200, 200, 200, 255 ), 1 );
  1313.  
  1314. end
  1315.  
  1316. end
  1317.  
  1318. function GM:DrawPlayerInfo()
  1319.  
  1320. local w = 220;
  1321.  
  1322. surface.SetFont( "CombineControl.LabelGiant" );
  1323. local x, y = surface.GetTextSize( LocalPlayer():VisibleRPName() );
  1324.  
  1325. if( x + 8 > w ) then
  1326.  
  1327. w = x + 8;
  1328.  
  1329. end
  1330.  
  1331. draw.RoundedBox( 0, 20, ScrH() - 102, w, 82, Color( 30, 30, 30, 200 ) );
  1332.  
  1333. draw.DrawTextShadow( LocalPlayer():VisibleRPName(), "CombineControl.LabelGiant", w + 20 - 4, ScrH() - 102 + 4, Color( 200, 200, 200, 255 ), Color( 0, 0, 0, 255 ), 2 );
  1334. draw.DrawTextShadow( tostring( LocalPlayer():Money() ) .. " Credits", "CombineControl.LabelGiant", w + 20 - 4, ScrH() - 102 + 4 + 22 + 4, Color( 200, 200, 200, 255 ), Color( 0, 0, 0, 255 ), 2 );
  1335. draw.DrawTextShadow( "CID #" .. LocalPlayer():FormattedCID(), "CombineControl.LabelGiant", w + 20 - 4, ScrH() - 102 + 4 + 22 + 4 + 22 + 4, Color( 200, 200, 200, 255 ), Color( 0, 0, 0, 255 ), 2 );
  1336.  
  1337. end
  1338.  
  1339. function GM:DrawHealthBars()
  1340.  
  1341. if( !self.HPDraw ) then self.HPDraw = 100 end
  1342. if( !self.ARDraw ) then self.ARDraw = 0 end
  1343. if( !self.HGDraw ) then self.HGDraw = 0 end
  1344.  
  1345. local hp = LocalPlayer():Health();
  1346. local ar = LocalPlayer():Armor();
  1347. local hg = LocalPlayer():Hunger();
  1348.  
  1349. if( self.HPDraw > hp ) then
  1350.  
  1351. self.HPDraw = self.HPDraw - 0.5;
  1352.  
  1353. elseif( self.HPDraw < hp ) then
  1354.  
  1355. self.HPDraw = self.HPDraw + 0.5;
  1356.  
  1357. end
  1358.  
  1359. if( math.abs( self.HPDraw - hp ) < 1 ) then
  1360.  
  1361. self.HPDraw = hp;
  1362.  
  1363. end
  1364.  
  1365. if( self.ARDraw > ar ) then
  1366.  
  1367. self.ARDraw = self.ARDraw - 0.5;
  1368.  
  1369. elseif( self.ARDraw < ar ) then
  1370.  
  1371. self.ARDraw = self.ARDraw + 0.5;
  1372.  
  1373. end
  1374.  
  1375. if( math.abs( self.ARDraw - ar ) < 1 ) then
  1376.  
  1377. self.ARDraw = ar;
  1378.  
  1379. end
  1380.  
  1381. if( self.HGDraw > hg ) then
  1382.  
  1383. self.HGDraw = self.HGDraw - 0.1;
  1384.  
  1385. elseif( self.HGDraw < hg ) then
  1386.  
  1387. self.HGDraw = self.HGDraw + 0.1;
  1388.  
  1389. end
  1390.  
  1391. if( math.abs( self.HGDraw - hg ) < 1 ) then
  1392.  
  1393. self.HGDraw = hg;
  1394.  
  1395. end
  1396.  
  1397. self.HPDraw = math.Clamp( self.HPDraw, 0, 100 );
  1398. self.ARDraw = math.Clamp( self.ARDraw, 0, 100 );
  1399. self.HGDraw = math.Clamp( self.HGDraw, 0, 100 );
  1400.  
  1401. local w = 220;
  1402.  
  1403. surface.SetFont( "CombineControl.LabelGiant" );
  1404. local x, y = surface.GetTextSize( LocalPlayer():VisibleRPName() );
  1405.  
  1406. if( x + 8 > w ) then
  1407.  
  1408. w = x + 8;
  1409.  
  1410. end
  1411.  
  1412. local y = ScrH() - 102 - 24;
  1413.  
  1414. draw.RoundedBox( 0, 20, y, w, 14, Color( 30, 30, 30, 200 ) );
  1415.  
  1416. if( self.HPDraw > 0 ) then
  1417.  
  1418. draw.RoundedBox( 0, 22, y + 2, ( w - 4 ) * ( self.HPDraw / 100 ), 10, Color( 150, 20, 20, 255 ) );
  1419.  
  1420. end
  1421.  
  1422. y = y - 16;
  1423.  
  1424. if( self.ARDraw > 0 ) then
  1425.  
  1426. draw.RoundedBox( 0, 20, y, w, 14, Color( 30, 30, 30, 200 ) );
  1427. draw.RoundedBox( 0, 22, y + 2, ( w - 4 ) * ( math.Clamp( self.ARDraw, 1, 100 ) / 100 ), 10, Color( 37, 84, 158, 255 ) );
  1428.  
  1429. if( LocalPlayer():Armor() > 100 ) then
  1430.  
  1431. draw.RoundedBox( 0, 22, y + 2, ( w - 4 ) * ( math.Clamp( self.ARDraw - 100, 1, 100 ) / 100 ), 10, Color( 240, 240, 240, 255 ) );
  1432.  
  1433. end
  1434.  
  1435. y = y - 16;
  1436.  
  1437. end
  1438.  
  1439. local b = 15 - ( LocalPlayer():Toughness() / 100 * 15 );
  1440. b = b + ( LocalPlayer():Hunger() / 100 ) * 10;
  1441.  
  1442. if( CurTime() - LocalPlayer():LastLegShot() < b + 5 ) then
  1443.  
  1444. local mul = 1 - ( CurTime() - LocalPlayer():LastLegShot() ) / ( b + 5 );
  1445.  
  1446. draw.RoundedBox( 0, 20, y, w, 14, Color( 30, 30, 30, 200 ) );
  1447. draw.RoundedBox( 0, 22, y + 2, ( w - 4 ) * mul, 10, Color( 150, 150, 100, 255 ) );
  1448.  
  1449. y = y - 16;
  1450.  
  1451. end
  1452.  
  1453. if( self.UseHunger ) then
  1454.  
  1455. draw.RoundedBox( 0, 20, y, w, 14, Color( 30, 30, 30, 200 ) );
  1456.  
  1457. if( self.HGDraw > 0 ) then
  1458.  
  1459. draw.RoundedBox( 0, 22, y + 2, ( w - 4 ) * ( math.Clamp( self.HGDraw, 1, 100 ) / 100 ), 10, Color( 37, 150, 37, 255 ) );
  1460.  
  1461. y = y - 16;
  1462.  
  1463. end
  1464.  
  1465. end
  1466.  
  1467. end
  1468.  
  1469. function GM:GetPlayerSight()
  1470.  
  1471. local range = 256;
  1472. range = range + ( LocalPlayer():Perception() + LocalPlayer():DrugPerceptionMod() ) * 20.48;
  1473. range = range - ( LocalPlayer():Hunger() / 100 ) * 200;
  1474.  
  1475. return range;
  1476.  
  1477. end
  1478.  
  1479. GM.NPCDrawBlacklist = {
  1480. "npc_antlion_grub",
  1481. "npc_barnacle_tongue_tip",
  1482. "npc_bullseye",
  1483. "monster_generic"
  1484. }
  1485.  
  1486. function GM:DrawEntities()
  1487.  
  1488. if( self.SeeAll and !LocalPlayer():IsAdmin() ) then
  1489.  
  1490. self.SeeAll = false;
  1491.  
  1492. return;
  1493.  
  1494. end
  1495.  
  1496. for _, v in pairs( player.GetAll() ) do
  1497.  
  1498. if( v != LocalPlayer() or LocalPlayer():GetViewEntity() != LocalPlayer() ) then
  1499.  
  1500. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1501.  
  1502. local pos = ( v:EyePos() + Vector( 0, 0, 10 ) ):ToScreen();
  1503.  
  1504. if( v:Ragdoll() and v:Ragdoll():IsValid() ) then
  1505.  
  1506. pos = ( v:Ragdoll():EyePos() + Vector( 0, 0, 10 ) ):ToScreen();
  1507.  
  1508. if( ( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v:Ragdoll() ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() ) ) and v:Alive() ) then
  1509.  
  1510. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1511.  
  1512. elseif( v.HUDAlpha > 0 ) then
  1513.  
  1514. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1515.  
  1516. end
  1517.  
  1518. else
  1519.  
  1520. if( ( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() and !v:GetNoDraw() ) ) and v:Alive() ) then
  1521.  
  1522. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1523.  
  1524. elseif( v.HUDAlpha > 0 ) then
  1525.  
  1526. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1527.  
  1528. end
  1529.  
  1530. end
  1531.  
  1532. if v.HUDAlpha > 0 then
  1533. local c = team.GetColor(v:Team())
  1534.  
  1535. draw.DrawTextShadow(v:VisibleRPName(), "CombineControl.PlayerFont", pos.x, pos.y, Color(c.r, c.g, c.b, v.HUDAlpha * 255), Color(0, 0, 0, v.HUDAlpha * 255), 1)
  1536. pos.y = pos.y + 20
  1537.  
  1538. if( v:TiedUp() ) then
  1539.  
  1540. draw.DrawTextShadow( "They're tied up.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1541. pos.y = pos.y + 20;
  1542.  
  1543. end
  1544.  
  1545. if( v:Typing() > 0 ) then
  1546.  
  1547. draw.DrawTextShadow( "Typing...", "CombineControl.LabelSmallItalic", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1548. pos.y = pos.y + 20;
  1549.  
  1550. end
  1551.  
  1552. if( v:NewbieStatus() < NEWBIE_STATUS_OLD ) then
  1553.  
  1554. draw.DrawTextShadow( "Inexperienced Roleplayer", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1555. pos.y = pos.y + 20;
  1556.  
  1557. end
  1558.  
  1559. if( self.SeeAll ) then
  1560.  
  1561. draw.DrawTextShadow( tostring( v:Health() ) .. "%", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 0, 0, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1562. pos.y = pos.y + 20;
  1563.  
  1564. end
  1565.  
  1566. end
  1567.  
  1568. end
  1569.  
  1570. end
  1571.  
  1572. for _, v in pairs( ents.FindByClass( "prop_physics" ) ) do
  1573.  
  1574. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1575.  
  1576. local pos = ( v:GetPos() + Vector( 0, 0, 10 ) ):ToScreen();
  1577.  
  1578. if( ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < 512 ) and LocalPlayer():GetActiveWeapon() and LocalPlayer():GetActiveWeapon():IsValid() and LocalPlayer():GetActiveWeapon() != NULL and LocalPlayer():GetActiveWeapon():GetClass() == "weapon_physgun" ) then
  1579.  
  1580. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1581.  
  1582. elseif( v.HUDAlpha > 0 ) then
  1583.  
  1584. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1585.  
  1586. end
  1587.  
  1588. if( v.HUDAlpha > 0 ) then
  1589.  
  1590. draw.DrawTextShadow( v:PropCreator(), "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1591. draw.DrawTextShadow( v:PropSteamID(), "CombineControl.LabelSmall", pos.x, pos.y + 24, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1592.  
  1593. end
  1594.  
  1595. end
  1596.  
  1597. for _, v in pairs( ents.FindByClass( "cc_item" ) ) do
  1598.  
  1599. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1600.  
  1601. local pos = v:GetPos():ToScreen();
  1602.  
  1603. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1604.  
  1605. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1606.  
  1607. elseif( v.HUDAlpha > 0 ) then
  1608.  
  1609. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1610.  
  1611. end
  1612.  
  1613. if( v.HUDAlpha > 0 ) then
  1614.  
  1615. draw.DrawTextShadow( GAMEMODE:GetItemByID( v:GetItem() ).Name, "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1616. pos.y = pos.y + 20;
  1617.  
  1618. draw.DrawTextShadow( "Weight - " .. tostring( GAMEMODE:GetItemByID( v:GetItem() ).Weight ), "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1619. pos.y = pos.y + 16;
  1620.  
  1621. end
  1622.  
  1623. end
  1624.  
  1625. for _, v in pairs( ents.FindByClass( "cc_paper" ) ) do
  1626.  
  1627. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1628.  
  1629. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  1630. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  1631. local pos = wpos:ToScreen();
  1632.  
  1633. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1634.  
  1635. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1636.  
  1637. elseif( v.HUDAlpha > 0 ) then
  1638.  
  1639. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1640.  
  1641. end
  1642.  
  1643. if( v.HUDAlpha > 0 ) then
  1644.  
  1645. draw.DrawTextShadow( "Paper", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1646. pos.y = pos.y + 20;
  1647.  
  1648. draw.DrawTextShadow( "Press C to read.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1649. pos.y = pos.y + 16;
  1650.  
  1651. end
  1652.  
  1653. end
  1654.  
  1655. for _, v in pairs( ents.FindByClass( "cc_combinecrate" ) ) do
  1656.  
  1657. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1658.  
  1659. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  1660. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  1661. local pos = wpos:ToScreen();
  1662.  
  1663. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1664.  
  1665. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1666.  
  1667. elseif( v.HUDAlpha > 0 ) then
  1668.  
  1669. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1670.  
  1671. end
  1672.  
  1673. if( v.HUDAlpha > 0 ) then
  1674.  
  1675. draw.DrawTextShadow( "Combine Crate", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1676. pos.y = pos.y + 20;
  1677.  
  1678. draw.DrawTextShadow( "Press E to open.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1679. pos.y = pos.y + 16;
  1680.  
  1681. end
  1682.  
  1683. end
  1684.  
  1685. for _, v in pairs( ents.FindByClass( "cc_citizenrationdispenser" ) ) do
  1686.  
  1687. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1688.  
  1689. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  1690. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  1691. local pos = wpos:ToScreen();
  1692.  
  1693. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1694.  
  1695. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1696.  
  1697. elseif( v.HUDAlpha > 0 ) then
  1698.  
  1699. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1700.  
  1701. end
  1702.  
  1703. if( v.HUDAlpha > 0 ) then
  1704.  
  1705. draw.DrawTextShadow( "Ration Dispenser", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1706. pos.y = pos.y + 20;
  1707.  
  1708. draw.DrawTextShadow( "Press E to get a ration.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1709. pos.y = pos.y + 16;
  1710.  
  1711. end
  1712.  
  1713. end
  1714.  
  1715. for _, v in pairs( ents.FindByClass( "cc_vendingmachine" ) ) do
  1716.  
  1717. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1718.  
  1719. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  1720. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  1721. local pos = wpos:ToScreen();
  1722.  
  1723. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1724.  
  1725. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1726.  
  1727. elseif( v.HUDAlpha > 0 ) then
  1728.  
  1729. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1730.  
  1731. end
  1732.  
  1733. if( v.HUDAlpha > 0 ) then
  1734.  
  1735. draw.DrawTextShadow( "Vending Machine", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1736. pos.y = pos.y + 20;
  1737.  
  1738. draw.DrawTextShadow( "Insert 7 Credits.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1739. pos.y = pos.y + 16;
  1740.  
  1741. end
  1742.  
  1743. end
  1744.  
  1745. for _, v in pairs( ents.FindByClass( "cc_workbench" ) ) do
  1746.  
  1747. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1748.  
  1749. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  1750. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  1751. local pos = wpos:ToScreen();
  1752.  
  1753. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1754.  
  1755. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1756.  
  1757. elseif( v.HUDAlpha > 0 ) then
  1758.  
  1759. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1760.  
  1761. end
  1762.  
  1763. if( v.HUDAlpha > 0 ) then
  1764.  
  1765. draw.DrawTextShadow( "Workbench", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1766. pos.y = pos.y + 40;
  1767.  
  1768. draw.DrawTextShadow( "Place items on it to craft.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1769. pos.y = pos.y + 25;
  1770.  
  1771. end
  1772.  
  1773. end
  1774.  
  1775. for _, v in pairs( ents.FindByClass( "cc_combineration" ) ) do
  1776.  
  1777. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1778.  
  1779. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  1780. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  1781. local pos = wpos:ToScreen();
  1782.  
  1783. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1784.  
  1785. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1786.  
  1787. elseif( v.HUDAlpha > 0 ) then
  1788.  
  1789. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1790.  
  1791. end
  1792.  
  1793. if( v.HUDAlpha > 0 ) then
  1794.  
  1795. draw.DrawTextShadow( "Ration Dispenser", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1796. pos.y = pos.y + 20;
  1797.  
  1798. draw.DrawTextShadow( "Press E to get a ration.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1799. pos.y = pos.y + 16;
  1800.  
  1801. end
  1802.  
  1803. end
  1804.  
  1805. for _, v in pairs( ents.FindByClass( "cc_rationcontent" ) ) do
  1806.  
  1807. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1808.  
  1809. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  1810. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  1811. local pos = wpos:ToScreen();
  1812.  
  1813. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1814.  
  1815. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1816.  
  1817. elseif( v.HUDAlpha > 0 ) then
  1818.  
  1819. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1820.  
  1821. end
  1822.  
  1823. if( v.HUDAlpha > 0 ) then
  1824.  
  1825. draw.DrawTextShadow( "Content Dispenser.", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1826. pos.y = pos.y + 20;
  1827.  
  1828. draw.DrawTextShadow( "Insert Coin.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1829. pos.y = pos.y + 16;
  1830.  
  1831. end
  1832.  
  1833. end
  1834.  
  1835. for _, v in pairs( ents.FindByClass( "cc_rationcreation" ) ) do
  1836.  
  1837. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1838.  
  1839. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  1840. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  1841. local pos = wpos:ToScreen();
  1842.  
  1843. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1844.  
  1845. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1846.  
  1847. elseif( v.HUDAlpha > 0 ) then
  1848.  
  1849. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1850.  
  1851. end
  1852.  
  1853. if( v.HUDAlpha > 0 ) then
  1854.  
  1855. draw.DrawTextShadow( "Ration Machine", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1856. pos.y = pos.y + 20;
  1857.  
  1858. draw.DrawTextShadow( "Press E to start.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1859. pos.y = pos.y + 16;
  1860.  
  1861. end
  1862. end
  1863.  
  1864.  
  1865. for _, v in pairs( ents.FindByClass( "cc_posterdispenser" ) ) do
  1866.  
  1867. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1868.  
  1869. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  1870. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  1871. local pos = wpos:ToScreen();
  1872.  
  1873. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1874.  
  1875. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1876.  
  1877. elseif( v.HUDAlpha > 0 ) then
  1878.  
  1879. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1880.  
  1881. end
  1882.  
  1883. if( v.HUDAlpha > 0 ) then
  1884.  
  1885. draw.DrawTextShadow( "Poster Dispenser.", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1886. pos.y = pos.y + 20;
  1887.  
  1888. draw.DrawTextShadow( "Press E to gain posters.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1889. pos.y = pos.y + 16;
  1890.  
  1891. end
  1892.  
  1893. end
  1894.  
  1895. for _, v in pairs( ents.FindByClass( "cc_stash" ) ) do
  1896.  
  1897. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1898.  
  1899. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  1900. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  1901. local pos = wpos:ToScreen();
  1902.  
  1903. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1904.  
  1905. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1906.  
  1907. elseif( v.HUDAlpha > 0 ) then
  1908.  
  1909. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1910.  
  1911. end
  1912.  
  1913. if( v.HUDAlpha > 0 ) then
  1914.  
  1915. draw.DrawTextShadow( "Personal Stash", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1916. pos.y = pos.y + 20;
  1917.  
  1918. draw.DrawTextShadow( "Press E to open your stash.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1919. pos.y = pos.y + 16;
  1920.  
  1921. end
  1922.  
  1923. end
  1924.  
  1925. for _, v in pairs( ents.FindByClass( "cc_dumpster" ) ) do
  1926.  
  1927. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1928.  
  1929. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  1930. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  1931. local pos = wpos:ToScreen();
  1932.  
  1933. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1934.  
  1935. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1936.  
  1937. elseif( v.HUDAlpha > 0 ) then
  1938.  
  1939. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1940.  
  1941. end
  1942.  
  1943. if( v.HUDAlpha > 0 ) then
  1944.  
  1945. draw.DrawTextShadow( "Dumpster", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1946. pos.y = pos.y + 20;
  1947.  
  1948. draw.DrawTextShadow( "Press E to search inside.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1949. pos.y = pos.y + 16;
  1950.  
  1951. end
  1952.  
  1953. end
  1954.  
  1955. for _, v in pairs( ents.FindByClass( "cc_supplycrate" ) ) do
  1956.  
  1957. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1958.  
  1959. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  1960. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  1961. local pos = wpos:ToScreen();
  1962.  
  1963. if( self.SeeAll or ( pos.visible and LocalPlayer():CanSee( v ) and LocalPlayer():GetPos():Distance( v:GetPos() ) < self:GetPlayerSight() / 2 ) ) then
  1964.  
  1965. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1966.  
  1967. elseif( v.HUDAlpha > 0 ) then
  1968.  
  1969. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  1970.  
  1971. end
  1972.  
  1973. if( v.HUDAlpha > 0 ) then
  1974.  
  1975. draw.DrawTextShadow( "Supply Crate", "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1976. pos.y = pos.y + 20;
  1977.  
  1978. draw.DrawTextShadow( "Damage it for loot.", "CombineControl.LabelSmall", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  1979. pos.y = pos.y + 16;
  1980.  
  1981. end
  1982.  
  1983. end
  1984.  
  1985. for _, v in pairs( ents.FindByClass( "npc_*" ) ) do
  1986.  
  1987. if( table.HasValue( self.NPCDrawBlacklist, v:GetClass() ) ) then continue; end
  1988.  
  1989. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  1990.  
  1991. local pos = ( v:EyePos() + Vector( 0, 0, 10 ) ):ToScreen();
  1992.  
  1993. if( self.SeeAll and v:Health() > 0 ) then
  1994.  
  1995. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  1996.  
  1997. elseif( v.HUDAlpha > 0 ) then
  1998.  
  1999. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  2000.  
  2001. end
  2002.  
  2003. if( v.HUDAlpha > 0 ) then
  2004.  
  2005. draw.DrawTextShadow( "#" .. v:GetClass(), "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 100, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  2006. pos.y = pos.y + 20;
  2007.  
  2008. end
  2009.  
  2010. end
  2011.  
  2012. end
  2013.  
  2014. function GM:DrawDoors()
  2015.  
  2016. for _, v in pairs( game.GetDoors() ) do
  2017.  
  2018. if( !v.HUDAlpha ) then v.HUDAlpha = 0; end
  2019.  
  2020. local a, b = v:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() );
  2021. local wpos = ( v:GetPos() + ( a + b ) / 2 );
  2022.  
  2023. local pos = wpos:ToScreen();
  2024.  
  2025. if( pos.visible and v:GetPos():Distance( LocalPlayer():GetPos() ) <= self:GetPlayerSight() ) then
  2026.  
  2027. local trace = { };
  2028. trace.start = LocalPlayer():EyePos();
  2029. trace.endpos = trace.start + LocalPlayer():GetAimVector() * self:GetPlayerSight();
  2030. trace.filter = LocalPlayer();
  2031. trace.mask = MASK_SOLID;
  2032. local tr = util.TraceLine( trace );
  2033.  
  2034. if( tr.Entity == v ) then
  2035.  
  2036. v.HUDAlpha = math.Clamp( v.HUDAlpha + FrameTime(), 0, 1 );
  2037.  
  2038. elseif( v.HUDAlpha > 0 ) then
  2039.  
  2040. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  2041.  
  2042. end
  2043.  
  2044. else
  2045.  
  2046. v.HUDAlpha = math.Clamp( v.HUDAlpha - FrameTime(), 0, 1 );
  2047.  
  2048. end
  2049.  
  2050. if( v.HUDAlpha > 0 ) then
  2051.  
  2052. local name = v:DoorOriginalName();
  2053.  
  2054. if( v:DoorName() != "" ) then
  2055.  
  2056. name = v:DoorName();
  2057.  
  2058. end
  2059.  
  2060. draw.DrawTextShadow( name, "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  2061. pos.y = pos.y + 20;
  2062.  
  2063. if( ( v:DoorType() == DOOR_BUYABLE or v:DoorType() == DOOR_BUYABLE_ASSIGNABLE ) and #v:DoorOwners() == 0 and #v:DoorAssignedOwners() == 0 ) then
  2064.  
  2065. draw.DrawTextShadow( v:DoorPrice() .. " credits", "CombineControl.PlayerFont", pos.x, pos.y, Color( 226, 205, 95, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  2066. pos.y = pos.y + 20;
  2067.  
  2068. end
  2069.  
  2070. if( self.SeeAll ) then
  2071.  
  2072. local tab = v:DoorOwners();
  2073. table.Merge( tab, v:DoorAssignedOwners() );
  2074.  
  2075. for _, owner in pairs( tab ) do
  2076.  
  2077. local ply = nil;
  2078.  
  2079. for _, l in pairs( player.GetAll() ) do
  2080.  
  2081. if( l:CharID() == owner ) then
  2082.  
  2083. ply = l;
  2084.  
  2085. end
  2086.  
  2087. end
  2088.  
  2089. local text = "Owner: CharID #" .. owner;
  2090.  
  2091. if( ply and ply:IsValid() ) then
  2092.  
  2093. text = "Owner: " .. ply:VisibleRPName();
  2094.  
  2095. end
  2096.  
  2097. draw.DrawTextShadow( text, "CombineControl.PlayerFont", pos.x, pos.y, Color( 200, 200, 200, v.HUDAlpha * 255 ), Color( 0, 0, 0, v.HUDAlpha * 255 ), 1 );
  2098. pos.y = pos.y + 20;
  2099.  
  2100. end
  2101.  
  2102. end
  2103.  
  2104. end
  2105.  
  2106. end
  2107.  
  2108. end
  2109.  
  2110. GM.WeaponOutText = { };
  2111. GM.WeaponOutText["weapon_physgun"] = "Your physgun is out! Switch to your hands when you're done building.";
  2112. GM.WeaponOutText["weapon_physcannon"] = "Your gravgun is out! Switch to your hands when you're done moving things.";
  2113. GM.WeaponOutText["gmod_tool"] = "Your toolgun is out! Switch to your hands when you're done building.";
  2114.  
  2115. function GM:DrawAmmo()
  2116.  
  2117. if( LocalPlayer():InVehicle() ) then
  2118.  
  2119. return;
  2120.  
  2121. end
  2122.  
  2123. local w = LocalPlayer():GetActiveWeapon();
  2124.  
  2125. if( w != NULL ) then
  2126.  
  2127. if( LocalPlayer():TiedUp() ) then
  2128.  
  2129. surface.SetFont( "CombineControl.LabelGiant" );
  2130. local x1, y1 = surface.GetTextSize( "You're tied up." );
  2131.  
  2132. draw.RoundedBox( 0, ScrW() - 24 - x1, ScrH() - 24 - y1, x1 + 4, y1 + 4, Color( 30, 30, 30, 200 ) );
  2133. draw.DrawTextShadow( "You're tied up.", "CombineControl.LabelGiant", ScrW() - 22 - x1, ScrH() - 22 - y1, Color( 200, 200, 200, 255 ), Color( 0, 0, 0, 255 ), 0 );
  2134.  
  2135. return;
  2136.  
  2137. elseif( LocalPlayer():Holstered() and w.Holsterable ) then
  2138.  
  2139. surface.SetFont( "CombineControl.LabelGiant" );
  2140. local x1, y1 = surface.GetTextSize( "Press B to unholster." );
  2141.  
  2142. draw.RoundedBox( 0, ScrW() - 24 - x1, ScrH() - 24 - y1, x1 + 4, y1 + 4, Color( 30, 30, 30, 200 ) );
  2143. draw.DrawTextShadow( "Press B to unholster.", "CombineControl.LabelGiant", ScrW() - 22 - x1, ScrH() - 22 - y1, Color( 200, 200, 200, 255 ), Color( 0, 0, 0, 255 ), 0 );
  2144.  
  2145. return;
  2146.  
  2147. elseif( w.UnholsterText ) then
  2148.  
  2149. surface.SetFont( "CombineControl.LabelGiant" );
  2150. local x1, y1 = surface.GetTextSize( w.UnholsterText );
  2151.  
  2152. draw.RoundedBox( 0, ScrW() - 24 - x1, ScrH() - 24 - y1, x1 + 4, y1 + 4, Color( 30, 30, 30, 200 ) );
  2153. draw.DrawTextShadow( w.UnholsterText, "CombineControl.LabelGiant", ScrW() - 22 - x1, ScrH() - 22 - y1, Color( 200, 200, 200, 255 ), Color( 0, 0, 0, 255 ), 0 );
  2154.  
  2155. return;
  2156.  
  2157. elseif( self.WeaponOutText[w:GetClass()] ) then
  2158.  
  2159. surface.SetFont( "CombineControl.LabelMassive" );
  2160. local x1, y1 = surface.GetTextSize( self.WeaponOutText[w:GetClass()] );
  2161.  
  2162. draw.RoundedBox( 0, ScrW() - 24 - x1, ScrH() - 24 - y1, x1 + 4, y1 + 4, Color( 30, 30, 30, 200 ) );
  2163. draw.DrawTextShadow( self.WeaponOutText[w:GetClass()], "CombineControl.LabelMassive", ScrW() - 22 - x1, ScrH() - 22 - y1, Color( 200, 0, 0, 255 ), Color( 0, 0, 0, 255 ), 0 );
  2164.  
  2165. return;
  2166.  
  2167. end
  2168.  
  2169. if( w.Firearm ) then
  2170.  
  2171. if( w.Primary.ClipSize > -1 ) then
  2172.  
  2173. local clip = w:Clip1();
  2174. local ammo = w:Ammo1();
  2175.  
  2176. surface.SetFont( "CombineControl.HUDAmmo" );
  2177. local x1, y1 = surface.GetTextSize( clip );
  2178. local y2 = self.FontHeight["CombineControl.HUDAmmo"];
  2179.  
  2180. local x = x1;
  2181. local y = math.max( y1, y2 );
  2182.  
  2183. draw.RoundedBox( 0, ScrW() - 24 - x, ScrH() - 24 - y, x + 4, y + 4, Color( 30, 30, 30, 200 ) );
  2184. draw.DrawTextShadow( clip, "CombineControl.HUDAmmo", ScrW() - 22 - x, ScrH() - 22 - y, Color( 200, 200, 200, 255 ), Color( 0, 0, 0, 255 ), 0 );
  2185.  
  2186. end
  2187.  
  2188. end
  2189.  
  2190. end
  2191.  
  2192. end
  2193.  
  2194. function nWarnName( len )
  2195.  
  2196. GAMEMODE.NameWarning = true;
  2197. GAMEMODE.NameWarningStart = CurTime();
  2198.  
  2199. end
  2200. net.Receive( "nWarnName", nWarnName );
  2201.  
  2202. function GM:DrawWarnings()
  2203.  
  2204. if( self.NameWarning and CurTime() - self.NameWarningStart < 15 ) then
  2205.  
  2206. local t = CurTime() - self.NameWarningStart;
  2207. local a = 1;
  2208.  
  2209. if( t < 1 ) then
  2210.  
  2211. a = t;
  2212.  
  2213. elseif( t > 14 ) then
  2214.  
  2215. a = 1 - ( t - 14 );
  2216.  
  2217. end
  2218.  
  2219. local h = 250;
  2220. local dh = ( ScrH() - h ) / 2;
  2221.  
  2222. draw.RoundedBox( 0, 0, dh, ScrW(), h, Color( 30, 30, 30, 200 * a ) );
  2223.  
  2224. draw.DrawText( "YOU HAVE BEEN ISSUED A NAME WARNING", "CombineControl.LabelStupid", ScrW() / 2, dh + 20, Color( 150, 20, 20, 255 * a ), 1 );
  2225.  
  2226. draw.DrawText( "An administrator considers your character's name to be inappropriate for Half-Life 2 RP.\n\nPlease change it through the player menu (F3) to a proper, realistic first and last name.\n\nIf you ignore this warning, you may be subject to a kick or ban.", "CombineControl.LabelGiant", ScrW() / 2, dh + 100, Color( 200, 200, 200, 255 * a ), 1 );
  2227.  
  2228. end
  2229.  
  2230. end
  2231.  
  2232. function GM:DrawUnconnected()
  2233.  
  2234. if( !self.CharCreateOpened ) then
  2235.  
  2236. surface.SetDrawColor( Color( 0, 0, 0, 150 ) );
  2237. surface.DrawRect( 0, 0, ScrW(), ScrH() );
  2238.  
  2239. draw.DrawBackgroundBlur( 1 );
  2240.  
  2241. draw.DrawText( "Please wait...", "CombineControl.LabelGiant", ScrW() / 2, ScrH() / 2, Color( 200, 200, 200, 255 ), 1 );
  2242.  
  2243. end
  2244.  
  2245. end
  2246.  
  2247. function nFlashRed( len )
  2248.  
  2249. GAMEMODE.FlashRedStart = CurTime();
  2250.  
  2251. end
  2252. net.Receive( "nFlashRed", nFlashRed );
  2253.  
  2254. function GM:DrawDamage()
  2255.  
  2256. if( self.FlashRedStart and LocalPlayer():Alive() ) then
  2257.  
  2258. local t = CurTime() - self.FlashRedStart;
  2259. local a = 0;
  2260.  
  2261. if( t < 0.1 ) then
  2262.  
  2263. a = 0.5;
  2264.  
  2265. elseif( t < 0.6 ) then
  2266.  
  2267. a = 0.5 - ( t - 0.1 );
  2268.  
  2269. end
  2270.  
  2271. if( a > 0 ) then
  2272.  
  2273. surface.SetDrawColor( 128, 0, 0, 255 * a );
  2274. surface.DrawRect( 0, 0, ScrW(), ScrH() );
  2275.  
  2276. end
  2277.  
  2278. end
  2279.  
  2280. end
  2281.  
  2282. GM.Notifications = { };
  2283.  
  2284. function nAddNotification( len )
  2285.  
  2286. local str = net.ReadString();
  2287. GAMEMODE:AddNotification( str );
  2288.  
  2289. end
  2290. net.Receive( "nAddNotification", nAddNotification );
  2291.  
  2292. function GM:AddNotification( text, col )
  2293.  
  2294. local n = 0;
  2295.  
  2296. for _, m in pairs( self.Notifications ) do
  2297.  
  2298. for _, v in pairs( self.Notifications ) do
  2299.  
  2300. if( v[3] == n ) then
  2301.  
  2302. n = v[3] + 1;
  2303.  
  2304. end
  2305.  
  2306. end
  2307.  
  2308. end
  2309.  
  2310. table.insert( self.Notifications, { text, CurTime(), n, col } );
  2311.  
  2312. end
  2313.  
  2314. function GM:DrawNotifications()
  2315.  
  2316. for k, v in pairs( self.Notifications ) do
  2317.  
  2318. local t = v[2];
  2319. local n = v[3];
  2320. local col = v[4];
  2321.  
  2322. if( CurTime() - t > 10 ) then
  2323.  
  2324. table.remove( self.Notifications, k );
  2325. continue;
  2326.  
  2327. end
  2328.  
  2329. local a = 1;
  2330.  
  2331. if( CurTime() - t < 0.5 ) then
  2332.  
  2333. a = ( CurTime() - t ) / 0.5;
  2334.  
  2335. elseif( CurTime() - t > 6 ) then
  2336.  
  2337. a = 1 - ( CurTime() - t - 6 ) / 4;
  2338.  
  2339. end
  2340.  
  2341. if( !col ) then
  2342.  
  2343. col = Color( 200, 200, 200, 255 * a )
  2344.  
  2345. else
  2346.  
  2347. col = Color( col.r, col.g, col.b, 255 * a )
  2348.  
  2349. end
  2350.  
  2351. surface.SetFont( "CombineControl.LabelGiant" );
  2352. local x1, y1 = surface.GetTextSize( v[1] );
  2353.  
  2354. draw.RoundedBox( 0, ScrW() - 24 - x1, ScrH() * ( 3 / 4 ) - ( n * ( y1 + 8 ) ), x1 + 4, y1 + 4, Color( 30, 30, 30, 200 * a ) );
  2355. draw.DrawTextShadow( v[1], "CombineControl.LabelGiant", ScrW() - 22 - x1, ScrH() * ( 3 / 4 ) - ( n * ( y1 + 8 ) ) + 2, Color( 200, 200, 200, 255 * a ), Color( 0, 0, 0, 255 * a ), 0 );
  2356.  
  2357. end
  2358.  
  2359. end
  2360.  
  2361. function GM:HUDPaint()
  2362.  
  2363. if( !CCP ) then return end
  2364.  
  2365. if( self:InIntroCam() ) then
  2366.  
  2367. self:DrawFancyIntro();
  2368. return;
  2369.  
  2370. end
  2371.  
  2372. if( CCP.Quiz ) then
  2373.  
  2374. self:DrawQuiz();
  2375. return;
  2376.  
  2377. end
  2378.  
  2379. if( self.CombineCameraView and self.CombineCameraView:IsValid() ) then
  2380.  
  2381. self:DrawCombineCamera();
  2382.  
  2383. if( cookie.GetNumber( "cc_chat", 1 ) == 1 ) then
  2384.  
  2385. self:DrawChat();
  2386.  
  2387. end
  2388.  
  2389. return;
  2390.  
  2391. end
  2392.  
  2393. self:DrawCharCreate();
  2394.  
  2395. if( !self.CharCreate ) then
  2396.  
  2397. if( cookie.GetNumber( "cc_hud", 1 ) == 1 and !self.Mastermind ) then
  2398.  
  2399. self:DrawDamage();
  2400. self:DrawDrugs();
  2401. self:DrawConsciousness();
  2402. self:DrawDoors();
  2403. self:DrawEntities();
  2404. self:DrawPlayerInfo();
  2405. self:DrawHealthBars();
  2406. self:DrawAmmo();
  2407. self:DrawWeaponSelect();
  2408. self:DrawTimedProgress();
  2409. self:DrawPassedOut();
  2410. self:DrawNotifications();
  2411.  
  2412. end
  2413.  
  2414. if( self.Mastermind ) then
  2415.  
  2416. self:DrawEntities();
  2417.  
  2418. end
  2419.  
  2420. if( cookie.GetNumber( "cc_chat", 1 ) == 1 ) then
  2421.  
  2422. self:DrawChat();
  2423.  
  2424. end
  2425.  
  2426. if( cookie.GetNumber( "cc_hud", 1 ) != 1 ) then
  2427.  
  2428. self:DrawConsciousness();
  2429. self:DrawWeaponSelect();
  2430. self:DrawPassedOut();
  2431.  
  2432. end
  2433.  
  2434. self:DrawWarnings();
  2435. self:DrawUnconnected();
  2436.  
  2437. end
  2438.  
  2439. end
  2440.  
  2441. function GM:HUDShouldDraw( str )
  2442.  
  2443. if( str == "CHudWeaponSelection" ) then return false end
  2444. if( str == "CHudAmmo" ) then return false end
  2445. if( str == "CHudAmmoSecondary" ) then return false end
  2446. if( str == "CHudHealth" ) then return false end
  2447. if( str == "CHudBattery" ) then return false end
  2448. if( str == "CHudChat" ) then return false end
  2449. if( str == "CHudDamageIndicator" ) then return false end
  2450.  
  2451. if( str == "CHudCrosshair" ) then
  2452.  
  2453. local wep = LocalPlayer():GetActiveWeapon();
  2454.  
  2455. if( wep and wep:IsValid() and wep != NULL ) then
  2456.  
  2457. if( wep:GetClass() == "gmod_tool" or wep:GetClass() == "weapon_physgun" or wep:GetClass() == "weapon_physcannon" ) then
  2458.  
  2459. return true
  2460.  
  2461. end
  2462.  
  2463. end
  2464.  
  2465. return false;
  2466.  
  2467. end
  2468.  
  2469. return true
  2470.  
  2471. end
  2472.  
  2473. GM.MastermindMat = Material( "vgui/white" );
  2474.  
  2475. function GM:RenderNPCTargets()
  2476.  
  2477. if( self.Mastermind ) then
  2478.  
  2479. for _, v in pairs( ents.GetNPCs() ) do
  2480.  
  2481. if( v:NPCTargetPos() != Vector() ) then
  2482.  
  2483. local col = v:NPCMastermindColor();
  2484.  
  2485. cam.Start3D2D( v:NPCTargetPos() + Vector( 0, 0, 1 ), Angle(), 1 );
  2486.  
  2487. surface.SetTexture( surface.GetTextureID( "effects/select_ring" ) );
  2488. surface.SetDrawColor( col.x, col.y, col.z, 255 );
  2489. surface.DrawTexturedRect( -10, -10, 20, 20 );
  2490.  
  2491. cam.End3D2D();
  2492.  
  2493. render.DrawLine( v:GetPos(), v:NPCTargetPos(), Color( col.x, col.y, col.z, 255 ), false );
  2494.  
  2495. end
  2496.  
  2497. end
  2498.  
  2499. if( self.MastermindSelected and self.MastermindSelected:IsValid() ) then
  2500.  
  2501. local trace = { };
  2502. trace.start = LocalPlayer():GetShootPos();
  2503. trace.endpos = trace.start + gui.ScreenToVector( gui.MousePos() ) * 32768;
  2504. trace.filter = LocalPlayer();
  2505.  
  2506. if( self.MastermindMouse and self.MastermindMouse == 109 ) then
  2507.  
  2508. trace.endpos = LocalPlayer():GetPos();
  2509.  
  2510. end
  2511.  
  2512. local tr = util.TraceLine( trace );
  2513.  
  2514. cam.Start3D2D( tr.HitPos + Vector( 0, 0, 1 ), Angle(), 1 );
  2515.  
  2516. surface.SetTexture( surface.GetTextureID( "effects/select_ring" ) );
  2517. surface.SetDrawColor( 200, 200, 200, 255 );
  2518. surface.DrawTexturedRect( -10, -10, 20, 20 );
  2519.  
  2520. cam.End3D2D();
  2521.  
  2522. render.DrawLine( self.MastermindSelected:GetPos(), tr.HitPos, Color( 200, 200, 200, 255 ), false );
  2523.  
  2524. end
  2525.  
  2526. end
  2527.  
  2528. end
  2529.  
  2530. function GM:PostDrawOpaqueRenderables()
  2531.  
  2532. for _, v in pairs( player.GetAll() ) do
  2533.  
  2534. if( v:GetActiveWeapon() and v:GetActiveWeapon():IsValid() and v:GetActiveWeapon() != NULL ) then
  2535.  
  2536. if( v:GetActiveWeapon().PostDrawOpaqueRenderables ) then
  2537.  
  2538. v:GetActiveWeapon():PostDrawOpaqueRenderables();
  2539.  
  2540. end
  2541.  
  2542. end
  2543.  
  2544. end
  2545.  
  2546. self:RenderNPCTargets();
  2547.  
  2548. if( self.MapPostDrawOpaqueRenderables ) then
  2549.  
  2550. self:MapPostDrawOpaqueRenderables();
  2551.  
  2552. end
  2553.  
  2554. self:DrugPostDrawOpaqueRenderables();
  2555.  
  2556. end
  2557.  
  2558. function GM:GetCursorNPC( max )
  2559.  
  2560. local dist = max;
  2561. local ent = nil;
  2562.  
  2563. for _, v in pairs( ents.GetNPCs() ) do
  2564.  
  2565. local pos = v:GetPos():ToScreen();
  2566. local x, y = gui.MousePos();
  2567.  
  2568. local d = math.sqrt( ( pos.x - x ) ^ 2 + ( pos.y - y ) ^ 2 );
  2569.  
  2570. if( d < dist ) then
  2571.  
  2572. ent = v;
  2573. dist = d;
  2574.  
  2575. end
  2576.  
  2577. end
  2578.  
  2579. return ent;
  2580.  
  2581. end
  2582.  
  2583. function GM:GetCursorEnt()
  2584.  
  2585. local trace = { };
  2586. trace.start = LocalPlayer():GetShootPos();
  2587. trace.endpos = trace.start + gui.ScreenToVector( gui.MousePos() ) * 32768;
  2588. trace.filter = LocalPlayer();
  2589. local tr = util.TraceLine( trace );
  2590.  
  2591. if( tr.Entity and tr.Entity:IsValid() ) then
  2592.  
  2593. return tr.Entity;
  2594.  
  2595. end
  2596.  
  2597. end
  2598.  
  2599. function GM:PreDrawHalos()
  2600.  
  2601. if( self.Mastermind ) then
  2602.  
  2603. local hEnt = nil;
  2604.  
  2605. if( vgui.IsHoveringWorld() and !self.MastermindSelected ) then
  2606.  
  2607. hEnt = self:GetCursorNPC( 200 );
  2608.  
  2609. end
  2610.  
  2611. local tab = { };
  2612.  
  2613. if( hEnt ) then
  2614.  
  2615. if( hEnt.GetActiveWeapon and hEnt:GetActiveWeapon() and hEnt:GetActiveWeapon():IsValid() ) then
  2616.  
  2617. halo.Add( { hEnt, hEnt:GetActiveWeapon() }, Color( 255, 255, 255, 255 ), 4, 4, 2, true, true );
  2618.  
  2619. else
  2620.  
  2621. halo.Add( { hEnt }, Color( 255, 255, 255, 255 ), 4, 4, 2, true, true );
  2622.  
  2623. end
  2624.  
  2625. end
  2626.  
  2627. for _, v in pairs( ents.GetNPCs() ) do
  2628.  
  2629. if( v != hEnt ) then
  2630.  
  2631. if( !tab[v:NPCMastermindColor()] ) then
  2632.  
  2633. tab[v:NPCMastermindColor()] = { };
  2634.  
  2635. end
  2636.  
  2637. table.insert( tab[v:NPCMastermindColor()], v );
  2638.  
  2639. if( v.GetActiveWeapon and v:GetActiveWeapon() and v:GetActiveWeapon():IsValid() ) then
  2640.  
  2641. table.insert( tab[v:NPCMastermindColor()], v:GetActiveWeapon() );
  2642.  
  2643. end
  2644.  
  2645. end
  2646.  
  2647. end
  2648.  
  2649. for _, v in pairs( ents.FindByClass( "prop_vehicle_apc" ) ) do
  2650.  
  2651. if( v != hEnt ) then
  2652.  
  2653. if( !tab[v:NPCMastermindColor()] ) then
  2654.  
  2655. tab[v:NPCMastermindColor()] = { };
  2656.  
  2657. end
  2658.  
  2659. table.insert( tab[v:NPCMastermindColor()], v );
  2660.  
  2661. end
  2662.  
  2663. end
  2664.  
  2665. for k, v in pairs( tab ) do
  2666.  
  2667. halo.Add( { v }, Color( k.x, k.y, k.z, 255 ), 2, 2, 1, true, true );
  2668.  
  2669. end
  2670.  
  2671. end
  2672.  
  2673. if( GAMEMODE.SeeAll ) then
  2674.  
  2675. local tab = { };
  2676.  
  2677. for _, v in pairs( ents.GetAll() ) do
  2678.  
  2679. if( v:PropSaved() ) then
  2680.  
  2681. table.insert( tab, v );
  2682.  
  2683. end
  2684.  
  2685. end
  2686.  
  2687. halo.Add( tab, Color( 255, 0, 255, 255 ), 1, 1, 1, true, false );
  2688.  
  2689. end
  2690.  
  2691. end
  2692.  
  2693. function GM:RenderScreenspaceEffects()
  2694.  
  2695. self.BaseClass:RenderScreenspaceEffects();
  2696.  
  2697. if( self:InIntroCam() ) then return end
  2698.  
  2699. if( LocalPlayer():PassedOut() ) then
  2700.  
  2701. local tab = { };
  2702.  
  2703. tab[ "$pp_colour_addr" ] = 0;
  2704. tab[ "$pp_colour_addg" ] = 0;
  2705. tab[ "$pp_colour_addb" ] = 0;
  2706. tab[ "$pp_colour_brightness" ] = -1;
  2707. tab[ "$pp_colour_contrast" ] = 1;
  2708. tab[ "$pp_colour_colour" ] = 1;
  2709. tab[ "$pp_colour_mulr" ] = 0;
  2710. tab[ "$pp_colour_mulg" ] = 0;
  2711. tab[ "$pp_colour_mulb" ] = 0;
  2712.  
  2713. DrawColorModify( tab );
  2714.  
  2715. end
  2716.  
  2717. if( self.FlashbangStart and LocalPlayer():Alive() ) then
  2718.  
  2719. local t = CurTime() - self.FlashbangStart;
  2720. local a = 0;
  2721.  
  2722. if( t < 5 ) then
  2723.  
  2724. a = 1;
  2725.  
  2726. elseif( t < 7 ) then
  2727.  
  2728. a = 1 - ( t - 5 ) / 2;
  2729.  
  2730. end
  2731.  
  2732. local tab = { };
  2733.  
  2734. tab[ "$pp_colour_addr" ] = 0;
  2735. tab[ "$pp_colour_addg" ] = 0;
  2736. tab[ "$pp_colour_addb" ] = 0;
  2737. tab[ "$pp_colour_brightness" ] = a;
  2738. tab[ "$pp_colour_contrast" ] = 1;
  2739. tab[ "$pp_colour_colour" ] = 1;
  2740. tab[ "$pp_colour_mulr" ] = 0;
  2741. tab[ "$pp_colour_mulg" ] = 0;
  2742. tab[ "$pp_colour_mulb" ] = 0;
  2743.  
  2744. DrawColorModify( tab );
  2745.  
  2746. end
  2747.  
  2748. if( self.CombineCameraView and self.CombineCameraView:IsValid() ) then
  2749.  
  2750. DrawMaterialOverlay( "effects/combine_binocoverlay", 0 )
  2751.  
  2752. local tab = { };
  2753.  
  2754. tab[ "$pp_colour_addr" ] = 0;
  2755. tab[ "$pp_colour_addg" ] = 0;
  2756. tab[ "$pp_colour_addb" ] = 0;
  2757. tab[ "$pp_colour_brightness" ] = 0;
  2758. tab[ "$pp_colour_contrast" ] = 1;
  2759. tab[ "$pp_colour_colour" ] = 0;
  2760. tab[ "$pp_colour_mulr" ] = 0;
  2761. tab[ "$pp_colour_mulg" ] = 0;
  2762. tab[ "$pp_colour_mulb" ] = 0;
  2763.  
  2764. DrawColorModify( tab );
  2765.  
  2766. end
  2767.  
  2768. self:RenderScreenspaceDrugs();
  2769.  
  2770. end
  2771.  
  2772. function GM:PlayerStartVoice( ply )
  2773.  
  2774. if( !game.IsDedicated() ) then
  2775.  
  2776. self.BaseClass:PlayerStartVoice( ply );
  2777.  
  2778. end
  2779.  
  2780. end
  2781.  
  2782. function GM:PlayerEndVoice( ply )
  2783.  
  2784. if( !game.IsDedicated() ) then
  2785.  
  2786. self.BaseClass:PlayerEndVoice( ply );
  2787.  
  2788. end
  2789.  
  2790. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement