diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-27 18:30:57 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-27 18:30:57 -0400 |
| commit | 9ea65b0c6a2b53766e5aa66cb6d86644a70da21f (patch) | |
| tree | f1aee040db7051a9db92e7b98746bf12d4fa5829 /gamemode/structuresystem/structures | |
| parent | f797cbe348dd52b51da4cd4812cfa291d1434095 (diff) | |
| download | gmstranded-9ea65b0c6a2b53766e5aa66cb6d86644a70da21f.tar.gz gmstranded-9ea65b0c6a2b53766e5aa66cb6d86644a70da21f.tar.bz2 gmstranded-9ea65b0c6a2b53766e5aa66cb6d86644a70da21f.zip | |
More work on structure system
Diffstat (limited to 'gamemode/structuresystem/structures')
| -rw-r--r-- | gamemode/structuresystem/structures/stonefurnace.lua | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/gamemode/structuresystem/structures/stonefurnace.lua b/gamemode/structuresystem/structures/stonefurnace.lua index 84c0311..5914ed2 100644 --- a/gamemode/structuresystem/structures/stonefurnace.lua +++ b/gamemode/structuresystem/structures/stonefurnace.lua @@ -14,18 +14,31 @@ 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) + print("Inputs: num=" .. num) + local time = math.pow(num,STRUCT.timemult) - ((num * STRUCT.timemult) * math.pow(ply:GetSkill("Smelting"),STRUCT.skillease )) + time = time * num / 5 + print("Time was: " .. time) + return time +end -print("stone furnace's recipies:") -PrintTable(STRUCT.Recipes) +local genericRecipe = { + ["Name"] = "Copper", + ["Description"] = "Smelt some copper or into copper!", + ["Requirements"] = {["Copper Ore"] = 1}, + ["Results"] = {["Copper"] = 1}, + ["Ratio"] = {1,1}, + ["Time"] = timefunc +} + +genericGiveRecipie(STRUCT,genericRecipe) +genericMakeFurnace(STRUCT) registerStructure(STRUCT) |
