aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/items/diamondsickle.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/items/diamondsickle.lua')
-rw-r--r--gamemode/itemsystem/items/diamondsickle.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/gamemode/itemsystem/items/diamondsickle.lua b/gamemode/itemsystem/items/diamondsickle.lua
index 0fd2688..37afc99 100644
--- a/gamemode/itemsystem/items/diamondsickle.lua
+++ b/gamemode/itemsystem/items/diamondsickle.lua
@@ -1,4 +1,4 @@
-
+local ITEM = {}
ITEM.Name = "Diamond Sickle"
ITEM.Class = "weapon"
ITEM.Desc = "A sickle made from ancient wood and diamonds"
@@ -42,21 +42,21 @@ ITEM.CD = 0.3
function ITEM:OnPrimary(pl,tr)
if (CLIENT) then return end
-
+
if (tr.Hit) then
if (IsValid(tr.Entity)) then
local ent = tr.Entity
local class = ent:GetClass()
-
+
if (class == "player" or class:find("npc_") or class == "ws_pigeon" or class == "ws_prop") then
ent:TakeDamage(self.Damage,pl)
-
+
if (class == "ws_prop") then pl:EmitSound(Sound("physics/wood/wood_plank_impact_hard"..math.random(1,3)..".wav"),100,math.random(90,110))
else pl:EmitSound(Sound("physics/flesh/flesh_impact_hard"..math.random(1,6)..".wav"),100,math.random(90,110)) end
elseif (ent:IsPlant()) then
if (math.random(1,35)/10 < 3) then pl:AddItem("Vine",1) end
if (math.random(1,35)/10 < 3) then pl:AddItem("Berry",1) end
-
+
pl:EmitSound(Sound("physics/concrete/rock_impact_hard"..math.random(1,6)..".wav"),100,math.random(90,110))
else
pl:EmitSound(Sound("physics/surfaces/sand_impact_bullet"..math.random(1,4)..".wav"),100,math.random(90,110))
@@ -68,3 +68,4 @@ function ITEM:OnPrimary(pl,tr)
pl:EmitSound(Sound("weapons/iceaxe/iceaxe_swing1.wav"),100,math.random(90,110))
end
end
+RegisterItem(ITEM)