From dbae9451bd969cfb21ef3d1f12cb7ca00defd99c Mon Sep 17 00:00:00 2001 From: 83N170 <83N170@mail.com> Date: Wed, 4 Dec 2024 22:59:39 +0000 Subject: [PATCH] #3959 Refactored evodecom stockpile limits --- luarules/gadgets/unit_stockpile_limit.lua | 9 +-------- units/Legion/Legion EvoCom/legevodecom.lua | 5 ++++- units/other/evocom/armcorevodecom.lua | 5 ++++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/luarules/gadgets/unit_stockpile_limit.lua b/luarules/gadgets/unit_stockpile_limit.lua index 5984321ec26..27317c591ff 100644 --- a/luarules/gadgets/unit_stockpile_limit.lua +++ b/luarules/gadgets/unit_stockpile_limit.lua @@ -19,14 +19,7 @@ if gadgetHandler:IsSyncedCode() then local StockpileDesiredTarget = {} local defaultStockpileLimit = 99 - local isStockpilingUnitNames = { -- number represents maximum stockpile. Use stockpileLimit customParam which overwrites whatever is set in this table - ['armdecomlvl3'] = 1, - ['armdecomlvl6'] = 2, - ['armdecomlvl10'] = 2, - ['legdecomlvl3'] = 1, - ['legdecomlvl6'] = 2, - ['legdecomlvl10'] = 3, - } + local isStockpilingUnitNames = {} -- number represents maximum stockpile. Use stockpileLimit customParam instead as this overwrites whatever is set in this table -- convert unitname -> unitDefID + add scavengers local isStockpilingUnit = {} for name, params in pairs(isStockpilingUnitNames) do diff --git a/units/Legion/Legion EvoCom/legevodecom.lua b/units/Legion/Legion EvoCom/legevodecom.lua index d04caf01744..ad710a0720c 100644 --- a/units/Legion/Legion EvoCom/legevodecom.lua +++ b/units/Legion/Legion EvoCom/legevodecom.lua @@ -11,6 +11,7 @@ unitsTable['legdecomlvl3'].customparams.i18nfromunit = "legcomlvl3" unitsTable['legdecomlvl3'].customparams.isdecoycommander = true unitsTable['legdecomlvl3'].decoyfor = "legcomlvl3" unitsTable['legdecomlvl3'].customparams.decoyfor = "legcomlvl3" +unitsTable['legdecomlvl6'].customparams.stockpileLimit = 1 unitsTable['legdecomlvl3'].health = math.ceil(unitsTable['legdecomlvl3'].health*0.5) unitsTable['legdecomlvl3'].weapondefs.disintegrator.damage.default = 40 @@ -25,6 +26,7 @@ unitsTable['legdecomlvl6'].customparams.i18nfromunit = "legcomlvl6" unitsTable['legdecomlvl6'].decoyfor = "legcomlvl6" unitsTable['legdecomlvl6'].customparams.decoyfor = "legcomlvl6" unitsTable['legdecomlvl6'].customparams.isdecoycommander = true +unitsTable['legdecomlvl6'].customparams.stockpileLimit = 2 unitsTable['legdecomlvl6'].health = math.ceil(unitsTable['legdecomlvl6'].health*0.5) unitsTable['legdecomlvl6'].weapondefs.disintegrator.damage.default = 40 @@ -39,7 +41,8 @@ unitsTable['legdecomlvl10'].customparams.i18nfromunit = "legcomlvl10" unitsTable['legdecomlvl10'].decoyfor = "legcomlvl10" unitsTable['legdecomlvl10'].customparams.decoyfor = "legcomlvl10" unitsTable['legdecomlvl10'].customparams.isdecoycommander = true +unitsTable['legdecomlvl10'].customparams.stockpileLimit = 3 unitsTable['legdecomlvl10'].health = math.ceil(unitsTable['legdecomlvl10'].health*0.5) unitsTable['legdecomlvl10'].weapondefs.disintegrator.damage.default = 40 -return unitsTable \ No newline at end of file +return unitsTable diff --git a/units/other/evocom/armcorevodecom.lua b/units/other/evocom/armcorevodecom.lua index 5b2d48ff17b..af70d753887 100644 --- a/units/other/evocom/armcorevodecom.lua +++ b/units/other/evocom/armcorevodecom.lua @@ -11,6 +11,7 @@ unitsTable['armdecomlvl3'].customparams.i18nfromunit = "armcomlvl3" unitsTable['armdecomlvl3'].decoyfor = "armcomlvl3" unitsTable['armdecomlvl3'].customparams.decoyfor = "armcomlvl3" unitsTable['armdecomlvl3'].customparams.isdecoycommander = true +unitsTable['armdecomlvl3'].customparams.stockpileLimit = 1 unitsTable['armdecomlvl3'].health = math.ceil(unitsTable['armdecomlvl3'].health*0.5) unitsTable['armdecomlvl3'].weapondefs.disintegrator.damage.default = 40 @@ -25,6 +26,7 @@ unitsTable['armdecomlvl6'].customparams.i18nfromunit = "armcomlvl6" unitsTable['armdecomlvl6'].decoyfor = "armcomlvl6" unitsTable['armdecomlvl6'].customparams.decoyfor = "armcomlvl6" unitsTable['armdecomlvl6'].customparams.isdecoycommander = true +unitsTable['armdecomlvl6'].customparams.stockpileLimit = 2 unitsTable['armdecomlvl6'].health = math.ceil(unitsTable['armdecomlvl6'].health*0.5) unitsTable['armdecomlvl6'].weapondefs.disintegrator.damage.default = 40 @@ -39,6 +41,7 @@ unitsTable['armdecomlvl10'].customparams.i18nfromunit = "armcomlvl10" unitsTable['armdecomlvl10'].decoyfor = "armcomlvl10" unitsTable['armdecomlvl10'].customparams.decoyfor = "armcomlvl10" unitsTable['armdecomlvl10'].customparams.isdecoycommander = true +unitsTable['armdecomlvl10'].customparams.stockpileLimit = 2 unitsTable['armdecomlvl10'].health = math.ceil(unitsTable['armdecomlvl10'].health*0.5) unitsTable['armdecomlvl10'].weapondefs.disintegrator.damage.default = 40 @@ -87,4 +90,4 @@ unitsTable['cordecomlvl10'].health = math.ceil(unitsTable['cordecomlvl10'].healt unitsTable['cordecomlvl10'].weapondefs.disintegrator.damage.default = 40 unitsTable['cordecomlvl10'].weapondefs.repulsor.shield.power = unitsTable['cordecomlvl10'].weapondefs.repulsor.shield.power*0.25 -return unitsTable \ No newline at end of file +return unitsTable