From 5e42851b122db26ff4bd96df988bc8bbf1d39178 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Thu, 31 Dec 2015 15:43:28 -0500 Subject: Finished feather fall rune --- .../hud/ws2_icons/icon_runefeatherfall.png | Bin 0 -> 12900 bytes .../wintersurvival2/hud/ws2_icons/rune.psd | Bin 62120 -> 87561 bytes gamemode/itemsystem/items/runefeatherfall.lua | 34 +++++++++++++++++++++ gamemode/server/damagemod.lua | 10 ++++++ 4 files changed, 44 insertions(+) create mode 100644 content/materials/wintersurvival2/hud/ws2_icons/icon_runefeatherfall.png create mode 100644 gamemode/itemsystem/items/runefeatherfall.lua create mode 100644 gamemode/server/damagemod.lua diff --git a/content/materials/wintersurvival2/hud/ws2_icons/icon_runefeatherfall.png b/content/materials/wintersurvival2/hud/ws2_icons/icon_runefeatherfall.png new file mode 100644 index 0000000..bb4b208 Binary files /dev/null and b/content/materials/wintersurvival2/hud/ws2_icons/icon_runefeatherfall.png differ diff --git a/content/materials/wintersurvival2/hud/ws2_icons/rune.psd b/content/materials/wintersurvival2/hud/ws2_icons/rune.psd index 47e3daf..fedee20 100644 Binary files a/content/materials/wintersurvival2/hud/ws2_icons/rune.psd and b/content/materials/wintersurvival2/hud/ws2_icons/rune.psd differ diff --git a/gamemode/itemsystem/items/runefeatherfall.lua b/gamemode/itemsystem/items/runefeatherfall.lua new file mode 100644 index 0000000..2ce71fd --- /dev/null +++ b/gamemode/itemsystem/items/runefeatherfall.lua @@ -0,0 +1,34 @@ + +ITEM.Name = "Feather-fall Rune" +ITEM.Class = "resource" +ITEM.Desc = "A rune that's lighter than air.\nCancels fall dammage" +ITEM.Model = "models/props_combine/breenlight.mdl" +ITEM.Icon = Material("wintersurvival2/hud/ws2_icons/icon_runefeatherfall.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 = { + ["Blank Rune"] = 1, + ["Feather"] = 1, + }, + Tools = {}, +} + + + +ITEM.Damage = 1 +ITEM.Range = 64 +ITEM.CD = 1 + +function ITEM:OnCraft(ply) + ply:AddFatigue(25) +end diff --git a/gamemode/server/damagemod.lua b/gamemode/server/damagemod.lua new file mode 100644 index 0000000..c90fb52 --- /dev/null +++ b/gamemode/server/damagemod.lua @@ -0,0 +1,10 @@ + +function GM:GetFallDamage(ply, speed) + print("Fall dammage detected:" .. speed) + if(ply:HasItem("Feather-fall Rune",1)) then + ply:RemoveItem("Feather-fall Rune",1) + return 0 + else + return speed/11 + end +end -- cgit v1.2.3-70-g09d2