From 5c4ebc932d8c02522802c842d43d863d89aca162 Mon Sep 17 00:00:00 2001 From: Apickx Date: Mon, 28 Dec 2015 19:10:44 -0500 Subject: Initial commit --- gamemode/itemsystem/items/bow.lua | 59 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 gamemode/itemsystem/items/bow.lua (limited to 'gamemode/itemsystem/items/bow.lua') diff --git a/gamemode/itemsystem/items/bow.lua b/gamemode/itemsystem/items/bow.lua new file mode 100644 index 0000000..8ecee8e --- /dev/null +++ b/gamemode/itemsystem/items/bow.lua @@ -0,0 +1,59 @@ + +ITEM.Name = "Bow" +ITEM.Class = "weapon" +ITEM.Desc = "A primitive bow made from vine, sap, and wood." +ITEM.Model = "models/props_debris/wood_board02a.mdl" +ITEM.Icon = Material("wintersurvival2/hud/ws1_icons/icon_bow") +ITEM.HoldType = "smg" + +ITEM.Structure = { + { + Bone = "ValveBiped.Bip01_L_Hand", + Model = "models/props_debris/wood_board02a.mdl", + Size = Vector(.5,.5,.35), + Pos = Vector(-1,-6,9), + Ang = Angle(-30,-65,180), + }, + { + Bone = "ValveBiped.Bip01_L_Hand", + Model = "models/props_debris/wood_board02a.mdl", + Size = Vector(.5,.5,.35), + Pos = Vector(-1,-6,-9), + Ang = Angle(30,-65,180), + }, + { + Bone = "ValveBiped.Bip01_L_Hand", + Model = "models/props_debris/wood_board02a.mdl", + Size = Vector(.05,.05,.51), + Pos = Vector(-3.3,-9.5,0), + Ang = Angle(0,-65,180), + }, +} + +ITEM.Recipe = { + Resources = { + ["Plank"] = 2, + ["Rope"] = 1, + ["Sap"] = 1, + }, + Tools = {}, +} + +ITEM.CD = 1 + +function ITEM:OnPrimary(pl,tr) + if (CLIENT) then return end + if (!pl:HasItem("Arrow",1)) then return end + + local aim = pl:GetAimVector() + + local D = ents.Create("ws_arrow") + D:SetPos(pl:GetShootPos()+aim*20) + D:SetOwner(pl) + D:SetAngles(aim:Angle()) + D:Spawn() + pl:EmitSound(Sound("physics/flesh/flesh_impact_hard.wav"),100,math.random(90,110)) + D:GetPhysicsObject():ApplyForceCenter(aim * 10000) + + pl:RemoveItem("Arrow",1) +end -- cgit v1.2.3-70-g09d2