mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
@@ -0,0 +1,204 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if (SERVER) then
|
||||
AddCSLuaFile("shared.lua")
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
SWEP.Slot = 1
|
||||
SWEP.SlotPos = 5
|
||||
SWEP.DrawAmmo = false
|
||||
SWEP.PrintName = "Lumière"
|
||||
SWEP.DrawCrosshair = true
|
||||
end
|
||||
|
||||
SWEP.Purpose = "Vous permet de créer une lumière verte autour de votre personnage."
|
||||
SWEP.Contact = ""
|
||||
SWEP.Author = "Adolphus"
|
||||
|
||||
SWEP.WorldModel = ""
|
||||
SWEP.HoldType = "fist"
|
||||
|
||||
SWEP.Category = "Vort Swep"
|
||||
|
||||
SWEP.Primary.DefaultClip = 0
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.Ammo = ""
|
||||
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
|
||||
SWEP.Secondary.DefaultClip = 0
|
||||
SWEP.Secondary.Automatic = false
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.Ammo = ""
|
||||
|
||||
SWEP.ViewModelFOV = 110
|
||||
SWEP.ViewModel = Model("models/willardnetworks/c_arms_vortigaunt.mdl")
|
||||
SWEP.IsAlwaysRaised = true
|
||||
SWEP.vePerUse = 1
|
||||
|
||||
if CLIENT then
|
||||
SWEP.NextAllowedPlayRateChange = 0
|
||||
end
|
||||
|
||||
function SWEP:Initialize()
|
||||
end
|
||||
|
||||
function SWEP:Deploy()
|
||||
if (!IsValid(self:GetOwner())) then
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_DRAW)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:Think()
|
||||
if (!IsValid(self:GetOwner())) then
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel) and self.NextAllowedPlayRateChange < CurTime()) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:Holster()
|
||||
if (!IsValid(self:GetOwner())) then
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_HOLSTER)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- A function to set whether the SWEP is activated.
|
||||
function SWEP:SetActivated(bActivated)
|
||||
self.Activated = bActivated
|
||||
end
|
||||
|
||||
-- A function to get whether the SWEP is activated.
|
||||
function SWEP:IsActivated()
|
||||
return self.Activated
|
||||
end
|
||||
|
||||
-- Called when the player attempts to primary fire.
|
||||
function SWEP:PrimaryAttack()
|
||||
if (SERVER) then
|
||||
local ent = ents.Create("ix_nvlight")
|
||||
|
||||
if (!self.Activated) then
|
||||
local percentage = self.vePerUse / 100
|
||||
if !self:GetOwner():HasVortalEnergy(self.vePerUse + (percentage * self:GetOwner():Armor())) then
|
||||
return
|
||||
end
|
||||
self:GetOwner():TakeVortalEnergy(self.vePerUse + (percentage * self:GetOwner():Armor()))
|
||||
self:GetOwner():EmitSound("npc/vort/health_charge.wav")
|
||||
self.Activated = true
|
||||
|
||||
ent:SetOwner(self:GetOwner())
|
||||
ent:SetParent(self:GetOwner())
|
||||
ent:SetPos(self:GetOwner():GetPos())
|
||||
ent:SetOwnerVariable(self:GetOwner())
|
||||
else
|
||||
self:GetOwner():EmitSound("npc/vort/health_charge.wav")
|
||||
self.Activated = false
|
||||
ent:RemoveLight(self:GetOwner())
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
self:SetNextPrimaryFire(CurTime() + 4)
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function SWEP:OnRemove()
|
||||
if (CLIENT or !IsValid(self:GetOwner())) then return end
|
||||
|
||||
local worldmodel = ents.FindInSphere(self:GetOwner():GetPos(), 1);
|
||||
|
||||
for _, v in pairs(worldmodel) do
|
||||
if (v:GetClass() == "ix_nvlight" and v:GetOwner() == self:GetOwner()) then
|
||||
v:Remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:PreDrawViewModel(viewModel, weapon, client)
|
||||
local hands = player_manager.TranslatePlayerHands(player_manager.TranslateToPlayerModelName(client:GetModel()))
|
||||
|
||||
if (hands and hands.model) then
|
||||
viewModel:SetModel(hands.model)
|
||||
viewModel:SetSkin(hands.skin)
|
||||
viewModel:SetBodyGroups(hands.body)
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:DoDrawCrosshair(x, y)
|
||||
surface.SetDrawColor(255, 255, 255, 66)
|
||||
surface.DrawRect(x - 2, y - 2, 4, 4)
|
||||
end
|
||||
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
SWEP.IronSightsPos = Vector(-5, -5, -55)
|
||||
SWEP.IronSightsAng = Vector(35, 15, 10)
|
||||
|
||||
function SWEP:GetViewModelPosition(EyePos, EyeAng)
|
||||
local Mul = 1.0
|
||||
|
||||
local Offset = self.IronSightsPos
|
||||
|
||||
if (self.IronSightsAng) then
|
||||
EyeAng = EyeAng * 1
|
||||
|
||||
EyeAng:RotateAroundAxis(EyeAng:Right(), self.IronSightsAng.x * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Up(), self.IronSightsAng.y * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Forward(), self.IronSightsAng.z * Mul)
|
||||
end
|
||||
|
||||
local Right = EyeAng:Right()
|
||||
local Up = EyeAng:Up()
|
||||
local Forward = EyeAng:Forward()
|
||||
|
||||
EyePos = EyePos + Offset.x * Right * Mul
|
||||
EyePos = EyePos + Offset.y * Forward * Mul
|
||||
EyePos = EyePos + Offset.z * Up * Mul
|
||||
|
||||
return EyePos, EyeAng
|
||||
end
|
||||
end
|
||||
|
||||
-- Called when the player attempts to secondary fire.
|
||||
function SWEP:SecondaryAttack() end
|
||||
@@ -0,0 +1,363 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if ( SERVER ) then
|
||||
AddCSLuaFile("shared.lua")
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
SWEP.Slot = 0
|
||||
SWEP.SlotPos = 5
|
||||
SWEP.DrawAmmo = false
|
||||
SWEP.PrintName = "Vortibeam Advanced"
|
||||
SWEP.DrawCrosshair = true
|
||||
|
||||
game.AddParticles("particles/Vortigaunt_FX.pcf")
|
||||
end
|
||||
|
||||
PrecacheParticleSystem("wn_vortigaunt_beam_colored")
|
||||
PrecacheParticleSystem("wn_vortigaunt_beam_charge_colored")
|
||||
PrecacheParticleSystem("wn_vortigaunt_hand_glow_colored")
|
||||
|
||||
SWEP.Instructions = "Primary Fire: Fire your beam."
|
||||
SWEP.Purpose = "Immediately kills the target that you fire it at."
|
||||
SWEP.Contact = ""
|
||||
SWEP.Author = "RJ"
|
||||
SWEP.Category = "Vort Swep"
|
||||
|
||||
player_manager.AddValidModel("vortigaunt_arms2", "models/willardnetworks/vortigaunt.mdl")
|
||||
player_manager.AddValidHands("vortigaunt_arms2", "models/willardnetworks/c_arms_vortigaunt.mdl", 1, "0000000")
|
||||
|
||||
SWEP.ViewModel = Model("models/willardnetworks/c_arms_vortigaunt.mdl")
|
||||
SWEP.ViewModelFOV = 110
|
||||
SWEP.WorldModel = ""
|
||||
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
|
||||
SWEP.Primary.IsAlwaysRaised = true
|
||||
SWEP.IsAlwaysRaised = true
|
||||
SWEP.HoldType = "pistol"
|
||||
|
||||
SWEP.Primary.DefaultClip = 0
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.Damage = 300
|
||||
SWEP.Primary.Delay = 3
|
||||
SWEP.Primary.Ammo = ""
|
||||
|
||||
SWEP.Secondary.DefaultClip = 0
|
||||
SWEP.Secondary.Automatic = false
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.Delay = 0
|
||||
SWEP.Secondary.Ammo = ""
|
||||
|
||||
SWEP.vePerShot = 100
|
||||
SWEP.aoeRadius = 90
|
||||
|
||||
if CLIENT then
|
||||
SWEP.NextAllowedPlayRateChange = 0
|
||||
end
|
||||
|
||||
-- Called when the SWEP is deployed.
|
||||
function SWEP:Deploy()
|
||||
self:SendWeaponAnim(ACT_VM_DRAW)
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_DRAW)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Called when the SWEP is holstered.
|
||||
function SWEP:Holster(switchingTo)
|
||||
self:SendWeaponAnim(ACT_VM_HOLSTER)
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_HOLSTER)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:PreDrawViewModel(viewModel, weapon, client)
|
||||
local hands = player_manager.TranslatePlayerHands(player_manager.TranslateToPlayerModelName(client:GetModel()))
|
||||
|
||||
if (hands and hands.model) then
|
||||
viewModel:SetModel(hands.model)
|
||||
viewModel:SetSkin(hands.skin)
|
||||
viewModel:SetBodyGroups(hands.body)
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:DoDrawCrosshair(x, y)
|
||||
surface.SetDrawColor(255, 255, 255, 66)
|
||||
surface.DrawRect(x - 2, y - 2, 4, 4)
|
||||
end
|
||||
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
SWEP.IronSightsPos = Vector(-5, -5, -55)
|
||||
SWEP.IronSightsAng = Vector(35, 15, 10)
|
||||
|
||||
function SWEP:GetViewModelPosition(EyePos, EyeAng)
|
||||
local Mul = 1.0
|
||||
|
||||
local Offset = self.IronSightsPos
|
||||
|
||||
if (self.IronSightsAng) then
|
||||
EyeAng = EyeAng * 1
|
||||
|
||||
EyeAng:RotateAroundAxis(EyeAng:Right(), self.IronSightsAng.x * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Up(), self.IronSightsAng.y * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Forward(), self.IronSightsAng.z * Mul)
|
||||
end
|
||||
|
||||
local Right = EyeAng:Right()
|
||||
local Up = EyeAng:Up()
|
||||
local Forward = EyeAng:Forward()
|
||||
|
||||
EyePos = EyePos + Offset.x * Right * Mul
|
||||
EyePos = EyePos + Offset.y * Forward * Mul
|
||||
EyePos = EyePos + Offset.z * Up * Mul
|
||||
|
||||
return EyePos, EyeAng
|
||||
end
|
||||
|
||||
function SWEP:Think()
|
||||
if (!IsValid(self:GetOwner())) then
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel) and self.NextAllowedPlayRateChange < CurTime()) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:OnRemove()
|
||||
if (SERVER) then
|
||||
if self:GetOwner() then
|
||||
if self:GetOwner().DrawViewModel then
|
||||
self:GetOwner():DrawViewModel(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (self:GetOwner().broomModel) then
|
||||
if (self:GetOwner().broomModel:IsValid()) then
|
||||
self:GetOwner().broomModel:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- Called when the SWEP is initialized.
|
||||
function SWEP:Initialize()
|
||||
self.Primary.Damage = ix.config.Get("advancedBeamDamage", 200)
|
||||
self:SetWeaponHoldType(self.HoldType)
|
||||
end
|
||||
|
||||
function SWEP:CanPrimaryAttack()
|
||||
local v = hook.Run("TFA_CanSecondaryAttack", self)
|
||||
if v ~= nil then
|
||||
return v
|
||||
end
|
||||
|
||||
if !self:GetOwner():HasVortalEnergy(self.vePerShot) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!self:GetOwner():GetCharacter():CanDoAction("vort_beam_shoot")) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!self:GetOwner():OnGround()) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- Called when the player attempts to primary fire.
|
||||
function SWEP:PrimaryAttack()
|
||||
if (self.bIsFiring or !self:CanPrimaryAttack()) then return end
|
||||
self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
|
||||
self.bIsFiring = true
|
||||
|
||||
if (CLIENT) then
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
self.IronSightsPos = Vector(-10, -5, -70)
|
||||
self.IronSightsAng = Vector(-5, 100, 10)
|
||||
end
|
||||
|
||||
self:GetOwner():SetAnimation( PLAYER_ATTACK1 )
|
||||
self:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
|
||||
|
||||
local chargeSound = CreateSound(self:GetOwner(), "npc/vort/attack_charge.wav")
|
||||
chargeSound:SetSoundLevel( 60 )
|
||||
chargeSound:Play()
|
||||
|
||||
ParticleEffectAttach("wn_vortigaunt_hand_glow_colored", PATTACH_POINT_FOLLOW, self:GetOwner(), self:GetOwner():LookupAttachment("leftclaw"))
|
||||
ParticleEffectAttach("wn_vortigaunt_hand_glow_colored", PATTACH_POINT_FOLLOW, self:GetOwner(), self:GetOwner():LookupAttachment("rightclaw"))
|
||||
util.ScreenShake( self:GetOwner():GetPos(), 8, 15, 1, 1000 )
|
||||
timer.Simple(0.6, function()
|
||||
chargeSound:Stop()
|
||||
|
||||
if (!IsValid(self)) then return end
|
||||
|
||||
if (!IsValid(self:GetOwner())) then
|
||||
self.bIsFiring = false
|
||||
return
|
||||
end
|
||||
|
||||
local v = hook.Run("TFA_CanSecondaryAttack", self)
|
||||
if v ~= nil then
|
||||
self.bIsFiring = false
|
||||
return v
|
||||
end
|
||||
self:GetOwner():EmitSound("npc/vort/attack_shoot.wav", 40)
|
||||
|
||||
local forward = self:GetOwner():EyeAngles():Forward()
|
||||
local tr = util.QuickTrace(self:GetOwner():EyePos(), (forward + VectorRand(-0.005, 0.005)) * 5000, self:GetOwner())
|
||||
|
||||
self:GetOwner():StopParticles()
|
||||
|
||||
local leftClaw = self:GetOwner():LookupAttachment("leftclaw")
|
||||
|
||||
if (leftClaw) then
|
||||
util.ParticleTracerEx(
|
||||
"wn_vortigaunt_beam_colored", self:GetOwner():GetAttachment(leftClaw).Pos, tr.HitPos, true, self:GetOwner():EntIndex(), leftClaw
|
||||
)
|
||||
end
|
||||
|
||||
local effectdata = EffectData()
|
||||
effectdata:SetOrigin( tr.HitPos + Vector(0, 0, 50) )
|
||||
util.Effect( "vortibeam_explosion", effectdata )
|
||||
|
||||
if SERVER then
|
||||
self:GetOwner():TakeVortalEnergy(self.vePerShot)
|
||||
end
|
||||
|
||||
if (SERVER) then
|
||||
local damage = self:GetOwner():GetCharacter():GetSkillScale("vort_beam") + self.Primary.Damage
|
||||
local damageInfo = DamageInfo()
|
||||
if self:GetOwner():GetNetVar("ixVortExtract") then
|
||||
damage = 999
|
||||
end
|
||||
damageInfo:SetAttacker(self:GetOwner())
|
||||
damageInfo:SetInflictor(self)
|
||||
damageInfo:SetDamage(damage)
|
||||
damageInfo:SetDamageForce(forward * damage)
|
||||
damageInfo:SetReportedPosition(leftClaw and self:GetOwner():GetAttachment(leftClaw).Pos or self:GetOwner():EyePos())
|
||||
damageInfo:SetDamagePosition(tr.HitPos)
|
||||
damageInfo:SetDamageType(DMG_SHOCK)
|
||||
for k, target in pairs(ents.FindInSphere(tr.HitPos, self.aoeRadius)) do
|
||||
if target != self:GetOwner() and
|
||||
target:IsPlayer() or
|
||||
target:IsNextBot() or
|
||||
target:IsNPC() or
|
||||
target:IsVehicle() then
|
||||
if !target:IsLineOfSightClear(tr.HitPos) then
|
||||
continue
|
||||
end
|
||||
|
||||
if (damageInfo:GetDamage() >= 1) then
|
||||
target:TakeDamageInfo(damageInfo)
|
||||
end
|
||||
|
||||
if (target:IsPlayer()) then
|
||||
hook.Run("PostCalculatePlayerDamage", target, damageInfo, HITGROUP_GENERIC)
|
||||
|
||||
ix.log.AddRaw("[VORT] ".. self:GetOwner():Name() .." has damaged " .. target:Name() .. " dealing " .. damage .. " with vortadvancedbeam")
|
||||
|
||||
ix.chat.Send(self:GetOwner(), "vortbeam", "has damaged " .. target:Name() .. ", dealing " .. damage .. " points of damage", false, attacker)
|
||||
end
|
||||
|
||||
if (target:IsNPC()) then
|
||||
ix.log.AddRaw("[VORT] ".. self:GetOwner():Name() .." has damaged " .. target:GetClass() .. ", dealing " .. damage .. " with vortadvancedbeam")
|
||||
end
|
||||
|
||||
if (target:IsNPC() or target:IsPlayer()) then
|
||||
self:GetOwner():GetCharacter():DoAction("vort_beam_shoot")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
for k, target in pairs(ents.FindInSphere(tr.HitPos, self.aoeRadius)) do
|
||||
if target != self:GetOwner() and
|
||||
target:IsPlayer() or
|
||||
target:IsNextBot() or
|
||||
target:IsNPC() or
|
||||
target:IsVehicle() then
|
||||
if !target:IsLineOfSightClear(tr.HitPos) then
|
||||
continue
|
||||
end
|
||||
|
||||
if (target:IsPlayer()) then
|
||||
--chat.AddText(Color(217, 83, 83), "You have damaged " .. target:Name() .. ", dealing " .. self:GetOwner():GetCharacter():GetSkillScale("vort_beam") + self.Primary.Damage .. " points of damage.")
|
||||
end
|
||||
|
||||
if (target:IsNPC()) then
|
||||
--chat.AddText(Color(217, 83, 83), "You have damaged " .. target:GetClass() .. ", dealing " .. self:GetOwner():GetCharacter():GetSkillScale("vort_beam") + self.Primary.Damage .. " points of damage.")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
timer.Simple(1, function()
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_DRAW)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
|
||||
self.IronSightsPos = Vector(-5, -5, -105)
|
||||
self.IronSightsAng = Vector(35, 15, 10)
|
||||
end
|
||||
end)
|
||||
|
||||
timer.Simple(2, function()
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
self.IronSightsPos = Vector(-5, -5, -55)
|
||||
end)
|
||||
|
||||
hook.Run("TFA_PostSecondaryAttack", self)
|
||||
|
||||
if (SERVER) then
|
||||
self:GetOwner():GetCharacter():DoAction("vort_beam_practice")
|
||||
end
|
||||
|
||||
self.bIsFiring = false
|
||||
end)
|
||||
hook.Run("TFA_PostSecondaryAttack", self, true)
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
return false
|
||||
end
|
||||
@@ -0,0 +1,373 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if ( SERVER ) then
|
||||
AddCSLuaFile("shared.lua")
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
SWEP.Slot = 0
|
||||
SWEP.SlotPos = 5
|
||||
SWEP.DrawAmmo = false
|
||||
SWEP.PrintName = "Attaque"
|
||||
SWEP.DrawCrosshair = true
|
||||
|
||||
game.AddParticles("particles/Vortigaunt_FX.pcf")
|
||||
end
|
||||
|
||||
PrecacheParticleSystem("vortigaunt_beam")
|
||||
PrecacheParticleSystem("vortigaunt_beam_b")
|
||||
PrecacheParticleSystem("vortigaunt_charge_token")
|
||||
|
||||
SWEP.Instructions = "Clic GAUCHE : Lance un laser."
|
||||
SWEP.Purpose = "Tue immédiatement la cible visée."
|
||||
SWEP.Contact = ""
|
||||
SWEP.Author = "RJ"
|
||||
SWEP.Category = "Vort Swep"
|
||||
|
||||
player_manager.AddValidModel("vortigaunt_arms2", "models/willardnetworks/vortigaunt.mdl")
|
||||
player_manager.AddValidHands("vortigaunt_arms2", "models/willardnetworks/c_arms_vortigaunt.mdl", 1, "0000000")
|
||||
|
||||
SWEP.ViewModel = Model("models/willardnetworks/c_arms_vortigaunt.mdl")
|
||||
SWEP.ViewModelFOV = 110
|
||||
SWEP.WorldModel = ""
|
||||
SWEP.HoldType = "pistol"
|
||||
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = true
|
||||
|
||||
SWEP.Primary.IsAlwaysRaised = true
|
||||
SWEP.IsAlwaysRaised = true
|
||||
|
||||
SWEP.Primary.DefaultClip = 0
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.Damage = 65
|
||||
SWEP.Primary.Delay = 3
|
||||
SWEP.Primary.Ammo = ""
|
||||
|
||||
SWEP.Secondary.DefaultClip = 0
|
||||
SWEP.Secondary.Automatic = false
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.Delay = 0
|
||||
SWEP.Secondary.Ammo = ""
|
||||
|
||||
SWEP.vePerShot = 5
|
||||
SWEP.aoeRadius = 75
|
||||
|
||||
if CLIENT then
|
||||
SWEP.NextAllowedPlayRateChange = 0
|
||||
end
|
||||
|
||||
-- Called when the SWEP is deployed.
|
||||
function SWEP:Deploy()
|
||||
self:SendWeaponAnim(ACT_VM_DRAW)
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_DRAW)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Called when the SWEP is holstered.
|
||||
function SWEP:Holster(switchingTo)
|
||||
self:SendWeaponAnim(ACT_VM_HOLSTER)
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_HOLSTER)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:PreDrawViewModel(viewModel, weapon, client)
|
||||
local hands = player_manager.TranslatePlayerHands(player_manager.TranslateToPlayerModelName(client:GetModel()))
|
||||
|
||||
if (hands and hands.model) then
|
||||
viewModel:SetModel(hands.model)
|
||||
viewModel:SetSkin(hands.skin)
|
||||
viewModel:SetBodyGroups(hands.body)
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:DoDrawCrosshair(x, y)
|
||||
surface.SetDrawColor(255, 255, 255, 66)
|
||||
surface.DrawRect(x - 2, y - 2, 4, 4)
|
||||
end
|
||||
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
SWEP.IronSightsPos = Vector(-5, -5, -55)
|
||||
SWEP.IronSightsAng = Vector(35, 15, 10)
|
||||
|
||||
function SWEP:GetViewModelPosition(EyePos, EyeAng)
|
||||
local Mul = 1.0
|
||||
|
||||
local Offset = self.IronSightsPos
|
||||
|
||||
if (self.IronSightsAng) then
|
||||
EyeAng = EyeAng * 1
|
||||
|
||||
EyeAng:RotateAroundAxis(EyeAng:Right(), self.IronSightsAng.x * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Up(), self.IronSightsAng.y * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Forward(), self.IronSightsAng.z * Mul)
|
||||
end
|
||||
|
||||
local Right = EyeAng:Right()
|
||||
local Up = EyeAng:Up()
|
||||
local Forward = EyeAng:Forward()
|
||||
|
||||
EyePos = EyePos + Offset.x * Right * Mul
|
||||
EyePos = EyePos + Offset.y * Forward * Mul
|
||||
EyePos = EyePos + Offset.z * Up * Mul
|
||||
|
||||
return EyePos, EyeAng
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:Think()
|
||||
if (!IsValid(self:GetOwner())) then
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel) and self.NextAllowedPlayRateChange < CurTime()) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:OnRemove()
|
||||
if (SERVER) then
|
||||
if self:GetOwner() then
|
||||
if self:GetOwner().DrawViewModel then
|
||||
self:GetOwner():DrawViewModel(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (self:GetOwner().broomModel) then
|
||||
if (self:GetOwner().broomModel:IsValid()) then
|
||||
self:GetOwner().broomModel:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- Called when the SWEP is initialized.
|
||||
function SWEP:Initialize()
|
||||
self.Primary.Damage = ix.config.Get("vortBeamAdditionalDamage", 40)
|
||||
self:SetWeaponHoldType(self.HoldType)
|
||||
end
|
||||
|
||||
function SWEP:CanPrimaryAttack()
|
||||
local v = hook.Run("TFA_CanSecondaryAttack", self)
|
||||
if v ~= nil then
|
||||
return v
|
||||
end
|
||||
|
||||
local percentage = self.vePerShot / 100
|
||||
percentage = percentage * ix.config.Get("additionalVortalEnergyDrainPerPointOfArmor", 1)
|
||||
if !self:GetOwner():HasVortalEnergy(self.vePerShot + (percentage * self:GetOwner():Armor())) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!self:GetOwner():GetCharacter():CanDoAction("vort_beam_shoot")) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!self:GetOwner():OnGround()) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- Called when the player attempts to primary fire.
|
||||
function SWEP:PrimaryAttack()
|
||||
if (self.bIsFiring or !self:CanPrimaryAttack() or self:GetOwner():IsSprinting()) then return end
|
||||
self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
|
||||
|
||||
self.bIsFiring = true
|
||||
|
||||
if (CLIENT) then
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
self.IronSightsPos = Vector(-10, -5, -70)
|
||||
self.IronSightsAng = Vector(-5, 100, 10)
|
||||
end
|
||||
|
||||
self:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
|
||||
self:GetOwner():SetAnimation( PLAYER_ATTACK1 )
|
||||
|
||||
local chargeSound = CreateSound(self:GetOwner(), "npc/vort/attack_charge.wav")
|
||||
chargeSound:SetSoundLevel( 60 )
|
||||
chargeSound:Play()
|
||||
|
||||
if (SERVER) then
|
||||
self:GetOwner():SprintDisable()
|
||||
end
|
||||
|
||||
ParticleEffectAttach("vortigaunt_charge_token", PATTACH_POINT_FOLLOW, self:GetOwner(), self:GetOwner():LookupAttachment("leftclaw"))
|
||||
ParticleEffectAttach("vortigaunt_charge_token", PATTACH_POINT_FOLLOW, self:GetOwner(), self:GetOwner():LookupAttachment("rightclaw"))
|
||||
|
||||
timer.Simple(0.6, function()
|
||||
chargeSound:Stop()
|
||||
if (SERVER) then
|
||||
self:GetOwner():SprintEnable()
|
||||
end
|
||||
|
||||
if (!IsValid(self)) then return end
|
||||
|
||||
if (!IsValid(self:GetOwner())) then
|
||||
self.bIsFiring = false
|
||||
return
|
||||
end
|
||||
|
||||
local v = hook.Run("TFA_CanSecondaryAttack", self)
|
||||
if v ~= nil then
|
||||
self.bIsFiring = false
|
||||
return v
|
||||
end
|
||||
self:GetOwner():EmitSound("npc/vort/attack_shoot.wav", 40)
|
||||
|
||||
local forward = self:GetOwner():EyeAngles():Forward()
|
||||
local tr = util.QuickTrace(self:GetOwner():EyePos(), (forward + VectorRand(-0.005, 0.005)) * 5000, self:GetOwner())
|
||||
|
||||
self:GetOwner():StopParticles()
|
||||
|
||||
local leftClaw = self:GetOwner():LookupAttachment("leftclaw")
|
||||
|
||||
if (leftClaw) then
|
||||
util.ParticleTracerEx(
|
||||
"vortigaunt_beam", self:GetOwner():GetAttachment(leftClaw).Pos, tr.HitPos, true, self:GetOwner():EntIndex(), leftClaw
|
||||
)
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
local percentage = self.vePerShot / 100
|
||||
percentage = percentage * ix.config.Get("additionalVortalEnergyDrainPerPointOfArmor", 1)
|
||||
self:GetOwner():TakeVortalEnergy(self.vePerShot + (percentage * self:GetOwner():Armor()))
|
||||
end
|
||||
|
||||
if (SERVER) then
|
||||
local damage = self:GetOwner():GetCharacter():GetSkillScale("vort_beam") + self.Primary.Damage
|
||||
local damageInfo = DamageInfo()
|
||||
if self:GetOwner():GetNetVar("ixVortExtract") then
|
||||
damage = 999
|
||||
end
|
||||
damageInfo:SetAttacker(self:GetOwner())
|
||||
damageInfo:SetInflictor(self)
|
||||
damageInfo:SetDamage(damage)
|
||||
damageInfo:SetDamageForce(forward * damage)
|
||||
damageInfo:SetReportedPosition(leftClaw and self:GetOwner():GetAttachment(leftClaw).Pos or self:GetOwner():EyePos())
|
||||
damageInfo:SetDamagePosition(tr.HitPos)
|
||||
damageInfo:SetDamageType(DMG_SHOCK)
|
||||
for k, target in pairs(ents.FindInSphere(tr.HitPos, self.aoeRadius)) do
|
||||
if target != self:GetOwner() and
|
||||
target:IsPlayer() or
|
||||
target:IsNextBot() or
|
||||
target:IsNPC() or
|
||||
target:IsVehicle() then
|
||||
if !target:IsLineOfSightClear(tr.HitPos) then
|
||||
continue
|
||||
end
|
||||
|
||||
if (damageInfo:GetDamage() >= 1) then
|
||||
target:TakeDamageInfo(damageInfo)
|
||||
end
|
||||
|
||||
if (target:IsPlayer()) then
|
||||
hook.Run("PostCalculatePlayerDamage", target, damageInfo, HITGROUP_GENERIC)
|
||||
|
||||
ix.log.AddRaw("[VORT] " .. self:GetOwner():Name() .. " has damaged " .. target:Name() .. ", dealing " .. damage .. " with vortbeam")
|
||||
end
|
||||
|
||||
if (target:IsNPC()) then
|
||||
ix.log.AddRaw("[VORT] " .. self:GetOwner():Name() .. " has damaged " .. target:GetClass() .. ", dealing " .. damage .. " with vortbeam")
|
||||
end
|
||||
|
||||
if (target:IsNPC() or target:IsPlayer()) then
|
||||
self:GetOwner():GetCharacter():DoAction("vort_beam_shoot")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
timer.Simple(1, function()
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_DRAW)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
|
||||
self.IronSightsPos = Vector(-5, -5, -105)
|
||||
self.IronSightsAng = Vector(35, 15, 10)
|
||||
end
|
||||
end)
|
||||
|
||||
timer.Simple(2, function()
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
self.IronSightsPos = Vector(-5, -5, -55)
|
||||
end)
|
||||
|
||||
hook.Run("TFA_PostSecondaryAttack", self)
|
||||
|
||||
if (SERVER) then
|
||||
self:GetOwner():GetCharacter():DoAction("vort_beam_practice")
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
for k, target in pairs(ents.FindInSphere(tr.HitPos, self.aoeRadius)) do
|
||||
if target != self:GetOwner() and
|
||||
target:IsPlayer() or
|
||||
target:IsNextBot() or
|
||||
target:IsNPC() or
|
||||
target:IsVehicle() then
|
||||
if !target:IsLineOfSightClear(tr.HitPos) then
|
||||
continue
|
||||
end
|
||||
|
||||
if (target:IsPlayer()) then
|
||||
--chat.AddText(Color(217, 83, 83), "You have damaged " .. target:Name() .. ", dealing " .. self:GetOwner():GetCharacter():GetSkillScale("vort_beam") + self.Primary.Damage .. " points of damage.")
|
||||
end
|
||||
|
||||
if (target:IsNPC()) then
|
||||
--chat.AddText(Color(217, 83, 83), "You have damaged " .. target:GetClass() .. ", dealing " .. self:GetOwner():GetCharacter():GetSkillScale("vort_beam") + self.Primary.Damage .. " points of damage.")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self.bIsFiring = false
|
||||
end)
|
||||
hook.Run("TFA_PostSecondaryAttack", self, true)
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
return false
|
||||
end
|
||||
@@ -0,0 +1,295 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if ( SERVER ) then
|
||||
AddCSLuaFile( "shared.lua" )
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
SWEP.Slot = 5
|
||||
SWEP.SlotPos = 5
|
||||
SWEP.DrawAmmo = false
|
||||
SWEP.PrintName = "Soins"
|
||||
SWEP.DrawCrosshair = true
|
||||
end
|
||||
|
||||
SWEP.Author = "Fruity"
|
||||
SWEP.Instructions = "Clic GAUCHE : Soigner un individu / Surcharger équipement"
|
||||
SWEP.Purpose = "Pour guérir les gens ou surcharger les équipements Combine."
|
||||
SWEP.Contact = ""
|
||||
|
||||
SWEP.Primary.IsAlwaysRaised = true
|
||||
SWEP.IsAlwaysRaised = true
|
||||
SWEP.Category = "Vort Swep"
|
||||
SWEP.Slot = 5
|
||||
SWEP.SlotPos = 5
|
||||
SWEP.Weight = 5
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
SWEP.ViewModel = Model("models/willardnetworks/c_arms_vortigaunt.mdl")
|
||||
SWEP.ViewModelFOV = 110
|
||||
SWEP.WorldModel = ""
|
||||
SWEP.HoldType = "smg"
|
||||
|
||||
if CLIENT then
|
||||
SWEP.NextAllowedPlayRateChange = 0
|
||||
end
|
||||
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.DefaultClip = -1
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.Ammo = "none"
|
||||
|
||||
SWEP.Secondary.ClipSize = 1
|
||||
SWEP.Secondary.DefaultClip = 1
|
||||
SWEP.Secondary.Automatic = false
|
||||
SWEP.Secondary.Ammo = "none"
|
||||
|
||||
SWEP.vePerHP = 0.5
|
||||
|
||||
function SWEP:Initialize()
|
||||
self:SetHoldType(self.HoldType)
|
||||
end
|
||||
|
||||
|
||||
function SWEP:Deploy()
|
||||
if (!IsValid(self:GetOwner())) then
|
||||
return
|
||||
end
|
||||
|
||||
if (SERVER) then
|
||||
if (!self.HealSound) then
|
||||
self.HealSound = CreateSound( self.Weapon, "npc/vort/health_charge.wav" )
|
||||
end
|
||||
end
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_DRAW)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:Think()
|
||||
if (!IsValid(self:GetOwner())) then
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel) and self.NextAllowedPlayRateChange < CurTime()) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:Holster()
|
||||
if (!IsValid(self:GetOwner())) then
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_HOLSTER)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:PreDrawViewModel(viewModel, weapon, client)
|
||||
local hands = player_manager.TranslatePlayerHands(player_manager.TranslateToPlayerModelName(client:GetModel()))
|
||||
|
||||
if (hands and hands.model) then
|
||||
viewModel:SetModel(hands.model)
|
||||
viewModel:SetSkin(hands.skin)
|
||||
viewModel:SetBodyGroups(hands.body)
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:DoDrawCrosshair(x, y)
|
||||
surface.SetDrawColor(255, 255, 255, 66)
|
||||
surface.DrawRect(x - 2, y - 2, 4, 4)
|
||||
end
|
||||
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
SWEP.IronSightsPos = Vector(-5, -5, -55)
|
||||
SWEP.IronSightsAng = Vector(35, 15, 10)
|
||||
|
||||
function SWEP:GetViewModelPosition(EyePos, EyeAng)
|
||||
local Mul = 1.0
|
||||
|
||||
local Offset = self.IronSightsPos
|
||||
|
||||
if (self.IronSightsAng) then
|
||||
EyeAng = EyeAng * 1
|
||||
|
||||
EyeAng:RotateAroundAxis(EyeAng:Right(), self.IronSightsAng.x * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Up(), self.IronSightsAng.y * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Forward(), self.IronSightsAng.z * Mul)
|
||||
end
|
||||
|
||||
local Right = EyeAng:Right()
|
||||
local Up = EyeAng:Up()
|
||||
local Forward = EyeAng:Forward()
|
||||
|
||||
EyePos = EyePos + Offset.x * Right * Mul
|
||||
EyePos = EyePos + Offset.y * Forward * Mul
|
||||
EyePos = EyePos + Offset.z * Up * Mul
|
||||
|
||||
return EyePos, EyeAng
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:DispatchEffect(EFFECTSTR)
|
||||
local pPlayer=self:GetOwner()
|
||||
if !pPlayer then return end
|
||||
local view
|
||||
if CLIENT then view=GetViewEntity() else view=pPlayer:GetViewEntity() end
|
||||
|
||||
if ( !pPlayer:IsNPC() and view:IsPlayer() ) then
|
||||
ParticleEffectAttach( EFFECTSTR, PATTACH_POINT_FOLLOW, pPlayer, pPlayer:LookupAttachment( "leftclaw" ) )
|
||||
else
|
||||
ParticleEffectAttach( EFFECTSTR, PATTACH_POINT_FOLLOW, pPlayer, pPlayer:LookupAttachment( "leftclaw" ) )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function SWEP:PrimaryAttack()
|
||||
if (!self:GetOwner():Alive()) then return false end
|
||||
if (!self:GetOwner():GetCharacter():IsVortigaunt()) then return false end
|
||||
|
||||
if (!self:GetOwner():GetCharacter():CanDoAction("vort_channel")) then return false end
|
||||
|
||||
local eye = self:GetOwner():GetEyeTrace()
|
||||
if (!eye.Entity:IsPlayer()) and (eye.Entity:GetClass() != "prop_ragdoll" and eye.Entity:GetClass() != "ix_combinelock" and eye.Entity:GetClass() != "ix_combinelock_cmru" and eye.Entity:GetClass() != "ix_combinelock_cwu" and eye.Entity:GetClass() != "ix_combinelock_dob" and eye.Entity:GetClass() != "ix_combinelock_moe") then return end
|
||||
if (eye.Entity:GetClass() == "prop_ragdoll" and !eye.Entity.ixPlayer) then return end
|
||||
|
||||
local target = eye.Entity
|
||||
if (!IsValid(target)) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (self:GetOwner():Health() <= 50) then
|
||||
if (SERVER) then
|
||||
self:GetOwner():NotifyLocalized("Tu es trop faible pour canaliser ton énergie!")
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if (IsValid(target.ixPlayer)) then
|
||||
target = target.ixPlayer
|
||||
end
|
||||
|
||||
if (target:GetPos():DistToSqr(self:GetOwner():GetShootPos()) > 105 * 105) then return end
|
||||
|
||||
if (target:IsPlayer()) then
|
||||
if (target:Health() >= target:GetMaxHealth()) then
|
||||
if (SERVER) then
|
||||
self:GetOwner():NotifyLocalized("La cible est en parfaite santé!")
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if (target:GetCharacter() and target:GetCharacter():GetBleedout()) then
|
||||
if target:GetCharacter().SetBleedout then
|
||||
target:GetCharacter():SetBleedout(-1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self:SetNextPrimaryFire( 10 )
|
||||
self:SendWeaponAnim( ACT_VM_SECONDARYATTACK )
|
||||
|
||||
if (CLIENT) then
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
self.IronSightsPos = Vector(0, -5, -55)
|
||||
self.IronSightsAng = Vector(35, 15, 10)
|
||||
end
|
||||
local healAmount = self:GetOwner():GetCharacter():GetSkillScale("vort_heal_amount")
|
||||
local veToApply = healAmount * self.vePerHP
|
||||
local percentage = self.vePerHP / 100
|
||||
percentage = percentage * ix.config.Get("additionalVortalEnergyDrainPerPointOfArmor", 1)
|
||||
percentage = healAmount * percentage
|
||||
|
||||
if !self:GetOwner():HasVortalEnergy(veToApply + (percentage * self:GetOwner():Armor())) then
|
||||
self:GetOwner():NotifyLocalized("You don't have enough vortal energy!")
|
||||
return
|
||||
end
|
||||
if (SERVER) then
|
||||
self:GetOwner():ForceSequence("heal_start", function()
|
||||
self:DispatchEffect("vortigaunt_charge_token")
|
||||
self:GetOwner():EmitSound( "npc/vort/health_charge.wav", 100, 150, 1, CHAN_AUTO )
|
||||
self:SendWeaponAnim( ACT_VM_RELOAD )
|
||||
self:GetOwner():ForceSequence("heal_cycle", function()
|
||||
if (!self:GetOwner():Alive()) then return end
|
||||
if (target:GetPos():DistToSqr(self:GetOwner():GetShootPos()) <= 105 * 105) then
|
||||
if (target:IsPlayer()) then
|
||||
self:GetOwner():TakeVortalEnergy(veToApply + (percentage * self:GetOwner():Armor()))
|
||||
target:SetHealth(math.Clamp(target:Health() + healAmount, 0, target:GetMaxHealth()))
|
||||
|
||||
ix.log.AddRaw("[VORT] ".. self:GetOwner():Name() .." has healed " .. target:Name())
|
||||
else
|
||||
ix.combineNotify:AddNotification("LOG:// Bio-restricteur " .. (target:GetLocked() and "débloqué" or "bloqué") .. " par %ERREUR%", nil, self:GetOwner())
|
||||
|
||||
target:SetLocked(!target:GetLocked())
|
||||
|
||||
self:GetOwner():GetCharacter():DoAction("vort_channel")
|
||||
end
|
||||
else
|
||||
self:GetOwner():StopSound("npc/vort/health_charge.wav")
|
||||
end
|
||||
|
||||
self:GetOwner():StopParticles()
|
||||
self:SendWeaponAnim( ACT_VM_PULLBACK )
|
||||
self:GetOwner():ForceSequence("heal_end", function()
|
||||
self:SetNextPrimaryFire( 0 )
|
||||
self:GetOwner():StopSound("npc/vort/health_charge.wav")
|
||||
self:GetOwner():Freeze(false)
|
||||
|
||||
self:GetOwner().lastVortHeal = CurTime() + 30
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_DRAW)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
self:GetOwner():Freeze(true)
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
timer.Simple(8, function()
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
self.IronSightsPos = Vector(-5, -5, -55)
|
||||
self.IronSightsAng = Vector(35, 15, 10)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
return false
|
||||
end
|
||||
@@ -0,0 +1,347 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if ( SERVER ) then
|
||||
AddCSLuaFile("shared.lua")
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
SWEP.Slot = 0
|
||||
SWEP.SlotPos = 5
|
||||
SWEP.DrawAmmo = false
|
||||
SWEP.PrintName = "Vortipyro"
|
||||
SWEP.DrawCrosshair = true
|
||||
|
||||
game.AddParticles("particles/Vortigaunt_FX.pcf")
|
||||
end
|
||||
|
||||
PrecacheParticleSystem("vortigaunt_beam")
|
||||
PrecacheParticleSystem("vortigaunt_beam_b")
|
||||
PrecacheParticleSystem("vortigaunt_charge_token")
|
||||
|
||||
SWEP.Instructions = "Primary Fire: Let them burn."
|
||||
SWEP.Purpose = "Immediately kills the target that you fire it at."
|
||||
SWEP.Contact = ""
|
||||
SWEP.Author = "RJ"
|
||||
SWEP.Category = "Vort Swep"
|
||||
|
||||
player_manager.AddValidModel("vortigaunt_arms2", "models/willardnetworks/vortigaunt.mdl")
|
||||
player_manager.AddValidHands("vortigaunt_arms2", "models/willardnetworks/c_arms_vortigaunt.mdl", 1, "0000000")
|
||||
|
||||
SWEP.ViewModel = Model("models/willardnetworks/c_arms_vortigaunt.mdl")
|
||||
SWEP.ViewModelFOV = 110
|
||||
SWEP.WorldModel = ""
|
||||
SWEP.HoldType = "pistol"
|
||||
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
|
||||
SWEP.Primary.IsAlwaysRaised = true
|
||||
SWEP.IsAlwaysRaised = true
|
||||
|
||||
SWEP.Primary.DefaultClip = 0
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.Damage = 15
|
||||
SWEP.Primary.Delay = 3
|
||||
SWEP.Primary.Ammo = ""
|
||||
|
||||
SWEP.Secondary.DefaultClip = 0
|
||||
SWEP.Secondary.Automatic = false
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.Delay = 0
|
||||
SWEP.Secondary.Ammo = ""
|
||||
|
||||
SWEP.vePerShot = 40
|
||||
SWEP.aoeRadius = 320
|
||||
|
||||
if CLIENT then
|
||||
SWEP.NextAllowedPlayRateChange = 0
|
||||
end
|
||||
|
||||
-- Called when the SWEP is deployed.
|
||||
function SWEP:Deploy()
|
||||
self:SendWeaponAnim(ACT_VM_DRAW)
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_DRAW)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Called when the SWEP is holstered.
|
||||
function SWEP:Holster(switchingTo)
|
||||
self:SendWeaponAnim(ACT_VM_HOLSTER)
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_HOLSTER)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:PreDrawViewModel(viewModel, weapon, client)
|
||||
local hands = player_manager.TranslatePlayerHands(player_manager.TranslateToPlayerModelName(client:GetModel()))
|
||||
|
||||
if (hands and hands.model) then
|
||||
viewModel:SetModel(hands.model)
|
||||
viewModel:SetSkin(hands.skin)
|
||||
viewModel:SetBodyGroups(hands.body)
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:DoDrawCrosshair(x, y)
|
||||
surface.SetDrawColor(255, 255, 255, 66)
|
||||
surface.DrawRect(x - 2, y - 2, 4, 4)
|
||||
end
|
||||
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
SWEP.IronSightsPos = Vector(-5, -5, -55)
|
||||
SWEP.IronSightsAng = Vector(35, 15, 10)
|
||||
|
||||
function SWEP:GetViewModelPosition(EyePos, EyeAng)
|
||||
local Mul = 1.0
|
||||
|
||||
local Offset = self.IronSightsPos
|
||||
|
||||
if (self.IronSightsAng) then
|
||||
EyeAng = EyeAng * 1
|
||||
|
||||
EyeAng:RotateAroundAxis(EyeAng:Right(), self.IronSightsAng.x * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Up(), self.IronSightsAng.y * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Forward(), self.IronSightsAng.z * Mul)
|
||||
end
|
||||
|
||||
local Right = EyeAng:Right()
|
||||
local Up = EyeAng:Up()
|
||||
local Forward = EyeAng:Forward()
|
||||
|
||||
EyePos = EyePos + Offset.x * Right * Mul
|
||||
EyePos = EyePos + Offset.y * Forward * Mul
|
||||
EyePos = EyePos + Offset.z * Up * Mul
|
||||
|
||||
return EyePos, EyeAng
|
||||
end
|
||||
|
||||
function SWEP:Think()
|
||||
if (!IsValid(self:GetOwner())) then
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel) and self.NextAllowedPlayRateChange < CurTime()) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:OnRemove()
|
||||
if (SERVER) then
|
||||
if self:GetOwner() then
|
||||
if self:GetOwner().DrawViewModel then
|
||||
self:GetOwner():DrawViewModel(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (self:GetOwner().broomModel) then
|
||||
if (self:GetOwner().broomModel:IsValid()) then
|
||||
self:GetOwner().broomModel:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- Called when the SWEP is initialized.
|
||||
function SWEP:Initialize()
|
||||
self:SetWeaponHoldType(self.HoldType)
|
||||
end
|
||||
|
||||
function SWEP:CanPrimaryAttack()
|
||||
local v = hook.Run("TFA_CanSecondaryAttack", self)
|
||||
if v ~= nil then
|
||||
return v
|
||||
end
|
||||
|
||||
local percentage = self.vePerShot / 100
|
||||
|
||||
if !self:GetOwner():HasVortalEnergy(self.vePerShot + (percentage * self:GetOwner():Armor())) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!self:GetOwner():GetCharacter():CanDoAction("vort_beam_shoot")) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!self:GetOwner():OnGround()) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- Called when the player attempts to primary fire.
|
||||
function SWEP:PrimaryAttack()
|
||||
self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
|
||||
|
||||
if (self.bIsFiring or !self:CanPrimaryAttack()) then return end
|
||||
self.bIsFiring = true
|
||||
|
||||
ParticleEffectAttach("vort_meditation", PATTACH_ABSORIGIN_FOLLOW, self:GetOwner(), 0)
|
||||
ParticleEffectAttach("vort_shield_parent", PATTACH_ABSORIGIN_FOLLOW, self:GetOwner(), 0)
|
||||
|
||||
if SERVER then
|
||||
local owner = self:GetOwner()
|
||||
owner:SetVelocity(-owner:GetVelocity())
|
||||
owner:SetRunSpeed(1)
|
||||
owner:SetWalkSpeed(1)
|
||||
owner:SetJumpPower(1)
|
||||
|
||||
timer.Simple(0.1, function()
|
||||
if !IsValid(owner) then return end
|
||||
owner:ForceSequence("Stomp", function()
|
||||
owner:SetRunSpeed(ix.config.Get("runSpeed") * 1.25)
|
||||
owner:SetWalkSpeed(ix.config.Get("walkSpeed"))
|
||||
owner:SetJumpPower(250)
|
||||
end, nil, true)
|
||||
end)
|
||||
end
|
||||
timer.Simple(0.2, function()
|
||||
if !IsValid(self:GetOwner()) then return end
|
||||
ParticleEffectAttach("vortigaunt_charge_token", PATTACH_POINT_FOLLOW, self:GetOwner(), 12)
|
||||
end)
|
||||
local chargeSound = CreateSound(self:GetOwner(), "npc/vort/attack_charge.wav")
|
||||
chargeSound:SetSoundLevel( 90 )
|
||||
chargeSound:Play()
|
||||
|
||||
timer.Simple(1, function()
|
||||
chargeSound:Stop()
|
||||
if (!IsValid(self)) then return end
|
||||
|
||||
if (!IsValid(self:GetOwner()) or !self:GetOwner():Alive()) then
|
||||
self.bIsFiring = false
|
||||
return
|
||||
end
|
||||
|
||||
local v = hook.Run("TFA_CanSecondaryAttack", self)
|
||||
if v ~= nil then
|
||||
self.bIsFiring = false
|
||||
return v
|
||||
end
|
||||
|
||||
local effectdata = EffectData()
|
||||
effectdata:SetOrigin( self:GetOwner():GetPos() )
|
||||
util.Effect( "vortipyro_explosion", effectdata )
|
||||
self:GetOwner():EmitSound("npc/vort/attack_shoot.wav", 40, 90)
|
||||
|
||||
local forward = self:GetOwner():EyeAngles():Forward()
|
||||
|
||||
self:GetOwner():StopParticles()
|
||||
|
||||
if SERVER then
|
||||
local percentage = self.vePerShot / 100
|
||||
percentage = percentage * ix.config.Get("additionalVortalEnergyDrainPerPointOfArmor", 1)
|
||||
self:GetOwner():TakeVortalEnergy(self.vePerShot + (percentage * self:GetOwner():Armor()))
|
||||
end
|
||||
|
||||
if (SERVER) then
|
||||
local damage = self.Primary.Damage
|
||||
local damageInfo = DamageInfo()
|
||||
damageInfo:SetAttacker(self:GetOwner())
|
||||
damageInfo:SetInflictor(self)
|
||||
damageInfo:SetDamage(damage)
|
||||
damageInfo:SetDamageForce(forward * damage)
|
||||
damageInfo:SetReportedPosition(self:GetOwner():GetPos())
|
||||
damageInfo:SetDamagePosition(self:GetOwner():GetPos())
|
||||
damageInfo:SetDamageType(DMG_BURN)
|
||||
for k, target in pairs(ents.FindInSphere(self:GetOwner():GetPos(), self.aoeRadius)) do
|
||||
if target != self:GetOwner() and
|
||||
target:IsPlayer() or
|
||||
target:IsNextBot() or
|
||||
target:IsNPC() or
|
||||
target:IsVehicle() then
|
||||
if !self:GetOwner():IsLineOfSightClear(target) then
|
||||
continue
|
||||
end
|
||||
target:Ignite(12)
|
||||
|
||||
if (damageInfo:GetDamage() >= 1) then
|
||||
target:TakeDamageInfo(damageInfo)
|
||||
end
|
||||
|
||||
if (target:IsPlayer()) then
|
||||
hook.Run("PostCalculatePlayerDamage", target, damageInfo, HITGROUP_GENERIC)
|
||||
|
||||
ix.log.AddRaw("[VORT] ".. self:GetOwner():Name() .." has damaged " .. target:Name() .. " dealing " .. damage .. " with vortpyro")
|
||||
|
||||
ix.chat.Send(self:GetOwner(), "vortbeam", "has damaged " .. target:Name() .. ", dealing " .. damage .. " points of damage", false, attacker)
|
||||
end
|
||||
|
||||
if (target:IsNPC()) then
|
||||
ix.log.AddRaw("[VORT] ".. self:GetOwner():Name() .." has damaged " .. target:GetClass() .. ", dealing " .. damage .. " with vortpyro")
|
||||
end
|
||||
|
||||
if (target:IsNPC() or target:IsPlayer()) then
|
||||
self:GetOwner():GetCharacter():DoAction("vort_beam_shoot")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
for k, target in pairs(ents.FindInSphere(self:GetOwner():GetPos(), self.aoeRadius)) do
|
||||
if target != self:GetOwner() and
|
||||
target:IsPlayer() or
|
||||
target:IsNextBot() or
|
||||
target:IsNPC() or
|
||||
target:IsVehicle() then
|
||||
if !self:GetOwner():IsLineOfSightClear(target) then
|
||||
continue
|
||||
end
|
||||
|
||||
if (target:IsPlayer()) then
|
||||
--chat.AddText(Color(217, 83, 83), "You have damaged " .. target:Name() .. ", dealing " .. self.Primary.Damage .. " points of damage.")
|
||||
end
|
||||
|
||||
if (target:IsNPC()) then
|
||||
--chat.AddText(Color(217, 83, 83), "You have damaged " .. target:GetClass() .. ", dealing " .. self.Primary.Damage .. " points of damage.")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hook.Run("TFA_PostSecondaryAttack", self)
|
||||
|
||||
if (SERVER) then
|
||||
self:GetOwner():GetCharacter():DoAction("vort_beam_practice")
|
||||
end
|
||||
|
||||
self.bIsFiring = false
|
||||
end)
|
||||
hook.Run("TFA_PostSecondaryAttack", self, true)
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
return false
|
||||
end
|
||||
@@ -0,0 +1,346 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if ( SERVER ) then
|
||||
AddCSLuaFile("shared.lua")
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
SWEP.Slot = 0
|
||||
SWEP.SlotPos = 5
|
||||
SWEP.DrawAmmo = false
|
||||
SWEP.PrintName = "Vortislam"
|
||||
SWEP.DrawCrosshair = true
|
||||
|
||||
game.AddParticles("particles/Vortigaunt_FX.pcf")
|
||||
end
|
||||
|
||||
PrecacheParticleSystem("vortigaunt_beam")
|
||||
PrecacheParticleSystem("vortigaunt_beam_b")
|
||||
PrecacheParticleSystem("vortigaunt_charge_token")
|
||||
|
||||
SWEP.Instructions = "Primary Fire: Breaks the surface."
|
||||
SWEP.Purpose = "Immediately kills the target that you fire it at."
|
||||
SWEP.Contact = ""
|
||||
SWEP.Author = "RJ"
|
||||
SWEP.Category = "Vort Swep"
|
||||
|
||||
player_manager.AddValidModel("vortigaunt_arms2", "models/willardnetworks/vortigaunt.mdl")
|
||||
player_manager.AddValidHands("vortigaunt_arms2", "models/willardnetworks/c_arms_vortigaunt.mdl", 1, "0000000")
|
||||
|
||||
SWEP.ViewModel = Model("models/willardnetworks/c_arms_vortigaunt.mdl")
|
||||
SWEP.ViewModelFOV = 110
|
||||
SWEP.WorldModel = ""
|
||||
SWEP.HoldType = "pistol"
|
||||
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
|
||||
SWEP.Primary.IsAlwaysRaised = true
|
||||
SWEP.IsAlwaysRaised = true
|
||||
|
||||
SWEP.Primary.DefaultClip = 0
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.Damage = 40
|
||||
SWEP.Primary.Delay = 3
|
||||
SWEP.Primary.Ammo = ""
|
||||
|
||||
SWEP.Secondary.DefaultClip = 0
|
||||
SWEP.Secondary.Automatic = false
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.Delay = 0
|
||||
SWEP.Secondary.Ammo = ""
|
||||
|
||||
SWEP.vePerShot = 10
|
||||
SWEP.aoeRadius = 350
|
||||
|
||||
if CLIENT then
|
||||
SWEP.NextAllowedPlayRateChange = 0
|
||||
end
|
||||
|
||||
-- Called when the SWEP is deployed.
|
||||
function SWEP:Deploy()
|
||||
self:SendWeaponAnim(ACT_VM_DRAW)
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_DRAW)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Called when the SWEP is holstered.
|
||||
function SWEP:Holster(switchingTo)
|
||||
self:SendWeaponAnim(ACT_VM_HOLSTER)
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_HOLSTER)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:PreDrawViewModel(viewModel, weapon, client)
|
||||
local hands = player_manager.TranslatePlayerHands(player_manager.TranslateToPlayerModelName(client:GetModel()))
|
||||
|
||||
if (hands and hands.model) then
|
||||
viewModel:SetModel(hands.model)
|
||||
viewModel:SetSkin(hands.skin)
|
||||
viewModel:SetBodyGroups(hands.body)
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:DoDrawCrosshair(x, y)
|
||||
surface.SetDrawColor(255, 255, 255, 66)
|
||||
surface.DrawRect(x - 2, y - 2, 4, 4)
|
||||
end
|
||||
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
SWEP.IronSightsPos = Vector(-5, -5, -55)
|
||||
SWEP.IronSightsAng = Vector(35, 15, 10)
|
||||
|
||||
function SWEP:GetViewModelPosition(EyePos, EyeAng)
|
||||
local Mul = 1.0
|
||||
|
||||
local Offset = self.IronSightsPos
|
||||
|
||||
if (self.IronSightsAng) then
|
||||
EyeAng = EyeAng * 1
|
||||
|
||||
EyeAng:RotateAroundAxis(EyeAng:Right(), self.IronSightsAng.x * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Up(), self.IronSightsAng.y * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Forward(), self.IronSightsAng.z * Mul)
|
||||
end
|
||||
|
||||
local Right = EyeAng:Right()
|
||||
local Up = EyeAng:Up()
|
||||
local Forward = EyeAng:Forward()
|
||||
|
||||
EyePos = EyePos + Offset.x * Right * Mul
|
||||
EyePos = EyePos + Offset.y * Forward * Mul
|
||||
EyePos = EyePos + Offset.z * Up * Mul
|
||||
|
||||
return EyePos, EyeAng
|
||||
end
|
||||
|
||||
function SWEP:Think()
|
||||
if (!IsValid(self:GetOwner())) then
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = self:GetOwner():GetViewModel()
|
||||
|
||||
if (IsValid(viewModel) and self.NextAllowedPlayRateChange < CurTime()) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:OnRemove()
|
||||
if (SERVER) then
|
||||
if self:GetOwner() then
|
||||
if self:GetOwner().DrawViewModel then
|
||||
self:GetOwner():DrawViewModel(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (self:GetOwner().broomModel) then
|
||||
if (self:GetOwner().broomModel:IsValid()) then
|
||||
self:GetOwner().broomModel:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- Called when the SWEP is initialized.
|
||||
function SWEP:Initialize()
|
||||
self.Primary.Damage = ix.config.Get("vortSlamBaseDamage", 40)
|
||||
self:SetWeaponHoldType(self.HoldType)
|
||||
end
|
||||
|
||||
function SWEP:CanPrimaryAttack()
|
||||
local v = hook.Run("TFA_CanSecondaryAttack", self)
|
||||
if v ~= nil then
|
||||
return v
|
||||
end
|
||||
|
||||
local percentage = self.vePerShot / 100
|
||||
percentage = percentage * ix.config.Get("additionalVortalEnergyDrainPerPointOfArmor", 1)
|
||||
|
||||
if !self:GetOwner():HasVortalEnergy(self.vePerShot + (percentage * self:GetOwner():Armor())) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!self:GetOwner():GetCharacter():CanDoAction("vort_beam_shoot")) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (!self:GetOwner():OnGround()) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- Called when the player attempts to primary fire.
|
||||
function SWEP:PrimaryAttack()
|
||||
self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
|
||||
|
||||
if (self.bIsFiring or !self:CanPrimaryAttack()) then return end
|
||||
self.bIsFiring = true
|
||||
|
||||
ParticleEffectAttach("vortigaunt_charge_token", PATTACH_POINT_FOLLOW, self:GetOwner(), self:GetOwner():LookupAttachment("leftclaw"))
|
||||
ParticleEffectAttach("vortigaunt_charge_token", PATTACH_POINT_FOLLOW, self:GetOwner(), self:GetOwner():LookupAttachment("rightclaw"))
|
||||
ParticleEffectAttach("vort_meditation", PATTACH_ABSORIGIN_FOLLOW, self:GetOwner(), 0)
|
||||
ParticleEffectAttach("vort_shield_parent", PATTACH_ABSORIGIN_FOLLOW, self:GetOwner(), 0)
|
||||
|
||||
if SERVER then
|
||||
local owner = self:GetOwner()
|
||||
owner:SetVelocity(-owner:GetVelocity())
|
||||
owner:SetRunSpeed(1)
|
||||
owner:SetWalkSpeed(1)
|
||||
owner:SetJumpPower(1)
|
||||
|
||||
timer.Simple(0.1, function()
|
||||
if !IsValid(owner) then return end
|
||||
owner:ForceSequence("Dispel", function()
|
||||
owner:SetRunSpeed(ix.config.Get("runSpeed") * 1.25)
|
||||
owner:SetWalkSpeed(ix.config.Get("walkSpeed"))
|
||||
owner:SetJumpPower(250)
|
||||
end, nil, true)
|
||||
end)
|
||||
end
|
||||
|
||||
timer.Simple(0.5, function()
|
||||
if !IsValid(self) or !IsValid(self:GetOwner()) then return end
|
||||
self:GetOwner():EmitSound("wn/vortigaunts/vort_dispell.wav", 95)
|
||||
end)
|
||||
|
||||
timer.Simple(2, function()
|
||||
if (!IsValid(self)) then return end
|
||||
|
||||
if (!IsValid(self:GetOwner()) or !self:GetOwner():Alive()) then
|
||||
self.bIsFiring = false
|
||||
return
|
||||
end
|
||||
|
||||
local v = hook.Run("TFA_CanSecondaryAttack", self)
|
||||
if v ~= nil then
|
||||
self.bIsFiring = false
|
||||
return v
|
||||
end
|
||||
|
||||
local effectdata = EffectData()
|
||||
effectdata:SetOrigin( self:GetOwner():GetPos() )
|
||||
util.Effect( "vortislam_impact", effectdata )
|
||||
|
||||
local forward = self:GetOwner():EyeAngles():Forward()
|
||||
self:GetOwner():StopParticles()
|
||||
|
||||
if SERVER then
|
||||
local percentage = self.vePerShot / 100
|
||||
percentage = percentage * ix.config.Get("additionalVortalEnergyDrainPerPointOfArmor", 1)
|
||||
self:GetOwner():TakeVortalEnergy(self.vePerShot + (percentage * self:GetOwner():Armor()))
|
||||
end
|
||||
|
||||
if (SERVER) then
|
||||
local damage = self.Primary.Damage
|
||||
if self:GetOwner():GetNetVar("ixVortExtract") then
|
||||
damage = 999
|
||||
end
|
||||
local damageInfo = DamageInfo()
|
||||
damageInfo:SetAttacker(self:GetOwner())
|
||||
damageInfo:SetInflictor(self)
|
||||
damageInfo:SetDamage(damage)
|
||||
damageInfo:SetDamageForce(forward * damage)
|
||||
damageInfo:SetReportedPosition(self:GetOwner():GetPos())
|
||||
damageInfo:SetDamagePosition(self:GetOwner():GetPos())
|
||||
damageInfo:SetDamageType(DMG_SHOCK)
|
||||
for k, target in pairs(ents.FindInSphere(self:GetOwner():GetPos(), self.aoeRadius)) do
|
||||
if target != self:GetOwner() and
|
||||
target:IsPlayer() or
|
||||
target:IsNextBot() or
|
||||
target:IsNPC() or
|
||||
target:IsVehicle() then
|
||||
if !self:GetOwner():IsLineOfSightClear(target) then
|
||||
continue
|
||||
end
|
||||
|
||||
if (damageInfo:GetDamage() >= 1) then
|
||||
target:TakeDamageInfo(damageInfo)
|
||||
end
|
||||
|
||||
if (target:IsPlayer()) then
|
||||
hook.Run("PostCalculatePlayerDamage", target, damageInfo, HITGROUP_GENERIC)
|
||||
|
||||
ix.log.AddRaw("[VORT] ".. self:GetOwner():Name() .." has damaged " .. target:Name() .. " dealing " .. damage .. " with vortslam")
|
||||
end
|
||||
|
||||
if (target:IsNPC()) then
|
||||
ix.log.AddRaw("[VORT] ".. self:GetOwner():Name() .." has damaged " .. target:GetClass() .. ", dealing " .. damage .. " with vortslam")
|
||||
end
|
||||
|
||||
if (target:IsNPC() or target:IsPlayer()) then
|
||||
self:GetOwner():GetCharacter():DoAction("vort_beam_shoot")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
for k, target in pairs(ents.FindInSphere(self:GetOwner():GetPos(), self.aoeRadius)) do
|
||||
if target != self:GetOwner() and
|
||||
target:IsPlayer() or
|
||||
target:IsNextBot() or
|
||||
target:IsNPC() or
|
||||
target:IsVehicle() then
|
||||
if !self:GetOwner():IsLineOfSightClear(target) then
|
||||
continue
|
||||
end
|
||||
|
||||
if (target:IsPlayer()) then
|
||||
--chat.AddText(Color(217, 83, 83), "You have damaged " .. target:Name() .. ", dealing " .. self.Primary.Damage .. " points of damage.")
|
||||
end
|
||||
|
||||
if (target:IsNPC()) then
|
||||
--chat.AddText(Color(217, 83, 83), "You have damaged " .. target:GetClass() .. ", dealing " .. self.Primary.Damage .. " points of damage.")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hook.Run("TFA_PostSecondaryAttack", self)
|
||||
|
||||
if (SERVER) then
|
||||
self:GetOwner():GetCharacter():DoAction("vort_beam_practice")
|
||||
end
|
||||
|
||||
self.bIsFiring = false
|
||||
end)
|
||||
hook.Run("TFA_PostSecondaryAttack", self, true)
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
return false
|
||||
end
|
||||
@@ -0,0 +1,207 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if ( SERVER ) then
|
||||
AddCSLuaFile( "shared.lua" )
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
SWEP.Slot = 3
|
||||
SWEP.SlotPos = 5
|
||||
SWEP.DrawAmmo = false
|
||||
SWEP.PrintName = "Balais"
|
||||
SWEP.DrawCrosshair = true
|
||||
end
|
||||
|
||||
SWEP.Author = "JohnyReaper"
|
||||
SWEP.Instructions = "Clic GAUCHE : Balayer"
|
||||
SWEP.Purpose = "Balayer la saleté et les ordures."
|
||||
SWEP.Contact = ""
|
||||
|
||||
SWEP.Category = "Vort Swep"
|
||||
SWEP.Slot = 3
|
||||
SWEP.SlotPos = 5
|
||||
SWEP.Weight = 5
|
||||
SWEP.IsAlwaysRaised = true
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
SWEP.HoldType = "shotgun"
|
||||
SWEP.WorldModel = ""
|
||||
SWEP.ViewModel = Model("models/willardnetworks/c_arms_vortigaunt.mdl")
|
||||
SWEP.ViewModelFOV = 110
|
||||
|
||||
if CLIENT then
|
||||
SWEP.NextAllowedPlayRateChange = 0
|
||||
end
|
||||
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.DefaultClip = -1
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.Ammo = "none"
|
||||
|
||||
SWEP.Secondary.ClipSize = 1
|
||||
SWEP.Secondary.DefaultClip = 1
|
||||
SWEP.Secondary.Automatic = false
|
||||
SWEP.Secondary.Ammo = "none"
|
||||
|
||||
function SWEP:Initialize()
|
||||
self:SetHoldType(self.HoldType)
|
||||
end
|
||||
|
||||
function SWEP:Deploy()
|
||||
if (!IsValid(self.Owner)) then
|
||||
return
|
||||
end
|
||||
|
||||
if (SERVER) then
|
||||
if (!self.Owner:Alive()) then return false end
|
||||
if (!self.Owner:GetCharacter():IsVortigaunt()) then return false end
|
||||
|
||||
|
||||
self.Owner.broomModel = ents.Create("prop_dynamic")
|
||||
self.Owner.broomModel:SetModel("models/props_c17/pushbroom.mdl")
|
||||
self.Owner.broomModel:SetMoveType(MOVETYPE_NONE)
|
||||
self.Owner.broomModel:SetSolid(SOLID_NONE)
|
||||
self.Owner.broomModel:SetParent(self.Owner)
|
||||
self.Owner.broomModel:DrawShadow(true)
|
||||
self.Owner.broomModel:Spawn()
|
||||
self.Owner.broomModel:Fire("setparentattachment", "cleaver_attachment", 0.01)
|
||||
end
|
||||
|
||||
local viewModel = self.Owner:GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_DRAW)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:Holster()
|
||||
if (!IsValid(self.Owner)) then
|
||||
return
|
||||
end
|
||||
|
||||
if (self.Owner.broomModel) then
|
||||
if (self.Owner.broomModel:IsValid()) then
|
||||
self.Owner.broomModel:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
local viewModel = self.Owner:GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_HOLSTER)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:PreDrawViewModel(viewModel, weapon, client)
|
||||
local hands = player_manager.TranslatePlayerHands(player_manager.TranslateToPlayerModelName(client:GetModel()))
|
||||
|
||||
if (hands and hands.model) then
|
||||
viewModel:SetModel(hands.model)
|
||||
viewModel:SetSkin(hands.skin)
|
||||
viewModel:SetBodyGroups(hands.body)
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:DoDrawCrosshair(x, y)
|
||||
surface.SetDrawColor(255, 255, 255, 66)
|
||||
surface.DrawRect(x - 2, y - 2, 4, 4)
|
||||
end
|
||||
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
SWEP.IronSightsPos = Vector(-5, -5, -55)
|
||||
SWEP.IronSightsAng = Vector(35, 15, 10)
|
||||
|
||||
function SWEP:GetViewModelPosition(EyePos, EyeAng)
|
||||
local Mul = 1.0
|
||||
|
||||
local Offset = self.IronSightsPos
|
||||
|
||||
if (self.IronSightsAng) then
|
||||
EyeAng = EyeAng * 1
|
||||
|
||||
EyeAng:RotateAroundAxis(EyeAng:Right(), self.IronSightsAng.x * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Up(), self.IronSightsAng.y * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Forward(), self.IronSightsAng.z * Mul)
|
||||
end
|
||||
|
||||
local Right = EyeAng:Right()
|
||||
local Up = EyeAng:Up()
|
||||
local Forward = EyeAng:Forward()
|
||||
|
||||
EyePos = EyePos + Offset.x * Right * Mul
|
||||
EyePos = EyePos + Offset.y * Forward * Mul
|
||||
EyePos = EyePos + Offset.z * Up * Mul
|
||||
|
||||
return EyePos, EyeAng
|
||||
end
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:Think()
|
||||
if (!IsValid(self.Owner)) then
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = self.Owner:GetViewModel()
|
||||
|
||||
if (IsValid(viewModel) and self.NextAllowedPlayRateChange < CurTime()) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function SWEP:OnRemove()
|
||||
if (SERVER) then
|
||||
if self.Owner then
|
||||
if self.Owner.DrawViewModel then
|
||||
self.Owner:DrawViewModel(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (self.Owner.broomModel) then
|
||||
if (self.Owner.broomModel:IsValid()) then
|
||||
self.Owner.broomModel:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function SWEP:PrimaryAttack()
|
||||
|
||||
if (!self.Owner:Alive()) then return false end
|
||||
if (!self.Owner:GetCharacter():IsVortigaunt()) then return false end
|
||||
|
||||
self:SetNextPrimaryFire( CurTime() + 2 )
|
||||
-- self.Owner:SetAnimation( PLAYER_ATTACK1 )
|
||||
|
||||
if (SERVER) then
|
||||
self.Owner:ForceSequence("sweep", nil,nil, false)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
return false
|
||||
end
|
||||
@@ -0,0 +1,208 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if (SERVER) then
|
||||
AddCSLuaFile("shared.lua")
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
SWEP.Slot = 1
|
||||
SWEP.SlotPos = 5
|
||||
SWEP.DrawAmmo = false
|
||||
SWEP.PrintName = "Bouclier"
|
||||
SWEP.DrawCrosshair = true
|
||||
end
|
||||
|
||||
SWEP.Purpose = "Permet de créer un bouclier."
|
||||
SWEP.Contact = ""
|
||||
SWEP.Author = "Adolphus (& M!NT)"
|
||||
SWEP.WorldModel = ""
|
||||
SWEP.HoldType = "fist"
|
||||
SWEP.Category = "Vort Swep"
|
||||
|
||||
SWEP.Primary.DefaultClip = 0
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.Ammo = ""
|
||||
SWEP.Spawnable = true
|
||||
SWEP.AdminSpawnable = false
|
||||
|
||||
SWEP.Secondary.DefaultClip = 0
|
||||
SWEP.Secondary.Automatic = false
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.Ammo = ""
|
||||
|
||||
SWEP.ViewModelFOV = 110
|
||||
SWEP.ViewModel = Model("models/willardnetworks/c_arms_vortigaunt.mdl")
|
||||
SWEP.IsAlwaysRaised = true
|
||||
|
||||
SWEP.vePerUse = 50
|
||||
|
||||
if CLIENT then
|
||||
SWEP.NextAllowedPlayRateChange = 0
|
||||
end
|
||||
|
||||
function SWEP:Initialize()
|
||||
return
|
||||
end
|
||||
|
||||
function SWEP:Deploy()
|
||||
local owner = self:GetOwner()
|
||||
if (!IsValid(owner)) then
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = owner:GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_DRAW)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:Think()
|
||||
local owner = self:GetOwner()
|
||||
if (self.vSHIELD and !IsValid(owner)) then
|
||||
self.vSHIELD:Remove()
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = owner:GetViewModel()
|
||||
|
||||
if (IsValid(viewModel) and self.NextAllowedPlayRateChange < CurTime()) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:Holster()
|
||||
local owner = self:GetOwner()
|
||||
if (!IsValid(owner)) then
|
||||
return
|
||||
end
|
||||
|
||||
local viewModel = owner:GetViewModel()
|
||||
|
||||
if (IsValid(viewModel)) then
|
||||
viewModel:SetPlaybackRate(1)
|
||||
viewModel:ResetSequence(ACT_VM_FISTS_HOLSTER)
|
||||
if CLIENT then
|
||||
self.NextAllowedPlayRateChange = CurTime() + viewModel:SequenceDuration()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function SWEP:ValidateShield()
|
||||
for _, shield in ipairs(ents.FindByClass("ix_vortshield")) do
|
||||
if shield:GetOwner() == self:GetOwner() then
|
||||
shield:Remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Called when the player attempts to primary fire.
|
||||
function SWEP:PrimaryAttack()
|
||||
local owner = self:GetOwner()
|
||||
|
||||
if (!owner:GetCharacter():HasFlags("q")) then
|
||||
if CLIENT then
|
||||
owner:NotifyLocalized("Vous n’avez pas le flag (q) requis!")
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local percentage = self.vePerUse / 100
|
||||
percentage = percentage * ix.config.Get("additionalVortalEnergyDrainPerPointOfArmor", 1)
|
||||
if !self.Owner:HasVortalEnergy(self.vePerUse + (percentage * self.Owner:Armor())) then
|
||||
return
|
||||
end
|
||||
|
||||
if (SERVER) then
|
||||
if (!IsValid(self.vSHIELD)) then
|
||||
self:SetNextPrimaryFire(CurTime() + ix.config.Get("VortShieldRecharge", 20))
|
||||
|
||||
self.Owner:TakeVortalEnergy(self.vePerUse + (percentage * self.Owner:Armor()))
|
||||
|
||||
self:ValidateShield()
|
||||
|
||||
self.vSHIELD = ents.Create("ix_vortshield")
|
||||
self.vSHIELD:SetPos(owner:GetPos() + owner:GetUp()*45)
|
||||
self.vSHIELD:Spawn()
|
||||
self.vSHIELD:Activate()
|
||||
self.vSHIELD:SetOwner(owner)
|
||||
self.vSHIELD:FollowBone(owner, 11)
|
||||
self.vSHIELD:SetLocalAngles(Angle(0, 0, -90))
|
||||
self.vSHIELD:SetLocalPos(Vector(-20, 10, 0))
|
||||
owner:EmitSound("npc/vort/health_charge.wav")
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
function SWEP:SecondaryAttack()
|
||||
if (SERVER) then
|
||||
if IsValid(self.vSHIELD) then
|
||||
self:GetOwner():EmitSound("npc/vort/health_charge.wav")
|
||||
self.vSHIELD:Remove()
|
||||
end
|
||||
self:SetNextSecondaryFire(CurTime() + 4)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
if (CLIENT) then
|
||||
function SWEP:PreDrawViewModel(viewModel, weapon, client)
|
||||
local hands = player_manager.TranslatePlayerHands(player_manager.TranslateToPlayerModelName(client:GetModel()))
|
||||
|
||||
if (hands and hands.model) then
|
||||
viewModel:SetModel(hands.model)
|
||||
viewModel:SetSkin(hands.skin)
|
||||
viewModel:SetBodyGroups(hands.body)
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:DoDrawCrosshair(x, y)
|
||||
surface.SetDrawColor(255, 255, 255, 66)
|
||||
surface.DrawRect(x - 2, y - 2, 4, 4)
|
||||
end
|
||||
|
||||
-- Adjust these variables to move the viewmodel's position
|
||||
SWEP.IronSightsPos = Vector(-5, -5, -55)
|
||||
SWEP.IronSightsAng = Vector(35, 15, 10)
|
||||
|
||||
function SWEP:GetViewModelPosition(EyePos, EyeAng)
|
||||
local Mul = 1.0
|
||||
|
||||
local Offset = self.IronSightsPos
|
||||
|
||||
if (self.IronSightsAng) then
|
||||
EyeAng = EyeAng * 1
|
||||
|
||||
EyeAng:RotateAroundAxis(EyeAng:Right(), self.IronSightsAng.x * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Up(), self.IronSightsAng.y * Mul)
|
||||
EyeAng:RotateAroundAxis(EyeAng:Forward(), self.IronSightsAng.z * Mul)
|
||||
end
|
||||
|
||||
local Right = EyeAng:Right()
|
||||
local Up = EyeAng:Up()
|
||||
local Forward = EyeAng:Forward()
|
||||
|
||||
EyePos = EyePos + Offset.x * Right * Mul
|
||||
EyePos = EyePos + Offset.y * Forward * Mul
|
||||
EyePos = EyePos + Offset.z * Up * Mul
|
||||
|
||||
return EyePos, EyeAng
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user