From e879c365577b0cc51c48bace7cd5fb52cdc26eaa Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 20 Jun 2016 15:33:39 -0400 Subject: Re-syncing last updated copy --- gamemode/structuresystem/structures/factory.lua | 128 ++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 gamemode/structuresystem/structures/factory.lua (limited to 'gamemode/structuresystem/structures/factory.lua') diff --git a/gamemode/structuresystem/structures/factory.lua b/gamemode/structuresystem/structures/factory.lua new file mode 100644 index 0000000..ae5b442 --- /dev/null +++ b/gamemode/structuresystem/structures/factory.lua @@ -0,0 +1,128 @@ +local STRUCT = {} + +STRUCT.Name = "Factory" +STRUCT.Model = "models/props_c17/factorymachine01.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"] = "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"] = timefunc, + ["Mults"] = {1,5,10,25}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 200, +} + +genericGiveRecipie(STRUCT,genericRecipe) + +local genericRecipe = { + ["Name"] = "Copper", + ["Description"] = "Smelt some copper ore into copper!", + ["Requirements"] = {["Copper Ore"] = 1}, + ["Results"] = {["Copper"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/ingot_copper.png", + ["CanCraft"] = checkfunc, + ["Time"] = timefunc, + ["Mults"] = {}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 200, +} + +genericGiveRecipie(STRUCT,genericRecipe) + +local genericRecipe = { + ["Name"] = "Resin", + ["Description"] = "Extracts the resin from the wood.", + ["Requirements"] = {["Water Bottles"] = 0.2, ["Wood"] = 3}, + ["Results"] = {["Resin"] = 0.2}, + ["Ratio"] = {1,1}, + ["Image"] = "items/resin.png", + ["CanCraft"] = checkfunc, + ["Time"] = noSkillTimeFunc, + ["Mults"] = {5,10,25}, +} + +genericGiveRecipie(STRUCT,genericRecipe) + +local genericRecipe = { + ["Name"] = "Plastic", + ["Description"] = "Solidifies the Resin, creating a natural plastic.", + ["Requirements"] = {["Resin"] = 1}, + ["Results"] = {["Plastic"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/plastic.png", + ["CanCraft"] = checkfunc, + ["Time"] = noSkillTimeFunc, + ["Mults"] = {10,25}, +} + +genericGiveRecipie(STRUCT,genericRecipe) + +local genericRecipe = { + ["Name"] = "Glass", + ["Description"] = "Heats sand to form glass.", + ["Requirements"] = {["Sand"] = 2.5}, + ["Results"] = {["Glass"] = 1}, + ["Ratio"] = {0.8,1}, + ["Image"] = "items/glass.png", + ["CanCraft"] = checkfunc, + ["Time"] = noSkillTimeFunc, + ["Mults"] = {10,25,50}, + ["Skill"] = "Weapon_Crafting", +} + +genericGiveRecipie(STRUCT,genericRecipe) + +local genericRecipe = { + ["Name"] = "Sand", + ["Description"] = "Crushes stone to sand.", + ["Requirements"] = {["Stone"] = 1}, + ["Results"] = {["Sand"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/sand.png", + ["CanCraft"] = checkfunc, + ["Time"] = noSkillTimeFunc, + ["Mults"] = {10,25,50}, + ["Skill"] = "Weapon_Crafting", +} + +genericGiveRecipie(STRUCT,genericRecipe) + +genericMakeCrafting(STRUCT) + +registerStructure(STRUCT) -- cgit v1.2.3-70-g09d2