Advertisement
CapsAdmin

Untitled

May 5th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.01 KB | None | 0 0
  1. if CLIENT then
  2.     resource.AddFile("materials/ending/cafebene.vtf")
  3.     resource.AddFile("materials/ending/cafebene.vmt")
  4.     resource.AddFile("materials/ending/ivyclub.vtf")
  5.     resource.AddFile("materials/ending/ivyclub.vmt")
  6.     resource.AddFile("materials/ending/afreecatv.vtf")
  7.     resource.AddFile("materials/ending/afreecatv.vmt")
  8.     resource.AddFile("materials/ending/afreecatv2.vtf")
  9.     resource.AddFile("materials/ending/afreecatv2.vmt")
  10.     resource.AddFile("materials/vgui/entities/ending_swep_bj.vtf")
  11.     resource.AddFile("materials/vgui/entities/ending_swep_bj.vmt")
  12.    
  13.     SWEP.PrintName = "엔딩 건(Ending SWEP) 모든BJ용"
  14.     SWEP.Author = "명박오니"
  15.     SWEP.Instructions = "왼쪽:엔딩 오른쪽:라이플(데미지 셈)  총 안보이는게 정상입니다."
  16.     SWEP.Slot = 1
  17.     SWEP.SlotPos = 1
  18.     SWEP.iconletter = "f"
  19.    
  20.     surface.CreateFont(
  21.         "ProduceSupport",
  22.         {
  23.             font        = "malgun",
  24.             size        = 30,
  25.             weight      = 1000,
  26.             blursize    = 0,
  27.             scanlines   = 0,
  28.             antialias   = true,
  29.             underline   = false,
  30.             italic      = false,
  31.             strikeout   = false,
  32.             symbol      = false,
  33.             rotary      = false,
  34.             shadow      = true,
  35.             additive    = false,
  36.             outline     = true
  37.         }
  38.     )
  39. end
  40.  
  41. SWEP.Category = "Other"
  42. SWEP.Spawnable = true
  43. SWEP.AdminOnly = true
  44. SWEP.AdminSpawnable = true
  45. SWEP.ViewModel = "models/weapons/v_pistol.mdl"
  46. SWEP.WorldModel = "models/weapons/w_pistol.mdl"
  47. SWEP.ViewModelFlip = true
  48. SWEP.ViewModelFOV = 75.000
  49. SWEP.Weight = 5
  50. SWEP.AutoSwitchTo = false
  51. SWEP.AutoSwitchFrom = false
  52. SWEP.HoldType = "Pistol"
  53. SWEP.FiresUnderwater = true
  54. SWEP.DrawCrosshair = false
  55. SWEP.DrawAmmo = true
  56. SWEP.ReloadSound = "sound/weapons/alyxgun/alyx_gun_reload.wav"
  57.  
  58. -- General settings 일반 설정
  59. CreateConVar("ending_white_enabled", "1")
  60.  
  61. -- PrimaryFire Settings 좌클릭 정보
  62. SWEP.Primary.Sound = "weapons/ending/ending.wav"
  63. SWEP.Primary.Damage = 999999999999999
  64. SWEP.Primary.TakeAmmo = 1
  65. SWEP.Primary.ClipSize = 10
  66. SWEP.Primary.Ammo = "Pistol"
  67. SWEP.Primary.DefaultClip = 500
  68. SWEP.Primary.Spread = 0.1
  69. SWEP.Primary.NumberofShots = 1
  70. SWEP.Primary.Automatic = false
  71. SWEP.Primary.Recoil = 1
  72. SWEP.Primary.Delay = 2
  73. SWEP.Primary.Force = 9999999999999
  74.  
  75. --SecondaryFire settings 우클릭 정보
  76. SWEP.Secondary.Sound = "weapons/usp/usp1.wav"
  77. SWEP.Secondary.Damage = 99999999999999999
  78. SWEP.Secondary.TakeAmmo = 1
  79. SWEP.Secondary.ClipSize = 45
  80. SWEP.Secondary.Ammo = "Pistol"
  81. SWEP.Secondary.DefaultClip = 500
  82. SWEP.Secondary.Spread = 0.1
  83. SWEP.Secondary.NumberofShots = 1
  84. SWEP.Secondary.Automatic = true
  85. SWEP.Secondary.Recoil = 1
  86. SWEP.Secondary.Delay = 0.08
  87. SWEP.Secondary.Force = 9999999999999999999
  88.  
  89. --SWEP:Initialize 초기화
  90. function SWEP:Initialize()
  91.     util.PrecacheSound(self.Primary.Sound)
  92.     self:SetWeaponHoldType(self.HoldType)
  93. end
  94.  
  95. --SWEP:Deploy 무기를 들었을 때
  96. function SWEP:Deploy()
  97.  
  98.     if SERVER then
  99.         self:GetOwner():DrawViewModel(false)
  100.     end
  101.    
  102.     if CLIENT then
  103.         if game.SinglePlayer() then
  104.             chat.AddText(Color(255,255,255), ply, "총 안보이는게 정상입니다.")
  105.             chat.AddText(Color(255,0,0), ply, "싱글 플레이 상태입니다. 광고가 보이지 않습니다.")
  106.         else
  107.             chat.AddText(Color(255,255,255), ply, "총 안보이는게 정상입니다.")
  108.         end
  109.     end
  110.    
  111. end
  112.  
  113. --SWEP:PrimaryAttack 좌클릭 함수
  114. function SWEP:PrimaryAttack()
  115.  
  116.     if not self:CanPrimaryAttack() then return end
  117.    
  118.     --[[local owner = self:GetOwner()
  119.    
  120.     local bullet = {}
  121.         bullet.Num = self.Primary.NumberofShots -- is this correct? (lower case "of")
  122.         bullet.Src = owner:GetShootPos()
  123.         bullet.Dir = owner:GetAimVector()
  124.         bullet.Spread = Vector(1, 1, 0) * self.Primary.Spread * 0.1
  125.         bullet.Tracer = 0
  126.         bullet.Force = self.Primary.Force
  127.         bullet.Damage = self.Primary.Damage
  128.         bullet.AmmoType = self.Primary.Ammo
  129.     owner:FireBullets(bullet)
  130.  
  131.     local recoil = self.Primary.Recoil
  132.     owner:ViewPunch(Angle(recoil * -1, recoil * math.Rand(-1, 1), recoil * -1))
  133.    
  134.     self:TakePrimaryAmmo(self.Primary.TakeAmmo)
  135.    
  136.     self:ShootEffects()]]
  137.     self:EmitSound(self.Primary.Sound)
  138.     self:DoSlowMotion(true)
  139.  
  140.     self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
  141. end
  142.  
  143. --SWEP:SecondaryAttack 우클릭 함수\\
  144. function SWEP:SecondaryAttack()
  145.     --[[if not self:CanSecondaryAttack() then return end
  146.  
  147.     local owner = self:GetOwner()
  148.    
  149.     local bullet = {}
  150.         bullet.Num = self.Secondary.NumberofShots
  151.         bullet.Src = owner:GetShootPos()
  152.         bullet.Dir = owner:GetAimVector()
  153.         bullet.Spread = Vector(1, 1, 0) * self.Secondary.Spread * 0.1
  154.         bullet.Tracer = 0
  155.         bullet.Force = self.Secondary.Force
  156.         bullet.Damage = self.Secondary.Damage
  157.         bullet.AmmoType = self.Secondary.Ammo
  158.     owner:FireBullets(bullet)
  159.    
  160.     self:TakeSecondaryAmmo(self.Secondary.TakeAmmo)
  161.    
  162.     self:ShootEffects()
  163.     self:EmitSound(Sound(self.Secondary.Sound))
  164.    
  165.     self:SetNextSecondaryFire(CurTime() + self.Secondary.Delay)]]
  166. end
  167.  
  168.  
  169. do -- slowmotion
  170.  
  171.     local speed = 0.25 -- speed multiplier
  172.     local pow = 2 -- This will make the sine curve shaper if you think it'S too smooth. Normal is 1
  173.  
  174.     local F, NF, W, H = 0, 0, 0, 0
  175.  
  176.     if CLIENT then
  177.         SWEP.Textures = {}
  178.            
  179.         function SWEP:DrawTexture(name)
  180.             self.Textures[name] = self.Textures[name] or surface.GetTextureID(name)
  181.             surface.SetTexture(self.Textures[name])
  182.             surface.SetDrawColor (255, 255, 255, 255)
  183.             surface.DrawTexturedRect(W /2 - 70, H -166, 256, 85)
  184.         end
  185.     end
  186.  
  187.     -- time starts from 0 counts up.
  188.     function SWEP:SlowMotionUpdate(time)
  189.         time = time * speed
  190.        
  191.         F = math.sin(time * math.pi)
  192.         NF = -F + 1
  193.        
  194.         if CLIENT then
  195.             W, H = ScrW(), ScrH()
  196.            
  197.             local params = {}
  198.  
  199.                 params["$pp_colour_addr"] = 0
  200.                 params["$pp_colour_addg"] = 0
  201.                 params["$pp_colour_addb"] = 0
  202.                 params["$pp_colour_brightness"] = (F ^ pow) * 0.5
  203.                 params["$pp_colour_contrast"] = 1
  204.                 params["$pp_colour_colour"] = NF
  205.                 params["$pp_colour_mulr"] = 0
  206.                 params["$pp_colour_mulg"] = 0
  207.                 params["$pp_colour_mulb"] = 0
  208.            
  209.             DrawColorModify(params)
  210.  
  211.             -- add alpha, draw alpha, delay
  212.             DrawMotionBlur(NF + 0.25, 1, 0)
  213.            
  214.             DrawBloom(
  215.                 0, -- darken
  216.                 1, -- multiply
  217.                
  218.                 2, -- sizex
  219.                 2, -- sizey
  220.                
  221.                 3, -- passes
  222.                
  223.                 0, -- color
  224.                
  225.                 0, -- red multiplier
  226.                 0, -- green multiplier
  227.                 0 -- blue multiplier
  228.                
  229.             )
  230.            
  231.             surface.SetFont("ProduceSupport")      
  232.             surface.SetTextPos(W /2 - 190, H -140)
  233.             surface.SetTextColor(255, 255, 255, 255)
  234.             surface.DrawText("제작지원")
  235.            
  236.             -- I don't know if this order is correct..
  237.                                    
  238.             if time < 0.25 then
  239.                 self:DrawTexture("ending/cafebene")
  240.             elseif time < 0.5 then
  241.                 self:DrawTexture("ending/ivyclub")
  242.             elseif time < 0.75 then
  243.                 self:DrawTexture("ending/afreecatv")
  244.             elseif time < 0.8 then 
  245.                 self:DrawTexture("ending/afreecatv2")
  246.             end
  247.         end
  248.        
  249.         if SERVER then
  250.             -- setting it lower than 0.25 might cause the game to run into sync problems
  251.             game.SetTimeScale(math.Clamp(NF, 0.25, 1))
  252.         end
  253.        
  254.         if F < 0 then
  255.             return false
  256.         end    
  257.     end
  258.  
  259.     if CLIENT then
  260.         net.Receive("cafe_slomo", function()
  261.             local self = net.ReadEntity()
  262.             if self:IsValid() then
  263.                 self:DoSlowMotion()
  264.             end
  265.         end)
  266.     end
  267.    
  268.     if SERVER then
  269.         util.AddNetworkString("cafe_slomo")
  270.     end
  271.    
  272.     function SWEP:DoSlowMotion(broadcast)
  273.    
  274.         local owner = self:GetOwner()
  275.    
  276.         if broadcast and CLIENT and owner ~= LocalPlayer() then return end
  277.    
  278.         if SERVER and broadcast then
  279.             local clients = {}
  280.            
  281.             for _, ply in pairs(player.GetAll()) do
  282.                 if ply ~= owner then
  283.                     table.insert(clients, ply)
  284.                 end
  285.             end
  286.        
  287.             net.Start("cafe_slomo")
  288.                 net.WriteEntity(self)
  289.             net.Send(clients)
  290.         end
  291.        
  292.         self.slomo_start = UnPredictedCurTime()
  293.                    
  294.         local name = CLIENT and "RenderScreenspaceEffects" or "Think"
  295.  
  296.         hook.Add(name, tostring(self), function()
  297.             if
  298.                 not self:IsValid() or
  299.                 not self:GetOwner():IsValid() or
  300.                 self:GetOwner():GetActiveWeapon() ~= self or
  301.                 self:SlowMotionUpdate(UnPredictedCurTime() - self.slomo_start) == false
  302.             then
  303.                 hook.Remove(name, tostring(self))
  304.                 self.slomo_start = nil
  305.             end
  306.         end)
  307.     end
  308. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement