Skip to content

Commit

Permalink
beyond-all-reason#3959 Refactored evodecom stockpile limits
Browse files Browse the repository at this point in the history
  • Loading branch information
83N170 authored and 83N170 committed Dec 4, 2024
1 parent 614b93d commit dbae945
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
9 changes: 1 addition & 8 deletions luarules/gadgets/unit_stockpile_limit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion units/Legion/Legion EvoCom/legevodecom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
return unitsTable
5 changes: 4 additions & 1 deletion units/other/evocom/armcorevodecom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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
return unitsTable

0 comments on commit dbae945

Please sign in to comment.