add sborka

This commit is contained in:
2026-03-31 10:27:04 +03:00
commit f5e5f56c84
2345 changed files with 382127 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
local function ARCCW_FAS2_ClientsidePanel(panel)
panel:ClearControls()
local slider = vgui.Create("DNumSlider", panel)
slider:SetDecimals(0)
slider:SetMin(0)
slider:SetMax(3)
slider:SetConVar("arccw_fas2_handrig")
slider:SetValue(GetConVarNumber("arccw_fas2_handrig"))
slider:SetText("Hand Rig")
panel:AddItem(slider)
local MC = vgui.Create("DComboBox", panel)
MC:SetText("Hand Skin")
MC.ConVar = "arccw_fas2_handskin"
MC:AddChoice("White")
MC:AddChoice("Tan")
MC:AddChoice("Black")
MC:AddChoice("Camo")
MC.OnSelect = function(panel, index, value, data)
RunConsoleCommand(MC.ConVar, tonumber(index))
end
panel:AddItem(MC)
local MC = vgui.Create("DComboBox", panel)
MC:SetText("Glove Skin")
MC.ConVar = "arccw_fas2_gloveskin"
MC:AddChoice("Nomex")
MC:AddChoice("Black")
MC:AddChoice("Desert Khaki")
MC:AddChoice("Multicam")
MC:AddChoice("Green")
MC.OnSelect = function(panel, index, value, data)
RunConsoleCommand(MC.ConVar, tonumber(index))
end
panel:AddItem(MC)
local MC = vgui.Create("DComboBox", panel)
MC:SetText("Sleeve Skin")
MC.ConVar = "arccw_fas2_sleeveskin"
MC:AddChoice("Woodland Camo")
MC:AddChoice("Digital Camo")
MC:AddChoice("Russian Digital Camo")
MC:AddChoice("Black")
MC.OnSelect = function(panel, index, value, data)
RunConsoleCommand(MC.ConVar, tonumber(index))
end
panel:AddItem(MC)
panel:AddControl("Button", {Label = "Apply Skin", Command = "arccw_fas2_handrig_applynow"})
local slider = vgui.Create("DNumSlider", panel)
slider:SetDecimals(2)
slider:SetMin(0)
slider:SetMax(2)
slider:SetConVar("arccw_fas2_headbob_intensity")
slider:SetValue(GetConVarNumber("arccw_fas2_headbob_intensity"))
slider:SetText("Headbob Intensity")
panel:AddItem(slider)
panel:AddControl("CheckBox", {Label = "FA:S 2.0 Bolting", Command = "arccw_fas2_bolting"})
end
local function ARCCW_FAS2_PopulateToolMenu()
spawnmenu.AddToolMenuOption("Options", "ArcCW", "ArcCW_FAS2", "FA:S 2.0 Options", "", "", ARCCW_FAS2_ClientsidePanel)
end
hook.Add("PopulateToolMenu", "ArcCW_FAS2_PopulateToolMenu", ARCCW_FAS2_PopulateToolMenu)

View File

@@ -0,0 +1,4 @@
AddCSLuaFile()
game.AddParticles( "particles/at4_explo.pcf")
game.AddParticles( "particles/struc_bomb.pcf")
game.AddParticles( "particles/fires.pcf")

View File

@@ -0,0 +1,9 @@
-- DO NOT REMOVE THIS FILE! THIS IS BASIC FILE DOWNLOAD WHICH IS ABSOLUTELY REQUIRED BY ANY CLIENT! IF YOU REMOVE THIS THEN MOST CLIENTS WILL BE BLIND BY PURPLE CHECKERS!
AddCSLuaFile();
if (SERVER) then
resource.AddSingleFile( "materials/hud/radiation.vmt" )
resource.AddSingleFile( "materials/hud/radiation.vtf" )
resource.AddSingleFile( "sound/natsu/firedrive.mp3" )
resource.AddWorkshop( 668552230 )
resource.AddWorkshop( 668558959 )
end

View File

@@ -0,0 +1,19 @@
if SERVER then
AddCSLuaFile();
emp_soundlist = {
"gbombs_5/explosions/emp_wave/emp_discharge.mp3",
"ambient/energy/newspark01.wav",
"ambient/energy/newspark02.wav",
"ambient/energy/newspark03.wav",
"ambient/energy/newspark04.wav",
"ambient/energy/newspark05.wav",
"ambient/energy/newspark06.wav",
"ambient/energy/newspark07.wav",
"ambient/energy/newspark08.wav",
"ambient/energy/newspark09.wav",
"ambient/energy/newspark10.wav",
"ambient/energy/newspark11.wav",
}
end

View File

@@ -0,0 +1,26 @@
if SERVER then
AddCSLuaFile();
emp_whitelist = {"gmod_wire_pod",
"gmod_wire_expression2",
"gmod_wire_gate",
"gmod_wire_value",
"gmod_wire_button",
"gmod_wire_dynamic_button",
"gmod_button",
"gmod_hoverball",
"radio_music",
"airraid_siren",
"general_siren",
"missile_detector",
"nuclear_siren",
"sent_tardis",
"npc_rollermine",
"npc_manhack",
"npc_cscanner",
"npc_turret_floor",
"npc_clawscanner",
"npc_helicopter",
"npc_combinegunship",
"scifi_siren"}
end

View File

@@ -0,0 +1,10 @@
if SERVER then
AddCSLuaFile();
emp_whiteragdolllist = {"npc_combinedropship",
"npc_strider",
"npc_dog",
"npc_stalker",
"npc_combinegunship",
"npc_hunter"}
end

View File

@@ -0,0 +1,10 @@
function AddAmmoType(name, text)
game.AddAmmoType({name = name,
dmgtype = DMG_BLAST})
if CLIENT then
language.Add(name .. "_ammo", text)
end
end
AddAmmoType("PanzerFaust3 Rocket", "PanzerFaust3 Rocket")

View File

@@ -0,0 +1,4 @@
AddCSLuaFile()
game.AddParticles( "particles/at4_explo.pcf")
game.AddParticles( "particles/struc_bomb.pcf")
game.AddParticles( "particles/fires.pcf")

View File

@@ -0,0 +1,33 @@
AddCSLuaFile()
if GetConVar("hb_easyuse") == nil then
CreateConVar("hb_easyuse", "1", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY } )
end
if GetConVar("hb_fragility") == nil then
CreateConVar("hb_fragility", "1", {FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY } )
end
if GetConVar("hb_nuclear_emp") == nil then
CreateConVar("hb_nuclear_emp", "1", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY } )
end
if GetConVar("hb_safeemp") == nil then
CreateConVar("hb_safeemp", "1", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY } )
end
if GetConVar("hb_nuclear_vaporisation") == nil then
CreateConVar("hb_nuclear_vaporisation", "1", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY } )
end
if GetConVar("hb_shockwave_unfreeze") == nil then
CreateConVar("hb_shockwave_unfreeze", "1", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY } )
end
if GetConVar("hb_decals") == nil then
CreateConVar("hb_decals", "1", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY } )
end
if GetConVar("hb_realistic_sound") == nil then
CreateConVar("hb_realistic_sound", "1", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY } )
end
if GetConVar("hb_sound_shake") == nil then
CreateConVar("hb_sound_shake", "1", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY } )
end
if GetConVar("hb_nuclear_fallout") == nil then
CreateConVar("hb_nuclear_fallout", "1", { FCVAR_REPLICATED, FCVAR_ARCHIVE, FCVAR_NOTIFY } )
end

View File

@@ -0,0 +1,11 @@
AddCSLuaFile()
game.AddDecal( "scorch_small", "decals/scorch_small" );
game.AddDecal( "scorch_medium", "decals/scorch_medium" );
game.AddDecal( "scorch_big", "decals/scorch_big" );
game.AddDecal( "scorch_big_2", "decals/scorch_big_2" );
game.AddDecal( "scorch_big_3", "decals/scorch_big_3" );
game.AddDecal( "nuke_small", "decals/nuke_small" );
game.AddDecal( "nuke_medium", "decals/nuke_medium" );
game.AddDecal( "nuke_big", "decals/nuke_big" );
game.AddDecal( "nuke_tsar", "decals/nuke_tsar" );
game.AddDecal( "tiberium", "models/rogue/tibe/tibe_decal" );

View File

@@ -0,0 +1,42 @@
AddCSLuaFile()
util.AddNetworkString( "hbombs_cvar" )
util.AddNetworkString( "hbombs_net" )
util.AddNetworkString( "hbombs_general" )
util.AddNetworkString( "hbombs_announcer" )
SetGlobalString ( "hb_ver", 5 )
TOTAL_BOMBS = 0
net.Receive( "hbombs_cvar", function( len, pl )
if( !pl:IsAdmin() ) then return end
local cvar = net.ReadString();
local val = net.ReadFloat();
if( GetConVar( tostring( cvar ) ) == nil ) then return end
if( GetConVarNumber( tostring( cvar ) ) == tonumber( val ) ) then return end
game.ConsoleCommand( tostring( cvar ) .." ".. tostring( val ) .."\n" );
end );
function source_debug( ply, command)
ply:ChatPrint("Engine Tickrate: \n"..tostring(1/engine.TickInterval()))
end
concommand.Add( "source_debug", source_debug )
function hbversion( ply, command, arguments )
ply:ChatPrint( "Hbombs 5/14/16" )
end
concommand.Add( "hb_version", hbversion )
function hb_spawn(ply)
ply.gasmasked=false
ply.hazsuited=false
net.Start( "hbombs_net" )
net.WriteBit( false )
ply:StopSound("breathing")
net.Send(ply)
end
hook.Add( "PlayerSpawn", "hb_spawn", hb_spawn )

View File

@@ -0,0 +1,14 @@
AddCSLuaFile()
function hb_physics()
Msg("\n|Hbombs physics module initialized!")
Msg("\n|If you don't want this, delete the hb_physics.lua file\n")
phys = {}
phys.MaxVelocity = 5000
phys.MaxAngularVelocity = 3636.3637695313
physenv.SetPerformanceSettings(phys)
end
hook.Add( "InitPostEntity", "hb_physics", hb_physics )

View File

@@ -0,0 +1,92 @@
CreateClientConVar("arccw_fas2_handskin", "1", true, true)
CreateClientConVar("arccw_fas2_gloveskin", "1", true, true)
CreateClientConVar("arccw_fas2_sleeveskin", "1", true, true)
CreateClientConVar("arccw_fas2_handrig", "0", true, true)
CreateClientConVar("arccw_fas2_headbob_intensity", "1", true, true)
CreateClientConVar("arccw_fas2_bolting", "1", true, true)
NumberToTexture = {[1] = "models/weapons/fas2/hands/hand",
[2] = "models/weapons/fas2/hands/hand_tan",
[3] = "models/weapons/fas2/hands/hand_black",
[4] = "models/weapons/fas2/hands/hand_camo"}
NumberToGlove = {[1] = "models/weapons/fas2/hands/nomex",
[2] = "models/weapons/fas2/hands/black",
[3] = "models/weapons/fas2/hands/desertkhaki",
[4] = "models/weapons/fas2/hands/multicam",
[5] = "models/weapons/fas2/hands/green"}
NumberToSleeve = {[1] = "models/weapons/fas2/hands/sleeve",
[2] = "models/weapons/fas2/hands/sleeve2",
[3] = "models/weapons/fas2/hands/sleeve3",
[4] = "models/weapons/fas2/hands/sleeve4"}
if CLIENT then
-- local function ARCCW_FAS2_InitPostEntity()
-- ply = LocalPlayer()
-- ply.ARCCW_FAS_FamiliarWeapons = {}
-- for k, v in pairs(weapons.GetList()) do
-- if v.ViewModel then
-- util.PrecacheModel(v.ViewModel)
-- end
-- end
-- end
-- hook.Add("InitPostEntity", "ARCCW_FAS2_InitPostEntity", ARCCW_FAS2_InitPostEntity)
local cvar
local ArcCW_HandMat = Material("models/weapons/fas2/hands/hand")
local ArcCW_HandMat2 = Material("models/weapons/fas2/hands/hand")
local ArcCW_GloveMat, ArcCW_GloveMat2 = Material("models/weapons/fas2/hands/nomex"), Material("models/weapons/fas2/hands/nomex")
local ArcCW_SleeveMat, ArcCW_SleeveMat2 = Material("models/weapons/fas2/hands/sleeve"), Material("models/weapons/fas2/hands/sleeve")
local vm
local function ArcCW_FAS2_ApplyRigNow(ply, com, args)
-- cvar = GetConVarNumber("arccw_fas2_handrig")
-- LocalPlayer():GetViewModel():SetBodygroup(0, cvar)
-- for k, v in pairs(LocalPlayer():GetWeapons()) do
-- print(v.VMElements)
-- if v.IsARCCWFAS2Weapon and IsValid(v.VMElements) then
-- v.VMElements:SetBodygroup(1, cvar)
-- end
-- end
local t = NumberToTexture[GetConVarNumber("arccw_fas2_handskin")]
ArcCW_HandMat:SetTexture("$basetexture", t and t or "models/weapons/fas2/hands/hand")
ArcCW_HandMat2:SetTexture("$basetexture", t and t or "models/weapons/fas2/hands/hand")
local t = NumberToSleeve[GetConVarNumber("arccw_fas2_sleeveskin")]
ArcCW_SleeveMat:SetTexture("$basetexture", t and t or "models/weapons/fas2/hands/sleeve")
ArcCW_SleeveMat2:SetTexture("$basetexture", t and t or "models/weapons/fas2/hands/sleeve")
local t = NumberToGlove[GetConVarNumber("arccw_fas2_gloveskin")]
ArcCW_GloveMat:SetTexture("$basetexture", t and t or "models/weapons/fas2/hands/nomex")
ArcCW_GloveMat2:SetTexture("$basetexture", t and t or "models/weapons/fas2/hands/nomex")
end
concommand.Add("arccw_fas2_handrig_applynow", ArcCW_FAS2_ApplyRigNow)
end
-- if self:GetOwner():IsPlayer() then
-- vm = self:GetOwner():GetViewModel()
-- end
-- if vm and vm:IsValid() then
-- ArcCW.SetBodyGroups(1, cvar)
-- -- vm:SetMaterial(vmm)
-- -- vm:SetColor(vmc)
-- -- vm:SetSkin(vms)
-- vmp["BaseClass"] = nil
-- for i, k in pairs(vmp) do
-- vm:SetPoseParameter(i, k)
-- end
-- end

View File

@@ -0,0 +1,144 @@
game.AddParticles("particles/muzzleflashes.pcf")
game.AddParticles("particles/muzzleflashes_test.pcf")
game.AddParticles("particles/muzzleflashes_test_b.pcf")
game.AddParticles("particles/new_muzzleflashes.pcf")
game.AddParticles("particles/new_muzzleflashes_b.pcf")
game.AddParticles("particles/flashbang.pcf")
game.AddParticles("particles/rocket_fx.pcf")
game.AddParticles("particles/fas_explosions.pcf")
game.AddParticles("particles/ammo.pcf")
game.AddParticles("particles/mortar_fx.pcf")
game.AddParticles("particles/fire_01.pcf")
game.AddParticles("particles/env_effects.pcf")
game.AddParticles("particles/burning_fx.pcf")
--muzzleflashes
PrecacheParticleSystem("muzzleflash_1") -- SKS, RPK
PrecacheParticleSystem("muzzleflash_3") -- RK95, UMP45, (SG552)
PrecacheParticleSystem("muzzleflash_4") -- G36K, (G36C)
PrecacheParticleSystem("muzzleflash_5") -- (M60E3), ASH12
PrecacheParticleSystem("muzzleflash_6") -- M4A1, M16
PrecacheParticleSystem("muzzleflash_ak47") -- AK47
PrecacheParticleSystem("muzzleflash_ak74") -- AK74
PrecacheParticleSystem("muzzleflash_FAMAS") -- FAMAS F1, SG550
PrecacheParticleSystem("muzzleflash_g3") -- G3A3
PrecacheParticleSystem("muzzleflash_m14") -- M14, L85, (M21)
PrecacheParticleSystem("muzzleflash_M3") -- M3S90, MP153
PrecacheParticleSystem("muzzleflash_m79") -- (M79)
PrecacheParticleSystem("muzzleflash_M82") -- (M82)
PrecacheParticleSystem("muzzleflash_MINIMI") -- (MINIMI)
PrecacheParticleSystem("muzzleflash_mp5") -- MP5A5
PrecacheParticleSystem("muzzleflash_none") -- Undefined --
PrecacheParticleSystem("muzzleflash_none_red") -- Undefined --
PrecacheParticleSystem("muzzleflash_none_smoke") -- Undefined --
PrecacheParticleSystem("muzzleflash_OTS") -- P226, (OTS)
PrecacheParticleSystem("muzzleflash_pistol") -- Glock, M1911, (Beretta F92)
PrecacheParticleSystem("muzzleflash_pistol_cleric") -- Vector
PrecacheParticleSystem("muzzleflash_pistol_deagle") -- Deagle, M40A3
PrecacheParticleSystem("muzzleflash_pistol_red") -- PMM
PrecacheParticleSystem("muzzleflash_shotgun") -- Remington 870, SAIGA12K
PrecacheParticleSystem("muzzleflash_slug") -- KS23
PrecacheParticleSystem("muzzleflash_smg") -- L2A3, UZI, (MK7A4), (MAC11)
PrecacheParticleSystem("muzzleflash_smg_bizon") -- Bizon
PrecacheParticleSystem("muzzleflash_suppressed") -- All Rifles
PrecacheParticleSystem("party_spark") -- Undefined --
PrecacheParticleSystem("port_smoke_heavy") -- Undefined --
PrecacheParticleSystem("muzzle_rockets") -- RPG26
PrecacheParticleSystem("muzzleflash_1bb") -- Undefined --
PrecacheParticleSystem("muzzleflash_3bb") -- AK104
PrecacheParticleSystem("muzzleflash_4bb") -- FN P90
PrecacheParticleSystem("muzzleflash_6b") -- FN FAL
PrecacheParticleSystem("muzzleflash_m24") -- M24
PrecacheParticleSystem("muzzleflash_pistol_rbull") -- Raging bull
PrecacheParticleSystem("muzzleflash_SR25") -- SR25, M110
PrecacheParticleSystem("muzzleflash_svd") -- SVD, Kar98K
PrecacheParticleSystem("muzzleflash_vollmer") -- MC51B Vollmer
PrecacheParticleSystem("explosion_claymore") -- medium
PrecacheParticleSystem("explosion_HE_claymore") -- big
PrecacheParticleSystem("explosion_grenade") -- medium
PrecacheParticleSystem("explosion_he_grenade") -- big
PrecacheParticleSystem("explosion_m79") -- medium
PrecacheParticleSystem("explosion_HE_m79") -- big
PrecacheParticleSystem("explosion_m79_body") -- playerhit
-- PrecacheParticleSystem("party_fireworks") --
PrecacheParticleSystem("explosion_water") --
PrecacheParticleSystem("fire_vehicle") -- helicrush
PrecacheParticleSystem("explosion") -- heliflyburn
PrecacheParticleSystem("explosion_flashbang") -- medium
PrecacheParticleSystem("explosion_he_flashbang") -- big
PrecacheParticleSystem("HE_smoke_grenade_smoke") -- m18 purple
PrecacheParticleSystem("smoke_grenade_smoke") -- m18 green
PrecacheParticleSystem("artillery_smoke_blue") -- flare
PrecacheParticleSystem("artillery_smoke_red") -- flare
PrecacheParticleSystem("m79_trail") --
function AddAmmoType(name, text)
game.AddAmmoType({name = name})
if CLIENT then
language.Add(name .. "_ammo", text)
end
end
--PISTOL
AddAmmoType("9x18mm", "9x18MM")
AddAmmoType("9x19mm", "9x19MM")
AddAmmoType(".45acp", ".45 ACP")
AddAmmoType(".357magnum", ".357 Magnum")
AddAmmoType(".454casull", ".454 Casull")
AddAmmoType(".50ae", ".50AE")
AddAmmoType("9x18mmap", "9x18MM AP")
AddAmmoType("9x19mmap", "9x19MM AP")
AddAmmoType(".45acphs", ".45 ACP HS")
AddAmmoType(".357magnumap", ".357 Magnum AP")
AddAmmoType(".50aeap", ".50AE AP")
AddAmmoType(".454casullap", ".454 Casull AP")
AddAmmoType("9x39mm", "9x39MM")
AddAmmoType("7.62x39mm", "7.62x39MM")
AddAmmoType("5.56x45mm", "5.56x45MM")
AddAmmoType("5.45x39mm", "5.45x39MM")
AddAmmoType("12.7x55mm", "12.7x55MM")
AddAmmoType("5.7x28mm", "5.7x28MM")
AddAmmoType(".50bmg", ".50 BMG")
AddAmmoType("7.62x54mm", "7.62x54MM")
AddAmmoType("7.62x51mm", "7.62x51MM")
AddAmmoType(".338lapua", ".338 Lapua")
AddAmmoType("12gauge", "12 Gauge")
AddAmmoType("12gauge_50bmg", "12 Gauge .50BMG Slug")
AddAmmoType("23x75mm", "23x75MM")
AddAmmoType("23x75mmap", "23x75MM S-25")
AddAmmoType("23x75mmzvezda", "23x75MM Zvezda")
--ADDITIONAL
AddAmmoType("9x39mmap", "9x39MM AP")
AddAmmoType("9x39mmsp", "9x39MM SP")
AddAmmoType("7.62x39mmap", "7.62x39MM AP")
AddAmmoType("5.56x45mmap", "5.56x45MM AP")
AddAmmoType("5.45x39mmap", "5.45x39MM AP")
AddAmmoType("12.7x55mmap", "12.7x55MM AP")
AddAmmoType("5.7x28mmap", "5.7x28MM AP")
AddAmmoType("7.62x54mmap", "7.62x54MM AP")
AddAmmoType("7.62x54mmsp", "7.62x54MM SP")
AddAmmoType("7.62x51mmap", "7.62x51MM AP")
AddAmmoType("12gaugeincendiary", "12 Gauge Incendiary")
AddAmmoType("12gaugeslug", "12 Gauge Slug")
-- AddAmmoType("9x18mmtr", "9x18MM Tracer")
AddAmmoType("40mmhe", "40MM HE")
AddAmmoType("vog25", "VOG-25")
AddAmmoType("vog30", "VOG-30")
AddAmmoType("40mmsmoke", "40MM Smoke")
AddAmmoType("60mmp1ap", "M60P1 AP")
AddAmmoType("m67_nades", "M67 Grenades")
AddAmmoType("m18_nades", "M18 Grenades")
AddAmmoType("m84_nades", "M84 Grenades")
AddAmmoType("rpg26_rocket", "RPG 26 Rocket")

View File

@@ -0,0 +1,6 @@
local hudcolor = Color(255, 255, 255, 255)
if killicon and killicon.Add then
killicon.Add("tfa_panzerfaust3_rocket", "vgui/hud/tfa_ins2_panzerfaust3", hudcolor)
killicon.Add("tfa_ins2_panzerfaust3", "vgui/hud/tfa_ins2_panzerfaust3", hudcolor)
end

View File

@@ -0,0 +1,838 @@
//Sound,Impact
// 1 2 3 4 5
//Dirt, Concrete, Metal, Glass, Flesh
// 1 2 3 4 5 6 7 8 9
//Dust, Dirt, Sand, Metal, Smoke, Wood, Glass, Blood, YellowBlood
local mats={
[MAT_ALIENFLESH] ={5,9},
[MAT_ANTLION] ={5,9},
[MAT_BLOODYFLESH] ={5,8},
[45] ={5,8}, // Metrocop heads are a source glitch, they have no enumeration
[MAT_CLIP] ={3,5},
[MAT_COMPUTER] ={4,5},
[MAT_FLESH] ={5,8},
[MAT_GRATE] ={3,4},
[MAT_METAL] ={3,4},
[MAT_PLASTIC] ={2,5},
[MAT_SLOSH] ={5,5},
[MAT_VENT] ={3,4},
[MAT_FOLIAGE] ={1,5},
[MAT_TILE] ={2,5},
[MAT_CONCRETE] ={2,1},
[MAT_DIRT] ={1,2},
--[85] ={1,2},
[MAT_SAND] ={1,3},
[MAT_WOOD] ={2,6},
[MAT_GLASS] ={4,7},
}
local sounds={
[1]={"Bullet.Dirt",},
[2]={"Bullet.Concrete",},
[3]={"Bullet.Metal",},
[4]={"Bullet.Glass",},
[5]={"Bullet.Flesh",},
}
function EFFECT:Init(data)
self.Entity = data:GetEntity() // Entity determines what is creating the dynamic light //
self.Pos = data:GetOrigin() // Origin determines the global position of the effect //
self.Scale = data:GetScale() // Scale determines how large the effect is //
self.Radius = data:GetRadius() or 1 // Radius determines what type of effect to create, default is Concrete //
self.DirVec = data:GetNormal() // Normal determines the direction of impact for the effect //
self.PenVec = data:GetStart() // PenVec determines the direction of the round for penetrations //
self.Particles = data:GetMagnitude() // Particles determines how many puffs to make, primarily for "trails" //
self.Angle = self.DirVec:Angle() // Angle is the angle of impact from Normal //
self.DebrizzlemyNizzle = 10+data:GetScale() // Debrizzle my Nizzle is how many "trails" to make //
self.Size = 5*self.Scale // Size is exclusively for the explosion "trails" size //
self.Emitter = ParticleEmitter( self.Pos ) // Emitter must be there so you don't get an error //
if self.Scale<1.2 then
sound.Play( "ambient/explosions/explode_" .. math.random(1, 4) .. ".wav", self.Pos, 100, 100 )
else
sound.Play( "Explosion.Boom", self.Pos)
sound.Play( "ambient/explosions/explode_" .. math.random(1, 4) .. ".wav", self.Pos, 100, 100 )
end
self.Mat=math.ceil(self.Radius)
foundTheMat = false
for k, v in pairs(mats) do
if k == self.Mat then
foundTheMat = true
continue
end
end
if not (foundTheMat) then self.Mat = 84 end
--THERE! I FIXED IT!
if mats[self.Mat][2]==1 then self:Dust()
elseif mats[self.Mat][2]==2 then self:Dirt()
elseif mats[self.Mat][2]==3 then self:Sand()
elseif mats[self.Mat][2]==4 then self:Metal()
elseif mats[self.Mat][2]==5 then self:Smoke()
elseif mats[self.Mat][2]==6 then self:Wood()
elseif mats[self.Mat][2]==7 then self:Glass()
elseif mats[self.Mat][2]==8 then self:Blood()
elseif mats[self.Mat][2]==9 then self:YellowBlood()
else self:Smoke()
end
end
function EFFECT:Dust()
for i=1,5 do
local Flash = self.Emitter:Add( "effects/muzzleflash"..math.random(1,4), self.Pos )
if (Flash) then
Flash:SetVelocity( self.DirVec*100 )
Flash:SetAirResistance( 200 )
Flash:SetDieTime( 0.15 )
Flash:SetStartAlpha( 255 )
Flash:SetEndAlpha( 0 )
Flash:SetStartSize( self.Scale*300 )
Flash:SetEndSize( 0 )
Flash:SetRoll( math.Rand(180,480) )
Flash:SetRollDelta( math.Rand(-1,1) )
Flash:SetColor(255,255,255)
end
end
for i=1, 20*self.Scale do
local Dust = self.Emitter:Add( "particle/particle_composite", self.Pos )
if (Dust) then
Dust:SetVelocity( self.DirVec * math.random( 100,400)*self.Scale + ((VectorRand():GetNormalized()*300)*self.Scale) )
Dust:SetDieTime( math.Rand( 2 , 3 ) )
Dust:SetStartAlpha( 230 )
Dust:SetEndAlpha( 0 )
Dust:SetStartSize( (50*self.Scale) )
Dust:SetEndSize( (100*self.Scale) )
Dust:SetRoll( math.Rand(150, 360) )
Dust:SetRollDelta( math.Rand(-1, 1) )
Dust:SetAirResistance( 150 )
Dust:SetGravity( Vector( 0, 0, math.Rand(-100, -400) ) )
Dust:SetColor( 80,80,80 )
end
end
for i=1, 15*self.Scale do
local Dust = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
if (Dust) then
Dust:SetVelocity( self.DirVec * math.random( 100,400)*self.Scale + ((VectorRand():GetNormalized()*400)*self.Scale) )
Dust:SetDieTime( math.Rand( 1 , 5 )*self.Scale )
Dust:SetStartAlpha( 50 )
Dust:SetEndAlpha( 0 )
Dust:SetStartSize( (80*self.Scale) )
Dust:SetEndSize( (100*self.Scale) )
Dust:SetRoll( math.Rand(150, 360) )
Dust:SetRollDelta( math.Rand(-1, 1) )
Dust:SetAirResistance( 250 )
Dust:SetGravity( Vector( math.Rand( -200 , 200 ), math.Rand( -200 , 200 ), math.Rand( 10 , 100 ) ) )
Dust:SetColor( 90,85,75 )
end
end
for i=1, 25*self.Scale do
local Debris = self.Emitter:Add( "effects/fleck_cement"..math.random(1,2), self.Pos )
if (Debris) then
Debris:SetVelocity ( self.DirVec * math.random(0,700)*self.Scale + VectorRand():GetNormalized() * math.random(0,700)*self.Scale )
Debris:SetDieTime( math.random( 1, 2) * self.Scale )
Debris:SetStartAlpha( 255 )
Debris:SetEndAlpha( 0 )
Debris:SetStartSize( math.random(5,10)*self.Scale)
Debris:SetRoll( math.Rand(0, 360) )
Debris:SetRollDelta( math.Rand(-5, 5) )
Debris:SetAirResistance( 40 )
Debris:SetColor( 60,60,60 )
Debris:SetGravity( Vector( 0, 0, -600) )
end
end
local Angle = self.DirVec:Angle()
for i = 1, self.DebrizzlemyNizzle do /// This part makes the trailers ///
Angle:RotateAroundAxis(Angle:Forward(), (360/self.DebrizzlemyNizzle))
local DustRing = Angle:Up()
local RanVec = self.DirVec*math.Rand(1, 5) + (DustRing*math.Rand(2, 5))
for k = 3, self.Particles do
local Rcolor = math.random(-20,20)
local particle1 = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
particle1:SetVelocity((VectorRand():GetNormalized()*math.Rand(1, 2) * self.Size) + (RanVec*self.Size*k*3.5))
particle1:SetDieTime( math.Rand( 0.5, 4 )*self.Scale )
particle1:SetStartAlpha( math.Rand( 90, 100 ) )
particle1:SetEndAlpha(0)
particle1:SetGravity((VectorRand():GetNormalized()*math.Rand(5, 10)* self.Size) + Vector(0,0,-50))
particle1:SetAirResistance( 200+self.Scale*20 )
particle1:SetStartSize( (5*self.Size)-((k/self.Particles)*self.Size*3) )
particle1:SetEndSize( (20*self.Size)-((k/self.Particles)*self.Size) )
particle1:SetRoll( math.random( -500, 500 )/100 )
particle1:SetRollDelta( math.random( -0.5, 0.5 ) )
particle1:SetColor( 90+Rcolor,87+Rcolor,80+Rcolor )
end
end
end
function EFFECT:Dirt()
for i=1,5 do
local Flash = self.Emitter:Add( "effects/muzzleflash"..math.random(1,4), self.Pos )
if (Flash) then
Flash:SetVelocity( self.DirVec*100 )
Flash:SetAirResistance( 200 )
Flash:SetDieTime( 0.15 )
Flash:SetStartAlpha( 255 )
Flash:SetEndAlpha( 0 )
Flash:SetStartSize( self.Scale*300 )
Flash:SetEndSize( 0 )
Flash:SetRoll( math.Rand(180,480) )
Flash:SetRollDelta( math.Rand(-1,1) )
Flash:SetColor(255,255,255)
end
end
for i=1, 20*self.Scale do
local Dust = self.Emitter:Add( "particle/particle_composite", self.Pos )
if (Dust) then
Dust:SetVelocity( self.DirVec * math.random( 100,400)*self.Scale + ((VectorRand():GetNormalized()*300)*self.Scale) )
Dust:SetDieTime( math.Rand( 2 , 3 ) )
Dust:SetStartAlpha( 230 )
Dust:SetEndAlpha( 0 )
Dust:SetStartSize( (50*self.Scale) )
Dust:SetEndSize( (100*self.Scale) )
Dust:SetRoll( math.Rand(150, 360) )
Dust:SetRollDelta( math.Rand(-1, 1) )
Dust:SetAirResistance( 150 )
Dust:SetGravity( Vector( 0, 0, math.Rand(-100, -400) ) )
Dust:SetColor( 90,83,68 )
end
end
for i=1, 15*self.Scale do
local Dust = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
if (Dust) then
Dust:SetVelocity( self.DirVec * math.random( 100,400)*self.Scale + ((VectorRand():GetNormalized()*400)*self.Scale) )
Dust:SetDieTime( math.Rand( 1 , 5 )*self.Scale )
Dust:SetStartAlpha( 50 )
Dust:SetEndAlpha( 0 )
Dust:SetStartSize( (80*self.Scale) )
Dust:SetEndSize( (100*self.Scale) )
Dust:SetRoll( math.Rand(150, 360) )
Dust:SetRollDelta( math.Rand(-1, 1) )
Dust:SetAirResistance( 250 )
Dust:SetGravity( Vector( math.Rand( -200 , 200 ), math.Rand( -200 , 200 ), math.Rand( 10 , 100 ) ) )
Dust:SetColor( 90,83,68 )
end
end
for i=1, 25*self.Scale do
local Debris = self.Emitter:Add( "effects/fleck_cement"..math.random(1,2), self.Pos )
if (Debris) then
Debris:SetVelocity ( self.DirVec * math.random(0,700)*self.Scale + VectorRand():GetNormalized() * math.random(0,700)*self.Scale )
Debris:SetDieTime( math.random( 1, 2) * self.Scale )
Debris:SetStartAlpha( 255 )
Debris:SetEndAlpha( 0 )
Debris:SetStartSize( math.random(5,10)*self.Scale)
Debris:SetRoll( math.Rand(0, 360) )
Debris:SetRollDelta( math.Rand(-5, 5) )
Debris:SetAirResistance( 40 )
Debris:SetColor( 50,53,45 )
Debris:SetGravity( Vector( 0, 0, -600) )
end
end
local Angle = self.DirVec:Angle()
for i = 1, self.DebrizzlemyNizzle do /// This part makes the trailers ///
Angle:RotateAroundAxis(Angle:Forward(), (360/self.DebrizzlemyNizzle))
local DustRing = Angle:Up()
local RanVec = self.DirVec*math.Rand(2, 6) + (DustRing*math.Rand(1, 4))
for k = 3, self.Particles do
local Rcolor = math.random(-20,20)
local particle1 = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
particle1:SetVelocity((VectorRand():GetNormalized()*math.Rand(1, 2) * self.Size) + (RanVec*self.Size*k*3.5))
particle1:SetDieTime( math.Rand( 0.5, 4 )*self.Scale )
particle1:SetStartAlpha( math.Rand( 90, 100 ) )
particle1:SetEndAlpha(0)
particle1:SetGravity((VectorRand():GetNormalized()*math.Rand(5, 10)* self.Size) + Vector(0,0,-50))
particle1:SetAirResistance( 200+self.Scale*20 )
particle1:SetStartSize( (5*self.Size)-((k/self.Particles)*self.Size*3) )
particle1:SetEndSize( (20*self.Size)-((k/self.Particles)*self.Size) )
particle1:SetRoll( math.random( -500, 500 )/100 )
particle1:SetRollDelta( math.random( -0.5, 0.5 ) )
particle1:SetColor( 90+Rcolor,83+Rcolor,68+Rcolor )
end
end
end
function EFFECT:Sand()
for i=0, 45*self.Scale do // This is the main plume
local Smoke = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
if (Smoke) then
Smoke:SetVelocity( self.DirVec * math.random( 50,1000*self.Scale) + VectorRand():GetNormalized()*300*self.Scale )
Smoke:SetDieTime( math.Rand( 1 , 5 )*self.Scale )
Smoke:SetStartAlpha( math.Rand( 100, 120 ) )
Smoke:SetEndAlpha( 0 )
Smoke:SetStartSize( 50*self.Scale )
Smoke:SetEndSize( 120*self.Scale )
Smoke:SetRoll( math.Rand(150, 360) )
Smoke:SetRollDelta( math.Rand(-1, 1) )
Smoke:SetAirResistance( 200 )
Smoke:SetGravity( Vector( 0, 0, math.Rand(-100, -400) ) )
Smoke:SetColor( 90,83,68 )
end
end
for i=0, 20*self.Scale do // This is the dirt kickup
local Dust = self.Emitter:Add( "particle/particle_composite", self.Pos )
if (Dust) then
Dust:SetVelocity( self.DirVec * math.random( 100,700)*self.Scale + VectorRand():GetNormalized()*250*self.Scale )
Dust:SetDieTime( math.Rand( 0.5 , 1,5 ) )
Dust:SetStartAlpha( 200 )
Dust:SetEndAlpha( 0 )
Dust:SetStartSize( 60*self.Scale )
Dust:SetEndSize( 90*self.Scale )
Dust:SetRoll( math.Rand(150, 360) )
Dust:SetRollDelta( math.Rand(-1, 1) )
Dust:SetAirResistance( 200 )
Dust:SetGravity( Vector( 0, 0, math.Rand(-100, -400) ) )
Dust:SetColor( 90,83,68 )
end
end
for i=0, 25*self.Scale do // Chunkage
local Debris = self.Emitter:Add( "effects/fleck_cement"..math.random(1,2), self.Pos )
if (Debris) then
Debris:SetVelocity ( self.DirVec * math.random(50,900)*self.Scale + VectorRand():GetNormalized() * math.random(0,700)*self.Scale )
Debris:SetDieTime( math.random( 1, 2) * self.Scale )
Debris:SetStartAlpha( 255 )
Debris:SetEndAlpha( 0 )
Debris:SetStartSize( math.random(5,8)*self.Scale )
Debris:SetRoll( math.Rand(0, 360) )
Debris:SetRollDelta( math.Rand(-5, 5) )
Debris:SetAirResistance( 40 )
Debris:SetColor( 53,50,45 )
Debris:SetGravity( Vector( 0, 0, -600) )
end
end
for i=0, 25*self.Scale do // Shrapnel
local Shrapnel = self.Emitter:Add( "effects/fleck_cement"..math.random(1,2), self.Pos+self.DirVec )
if (Shrapnel) then
Shrapnel:SetVelocity ( (self.DirVec*700*self.Scale) + (VectorRand():GetNormalized() * 1000*self.Scale) )
Shrapnel:SetDieTime( math.random( 0.3, 0.5) * self.Scale )
Shrapnel:SetStartAlpha( 255 )
Shrapnel:SetEndAlpha( 0 )
Shrapnel:SetStartSize( math.random(4,7)*self.Scale )
Shrapnel:SetRoll( math.Rand(0, 360) )
Shrapnel:SetRollDelta( math.Rand(-5, 5) )
Shrapnel:SetAirResistance( 10 )
Shrapnel:SetColor( 53,50,45 )
Shrapnel:SetGravity( Vector( 0, 0, -600) )
Shrapnel:SetCollide( true )
Shrapnel:SetBounce( 0.8 )
end
end
for i=1,5 do // Blast flash
local Flash = self.Emitter:Add( "effects/muzzleflash"..math.random(1,4), self.Pos )
if (Flash) then
Flash:SetVelocity( self.DirVec*100 )
Flash:SetAirResistance( 200 )
Flash:SetDieTime( 0.10 )
Flash:SetStartAlpha( 255 )
Flash:SetEndAlpha( 0 )
Flash:SetStartSize( self.Scale*200 )
Flash:SetEndSize( 0 )
Flash:SetRoll( math.Rand(180,480) )
Flash:SetRollDelta( math.Rand(-1,1) )
Flash:SetColor(255,255,255)
end
end
for i=0, 10*self.Scale do
local Smoke = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
if (Smoke) then
Smoke:SetVelocity( self.DirVec * math.random( 30,120*self.Scale) + VectorRand():GetNormalized() * math.random( 50,100*self.Scale) )
Smoke:SetDieTime( math.Rand( 0.5 , 1 )*self.Scale )
Smoke:SetStartAlpha( math.Rand( 80, 100 ) )
Smoke:SetEndAlpha( 0 )
Smoke:SetStartSize( 10*self.Scale )
Smoke:SetEndSize( 30*self.Scale )
Smoke:SetRoll( math.Rand(150, 360) )
Smoke:SetRollDelta( math.Rand(-2, 2) )
Smoke:SetAirResistance( 100 )
Smoke:SetGravity( Vector( math.random(-20,20)*self.Scale, math.random(-20,20)*self.Scale, 250 ) )
Smoke:SetColor( 90,83,68 )
end
end
for i=0, 5*self.Scale do
local Whisp = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
if (Whisp) then
Whisp:SetVelocity(VectorRand():GetNormalized() * math.random( 300,600*self.Scale) )
Whisp:SetDieTime( math.Rand( 4 , 10 )*self.Scale/2 )
Whisp:SetStartAlpha( math.Rand( 30, 40 ) )
Whisp:SetEndAlpha( 0 )
Whisp:SetStartSize( 70*self.Scale )
Whisp:SetEndSize( 100*self.Scale )
Whisp:SetRoll( math.Rand(150, 360) )
Whisp:SetRollDelta( math.Rand(-2, 2) )
Whisp:SetAirResistance( 300 )
Whisp:SetGravity( Vector( math.random(-40,40)*self.Scale, math.random(-40,40)*self.Scale, 0 ) )
Whisp:SetColor( 150,150,150 )
end
end
local Density = 40*self.Scale /// This part is for the dust ring ///
local Angle = self.DirVec:Angle()
for i=0, Density do
Angle:RotateAroundAxis(Angle:Forward(), (360/Density))
local ShootVector = Angle:Up()
local Smoke = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
if (Smoke) then
Smoke:SetVelocity( ShootVector * math.Rand(50,700*self.Scale) )
Smoke:SetDieTime( math.Rand( 1 , 4 )*self.Scale )
Smoke:SetStartAlpha( math.Rand( 90, 120 ) )
Smoke:SetEndAlpha( 0 )
Smoke:SetStartSize( 40*self.Scale )
Smoke:SetEndSize( 70*self.Scale )
Smoke:SetRoll( math.Rand(0, 360) )
Smoke:SetRollDelta( math.Rand(-1, 1) )
Smoke:SetAirResistance( 200 )
Smoke:SetGravity( Vector( math.Rand( -200 , 200 ), math.Rand( -200 , 200 ), math.Rand( 10 , 100 ) ) )
Smoke:SetColor( 90,83,68 )
end
end
end
function EFFECT:Metal()
sound.Play( "Bullet.Impact", self.Pos)
for i=1,5 do // Blast flash
local Flash = self.Emitter:Add( "effects/muzzleflash"..math.random(1,4), self.Pos )
if (Flash) then
Flash:SetVelocity( self.DirVec*100 )
Flash:SetAirResistance( 200 )
Flash:SetDieTime( 0.15 )
Flash:SetStartAlpha( 255 )
Flash:SetEndAlpha( 0 )
Flash:SetStartSize( self.Scale*200 )
Flash:SetEndSize( 0 )
Flash:SetRoll( math.Rand(180,480) )
Flash:SetRollDelta( math.Rand(-1,1) )
Flash:SetColor(255,255,255)
end
end
for i=0, 30*self.Scale do
local Whisp = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
if (Whisp) then
Whisp:SetVelocity(VectorRand():GetNormalized() * math.random( 200,1000*self.Scale) )
Whisp:SetDieTime( math.Rand( 4 , 10 )*self.Scale/2 )
Whisp:SetStartAlpha( math.Rand( 50, 70 ) )
Whisp:SetEndAlpha( 0 )
Whisp:SetStartSize( 70*self.Scale )
Whisp:SetEndSize( 100*self.Scale )
Whisp:SetRoll( math.Rand(150, 360) )
Whisp:SetRollDelta( math.Rand(-2, 2) )
Whisp:SetAirResistance( 300 )
Whisp:SetGravity( Vector( math.random(-40,40)*self.Scale, math.random(-40,40)*self.Scale, 0 ) )
Whisp:SetColor( 120,120,120 )
end
end
for i=0, 30*self.Scale do
local Sparks = self.Emitter:Add( "effects/spark", self.Pos )
if (Sparks) then
Sparks:SetVelocity( ((self.DirVec*0.75)+VectorRand()) * math.Rand(200, 600)*self.Scale )
Sparks:SetDieTime( math.Rand(0.3, 1) )
Sparks:SetStartAlpha( 255 )
Sparks:SetStartSize( math.Rand(7, 15)*self.Scale )
Sparks:SetEndSize( 0 )
Sparks:SetRoll( math.Rand(0, 360) )
Sparks:SetRollDelta( math.Rand(-5, 5) )
Sparks:SetAirResistance( 20 )
Sparks:SetGravity( Vector( 0, 0, -600 ) )
end
end
for i=0, 10*self.Scale do
local Sparks = self.Emitter:Add( "effects/yellowflare", self.Pos )
if (Sparks) then
Sparks:SetVelocity( VectorRand() * math.Rand(200, 600)*self.Scale )
Sparks:SetDieTime( math.Rand(1, 1.7) )
Sparks:SetStartAlpha( 200 )
Sparks:SetStartSize( math.Rand(10, 13)*self.Scale )
Sparks:SetEndSize( 0 )
Sparks:SetRoll( math.Rand(0, 360) )
Sparks:SetRollDelta( math.Rand(-5, 5) )
Sparks:SetAirResistance( 100 )
Sparks:SetGravity( Vector( 0, 0, -60 ) )
end
end
end
function EFFECT:Smoke()
sound.Play( "Bullet.Impact", self.Pos)
for i=1,5 do // Blast flash
local Flash = self.Emitter:Add( "effects/muzzleflash"..math.random(1,4), self.Pos )
if (Flash) then
Flash:SetVelocity( self.DirVec*100 )
Flash:SetAirResistance( 200 )
Flash:SetDieTime( 0.15 )
Flash:SetStartAlpha( 255 )
Flash:SetEndAlpha( 0 )
Flash:SetStartSize( self.Scale*200 )
Flash:SetEndSize( 0 )
Flash:SetRoll( math.Rand(180,480) )
Flash:SetRollDelta( math.Rand(-1,1) )
Flash:SetColor(255,255,255)
end
end
for i=0, 30*self.Scale do
local Whisp = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
if (Whisp) then
Whisp:SetVelocity(VectorRand():GetNormalized() * math.random( 200,1200*self.Scale) )
Whisp:SetDieTime( math.Rand( 4 , 10 )*self.Scale/2 )
Whisp:SetStartAlpha( math.Rand( 35, 50 ) )
Whisp:SetEndAlpha( 0 )
Whisp:SetStartSize( 70*self.Scale )
Whisp:SetEndSize( 100*self.Scale )
Whisp:SetRoll( math.Rand(150, 360) )
Whisp:SetRollDelta( math.Rand(-2, 2) )
Whisp:SetAirResistance( 300 )
Whisp:SetGravity( Vector( math.random(-40,40)*self.Scale, math.random(-40,40)*self.Scale, 0 ) )
Whisp:SetColor( 120,120,120 )
end
end
for i=1, 25*self.Scale do
local Debris = self.Emitter:Add( "effects/fleck_tile"..math.random(1,2), self.Pos )
if (Debris) then
Debris:SetVelocity ( self.DirVec * math.random(100,600)*self.Scale + VectorRand():GetNormalized() * math.random(100,1200)*self.Scale )
Debris:SetDieTime( math.random( 1, 3) * self.Scale )
Debris:SetStartAlpha( 255 )
Debris:SetEndAlpha( 0 )
Debris:SetStartSize( math.random(5,10)*self.Scale)
Debris:SetRoll( math.Rand(0, 360) )
Debris:SetRollDelta( math.Rand(-5, 5) )
Debris:SetAirResistance( 40 )
Debris:SetColor( 70,70,70 )
Debris:SetGravity( Vector( 0, 0, -600) )
end
end
local Angle = self.DirVec:Angle()
for i = 1, self.DebrizzlemyNizzle do /// This part makes the trailers ///
Angle:RotateAroundAxis(Angle:Forward(), (360/self.DebrizzlemyNizzle))
local DustRing = Angle:Up()
local RanVec = self.DirVec*math.Rand(1, 4) + (DustRing*math.Rand(3, 4))
for k = 3, self.Particles do
local Rcolor = math.random(-20,20)
local particle1 = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
particle1:SetVelocity((VectorRand():GetNormalized()*math.Rand(1, 2) * self.Size) + (RanVec*self.Size*k*3.5))
particle1:SetDieTime( math.Rand( 0, 3 )*self.Scale )
particle1:SetStartAlpha( math.Rand( 90, 100 ) )
particle1:SetEndAlpha(0)
particle1:SetGravity((VectorRand():GetNormalized()*math.Rand(5, 10)* self.Size) + Vector(0,0,-50))
particle1:SetAirResistance( 200+self.Scale*20 )
particle1:SetStartSize( (5*self.Size)-((k/self.Particles)*self.Size*3) )
particle1:SetEndSize( (20*self.Size)-((k/self.Particles)*self.Size) )
particle1:SetRoll( math.random( -500, 500 )/100 )
particle1:SetRollDelta( math.random( -0.5, 0.5 ) )
particle1:SetColor( 90+Rcolor,85+Rcolor,75+Rcolor )
end
end
end
function EFFECT:Wood()
for i=1,5 do
local Flash = self.Emitter:Add( "effects/muzzleflash"..math.random(1,4), self.Pos )
if (Flash) then
Flash:SetVelocity( self.DirVec*100 )
Flash:SetAirResistance( 200 )
Flash:SetDieTime( 0.15 )
Flash:SetStartAlpha( 255 )
Flash:SetEndAlpha( 0 )
Flash:SetStartSize( self.Scale*200 )
Flash:SetEndSize( 0 )
Flash:SetRoll( math.Rand(180,480) )
Flash:SetRollDelta( math.Rand(-1,1) )
Flash:SetColor(255,255,255)
end
end
for i=0, 30*self.Scale do
local Whisp = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
if (Whisp) then
Whisp:SetVelocity(VectorRand():GetNormalized() * math.random( 200,1000)*self.Scale )
Whisp:SetDieTime( math.Rand( 4 , 10 )*self.Scale/2 )
Whisp:SetStartAlpha( math.Rand( 70, 90 ) )
Whisp:SetEndAlpha( 0 )
Whisp:SetStartSize( 70*self.Scale )
Whisp:SetEndSize( 100*self.Scale )
Whisp:SetRoll( math.Rand(150, 360) )
Whisp:SetRollDelta( math.Rand(-2, 2) )
Whisp:SetAirResistance( 300 )
Whisp:SetGravity( Vector( math.random(-40,40)*self.Scale, math.random(-40,40)*self.Scale, 0 ) )
Whisp:SetColor( 90,85,75 )
end
end
for i=0, 20*self.Scale do
local Debris = self.Emitter:Add( "effects/fleck_wood"..math.random(1,2), self.Pos+self.DirVec )
if (Debris) then
Debris:SetVelocity( self.DirVec * math.random(50,500)*self.Scale + VectorRand():GetNormalized() * math.random(200,900)*self.Scale )
Debris:SetDieTime( math.random( 0.75, 2) )
Debris:SetStartAlpha( 255 )
Debris:SetEndAlpha( 0 )
Debris:SetStartSize( math.random(10,15)*self.Scale )
Debris:SetRoll( math.Rand(0, 360) )
Debris:SetRollDelta( math.Rand(-5, 5) )
Debris:SetAirResistance( 70 )
Debris:SetColor( 90,85,75 )
Debris:SetGravity( Vector( 0, 0, -600) )
end
end
end
function EFFECT:Glass()
for i=1,5 do // Blast flash
local Flash = self.Emitter:Add( "effects/muzzleflash"..math.random(1,4), self.Pos )
if (Flash) then
Flash:SetVelocity( self.DirVec*100 )
Flash:SetAirResistance( 200 )
Flash:SetDieTime( 0.15 )
Flash:SetStartAlpha( 255 )
Flash:SetEndAlpha( 0 )
Flash:SetStartSize( self.Scale*200 )
Flash:SetEndSize( 0 )
Flash:SetRoll( math.Rand(180,480) )
Flash:SetRollDelta( math.Rand(-1,1) )
Flash:SetColor(255,255,255)
end
end
for i=0, 30*self.Scale do
local Debris = self.Emitter:Add( "effects/fleck_glass"..math.random(1,3), self.Pos )
if (Debris) then
Debris:SetVelocity ( VectorRand():GetNormalized() * math.random(100,600)*self.Scale )
Debris:SetDieTime( math.random( 1, 2.5) )
Debris:SetStartAlpha( 255 )
Debris:SetEndAlpha( 0 )
Debris:SetStartSize( math.random(3,7)*self.Scale )
Debris:SetRoll( math.Rand(0, 360) )
Debris:SetRollDelta( math.Rand(-15, 15) )
Debris:SetAirResistance( 50 )
Debris:SetColor( 200,200,200 )
Debris:SetGravity( Vector( 0, 0, -600) )
Debris:SetCollide( true )
Debris:SetBounce( 0.5 )
end
end
for i=0, 30*self.Scale do
local Whisp = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
if (Whisp) then
Whisp:SetVelocity(VectorRand():GetNormalized() * math.random( 200,800*self.Scale) )
Whisp:SetDieTime( math.Rand( 4 , 10 )*self.Scale/2 )
Whisp:SetStartAlpha( math.Rand( 35, 50 ) )
Whisp:SetEndAlpha( 0 )
Whisp:SetStartSize( 70*self.Scale )
Whisp:SetEndSize( 100*self.Scale )
Whisp:SetRoll( math.Rand(150, 360) )
Whisp:SetRollDelta( math.Rand(-2, 2) )
Whisp:SetAirResistance( 300 )
Whisp:SetGravity( Vector( math.random(-40,40)*self.Scale, math.random(-40,40)*self.Scale, 0 ) )
Whisp:SetColor( 150,150,150 )
end
end
end
function EFFECT:Blood()
for i=0, 30*self.Scale do // If you recieve over 50,000 joules of energy, you become red mist.
local Smoke = self.Emitter:Add( "particle/particle_composite", self.Pos )
if (Smoke) then
Smoke:SetVelocity( VectorRand():GetNormalized()*math.random(100,600)*self.Scale )
Smoke:SetDieTime( math.Rand( 1 , 2 ) )
Smoke:SetStartAlpha( 80 )
Smoke:SetEndAlpha( 0 )
Smoke:SetStartSize( 30*self.Scale )
Smoke:SetEndSize( 100*self.Scale )
Smoke:SetRoll( math.Rand(150, 360) )
Smoke:SetRollDelta( math.Rand(-2, 2) )
Smoke:SetAirResistance( 400 )
Smoke:SetGravity( Vector( math.Rand(-50, 50) * self.Scale, math.Rand(-50, 50) * self.Scale, math.Rand(0, -200) ) )
Smoke:SetColor( 70,35,35 )
end
end
for i=0, 20*self.Scale do // Add some finer details....
local Smoke = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
if (Smoke) then
Smoke:SetVelocity( VectorRand():GetNormalized()*math.random(200,600)*self.Scale )
Smoke:SetDieTime( math.Rand( 1 , 4 ) )
Smoke:SetStartAlpha( 120 )
Smoke:SetEndAlpha( 0 )
Smoke:SetStartSize( 30*self.Scale )
Smoke:SetEndSize( 100*self.Scale )
Smoke:SetRoll( math.Rand(150, 360) )
Smoke:SetRollDelta( math.Rand(-2, 2) )
Smoke:SetAirResistance( 400 )
Smoke:SetGravity( Vector( math.Rand(-50, 50) * self.Scale, math.Rand(-50, 50) * self.Scale, math.Rand(-50, -300) ) )
Smoke:SetColor( 70,35,35 )
end
end
for i=1,5 do // Into the flash!
local Flash = self.Emitter:Add( "effects/muzzleflash"..math.random(1,4), self.Pos )
if (Flash) then
Flash:SetVelocity( self.DirVec*100 )
Flash:SetAirResistance( 200 )
Flash:SetDieTime( 0.15 )
Flash:SetStartAlpha( 255 )
Flash:SetEndAlpha( 0 )
Flash:SetStartSize( self.Scale*300 )
Flash:SetEndSize( 0 )
Flash:SetRoll( math.Rand(180,480) )
Flash:SetRollDelta( math.Rand(-1,1) )
Flash:SetColor(255,255,255)
end
end
for i=1, 20*self.Scale do // Chunkage NOT contained
local Debris = self.Emitter:Add( "effects/fleck_cement"..math.random(1,2), self.Pos-(self.DirVec*5) )
if (Debris) then
Debris:SetVelocity ( VectorRand():GetNormalized() * 400*self.Scale )
Debris:SetDieTime( math.random( 0.3, 0.6) )
Debris:SetStartAlpha( 255 )
Debris:SetEndAlpha( 0 )
Debris:SetStartSize( 8 )
Debris:SetEndSize( 9 )
Debris:SetRoll( math.Rand(0, 360) )
Debris:SetRollDelta( math.Rand(-5, 5) )
Debris:SetAirResistance( 30 )
Debris:SetColor( 70,35,35 )
Debris:SetGravity( Vector( 0, 0, -600) )
Debris:SetCollide( true )
Debris:SetBounce( 0.2 )
end
end
end
function EFFECT:YellowBlood()
for i=0, 30*self.Scale do // If you recieve over 50,000 joules of energy, you become red mist.
local Smoke = self.Emitter:Add( "particle/particle_composite", self.Pos )
if (Smoke) then
Smoke:SetVelocity( VectorRand():GetNormalized()*math.random(100,600)*self.Scale )
Smoke:SetDieTime( math.Rand( 1 , 2 ) )
Smoke:SetStartAlpha( 80 )
Smoke:SetEndAlpha( 0 )
Smoke:SetStartSize( 30*self.Scale )
Smoke:SetEndSize( 100*self.Scale )
Smoke:SetRoll( math.Rand(150, 360) )
Smoke:SetRollDelta( math.Rand(-2, 2) )
Smoke:SetAirResistance( 400 )
Smoke:SetGravity( Vector( math.Rand(-50, 50) * self.Scale, math.Rand(-50, 50) * self.Scale, math.Rand(0, -200) ) )
Smoke:SetColor( 120,120,0 )
end
end
for i=0, 20*self.Scale do // Add some finer details....
local Smoke = self.Emitter:Add( "particle/smokesprites_000"..math.random(1,9), self.Pos )
if (Smoke) then
Smoke:SetVelocity( VectorRand():GetNormalized()*math.random(200,600)*self.Scale )
Smoke:SetDieTime( math.Rand( 1 , 4 ) )
Smoke:SetStartAlpha( 120 )
Smoke:SetEndAlpha( 0 )
Smoke:SetStartSize( 30*self.Scale )
Smoke:SetEndSize( 100*self.Scale )
Smoke:SetRoll( math.Rand(150, 360) )
Smoke:SetRollDelta( math.Rand(-2, 2) )
Smoke:SetAirResistance( 400 )
Smoke:SetGravity( Vector( math.Rand(-50, 50) * self.Scale, math.Rand(-50, 50) * self.Scale, math.Rand(-50, -300) ) )
Smoke:SetColor( 120,120,0 )
end
end
for i=1,5 do // Into the flash!
local Flash = self.Emitter:Add( "effects/muzzleflash"..math.random(1,4), self.Pos )
if (Flash) then
Flash:SetVelocity( self.DirVec*100 )
Flash:SetAirResistance( 200 )
Flash:SetDieTime( 0.15 )
Flash:SetStartAlpha( 255 )
Flash:SetEndAlpha( 0 )
Flash:SetStartSize( self.Scale*300 )
Flash:SetEndSize( 0 )
Flash:SetRoll( math.Rand(180,480) )
Flash:SetRollDelta( math.Rand(-1,1) )
Flash:SetColor(255,255,255)
end
end
for i=1, 20*self.Scale do // Chunkage NOT contained
local Debris = self.Emitter:Add( "effects/fleck_cement"..math.random(1,2), self.Pos-(self.DirVec*5) )
if (Debris) then
Debris:SetVelocity ( VectorRand():GetNormalized() * 400*self.Scale )
Debris:SetDieTime( math.random( 0.3, 0.6) )
Debris:SetStartAlpha( 255 )
Debris:SetEndAlpha( 0 )
Debris:SetStartSize( 8 )
Debris:SetEndSize( 9 )
Debris:SetRoll( math.Rand(0, 360) )
Debris:SetRollDelta( math.Rand(-5, 5) )
Debris:SetAirResistance( 30 )
Debris:SetColor( 120,120,0 )
Debris:SetGravity( Vector( 0, 0, -600) )
Debris:SetCollide( true )
Debris:SetBounce( 0.2 )
end
end
end
function EFFECT:Think( )
return false
end
function EFFECT:Render()
end

View File

@@ -0,0 +1,34 @@
function EFFECT:Init( data )
local tr = util.TraceLine( {
start = data:GetOrigin(),
endpos = data:GetOrigin() - Vector(0,0,60),
mask = MASK_SOLID_BRUSHONLY
} )
if tr.HitWorld then
ParticleEffect(table.Random({"hd_explosion","hd_explosion","hd_explosion"}), data:GetOrigin(), Angle(0,math.random(0,360),0), nil)
else
ParticleEffect(table.Random({"hd_explosion","hd_explosion","hd_explosion"}), data:GetOrigin(), Angle(0,math.random(0,360),0), nil)
end
sound.Play( "hd/new_grenadeexplo.mp3", data:GetOrigin(), 100, math.random(90,110), 1)
end
function EFFECT:Think()
return false
end
function EFFECT:Render()
end

View File

@@ -0,0 +1,11 @@
include("shared.lua")
function ENT:Draw()
if CurTime() > self:GetNWFloat("HideTime", CurTime() + 1) then
self:DrawModel()
end
end
function ENT:IsTranslucent()
return true
end

View File

@@ -0,0 +1,146 @@
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
local LVS = LVS
ENT.Damage = 0
ENT.Prime = 0.03
ENT.Delay = 30
ENT.HideDelay = 0.0
function ENT:Initialize()
local mdl = self:GetModel()
if not mdl or mdl == "" or mdl == "models/error.mdl" then
self:SetModel("models/Weapons/w_panzerfaust3_sandstorm_projectile.mdl")
end
self.burnout = CurTime() + 2
self:PhysicsInit(SOLID_VPHYSICS)
--self:PhysicsInitSphere((self:OBBMaxs() - self:OBBMins()):Length() / 4, "metal")
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
end
self:SetFriction(self.Delay)
self.killtime = CurTime() + self.Delay
self:DrawShadow(true)
self.StartTime = CurTime()
self:EmitSound( "TFA_INS2_RPG7.Loop" )
self:SetUseType(SIMPLE_USE)
self.HasIdle = true
timer.Simple(0.1, function()
if IsValid(self) then
self:SetOwner()
end
end)
self:SetNWFloat("HideTime",CurTime() + self.HideDelay )
self.HP = math.random(30, 60)
end
function ENT:Think()
if self.killtime < CurTime() then
return false
end
local phys = self:GetPhysicsObject()
local force = phys:GetMass() * Vector( 0, 0, -9.80665 ) * 7-- This gives us the force in kg*source_unit/s^2
local dt = engine.TickInterval() -- The time interval over which the force acts on the object (in seconds)
phys:ApplyForceCenter( force * dt ) -- Multiplying the two gives us the impulse in kg*source_unit/s
self:NextThink(CurTime())
return true
end
local effectdata, shake
function ENT:Explode()
if not IsValid(self.Owner) then
self:Remove()
return
end
local effectdata = EffectData()
effectdata:SetOrigin(self:GetPos())
effectdata:SetScale(10)
effectdata:SetMagnitude(5)
util.Effect("lvs_explosion_small", effectdata)
util.Effect("lvs_explosion_small", effectdata)
util.BlastDamage(self, self.Owner, self:GetPos(), 100, 10)
shake = ents.Create("env_shake")
shake:SetOwner(self.Owner)
shake:SetPos(self:GetPos())
shake:SetKeyValue("amplitude", tostring(20)) -- Power of the shake
shake:SetKeyValue("radius", tostring( 768 ) ) -- Radius of the shake
shake:SetKeyValue("duration", tostring( self.Damage / 800 )) -- Time of shake
shake:SetKeyValue("frequency", "255") -- How har should the screenshake be
shake:SetKeyValue("spawnflags", "4") -- Spawnflags(In Air)
shake:Spawn()
shake:Activate()
shake:Fire("StartShake", "", 0)
self:EmitSound("TFA_INS2_RPG7.2")
local heat = {}
heat.Src = self:GetPos()
heat.Dir = self:GetAngles():Forward()
heat.Spread = Vector(0,0,0)
heat.Force = 20000
heat.HullSize = 0
heat.Damage = 8000
heat.Velocity = 2000
heat.Attacker = self.Owner
LVS:FireBullet( heat )
self:Remove()
end
function ENT:PhysicsCollide(data, phys)
if data.Speed > 60 and CurTime() > self.StartTime + self.Prime then
timer.Simple(0,function()
if IsValid(self) then
self:Explode()
end
end)
else
self.Prime = math.huge
if self.HasIdle then
self:StopSound("TFA_INS2_RPG7.Loop")
self.HasIdle = false
self:SetNWFloat("HideTime", -1 )
end
end
--[[elseif self:GetOwner() ~= self then
self.Prime = math.huge
self:StopSound("TFA_INS2_RPG7.Loop")
self:SetOwner(self)
end
]]--
end
function ENT:OnRemove()
if self.HasIdle then
self:StopSound("TFA_INS2_RPG7.Loop")
self.HasIdle = false
end
end
function ENT:Use(activator, caller)
if activator:IsPlayer() and self.WeaponClass and activator:GetWeapon(self.WeaponClass) then
activator:GiveAmmo(1, activator:GetWeapon(self.WeaponClass):GetPrimaryAmmoType(), false)
self:Remove()
end
end
function ENT:OnTakeDamage( dmg )
if dmg:GetInflictor() == self or dmg:GetAttacker() == self then return end
if self.Exploded then return end
if self.HP > 0 and self.HP - dmg:GetDamage() <= 0 then
self.Exploded = true
self:Explode()
end
self.HP = self.HP - dmg:GetDamage()
dmg:SetAttacker(self)
dmg:SetInflictor(self)
self:TakePhysicsDamage( dmg )
end

View File

@@ -0,0 +1,8 @@
ENT.Type = "anim"
ENT.PrintName = "Contact Explosive"
ENT.Author = ""
ENT.Contact = ""
ENT.Purpose = ""
ENT.Instructions = ""
ENT.DoNotDuplicate = true
ENT.DisableDuplicator = true

View File

@@ -0,0 +1,11 @@
include("shared.lua")
function ENT:Draw()
if CurTime() > self:GetNWFloat("HideTime", 0) then
self:DrawModel()
end
end
function ENT:IsTranslucent()
return true
end

View File

@@ -0,0 +1,229 @@
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
local LVS = LVS
ENT.Damage = 0
ENT.Prime = 0.03
ENT.Delay = 30
ENT.HideDelay = 0.0
function ENT:Initialize()
if not self:GetModel() or self:GetModel() == "" or self:GetModel() == "models/error.mdl" then
self:SetModel("models/weapons/fas2/world/explosives/rpg26/rocket.mdl")
end
if not self.Owner:IsPlayer() then
self.Owner = NULL
end
self.burnout = CurTime() + 2
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
if IsValid(phys) then
phys:Wake()
end
self:SetFriction(self.Delay)
self.killtime = CurTime() + self.Delay
self.StartTime = CurTime()
self:EmitSound("TFA_INS2_RPG7.Loop")
self:SetUseType(SIMPLE_USE)
self.HasIdle = true
self.HP = math.random(30, 60)
timer.Simple(0.1, function()
if IsValid(self) then
self:SetOwner(self:GetOwner() or NULL)
end
end)
self:SetNWFloat("HideTime", CurTime() + self.HideDelay)
end
function ENT:Think()
local ct = CurTime()
if self.killtime < ct then return false end
local phys = self:GetPhysicsObject()
if not IsValid(phys) then return end
if phys:IsValid() then
phys:ApplyForceCenter(Vector(0, 0, -9.80665 * 7) * phys:GetMass() * engine.TickInterval())
end
self:NextThink(ct)
return true
end
function ENT:Explode()
if self._Exploding then return end
self._Exploding = true
if not IsValid(self.Owner) then
self:Remove()
return
end
local tr = util.TraceLine({
start = pos,
endpos = pos + self:GetAngles():Forward() * 200,
filter = self
})
local hit = tr.Entity
if IsValid(hit) and hit.LVS then
local dmg = DamageInfo()
dmg:SetDamage(250)
dmg:SetDamageType(DMG_BLAST)
dmg:SetAttacker(self.Owner or self)
dmg:SetInflictor(self)
hit:TakeDamageInfo(dmg)
if hit.GetSubSystem then
local subsys = hit:GetSubSystem(tr.HitPos)
if subsys then
subsys:TakeDamage(300)
end
end
end
local pos = self:GetPos()
local effectdata = EffectData()
effectdata:SetOrigin(pos)
effectdata:SetScale(5)
effectdata:SetMagnitude(5)
util.Effect("HelicopterMegaBomb", effectdata)
util.Effect("Explosion", effectdata)
util.BlastDamage(self, self.Owner, pos, 100, 10)
local shake = ents.Create("env_shake")
shake:SetOwner(self.Owner)
shake:SetPos(pos)
shake:SetKeyValue("amplitude", "20")
shake:SetKeyValue("radius", "768")
shake:SetKeyValue("duration", tostring(self.Damage / 800))
shake:SetKeyValue("frequency", "255")
shake:SetKeyValue("spawnflags", "4")
shake:Spawn()
shake:Activate()
shake:Fire("StartShake", "", 0)
self:EmitSound("TFA_INS2_RPG7.2")
LVS:FireBullet({
Src = pos,
Dir = self:GetAngles():Forward(),
Spread = vector_origin,
Force = 42000,
HullSize = 0,
Damage = 12000,
Velocity = 16000,
Attacker = self.Owner
})
local tr = util.TraceHull({
start = pos,
endpos = pos,
mins = Vector(-80, -80, -80),
maxs = Vector(80, 80, 80),
filter = self
})
local hit = tr.Entity
if IsValid(hit) and hit.LVS then
local dmg = DamageInfo()
dmg:SetDamage(200)
dmg:SetDamageType(DMG_BLAST)
dmg:SetAttacker(self.Owner or self)
dmg:SetInflictor(self)
hit:TakeDamageInfo(dmg)
if hit.GetSubSystem then
local subsys = hit:GetSubSystem(pos)
if subsys then
local name = subsys.Name:lower()
if name:find("engine") then
subsys:SetHP(0)
elseif name:find("ammo") then
subsys:SetHP(0)
elseif name:find("fuel") then
subsys:SetHP(0)
else
subsys:TakeDamage(250)
end
end
end
end
self:Remove()
end
function ENT:PhysicsCollide(data, phys)
if self._LastCollide and self._LastCollide > CurTime() - 0.05 then return end
self._LastCollide = CurTime()
local ct = CurTime()
if data.Speed > 60 and ct > self.StartTime + self.Prime then
timer.Simple(0, function()
if IsValid(self) then self:Explode() end
end)
return
end
self.Prime = math.huge
if self.HasIdle then
self:StopSound("TFA_INS2_RPG7.Loop")
self.HasIdle = false
self:SetNWFloat("HideTime", -1)
end
end
function ENT:OnRemove()
if self.HasIdle then
self:StopSound("TFA_INS2_RPG7.Loop")
self.HasIdle = false
end
end
function ENT:Use(activator)
if activator:IsPlayer() and self.WeaponClass then
local wep = activator:GetWeapon(self.WeaponClass)
if IsValid(wep) then
activator:GiveAmmo(1, wep:GetPrimaryAmmoType(), false)
self:Remove()
end
end
end
function ENT:OnTakeDamage(dmg)
if dmg:GetInflictor() == self or dmg:GetAttacker() == self then return end
if self.Exploded then return end
local damage = dmg:GetDamage()
self.HP = self.HP - damage
if self.HP <= 0 then
self.Exploded = true
self:Explode()
return
end
self:TakePhysicsDamage(dmg)
end

View File

@@ -0,0 +1,8 @@
ENT.Type = "anim"
ENT.PrintName = "Contact Explosive"
ENT.Author = ""
ENT.Contact = ""
ENT.Purpose = ""
ENT.Instructions = ""
ENT.DoNotDuplicate = true
ENT.DisableDuplicator = true

View File

@@ -0,0 +1,11 @@
include("shared.lua")
function ENT:Draw()
if CurTime() > self:GetNWFloat("HideTime", CurTime() + 1) then
self:DrawModel()
end
end
function ENT:IsTranslucent()
return true
end

View File

@@ -0,0 +1,219 @@
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
local LVS = LVS
ENT.Damage = 0
ENT.Prime = 0.03
ENT.Delay = 30
ENT.HideDelay = 5
ENT.FireRadius = 600 -- Общий радиус распространения пожара
ENT.FireDuration = 10 -- Длительность пожара в секундах
ENT.FireCount = 20 -- Количество отдельных источников огня
ENT.MaxFireDistance = 200 -- Максимальное расстояние от центра взрыва для источников огня
function ENT:Initialize()
local mdl = self:GetModel()
if not mdl or mdl == "" or mdl == "models/error.mdl" then
self:SetModel("models/weapons/fas2/world/explosives/rpg26/rocket.mdl")
end
self.burnout = CurTime() + 2
self:PhysicsInit(SOLID_VPHYSICS)
--self:PhysicsInitSphere((self:OBBMaxs() - self:OBBMins()):Length() / 4, "metal")
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
end
self:SetFriction(self.Delay)
self.killtime = CurTime() + self.Delay
self:DrawShadow(true)
self.StartTime = CurTime()
self:EmitSound( "TFA_INS2_RPG7.Loop" )
self:SetUseType(SIMPLE_USE)
self.HasIdle = true
timer.Simple(0.1, function()
if IsValid(self) then
self:SetOwner()
end
end)
self:SetNWFloat("HideTime",CurTime() + self.HideDelay )
self.HP = math.random(30, 60)
end
function ENT:Think()
if self.killtime < CurTime() then
return false
end
local phys = self:GetPhysicsObject()
local force = phys:GetMass() * Vector( 0, 0, -9.80665 ) * 7-- This gives us the force in kg*source_unit/s^2
local dt = engine.TickInterval() -- The time interval over which the force acts on the object (in seconds)
phys:ApplyForceCenter( force * dt ) -- Multiplying the two gives us the impulse in kg*source_unit/s
self:NextThink(CurTime())
return true
end
local effectdata, shake
function ENT:CreateFire()
-- Создаем несколько источников огня в случайных позициях внутри радиуса
for i = 1, self.FireCount do
-- Вычисляем случайную позицию в радиусе взрыва
local angle = math.random(0, 360)
local distance = math.random(0, self.MaxFireDistance)
local rad = math.rad(angle)
local offset = Vector(
math.cos(rad) * distance,
math.sin(rad) * distance,
0
)
local firePos = self:GetPos() + offset
-- Проверяем, что позиция не находится внутри объекта
local trace = util.TraceLine({
start = self:GetPos(),
endpos = firePos,
mask = MASK_SOLID_BRUSHONLY
})
-- Создаем отдельный источник огня
local fire = ents.Create("env_fire")
if IsValid(fire) then
fire:SetPos(firePos)
-- Размер каждого отдельного огня (меньше общего радиуса)
local individualFireSize = math.random(10, 40)
fire:SetKeyValue("health", self.FireDuration + math.random(-5, 5)) -- Случайная длительность
fire:SetKeyValue("firesize", individualFireSize)
fire:SetKeyValue("fireattack", "5")
fire:SetKeyValue("damagescale", "20")
fire:SetKeyValue("spawnflags", "130") -- Бесконечный огонь + дым + старт сразу
fire:Spawn()
fire:Fire("StartFire", "", 0)
-- Автоматическое удаление огня после заданного времени
timer.Simple(self.FireDuration + math.random(-2, 2), function()
if IsValid(fire) then
fire:Remove()
end
end)
end
end
local centerFire = ents.Create("env_fire")
if IsValid(centerFire) then
centerFire:SetPos(self:GetPos())
centerFire:SetKeyValue("health", self.FireDuration)
centerFire:SetKeyValue("firesize", 150)
centerFire:SetKeyValue("fireattack", "10")
centerFire:SetKeyValue("damagescale", "20")
centerFire:SetKeyValue("spawnflags", "130")
centerFire:Spawn()
centerFire:Fire("StartFire", "", 0)
timer.Simple(self.FireDuration, function()
if IsValid(centerFire) then
centerFire:Remove()
end
end)
end
end
function ENT:Explode()
if not IsValid(self.Owner) then
self:Remove()
return
end
effectdata = EffectData()
effectdata:SetOrigin(self:GetPos())
effectdata:SetScale(5)
effectdata:SetMagnitude(5)
util.Effect("lvs_explosion_small", effectdata)
util.Effect("lvs_explosion_small", effectdata)
util.BlastDamage(self, self.Owner, self:GetPos(), 100, 10)
shake = ents.Create("env_shake")
shake:SetOwner(self.Owner)
shake:SetPos(self:GetPos())
shake:SetKeyValue("amplitude", tostring(20)) -- Power of the shake
shake:SetKeyValue("radius", tostring( 768 ) ) -- Radius of the shake
shake:SetKeyValue("duration", tostring( self.Damage / 800 )) -- Time of shake
shake:SetKeyValue("frequency", "255") -- How har should the screenshake be
shake:SetKeyValue("spawnflags", "4") -- Spawnflags(In Air)
shake:Spawn()
shake:Activate()
shake:Fire("StartShake", "", 0)
self:EmitSound("TFA_INS2_RPG7.2")
local he = {}
he.Src = self:GetPos()
he.Dir = self:GetAngles():Forward()
he.Spread = Vector(0,0,0)
he.Force = 100
he.HullSize = 0
he.Damage = 700
he.SplashDamage = 200
he.SplashDamageRadius = 250
he.Velocity = 300
he.TracerName = "lvs_tracer_autocannon" -- Изменено на нужный трассер
he.Attacker = self.Owner
LVS:FireBullet( heat )
-- Создаем пожар после взрыва
self:CreateFire()
self:Remove()
end
function ENT:PhysicsCollide(data, phys)
if data.Speed > 60 and CurTime() > self.StartTime + self.Prime then
timer.Simple(0,function()
if IsValid(self) then
self:Explode()
end
end)
else
self.Prime = math.huge
if self.HasIdle then
self:StopSound("TFA_INS2_RPG7.Loop")
self.HasIdle = false
self:SetNWFloat("HideTime", -1 )
end
end
end
function ENT:OnRemove()
if self.HasIdle then
self:StopSound("TFA_INS2_RPG7.Loop")
self.HasIdle = false
end
end
function ENT:Use(activator, caller)
if activator:IsPlayer() and self.WeaponClass and activator:GetWeapon(self.WeaponClass) then
activator:GiveAmmo(1, activator:GetWeapon(self.WeaponClass):GetPrimaryAmmoType(), false)
self:Remove()
end
end
function ENT:OnTakeDamage( dmg )
if dmg:GetInflictor() == self or dmg:GetAttacker() == self then return end
if self.Exploded then return end
if self.HP > 0 and self.HP - dmg:GetDamage() <= 0 then
self.Exploded = true
self:Explode()
end
self.HP = self.HP - dmg:GetDamage()
dmg:SetAttacker(self)
dmg:SetInflictor(self)
self:TakePhysicsDamage( dmg )
end

View File

@@ -0,0 +1,8 @@
ENT.Type = "anim"
ENT.PrintName = "Contact Explosive"
ENT.Author = ""
ENT.Contact = ""
ENT.Purpose = ""
ENT.Instructions = ""
ENT.DoNotDuplicate = true
ENT.DisableDuplicator = true

View File

@@ -0,0 +1,11 @@
include("shared.lua")
function ENT:Draw()
if CurTime() > self:GetNWFloat("HideTime", CurTime() + 1) then
self:DrawModel()
end
end
function ENT:IsTranslucent()
return true
end

View File

@@ -0,0 +1,146 @@
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
local LVS = LVS
ENT.Damage = 0
ENT.Prime = 0.03
ENT.Delay = 30
ENT.HideDelay = 0.0
function ENT:Initialize()
local mdl = self:GetModel()
if not mdl or mdl == "" or mdl == "models/error.mdl" then
self:SetModel("models/weapons/rpg28_rocket.mdl")
end
self.burnout = CurTime() + 2
self:PhysicsInit(SOLID_VPHYSICS)
--self:PhysicsInitSphere((self:OBBMaxs() - self:OBBMins()):Length() / 4, "metal")
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
end
self:SetFriction(self.Delay)
self.killtime = CurTime() + self.Delay
self:DrawShadow(true)
self.StartTime = CurTime()
self:EmitSound( "TFA_INS2_RPG7.Loop" )
self:SetUseType(SIMPLE_USE)
self.HasIdle = true
timer.Simple(0.1, function()
if IsValid(self) then
self:SetOwner()
end
end)
self:SetNWFloat("HideTime",CurTime() + self.HideDelay )
self.HP = math.random(30, 60)
end
function ENT:Think()
if self.killtime < CurTime() then
return false
end
local phys = self:GetPhysicsObject()
local force = phys:GetMass() * Vector( 0, 0, -9.80665 ) * 7-- This gives us the force in kg*source_unit/s^2
local dt = engine.TickInterval() -- The time interval over which the force acts on the object (in seconds)
phys:ApplyForceCenter( force * dt ) -- Multiplying the two gives us the impulse in kg*source_unit/s
self:NextThink(CurTime())
return true
end
local effectdata, shake
function ENT:Explode()
if not IsValid(self.Owner) then
self:Remove()
return
end
local effectdata = EffectData()
effectdata:SetOrigin(self:GetPos())
effectdata:SetScale(10)
effectdata:SetMagnitude(5)
util.Effect("lvs_explosion_small", effectdata)
util.Effect("lvs_explosion_small", effectdata)
util.BlastDamage(self, self.Owner, self:GetPos(), 100, 10)
shake = ents.Create("env_shake")
shake:SetOwner(self.Owner)
shake:SetPos(self:GetPos())
shake:SetKeyValue("amplitude", tostring(20)) -- Power of the shake
shake:SetKeyValue("radius", tostring( 768 ) ) -- Radius of the shake
shake:SetKeyValue("duration", tostring( self.Damage / 800 )) -- Time of shake
shake:SetKeyValue("frequency", "255") -- How har should the screenshake be
shake:SetKeyValue("spawnflags", "4") -- Spawnflags(In Air)
shake:Spawn()
shake:Activate()
shake:Fire("StartShake", "", 0)
self:EmitSound("TFA_INS2_RPG7.2")
local heat = {}
heat.Src = self:GetPos()
heat.Dir = self:GetAngles():Right()
heat.Spread = Vector(0,0,0)
heat.Force = 18000
heat.HullSize = 0
heat.Damage = 8000
heat.Velocity = 16000
heat.Attacker = self.Owner
LVS:FireBullet( heat )
self:Remove()
end
function ENT:PhysicsCollide(data, phys)
if data.Speed > 60 and CurTime() > self.StartTime + self.Prime then
timer.Simple(0,function()
if IsValid(self) then
self:Explode()
end
end)
else
self.Prime = math.huge
if self.HasIdle then
self:StopSound("TFA_INS2_RPG7.Loop")
self.HasIdle = false
self:SetNWFloat("HideTime", -1 )
end
end
--[[elseif self:GetOwner() ~= self then
self.Prime = math.huge
self:StopSound("TFA_INS2_RPG7.Loop")
self:SetOwner(self)
end
]]--
end
function ENT:OnRemove()
if self.HasIdle then
self:StopSound("TFA_INS2_RPG7.Loop")
self.HasIdle = false
end
end
function ENT:Use(activator, caller)
if activator:IsPlayer() and self.WeaponClass and activator:GetWeapon(self.WeaponClass) then
activator:GiveAmmo(1, activator:GetWeapon(self.WeaponClass):GetPrimaryAmmoType(), false)
self:Remove()
end
end
function ENT:OnTakeDamage( dmg )
if dmg:GetInflictor() == self or dmg:GetAttacker() == self then return end
if self.Exploded then return end
if self.HP > 0 and self.HP - dmg:GetDamage() <= 0 then
self.Exploded = true
self:Explode()
end
self.HP = self.HP - dmg:GetDamage()
dmg:SetAttacker(self)
dmg:SetInflictor(self)
self:TakePhysicsDamage( dmg )
end

View File

@@ -0,0 +1,8 @@
ENT.Type = "anim"
ENT.PrintName = "Contact Explosive"
ENT.Author = ""
ENT.Contact = ""
ENT.Purpose = ""
ENT.Instructions = ""
ENT.DoNotDuplicate = true
ENT.DisableDuplicator = true

View File

@@ -0,0 +1,28 @@
local path = "weapons/at4/"
TFA.AddFireSound("AT4_FIRE", path .. "at4_fp.wav", true, ")" )
TFA.AddWeaponSound("Universal.Draw", {"weapons/universal/uni_weapon_draw_01.wav", "weapons/universal/uni_weapon_draw_02.wav", "weapons/universal/uni_weapon_draw_03.wav"})
TFA.AddWeaponSound("Universal.LeanOut", { "weapons/universal/uni_lean_out_01.wav", "weapons/universal/uni_lean_out_02.wav", "weapons/universal/uni_lean_out_03.wav", "weapons/universal/uni_lean_out_04.wav"})
TFA.AddWeaponSound("Universal.WeaponLower", "weapons/universal/uni_weapon_lower_01.wav")
TFA.AddWeaponSound("Universal.Holster", "weapons/universal/uni_weapon_holster.wav")
TFA.AddWeaponSound("Weapon_M9.safety", "weapons/m9/handling/m9_safety.wav")
TFA.AddWeaponSound("Weapon_AT4.Latch_01", path .. "/handling/at4_latch_01.wav")
TFA.AddWeaponSound("Weapon_AT4.Latch_02", path .. "/handling/at4_latch_02.wav")
TFA.AddWeaponSound("Weapon_AT4.Ready", path .. "/handling/at4_ready.wav")
TFA.AddWeaponSound("Weapon_AT4.Shoulder", path .. "/handling/at4_shoulder.wav")
TFA.AddAmmo( "at4", "AT4" )
TFA.AddAmmo( "at4armor", "AT4ARMOR" )
TFA.AddAmmo( "at4strc", "AT4STRC" )
--[[
TFA.AddWeaponSound("TFA_INS2_RPG7.Empty", path .. "ak74_empty.wav")
TFA.AddWeaponSound("TFA_INS2_RPG7.MagRelease", path .. "ak74_magrelease.wav")
TFA.AddWeaponSound("TFA_INS2_RPG7.Magout", path .. "ak74_magout.wav")
TFA.AddWeaponSound("TFA_INS2_RPG7.Rattle", path .. "ak74_rattle.wav")
TFA.AddWeaponSound("TFA_INS2_RPG7.Magin", path .. "ak74_magin.wav")
TFA.AddWeaponSound("TFA_INS2_RPG7.Boltback", path .. "ak74_boltback.wav")
TFA.AddWeaponSound("TFA_INS2_RPG7.Boltrelease", path .. "ak74_boltrelease.wav")
]]--

View File

@@ -0,0 +1,5 @@
local hudcolor = Color(255, 255, 255, 255)
if killicon and killicon.Add then
killicon.Add("tfa_ins2_panzerfaust3", "vgui/hud/tfa_ins2_panzerfaust3", hudcolor)
end

View File

@@ -0,0 +1,20 @@
local path = "weapons/tfa_ins2_rpg7_scoped/"
local pref = "TFA_SCOPED_RPG7"
local hudcolor = Color(255, 255, 255, 255)
if (CLIENT) then
game.AddParticles( "particles/hd_explosions.pcf" )
end
PrecacheParticleSystem("hd_explosion")
TFA.AddFireSound(pref .. ".1", path .. "rhino_1.wav", false, ")")
TFA.AddWeaponSound(pref .. ".Fetch", path .. "rpg7_fetch.wav")
TFA.AddWeaponSound(pref .. ".Load1", path .. "rpg7_load1.wav")
TFA.AddWeaponSound(pref .. ".Load2", path .. "rpg7_load2.wav")
TFA.AddWeaponSound(pref .. ".EndGrab", path .. "rpg7_endgrab.wav")
TFA.AddWeaponSound(pref .. ".safety", path .. "m9_safety.wav")
if killicon and killicon.Add then
killicon.Add("tfa_anti_tank", "vgui/hud/tfa_anti_tank", hudcolor)
killicon.Add("tfa_crocket_rpg", "vgui/hud/tfa_crocket_rpg", hudcolor)
killicon.Add("tfa_ins2_rpg7_scoped", "vgui/hud/tfa_ins2_rpg7_scoped", hudcolor)
end

View File

@@ -0,0 +1,601 @@
-- Copyright (c) 2018-2020 TFA Base Devs
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
SWEP.Base = "tfa_gun_base"
SWEP.Category = "FT | Antitank" --The category. Please, just choose something generic or something I've already done if you plan on only doing like one swep..
SWEP.Manufacturer = "FT_Scripty" --Gun Manufactrer (e.g. Hoeckler and Koch )
SWEP.Author = "Shtormer, Scripty" --Author Tooltip
SWEP.Contact = "" --Contact Info Tooltip
SWEP.Purpose = "" --Purpose Tooltip
SWEP.Instructions = "" --Instructions Tooltip
SWEP.Spawnable = true --Can you, as a normal user, spawn this?
SWEP.AdminSpawnable = true --Can an adminstrator spawn this? Does not tie into your admin mod necessarily, unless its coded to allow for GMod's default ranks somewhere in its code. Evolve and ULX should work, but try to use weapon restriction rather than these.
SWEP.DrawCrosshair = true -- Draw the crosshair?
SWEP.DrawCrosshairIS = true --Draw the crosshair in ironsights?
SWEP.PrintName = "AT4" -- Weapon name (Shown on HUD)
SWEP.Slot = 5 -- Slot in the weapon selection menu. Subtract 1, as this starts at 0.
SWEP.SlotPos = 73 -- Position in the slot
SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up
SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon
SWEP.Weight = 30 -- This controls how "good" the weapon is for autopickup.
--[[WEAPON HANDLING]]--
SWEP.Primary.Sound = Sound("weapons/at4/at4_fp.wav")
SWEP.Primary.SilencedSound = nil -- This is the sound of the weapon, when silenced.
SWEP.Primary.PenetrationMultiplier = 1 --Change the amount of something this gun can penetrate through
SWEP.Primary.Damage = 500 -- Damage, in standard damage points.
SWEP.Primary.DamageTypeHandled = true --true will handle damagetype in base
SWEP.Primary.DamageType = nil --See DMG enum. This might be DMG_SHOCK, DMG_BURN, DMG_BULLET, etc. Leave nil to autodetect. DMG_AIRBOAT opens doors.
SWEP.Primary.Force = nil --Force value, leave nil to autocalc
SWEP.Primary.Knockback = 1 --Autodetected if nil; this is the velocity kickback
SWEP.Primary.HullSize = 0 --Big bullets, increase this value. They increase the hull size of the hitscan bullet.
SWEP.Primary.NumShots = 1 --The number of shots the weapon fires. SWEP.Shotgun is NOT required for this to be >1.
SWEP.Primary.Automatic = false -- Automatic/Semi Auto
SWEP.Primary.RPM = 120 -- This is in Rounds Per Minute / RPM
SWEP.Primary.RPM_Displayed = 15 -- This is in Rounds Per Minute / RPM
SWEP.Primary.RPM_Semi = nil -- RPM for semi-automatic or burst fire. This is in Rounds Per Minute / RPM
SWEP.Primary.RPM_Burst = nil -- RPM for burst fire, overrides semi. This is in Rounds Per Minute / RPM
SWEP.Primary.DryFireDelay = nil --How long you have to wait after firing your last shot before a dryfire animation can play. Leave nil for full empty attack length. Can also use SWEP.StatusLength[ ACT_VM_BLABLA ]
SWEP.Primary.BurstDelay = nil -- Delay between bursts, leave nil to autocalculate
SWEP.Primary.LoopSound = nil -- Looped fire sound, unsilenced
SWEP.Primary.LoopSoundSilenced = nil -- Looped fire sound, silenced
SWEP.Primary.LoopSoundTail = nil -- Loop end/tail sound, unsilenced
SWEP.Primary.LoopSoundTailSilenced = nil -- Loop end/tail sound, silenced
SWEP.Primary.LoopSoundAutoOnly = false -- Play loop sound for full-auto only? Fallbacks to Primary.Sound for semi/burst if true
SWEP.CanJam = false -- whenever weapon cam jam
SWEP.JamChance = 0.04 -- the (maximal) chance the weapon will jam. Newly spawned weapon will never jam on first shot for example.
-- Default value is 0.04 (4%)
-- Maxmial value is 1, means weapon will always jam when factor become 100
-- Also remember that there is a minimal factor before weapon can jam
-- This number is not treated "as-is" but as basic value that needs to be concluded as chance
-- You don't really need to cry over it and trying to balance it, TFA Base will do the job for you
-- (TFA Base will calculate the best value between 0 and JamChance based on current JamFactor of the weapon)
SWEP.JamFactor = 0.06 -- How to increase jam factor after each shot.
-- When factor reach 100 it will mean that on each shot there will be SWEP.Primary.JamChance chance to jam
-- When factor reach 50 it will mean that on each shot there will be SWEP.Primary.JamChance / 2 chance to jam
-- and so on
-- Default value is 0.06, means weapon will jam with SWEP.Primary.JamChance chance right after 1666 shots
-- These settings are good for Assault Rifles, however, not good for anything else.
-- Suggested stats:
--[[
-- Pistols
SWEP.JamChance = 0.20
SWEP.JamFactor = 0.14
]]
--[[
-- Revolvers
SWEP.JamChance = 0.17
SWEP.JamFactor = 0.50
]]
--[[
-- Miniguns
SWEP.JamChance = 0.03
SWEP.JamFactor = 0.01
]]
--[[
-- Submachine gun
SWEP.JamChance = 0.04
SWEP.JamFactor = 0.09
]]
--[[
-- Auto shotguns
SWEP.JamChance = 0.15
SWEP.JamFactor = 0.2
]]
--[[
-- Pump-action shotguns
SWEP.JamChance = 0.25
SWEP.JamFactor = 0.3
]]
--[[
-- Sniper rifle
SWEP.JamChance = 0.17
SWEP.JamFactor = 0.35
]]
SWEP.FiresUnderwater = false
--Miscelaneous Sounds
SWEP.IronInSound = nil --Sound to play when ironsighting in? nil for default
SWEP.IronOutSound = nil --Sound to play when ironsighting out? nil for default
--Silencing
SWEP.CanBeSilenced = false --Can we silence? Requires animations.
SWEP.Silenced = false --Silenced by default?
-- Selective Fire Stuff
SWEP.SelectiveFire = false --Allow selecting your firemode?
SWEP.DisableBurstFire = false --Only auto/single?
SWEP.OnlyBurstFire = false --No auto, only burst/single?
SWEP.BurstFireCount = nil -- Burst fire count override (autocalculated by the clip size if nil)
SWEP.DefaultFireMode = "safe" --Default to auto or whatev
SWEP.FireModeName = nil --Change to a text value to override it
SWEP.FireSoundAffectedByClipSize = true -- Whenever adjuct pitch (and proably other properties) of fire sound based on current clip / maxclip
-- This is always false when either:
-- Weapon has no primary clip
-- Weapon's clip is smaller than 4 rounds
-- Weapon is a shotgun
--Ammo Related
SWEP.Primary.ClipSize = 1 -- This is the size of a clip
SWEP.Primary.ClipSize = 1 -- This is the size of a clip
SWEP.Primary.DefaultClip = 1 -- This is the number of bullets the gun gives you, counting a clip as defined directly above.
SWEP.Primary.Ammo = "at4" -- What kind of ammo. Options, besides custom, include pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, and AirboatGun.
SWEP.Primary.AmmoConsumption = 1 --Ammo consumed per shot
--Pistol, buckshot, and slam like to ricochet. Use AirboatGun for a light metal peircing shotgun pellets
SWEP.DisableChambering = true --Disable round-in-the-chamber
--Recoil Related
SWEP.Primary.KickUp = 0 -- This is the maximum upwards recoil (rise)
SWEP.Primary.KickDown = 0 -- This is the maximum downwards recoil (skeet)
SWEP.Primary.KickHorizontal = 0 -- This is the maximum sideways recoil (no real term)
SWEP.Primary.StaticRecoilFactor = 0.5 --Amount of recoil to directly apply to EyeAngles. Enter what fraction or percentage (in decimal form) you want. This is also affected by a convar that defaults to 0.5.
--Firing Cone Related
SWEP.Primary.Spread = .01 --This is hip-fire acuracy. Less is more (1 is horribly awful, .0001 is close to perfect)
SWEP.Primary.IronAccuracy = .005 -- Ironsight accuracy, should be the same for shotguns
--Unless you can do this manually, autodetect it. If you decide to manually do these, uncomment this block and remove this line.
SWEP.Primary.SpreadMultiplierMax = nil--How far the spread can expand when you shoot. Example val: 2.5
SWEP.Primary.SpreadIncrement = nil --What percentage of the modifier is added on, per shot. Example val: 1/3.5
SWEP.Primary.SpreadRecovery = nil--How much the spread recovers, per second. Example val: 3
--Range Related
SWEP.Primary.Range = -1 -- The distance the bullet can travel in source units. Set to -1 to autodetect based on damage/rpm.
SWEP.Primary.RangeFalloff = -1 -- The percentage of the range the bullet damage starts to fall off at. Set to 0.8, for example, to start falling off after 80% of the range.
--Penetration Related
SWEP.MaxPenetrationCounter = 4 --The maximum number of ricochets. To prevent stack overflows.
--Misc
SWEP.IronRecoilMultiplier = 0.5 --Multiply recoil by this factor when we're in ironsights. This is proportional, not inversely.
SWEP.CrouchAccuracyMultiplier = 0.5 --Less is more. Accuracy * 0.5 = Twice as accurate, Accuracy * 0.1 = Ten times as accurate
--Movespeed
SWEP.MoveSpeed = 1 --Multiply the player's movespeed by this.
SWEP.IronSightsMoveSpeed = 0.8 --Multiply the player's movespeed by this when sighting.
--[[PROJECTILES]]--
SWEP.Primary.ProjectileDelay = 10 / 1000 --Entity to shoot
SWEP.ProjectileEntity = "at4_rocket" --Entity to shoot
SWEP.Primary.ProjectileVelocity = 294 * 100 --Entity to shoot's velocity
SWEP.Primary.ProjectileModel = nil --Entity to shoot's model
--[[VIEWMODEL]]--
SWEP.ViewModel = "models/weapons/at4genius_antipersonel/v_at4.mdl" --Viewmodel path
SWEP.ViewModelFOV = 65 -- This controls how big the viewmodel looks. Less is more.
SWEP.ViewModelFlip = false -- Set this to true for CSS models, or false for everything else (with a righthanded viewmodel.)
SWEP.UseHands = true --Use gmod c_arms system.
SWEP.VMPos = Vector(0,0,0) --The viewmodel positional offset, constantly. Subtract this from any other modifications to viewmodel position.
SWEP.VMAng = Vector(0,0,0) --The viewmodel angular offset, constantly. Subtract this from any other modifications to viewmodel angle.
SWEP.VMPos_Additive = true --Set to false for an easier time using VMPos. If true, VMPos will act as a constant delta ON TOP OF ironsights, run, whateverelse
SWEP.CenteredPos = nil --The viewmodel positional offset, used for centering. Leave nil to autodetect using ironsights.
SWEP.CenteredAng = nil --The viewmodel angular offset, used for centering. Leave nil to autodetect using ironsights.
SWEP.Bodygroups_V = nil --{
--[0] = 1,
--[1] = 4,
--[2] = etc.
--}
SWEP.AllowIronSightsDoF = true -- whenever allow DoF effect on viewmodel when zoomed in with iron sights
--[[WORLDMODEL]]--
SWEP.WorldModel = "models/weapons/personel.mdl" -- Weapon world model path
SWEP.Bodygroups_W = nil --{
--[0] = 1,
--[1] = 4,
--[2] = etc.
--}
SWEP.HoldType = "rpg" -- This is how others view you carrying the weapon. Options include:
-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive
-- You're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles
SWEP.Offset = {
Pos = {
Up = -5,
Right = 1,
Forward = 8
},
Ang = {
Up = 0,
Right = -10,
Forward = 180
},
Scale = 1
} --Procedural world model animation, defaulted for CS:S purposes.
SWEP.ThirdPersonReloadDisable = false --Disable third person reload? True disables.
--[[SCOPES]]--
SWEP.IronSightsSensitivity = 1 --Useful for a RT scope. Change this to 0.25 for 25% sensitivity. This is if normal FOV compenstaion isn't your thing for whatever reason, so don't change it for normal scopes.
SWEP.BoltAction = false --Unscope/sight after you shoot?
SWEP.Scoped = false --Draw a scope overlay?
SWEP.ScopeOverlayThreshold = 0.875 --Percentage you have to be sighted in to see the scope.
SWEP.BoltTimerOffset = 0.25 --How long you stay sighted in after shooting, with a bolt action.
SWEP.ScopeScale = 0.5 --Scale of the scope overlay
SWEP.ReticleScale = 0.7 --Scale of the reticle overlay
--GDCW Overlay Options. Only choose one.
SWEP.Secondary.UseACOG = false --Overlay option
SWEP.Secondary.UseMilDot = false --Overlay option
SWEP.Secondary.UseSVD = false --Overlay option
SWEP.Secondary.UseParabolic = false --Overlay option
SWEP.Secondary.UseElcan = false --Overlay option
SWEP.Secondary.UseGreenDuplex = false --Overlay option
if surface then
SWEP.Secondary.ScopeTable = nil --[[
{
scopetex = surface.GetTextureID("scope/gdcw_closedsight"),
reticletex = surface.GetTextureID("scope/gdcw_acogchevron"),
dottex = surface.GetTextureID("scope/gdcw_acogcross")
}
]]--
end
--[[SHOTGUN CODE]]--
SWEP.Shotgun = false --Enable shotgun style reloading.
SWEP.ShotgunEmptyAnim = false --Enable emtpy reloads on shotguns?
SWEP.ShotgunEmptyAnim_Shell = true --Enable insertion of a shell directly into the chamber on empty reload?
SWEP.ShotgunStartAnimShell = false --shotgun start anim inserts shell
SWEP.ShellTime = .35 -- For shotguns, how long it takes to insert a shell.
--[[SPRINTING]]--
SWEP.RunSightsPos = Vector(0, 0, 0) --Change this, using SWEP Creation Kit preferably
SWEP.RunSightsAng = Vector(0, 0, 0) --Change this, using SWEP Creation Kit preferably
--[[IRONSIGHTS]]--
SWEP.data = {}
SWEP.data.ironsights = 1 --Enable Ironsights
SWEP.Secondary.IronFOV = 70 -- How much you "zoom" in. Less is more! Don't have this be <= 0. A good value for ironsights is like 70.
SWEP.IronSightsPos = Vector(-1.2966, -2, 0.5867) --Change this, using SWEP Creation Kit preferably
SWEP.IronSightsAng = Vector(1.6276, -2.1752, 7) --Change this, using SWEP Creation Kit preferably
--[[INSPECTION]]--
SWEP.InspectPos = nil--Vector(0,0,0) --Replace with a vector, in style of ironsights position, to be used for inspection
SWEP.InspectAng = nil--Vector(0,0,0) --Replace with a vector, in style of ironsights angle, to be used for inspection
--[[VIEWMODEL BLOWBACK]]--
SWEP.BlowbackEnabled = false --Enable Blowback?
SWEP.BlowbackVector = Vector(0,-1,0) --Vector to move bone <or root> relative to bone <or view> orientation.
SWEP.BlowbackCurrentRoot = 0 --Amount of blowback currently, for root
SWEP.BlowbackCurrent = 0 --Amount of blowback currently, for bones
SWEP.BlowbackBoneMods = nil --Viewmodel bone mods via SWEP Creation Kit
SWEP.Blowback_Only_Iron = true --Only do blowback on ironsights
SWEP.Blowback_PistolMode = false --Do we recover from blowback when empty?
SWEP.Blowback_Shell_Enabled = true --Shoot shells through blowback animations
SWEP.Blowback_Shell_Effect = "ShellEject"--Which shell effect to use
--[[VIEWMODEL PROCEDURAL ANIMATION]]--
SWEP.DoProceduralReload = false--Animate first person reload using lua?
SWEP.ProceduralReloadTime = 1 --Procedural reload time?
--[[HOLDTYPES]]--
SWEP.IronSightHoldTypeOverride = "" --This variable overrides the ironsights holdtype, choosing it instead of something from the above tables. Change it to "" to disable.
SWEP.SprintHoldTypeOverride = "" --This variable overrides the sprint holdtype, choosing it instead of something from the above tables. Change it to "" to disable.
--[[ANIMATION]]--
SWEP.StatusLengthOverride = {} --Changes the status delay of a given animation; only used on reloads. Otherwise, use SequenceLengthOverride or one of the others
SWEP.SequenceLengthOverride = {} --Changes both the status delay and the nextprimaryfire of a given animation
SWEP.SequenceTimeOverride = {} --Like above but changes animation length to a target
SWEP.SequenceRateOverride = {} --Like above but scales animation length rather than being absolute
SWEP.ProceduralHolsterEnabled = nil
SWEP.ProceduralHolsterTime = 0.3
SWEP.ProceduralHolsterPos = Vector(3, 0, -5)
SWEP.ProceduralHolsterAng = Vector(-40, -30, 10)
SWEP.Sights_Mode = TFA.Enum.LOCOMOTION_LUA -- ANI = mdl, HYBRID = lua but continue idle, Lua = stop mdl animation
SWEP.Sprint_Mode = TFA.Enum.LOCOMOTION_LUA -- ANI = mdl, HYBRID = ani + lua, Lua = lua only
SWEP.Walk_Mode = TFA.Enum.LOCOMOTION_LUA -- ANI = mdl, HYBRID = ani + lua, Lua = lua only
SWEP.Idle_Mode = TFA.Enum.IDLE_BOTH --TFA.Enum.IDLE_DISABLED = no idle, TFA.Enum.IDLE_LUA = lua idle, TFA.Enum.IDLE_ANI = mdl idle, TFA.Enum.IDLE_BOTH = TFA.Enum.IDLE_ANI + TFA.Enum.IDLE_LUA
SWEP.Idle_Blend = 0.25 --Start an idle this far early into the end of a transition
SWEP.Idle_Smooth = 0.05 --Start an idle this far early into the end of another animation
--MDL Animations Below
SWEP.IronAnimation = {
["in"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "Idle_To_Iron", --Number for act, String/Number for sequence
["value_empty"] = "Idle_To_Iron_Dry",
["transition"] = true
}, --Inward transition
["loop"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "Idle_Iron", --Number for act, String/Number for sequence
["value_empty"] = "Idle_Iron_Dry"
}, --Looping Animation
["out"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "Iron_To_Idle", --Number for act, String/Number for sequence
["value_empty"] = "Iron_To_Idle_Dry",
["transition"] = true
}, --Outward transition
["shoot"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "Fire_Iron", --Number for act, String/Number for sequence
["value_last"] = "Fire_Iron_Last",
["value_empty"] = "Fire_Iron_Dry"
} --What do you think
}
SWEP.SprintAnimation = {
["in"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "Idle_to_Sprint", --Number for act, String/Number for sequence
["value_empty"] = "Idle_to_Sprint_Empty",
["transition"] = true
}, --Inward transition
["loop"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "Sprint_", --Number for act, String/Number for sequence
["value_empty"] = "Sprint_Empty_",
["is_idle"] = true
},--looping animation
["out"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "Sprint_to_Idle", --Number for act, String/Number for sequence
["value_empty"] = "Sprint_to_Idle_Empty",
["transition"] = true
} --Outward transition
}
SWEP.WalkAnimation = {
["in"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "Idle_to_Walk", --Number for act, String/Number for sequence
["value_empty"] = "Idle_to_Walk_Empty",
["transition"] = true
}, --Inward transition
["loop"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "Walk", --Number for act, String/Number for sequence
["value_empty"] = "Walk_Empty",
["is_idle"] = true
},--looping animation
["out"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "Walk_to_Idle", --Number for act, String/Number for sequence
["value_empty"] = "Walk_to_Idle_Empty",
["transition"] = true
} --Outward transition
}
-- Looping fire animation (full-auto only)
SWEP.ShootAnimation = {
["in"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "ShootLoop_Start", --Number for act, String/Number for sequence
["value_is"] = "ShootLoop_Iron_Start", --Number for act, String/Number for sequence
["transition"] = true
}, --Looping Start, fallbacks to loop
["loop"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "ShootLoop", --Number for act, String/Number for sequence,
["value_is"] = "ShootLoop_Iron", --Number for act, String/Number for sequence,
["is_idle"] = true,
}, --Looping Animation
["out"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "ShootLoop_End", --Number for act, String/Number for sequence
["value_is"] = "ShootLoop_Iron_End", --Number for act, String/Number for sequence
["transition"] = true
}, --Looping End
}
--[[
SWEP.PumpAction = { -- Pump/bolt animations
["type"] = TFA.Enum.ANIMATION_ACT, -- Sequence or act
["value"] = ACT_VM_PULLBACK_HIGH, -- Number for act, String/Number for sequence
["value_empty"] = ACT_VM_PULLBACK, -- Last shot pump
["value_is"] = ACT_VM_PULLBACK_LOW, -- ADS pump
}
]]--
--[[EFFECTS]]--
--Attachments
SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models
SWEP.ShellAttachment = "2" -- Should be "2" for CSS models or "shell" for hl2 models
SWEP.MuzzleFlashEnabled = true --Enable muzzle flash
SWEP.MuzzleAttachmentRaw = nil --This will override whatever string you gave. This is the raw attachment number. This is overridden or created when a gun makes a muzzle event.
SWEP.AutoDetectMuzzleAttachment = false --For multi-barrel weapons, detect the proper attachment?
SWEP.MuzzleFlashEffect = nil --Change to a string of your muzzle flash effect. Copy/paste one of the existing from the base.
SWEP.SmokeParticle = nil --Smoke particle (ID within the PCF), defaults to something else based on holdtype; "" to disable
SWEP.EjectionSmokeEnabled = true --Disable automatic ejection smoke
--Shell eject override
SWEP.LuaShellEject = false --Enable shell ejection through lua?
SWEP.LuaShellEjectDelay = 0 --The delay to actually eject things
SWEP.LuaShellModel = nil --The model to use for ejected shells
SWEP.LuaShellScale = nil --The model scale to use for ejected shells
SWEP.LuaShellYaw = nil --The model yaw rotation ( relative ) to use for ejected shells
--Tracer Stuff
SWEP.TracerName = nil --Change to a string of your tracer name. Can be custom. There is a nice example at https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/base/entities/effects/tooltracer.lua
SWEP.TracerCount = 3 --0 disables, otherwise, 1 in X chance
--Impact Effects
SWEP.ImpactEffect = nil--Impact Effect
SWEP.ImpactDecal = nil--Impact Decal
--[[EVENT TABLE]]--
SWEP.EventTable = {} --Event Table, used for custom events when an action is played. This can even do stuff like playing a pump animation after shooting.
--example:
--[[RENDER TARGET]]--
SWEP.RTMaterialOverride = nil -- Take the material you want out of print(LocalPlayer():GetViewModel():GetMaterials()), subtract 1 from its index, and set it to this.
SWEP.RTOpaque = false -- Do you want your render target to be opaque?
SWEP.RTCode = nil--function(self) return end --This is the function to draw onto your rendertarget
--[[AKIMBO]]--
SWEP.Akimbo = false --Akimbo gun? Alternates between primary and secondary attacks.
SWEP.AnimCycle = 1 -- Start on the right
--[[ATTACHMENTS]]--
SWEP.VElements = nil --Export from SWEP Creation Kit. For each item that can/will be toggled, set active=false in its individual table
SWEP.WElements = nil --Export from SWEP Creation Kit. For each item that can/will be toggled, set active=false in its individual table
SWEP.Attachments = {
--[ORDER] = = { atts = { "si_eotech" }, sel = 0 }
--sel allows you to have an attachment pre-selected, and is used internally by the base to show which attachment is selected in each category.
}
SWEP.AttachmentDependencies = {} --{["si_acog"] = {"bg_rail", ["type"] = "OR"}}--type could also be AND to require multiple
SWEP.AttachmentExclusions = {} --{ ["si_iron"] = { [1] = "bg_heatshield"} }
SWEP.AttachmentTableOverride = {} --[[{ -- overrides WeaponTable for attachments
["ins2_ub_laser"] = { -- attachment id, root of WeaponTable override
["VElements"] = {
["laser_rail"] = {
["active"] = true
},
},
}
}]]
--[[MISC INFO FOR MODELERS]]--
--[[
Used Animations (for modelers):
ACT_VM_DRAW - Draw
ACT_VM_DRAW_EMPTY - Draw empty
ACT_VM_DRAW_SILENCED - Draw silenced, overrides empty
ACT_VM_IDLE - Idle
ACT_VM_IDLE_SILENCED - Idle empty, overwritten by silenced
ACT_VM_IDLE_SILENCED - Idle silenced
ACT_VM_PRIMARYATTACK - Shoot
ACT_VM_PRIMARYATTACK_EMPTY - Shoot last chambered bullet
ACT_VM_PRIMARYATTACK_SILENCED - Shoot silenced, overrides empty
ACT_VM_PRIMARYATTACK_1 - Shoot ironsights, overriden by everything besides normal shooting
ACT_VM_DRYFIRE - Dryfire
ACT_VM_RELOAD - Reload / Tactical Reload / Insert Shotgun Shell
ACT_SHOTGUN_RELOAD_START - Start shotgun reload, unless ACT_VM_RELOAD_EMPTY is there.
ACT_SHOTGUN_RELOAD_FINISH - End shotgun reload.
ACT_VM_RELOAD_EMPTY - Empty mag reload, chambers the new round. Works for shotguns too, where applicable.
ACT_VM_RELOAD_SILENCED - Silenced reload, overwrites all
ACT_VM_HOLSTER - Holster
ACT_VM_HOLSTER_SILENCED - Holster empty, overwritten by silenced
ACT_VM_HOLSTER_SILENCED - Holster silenced
]]--
-- отключаем TFA bullet logic
function SWEP:CanPrimaryAttack()
return true
end
function SWEP:ShootBulletInformation()
return
end
function SWEP:Recoil()
return
end
function SWEP:PrimaryAttack()
if not SERVER then return end
self:ShootAT4()
end
function SWEP:DropTube()
local ply = self:GetOwner()
if not IsValid(ply) then return end
local eyePos = ply:EyePos()
local eyeAng = ply:EyeAngles()
local tube = ents.Create("prop_physics")
if not IsValid(tube) then return end
tube:SetModel(self.WorldModel)
tube:SetPos(eyePos + eyeAng:Forward() * -20)
tube:SetAngles(eyeAng)
tube:Spawn()
tube:Activate()
-- ply:StripWeapon(self:GetClass()) -- REMOVED: make it reloadable
timer.Simple(3, function()
if IsValid(tube) then tube:Remove() end
end)
end
function SWEP:ShootAT4()
local ply = self:GetOwner()
if not IsValid(ply) then return end
if self:Clip1() <= 0 then return end
local eyePos = ply:EyePos()
local eyeAng = ply:EyeAngles()
local tr = util.TraceLine({
start = eyePos,
endpos = eyePos + eyeAng:Forward() * (3 * 52.49),
filter = ply
})
ply:EmitSound("weapons/at4/at4_fp.wav", 100, 100, 1, CHAN_WEAPON)
if tr.Hit then
ply:EmitSound("weapons/rpg/rocketclose.wav", 75, 100, 1, CHAN_ITEM)
local inert = ents.Create("prop_physics")
if IsValid(inert) then
inert:SetModel("models/w_at4_projectile.mdl")
inert:SetPos(eyePos + eyeAng:Forward() * 10)
inert:SetAngles(eyeAng)
inert:Spawn()
inert:Activate()
local phys = inert:GetPhysicsObject()
if IsValid(phys) then
phys:SetVelocity(eyeAng:Forward() * 300)
end
timer.Simple(10, function()
if IsValid(inert) then inert:Remove() end
end)
end
self:TakePrimaryAmmo(1)
self:DropTube()
return
end
local missile = ents.Create("lvs_missile")
if not IsValid(missile) then
self:DropTube()
return
end
missile:SetPos(eyePos)
missile:SetAngles(eyeAng)
missile:Spawn()
missile:Activate()
missile:SetDamage(900)
missile:SetRadius(150)
missile:SetForce(80000)
missile:SetAttacker(ply)
missile:SetEntityFilter({ply})
missile:SetTurnSpeed(0)
missile:SetSpeed(1600)
missile:Enable()
ParticleEffect("ins_weapon_rpg_frontblast", eyePos, eyeAng, ply)
ParticleEffect("ins_weapon_rpg_backblast", eyePos - eyeAng:Forward()*80, eyeAng - Angle(0,180,0), ply)
local pphys = ply:GetPhysicsObject()
if IsValid(pphys) then
pphys:ApplyForceOffset(-eyeAng:Forward() * 2000, eyePos)
end
self:TakePrimaryAmmo(1)
self:DropTube()
-- Force reload after 1 second
timer.Simple(1, function()
if IsValid(self) then self:Reload() end
end)
end
SWEP.SprintBobMult = 0
DEFINE_BASECLASS( SWEP.Base )

View File

@@ -0,0 +1,233 @@
-- Variables that are used on both client and server
SWEP.Gun = ("weapon_sw_panzerfaust3") -- must be the name of your swep but NO CAPITALS!
SWEP.Category = "FT | Antitank"
SWEP.Manufacturer = "FT_Scripty" --Gun Manufactrer (e.g. Hoeckler and Koch )
SWEP.Author = "The Master MLG, Scripty"
SWEP.Contact = ""
SWEP.Purpose = ""
SWEP.Instructions = ""
SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models
SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models
SWEP.PrintName = "PanzerFaust - 3" -- Weapon name (Shown on HUD)
SWEP.Slot = 2 -- Slot in the weapon selection menu
SWEP.SlotPos = 3 -- Position in the slot
SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter
SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box
SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce?
SWEP.DrawCrosshair = true -- set false if you want no crosshair
SWEP.Weight = 2 -- rank relative ot other weapons. bigger is better
SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up
SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon
SWEP.HoldType = "smg" -- how others view you carrying the weapon
SWEP.Type = "Anti-Tank Rocket Launcher"
-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive
-- you're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles
SWEP.ViewModelFOV = 70
SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/v_panzerfaust3_sandstorm.mdl" -- Weapon view model
SWEP.WorldModel = "models/weapons/w_panzerfaust3_sandstorm.mdl" -- Weapon world model
SWEP.Base = "tfa_3dbash_base"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.FiresUnderwater = false
SWEP.UseHands = true
SWEP.Primary.Sound = Sound("weapons/at4/at4_fp.wav")
SWEP.Primary.RPM = 125 -- This is in Rounds Per Minute
SWEP.Primary.ClipSize = 1 -- Size of a clip
SWEP.Primary.DefaultClip = 1 -- Bullets you start with
SWEP.Primary.KickUp = 0.345 -- Maximum up recoil (rise)
SWEP.Primary.KickDown = 0.267 -- Maximum down recoil (skeet)
SWEP.Primary.KickHorizontal = 0.186 -- Maximum up recoil (stock)
SWEP.Primary.StaticRecoilFactor = 0.63 --Amount of recoil to directly apply to EyeAngles. Enter what fraction or percentage (in decimal form) you want. This is also affected by a convar that defaults to 0.5.
SWEP.IronRecoilMultiplier = 0.61
SWEP.Primary.Automatic = false -- Automatic = true; Semi Auto = false
SWEP.Primary.Ammo = "PanzerFaust3 Rocket" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun
-- Pistol, buckshot, and slam always ricochet. Use AirboatGun for a light metal peircing shotgun pellets
SWEP.Secondary.IronFOV = 70 -- How much you 'zoom' in. Less is more! Don't have this be <= 0. A good value for ironsights is like 70.
SWEP.MoveSpeed = 0.72 --Multiply the player's movespeed by this.
SWEP.IronSightsMoveSpeed = SWEP.MoveSpeed * 0.91
SWEP.data = {} --The starting firemode
SWEP.data.ironsights = 1
SWEP.Primary.NumShots = 1 -- How many bullets to shoot per trigger pull
SWEP.Primary.Damage = 1000 -- Base damage per bullet
SWEP.Primary.Spread = .001 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact)
SWEP.Primary.IronAccuracy = .001 -- Ironsight accuracy, should be the same for shotguns
SWEP.DisableChambering = true
-- Enter iron sight info and bone mod info below
SWEP.IronSightsPos = Vector(-0.565, -4, 0.97)
SWEP.IronSightsAng = Vector(16.535, 0, 0)
SWEP.RunSightsPos = Vector(4.762, -4.238, -0.717)
SWEP.RunSightsAng = Vector(-6.743, 46.284, 0)
SWEP.InspectPos = Vector(7.76, -2, 0.016)
SWEP.InspectAng = Vector(1, 37.277, 3.2)
SWEP.ProjectileVelocity = 7000 * 16 / 12 --Entity to shoot's velocity
SWEP.FireModeName = "One-Shot"
SWEP.RTMaterialOverride = -1 --the number of the texture, which you subtract from GetAttachment
SWEP.ScopeAngleTransforms = {
{"P",-6}, --Pitch, 1
{"Y",1.25}, --Yaw, 1
{"R",20}, --Roll, 1
}
SWEP.RTScopeFOV = 9.32
SWEP.RTScopeAttachment = 3
SWEP.RTMaterialOverride = -1
SWEP.IronSightsSensitivity = 1 / 3
SWEP.ScopeShadow = nil
SWEP.UpdateScopeType = function() end
SWEP.RTScopeAttachment = 3
SWEP.Primary.UseLuaBullet = false
SWEP.Primary.Projectile = nil
SWEP.Primary.Damage = 0
SWEP.ScopeReticule = ("models/weapons/panzerfaust3_sandstorm/panzefaust_reticle")
SWEP.SelectiveFire = false
SWEP.DisableBurstFire = false --Only auto/single?
SWEP.Offset = {
Pos = {
Up = -8.8,
Right = 2,
Forward = 7.5,
},
Ang = {
Up = -5,
Right = 170,
Forward = 185,
},
Scale = 1
}
SWEP.VElements = {
["RT_Scope"] = { type = "Model", model = "models/rtcircle.mdl", bone = "Weapon", rel = "", pos = Vector(2.644, -3.55, 5.192), angle = Angle(0, 90, -20), size = Vector(0.428, 0.428, 0.428), color = Color(255, 255, 255, 255), surpresslightning = false, material = "!tfa_rtmaterial", skin = 0, bodygroup = {} }
}
SWEP.Sprint_Mode = TFA.Enum.LOCOMOTION_ANI -- ANI = mdl, HYBRID = ani + lua, Lua = lua only
SWEP.SprintAnimation = {
["loop"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "base_sprint", --Number for act, String/Number for sequence
["is_idle"] = true
}
}
SWEP.WElements = {
["ref"] = { type = "Model", model = SWEP.WorldModel, bone = "oof", rel = "", pos = Vector(0, 0, 0), angle = Angle(0, 0, 0), size = Vector(0.9, 0.9, 0.9), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {}, bonemerge = true, active = false }
}
function SWEP:DropTube()
local ply = self:GetOwner()
if not IsValid(ply) then return end
local eyePos = ply:EyePos()
local eyeAng = ply:EyeAngles()
local tube = ents.Create("prop_physics")
if not IsValid(tube) then return end
tube:SetModel(self.WorldModel)
tube:SetPos(eyePos + eyeAng:Forward() * -20)
tube:SetAngles(eyeAng)
tube:Spawn()
tube:Activate()
ply:StripWeapon(self:GetClass())
timer.Simple(3, function()
if IsValid(tube) then tube:Remove() end
end)
end
function SWEP:PrimaryAttack()
if not SERVER then return end
self:ShootBullet()
end
function SWEP:ShootBullet()
if not SERVER then return end
local ply = self:GetOwner()
if not IsValid(ply) then return end
local eyePos = ply:EyePos()
local eyeAng = ply:EyeAngles()
local tr = util.TraceLine({
start = eyePos,
endpos = eyePos + eyeAng:Forward() * (3 * 52.49),
filter = ply
})
ply:EmitSound("weapons/at4/at4_fp.wav", 100, 100, 1, CHAN_WEAPON)
if tr.Hit then
ply:EmitSound("weapons/rpg/rocketclose.wav", 75, 100, 1, CHAN_ITEM)
local inert = ents.Create("prop_physics")
if IsValid(inert) then
inert:SetModel("models/weapons/w_panzerfaust3_sandstorm_projectile.mdl")
inert:SetPos(eyePos + eyeAng:Forward() * 10)
inert:SetAngles(eyeAng)
inert:Spawn()
inert:Activate()
local phys = inert:GetPhysicsObject()
if IsValid(phys) then
phys:SetVelocity(eyeAng:Forward() * 300)
end
timer.Simple(10, function()
if IsValid(inert) then inert:Remove() end
end)
end
self:DropTube()
return
end
local missile = ents.Create("lvs_missile")
if not IsValid(missile) then
self:DropTube()
return
end
missile:SetPos(eyePos)
missile:SetAngles(eyeAng)
missile:Spawn()
missile:Activate()
missile:SetDamage(1000)
missile:SetRadius(120)
missile:SetForce(60000)
missile:SetAttacker(ply)
missile:SetEntityFilter({ply})
missile:SetTurnSpeed(0)
missile:SetSpeed(1500)
missile:Enable()
ParticleEffect("ins_weapon_rpg_frontblast", eyePos, eyeAng, ply)
ParticleEffect("ins_weapon_rpg_backblast", eyePos - eyeAng:Forward()*80, eyeAng - Angle(0,180,0), ply)
local pphys = ply:GetPhysicsObject()
if IsValid(pphys) then
pphys:ApplyForceOffset(-eyeAng:Forward() * 2000, eyePos)
end
self:DropTube()
end

View File

@@ -0,0 +1,226 @@
-- Variables that are used on both client and server
SWEP.Gun = ("weapon_sw_rpg26") -- must be the name of your swep but NO CAPITALS!
SWEP.Category = "FT | Antitank" --Category where you will find your weapons
SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models
SWEP.ShellEjectAttachment = "1" -- Should be "2" for CSS models or "1" for hl2 models
SWEP.Author = "Shtormer, Scripty"
SWEP.Contact = ""
SWEP.Purpose = ""
SWEP.Manufacturer = "FT_Scripty"
SWEP.Instructions = ""
SWEP.PrintName = "RPG-26" -- Weapon name (Shown on HUD)
SWEP.Slot = 4 -- Slot in the weapon selection menu
SWEP.SlotPos = 4 -- Position in the slot
SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter
SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box
SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce?
SWEP.DrawCrosshair = true -- set false if you want no crosshair
SWEP.Weight = 89 -- rank relative ot other weapons. bigger is better
SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up
SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon
SWEP.HoldType = "rpg" -- how others view you carrying the weapon
-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive
-- you're mostly going to use ar2, smg, shotgun or pistol. rpg makes for good sniper rifles
SWEP.ViewModelFOV = 70
SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/fas2/view/explosives/rpg26.mdl"
SWEP.WorldModel = "models/weapons/fas2/world/explosives/rpg26.mdl"
SWEP.ShowWorldModel = true
SWEP.Base = "tfa_bash_base" --the Base this weapon will work on. PLEASE RENAME THE BASE!
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.FiresUnderwater = false
SWEP.UseHands = true
SWEP.Type = "Man-Portable Anti-Tank Weapon"
SWEP.IronSightTime = 0.5
SWEP.Primary.Sound = Sound("weapons/at4/at4_fp.wav") -- This is the sound of the weapon, when you shoot.
SWEP.Primary.RPM = 325 -- This is in Rounds Per Minute
SWEP.Primary.ClipSize = 1 -- Size of a clip
SWEP.Primary.DefaultClip = 1 -- Bullets you start with
SWEP.Primary.KickUp = 2.25 -- Maximum up recoil (rise)
SWEP.Primary.KickDown = 1.75 -- Maximum down recoil (skeet)
SWEP.Primary.KickHorizontal = 1.45 -- Maximum up recoil (stock)
SWEP.Primary.Automatic = false -- Automatic = true; Semi Auto = false
SWEP.Primary.Ammo = "rpg_round" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun
SWEP.Primary.StaticRecoilFactor = 1.3
SWEP.SelectiveFire = false
SWEP.Secondary.BashInterrupt = false -- Do you need to be in a "ready" status to bash?
SWEP.Secondary.BashDelay = 0.1
SWEP.Secondary.BashLength = 52
SWEP.Secondary.BashEnd = 2.25 -- Override bash sequence length easier
SWEP.Secondary.BashDamage = 56
SWEP.Secondary.IronFOV = 50 -- How much you 'zoom' in. Less is more!
SWEP.data = {} --The starting firemode
SWEP.Primary.Damage = 225 -- Base damage per bullet
SWEP.Primary.Spread = .021 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact)
SWEP.Primary.IronAccuracy = .008 -- Ironsight accuracy, should be the same for shotguns
-- Enter iron sight info and bone mod info below
SWEP.IronSightsPos = Vector(-2, -1, -1)
SWEP.IronSightsAng = Vector(0.65, -0.02, 0)
SWEP.IronSightsPos_Pgo7 = Vector(-2.5, -1, 0.6)
SWEP.IronSightsAng_Pgo7 = Vector(0, 0, 0)
SWEP.RunSightsPos = Vector(4.762, -4.238, -0.717)
SWEP.RunSightsAng = Vector(-6.743, 46.284, 0)
SWEP.InspectPos = Vector(7.76, -2, 0.016)
SWEP.InspectAng = Vector(1, 37.277, 3.2)
SWEP.Offset = {
Pos = {
Up = -2.5,
Right = 1.1,
Forward = 8.295
},
Ang = {
Up = -1.043,
Right = 0,
Forward = 180,
},
Scale = 1.0
} --Procedural world model animation, defaulted for CS:S purposes.
SWEP.VElements = {
}
SWEP.Attachments = {
}
SWEP.WElements = {
}
SWEP.Sights_Mode = TFA.Enum.LOCOMOTION_HYBRID -- ANI = mdl, HYBRID = lua but continue idle, Lua = stop mdl animation
SWEP.Idle_Mode = TFA.Enum.IDLE_BOTH --TFA.Enum.IDLE_DISABLED = no idle, TFA.Enum.IDLE_LUA = lua idle, TFA.Enum.IDLE_ANI = mdl idle, TFA.Enum.IDLE_BOTH = TFA.Enum.IDLE_ANI + TFA.Enum.IDLE_LUA
SWEP.Sprint_Mode = TFA.Enum.LOCOMOTION_LUA -- ANI = mdl, HYBRID = ani + lua, Lua = lua only
SWEP.RunSightsPos = Vector(0, -5, 0) --Change this, using SWEP Creation Kit preferably
SWEP.RunSightsAng = Vector(20, 0, 0) --Change this, using SWEP Creation Kit preferably
SWEP.SprintBobMult = 1.3
SWEP.SprintAnimation = {
["loop"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "base_sprint", --Number for act, String/Number for sequence
["is_idle"] = true
}
}
SWEP.Entities = {}
function SWEP:PrimaryAttack()
if not SERVER then return end
if self._NextFire and self._NextFire > CurTime() then return end
if self:Clip1() <= 0 then
self:Reload()
return
end
self._NextFire = CurTime() + 5.5 -- Запрет на стрельбу во время перезарядки
self:FireShot()
self:TakePrimaryAmmo(1)
local ply = self:GetOwner()
if not IsValid(ply) then return end
local shootPos = ply:GetShootPos()
local shootAng = ply:EyeAngles()
-- Эффект вылета тубуса (через 0.2с после выстрела)
timer.Simple(0.2, function()
if not IsValid(ply) then return end
local ent = ents.Create("prop_physics")
if not IsValid(ent) then return end
ent:SetModel("models/weapons/fas2/world/explosives/rpg26.mdl")
ent:SetPos(shootPos + shootAng:Forward() * -20)
ent:SetAngles(shootAng)
ent:Spawn()
ent:Activate()
timer.Simple(3, function()
if IsValid(ent) then ent:Remove() end
end)
end)
end
function SWEP:FireShot()
if SERVER then
local ply = self:GetOwner()
if not IsValid(ply) then return end
local safetyDist = 3
local tr = util.TraceLine({
start = ply:EyePos(),
endpos = ply:EyePos() + ply:EyeAngles():Forward() * (safetyDist * 52.49),
filter = ply
})
if tr.Hit then
ply:EmitSound("weapons/rpg/rocketclose.wav")
local inert = ents.Create("prop_physics")
if IsValid(inert) then
inert:SetModel("models/weapons/fas2/world/explosives/rpg26/rocket.mdl")
inert:SetPos(ply:EyePos() + ply:EyeAngles():Forward() * 10)
inert:SetAngles(ply:EyeAngles())
inert:Spawn()
inert:Activate()
local phys = inert:GetPhysicsObject()
if IsValid(phys) then
phys:SetVelocity(ply:EyeAngles():Forward() * 300)
end
timer.Simple(10, function()
if IsValid(inert) then inert:Remove() end
end)
end
return
end
local pos = ply:EyePos()
local ang = ply:EyeAngles()
local missile = ents.Create("lvs_missile")
if not IsValid(missile) then return end
missile:SetPos(pos)
missile:SetAngles(ang)
missile:Spawn()
missile:Activate()
missile:SetDamage(1000) -- урон
missile:SetRadius(120) -- радиус поражения
missile:SetForce(60000) -- сила взрыва
missile:SetAttacker(ply)
missile:SetEntityFilter({ply})
missile:SetTurnSpeed(0)
missile:SetSpeed(1500) -- скорость полёта
missile:Enable()
ParticleEffect("ins_weapon_rpg_frontblast", pos, ang, ply)
ParticleEffect("ins_weapon_rpg_backblast", pos - ang:Forward()*80, ang - Angle(0,180,0), ply)
local phys = ply:GetPhysicsObject()
if IsValid(phys) then
phys:ApplyForceOffset(-ang:Forward() * 2000, pos)
end
end
end
SWEP.SequenceRateOverrideScaled = {
[ACT_VM_PRIMARYATTACK] = 0.85,
[ACT_VM_PRIMARYATTACK_1] = 0.85
}
SWEP.ProjectileVelocity = 7150 * 12 / 10
SWEP.DisableChambering = true

View File

@@ -0,0 +1,267 @@
-- БИБА СТРОЧКА 100!!!!!!!
SWEP.Gun = ("weapon_sw_rpg28") -- must be the name of your swep but NO CAPITALS!
SWEP.Category = "FT | Antitank" --Category where you will find your weapons
SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models
SWEP.ShellEjectAttachment = "1" -- Should be "2" for CSS models or "1" for hl2 models
SWEP.Author = "Shtormer, Scripty"
SWEP.Contact = ""
SWEP.Purpose = ""
SWEP.Manufacturer = "FT_Scripty"
SWEP.Instructions = ""
SWEP.PrintName = "RPG-28" -- Weapon name (Shown on HUD)
SWEP.Slot = 4 -- Slot in the weapon selection menu
SWEP.SlotPos = 4 -- Position in the slot
SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter
SWEP.DrawWeaponInfoBox = false -- Should draw the weapon info box
SWEP.BounceWeaponIcon = false -- Should the weapon icon bounce?
SWEP.DrawCrosshair = true -- set false if you want no crosshair
SWEP.Weight = 89 -- rank relative ot other weapons. bigger is better
SWEP.AutoSwitchTo = true -- Auto switch to if we pick it up
SWEP.AutoSwitchFrom = true -- Auto switch from if you pick up a better weapon
SWEP.HoldType = "rpg" -- how others view you carrying the weapon
-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive
-- you're mostly going to use ar2, smg, shotgun or pistol. rpg makes for good sniper rifles
SWEP.ViewModelFOV = 70
SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/javelin_c.mdl" -- Weapon view model
SWEP.WorldModel = "models/weapons/rpg28_launcher.mdl" -- Weapon world model
SWEP.ShowWorldModel = true
SWEP.Base = "tfa_bash_base" --the Base this weapon will work on. PLEASE RENAME THE BASE!
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.FiresUnderwater = false
SWEP.UseHands = true
SWEP.Type = "Man-Portable Anti-Tank Weapon"
SWEP.IronSightTime = 0.5
SWEP.Primary.Sound = Sound("weapons/at4/at4_fp.wav")
SWEP.Primary.RPM = 325 -- This is in Rounds Per Minute
SWEP.Primary.ClipSize = 1 -- Size of a clip
SWEP.Primary.DefaultClip = 3 -- Bullets you start with
SWEP.Primary.KickUp = 2.25 -- Maximum up recoil (rise)
SWEP.Primary.KickDown = 1.75 -- Maximum down recoil (skeet)
SWEP.Primary.KickHorizontal = 1.45 -- Maximum up recoil (stock)
SWEP.Primary.Automatic = false -- Automatic = true; Semi Auto = false
SWEP.Primary.Ammo = "rpg_round" -- pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, AirboatGun
SWEP.Primary.StaticRecoilFactor = 1.3
SWEP.SelectiveFire = false
SWEP.ShowViewModel = false
SWEP.ShowWorldModel = false
SWEP.Secondary.BashInterrupt = false -- Do you need to be in a "ready" status to bash?
SWEP.Secondary.BashDelay = 0.1
SWEP.Secondary.BashLength = 52
SWEP.Secondary.BashEnd = 2.25 -- Override bash sequence length easier
SWEP.Secondary.BashDamage = 56
SWEP.Secondary.IronFOV = 25 -- How much you 'zoom' in. Less is more!
SWEP.data = {} --The starting firemode
SWEP.Primary.Damage = 225 -- Base damage per bullet
SWEP.Primary.Spread = .021 -- Define from-the-hip accuracy 1 is terrible, .0001 is exact)
SWEP.Primary.IronAccuracy = .008 -- Ironsight accuracy, should be the same for shotguns
SWEP.Scoped = true
-- Enter iron sight info and bone mod info below
SWEP.IronSightsPos = Vector(-9, 1, -9)
SWEP.IronSightsAng = Vector(0, -5, 0)
SWEP.IronSightsPos_Pgo7 = Vector(-2.5, -1, 0.6)
SWEP.IronSightsAng_Pgo7 = Vector(0, 0, 0)
SWEP.RunSightsPos = Vector(4.762, -4.238, -0.717)
SWEP.RunSightsAng = Vector(-6.743, 46.284, 0)
SWEP.InspectPos = Vector(7.76, -2, 0.016)
SWEP.InspectAng = Vector(1, 37.277, 3.2)
SWEP.Offset = {
Pos = {
Up = -1.5,
Right = 1,
Forward = 0
},
Ang = {
Up = -1,
Right = -2,
Forward = 178
},
Scale = 1
} --Procedural world model animation, defaulted for CS:S purposes.
SWEP.ViewModelBoneMods = {
["j_gun"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(-18, -5, -8), angle = Angle(-10, 0, 3) }
}
SWEP.VElements = {
["nlaw"] = { type = "Model", model = "models/weapons/rpg28_launcher.mdl", bone = "j_gun", rel = "", pos = Vector(0, 0, 0), angle = Angle(0, 180, 0), size = Vector(0.8, 0.8, 0.8), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.WElements = {
["nlaw"] = { type = "Model", model = "models/weapons/rpg28_launcher.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(0.3, 2, 1), angle = Angle(10, 180, 180), size = Vector(0.5, 0.5, 0.5), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.Sights_Mode = TFA.Enum.LOCOMOTION_HYBRID -- ANI = mdl, HYBRID = lua but continue idle, Lua = stop mdl animation
SWEP.Idle_Mode = TFA.Enum.IDLE_BOTH --TFA.Enum.IDLE_DISABLED = no idle, TFA.Enum.IDLE_LUA = lua idle, TFA.Enum.IDLE_ANI = mdl idle, TFA.Enum.IDLE_BOTH = TFA.Enum.IDLE_ANI + TFA.Enum.IDLE_LUA
SWEP.Sprint_Mode = TFA.Enum.LOCOMOTION_LUA -- ANI = mdl, HYBRID = ani + lua, Lua = lua only
SWEP.RunSightsPos = Vector(0, -5, 0) --Change this, using SWEP Creation Kit preferably
SWEP.RunSightsAng = Vector(20, 0, 0) --Change this, using SWEP Creation Kit preferably
SWEP.SprintBobMult = 1.3
SWEP.SprintAnimation = {
["loop"] = {
["type"] = TFA.Enum.ANIMATION_SEQ, --Sequence or act
["value"] = "base_sprint", --Number for act, String/Number for sequence
["is_idle"] = true
}
}
SWEP.ReticleScale = 0.7
SWEP.ScopeScale = 0.5
DEFINE_BASECLASS( SWEP.Base )
SWEP.Primary.AttacksWithNoAmmo = true
SWEP.Primary.ClipSize = -1
function SWEP:PrimaryAttack()
if not SERVER then return end
if self._NextFire and self._NextFire > CurTime() then return end
self._NextFire = CurTime() + 0.5
self:FireShot()
end
function SWEP:FireShot()
if not SERVER then return end
local ply = self:GetOwner()
if not IsValid(ply) then return end
ply:EmitSound("weapons/at4/at4_fp.wav", 100, 100, 1, CHAN_WEAPON)
local eyePos = ply:GetShootPos()
local eyeAng = ply:EyeAngles()
local safetyDist = 3 * 52.49
local tr = util.TraceLine({
start = eyePos,
endpos = eyePos + eyeAng:Forward() * safetyDist,
filter = ply
})
if tr.Hit then
ply:EmitSound("weapons/rpg/rocketclose.wav", 75, 100, 1, CHAN_ITEM)
local inert = ents.Create("prop_physics")
if IsValid(inert) then
inert:SetModel("models/weapons/fas2/world/explosives/rpg26/rocket.mdl")
inert:SetPos(eyePos + eyeAng:Forward() * 10)
inert:SetAngles(eyeAng)
inert:Spawn()
inert:Activate()
local phys = inert:GetPhysicsObject()
if IsValid(phys) then
phys:SetVelocity(eyeAng:Forward() * 300)
end
timer.Simple(10, function()
if IsValid(inert) then inert:Remove() end
end)
end
self:DropTube()
ply:StripWeapon(self:GetClass())
return
end
local spawnPos = eyePos + eyeAng:Forward() * 40
local missile = ents.Create("lvs_missile")
if not IsValid(missile) then return end
missile:SetPos(spawnPos)
missile:SetAngles(eyeAng)
missile:Spawn()
missile:Activate()
missile:SetDamage(3000)
missile:SetRadius(180)
missile:SetForce(90000)
missile:SetAttacker(ply)
missile:SetEntityFilter({ply})
missile:SetTurnSpeed(0)
missile:SetSpeed(1800)
missile.Autopilot = false
timer.Simple(0, function()
if IsValid(missile) then
local phys = missile:GetPhysicsObject()
if IsValid(phys) then
phys:SetVelocity(eyeAng:Forward() * 1800)
phys:SetAngles(eyeAng)
end
end
end)
missile:Enable()
ParticleEffect("ins_weapon_rpg_frontblast", spawnPos, eyeAng, ply)
ParticleEffect("ins_weapon_rpg_backblast", spawnPos - eyeAng:Forward()*80, eyeAng - Angle(0,180,0), ply)
local phys = ply:GetPhysicsObject()
if IsValid(phys) then
phys:ApplyForceOffset(-eyeAng:Forward() * 2000, eyePos)
end
self:DropTube()
ply:StripWeapon(self:GetClass())
end
function SWEP:DropTube()
local ply = self:GetOwner()
if not IsValid(ply) then return end
local eyePos = ply:EyePos()
local eyeAng = ply:EyeAngles()
local tube = ents.Create("prop_physics")
if not IsValid(tube) then return end
tube:SetModel(self.WorldModel)
tube:SetPos(eyePos + eyeAng:Forward() * -20)
tube:SetAngles(eyeAng)
tube:Spawn()
tube:Activate()
ply:StripWeapon(self:GetClass())
timer.Simple(3, function()
if IsValid(tube) then tube:Remove() end
end)
end
if CLIENT then
SWEP.Secondary.ScopeTable =
{
ScopeBorder = Color(0, 0, 0, 255),
ScopeMaterial = Material("models/eryx/noise"),
ScopeOverlay = Material("models/eryx/overlay"),
ScopeCrosshair = { -- can also be just a Material() value
r = 0, g = 0, b = 0, a = 255, -- color
scale = 1, -- scale or crosshair line width if no material specified
Material = Material("scope/gdcw_acogcross"), -- material, OPTIONAL!
}
}
end
SWEP.SequenceRateOverrideScaled = {
[ACT_VM_PRIMARYATTACK] = 0.85,
[ACT_VM_PRIMARYATTACK_1] = 0.85
}
SWEP.ProjectileVelocity = 7150 * 12 / 10 --Entity to shoot's velocity
SWEP.DisableChambering = true