Skip to content

Commit

Permalink
Make featuredefs code easier to read
Browse files Browse the repository at this point in the history
Fix an error in morph defs
  • Loading branch information
ForbodingAngel committed Jan 27, 2022
1 parent f0044ff commit ea968b2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
24 changes: 10 additions & 14 deletions Gamedata/featuredefs_post.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,19 @@ for name, fd in pairs(FeatureDefs) do
end

if fd["footprintz"] ~= nil and fd["footprintx"] ~= nil then
if(
(
tonumber(fd["footprintz"]) <= 8
or tonumber(fd["footprintx"]) <= 8
or string.lower(fd["category"]) == "vegitation"
or string.lower(fd["category"]) == "vegetation"
)
and (not fd["name"] or string.lower(fd["name"]) ~= "ammobox")
) then
if tonumber(fd["footprintz"]) <= 8
or tonumber(fd["footprintx"]) <= 8
or string.lower(fd["category"]) == "vegitation"
or string.lower(fd["category"]) == "vegetation" then

fd["blocking"] = false
if (not fd.customparams) then
fd.customparams = {}
fd.customparams = {}
end
if (not fd.customparams.provide_cover) then
fd.customparams.provide_cover = 1
-- Spring.Echo("Feature["..name.."] is providing cover!")
end

-- if (not fd.customparams.provide_cover) then
-- fd.customparams.provide_cover = 1
-- end
end
end

Expand Down
25 changes: 13 additions & 12 deletions Gamedata/morph_defs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ Overseer]],

ecommandercloak = {
{
into = 'ecommanderhealer',
time = timeToBuild_ecommanderhealer,
cmdname = [[Healer
Overseer]],
into = 'ecommanderhealer',
time = timeToBuild_ecommanderhealer,
cmdname = [[Healer
Overseer]],
energy = energyCost_ecommanderhealer,
metal = 0,
text = 'Evolve into Healer Overseer: Overseer has a very strong AOE heal in it\'s immediate vicinity.',
Expand Down Expand Up @@ -281,10 +281,10 @@ Overseer]],

ecommanderbuild = {
{
into = 'ecommanderhealer',
time = timeToBuild_ecommanderhealer,
cmdname = [[Healer
Overseer]],
into = 'ecommanderhealer',
time = timeToBuild_ecommanderhealer,
cmdname = [[Healer
Overseer]],
energy = energyCost_ecommanderhealer,
metal = 0,
text = 'Evolve into Healer Overseer: Overseer has a very strong AOE heal in it\'s immediate vicinity.',
Expand Down Expand Up @@ -329,10 +329,10 @@ Overseer]],

ecommanderfactory = {
{
into = 'ecommanderhealer',
time = timeToBuild_ecommanderhealer,
cmdname = [[Healer
Overseer]],
into = 'ecommanderhealer',
time = timeToBuild_ecommanderhealer,
cmdname = [[Healer
Overseer]],
energy = energyCost_ecommanderhealer,
metal = 0,
text = 'Evolve into Healer Overseer: Overseer has a very strong AOE heal in it\'s immediate vicinity.',
Expand Down Expand Up @@ -452,6 +452,7 @@ Overseer]],
metal = 0,
text = 'Evolve into Battle Overseer: Upgraded machinegun that does heavy damage to Light units and Buildings. No longer grants supply.',
require = [[tech2]],
},
{
into = 'ecommandercloak',
time = timeToBuild_ecommandercloak,
Expand Down

0 comments on commit ea968b2

Please sign in to comment.