summaryrefslogtreecommitdiff
path: root/gamemode/structuresystem/structures/copperfurnace.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/structuresystem/structures/copperfurnace.lua')
-rw-r--r--gamemode/structuresystem/structures/copperfurnace.lua68
1 files changed, 68 insertions, 0 deletions
diff --git a/gamemode/structuresystem/structures/copperfurnace.lua b/gamemode/structuresystem/structures/copperfurnace.lua
new file mode 100644
index 0000000..c115967
--- /dev/null
+++ b/gamemode/structuresystem/structures/copperfurnace.lua
@@ -0,0 +1,68 @@
+local STRUCT = {}
+
+STRUCT.Name = "Copper Furnace"
+STRUCT.Model = "models/props/cs_militia/furnace01.mdl"
+
+STRUCT.onInitialize = function(self)
+ --print("Initalize called!")
+end
+
+STRUCT.uniquedata = false
+
+STRUCT.onUse = function(self, ply)
+ if CLIENT and ply != LocalPlayer() then return end
+ --print("onUse called!")
+end
+
+STRUCT.timemult = 0.5
+STRUCT.skillease = 0.25
+
+local irontimefunc = function(ply, num)
+ local time = math.pow(num,STRUCT.timemult)*4 - math.pow(ply:GetSkill("Smelting"),STRUCT.skillease)
+ return time
+end
+
+local sulphurtimefunc = function(ply, num)
+ local time = math.pow(num,STRUCT.timemult)*4 - math.pow(10,STRUCT.skillease)
+ return time
+end
+
+local checkfunc = function(ply)
+ return true
+end
+
+local genericRecipe = {
+ ["Name"] = "Iron",
+ ["Description"] = "Smelt some iron ore into iron!",
+ ["Requirements"] = {["Iron Ore"] = 1},
+ ["Results"] = {["Iron"] = 1},
+ ["Ratio"] = {1,1},
+ ["Image"] = "items/ingot_iron.png",
+ ["CanCraft"] = checkfunc,
+ ["Time"] = irontimefunc,
+ ["Mults"] = {1,5,10,25},
+ ["Skill"] = "Smelting",
+ ["SmeltAll"] = true,
+ ["MaxAmount"] = 50,
+}
+
+genericGiveRecipie(STRUCT,genericRecipe)
+
+local genericRecipe = {
+ ["Name"] = "Sulphur",
+ ["Description"] = "Make some sulphur!",
+ ["Requirements"] = {["Stone"] = 2},
+ ["Results"] = {["Sulphur"] = 1},
+ ["Ratio"] = {1,1},
+ ["Image"] = "items/sulphur.png",
+ ["CanCraft"] = checkfunc,
+ ["Time"] = sulphurtimefunc,
+ ["Mults"] = {5,10},
+}
+
+genericGiveRecipie(STRUCT,genericRecipe)
+
+
+genericMakeCrafting(STRUCT)
+
+registerStructure(STRUCT)