summaryrefslogtreecommitdiff
path: root/gamemode/structuresystem/structures/ironfurnace.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/structuresystem/structures/ironfurnace.lua')
-rw-r--r--gamemode/structuresystem/structures/ironfurnace.lua82
1 files changed, 82 insertions, 0 deletions
diff --git a/gamemode/structuresystem/structures/ironfurnace.lua b/gamemode/structuresystem/structures/ironfurnace.lua
new file mode 100644
index 0000000..81b6988
--- /dev/null
+++ b/gamemode/structuresystem/structures/ironfurnace.lua
@@ -0,0 +1,82 @@
+local STRUCT = {}
+
+STRUCT.Name = "Iron Furnace"
+STRUCT.Model = "models/props_c17/furniturefireplace001a.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 timefunc = function(ply, num)
+ local time = math.pow(num,STRUCT.timemult)*4 - math.pow(ply:GetSkill("Smelting"),STRUCT.skillease)
+ return time
+end
+
+local noSkillTimeFunc = 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"] = "Tech",
+ ["Description"] = "Smelt some tech ore into tech!",
+ ["Requirements"] = {["Tech Ore"] = 1},
+ ["Results"] = {["Tech"] = 1},
+ ["Ratio"] = {1,1},
+ ["Image"] = "items/ingot_tech.png",
+ ["CanCraft"] = checkfunc,
+ ["Time"] = timefunc,
+ ["Mults"] = {1,5,10,25},
+ ["Skill"] = "Smelting",
+ ["SmeltAll"] = true,
+ ["MaxAmount"] = 50,
+}
+
+genericGiveRecipie(STRUCT,genericRecipe)
+
+local genericRecipe = {
+ ["Name"] = "Charcoal",
+ ["Description"] = "Used in the production of charcoal.",
+ ["Requirements"] = {["Wood"] = 5},
+ ["Results"] = {["Charcoal"] = 1},
+ ["Ratio"] = {1,1},
+ ["Image"] = "items/coal.png",
+ ["CanCraft"] = checkfunc,
+ ["Time"] = noSkillTimeFunc,
+ ["Mults"] = {1,10},
+}
+
+genericGiveRecipie(STRUCT,genericRecipe)
+
+local genericRecipe = {
+ ["Name"] = "Glass",
+ ["Description"] = "Glass can be used for making bottles and lighting.",
+ ["Requirements"] = {["Sand"] = 2},
+ ["Results"] = {["Glass"] = 1},
+ ["Ratio"] = {1,1},
+ ["Image"] = "items/glass.png",
+ ["CanCraft"] = checkfunc,
+ ["Time"] = noSkillTimeFunc,
+ ["Mults"] = {1},
+}
+
+genericGiveRecipie(STRUCT,genericRecipe)
+
+
+genericMakeCrafting(STRUCT)
+
+registerStructure(STRUCT)