Skip to content

Commit f647df4

Browse files
committed
Preempt some settings related to reclaiming features
1 parent 05abd6b commit f647df4

File tree

13 files changed

+37
-27
lines changed

13 files changed

+37
-27
lines changed

Gamedata/alldefs_post.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,10 +611,9 @@ function ModOptions_Post (UnitDefs, WeaponDefs)
611611
if unitDef.workertime and unitDef.workertime >= 8 then
612612
unitDef.workertime = 8
613613
end
614-
-- Set reclaimspeed to be a multiple of workertime. This relies on max defaults set in featuredefs post. Without some mox defaults there, this will be a funny result.
615-
if unitDef.workertime and unitDef.reclaimspeed then
616-
unitDef.reclaimspeed = unitDef.workertime
617-
end
614+
-- Set reclaimspeed to be a multiple of workertime. This relies on max defaults set in featuredefs post. Without some max defaults there, this will be a funny result.
615+
unitDef.reclaimspeed = unitDef.workertime
616+
618617
if canAnyUnitsReclaim == false then
619618
if unitDef.canreclaim == true then
620619
unitDef.canreclaim = false

Gamedata/featuredefs_post.lua

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ local function istable(x) return (type(x) == 'table') end
1919
local function isnumber(x) return (type(x) == 'number') end
2020
local function isstring(x) return (type(x) == 'string') end
2121
local spGetModOptions = Spring.GetModOptions
22-
2322
--------------------------------------------------------------------------------
2423

2524
if spGetModOptions then
@@ -50,19 +49,31 @@ for name, fd in pairs(FeatureDefs) do
5049
end
5150
end
5251

53-
-- Reset maximum feature values
52+
-- Set Reclaimtime that isn't insane. Default engine reclaimtime is (m+e) * 6 which is arbitrary as all hell.
5453
if tonumber(fd["metal"]) == nil or tonumber(fd["metal"]) == 0 then
55-
fd.metal = 100
56-
end
57-
if tonumber(fd["metal"]) > 100 then
58-
fd.metal = 100
54+
fd.metal = 1
5955
end
6056
if tonumber(fd["energy"]) == nil or tonumber(fd["energy"]) == 0 then
61-
fd.energy = 100
62-
end
63-
if tonumber(fd["energy"]) > 500 then
64-
fd.energy = 500
57+
fd.energy = 1
6558
end
59+
60+
local reclaimvalue = (tonumber(fd["metal"]) + tonumber(fd["energy"])) / 4
61+
62+
fd.reclaimtime = reclaimvalue
63+
64+
-- Reset maximum feature values
65+
-- if tonumber(fd["metal"]) == nil or tonumber(fd["metal"]) == 0 then
66+
-- fd.metal = 100
67+
-- end
68+
-- if tonumber(fd["metal"]) > 100 then
69+
-- fd.metal = 100
70+
-- end
71+
-- if tonumber(fd["energy"]) == nil or tonumber(fd["energy"]) == 0 then
72+
-- fd.energy = 100
73+
-- end
74+
-- if tonumber(fd["energy"]) > 1 then
75+
-- fd.energy = 100
76+
-- end
6677
end
6778

6879

Gamedata/modrules.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ local modrules = {
3737
unitMethod = 0, -- defaults to 1
3838

3939
unitEnergyCostFactor = 0, -- defaults to 0
40-
unitEfficiency = 0, -- defaults to 1
40+
unitEfficiency = 1, -- defaults to 1
4141
featureEnergyCostFactor = 0, -- defaults to 0
4242

4343
allowEnemies = false, -- defaults to true

LuaRules/Gadgets/game_featureReclaim.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function gadget:GetInfo()
66
date = "December, 2008",
77
license = "public domain",
88
layer = 0,
9-
enabled = true -- loaded by default?
9+
enabled = false -- loaded by default?
1010
}
1111
end
1212

@@ -26,10 +26,10 @@ if gadgetHandler:IsSyncedCode() then
2626
reclaimLeft[featureID] = (reclaimLeft[featureID] or 0.1) + part
2727
if (reclaimLeft[featureID] <= 0) then
2828
Spring.DestroyFeature(featureID)
29-
--Spring.AddTeamResource(builderTeam, "e", 10)
29+
--Spring.AddTeamResource(builderTeam, "e", 1)
3030
local fx, fy, fz = GetFeaturePosition(featureID)
3131
Spring.PlaySoundFile("sounds/miscfx/reclaimed.wav", 0.5, fx, fy, fz)
32-
SpawnCEG("sparklegreenplus10energy", fx, fy, fz)
32+
SpawnCEG("sparklegreen", fx, fy, fz)
3333
end
3434
return false
3535
end

Units-Configs-Basedefs/basedefs/zaal/zarm_basedef.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ unitDef = {
1818
canHover = false,
1919
canMove = false,
2020
canPatrol = false,
21-
canreclaim = false,
21+
canreclaim = true,
2222
canstop = true,
2323
category = "BUILDING",
2424
description = [[Provides Tech/Builds Construction Bugs]],

Units-Configs-Basedefs/basedefs/zaal/zconstructor_basedef.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ unitDef = {
1818
canHover = false,
1919
canMove = true,
2020
canPatrol = true,
21-
canreclaim = false,
21+
canreclaim = true,
2222
canstop = true,
2323
category = "LIGHT NOTAIR",
2424
description = [[Construction Bug]],

Units-Configs-Basedefs/basedefs/zaal/ztenticle_basedef.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ unitDef = {
1818
canHover = false,
1919
canMove = false,
2020
canPatrol = false,
21-
canreclaim = false,
21+
canreclaim = true,
2222
canstop = true,
2323
category = "BUILDING",
2424
description = [[Builds Units]],

Units/ecommanderbattle.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ local unitDef = {
4545
canGuard = true,
4646
canMove = true,
4747
canPatrol = true,
48-
canreclaim = false,
48+
canreclaim = true,
4949
canstop = true,
5050
category = "NOTAIR SUPPORT ARMORED",
5151
description = [[Experimental Assault Overseer]],

Units/ecommanderbuild.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ local unitDef = {
4141
canGuard = true,
4242
canMove = true,
4343
canPatrol = true,
44-
canreclaim = false,
44+
canreclaim = true,
4545
canstop = true,
4646
category = "NOTAIR SUPPORT LIGHT",
4747
description = [[Builds Units x8 as fast]],

Units/ecommandercloak.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ local unitDef = {
4141
canGuard = true,
4242
canMove = true,
4343
canPatrol = true,
44-
canreclaim = false,
44+
canreclaim = true,
4545
canstop = true,
4646
category = "NOTAIR SUPPORT LIGHT",
4747
description = [[Provides Massive Cloak Field]],

0 commit comments

Comments
 (0)