Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if CLIENT then
- resource.AddFile("materials/ending/cafebene.vtf")
- resource.AddFile("materials/ending/cafebene.vmt")
- resource.AddFile("materials/ending/ivyclub.vtf")
- resource.AddFile("materials/ending/ivyclub.vmt")
- resource.AddFile("materials/ending/afreecatv.vtf")
- resource.AddFile("materials/ending/afreecatv.vmt")
- resource.AddFile("materials/ending/afreecatv2.vtf")
- resource.AddFile("materials/ending/afreecatv2.vmt")
- resource.AddFile("materials/vgui/entities/ending_swep_bj.vtf")
- resource.AddFile("materials/vgui/entities/ending_swep_bj.vmt")
- SWEP.PrintName = "엔딩 건(Ending SWEP) 모든BJ용"
- SWEP.Author = "명박오니"
- SWEP.Instructions = "왼쪽:엔딩 오른쪽:라이플(데미지 셈) 총 안보이는게 정상입니다."
- SWEP.Slot = 1
- SWEP.SlotPos = 1
- SWEP.iconletter = "f"
- surface.CreateFont(
- "ProduceSupport",
- {
- font = "malgun",
- size = 30,
- weight = 1000,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = true,
- additive = false,
- outline = true
- }
- )
- end
- SWEP.Category = "Other"
- SWEP.Spawnable = true
- SWEP.AdminOnly = true
- SWEP.AdminSpawnable = true
- SWEP.ViewModel = "models/weapons/v_pistol.mdl"
- SWEP.WorldModel = "models/weapons/w_pistol.mdl"
- SWEP.ViewModelFlip = true
- SWEP.ViewModelFOV = 75.000
- SWEP.Weight = 5
- SWEP.AutoSwitchTo = false
- SWEP.AutoSwitchFrom = false
- SWEP.HoldType = "Pistol"
- SWEP.FiresUnderwater = true
- SWEP.DrawCrosshair = false
- SWEP.DrawAmmo = true
- SWEP.ReloadSound = "sound/weapons/alyxgun/alyx_gun_reload.wav"
- -- General settings 일반 설정
- CreateConVar("ending_white_enabled", "1")
- -- PrimaryFire Settings 좌클릭 정보
- SWEP.Primary.Sound = "weapons/ending/ending.wav"
- SWEP.Primary.Damage = 999999999999999
- SWEP.Primary.TakeAmmo = 1
- SWEP.Primary.ClipSize = 10
- SWEP.Primary.Ammo = "Pistol"
- SWEP.Primary.DefaultClip = 500
- SWEP.Primary.Spread = 0.1
- SWEP.Primary.NumberofShots = 1
- SWEP.Primary.Automatic = false
- SWEP.Primary.Recoil = 1
- SWEP.Primary.Delay = 2
- SWEP.Primary.Force = 9999999999999
- --SecondaryFire settings 우클릭 정보
- SWEP.Secondary.Sound = "weapons/usp/usp1.wav"
- SWEP.Secondary.Damage = 99999999999999999
- SWEP.Secondary.TakeAmmo = 1
- SWEP.Secondary.ClipSize = 45
- SWEP.Secondary.Ammo = "Pistol"
- SWEP.Secondary.DefaultClip = 500
- SWEP.Secondary.Spread = 0.1
- SWEP.Secondary.NumberofShots = 1
- SWEP.Secondary.Automatic = true
- SWEP.Secondary.Recoil = 1
- SWEP.Secondary.Delay = 0.08
- SWEP.Secondary.Force = 9999999999999999999
- --SWEP:Initialize 초기화
- function SWEP:Initialize()
- util.PrecacheSound(self.Primary.Sound)
- self:SetWeaponHoldType(self.HoldType)
- end
- --SWEP:Deploy 무기를 들었을 때
- function SWEP:Deploy()
- if SERVER then
- self:GetOwner():DrawViewModel(false)
- end
- if CLIENT then
- if game.SinglePlayer() then
- chat.AddText(Color(255,255,255), ply, "총 안보이는게 정상입니다.")
- chat.AddText(Color(255,0,0), ply, "싱글 플레이 상태입니다. 광고가 보이지 않습니다.")
- else
- chat.AddText(Color(255,255,255), ply, "총 안보이는게 정상입니다.")
- end
- end
- end
- --SWEP:PrimaryAttack 좌클릭 함수
- function SWEP:PrimaryAttack()
- if not self:CanPrimaryAttack() then return end
- --[[local owner = self:GetOwner()
- local bullet = {}
- bullet.Num = self.Primary.NumberofShots -- is this correct? (lower case "of")
- bullet.Src = owner:GetShootPos()
- bullet.Dir = owner:GetAimVector()
- bullet.Spread = Vector(1, 1, 0) * self.Primary.Spread * 0.1
- bullet.Tracer = 0
- bullet.Force = self.Primary.Force
- bullet.Damage = self.Primary.Damage
- bullet.AmmoType = self.Primary.Ammo
- owner:FireBullets(bullet)
- local recoil = self.Primary.Recoil
- owner:ViewPunch(Angle(recoil * -1, recoil * math.Rand(-1, 1), recoil * -1))
- self:TakePrimaryAmmo(self.Primary.TakeAmmo)
- self:ShootEffects()]]
- self:EmitSound(self.Primary.Sound)
- self:DoSlowMotion(true)
- self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
- end
- --SWEP:SecondaryAttack 우클릭 함수\\
- function SWEP:SecondaryAttack()
- --[[if not self:CanSecondaryAttack() then return end
- local owner = self:GetOwner()
- local bullet = {}
- bullet.Num = self.Secondary.NumberofShots
- bullet.Src = owner:GetShootPos()
- bullet.Dir = owner:GetAimVector()
- bullet.Spread = Vector(1, 1, 0) * self.Secondary.Spread * 0.1
- bullet.Tracer = 0
- bullet.Force = self.Secondary.Force
- bullet.Damage = self.Secondary.Damage
- bullet.AmmoType = self.Secondary.Ammo
- owner:FireBullets(bullet)
- self:TakeSecondaryAmmo(self.Secondary.TakeAmmo)
- self:ShootEffects()
- self:EmitSound(Sound(self.Secondary.Sound))
- self:SetNextSecondaryFire(CurTime() + self.Secondary.Delay)]]
- end
- do -- slowmotion
- local speed = 0.25 -- speed multiplier
- local pow = 2 -- This will make the sine curve shaper if you think it'S too smooth. Normal is 1
- local F, NF, W, H = 0, 0, 0, 0
- if CLIENT then
- SWEP.Textures = {}
- function SWEP:DrawTexture(name)
- self.Textures[name] = self.Textures[name] or surface.GetTextureID(name)
- surface.SetTexture(self.Textures[name])
- surface.SetDrawColor (255, 255, 255, 255)
- surface.DrawTexturedRect(W /2 - 70, H -166, 256, 85)
- end
- end
- -- time starts from 0 counts up.
- function SWEP:SlowMotionUpdate(time)
- time = time * speed
- F = math.sin(time * math.pi)
- NF = -F + 1
- if CLIENT then
- W, H = ScrW(), ScrH()
- local params = {}
- params["$pp_colour_addr"] = 0
- params["$pp_colour_addg"] = 0
- params["$pp_colour_addb"] = 0
- params["$pp_colour_brightness"] = (F ^ pow) * 0.5
- params["$pp_colour_contrast"] = 1
- params["$pp_colour_colour"] = NF
- params["$pp_colour_mulr"] = 0
- params["$pp_colour_mulg"] = 0
- params["$pp_colour_mulb"] = 0
- DrawColorModify(params)
- -- add alpha, draw alpha, delay
- DrawMotionBlur(NF + 0.25, 1, 0)
- DrawBloom(
- 0, -- darken
- 1, -- multiply
- 2, -- sizex
- 2, -- sizey
- 3, -- passes
- 0, -- color
- 0, -- red multiplier
- 0, -- green multiplier
- 0 -- blue multiplier
- )
- surface.SetFont("ProduceSupport")
- surface.SetTextPos(W /2 - 190, H -140)
- surface.SetTextColor(255, 255, 255, 255)
- surface.DrawText("제작지원")
- -- I don't know if this order is correct..
- if time < 0.25 then
- self:DrawTexture("ending/cafebene")
- elseif time < 0.5 then
- self:DrawTexture("ending/ivyclub")
- elseif time < 0.75 then
- self:DrawTexture("ending/afreecatv")
- elseif time < 0.8 then
- self:DrawTexture("ending/afreecatv2")
- end
- end
- if SERVER then
- -- setting it lower than 0.25 might cause the game to run into sync problems
- game.SetTimeScale(math.Clamp(NF, 0.25, 1))
- end
- if F < 0 then
- return false
- end
- end
- if CLIENT then
- net.Receive("cafe_slomo", function()
- local self = net.ReadEntity()
- if self:IsValid() then
- self:DoSlowMotion()
- end
- end)
- end
- if SERVER then
- util.AddNetworkString("cafe_slomo")
- end
- function SWEP:DoSlowMotion(broadcast)
- local owner = self:GetOwner()
- if broadcast and CLIENT and owner ~= LocalPlayer() then return end
- if SERVER and broadcast then
- local clients = {}
- for _, ply in pairs(player.GetAll()) do
- if ply ~= owner then
- table.insert(clients, ply)
- end
- end
- net.Start("cafe_slomo")
- net.WriteEntity(self)
- net.Send(clients)
- end
- self.slomo_start = UnPredictedCurTime()
- local name = CLIENT and "RenderScreenspaceEffects" or "Think"
- hook.Add(name, tostring(self), function()
- if
- not self:IsValid() or
- not self:GetOwner():IsValid() or
- self:GetOwner():GetActiveWeapon() ~= self or
- self:SlowMotionUpdate(UnPredictedCurTime() - self.slomo_start) == false
- then
- hook.Remove(name, tostring(self))
- self.slomo_start = nil
- end
- end)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement