Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated all SWEP files to a unified format #819

Merged
merged 1 commit into from
Mar 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 0 additions & 100 deletions garrysmod/lua/weapons/flechette_gun.lua

This file was deleted.

36 changes: 19 additions & 17 deletions garrysmod/lua/weapons/weapon_fists.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@

AddCSLuaFile()

SWEP.PrintName = "Fists"
SWEP.PrintName = "Fists"
SWEP.Author = "Kilburn, robotboy655, MaxOfS2D & Tenrys"
SWEP.Purpose = "Well we sure as hell didn't use guns! We would just wrestle Hunters to the ground with our bare hands! I used to kill ten, twenty a day, just using my fists."

SWEP.Author = "Kilburn, robotboy655, MaxOfS2D & Tenrys"
SWEP.Purpose = "Well we sure as hell didn't use guns! We would just wrestle Hunters to the ground with our bare hands! I used to kill ten, twenty a day, just using my fists."
SWEP.Slot = 0
SWEP.SlotPos = 4

SWEP.Spawnable = true
SWEP.UseHands = true
SWEP.DrawAmmo = false
SWEP.Spawnable = true

SWEP.ViewModel = "models/weapons/c_arms_citizen.mdl"
SWEP.WorldModel = ""

SWEP.ViewModelFOV = 52
SWEP.Slot = 0
SWEP.SlotPos = 5
SWEP.ViewModel = Model( "models/weapons/c_arms_citizen.mdl" )
SWEP.WorldModel = ""
SWEP.ViewModelFOV = 54
SWEP.UseHands = true

SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
Expand All @@ -27,7 +25,11 @@ SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = true
SWEP.Secondary.Ammo = "none"

local SwingSound = Sound( "weapons/slam/throw.wav" )
SWEP.DrawAmmo = false

SWEP.HitDistance = 48

local SwingSound = Sound( "WeaponFrag.Throw" )
local HitSound = Sound( "Flesh.ImpactHard" )

function SWEP:Initialize()
Expand All @@ -42,8 +44,6 @@ function SWEP:PreDrawViewModel( vm, wep, ply )

end

SWEP.HitDistance = 48

function SWEP:SetupDataTables()

self:NetworkVar( "Float", 0, "NextMeleeAttack" )
Expand Down Expand Up @@ -83,7 +83,9 @@ function SWEP:PrimaryAttack( right )
end

function SWEP:SecondaryAttack()

self:PrimaryAttack( true )

end

function SWEP:DealDamage()
Expand All @@ -108,7 +110,7 @@ function SWEP:DealDamage()
} )
end

-- We need the second part for single player because SWEP:Think is ran shared in SP.
-- We need the second part for single player because SWEP:Think is ran shared in SP
if ( tr.Hit && !( game.SinglePlayer() && CLIENT ) ) then
self:EmitSound( HitSound )
end
Expand Down Expand Up @@ -220,4 +222,4 @@ function SWEP:Think()

end

end
end
81 changes: 81 additions & 0 deletions garrysmod/lua/weapons/weapon_flechette.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

if ( IsMounted( "ep2" ) ) then AddCSLuaFile() else return end

SWEP.PrintName = "Flechette Gun"
SWEP.Author = "garry"
SWEP.Purpose = "Shoot flechettes with primary attack."

SWEP.Slot = 1
SWEP.SlotPos = 2

SWEP.Spawnable = true

SWEP.ViewModel = Model( "models/weapons/c_smg1.mdl" )
SWEP.WorldModel = Model( "models/weapons/w_smg1.mdl" )
SWEP.ViewModelFOV = 54
SWEP.UseHands = true

SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "none"

SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"

SWEP.DrawAmmo = false
SWEP.AdminOnly = true

game.AddParticles( "particles/hunter_flechette.pcf" )
game.AddParticles( "particles/hunter_projectile.pcf" )

local ShootSound = Sound( "NPC_Hunter.FlechetteShoot" )

function SWEP:Initialize()

self:SetHoldType( "smg" )

end

function SWEP:Reload()

end

function SWEP:PrimaryAttack()

self:SetNextPrimaryFire( CurTime() + 0.1 )

self:EmitSound( ShootSound )
self:ShootEffects( self )

if (!SERVER) then return end

local Forward = self.Owner:EyeAngles():Forward()

local ent = ents.Create( "hunter_flechette" )
if ( IsValid( ent ) ) then

ent:SetPos( self.Owner:GetShootPos() + Forward * 32 )
ent:SetAngles( self.Owner:EyeAngles() )
ent:Spawn()

ent:SetVelocity( Forward * 2000 )
ent:SetOwner( self.Owner )

end

end

function SWEP:SecondaryAttack()

-- TODO: Reimplement the old rollermine secondary attack?

end

function SWEP:ShouldDropOnDie()

return false

end
30 changes: 15 additions & 15 deletions garrysmod/lua/weapons/weapon_medkit.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@

AddCSLuaFile()

SWEP.PrintName = "Medkit"
SWEP.Author = "robotboy655 & MaxOfS2D"
SWEP.Purpose = "Heal people with your primary attack, or yourself with the secondary."
SWEP.PrintName = "Medkit"
SWEP.Author = "robotboy655 & MaxOfS2D"
SWEP.Purpose = "Heal people with your primary attack, or yourself with the secondary."

SWEP.Spawnable = true
SWEP.UseHands = true
SWEP.Slot = 5
SWEP.SlotPos = 3

SWEP.ViewModel = "models/weapons/c_medkit.mdl"
SWEP.WorldModel = "models/weapons/w_medkit.mdl"
SWEP.Spawnable = true

SWEP.ViewModelFOV = 54
SWEP.Slot = 5
SWEP.SlotPos = 3
SWEP.ViewModel = Model( "models/weapons/c_medkit.mdl" )
SWEP.WorldModel = Model( "models/weapons/w_medkit.mdl" )
SWEP.ViewModelFOV = 54
SWEP.UseHands = true

SWEP.Primary.ClipSize = 100
SWEP.Primary.DefaultClip = 100
Expand All @@ -25,11 +25,11 @@ SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"

SWEP.HealAmount = 20 -- Maximum heal amount per use
SWEP.MaxAmmo = 100 -- Maxumum ammo
SWEP.HealAmount = 20 -- Maximum heal amount per use
SWEP.MaxAmmo = 100 -- Maxumum ammo

local HealSound = Sound( "items/smallmedkit1.wav" )
local DenySound = Sound( "items/medshotno1.wav" )
local HealSound = Sound( "HealthKit.Touch" )
local DenySound = Sound( "WallHealth.Deny" )

function SWEP:Initialize()

Expand Down Expand Up @@ -137,4 +137,4 @@ function SWEP:CustomAmmoDisplay()

return self.AmmoDisplay

end
end