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 +++++---------------- gamemode/craftablesystem/furnaces/goldfurnace.lua | 52 +++++---------------- gamemode/craftablesystem/furnaces/ironfurnace.lua | 53 +++++----------------- .../craftablesystem/furnaces/silverfurnace.lua | 51 +++++---------------- gamemode/craftablesystem/furnaces/steelfurnace.lua | 52 +++++---------------- gamemode/craftablesystem/furnaces/stonefurnace.lua | 52 +++++---------------- gamemode/craftablesystem/furnaces/techfurnace.lua | 51 +++++---------------- 7 files changed, 84 insertions(+), 279 deletions(-) (limited to 'gamemode/craftablesystem') 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 = {} diff --git a/gamemode/craftablesystem/furnaces/goldfurnace.lua b/gamemode/craftablesystem/furnaces/goldfurnace.lua index fc050ba..7e0bacf 100644 --- a/gamemode/craftablesystem/furnaces/goldfurnace.lua +++ b/gamemode/craftablesystem/furnaces/goldfurnace.lua @@ -29,50 +29,22 @@ COMBI.Results["Steel"] = 1 GMS.RegisterCombi( COMBI, "gms_goldfurnace" ) -/* 5 Steel */ -local COMBI = {} - -COMBI.Name = "Steel 5x" -COMBI.Description = "Steel can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_goldfurnace" - -COMBI.Req = {} -COMBI.Req["Steel_Ore"] = 5 - -COMBI.Results = {} -COMBI.Results["Steel"] = 5 - -GMS.RegisterCombi( COMBI, "gms_goldfurnace" ) - -/* 10 Steel */ -local COMBI = {} - -COMBI.Name = "Steel 10x" -COMBI.Description = "Steel can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_goldfurnace" - -COMBI.Req = {} -COMBI.Req["Steel_Ore"] = 10 - -COMBI.Results = {} -COMBI.Results["Steel"] = 10 - -GMS.RegisterCombi( COMBI, "gms_goldfurnace" ) +local SteelMultiples = {5,10,25} +for k,v in pairs(SteelMultiples) do + local COMBI = {} -/* 25 Steel */ -local COMBI = {} + COMBI.Name = "Steel " .. v .. "x" + COMBI.Description = "Steel can be used to create more advanced buildings and tools." + COMBI.Entity = "gms_goldfurnace" -COMBI.Name = "Steel 25x" -COMBI.Description = "Steel can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_goldfurnace" + COMBI.Req = {} + COMBI.Req["Steel_Ore"] = v -COMBI.Req = {} -COMBI.Req["Steel_Ore"] = 25 + COMBI.Results = {} + COMBI.Results["Steel"] = v -COMBI.Results = {} -COMBI.Results["Steel"] = 25 - -GMS.RegisterCombi( COMBI, "gms_goldfurnace" ) + GMS.RegisterCombi( COMBI, "gms_goldfurnace" ) +end /* All Steel */ local COMBI = {} diff --git a/gamemode/craftablesystem/furnaces/ironfurnace.lua b/gamemode/craftablesystem/furnaces/ironfurnace.lua index bea5d0b..8264148 100644 --- a/gamemode/craftablesystem/furnaces/ironfurnace.lua +++ b/gamemode/craftablesystem/furnaces/ironfurnace.lua @@ -46,51 +46,22 @@ COMBI.Results["Tech"] = 1 GMS.RegisterCombi( COMBI, "gms_ironfurnace" ) -/* 5 Tech */ -local COMBI = {} - -COMBI.Name = "Tech 5x" -COMBI.Description = "Tech can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_ironfurnace" +local TechMultiples = {5,10,25} +for k,v in pairs(TechMultiples) do + local COMBI = {} -COMBI.Req = {} -COMBI.Req["Tech_Ore"] = 5 - -COMBI.Results = {} -COMBI.Results["Tech"] = 5 + COMBI.Name = "Tech " .. v .. "x" + COMBI.Description = "Tech can be used to create more advanced buildings and tools." + COMBI.Entity = "gms_ironfurnace" -GMS.RegisterCombi( COMBI, "gms_ironfurnace" ) - -/* 10 Tech */ -local COMBI = {} - -COMBI.Name = "Tech 10x" -COMBI.Description = "Tech can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_ironfurnace" - -COMBI.Req = {} -COMBI.Req["Tech_Ore"] = 10 + COMBI.Req = {} + COMBI.Req["Tech_Ore"] = v -COMBI.Results = {} -COMBI.Results["Tech"] = 10 - -GMS.RegisterCombi( COMBI, "gms_ironfurnace" ) - -/* 25 Tech */ -local COMBI = {} - -COMBI.Name = "Tech 25x" -COMBI.Description = "Tech can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_ironfurnace" - -COMBI.Req = {} -COMBI.Req["Tech_Ore"] = 25 - -COMBI.Results = {} -COMBI.Results["Tech"] = 25 - -GMS.RegisterCombi( COMBI, "gms_ironfurnace" ) + COMBI.Results = {} + COMBI.Results["Tech"] = v + GMS.RegisterCombi( COMBI, "gms_ironfurnace" ) +end /* Glass */ local COMBI = {} diff --git a/gamemode/craftablesystem/furnaces/silverfurnace.lua b/gamemode/craftablesystem/furnaces/silverfurnace.lua index ce920c9..b363c5e 100644 --- a/gamemode/craftablesystem/furnaces/silverfurnace.lua +++ b/gamemode/craftablesystem/furnaces/silverfurnace.lua @@ -29,50 +29,23 @@ COMBI.Results["Gold"] = 1 GMS.RegisterCombi( COMBI, "gms_silverfurnace" ) -/* 5 Gold */ -local COMBI = {} - -COMBI.Name = "Gold 5x" -COMBI.Description = "Gold can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_silverfurnace" - -COMBI.Req = {} -COMBI.Req["Gold_Ore"] = 5 - -COMBI.Results = {} -COMBI.Results["Gold"] = 5 +local GoldMultiples = {5,10,25} -GMS.RegisterCombi( COMBI, "gms_silverfurnace" ) +for k,v in pairs(GoldMultiples) do + local COMBI = {} -/* 10 Gold */ -local COMBI = {} + COMBI.Name = "Gold " .. v .. "x" + COMBI.Description = "Gold can be used to create more advanced buildings and tools." + COMBI.Entity = "gms_silverfurnace" -COMBI.Name = "Gold 10x" -COMBI.Description = "Gold can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_silverfurnace" + COMBI.Req = {} + COMBI.Req["Gold_Ore"] = v -COMBI.Req = {} -COMBI.Req["Gold_Ore"] = 10 + COMBI.Results = {} + COMBI.Results["Gold"] = v -COMBI.Results = {} -COMBI.Results["Gold"] = 10 - -GMS.RegisterCombi( COMBI, "gms_silverfurnace" ) - -/* 25 Gold */ -local COMBI = {} - -COMBI.Name = "Gold 25x" -COMBI.Description = "Gold can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_silverfurnace" - -COMBI.Req = {} -COMBI.Req["Gold_Ore"] = 25 - -COMBI.Results = {} -COMBI.Results["Gold"] = 25 - -GMS.RegisterCombi( COMBI, "gms_silverfurnace" ) + GMS.RegisterCombi( COMBI, "gms_silverfurnace" ) +end /* All Gold */ local COMBI = {} 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 = {} diff --git a/gamemode/craftablesystem/furnaces/stonefurnace.lua b/gamemode/craftablesystem/furnaces/stonefurnace.lua index c48a7d0..ecc1fb6 100644 --- a/gamemode/craftablesystem/furnaces/stonefurnace.lua +++ b/gamemode/craftablesystem/furnaces/stonefurnace.lua @@ -28,50 +28,22 @@ COMBI.Results["Copper"] = 1 GMS.RegisterCombi( COMBI, "gms_stonefurnace" ) -/* Copper Ore to Copper x5 */ -local COMBI = {} - -COMBI.Name = "Copper 5x" -COMBI.Description = "Copper can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_stonefurnace" - -COMBI.Req = {} -COMBI.Req["Copper_Ore"] = 5 - -COMBI.Results = {} -COMBI.Results["Copper"] = 5 - -GMS.RegisterCombi( COMBI, "gms_stonefurnace" ) - -/* Copper Ore to Copper x10 */ -local COMBI = {} - -COMBI.Name = "Copper 10x" -COMBI.Description = "Copper can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_stonefurnace" - -COMBI.Req = {} -COMBI.Req["Copper_Ore"] = 10 - -COMBI.Results = {} -COMBI.Results["Copper"] = 10 - -GMS.RegisterCombi( COMBI, "gms_stonefurnace" ) +local CopperMultiples = {5,10,25} +for k,v in pairs(CopperMultiples) do + local COMBI = {} -/* Copper Ore to Copper x25 */ -local COMBI = {} + COMBI.Name = "Copper " .. v .. "x" + COMBI.Description = "Copper can be used to create more advanced buildings and tools." + COMBI.Entity = "gms_stonefurnace" -COMBI.Name = "Copper 25x" -COMBI.Description = "Copper can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_stonefurnace" + COMBI.Req = {} + COMBI.Req["Copper_Ore"] = v -COMBI.Req = {} -COMBI.Req["Copper_Ore"] = 25 + COMBI.Results = {} + COMBI.Results["Copper"] = v -COMBI.Results = {} -COMBI.Results["Copper"] = 25 - -GMS.RegisterCombi( COMBI, "gms_stonefurnace" ) + GMS.RegisterCombi( COMBI, "gms_stonefurnace" ) +end /* Allsmelt Copper */ local COMBI = {} diff --git a/gamemode/craftablesystem/furnaces/techfurnace.lua b/gamemode/craftablesystem/furnaces/techfurnace.lua index 274ce57..2706019 100644 --- a/gamemode/craftablesystem/furnaces/techfurnace.lua +++ b/gamemode/craftablesystem/furnaces/techfurnace.lua @@ -47,47 +47,20 @@ COMBI.Results["Silver"] = 1 GMS.RegisterCombi( COMBI, "gms_techfurnace" ) -/* 5 Silver */ -local COMBI = {} - -COMBI.Name = "Silver 5x" -COMBI.Description = "Silver can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_techfurnace" - -COMBI.Req = {} -COMBI.Req["Silver_Ore"] = 5 - -COMBI.Results = {} -COMBI.Results["Silver"] = 5 +local SilverMultiples = {5,10,25} -GMS.RegisterCombi( COMBI, "gms_techfurnace" ) +for k,v in pairs(SilverMultiples) do + local COMBI = {} -/* 10 Silver */ -local COMBI = {} + COMBI.Name = "Silver " .. v .. "x" + COMBI.Description = "Silver can be used to create more advanced buildings and tools." + COMBI.Entity = "gms_techfurnace" -COMBI.Name = "Silver 10x" -COMBI.Description = "Silver can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_techfurnace" + COMBI.Req = {} + COMBI.Req["Silver_Ore"] = v -COMBI.Req = {} -COMBI.Req["Silver_Ore"] = 10 + COMBI.Results = {} + COMBI.Results["Silver"] = v -COMBI.Results = {} -COMBI.Results["Silver"] = 10 - -GMS.RegisterCombi( COMBI, "gms_techfurnace" ) - -/* 25 Silver */ -local COMBI = {} - -COMBI.Name = "Silver 25x" -COMBI.Description = "Silver can be used to create more advanced buildings and tools." -COMBI.Entity = "gms_techfurnace" - -COMBI.Req = {} -COMBI.Req["Silver_Ore"] = 25 - -COMBI.Results = {} -COMBI.Results["Silver"] = 25 - -GMS.RegisterCombi( COMBI, "gms_techfurnace" ) + GMS.RegisterCombi( COMBI, "gms_techfurnace" ) +end -- cgit v1.2.3-70-g09d2