From d35d55bbda4819da45c1af1bd7ced8bebc82ce5b Mon Sep 17 00:00:00 2001 From: ryanbennitt Date: Mon, 30 Dec 2024 15:40:11 +0000 Subject: [PATCH] #3959 Refactored stockpile limits into unit custom params (#3994) Refactor to move stockpile limits to the weapon defs instead of a list in gadget. Engine still only supports one stockpile weapon per unit, however. --- gamedata/scavengers/unitdef_changes.lua | 4 +- luarules/gadgets/unit_stockpile_limit.lua | 101 +++--------------- units/ArmBots/T2/armscab.lua | 3 + .../LandDefenceOffence/armamd.lua | 3 + .../LandDefenceOffence/armemp.lua | 3 + .../LandDefenceOffence/armjuno.lua | 1 + .../LandDefenceOffence/armmercury.lua | 3 + .../LandDefenceOffence/armsilo.lua | 1 + units/ArmGantry/armthor.lua | 3 + units/ArmShips/T2/armantiship.lua | 3 + units/ArmShips/T2/armcarry.lua | 3 + units/ArmShips/T2/armseadragon.lua | 1 + .../LandDefenceOffence/corfmd.lua | 3 + .../LandDefenceOffence/corjuno.lua | 3 + .../LandDefenceOffence/corscreamer.lua | 3 + .../LandDefenceOffence/corsilo.lua | 1 + .../LandDefenceOffence/cortron.lua | 3 + units/CorShips/T2/corantiship.lua | 3 + units/CorShips/T2/corcarry.lua | 3 + units/CorShips/T2/cordesolator.lua | 1 + units/CorVehicles/T2/cormabm.lua | 3 + units/Legion/Air/T2 Air/legmineb.lua | 1 + units/Legion/Air/legmos.lua | 3 + units/Legion/Defenses/legabm.lua | 5 +- units/Legion/Defenses/legperdition.lua | 3 +- units/Legion/Defenses/legsilo.lua | 1 + units/Legion/Defenses/legstarfall.lua | 3 + units/Legion/Economy/legrampart.lua | 3 + units/Legion/Legion EvoCom/legcomlvl10.lua | 1 + units/Legion/Legion EvoCom/legcomlvl2.lua | 42 -------- units/Legion/Legion EvoCom/legcomlvl3.lua | 43 +------- units/Legion/Legion EvoCom/legcomlvl4.lua | 42 +------- units/Legion/Legion EvoCom/legcomlvl5.lua | 1 + units/Legion/Legion EvoCom/legcomlvl6.lua | 1 + units/Legion/Legion EvoCom/legcomlvl7.lua | 1 + units/Legion/Legion EvoCom/legcomlvl8.lua | 1 + units/Legion/Legion EvoCom/legcomlvl9.lua | 1 + units/Legion/Legion EvoCom/legevodecom.lua | 5 +- units/Scavengers/Air/legmost3.lua | 3 + units/Scavengers/Boss/scavengerbossv4.lua | 4 +- units/Scavengers/Bots/legsrailt4.lua | 3 + .../Buildings/DefenseOffense/armbotrail.lua | 1 + units/other/evocom/armcomlvl10.lua | 3 + units/other/evocom/armcomlvl3.lua | 3 + units/other/evocom/armcomlvl4.lua | 3 + units/other/evocom/armcomlvl5.lua | 3 + units/other/evocom/armcomlvl6.lua | 3 + units/other/evocom/armcomlvl7.lua | 3 + units/other/evocom/armcomlvl8.lua | 3 + units/other/evocom/armcomlvl9.lua | 3 + units/other/evocom/armcorevodecom.lua | 5 +- .../raptor_turret_antinuke_t2_v1.lua | 3 + .../raptor_turret_antinuke_t3_v1.lua | 3 + 53 files changed, 133 insertions(+), 222 deletions(-) diff --git a/gamedata/scavengers/unitdef_changes.lua b/gamedata/scavengers/unitdef_changes.lua index d5275324db3..83cfb21a85d 100644 --- a/gamedata/scavengers/unitdef_changes.lua +++ b/gamedata/scavengers/unitdef_changes.lua @@ -96,7 +96,7 @@ customDefs.armjuno = { commandfire = true, customparams = { scavforcecommandfire = true, - stockpileLimit = 1, + stockpilelimit = 1, }, }, }, @@ -112,7 +112,7 @@ customDefs.corjuno = { commandfire = true, customparams = { scavforcecommandfire = true, - stockpileLimit = 1, + stockpilelimit = 1, }, }, }, diff --git a/luarules/gadgets/unit_stockpile_limit.lua b/luarules/gadgets/unit_stockpile_limit.lua index a9ee98ff996..c4150c92aea 100644 --- a/luarules/gadgets/unit_stockpile_limit.lua +++ b/luarules/gadgets/unit_stockpile_limit.lua @@ -19,87 +19,7 @@ if gadgetHandler:IsSyncedCode() then local StockpileDesiredTarget = {} local defaultStockpileLimit = 99 - local isStockpilingUnitNames = { -- number represents maximum stockpile. You can also use stockpileLimit customParam which overwrites whatever is set in this table - ['armmercury'] = 5, - ['corscreamer'] = 5, - - ['armthor'] = 2, - - ['legmos'] = 8, - ['legmost3'] = 8, - ['legmineb'] = 1, - ['legsrailt4'] = 3, - - ['armsilo'] = 10, - ['corsilo'] = 10, - ['legsilo'] = 10, - ['cordesolator'] = 10, - ['armseadragon'] = 10, - - - ['armamd'] = 20, - ['legabm'] = 20, - ['corfmd'] = 20, - ['raptor_turret_antinuke_t2_v1'] = 5, - ['raptor_turret_antinuke_t3_v1'] = 10, - - ['armjuno'] = 20, - ['corjuno'] = 20, - - ['armcarry'] = 20, - ['corcarry'] = 20, - - ['armantiship'] = 20, - ['corantiship'] = 20, - - ['armscab'] = 20, - ['cormabm'] = 20, - - ['armemp'] = 10, - ['cortron'] = 10, - ['legperdition'] = 10, - - ['armbotrail'] = 50, - ['armcomlvl2'] = 3, - ['armcomlvl3'] = 3, - ['armdecomlvl3'] = 1, - ['armcomlvl4'] = 3, - ['armcomlvl5'] = 4, - ['armcomlvl6'] = 4, - ['armdecomlvl6'] = 2, - ['armcomlvl7'] = 4, - ['armcomlvl8'] = 5, - ['armcomlvl9'] = 5, - ['armcomlvl10'] = 5, - ['armdecomlvl10'] = 2, - ['legcom'] = 2, - ['legcomlvl2'] = 3, - ['legcomlvl3'] = 3, - ['legdecomlvl3'] = 1, - ['legcomlvl4'] = 3, - ['legcomlvl5'] = 4, - ['legcomlvl6'] = 4, - ['legdecomlvl6'] = 2, - ['legcomlvl7'] = 4, - ['legcomlvl8'] = 5, - ['legcomlvl9'] = 5, - ['legcomlvl10'] = 5, - ['legdecomlvl10'] = 3, - - ['legstarfall'] = 1, - ['legrampart'] = 20, - } - -- convert unitname -> unitDefID + add scavengers - local isStockpilingUnit = {} - for name, params in pairs(isStockpilingUnitNames) do - if UnitDefNames[name] then - isStockpilingUnit[UnitDefNames[name].id] = params - if UnitDefNames[name..'_scav'] then - isStockpilingUnit[UnitDefNames[name..'_scav'].id] = params - end - end - end - isStockpilingUnitNames = nil + local unitStockpileLimit = {} ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- @@ -112,15 +32,18 @@ if gadgetHandler:IsSyncedCode() then if ud.canStockpile then canStockpile[udid] = true end - if ud.customParams and ud.customParams.stockpileLimit then - isStockpilingUnit[udid] = tonumber(ud.customParams.stockpileLimit) - elseif ud.customParams and ud.customParams.stockpilelimit then - isStockpilingUnit[udid] = tonumber(ud.customParams.stockpilelimit) + if ud.weapons then + for i = 1, #ud.weapons do + local weaponDef = WeaponDefs[ud.weapons[i].weaponDef] + if weaponDef.stockpile and weaponDef.customParams and weaponDef.customParams.stockpilelimit then + unitStockpileLimit[udid] = tonumber(weaponDef.customParams.stockpilelimit) + end + end end end function UpdateStockpile(unitID, unitDefID) - local MaxStockpile = math.max(math.min(isStockpilingUnit[unitDefID] or defaultStockpileLimit, StockpileDesiredTarget[unitID]), 0) + local MaxStockpile = math.max(math.min(unitStockpileLimit[unitDefID] or defaultStockpileLimit, StockpileDesiredTarget[unitID]), 0) local stock,queued = GetUnitStockpile(unitID) if queued and stock then @@ -181,7 +104,7 @@ if gadgetHandler:IsSyncedCode() then if fromLua == true and fromSynced == true then -- fromLua is *true* if command is sent from a gadget and *false* if it's sent by a player. return true else - StockpileDesiredTarget[unitID] = math.max(math.min(StockpileDesiredTarget[unitID] + addQ, isStockpilingUnit[unitDefID] or defaultStockpileLimit), 0) -- let's make sure desired target doesn't go above maximum of this unit, and doesn't go below 0 + StockpileDesiredTarget[unitID] = math.max(math.min(StockpileDesiredTarget[unitID] + addQ, unitStockpileLimit[unitDefID] or defaultStockpileLimit), 0) -- let's make sure desired target doesn't go above maximum of this unit, and doesn't go below 0 UpdateStockpile(unitID, unitDefID) return false end @@ -192,14 +115,14 @@ if gadgetHandler:IsSyncedCode() then function gadget:UnitCreated(unitID, unitDefID, unitTeam) if canStockpile[unitDefID] then - StockpileDesiredTarget[unitID] = isStockpilingUnit[unitDefID] or defaultStockpileLimit + StockpileDesiredTarget[unitID] = unitStockpileLimit[unitDefID] or defaultStockpileLimit UpdateStockpile(unitID, unitDefID) end end function gadget:UnitGiven(unitID, unitDefID, unitTeam) if canStockpile[unitDefID] then - StockpileDesiredTarget[unitID] = isStockpilingUnit[unitDefID] or defaultStockpileLimit + StockpileDesiredTarget[unitID] = unitStockpileLimit[unitDefID] or defaultStockpileLimit UpdateStockpile(unitID, unitDefID) end end diff --git a/units/ArmBots/T2/armscab.lua b/units/ArmBots/T2/armscab.lua index 136b576b783..7f0beca6eff 100644 --- a/units/ArmBots/T2/armscab.lua +++ b/units/ArmBots/T2/armscab.lua @@ -148,6 +148,9 @@ return { weapontimer = 2, weapontype = "StarburstLauncher", weaponvelocity = 7000, + customparams = { + stockpilelimit = 20, + }, damage = { default = 500, }, diff --git a/units/ArmBuildings/LandDefenceOffence/armamd.lua b/units/ArmBuildings/LandDefenceOffence/armamd.lua index 1fdad157817..840575acb1f 100644 --- a/units/ArmBuildings/LandDefenceOffence/armamd.lua +++ b/units/ArmBuildings/LandDefenceOffence/armamd.lua @@ -148,6 +148,9 @@ return { weapontimer = 3, weapontype = "StarburstLauncher", weaponvelocity = 6000, + customparams = { + stockpilelimit = 20, + }, damage = { default = 1500, }, diff --git a/units/ArmBuildings/LandDefenceOffence/armemp.lua b/units/ArmBuildings/LandDefenceOffence/armemp.lua index 3b682448fb4..164acf599e0 100644 --- a/units/ArmBuildings/LandDefenceOffence/armemp.lua +++ b/units/ArmBuildings/LandDefenceOffence/armemp.lua @@ -143,6 +143,9 @@ return { weapontimer = 3, weapontype = "StarburstLauncher", weaponvelocity = 1200, + customparams = { + stockpilelimit = 10, + }, damage = { default = 50000, }, diff --git a/units/ArmBuildings/LandDefenceOffence/armjuno.lua b/units/ArmBuildings/LandDefenceOffence/armjuno.lua index edff9cd0ebc..ee2126d4c78 100644 --- a/units/ArmBuildings/LandDefenceOffence/armjuno.lua +++ b/units/ArmBuildings/LandDefenceOffence/armjuno.lua @@ -143,6 +143,7 @@ return { customparams = { lups_noshockwave = 1, nofire = true, + stockpilelimit = 20, }, damage = { default = 1, diff --git a/units/ArmBuildings/LandDefenceOffence/armmercury.lua b/units/ArmBuildings/LandDefenceOffence/armmercury.lua index 4a67742310c..ad57d3e73aa 100644 --- a/units/ArmBuildings/LandDefenceOffence/armmercury.lua +++ b/units/ArmBuildings/LandDefenceOffence/armmercury.lua @@ -146,6 +146,9 @@ return { weaponacceleration = 1000, weapontype = "MissileLauncher", weaponvelocity = 1850, + customparams = { + stockpilelimit = 5, + }, damage = { vtol = 750, }, diff --git a/units/ArmBuildings/LandDefenceOffence/armsilo.lua b/units/ArmBuildings/LandDefenceOffence/armsilo.lua index cbd50cf67d7..90c097118d3 100644 --- a/units/ArmBuildings/LandDefenceOffence/armsilo.lua +++ b/units/ArmBuildings/LandDefenceOffence/armsilo.lua @@ -172,6 +172,7 @@ return { weaponvelocity = 1600, customparams = { place_target_on_ground = "true", + stockpilelimit = 10, }, damage = { commanders = 2500, diff --git a/units/ArmGantry/armthor.lua b/units/ArmGantry/armthor.lua index 93c814519e2..44d4eedb9e6 100644 --- a/units/ArmGantry/armthor.lua +++ b/units/ArmGantry/armthor.lua @@ -194,6 +194,9 @@ return { weapontimer = 2.5, weapontype = "StarburstLauncher", weaponvelocity = 500, + customparams = { + stockpilelimit = 2, + }, damage = { default = 80000, }, diff --git a/units/ArmShips/T2/armantiship.lua b/units/ArmShips/T2/armantiship.lua index a503345095c..00e766583ee 100644 --- a/units/ArmShips/T2/armantiship.lua +++ b/units/ArmShips/T2/armantiship.lua @@ -166,6 +166,9 @@ return { weapontimer = 2.5, weapontype = "StarburstLauncher", weaponvelocity = 6000, + customparams = { + stockpilelimit = 20, + }, damage = { default = 1500, }, diff --git a/units/ArmShips/T2/armcarry.lua b/units/ArmShips/T2/armcarry.lua index 1a41590f2b0..13c3ef3010f 100644 --- a/units/ArmShips/T2/armcarry.lua +++ b/units/ArmShips/T2/armcarry.lua @@ -168,6 +168,9 @@ return { weapontimer = 2.5, weapontype = "StarburstLauncher", weaponvelocity = 6000, + customparams = { + stockpilelimit = 20, + }, damage = { default = 1500, }, diff --git a/units/ArmShips/T2/armseadragon.lua b/units/ArmShips/T2/armseadragon.lua index 014f289ec08..313ff93c02f 100644 --- a/units/ArmShips/T2/armseadragon.lua +++ b/units/ArmShips/T2/armseadragon.lua @@ -195,6 +195,7 @@ return { customparams = { place_target_on_ground = "true", scavforcecommandfire = true, + stockpilelimit = 10, }, damage = { commanders = 2500, diff --git a/units/CorBuildings/LandDefenceOffence/corfmd.lua b/units/CorBuildings/LandDefenceOffence/corfmd.lua index ec43012ee2c..c414ce8b448 100644 --- a/units/CorBuildings/LandDefenceOffence/corfmd.lua +++ b/units/CorBuildings/LandDefenceOffence/corfmd.lua @@ -148,6 +148,9 @@ return { weapontimer = 2.5, weapontype = "StarburstLauncher", weaponvelocity = 6000, + customparams = { + stockpilelimit = 20, + }, damage = { default = 1500, }, diff --git a/units/CorBuildings/LandDefenceOffence/corjuno.lua b/units/CorBuildings/LandDefenceOffence/corjuno.lua index 9cd359f0dbe..ef1e2461d15 100644 --- a/units/CorBuildings/LandDefenceOffence/corjuno.lua +++ b/units/CorBuildings/LandDefenceOffence/corjuno.lua @@ -140,6 +140,9 @@ return { weapontimer = 4, weapontype = "StarburstLauncher", weaponvelocity = 500, + customparams = { + stockpilelimit = 20, + }, customparams = { lups_noshockwave = 1, nofire = true, diff --git a/units/CorBuildings/LandDefenceOffence/corscreamer.lua b/units/CorBuildings/LandDefenceOffence/corscreamer.lua index 60c5c1bed0d..d0b78668b19 100644 --- a/units/CorBuildings/LandDefenceOffence/corscreamer.lua +++ b/units/CorBuildings/LandDefenceOffence/corscreamer.lua @@ -146,6 +146,9 @@ return { weaponacceleration = 1000, weapontype = "MissileLauncher", weaponvelocity = 1850, + customparams = { + stockpilelimit = 5, + }, damage = { vtol = 750, }, diff --git a/units/CorBuildings/LandDefenceOffence/corsilo.lua b/units/CorBuildings/LandDefenceOffence/corsilo.lua index a5c499f52c4..5e3783eb1fc 100644 --- a/units/CorBuildings/LandDefenceOffence/corsilo.lua +++ b/units/CorBuildings/LandDefenceOffence/corsilo.lua @@ -147,6 +147,7 @@ return { weaponvelocity = 1600, customparams = { place_target_on_ground = "true", + stockpilelimit = 10, }, damage = { commanders = 2500, diff --git a/units/CorBuildings/LandDefenceOffence/cortron.lua b/units/CorBuildings/LandDefenceOffence/cortron.lua index 8332d50a449..425db71afc9 100644 --- a/units/CorBuildings/LandDefenceOffence/cortron.lua +++ b/units/CorBuildings/LandDefenceOffence/cortron.lua @@ -141,6 +141,9 @@ return { weapontimer = 3, weapontype = "StarburstLauncher", weaponvelocity = 1200, + customparams = { + stockpilelimit = 10, + }, damage = { commanders = 750, default = 4000, diff --git a/units/CorShips/T2/corantiship.lua b/units/CorShips/T2/corantiship.lua index 4546acc4613..2492e930822 100644 --- a/units/CorShips/T2/corantiship.lua +++ b/units/CorShips/T2/corantiship.lua @@ -166,6 +166,9 @@ return { weapontimer = 2.5, weapontype = "StarburstLauncher", weaponvelocity = 6000, + customparams = { + stockpilelimit = 20, + }, damage = { default = 1500, }, diff --git a/units/CorShips/T2/corcarry.lua b/units/CorShips/T2/corcarry.lua index 8c47fff8599..571b4dde2b5 100644 --- a/units/CorShips/T2/corcarry.lua +++ b/units/CorShips/T2/corcarry.lua @@ -169,6 +169,9 @@ return { weapontimer = 2.5, weapontype = "StarburstLauncher", weaponvelocity = 6000, + customparams = { + stockpilelimit = 20, + }, damage = { default = 1500, }, diff --git a/units/CorShips/T2/cordesolator.lua b/units/CorShips/T2/cordesolator.lua index 6063eaeb811..a78880f433d 100644 --- a/units/CorShips/T2/cordesolator.lua +++ b/units/CorShips/T2/cordesolator.lua @@ -169,6 +169,7 @@ return { customparams = { place_target_on_ground = "true", scavforcecommandfire = true, + stockpilelimit = 10, }, damage = { commanders = 2500, diff --git a/units/CorVehicles/T2/cormabm.lua b/units/CorVehicles/T2/cormabm.lua index 497e05f8e9e..225e3869a77 100644 --- a/units/CorVehicles/T2/cormabm.lua +++ b/units/CorVehicles/T2/cormabm.lua @@ -155,6 +155,9 @@ return { weapontimer = 2, weapontype = "StarburstLauncher", weaponvelocity = 6000, + customparams = { + stockpilelimit = 20, + }, damage = { default = 500, }, diff --git a/units/Legion/Air/T2 Air/legmineb.lua b/units/Legion/Air/T2 Air/legmineb.lua index cfbfbd81db1..956d8bd0c34 100644 --- a/units/Legion/Air/T2 Air/legmineb.lua +++ b/units/Legion/Air/T2 Air/legmineb.lua @@ -125,6 +125,7 @@ return { bogus = 1, spawns_name = "cormine1", spawns_surface = "LAND", + stockpilelimit = 1, }, damage = { default = 1, diff --git a/units/Legion/Air/legmos.lua b/units/Legion/Air/legmos.lua index c23f0bcb4bb..1ab10bbbe4b 100644 --- a/units/Legion/Air/legmos.lua +++ b/units/Legion/Air/legmos.lua @@ -112,6 +112,9 @@ return { weapontimer = 2, weapontype = "MissileLauncher", weaponvelocity = 400, + customparams = { + stockpilelimit = 8, + }, damage = { default = 44, }, diff --git a/units/Legion/Defenses/legabm.lua b/units/Legion/Defenses/legabm.lua index c116e3a796e..0925ea9424d 100644 --- a/units/Legion/Defenses/legabm.lua +++ b/units/Legion/Defenses/legabm.lua @@ -99,7 +99,7 @@ return { select = { [1] = "loadwtr1", }, - }, + }, weapondefs = { fmd_rocket = { areaofeffect = 420, @@ -148,6 +148,9 @@ return { weapontimer = 2.5, weapontype = "StarburstLauncher", weaponvelocity = 6000, + customparams = { + stockpilelimit = 20, + }, damage = { default = 1500, }, diff --git a/units/Legion/Defenses/legperdition.lua b/units/Legion/Defenses/legperdition.lua index 49b261d621b..499ff562f25 100644 --- a/units/Legion/Defenses/legperdition.lua +++ b/units/Legion/Defenses/legperdition.lua @@ -179,13 +179,14 @@ return { area_onhit_damage = 175, area_onhit_range = 150, area_onhit_time = 15, + stockpilelimit = 10, }, damage = { commanders = 700, default = 2000,--plus 150*15 within 150 area }, }, - + }, weapons = { [1] = { diff --git a/units/Legion/Defenses/legsilo.lua b/units/Legion/Defenses/legsilo.lua index 6907b5f293b..42af5c19a56 100644 --- a/units/Legion/Defenses/legsilo.lua +++ b/units/Legion/Defenses/legsilo.lua @@ -147,6 +147,7 @@ return { weaponvelocity = 1600, customparams = { place_target_on_ground = "true", + stockpilelimit = 10, }, damage = { commanders = 2500, diff --git a/units/Legion/Defenses/legstarfall.lua b/units/Legion/Defenses/legstarfall.lua index a34572969ac..09c0e7fa831 100644 --- a/units/Legion/Defenses/legstarfall.lua +++ b/units/Legion/Defenses/legstarfall.lua @@ -136,6 +136,9 @@ return { weapontimer = 14, weapontype = "Cannon", weaponvelocity = 900, + --customparams = { + -- stockpilelimit = 1, + --}, damage = { default = 600, shields = 375, diff --git a/units/Legion/Economy/legrampart.lua b/units/Legion/Economy/legrampart.lua index c5d57470011..bdb7a11d695 100644 --- a/units/Legion/Economy/legrampart.lua +++ b/units/Legion/Economy/legrampart.lua @@ -125,6 +125,9 @@ return { weapontimer = 2.5, weapontype = "StarburstLauncher", weaponvelocity = 6000, + customparams = { + stockpilelimit = 20, + }, damage = { default = 1500, }, diff --git a/units/Legion/Legion EvoCom/legcomlvl10.lua b/units/Legion/Legion EvoCom/legcomlvl10.lua index 70ea4df1b5f..fb81d9fbf55 100644 --- a/units/Legion/Legion EvoCom/legcomlvl10.lua +++ b/units/Legion/Legion EvoCom/legcomlvl10.lua @@ -420,6 +420,7 @@ return { spawns_expire = 25, spawns_surface = "LAND", -- Available: "LAND SEA" spawns_mode = "random", + stockpilelimit = 5, }, damage = { default = 0, diff --git a/units/Legion/Legion EvoCom/legcomlvl2.lua b/units/Legion/Legion EvoCom/legcomlvl2.lua index 1c189eb10fd..9ab52b0e5c6 100644 --- a/units/Legion/Legion EvoCom/legcomlvl2.lua +++ b/units/Legion/Legion EvoCom/legcomlvl2.lua @@ -313,48 +313,6 @@ return { commanders = 1, }, }, - napalmmissile = { --unused, left here in case it replaces the Dgun again. - areaofeffect = 200, - avoidfeature = false, - burnblow = true, - cegtag = "missiletraillarge-red", - commandfire = true, - craterboost = 0, - cratermult = 0, - edgeeffectiveness = 1, - explosiongenerator = "custom:burnfirecom", - gravityaffected = "true", - impulsefactor = 1.8, - model = "banishermissile.s3o", - name = "napalmmissile", - noselfdamage = true, - range = 450, - reloadtime = 7, - smoketrail = true, - smokePeriod = 7, - smoketime = 48, - smokesize = 11.3, - smokecolor = 0.82, - soundhit = "corban_b", - soundhitwet = "splsmed", - soundstart = "corban_a", - startvelocity = 240, - stockpile = true, - stockpiletime = 30, - texture1 = "null", - texture2 = "railguntrail", - tolerance = 9000, - turret = true, - turnrate = 5000, - trajectoryheight = 0.45, - weaponacceleration = 220, - weapontimer = 5, - weapontype = "MissileLauncher", - weaponvelocity = 650, - damage = { - default = 75, - }, - }, disintegrator = { areaofeffect = 36, avoidfeature = false, diff --git a/units/Legion/Legion EvoCom/legcomlvl3.lua b/units/Legion/Legion EvoCom/legcomlvl3.lua index 9fdf47c7bd7..4974cf536fd 100644 --- a/units/Legion/Legion EvoCom/legcomlvl3.lua +++ b/units/Legion/Legion EvoCom/legcomlvl3.lua @@ -333,48 +333,6 @@ return { commanders = 1, }, }, - napalmmissile = { --unused, left here in case it replaces the Dgun again. - areaofeffect = 300, - avoidfeature = false, - burnblow = true, - cegtag = "missiletraillarge-red", - commandfire = true, - craterboost = 0, - cratermult = 0, - edgeeffectiveness = 1, - explosiongenerator = "custom:burnfirecom-xl", - gravityaffected = "true", - impulsefactor = 2.7, - model = "banishermissile.s3o", - name = "napalmmissile", - noselfdamage = true, - range = 450, - reloadtime = 5, - smoketrail = true, - smokePeriod = 7, - smoketime = 48, - smokesize = 11.3, - smokecolor = 0.82, - soundhit = "corban_b", - soundhitwet = "splsmed", - soundstart = "corban_a", - startvelocity = 240, - stockpile = true, - stockpiletime = 25, - texture1 = "null", - texture2 = "railguntrail", - tolerance = 9000, - turret = true, - turnrate = 5000, - trajectoryheight = 0.45, - weaponacceleration = 220, - weapontimer = 5, - weapontype = "MissileLauncher", - weaponvelocity = 650, - damage = { - default = 150, - }, - }, botcannon = { accuracy = 0.2, areaofeffect = 10, @@ -421,6 +379,7 @@ return { spawns_expire = 25, spawns_surface = "LAND", -- Available: "LAND SEA" spawns_mode = "random", + stockpilelimit = 3, }, damage = { default = 0, diff --git a/units/Legion/Legion EvoCom/legcomlvl4.lua b/units/Legion/Legion EvoCom/legcomlvl4.lua index 7d005b9c4f6..5c66fe0d4d3 100644 --- a/units/Legion/Legion EvoCom/legcomlvl4.lua +++ b/units/Legion/Legion EvoCom/legcomlvl4.lua @@ -326,47 +326,6 @@ return { default = 250, }, }, - napalmmissile = { --unused, left here in case it replaces Dgun again. - areaofeffect = 300, - avoidfeature = false, - burnblow = true, - cegtag = "missiletraillarge-red", - craterboost = 0, - cratermult = 0, - edgeeffectiveness = 1, - explosiongenerator = "custom:burnfirecom-xl", - gravityaffected = "true", - impulsefactor = 2.7, - model = "banishermissile.s3o", - name = "napalmmissile", - noselfdamage = true, - range = 600, - reloadtime = 3, - smoketrail = true, - smokePeriod = 7, - smoketime = 48, - smokesize = 11.3, - smokecolor = 0.82, - soundhit = "corban_b", - soundhitwet = "splsmed", - soundstart = "corban_a", - startvelocity = 240, - stockpile = true, - stockpiletime = 20, - texture1 = "null", - texture2 = "railguntrail", - tolerance = 9000, - turret = true, - turnrate = 5000, - trajectoryheight = 0.45, - weaponacceleration = 220, - weapontimer = 5, - weapontype = "MissileLauncher", - weaponvelocity = 650, - damage = { - default = 150, - }, - }, botcannon = { accuracy = 0.2, areaofeffect = 10, @@ -413,6 +372,7 @@ return { spawns_expire = 25, spawns_surface = "LAND", -- Available: "LAND SEA" spawns_mode = "random", + stockpilelimit = 3, }, damage = { default = 0, diff --git a/units/Legion/Legion EvoCom/legcomlvl5.lua b/units/Legion/Legion EvoCom/legcomlvl5.lua index 5589d8cbaa8..125dcc8047e 100644 --- a/units/Legion/Legion EvoCom/legcomlvl5.lua +++ b/units/Legion/Legion EvoCom/legcomlvl5.lua @@ -429,6 +429,7 @@ return { spawns_expire = 25, spawns_surface = "LAND", -- Available: "LAND SEA" spawns_mode = "random", + stockpilelimit = 4, }, damage = { default = 0, diff --git a/units/Legion/Legion EvoCom/legcomlvl6.lua b/units/Legion/Legion EvoCom/legcomlvl6.lua index c6db5e40363..165634c39b3 100644 --- a/units/Legion/Legion EvoCom/legcomlvl6.lua +++ b/units/Legion/Legion EvoCom/legcomlvl6.lua @@ -418,6 +418,7 @@ return { spawns_expire = 25, spawns_surface = "LAND", -- Available: "LAND SEA" spawns_mode = "random", + stockpilelimit = 4, }, damage = { default = 0, diff --git a/units/Legion/Legion EvoCom/legcomlvl7.lua b/units/Legion/Legion EvoCom/legcomlvl7.lua index 430ed78f651..33a2802883e 100644 --- a/units/Legion/Legion EvoCom/legcomlvl7.lua +++ b/units/Legion/Legion EvoCom/legcomlvl7.lua @@ -418,6 +418,7 @@ return { spawns_expire = 25, spawns_surface = "LAND", -- Available: "LAND SEA" spawns_mode = "random", + stockpilelimit = 4, }, damage = { default = 0, diff --git a/units/Legion/Legion EvoCom/legcomlvl8.lua b/units/Legion/Legion EvoCom/legcomlvl8.lua index abf31c9687a..dd4caf45153 100644 --- a/units/Legion/Legion EvoCom/legcomlvl8.lua +++ b/units/Legion/Legion EvoCom/legcomlvl8.lua @@ -420,6 +420,7 @@ return { spawns_expire = 25, spawns_surface = "LAND", -- Available: "LAND SEA" spawns_mode = "random", + stockpilelimit = 5, }, damage = { default = 0, diff --git a/units/Legion/Legion EvoCom/legcomlvl9.lua b/units/Legion/Legion EvoCom/legcomlvl9.lua index 986f32a8f86..9a668360c96 100644 --- a/units/Legion/Legion EvoCom/legcomlvl9.lua +++ b/units/Legion/Legion EvoCom/legcomlvl9.lua @@ -425,6 +425,7 @@ return { spawns_expire = 25, spawns_surface = "LAND", -- Available: "LAND SEA" spawns_mode = "random", + stockpilelimit = 5, }, damage = { default = 0, diff --git a/units/Legion/Legion EvoCom/legevodecom.lua b/units/Legion/Legion EvoCom/legevodecom.lua index d04caf01744..ee476fc55c9 100644 --- a/units/Legion/Legion EvoCom/legevodecom.lua +++ b/units/Legion/Legion EvoCom/legevodecom.lua @@ -13,6 +13,7 @@ unitsTable['legdecomlvl3'].decoyfor = "legcomlvl3" unitsTable['legdecomlvl3'].customparams.decoyfor = "legcomlvl3" unitsTable['legdecomlvl3'].health = math.ceil(unitsTable['legdecomlvl3'].health*0.5) unitsTable['legdecomlvl3'].weapondefs.disintegrator.damage.default = 40 +unitsTable['legdecomlvl3'].weapondefs.botcannon.customparams.stockpilelimit = 1 unitsTable['legdecomlvl6'] = VFS.Include('units/Legion/Legion EvoCom/legcomlvl6.lua').legcomlvl6 --if this filepath is changed, the unit will no longer work! unitsTable['legdecomlvl6'].selfdestructas = "decoycommander" @@ -27,6 +28,7 @@ unitsTable['legdecomlvl6'].customparams.decoyfor = "legcomlvl6" unitsTable['legdecomlvl6'].customparams.isdecoycommander = true unitsTable['legdecomlvl6'].health = math.ceil(unitsTable['legdecomlvl6'].health*0.5) unitsTable['legdecomlvl6'].weapondefs.disintegrator.damage.default = 40 +unitsTable['legdecomlvl6'].weapondefs.botcannon.customparams.stockpilelimit = 2 unitsTable['legdecomlvl10'] = VFS.Include('units/Legion/Legion EvoCom/legcomlvl10.lua').legcomlvl10 --if this filepath is changed, the unit will no longer work! unitsTable['legdecomlvl10'].selfdestructas = "decoycommander" @@ -41,5 +43,6 @@ unitsTable['legdecomlvl10'].customparams.decoyfor = "legcomlvl10" unitsTable['legdecomlvl10'].customparams.isdecoycommander = true unitsTable['legdecomlvl10'].health = math.ceil(unitsTable['legdecomlvl10'].health*0.5) unitsTable['legdecomlvl10'].weapondefs.disintegrator.damage.default = 40 +unitsTable['legdecomlvl10'].weapondefs.botcannon.customparams.stockpilelimit = 3 -return unitsTable \ No newline at end of file +return unitsTable diff --git a/units/Scavengers/Air/legmost3.lua b/units/Scavengers/Air/legmost3.lua index ec071d91141..8282ce83714 100644 --- a/units/Scavengers/Air/legmost3.lua +++ b/units/Scavengers/Air/legmost3.lua @@ -120,6 +120,9 @@ return { weapontype = "MissileLauncher", weaponvelocity = 700, --wobble = 3000, + customparams = { + stockpilelimit = 8, + }, damage = { default = 200, }, diff --git a/units/Scavengers/Boss/scavengerbossv4.lua b/units/Scavengers/Boss/scavengerbossv4.lua index 07ccdeec334..d938f8a27e7 100644 --- a/units/Scavengers/Boss/scavengerbossv4.lua +++ b/units/Scavengers/Boss/scavengerbossv4.lua @@ -117,7 +117,6 @@ for difficulty, stats in pairs(difficultyParams) do paralyzemultiplier = 0.025, subfolder = "", i18nfromunit = 'scavengerbossv4', - stockpileLimit = 1, }, featuredefs = { dead = { @@ -738,6 +737,7 @@ for difficulty, stats in pairs(difficultyParams) do spawns_name = "squadarmsptkt4 squadcorkarganetht4 squadcorakt4 squadcorakt4 squadcorakt4 squadcorakt4 squadcorakt4 squadarmpwt4 squadarmpwt4 squadarmpwt4 squadarmpwt4 squadarmpwt4", spawns_surface = "LAND", spawns_mode = "random", + stockpilelimit = 1, }, damage = { default = 0, @@ -872,7 +872,7 @@ for difficulty, stats in pairs(difficultyParams) do name = "TurboWeaponGapDelay", noselfdamage = true, projectiles = math.floor((10/stats.turboWeaponOnTime*100) + 0.5), -- after delay, when 200-300 additional projectiles are fired, the turbo weapon is disabled. - range = 99999, + range = 99999, reloadtime = 1/stats.turboWeaponOffTime*100, --when 10+(health%/4) shots are fired, select a turbo weapon and enable it. rgbcolor = "0.7 0.3 1.0", rgbcolor2 = "0.8 0.6 1.0", diff --git a/units/Scavengers/Bots/legsrailt4.lua b/units/Scavengers/Bots/legsrailt4.lua index eec9832fe1d..dd780b1c23e 100644 --- a/units/Scavengers/Bots/legsrailt4.lua +++ b/units/Scavengers/Bots/legsrailt4.lua @@ -137,6 +137,9 @@ return { turret = true, weapontype = "LaserCannon", weaponvelocity = 3180, + customparams = { + stockpilelimit = 3, + }, damage = { commanders = 1000, default = 6000, diff --git a/units/Scavengers/Buildings/DefenseOffense/armbotrail.lua b/units/Scavengers/Buildings/DefenseOffense/armbotrail.lua index 43acd0f5af4..0d51e42dc3b 100644 --- a/units/Scavengers/Buildings/DefenseOffense/armbotrail.lua +++ b/units/Scavengers/Buildings/DefenseOffense/armbotrail.lua @@ -151,6 +151,7 @@ return { customparams = { spawns_name = "armpw", spawns_surface = "LAND", -- Available: "LAND SEA" blah + stockpilelimit = 50, }, damage = { default = 10, diff --git a/units/other/evocom/armcomlvl10.lua b/units/other/evocom/armcomlvl10.lua index 13c60b433d9..b1499103e30 100644 --- a/units/other/evocom/armcomlvl10.lua +++ b/units/other/evocom/armcomlvl10.lua @@ -254,6 +254,9 @@ return { weapontimer = 1.9, weapontype = "StarburstLauncher", weaponvelocity = 1000, + customparams = { + stockpilelimit = 5, + }, damage = { default = 4400, }, diff --git a/units/other/evocom/armcomlvl3.lua b/units/other/evocom/armcomlvl3.lua index 4bc5ea944f9..67c52fb7b4e 100644 --- a/units/other/evocom/armcomlvl3.lua +++ b/units/other/evocom/armcomlvl3.lua @@ -260,6 +260,9 @@ return { weapontimer = 0.87, weapontype = "StarburstLauncher", weaponvelocity = 1000, + customparams = { + stockpilelimit = 3, + }, damage = { default = 550, }, diff --git a/units/other/evocom/armcomlvl4.lua b/units/other/evocom/armcomlvl4.lua index ed7fac22a2c..2765884ce08 100644 --- a/units/other/evocom/armcomlvl4.lua +++ b/units/other/evocom/armcomlvl4.lua @@ -260,6 +260,9 @@ return { weapontimer = 1.1, weapontype = "StarburstLauncher", weaponvelocity = 1000, + customparams = { + stockpilelimit = 3, + }, damage = { default = 800, }, diff --git a/units/other/evocom/armcomlvl5.lua b/units/other/evocom/armcomlvl5.lua index 6c95faa1c40..963e9be1bad 100644 --- a/units/other/evocom/armcomlvl5.lua +++ b/units/other/evocom/armcomlvl5.lua @@ -260,6 +260,9 @@ return { weapontimer = 1.24, weapontype = "StarburstLauncher", weaponvelocity = 1000, + customparams = { + stockpilelimit = 4, + }, damage = { default = 1200, }, diff --git a/units/other/evocom/armcomlvl6.lua b/units/other/evocom/armcomlvl6.lua index b600808315c..d89a4cc2523 100644 --- a/units/other/evocom/armcomlvl6.lua +++ b/units/other/evocom/armcomlvl6.lua @@ -260,6 +260,9 @@ return { weapontimer = 1.46, weapontype = "StarburstLauncher", weaponvelocity = 1000, + customparams = { + stockpilelimit = 4, + }, damage = { default = 1350, }, diff --git a/units/other/evocom/armcomlvl7.lua b/units/other/evocom/armcomlvl7.lua index a96907624df..81ab87df470 100644 --- a/units/other/evocom/armcomlvl7.lua +++ b/units/other/evocom/armcomlvl7.lua @@ -261,6 +261,9 @@ return { weapontimer = 1.46, weapontype = "StarburstLauncher", weaponvelocity = 1000, + customparams = { + stockpilelimit = 4, + }, damage = { default = 1800, }, diff --git a/units/other/evocom/armcomlvl8.lua b/units/other/evocom/armcomlvl8.lua index 0af49e27ea1..f916a4bd0e3 100644 --- a/units/other/evocom/armcomlvl8.lua +++ b/units/other/evocom/armcomlvl8.lua @@ -263,6 +263,9 @@ return { weapontimer = 1.6, weapontype = "StarburstLauncher", weaponvelocity = 1000, + customparams = { + stockpilelimit = 5, + }, damage = { default = 2300, }, diff --git a/units/other/evocom/armcomlvl9.lua b/units/other/evocom/armcomlvl9.lua index 18f40a1e540..2318ff07b71 100644 --- a/units/other/evocom/armcomlvl9.lua +++ b/units/other/evocom/armcomlvl9.lua @@ -263,6 +263,9 @@ return { weapontimer = 1.74, weapontype = "StarburstLauncher", weaponvelocity = 1000, + customparams = { + stockpilelimit = 5, + }, damage = { default = 3600, }, diff --git a/units/other/evocom/armcorevodecom.lua b/units/other/evocom/armcorevodecom.lua index 5b2d48ff17b..b16ba68c82e 100644 --- a/units/other/evocom/armcorevodecom.lua +++ b/units/other/evocom/armcorevodecom.lua @@ -13,6 +13,7 @@ unitsTable['armdecomlvl3'].customparams.decoyfor = "armcomlvl3" unitsTable['armdecomlvl3'].customparams.isdecoycommander = true unitsTable['armdecomlvl3'].health = math.ceil(unitsTable['armdecomlvl3'].health*0.5) unitsTable['armdecomlvl3'].weapondefs.disintegrator.damage.default = 40 +unitsTable['armdecomlvl3'].weapondefs.backlauncher.customparams.stockpilelimit = 1 unitsTable['armdecomlvl6'] = VFS.Include('units/other/evocom/armcomlvl6.lua').armcomlvl6 --if this filepath is changed, the unit will no longer work! unitsTable['armdecomlvl6'].selfdestructas = "decoycommander" @@ -27,6 +28,7 @@ unitsTable['armdecomlvl6'].customparams.decoyfor = "armcomlvl6" unitsTable['armdecomlvl6'].customparams.isdecoycommander = true unitsTable['armdecomlvl6'].health = math.ceil(unitsTable['armdecomlvl6'].health*0.5) unitsTable['armdecomlvl6'].weapondefs.disintegrator.damage.default = 40 +unitsTable['armdecomlvl6'].weapondefs.backlauncher.customparams.stockpilelimit = 2 unitsTable['armdecomlvl10'] = VFS.Include('units/other/evocom/armcomlvl10.lua').armcomlvl10 --if this filepath is changed, the unit will no longer work! unitsTable['armdecomlvl10'].selfdestructas = "decoycommander" @@ -41,6 +43,7 @@ unitsTable['armdecomlvl10'].customparams.decoyfor = "armcomlvl10" unitsTable['armdecomlvl10'].customparams.isdecoycommander = true unitsTable['armdecomlvl10'].health = math.ceil(unitsTable['armdecomlvl10'].health*0.5) unitsTable['armdecomlvl10'].weapondefs.disintegrator.damage.default = 40 +unitsTable['armdecomlvl10'].weapondefs.backlauncher.customparams.stockpilelimit = 2 unitsTable['cordecomlvl3'] = VFS.Include('units/other/evocom/corcomlvl3.lua').corcomlvl3 --if this filepath is changed, the unit will no longer work! unitsTable['cordecomlvl3'].selfdestructas = "decoycommander" @@ -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 diff --git a/units/other/raptors/Structures/raptor_turret_antinuke_t2_v1.lua b/units/other/raptors/Structures/raptor_turret_antinuke_t2_v1.lua index ef1a7dfa943..3befab5db99 100644 --- a/units/other/raptors/Structures/raptor_turret_antinuke_t2_v1.lua +++ b/units/other/raptors/Structures/raptor_turret_antinuke_t2_v1.lua @@ -120,6 +120,9 @@ return { weapontype = "MissileLauncher", weaponvelocity = 2000, wobble = 32000, + customparams = { + stockpilelimit = 5, + }, damage = { default = 1500, }, diff --git a/units/other/raptors/Structures/raptor_turret_antinuke_t3_v1.lua b/units/other/raptors/Structures/raptor_turret_antinuke_t3_v1.lua index b6c98ef5909..38b0e25bb66 100644 --- a/units/other/raptors/Structures/raptor_turret_antinuke_t3_v1.lua +++ b/units/other/raptors/Structures/raptor_turret_antinuke_t3_v1.lua @@ -119,6 +119,9 @@ return { weapontype = "MissileLauncher", weaponvelocity = 2000, wobble = 32000, + customparams = { + stockpilelimit = 10, + }, damage = { default = 1500, },