From f647df4369accbd2e4953880c0d9d90a73bbb2d3 Mon Sep 17 00:00:00 2001 From: Forboding Angel Date: Sat, 12 Feb 2022 22:10:33 -0800 Subject: [PATCH] Preempt some settings related to reclaiming features --- Gamedata/alldefs_post.lua | 7 ++--- Gamedata/featuredefs_post.lua | 31 +++++++++++++------ Gamedata/modrules.lua | 2 +- LuaRules/Gadgets/game_featureReclaim.lua | 6 ++-- .../basedefs/zaal/zarm_basedef.lua | 2 +- .../basedefs/zaal/zconstructor_basedef.lua | 2 +- .../basedefs/zaal/ztenticle_basedef.lua | 2 +- Units/ecommanderbattle.lua | 2 +- Units/ecommanderbuild.lua | 2 +- Units/ecommandercloak.lua | 2 +- Units/ecommanderfactory.lua | 2 +- Units/ecommandershield.lua | 2 +- modinfo.lua | 2 +- 13 files changed, 37 insertions(+), 27 deletions(-) diff --git a/Gamedata/alldefs_post.lua b/Gamedata/alldefs_post.lua index 8bc1ab112..ac4ef174b 100644 --- a/Gamedata/alldefs_post.lua +++ b/Gamedata/alldefs_post.lua @@ -611,10 +611,9 @@ function ModOptions_Post (UnitDefs, WeaponDefs) if unitDef.workertime and unitDef.workertime >= 8 then unitDef.workertime = 8 end - -- 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. - if unitDef.workertime and unitDef.reclaimspeed then - unitDef.reclaimspeed = unitDef.workertime - end + -- 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. + unitDef.reclaimspeed = unitDef.workertime + if canAnyUnitsReclaim == false then if unitDef.canreclaim == true then unitDef.canreclaim = false diff --git a/Gamedata/featuredefs_post.lua b/Gamedata/featuredefs_post.lua index dca006fee..d2617896d 100644 --- a/Gamedata/featuredefs_post.lua +++ b/Gamedata/featuredefs_post.lua @@ -19,7 +19,6 @@ local function istable(x) return (type(x) == 'table') end local function isnumber(x) return (type(x) == 'number') end local function isstring(x) return (type(x) == 'string') end local spGetModOptions = Spring.GetModOptions - -------------------------------------------------------------------------------- if spGetModOptions then @@ -50,19 +49,31 @@ for name, fd in pairs(FeatureDefs) do end end - -- Reset maximum feature values + -- Set Reclaimtime that isn't insane. Default engine reclaimtime is (m+e) * 6 which is arbitrary as all hell. if tonumber(fd["metal"]) == nil or tonumber(fd["metal"]) == 0 then - fd.metal = 100 - end - if tonumber(fd["metal"]) > 100 then - fd.metal = 100 + fd.metal = 1 end if tonumber(fd["energy"]) == nil or tonumber(fd["energy"]) == 0 then - fd.energy = 100 - end - if tonumber(fd["energy"]) > 500 then - fd.energy = 500 + fd.energy = 1 end + + local reclaimvalue = (tonumber(fd["metal"]) + tonumber(fd["energy"])) / 4 + + fd.reclaimtime = reclaimvalue + + -- Reset maximum feature values + -- if tonumber(fd["metal"]) == nil or tonumber(fd["metal"]) == 0 then + -- fd.metal = 100 + -- end + -- if tonumber(fd["metal"]) > 100 then + -- fd.metal = 100 + -- end + -- if tonumber(fd["energy"]) == nil or tonumber(fd["energy"]) == 0 then + -- fd.energy = 100 + -- end + -- if tonumber(fd["energy"]) > 1 then + -- fd.energy = 100 + -- end end diff --git a/Gamedata/modrules.lua b/Gamedata/modrules.lua index bb7c07a98..9f1da3641 100644 --- a/Gamedata/modrules.lua +++ b/Gamedata/modrules.lua @@ -37,7 +37,7 @@ local modrules = { unitMethod = 0, -- defaults to 1 unitEnergyCostFactor = 0, -- defaults to 0 - unitEfficiency = 0, -- defaults to 1 + unitEfficiency = 1, -- defaults to 1 featureEnergyCostFactor = 0, -- defaults to 0 allowEnemies = false, -- defaults to true diff --git a/LuaRules/Gadgets/game_featureReclaim.lua b/LuaRules/Gadgets/game_featureReclaim.lua index 46daaa4ef..89fef9e13 100644 --- a/LuaRules/Gadgets/game_featureReclaim.lua +++ b/LuaRules/Gadgets/game_featureReclaim.lua @@ -6,7 +6,7 @@ function gadget:GetInfo() date = "December, 2008", license = "public domain", layer = 0, - enabled = true -- loaded by default? + enabled = false -- loaded by default? } end @@ -26,10 +26,10 @@ if gadgetHandler:IsSyncedCode() then reclaimLeft[featureID] = (reclaimLeft[featureID] or 0.1) + part if (reclaimLeft[featureID] <= 0) then Spring.DestroyFeature(featureID) - --Spring.AddTeamResource(builderTeam, "e", 10) + --Spring.AddTeamResource(builderTeam, "e", 1) local fx, fy, fz = GetFeaturePosition(featureID) Spring.PlaySoundFile("sounds/miscfx/reclaimed.wav", 0.5, fx, fy, fz) - SpawnCEG("sparklegreenplus10energy", fx, fy, fz) + SpawnCEG("sparklegreen", fx, fy, fz) end return false end diff --git a/Units-Configs-Basedefs/basedefs/zaal/zarm_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zarm_basedef.lua index 9f65509f7..3527ddae7 100644 --- a/Units-Configs-Basedefs/basedefs/zaal/zarm_basedef.lua +++ b/Units-Configs-Basedefs/basedefs/zaal/zarm_basedef.lua @@ -18,7 +18,7 @@ unitDef = { canHover = false, canMove = false, canPatrol = false, - canreclaim = false, + canreclaim = true, canstop = true, category = "BUILDING", description = [[Provides Tech/Builds Construction Bugs]], diff --git a/Units-Configs-Basedefs/basedefs/zaal/zconstructor_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/zconstructor_basedef.lua index d23eedf66..fc8fe1c65 100644 --- a/Units-Configs-Basedefs/basedefs/zaal/zconstructor_basedef.lua +++ b/Units-Configs-Basedefs/basedefs/zaal/zconstructor_basedef.lua @@ -18,7 +18,7 @@ unitDef = { canHover = false, canMove = true, canPatrol = true, - canreclaim = false, + canreclaim = true, canstop = true, category = "LIGHT NOTAIR", description = [[Construction Bug]], diff --git a/Units-Configs-Basedefs/basedefs/zaal/ztenticle_basedef.lua b/Units-Configs-Basedefs/basedefs/zaal/ztenticle_basedef.lua index 9545bd82a..02ae7dd4e 100644 --- a/Units-Configs-Basedefs/basedefs/zaal/ztenticle_basedef.lua +++ b/Units-Configs-Basedefs/basedefs/zaal/ztenticle_basedef.lua @@ -18,7 +18,7 @@ unitDef = { canHover = false, canMove = false, canPatrol = false, - canreclaim = false, + canreclaim = true, canstop = true, category = "BUILDING", description = [[Builds Units]], diff --git a/Units/ecommanderbattle.lua b/Units/ecommanderbattle.lua index 8fd130651..c920721fe 100644 --- a/Units/ecommanderbattle.lua +++ b/Units/ecommanderbattle.lua @@ -45,7 +45,7 @@ local unitDef = { canGuard = true, canMove = true, canPatrol = true, - canreclaim = false, + canreclaim = true, canstop = true, category = "NOTAIR SUPPORT ARMORED", description = [[Experimental Assault Overseer]], diff --git a/Units/ecommanderbuild.lua b/Units/ecommanderbuild.lua index 6e15ff617..533e94fc3 100644 --- a/Units/ecommanderbuild.lua +++ b/Units/ecommanderbuild.lua @@ -41,7 +41,7 @@ local unitDef = { canGuard = true, canMove = true, canPatrol = true, - canreclaim = false, + canreclaim = true, canstop = true, category = "NOTAIR SUPPORT LIGHT", description = [[Builds Units x8 as fast]], diff --git a/Units/ecommandercloak.lua b/Units/ecommandercloak.lua index 7025ea5cf..8ebf3556e 100644 --- a/Units/ecommandercloak.lua +++ b/Units/ecommandercloak.lua @@ -41,7 +41,7 @@ local unitDef = { canGuard = true, canMove = true, canPatrol = true, - canreclaim = false, + canreclaim = true, canstop = true, category = "NOTAIR SUPPORT LIGHT", description = [[Provides Massive Cloak Field]], diff --git a/Units/ecommanderfactory.lua b/Units/ecommanderfactory.lua index 9a0ba055c..394559e95 100644 --- a/Units/ecommanderfactory.lua +++ b/Units/ecommanderfactory.lua @@ -41,7 +41,7 @@ local unitDef = { canGuard = true, canMove = true, canPatrol = true, - canreclaim = false, + canreclaim = true, canstop = true, category = "NOTAIR SUPPORT LIGHT", description = [[Creates buildings and mobile units • Gives ]] ..supplyGiven.. [[ Supply]], diff --git a/Units/ecommandershield.lua b/Units/ecommandershield.lua index b55f46259..48dee7a5c 100644 --- a/Units/ecommandershield.lua +++ b/Units/ecommandershield.lua @@ -45,7 +45,7 @@ local unitDef = { canGuard = true, canMove = true, canPatrol = true, - canreclaim = false, + canreclaim = true, canstop = true, category = "NOTAIR SUPPORT LIGHT", description = [[Provides large shielding • Self-Heals out of combat 40hp/s when idle]], diff --git a/modinfo.lua b/modinfo.lua index 6f07c78ea..3a800d498 100644 --- a/modinfo.lua +++ b/modinfo.lua @@ -13,7 +13,7 @@ return { name='Evolution RTS -', description='EvoRTS', shortname='EvoRTS', - version='v17.07', + version='dev', mutator='Official', game='Evolution RTS', shortGame='EvoRTS',