aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/items/ancientwood.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/items/ancientwood.lua')
-rw-r--r--gamemode/itemsystem/items/ancientwood.lua17
1 files changed, 8 insertions, 9 deletions
diff --git a/gamemode/itemsystem/items/ancientwood.lua b/gamemode/itemsystem/items/ancientwood.lua
index 8f38c17..616ac57 100644
--- a/gamemode/itemsystem/items/ancientwood.lua
+++ b/gamemode/itemsystem/items/ancientwood.lua
@@ -1,4 +1,4 @@
-
+local ITEM = {}
ITEM.Name = "Ancient Wood"
ITEM.Class = "weapon"
ITEM.Desc = "A stronger type of wood.\nUsed for advanced equipment."
@@ -21,15 +21,15 @@ ITEM.CD = 0.6
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:GetModel():find("tree")) then
@@ -48,13 +48,12 @@ end
function ITEM:OnSecondary(pl,tr)
if (CLIENT) then return end
if (!pl:HasItem(self.Name)) then return end
-
+
local drop = SpawnWSItem(self.Name,pl:GetShootPos()+pl:GetAimVector()*20)
drop:GetPhysicsObject():ApplyForceCenter(pl:GetAimVector() * 200)
-
+
pl:RemoveItem(self.Name,1)
-
+
pl:EmitSound(Sound("weapons/iceaxe/iceaxe_swing1.wav"),100,math.random(40,60))
end
-
-
+RegisterItem(ITEM)