Skip to content

Commit

Permalink
Fix energyupkeep usage (#3944)
Browse files Browse the repository at this point in the history
Remove energyupkeep for units not really having it:
* All construction turrets (including experimental? t2 ones).
* armack (adv con bot), armacsub (adv con sub), and cormadsam (sam battery).
  • Loading branch information
saurtron authored Nov 21, 2024
1 parent 38021ca commit 2d6ba1a
Show file tree
Hide file tree
Showing 20 changed files with 6 additions and 17 deletions.
4 changes: 2 additions & 2 deletions gamedata/alldefs_post.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1259,8 +1259,8 @@ function UnitDef_Post(name, uDef)
uDef.energystorage = uDef.energystorage * x
end
end
if name == "armsolar" or name == "corsolar" or name == "legsolar" then
-- special case (but why?)
if uDef.energyupkeep and uDef.energyupkeep < 0 then
-- units with negative upkeep means they produce energy when "on".
local x = modOptions.multiplier_energyproduction * modOptions.multiplier_resourceincome
uDef.energyupkeep = uDef.energyupkeep * x
if uDef.energystorage then
Expand Down
1 change: 0 additions & 1 deletion units/ArmBots/T2/armack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ return {
energycost = 6900,
energymake = 14,
energystorage = 100,
energyupkeep = 14,
explodeas = "mediumexplosiongeneric-builder",
footprintx = 2,
footprintz = 2,
Expand Down
1 change: 1 addition & 0 deletions units/ArmBuildings/LandEconomy/armsolar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ return {
damagemodifier = 0.5,
energycost = 0,
energystorage = 50,
-- negative energyupkeep means it's conditional so when unit is off won't produce
energyupkeep = -20,
explodeas = "smallBuildingexplosiongeneric",
footprintx = 5,
Expand Down
1 change: 0 additions & 1 deletion units/ArmBuildings/LandUtil/armnanotc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ return {
collisionvolumescales = "31 32 31",
collisionvolumetype = "CylY",
energycost = 3200,
energyupkeep = 30,
explodeas = "nanoboom",
footprintx = 3,
footprintz = 3,
Expand Down
1 change: 0 additions & 1 deletion units/ArmBuildings/LandUtil/armnanotct2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ return {
collisionvolumescales = "46 80 46",
collisionvolumetype = "CylY",
energycost = 12800,
energyupkeep = 30,
explodeas = "nanoboom",
footprintx = 4,
footprintz = 4,
Expand Down
1 change: 0 additions & 1 deletion units/ArmBuildings/SeaUtil/armnanotc2plat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ return {
collisionvolumescales = "46 80 46",
collisionvolumetype = "CylY",
energycost = 12800,
energyupkeep = 30,
explodeas = "nanoboom",
floater = true,
footprintx = 4,
Expand Down
1 change: 0 additions & 1 deletion units/ArmBuildings/SeaUtil/armnanotcplat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ return {
collisionvolumescales = "31 50 31",
collisionvolumetype = "CylY",
energycost = 2600,
energyupkeep = 30,
explodeas = "nanoboom",
floater = true,
footprintx = 3,
Expand Down
1 change: 0 additions & 1 deletion units/ArmShips/T2/armacsub.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ return {
energycost = 9000,
energymake = 30,
energystorage = 150,
energyupkeep = 30,
explodeas = "smallExplosionGeneric-uw",
footprintx = 4,
footprintz = 4,
Expand Down
1 change: 0 additions & 1 deletion units/CorBuildings/LandDefenceOffence/cormadsam.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ return {
collisionvolumetype = "CylY",
corpse = "DEAD",
energycost = 6100,
energyupkeep = 5,
explodeas = "mediumBuildingexplosiongeneric",
footprintx = 3,
footprintz = 3,
Expand Down
1 change: 1 addition & 0 deletions units/CorBuildings/LandEconomy/corsolar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ return {
damagemodifier = 0.5,
energycost = 0,
energystorage = 50,
-- negative energyupkeep means it's conditional so when unit is off won't produce
energyupkeep = -20,
explodeas = "smallBuildingexplosiongeneric",
footprintx = 5,
Expand Down
1 change: 0 additions & 1 deletion units/CorBuildings/LandUtil/cornanotc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ return {
collisionvolumescales = "31 32 31",
collisionvolumetype = "CylY",
energycost = 3200,
energyupkeep = 30,
explodeas = "nanoboom",
footprintx = 3,
footprintz = 3,
Expand Down
1 change: 0 additions & 1 deletion units/CorBuildings/LandUtil/cornanotct2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ return {
collisionvolumescales = "46 80 46",
collisionvolumetype = "CylY",
energycost = 12800,
energyupkeep = 30,
explodeas = "nanoboom",
footprintx = 4,
footprintz = 4,
Expand Down
1 change: 0 additions & 1 deletion units/CorBuildings/SeaUtil/cornanotc2plat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ return {
collisionvolumescales = "46 80 46",
collisionvolumetype = "CylY",
energycost = 12800,
energyupkeep = 30,
explodeas = "nanoboom",
floater = true,
footprintx = 4,
Expand Down
1 change: 0 additions & 1 deletion units/CorBuildings/SeaUtil/cornanotcplat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ return {
collisionvolumescales = "31 50 31",
collisionvolumetype = "CylY",
energycost = 2600,
energyupkeep = 30,
explodeas = "nanoboom",
floater = true,
footprintx = 3,
Expand Down
1 change: 1 addition & 0 deletions units/Legion/Economy/legmex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ return {
collisionvolumescales = "48 30 48",
collisionvolumetype = "CylY",
corpse = "DEAD",
-- negative energyupkeep means it's conditional so when unit is off won't produce
energyupkeep = -7,
explodeas = "smallBuildingexplosiongeneric",
extractsmetal = 0.0008,
Expand Down
1 change: 1 addition & 0 deletions units/Legion/Economy/legsolar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ return {
corpse = "DEAD",
damagemodifier = 0.5,
energystorage = 50,
-- negative energyupkeep means it's conditional so when unit is off won't produce
energyupkeep = -20,
explodeas = "smallBuildingexplosiongeneric",
footprintx = 5,
Expand Down
1 change: 0 additions & 1 deletion units/Legion/Utilities/cornanotc2plat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ return {
collisionvolumeoffsets = "0 0 0",
collisionvolumescales = "46 80 46",
collisionvolumetype = "CylY",
energyupkeep = 30,
explodeas = "nanoboom",
floater = true,
footprintx = 4,
Expand Down
1 change: 0 additions & 1 deletion units/Legion/Utilities/legnanotc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ return {
collisionvolumeoffsets = "0 0 0",
collisionvolumescales = "31 32 31",
collisionvolumetype = "CylY",
energyupkeep = 30,
explodeas = "nanoboom",
footprintx = 3,
footprintz = 3,
Expand Down
1 change: 0 additions & 1 deletion units/Legion/Utilities/legnanotcplat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ return {
collisionvolumeoffsets = "0 0 0",
collisionvolumescales = "31 50 31",
collisionvolumetype = "CylY",
energyupkeep = 30,
explodeas = "nanoboom",
floater = true,
footprintx = 3,
Expand Down
1 change: 0 additions & 1 deletion units/Legion/Utilities/legnanotct2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ return {
collisionvolumeoffsets = "0 0 0",
collisionvolumescales = "46 80 46",
collisionvolumetype = "CylY",
energyupkeep = 30,
explodeas = "nanoboom",
footprintx = 4,
footprintz = 4,
Expand Down

0 comments on commit 2d6ba1a

Please sign in to comment.