From 573c19a5535deef9e015f0655fb495d91bac86a3 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 16 Apr 2016 22:51:41 -0400 Subject: Refactored some of the code for the furnaces --- gamemode/craftablesystem/furnaces/steelfurnace.lua | 52 +++++----------------- 1 file changed, 12 insertions(+), 40 deletions(-) (limited to 'gamemode/craftablesystem/furnaces/steelfurnace.lua') diff --git a/gamemode/craftablesystem/furnaces/steelfurnace.lua b/gamemode/craftablesystem/furnaces/steelfurnace.lua index 2f2bfdd..d4680a9 100644 --- a/gamemode/craftablesystem/furnaces/steelfurnace.lua +++ b/gamemode/craftablesystem/furnaces/steelfurnace.lua @@ -29,50 +29,22 @@ COMBI.Results["Platinum"] = 1 GMS.RegisterCombi( COMBI, "gms_steelfurnace" ) -/* 5 Platinum */ -local COMBI = {} - -COMBI.Name = "Platinum 5x" -COMBI.Description = "Platinum can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_steelfurnace" - -COMBI.Req = {} -COMBI.Req["Platinum_Ore"] = 5 - -COMBI.Results = {} -COMBI.Results["Platinum"] = 5 - -GMS.RegisterCombi( COMBI, "gms_steelfurnace" ) - -/* 10 Platinum */ -local COMBI = {} - -COMBI.Name = "Platinum 10x" -COMBI.Description = "Platinum can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_steelfurnace" - -COMBI.Req = {} -COMBI.Req["Platinum_Ore"] = 10 - -COMBI.Results = {} -COMBI.Results["Platinum"] = 10 - -GMS.RegisterCombi( COMBI, "gms_steelfurnace" ) +local PlatinumMultiples = {5,10,25} +for k,v in pairs(PlatinumMultiples) do + local COMBI = {} -/* 25 Platinum */ -local COMBI = {} + COMBI.Name = "Platinum " .. v .. "x" + COMBI.Description = "Platinum can be used to create more advanced buildings and tools." + COMBI.Entity = "gms_steelfurnace" -COMBI.Name = "Platinum 25x" -COMBI.Description = "Platinum can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_steelfurnace" + COMBI.Req = {} + COMBI.Req["Platinum_Ore"] = v -COMBI.Req = {} -COMBI.Req["Platinum_Ore"] = 25 + COMBI.Results = {} + COMBI.Results["Platinum"] = v -COMBI.Results = {} -COMBI.Results["Platinum"] = 25 - -GMS.RegisterCombi( COMBI, "gms_steelfurnace" ) + GMS.RegisterCombi( COMBI, "gms_steelfurnace" ) +end /* All Platinum */ local COMBI = {} -- cgit v1.2.3-70-g09d2