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 --- .../craftablesystem/furnaces/copperfurnace.lua | 52 +++++----------------- 1 file changed, 12 insertions(+), 40 deletions(-) (limited to 'gamemode/craftablesystem/furnaces/copperfurnace.lua') diff --git a/gamemode/craftablesystem/furnaces/copperfurnace.lua b/gamemode/craftablesystem/furnaces/copperfurnace.lua index 8d58554..2d8c066 100644 --- a/gamemode/craftablesystem/furnaces/copperfurnace.lua +++ b/gamemode/craftablesystem/furnaces/copperfurnace.lua @@ -28,50 +28,22 @@ COMBI.Results["Iron"] = 1 GMS.RegisterCombi( COMBI, "gms_copperfurnace" ) -/* Iron Ore to Iron x5 */ -local COMBI = {} - -COMBI.Name = "Iron 5x" -COMBI.Description = "Iron can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_copperfurnace" - -COMBI.Req = {} -COMBI.Req["Iron_Ore"] = 5 - -COMBI.Results = {} -COMBI.Results["Iron"] = 5 - -GMS.RegisterCombi( COMBI, "gms_copperfurnace" ) - -/* Iron Ore to Iron x10 */ -local COMBI = {} - -COMBI.Name = "Iron 10x" -COMBI.Description = "Iron can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_copperfurnace" - -COMBI.Req = {} -COMBI.Req["Iron_Ore"] = 10 - -COMBI.Results = {} -COMBI.Results["Iron"] = 10 - -GMS.RegisterCombi( COMBI, "gms_copperfurnace" ) +local SmeltMultiples = {5,10,25} +for v,k in pairs(SmeltMultiples) do + local COMBI = {} -/* Iron Ore to Iron x25 */ -local COMBI = {} + COMBI.Name = "Iron " .. k .. "x" + COMBI.Description = "Iron can be used to create more advanced buildings and tools." + COMBI.Entity = "gms_copperfurnace" -COMBI.Name = "Iron 25x" -COMBI.Description = "Iron can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_copperfurnace" + COMBI.Req = {} + COMBI.Req["Iron_Ore"] = k -COMBI.Req = {} -COMBI.Req["Iron_Ore"] = 25 + COMBI.Results = {} + COMBI.Results["Iron"] = k -COMBI.Results = {} -COMBI.Results["Iron"] = 25 - -GMS.RegisterCombi( COMBI, "gms_copperfurnace" ) + GMS.RegisterCombi( COMBI, "gms_copperfurnace" ) +end /* Allsmelt Iron */ local COMBI = {} -- cgit v1.2.3-70-g09d2