From 7e5db609550cca0d8b8a76c4bf78ba4658962167 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 16 Apr 2016 02:02:00 -0400 Subject: Initial commit --- entities/weapons/gms_stonehatchet.lua | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 entities/weapons/gms_stonehatchet.lua (limited to 'entities/weapons/gms_stonehatchet.lua') diff --git a/entities/weapons/gms_stonehatchet.lua b/entities/weapons/gms_stonehatchet.lua new file mode 100644 index 0000000..980b44c --- /dev/null +++ b/entities/weapons/gms_stonehatchet.lua @@ -0,0 +1,40 @@ + +AddCSLuaFile() + +SWEP.Slot = 4 +SWEP.SlotPos = 1 + +SWEP.Base = "gms_base_weapon" +SWEP.PrintName = "Stone Hatchet" +SWEP.ViewModel = "models/weapons/c_gms_hatchet.mdl" +SWEP.WorldModel = "models/weapons/w_gms_hatchet.mdl" + +SWEP.Purpose = "Effective woodcutting tool" +SWEP.Instructions = "Primary fire: Chop wood from a tree" + +SWEP.HoldType = "melee" + +SWEP.Primary.Damage = 7 +SWEP.Primary.Delay = 1 +SWEP.UseHands = true + +function SWEP:PlaySwingSound() + self:PlaySound( "weapons/iceaxe/iceaxe_swing1.wav" ) +end + +function SWEP:PlayHitSound() + self:PlaySound( "physics/glass/glass_bottle_impact_hard" .. math.random( 1, 3 ) .. ".wav" ) +end + +function SWEP:DoToolHit( ent ) + if ( ent:IsTreeModel() or ent:GetClass() == "gms_tree" ) then + self.Owner:DoProcess( "WoodCutting", 2, { + Entity = ent, + Chance = 50, + MinAmount = 1, + MaxAmount = 6, + } ) + else + self:PlayHitSound() + end +end -- cgit v1.2.3-70-g09d2