mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
local smoke = {
|
||||
"particle/smokesprites_0001",
|
||||
"particle/smokesprites_0002",
|
||||
"particle/smokesprites_0003",
|
||||
"particle/smokesprites_0004",
|
||||
"particle/smokesprites_0005",
|
||||
"particle/smokesprites_0006",
|
||||
"particle/smokesprites_0007",
|
||||
"particle/smokesprites_0008",
|
||||
"particle/smokesprites_0009",
|
||||
"particle/smokesprites_0010",
|
||||
"particle/smokesprites_0011",
|
||||
"particle/smokesprites_0012",
|
||||
"particle/smokesprites_0013",
|
||||
"particle/smokesprites_0014",
|
||||
"particle/smokesprites_0015",
|
||||
"particle/smokesprites_0016"
|
||||
}
|
||||
|
||||
function EFFECT:Init( data )
|
||||
local vOffset = data:GetOrigin()
|
||||
|
||||
local emitter = ParticleEmitter( vOffset, false )
|
||||
|
||||
for i = 1, 80 do
|
||||
local Pos = Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 0)
|
||||
local particle = emitter:Add( smoke[math.random(1, #smoke)], vOffset + Pos * 4 )
|
||||
if ( particle ) then
|
||||
particle:SetVelocity( Pos * 320 )
|
||||
|
||||
particle:SetLifeTime( 0 )
|
||||
particle:SetDieTime( 8 )
|
||||
|
||||
particle:SetStartAlpha( 8 )
|
||||
particle:SetEndAlpha( 0 )
|
||||
|
||||
particle:SetColor(60, 193, 255)
|
||||
particle:SetRoll( math.Rand( -1, 1 ) )
|
||||
|
||||
local Size = math.random( 100, 150 )
|
||||
particle:SetStartSize( Size )
|
||||
particle:SetEndSize( Size )
|
||||
|
||||
particle:SetAirResistance( 50 )
|
||||
particle:SetGravity( Vector( math.Rand( -1, 1 ) * 50, math.Rand( -1, 1 ) * 50, 10 ) )
|
||||
|
||||
end
|
||||
end
|
||||
timer.Simple(4.2, function()
|
||||
for i = 0, 80 do
|
||||
local exp = emitter:Add( smoke[math.random(1, #smoke)], vOffset)
|
||||
|
||||
if exp then
|
||||
exp:SetVelocity( Vector(math.Rand(-1, 1), math.Rand(-1, 1), 0) * 300 )
|
||||
exp:SetDieTime( 3 )
|
||||
exp:SetStartAlpha( 68 )
|
||||
exp:SetStartSize( 150 )
|
||||
exp:SetEndSize( 80 )
|
||||
exp:SetEndAlpha( 0 )
|
||||
exp:SetRoll( math.Rand( -1, 1 ) )
|
||||
exp:SetColor(60, 193, 255)
|
||||
exp:SetGravity( Vector( math.Rand( -1, 1 ) * 50, math.Rand( -1, 1 ) * 50, 10 ) )
|
||||
end
|
||||
end
|
||||
emitter:Finish()
|
||||
end)
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
@@ -0,0 +1,83 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
local smoke = {
|
||||
"particle/smokesprites_0001",
|
||||
"particle/smokesprites_0002",
|
||||
"particle/smokesprites_0003",
|
||||
"particle/smokesprites_0004",
|
||||
"particle/smokesprites_0005",
|
||||
"particle/smokesprites_0006",
|
||||
"particle/smokesprites_0007",
|
||||
"particle/smokesprites_0008",
|
||||
"particle/smokesprites_0009",
|
||||
"particle/smokesprites_0010",
|
||||
"particle/smokesprites_0011",
|
||||
"particle/smokesprites_0012",
|
||||
"particle/smokesprites_0013",
|
||||
"particle/smokesprites_0014",
|
||||
"particle/smokesprites_0015",
|
||||
"particle/smokesprites_0016"
|
||||
}
|
||||
|
||||
function EFFECT:Init( data )
|
||||
local vOffset = data:GetOrigin()
|
||||
|
||||
local emitter = ParticleEmitter( vOffset, false )
|
||||
|
||||
for i = 0, 15 do
|
||||
local exp = emitter:Add( "particles/flamelet"..math.random(1,5), vOffset)
|
||||
|
||||
if exp then
|
||||
exp:SetVelocity( VectorRand() * 250 )
|
||||
exp:SetDieTime( 0.2 )
|
||||
exp:SetStartAlpha( 255 )
|
||||
exp:SetStartSize( 20 )
|
||||
exp:SetEndSize( 150 )
|
||||
exp:SetEndAlpha( 50 )
|
||||
exp:SetRoll( math.Rand( -1, 1 ) )
|
||||
exp:SetColor(60, 193, 255)
|
||||
exp:SetGravity( Vector( 50, 50, 10 ) )
|
||||
end
|
||||
end
|
||||
|
||||
for i = 1, 40 do
|
||||
local Pos = Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 0)
|
||||
local particle = emitter:Add( smoke[math.random(1, #smoke)], vOffset + Pos * 4 )
|
||||
if ( particle ) then
|
||||
particle:SetVelocity( Pos * 120 )
|
||||
|
||||
particle:SetLifeTime( 0 )
|
||||
particle:SetDieTime( 2 )
|
||||
|
||||
particle:SetStartAlpha( 8 )
|
||||
particle:SetEndAlpha( 0 )
|
||||
|
||||
particle:SetColor(60, 193, 255)
|
||||
particle:SetRoll( math.Rand( -1, 1 ) )
|
||||
|
||||
local Size = math.random( 100, 150 )
|
||||
particle:SetStartSize( Size )
|
||||
particle:SetEndSize( Size )
|
||||
|
||||
particle:SetAirResistance( 50 )
|
||||
particle:SetGravity( Vector( math.Rand( -1, 1 ) * 50, math.Rand( -1, 1 ) * 50, 10 ) )
|
||||
|
||||
end
|
||||
end
|
||||
emitter:Finish()
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
@@ -0,0 +1,82 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
local smoke = {
|
||||
"particle/smokesprites_0001",
|
||||
"particle/smokesprites_0002",
|
||||
"particle/smokesprites_0003",
|
||||
"particle/smokesprites_0004",
|
||||
"particle/smokesprites_0005",
|
||||
"particle/smokesprites_0006",
|
||||
"particle/smokesprites_0007",
|
||||
"particle/smokesprites_0008",
|
||||
"particle/smokesprites_0009",
|
||||
"particle/smokesprites_0010",
|
||||
"particle/smokesprites_0011",
|
||||
"particle/smokesprites_0012",
|
||||
"particle/smokesprites_0013",
|
||||
"particle/smokesprites_0014",
|
||||
"particle/smokesprites_0015",
|
||||
"particle/smokesprites_0016"
|
||||
}
|
||||
|
||||
function EFFECT:Init( data )
|
||||
local vOffset = data:GetOrigin()
|
||||
|
||||
local emitter = ParticleEmitter( vOffset, false )
|
||||
|
||||
for i = 0, 80 do
|
||||
local exp = emitter:Add( "particles/flamelet"..math.random(1,5), vOffset)
|
||||
|
||||
if exp then
|
||||
exp:SetVelocity( Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 0) * 320 )
|
||||
exp:SetDieTime( 0.8 )
|
||||
exp:SetStartAlpha( 200 )
|
||||
exp:SetStartSize( 20 )
|
||||
exp:SetEndSize( 40 )
|
||||
exp:SetEndAlpha( 0 )
|
||||
exp:SetRoll( math.Rand( -1, 1 ) )
|
||||
exp:SetGravity( Vector( 50, 50, 8 ) )
|
||||
end
|
||||
end
|
||||
|
||||
for i = 1, 80 do
|
||||
local Pos = Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 0)
|
||||
local particle = emitter:Add( smoke[math.random(1, #smoke)], vOffset + Pos * 4 )
|
||||
if ( particle ) then
|
||||
particle:SetVelocity( Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 0) * 150 + Vector(0, 0, 8))
|
||||
|
||||
particle:SetLifeTime( 0 )
|
||||
particle:SetDieTime( 4 )
|
||||
|
||||
particle:SetStartAlpha( 80 )
|
||||
particle:SetEndAlpha( 0 )
|
||||
|
||||
particle:SetColor(32, 185, 50)
|
||||
particle:SetRoll( math.Rand( -1, 1 ) )
|
||||
|
||||
local Size = math.random( 20, 40 )
|
||||
particle:SetStartSize( Size )
|
||||
particle:SetEndSize( Size )
|
||||
|
||||
particle:SetAirResistance( 100 )
|
||||
particle:SetGravity( Vector( math.Rand( -1, 1 ) * 50, math.Rand( -1, 1 ) * 50, 0 ) )
|
||||
|
||||
end
|
||||
end
|
||||
emitter:Finish()
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
@@ -0,0 +1,145 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
local ringMats = {
|
||||
"particle/particle_ring_blur",
|
||||
"particle/particle_ring_wave_additive",
|
||||
"particle/particle_ring_wave_addnofog",
|
||||
"particle/particle_ring_sharp_additive",
|
||||
"particle/particle_ring_sharp",
|
||||
"particle/particle_ring_refract_01",
|
||||
"particle/particle_ring_blur",
|
||||
"particle/particle_noisesphere"
|
||||
}
|
||||
local smoke = {
|
||||
"particle/smokesprites_0001",
|
||||
"particle/smokesprites_0002",
|
||||
"particle/smokesprites_0003",
|
||||
"particle/smokesprites_0004",
|
||||
"particle/smokesprites_0005",
|
||||
"particle/smokesprites_0006",
|
||||
"particle/smokesprites_0007",
|
||||
"particle/smokesprites_0008",
|
||||
"particle/smokesprites_0009",
|
||||
"particle/smokesprites_0010",
|
||||
"particle/smokesprites_0011",
|
||||
"particle/smokesprites_0012",
|
||||
"particle/smokesprites_0013",
|
||||
"particle/smokesprites_0014",
|
||||
"particle/smokesprites_0015",
|
||||
"particle/smokesprites_0016"
|
||||
}
|
||||
|
||||
function EFFECT:Init( data )
|
||||
local vOffset = data:GetOrigin()
|
||||
|
||||
local NumParticles = 32
|
||||
|
||||
local emitter = ParticleEmitter( vOffset, false )
|
||||
local ringSize = math.random( 80, 90 )
|
||||
|
||||
for i = 1, #ringMats do
|
||||
local ring = emitter:Add(ringMats[i], vOffset + Vector(0, 0, 20))
|
||||
if (ring) then
|
||||
ring:SetStartSize( ringSize )
|
||||
ring:SetEndSize( 0 )
|
||||
ring:SetLifeTime( 0 )
|
||||
ring:SetDieTime( 0.5 )
|
||||
ring:SetStartAlpha( 150 )
|
||||
ring:SetEndAlpha( 0 )
|
||||
ring:SetAirResistance( 100 )
|
||||
ring:SetGravity( Vector( 0, 0, 10 ) )
|
||||
ring:SetRoll( 90 )
|
||||
ring:SetColor(32, 185, 50)
|
||||
end
|
||||
end
|
||||
|
||||
for i = 0, 40 do
|
||||
local exp = emitter:Add( "particle/particle_glow_03", vOffset + Vector(0, 0, 20) )
|
||||
|
||||
if exp then
|
||||
exp:SetVelocity( Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 0) * 30 )
|
||||
exp:SetDieTime( 0.5 )
|
||||
exp:SetStartAlpha( 255 )
|
||||
exp:SetStartSize( 75 )
|
||||
exp:SetEndSize( 120 )
|
||||
exp:SetEndAlpha( 0 )
|
||||
exp:SetRoll( math.Rand( -1, 1 ) )
|
||||
exp:SetColor(32, 185, 50)
|
||||
end
|
||||
end
|
||||
|
||||
for i = 1, 40 do
|
||||
local Pos = Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 0)
|
||||
local particle = emitter:Add( smoke[math.random(1, #smoke)], vOffset + Pos * 4 )
|
||||
if ( particle ) then
|
||||
particle:SetVelocity( Pos * 30 )
|
||||
|
||||
particle:SetLifeTime( 0 )
|
||||
particle:SetDieTime( 5 )
|
||||
|
||||
particle:SetStartAlpha( 8 )
|
||||
particle:SetEndAlpha( 0 )
|
||||
|
||||
particle:SetColor(32, 185, 50)
|
||||
particle:SetRoll( math.Rand( -1, 1 ) )
|
||||
|
||||
local Size = math.random( 100, 150 )
|
||||
particle:SetStartSize( Size )
|
||||
particle:SetEndSize( Size )
|
||||
|
||||
particle:SetAirResistance( 50 )
|
||||
particle:SetGravity( Vector( math.Rand( -1, 1 ) * 15, math.Rand( -1, 1 ) * 15, 18 ) )
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
for i = 0, NumParticles do
|
||||
|
||||
local Pos = Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), math.Rand( -1, 1 ) )
|
||||
|
||||
local particle = emitter:Add( "particle/particle_ring_wave_8", vOffset + Pos * 4 )
|
||||
if ( particle ) then
|
||||
|
||||
particle:SetVelocity( Pos * 340 )
|
||||
|
||||
particle:SetLifeTime( 0 )
|
||||
particle:SetDieTime( 3 )
|
||||
|
||||
particle:SetStartAlpha( 255 )
|
||||
particle:SetEndAlpha( 0 )
|
||||
|
||||
particle:SetColor(32, 185, 50)
|
||||
|
||||
|
||||
local Size = math.random( 5, 15 )
|
||||
particle:SetStartSize( Size )
|
||||
particle:SetEndSize( 0 )
|
||||
|
||||
particle:SetRoll( math.Rand( 0, 360 ) )
|
||||
particle:SetRollDelta( math.Rand( -25, 25 ) )
|
||||
|
||||
particle:SetAirResistance( 150 )
|
||||
particle:SetGravity( Vector( math.Rand( -1, 1 ) * 15, math.Rand( -1, 1 ) * 15, 30 ) )
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
emitter:Finish()
|
||||
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
@@ -0,0 +1,35 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
include("shared.lua");
|
||||
|
||||
function ENT:Think()
|
||||
local dlight = DynamicLight( self:EntIndex() );
|
||||
|
||||
cam.Start3D( EyePos(), EyeAngles() );
|
||||
for k, v in ipairs( player.GetAll() ) do
|
||||
if (v:Alive()) then
|
||||
if ( dlight and v == self.Owner ) then
|
||||
local lightVector = self:GetPos();
|
||||
lightVector:Add(Vector(0,2,0));
|
||||
|
||||
dlight.Pos = lightVector;
|
||||
dlight.r = 30;
|
||||
dlight.g = 255;
|
||||
dlight.b = 30;
|
||||
dlight.Brightness = 0;
|
||||
dlight.Size = 700;
|
||||
dlight.Decay = 5;
|
||||
dlight.DieTime = CurTime() + 0.1;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
cam.End3D();
|
||||
end;
|
||||
@@ -0,0 +1,37 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
include("shared.lua");
|
||||
|
||||
AddCSLuaFile("cl_init.lua");
|
||||
AddCSLuaFile("shared.lua");
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetMoveType( MOVETYPE_NONE );
|
||||
self:SetSolid( SOLID_NONE );
|
||||
self:SetCollisionGroup( COLLISION_GROUP_NONE );
|
||||
ent:SetModel("models/error.mdl");
|
||||
ent:SetColor( Color(0,0,0,0) );
|
||||
ent:DrawShadow(false);
|
||||
end;
|
||||
|
||||
function ENT:SetOwnerVariable(owner)
|
||||
self.Owner = owner;
|
||||
end;
|
||||
|
||||
function ENT:RemoveLight(owner)
|
||||
local worldmodel = ents.FindInSphere(owner:GetPos(), 0.6);
|
||||
|
||||
for k, v in pairs(worldmodel) do
|
||||
if (v:GetClass() == "ix_nvlight" and v:GetOwner() == owner) then
|
||||
v:Remove();
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@@ -0,0 +1,17 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
DEFINE_BASECLASS("base_gmodentity");
|
||||
|
||||
ENT.Type = "anim";
|
||||
ENT.Author = "RJ";
|
||||
ENT.PrintName = "Lumière de vision";
|
||||
ENT.Spawnable = false;
|
||||
ENT.AdminSpawnable = false;
|
||||
@@ -0,0 +1,105 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Bouclier de Vortigaunt"
|
||||
ENT.Category = "HL2RP"
|
||||
ENT.Spawnable = true
|
||||
ENT.bNoPersist = true
|
||||
ENT.AutomaticFrameAdvance = true
|
||||
|
||||
if (SERVER) then
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/props_phx/construct/metal_dome360.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
|
||||
local physObj = self:GetPhysicsObject()
|
||||
if (IsValid(physObj)) then
|
||||
physObj:Wake()
|
||||
end
|
||||
|
||||
self:SetCollisionGroup(COLLISION_GROUP_DEBRIS_TRIGGER)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:AddEffects(EF_NOSHADOW)
|
||||
self:AddEFlags(EFL_DONTBLOCKLOS)
|
||||
self:SetRenderMode(RENDERMODE_WORLDGLOW)
|
||||
|
||||
self:SetMaterial("models/props_combine/stasisshield_sheet")
|
||||
self:SetColor(Color(0, 255, 55, 255))
|
||||
self:SetModelScale(1.2)
|
||||
self:SetHealth(ix.config.Get("VortShieldHealth", 500))
|
||||
|
||||
timer.Simple(0.25, function()
|
||||
ParticleEffectAttach("vort_shield_parent", PATTACH_ABSORIGIN_FOLLOW, self, 0)
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:OnTakeDamage(dmginfo)
|
||||
self:EmitSound("ambient/energy/ion_cannon_shot"..math.random(1, 3)..".wav")
|
||||
|
||||
ParticleEffect("vortigaunt_glow_beam_cp0", dmginfo:GetDamagePosition(), Angle(0, 0, 0), self)
|
||||
|
||||
self:SetHealth(math.Clamp(self:Health() - dmginfo:GetDamage(), 0, 350))
|
||||
|
||||
if self:Health() <= 0 then
|
||||
self:Die()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:ImpactTrace(trace, dmgtype, customimpactname)
|
||||
if (trace.HitSky) then
|
||||
return
|
||||
end
|
||||
|
||||
local effectdata = EffectData()
|
||||
effectdata:SetOrigin(trace.HitPos + trace.HitNormal)
|
||||
effectdata:SetNormal(trace.HitNormal)
|
||||
util.Effect("AR2Impact", effectdata)
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function ENT:Die()
|
||||
ParticleEffect("vortigaunt_charge_token", self:GetPos()*15, Angle(0, 0, 0))
|
||||
|
||||
self:EmitSound("ambient/levels/labs/electric_explosion1.wav", 80, 100, 1, CHAN_WEAPON)
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
if (!IsValid(self:GetOwner()) or !self:GetOwner():IsVortigaunt()) then
|
||||
self:Remove()
|
||||
end
|
||||
self:NextThink(CurTime() + 0.1)
|
||||
|
||||
return true
|
||||
end
|
||||
else
|
||||
function ENT:Think()
|
||||
if IsValid(self:GetOwner()) and self:GetOwner():Alive() then
|
||||
local lightVector = self:GetPos() + self:GetUp()*15
|
||||
local dlight = DynamicLight(self:EntIndex())
|
||||
dlight.Pos = lightVector
|
||||
dlight.r = 30
|
||||
dlight.g = 255
|
||||
dlight.b = 30
|
||||
dlight.Brightness = 0
|
||||
dlight.Size = 700
|
||||
dlight.Decay = 5
|
||||
dlight.DieTime = CurTime() + 0.1
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
self:RemoveAllDecals()
|
||||
end
|
||||
end
|
||||
@@ -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