diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-06-20 15:33:39 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-06-20 15:33:39 -0400 |
| commit | e879c365577b0cc51c48bace7cd5fb52cdc26eaa (patch) | |
| tree | 822a52cf38efd6815f2b7483cf6369e68c3dab23 /gamemode/structuresystem/structures | |
| parent | f797cbe348dd52b51da4cd4812cfa291d1434095 (diff) | |
| download | gmstranded-e879c365577b0cc51c48bace7cd5fb52cdc26eaa.tar.gz gmstranded-e879c365577b0cc51c48bace7cd5fb52cdc26eaa.tar.bz2 gmstranded-e879c365577b0cc51c48bace7cd5fb52cdc26eaa.zip | |
Diffstat (limited to 'gamemode/structuresystem/structures')
11 files changed, 717 insertions, 15 deletions
diff --git a/gamemode/structuresystem/structures/aaaStructureExample.lua b/gamemode/structuresystem/structures/aaaStructureExample.lua index abe91ba..f8abb3c 100644 --- a/gamemode/structuresystem/structures/aaaStructureExample.lua +++ b/gamemode/structuresystem/structures/aaaStructureExample.lua @@ -6,11 +6,11 @@ STRUCT = {} STRUCT.Name = "Example Structure" --The model for this structure. -STRUCT.Model = "models/props/de_inferno/ClayOven.mdl" +STRUCT.Model = "models/props_combine/breendesk.mdl" --The initalize method. Called on both the server and the client STRUCT.onInitialize = function(self) - print("Initalize called!") + --print("Initalize called!") end --If this structure is not like every other structures of the same name (for example, if it has an internal inventory) @@ -18,5 +18,8 @@ STRUCT.uniquedata = false --Called when a player presses e on this structure, called on both the server and the client. Keep in mind that on the client side, ply may not be the local player! STRUCT.onUse = function(self,ply) - print("onUse called!") + --print("onUse called!") end + +--Don't forget to register the structure when you're done! +registerStructure(STRUCT) 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) 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) diff --git a/gamemode/structuresystem/structures/goldfurnace.lua b/gamemode/structuresystem/structures/goldfurnace.lua new file mode 100644 index 0000000..476758e --- /dev/null +++ b/gamemode/structuresystem/structures/goldfurnace.lua @@ -0,0 +1,48 @@ +local STRUCT = {} + +STRUCT.Name = "Gold Furnace" +STRUCT.Model = "models/props_industrial/oil_storage.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 checkfunc = function(ply) + return true +end + +local genericRecipe = { + ["Name"] = "Steel", + ["Description"] = "Smelt some steel ore into steel!", + ["Requirements"] = {["Steel Ore"] = 1}, + ["Results"] = {["Steel"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/ingot_steel.png", + ["CanCraft"] = checkfunc, + ["Time"] = timefunc, + ["Mults"] = {1,5,10,25}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 50, +} + +genericGiveRecipie(STRUCT,genericRecipe) + + +genericMakeCrafting(STRUCT) + +registerStructure(STRUCT) 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) diff --git a/gamemode/structuresystem/structures/mithrilfactory.lua b/gamemode/structuresystem/structures/mithrilfactory.lua new file mode 100644 index 0000000..aad02de --- /dev/null +++ b/gamemode/structuresystem/structures/mithrilfactory.lua @@ -0,0 +1,166 @@ +local STRUCT = {} + +STRUCT.Name = "Mithril Factory" +STRUCT.Model = "models/props_wasteland/laundry_washer001a.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 checkfunc = function(ply) + return true +end + +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"] = 100, +} + +genericGiveRecipie(STRUCT,genericRecipe) + +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"] = {}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 100, +} + +genericGiveRecipie(STRUCT,genericRecipe) + +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"] = {}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 100, +} + +genericGiveRecipie(STRUCT,genericRecipe) + +local genericRecipe = { + ["Name"] = "Silver", + ["Description"] = "Smelt some silver ore into silver!", + ["Requirements"] = {["Silver Ore"] = 1}, + ["Results"] = {["Silver"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/ingot_silver.png", + ["CanCraft"] = checkfunc, + ["Time"] = timefunc, + ["Mults"] = {}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 100, +} + +genericGiveRecipie(STRUCT,genericRecipe) + +local genericRecipe = { + ["Name"] = "Gold", + ["Description"] = "Smelt some gold ore into gold!", + ["Requirements"] = {["Gold Ore"] = 1}, + ["Results"] = {["Gold"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/ingot_gold.png", + ["CanCraft"] = checkfunc, + ["Time"] = timefunc, + ["Mults"] = {}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 100, +} + +genericGiveRecipie(STRUCT,genericRecipe) + +local genericRecipe = { + ["Name"] = "Steel", + ["Description"] = "Smelt some steel ore into steel!", + ["Requirements"] = {["Steel Ore"] = 1}, + ["Results"] = {["Steel"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/ingot_steel.png", + ["CanCraft"] = checkfunc, + ["Time"] = timefunc, + ["Mults"] = {}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 100, +} + +genericGiveRecipie(STRUCT,genericRecipe) + +local genericRecipe = { + ["Name"] = "Platinum", + ["Description"] = "Smelt some platinum ore into platinum!", + ["Requirements"] = {["Platinum Ore"] = 1}, + ["Results"] = {["Platinum"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/ingot_platinum.png", + ["CanCraft"] = checkfunc, + ["Time"] = timefunc, + ["Mults"] = {}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 100, +} + +genericGiveRecipie(STRUCT,genericRecipe) + +local genericRecipe = { + ["Name"] = "Pure Mithril", + ["Description"] = "Smelt some mithril ore into pure mithril!", + ["Requirements"] = {["Mithril Ore"] = 2}, + ["Results"] = {["Pure Mithril"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/ingot_puremithril.png", + ["CanCraft"] = checkfunc, + ["Time"] = timefunc, + ["Mults"] = {}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 100, +} + +genericGiveRecipie(STRUCT,genericRecipe) + +genericMakeCrafting(STRUCT) + +registerStructure(STRUCT) diff --git a/gamemode/structuresystem/structures/platinumfurnace.lua b/gamemode/structuresystem/structures/platinumfurnace.lua new file mode 100644 index 0000000..44f8e06 --- /dev/null +++ b/gamemode/structuresystem/structures/platinumfurnace.lua @@ -0,0 +1,48 @@ +local STRUCT = {} + +STRUCT.Name = "Platinum Furnace" +STRUCT.Model = "models/xeon133/slider/slider_stand_12x12x24.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 checkfunc = function(ply) + return true +end + +local genericRecipe = { + ["Name"] = "Pure Mithril", + ["Description"] = "Smelt some mithril ore into pure mithril!", + ["Requirements"] = {["Mithril Ore"] = 2}, + ["Results"] = {["Pure Mithril"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/ingot_puremithril.png", + ["CanCraft"] = checkfunc, + ["Time"] = timefunc, + ["Mults"] = {1,5,10,25}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 50, +} + +genericGiveRecipie(STRUCT,genericRecipe) + + +genericMakeCrafting(STRUCT) + +registerStructure(STRUCT) diff --git a/gamemode/structuresystem/structures/silverfurnace.lua b/gamemode/structuresystem/structures/silverfurnace.lua new file mode 100644 index 0000000..ecb774d --- /dev/null +++ b/gamemode/structuresystem/structures/silverfurnace.lua @@ -0,0 +1,48 @@ +local STRUCT = {} + +STRUCT.Name = "Silver Furnace" +STRUCT.Model = "models/props_wasteland/laundry_basket001.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 checkfunc = function(ply) + return true +end + +local genericRecipe = { + ["Name"] = "Gold", + ["Description"] = "Smelt some gold ore into gold!", + ["Requirements"] = {["Gold Ore"] = 1}, + ["Results"] = {["Gold"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/ingot_gold.png", + ["CanCraft"] = checkfunc, + ["Time"] = timefunc, + ["Mults"] = {1,5,10,25}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 50, +} + +genericGiveRecipie(STRUCT,genericRecipe) + + +genericMakeCrafting(STRUCT) + +registerStructure(STRUCT) diff --git a/gamemode/structuresystem/structures/steelfurnace.lua b/gamemode/structuresystem/structures/steelfurnace.lua new file mode 100644 index 0000000..9c40161 --- /dev/null +++ b/gamemode/structuresystem/structures/steelfurnace.lua @@ -0,0 +1,48 @@ +local STRUCT = {} + +STRUCT.Name = "Steel Furnace" +STRUCT.Model = "models/props_industrial/winch_deck.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 checkfunc = function(ply) + return true +end + +local genericRecipe = { + ["Name"] = "Platinum", + ["Description"] = "Smelt some platinum ore into platinum!", + ["Requirements"] = {["Platinum Ore"] = 1}, + ["Results"] = {["Platinum"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/ingot_platinum.png", + ["CanCraft"] = checkfunc, + ["Time"] = timefunc, + ["Mults"] = {1,5,10,25}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 50, +} + +genericGiveRecipie(STRUCT,genericRecipe) + + +genericMakeCrafting(STRUCT) + +registerStructure(STRUCT) diff --git a/gamemode/structuresystem/structures/stonefurnace.lua b/gamemode/structuresystem/structures/stonefurnace.lua index 84c0311..c5b4c4d 100644 --- a/gamemode/structuresystem/structures/stonefurnace.lua +++ b/gamemode/structuresystem/structures/stonefurnace.lua @@ -3,29 +3,44 @@ local STRUCT = {} STRUCT.Name = "Stone Furnace" STRUCT.Model = "models/props/de_inferno/ClayOven.mdl" -STRUCT.Structure = { - {"models/props/de_inferno/ClayOven.mdl",Vector(0,0,0),Angle(0,0,0)} -} - STRUCT.onInitialize = function(self) - print("Initalize called!") + --print("Initalize called!") end STRUCT.uniquedata = false STRUCT.onUse = function(self, ply) - print("I am the old use function!") + if CLIENT and ply != LocalPlayer() then return end + --print("onUse called!") end -STRUCT.Recipes = {} - STRUCT.timemult = 0.5 STRUCT.skillease = 0.25 -genericMakeFurnace(STRUCT) -recipieForSmelt(STRUCT.Recipes,"Copper", "Smelt copper ore into copper", "Copper Ore", "Copper", {1,1}, {1,5,10}) +local timefunc = function(ply, num) + local time = math.pow(num,STRUCT.timemult)*4 - math.pow(ply:GetSkill("Smelting"),STRUCT.skillease) + return time +end +local checkfunc = function(ply) + return true +end + +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"] = {1,5,10,25}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 50, +} -print("stone furnace's recipies:") -PrintTable(STRUCT.Recipes) +genericGiveRecipie(STRUCT,genericRecipe) +genericMakeCrafting(STRUCT) registerStructure(STRUCT) diff --git a/gamemode/structuresystem/structures/techfurnace.lua b/gamemode/structuresystem/structures/techfurnace.lua new file mode 100644 index 0000000..fb93855 --- /dev/null +++ b/gamemode/structuresystem/structures/techfurnace.lua @@ -0,0 +1,48 @@ +local STRUCT = {} + +STRUCT.Name = "Tech Furnace" +STRUCT.Model = "models/props/cs_militia/dryer.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 checkfunc = function(ply) + return true +end + +local genericRecipe = { + ["Name"] = "Silver", + ["Description"] = "Smelt some silver ore into silver!", + ["Requirements"] = {["Silver Ore"] = 1}, + ["Results"] = {["Silver"] = 1}, + ["Ratio"] = {1,1}, + ["Image"] = "items/ingot_silver.png", + ["CanCraft"] = checkfunc, + ["Time"] = timefunc, + ["Mults"] = {1,5,10,25}, + ["Skill"] = "Smelting", + ["SmeltAll"] = true, + ["MaxAmount"] = 50, +} + +genericGiveRecipie(STRUCT,genericRecipe) + + +genericMakeCrafting(STRUCT) + +registerStructure(STRUCT) |
