From 2afeee8c129aed8fac045735c302f290305f4e5c Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Thu, 31 Dec 2015 14:53:50 -0500 Subject: Added explosive rune --- .../hud/ws2_icons/icon_runeexplosive.png | Bin 0 -> 13033 bytes .../hud/ws2_icons/runeexplosive.png | Bin 13033 -> 0 bytes gamemode/itemsystem/items/cup.lua | 2 +- gamemode/itemsystem/items/runeexplosive.lua | 54 +++++++++++++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 content/materials/wintersurvival2/hud/ws2_icons/icon_runeexplosive.png delete mode 100644 content/materials/wintersurvival2/hud/ws2_icons/runeexplosive.png create mode 100644 gamemode/itemsystem/items/runeexplosive.lua diff --git a/content/materials/wintersurvival2/hud/ws2_icons/icon_runeexplosive.png b/content/materials/wintersurvival2/hud/ws2_icons/icon_runeexplosive.png new file mode 100644 index 0000000..1ca24a5 Binary files /dev/null and b/content/materials/wintersurvival2/hud/ws2_icons/icon_runeexplosive.png differ diff --git a/content/materials/wintersurvival2/hud/ws2_icons/runeexplosive.png b/content/materials/wintersurvival2/hud/ws2_icons/runeexplosive.png deleted file mode 100644 index 1ca24a5..0000000 Binary files a/content/materials/wintersurvival2/hud/ws2_icons/runeexplosive.png and /dev/null differ diff --git a/gamemode/itemsystem/items/cup.lua b/gamemode/itemsystem/items/cup.lua index 5c8e27d..92e2a7e 100644 --- a/gamemode/itemsystem/items/cup.lua +++ b/gamemode/itemsystem/items/cup.lua @@ -7,7 +7,7 @@ ITEM.Icon = Material("wintersurvival2/hud/ws2_icons/icon_cupempty.png") ITEM.Recipe = { Resources = { - ["Log"] = 1, + ["Wood"] = 1, ["Sap"] = 1, }, Tools = { diff --git a/gamemode/itemsystem/items/runeexplosive.lua b/gamemode/itemsystem/items/runeexplosive.lua new file mode 100644 index 0000000..96d574c --- /dev/null +++ b/gamemode/itemsystem/items/runeexplosive.lua @@ -0,0 +1,54 @@ + +ITEM.Name = "Explosive Rune" +ITEM.Class = "resource" +ITEM.Desc = "A highly volitile rune! Handle with care." +ITEM.Model = "models/props_combine/breenlight.mdl" +ITEM.Icon = Material("wintersurvival2/hud/ws2_icons/icon_runeexplosive.png") + +ITEM.Structure = { + { + Bone = "ValveBiped.Bip01_R_Hand", + Model = "models/props_junk/rock001a.mdl", + Size = Vector(1,1,1), + Pos = Vector(3,-1.6,0.5), + Ang = Angle(0,0,0), + }, +} + +ITEM.Recipe = { + Resources = { + ["Energy Rune"] = 1, + ["Fire Rune"] = 1, + }, + Tools = {}, +} + + + +ITEM.Damage = 1 +ITEM.Range = 64 +ITEM.CD = 1 + +function ITEM:OnPrimary(user) + if(user:HasItem("Explosive Rune",1)) then + self:OnUse(user) + else + user:UnEquipWeaponSlot(user:GetSelectedWeapon()) + self:OnUse(user) + end +end + +function ITEM:OnUse(user) + if( not user:IsOnGround()) then + user:SetVelocity(Vector(0,0,500)) + user:TakeDamage(30) + else + user:TakeDamage(40) + end + user:RemoveItem(self.Name,1) + if(CLIENT) then return end + local exp = ents.Create("env_explosion") + exp:SetPos(user:GetPos()) + exp:Fire("Explode","",0) + exp:Spawn() +end -- cgit v1.2.3-70-g09d2