Skip to content

Commit

Permalink
Fix sqrt of mapsize in metal spot placer
Browse files Browse the repository at this point in the history
change deployed hbot forms so that they get 33% damage boost when deployed
remove range boost from deployed hbots
Shrink size of fission powerplant and zaal supply buildings
Remove arbitrary energy cost from tech 1 building
Increase mine damage so that it will 1shot most t1 units
Reduce energy usage for morphs back to 10 (where it used to be)
Reduce damage boosts vs armortypes to +50% instead of +100%
Fix tooltip display of damages
  • Loading branch information
ForbodingAngel committed May 18, 2021
1 parent 2ed3a77 commit 0892162
Show file tree
Hide file tree
Showing 26 changed files with 153 additions and 126 deletions.
42 changes: 24 additions & 18 deletions Gamedata/configs/damageTypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,80 @@ local damageClasses = {
-- classes with armor classes for weapons
damageTypes = {
light = {
LIGHT = 2,
LIGHT = 1.5,
ARMORED = 1,
BUILDING = 1,
AIR = 1,
},
turretantilight = {
LIGHT = 2,
LIGHT = 1.5,
ARMORED = 1,
BUILDING = 0.1,
AIR = 1,
},
turretantiarmored = {
LIGHT = 1,
ARMORED = 2,
ARMORED = 1.5,
BUILDING = 0.1,
AIR = 1,
},
antiarmored = {
LIGHT = 1,
ARMORED = 2,
ARMORED = 1.5,
BUILDING = 1,
AIR = 1,
},
antibuilding = {
LIGHT = 1,
ARMORED = 1,
BUILDING = 2,
BUILDING = 1.5,
AIR = 1,
},
antibuildingarty = {
LIGHT = 0.25,
ARMORED = 0.25,
BUILDING = 1.5,
AIR = 0.25,
},
antiair = {
LIGHT = 1,
ARMORED = 1,
BUILDING = 1,
AIR = 2,
AIR = 1.5,
},
antilightarmored = {
LIGHT = 2,
ARMORED = 2,
LIGHT = 1.5,
ARMORED = 1.5,
BUILDING = 1,
AIR = 1,
},
antilightbuilding = {
LIGHT = 2,
LIGHT = 1.5,
ARMORED = 1,
BUILDING = 2,
BUILDING = 1.5,
AIR = 1,
},
antiarmoredbuilding = {
LIGHT = 1,
ARMORED = 2,
BUILDING = 2,
ARMORED = 1.5,
BUILDING = 1.5,
AIR = 1,
},
antibuildingair = {
LIGHT = 1,
ARMORED = 1,
BUILDING = 2,
AIR = 2,
BUILDING = 1.5,
AIR = 1.5,
},
antiarmoredair = {
LIGHT = 1,
ARMORED = 2,
ARMORED = 1.5,
BUILDING = 1,
AIR = 2,
AIR = 1.5,
},
turretantilightarmored = {
LIGHT = 2,
ARMORED = 2,
LIGHT = 1.5,
ARMORED = 1.5,
BUILDING = 0.1,
AIR = 1,
},
Expand Down
74 changes: 37 additions & 37 deletions Gamedata/morph_defs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,38 @@ local morphDefs = { --beginig of morphDefs

local devolution = (-1 > 0)

local energyCost_ecommander = 200
local timeToBuild_ecommander = energyCost_ecommander * 0.05
local energyCost_ecommander = 100
local timeToBuild_ecommander = energyCost_ecommander * 0.10

local energyCost_ecommandercloak = 200
local timeToBuild_ecommandercloak = energyCost_ecommandercloak * 0.05
local energyCost_ecommandercloak = 100
local timeToBuild_ecommandercloak = energyCost_ecommandercloak * 0.10

local energyCost_ecommandershield = 200
local timeToBuild_ecommandershield = energyCost_ecommandershield * 0.05
local energyCost_ecommandershield = 100
local timeToBuild_ecommandershield = energyCost_ecommandershield * 0.10

local energyCost_ecommanderbuild = 200
local timeToBuild_ecommanderbuild = energyCost_ecommanderbuild * 0.05
local energyCost_ecommanderbuild = 100
local timeToBuild_ecommanderbuild = energyCost_ecommanderbuild * 0.10

local energyCost_ecommanderfactory = 200
local timeToBuild_ecommanderfactory = energyCost_ecommanderfactory * 0.05
local energyCost_ecommanderfactory = 100
local timeToBuild_ecommanderfactory = energyCost_ecommanderfactory * 0.10

local energyCost_ecommanderbattle = 6000
local timeToBuild_ecommanderbattle = energyCost_ecommanderbattle * 0.05
local energyCost_ecommanderbattle = 3000
local timeToBuild_ecommanderbattle = energyCost_ecommanderbattle * 0.10

local energyCost_ecommandermeteor = 12000
local timeToBuild_ecommandermeteor = energyCost_ecommandermeteor * 0.025
local energyCost_ecommandermeteor = 6000
local timeToBuild_ecommandermeteor = energyCost_ecommandermeteor * 0.10

local energyCost_eradar2_up1 = 1800
local timeToBuild_eradar2_up1 = energyCost_eradar2_up1 * 0.05
local energyCost_eradar2_up1 = 450
local timeToBuild_eradar2_up1 = energyCost_eradar2_up1 * 0.10

local energyCost_factory_up1 = 1200
local timeToBuild_factory_up1 = energyCost_factory_up1 * 0.05
local energyCost_factory_up1 = 600
local timeToBuild_factory_up1 = energyCost_factory_up1 * 0.10

local energyCost_etech2 = 1200
local timeToBuild_etech2 = energyCost_etech2 * 0.05
local energyCost_etech2 = 600
local timeToBuild_etech2 = energyCost_etech2 * 0.10

local energyCost_etech3 = 4000
local timeToBuild_etech3 = energyCost_etech3 * 0.05
local energyCost_etech3 = 2000
local timeToBuild_etech3 = energyCost_etech3 * 0.10

local energyCost_zarmtech1 = 300
local timeToBuild_zarmtech1 = energyCost_zarmtech1 * 0.10
Expand All @@ -71,38 +71,38 @@ local timeToBuild_zespire4 = energyCost_zespire4 * 0.10
local energyCost_zespire5 = 200
local timeToBuild_zespire5 = energyCost_zespire5 * 0.10

local energyCost_elightturret2 = 150
local timeToBuild_elightturret2 = energyCost_elightturret2 * 0.05
local energyCost_elightturret2 = 75
local timeToBuild_elightturret2 = energyCost_elightturret2 * 0.10

local energyCost_eheavyturret2 = 250
local timeToBuild_eheavyturret2 = energyCost_eheavyturret2 * 0.05
local energyCost_eheavyturret2 = 125
local timeToBuild_eheavyturret2 = energyCost_eheavyturret2 * 0.10

local energyCost_euwturret = 100
local timeToBuild_euwturret = energyCost_euwturret * 0.05
local energyCost_euwturret = 50
local timeToBuild_euwturret = energyCost_euwturret * 0.10

local energyCost_emetalextractor_up1 = 1200
local timeToBuild_emetalextractor_up1 = energyCost_emetalextractor_up1 * 0.05
local energyCost_emetalextractor_up1 = 600
local timeToBuild_emetalextractor_up1 = energyCost_emetalextractor_up1 * 0.10

local energyCost_zmex_up1 = 1200
local timeToBuild_zmex_up1 = energyCost_zmex_up1 * 0.10

local energyCost_xmetalextractor = 1200
local timeToBuild_xmetalextractor = energyCost_xmetalextractor * 0.05
local timeToBuild_xmetalextractor = energyCost_xmetalextractor * 0.10

local energyCost_eorb = 300
local timeToBuild_eorb = energyCost_eorb * 0.05
local energyCost_eorb = 150
local timeToBuild_eorb = energyCost_eorb * 0.10

local energyCost_eartyturret = 800
local timeToBuild_eartyturret = energyCost_eartyturret * 0.05
local energyCost_eartyturret = 400
local timeToBuild_eartyturret = energyCost_eartyturret * 0.10

local energyCost_ehbotturret = 0
local timeToBuild_ehbotturret = 2

local energyCost_ehbot = 0
local timeToBuild_ehbot = 10

local energyCost_eartytanksauration = 300
local timeToBuild_eartytanksauration = energyCost_eartytanksauration * 0.05
local energyCost_eartytanksauration = 150
local timeToBuild_eartytanksauration = energyCost_eartytanksauration * 0.10

local energyCost_kargannethturret = 0
local timeToBuild_kargannethturret = 2
Expand Down
28 changes: 20 additions & 8 deletions LuaRules/Configs/MetalSpots/defaultLayout.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
--math.randomseed(Game.GameID) -- This only works in 104+
math.random(); math.random(); math.random()
local mapx, mapz = Game.mapSizeX * 0.5, Game.mapSizeZ * 0.5
-- Params

-- Lets sq root the map size into a digestable number for later. We're doing some math here to account for the fact that spring does not work with add numbers. Only even ones. So, for that reason we cant to get the square root in numbers that comport to how we normally thing about maps. For example, a 16 x 16 map sqrt is 256, so that is our basis.

local mapWidthX = (Game.mapSizeX * 2) / 1024
local mapLengthZ = (Game.mapSizeZ * 2) / 1024
local mapSQRT = mapWidthX * mapLengthZ

-- Params
local size = math.max(mapx, mapz)

--
Spring.Echo("[Default Mex Layout] Map size is: " .. size)
Spring.Echo("[Default Mex Layout] Map square root size is: " .. mapSQRT)
local count = #Spring.GetTeamList() - 1
local allycount = #Spring.GetAllyTeamList() - 1
-- for i = 1, #players do
Expand Down Expand Up @@ -256,20 +263,25 @@ if mexRandomLayout == "standard" then
elseif teamIDCount > 6 then
mexSpotsPerSide = 50
end
local mapSize = size * 2

if mapSize >= 14336 then -- An exception for 28x28 maps
if mapSQRT >= 784 then -- An exception for 28x28 maps
mexSpotsPerSide = mexSpotsPerSide * 2
elseif mapSize >= 12288 then -- An exception for 24x24 maps
Spring.Echo("[Default Mex Layout] Map Square Root size is " .. mapSQRT .. " with a teamIDCount of " .. teamIDCount.. ". Placing " .. mexSpotsPerSide .. " mex points per quadrant (This is usually rounded up to the next whole number).")
elseif mapSQRT >= 576 then -- An exception for 24x24 maps
mexSpotsPerSide = mexSpotsPerSide * 1.75
elseif mapSize >= 10240 then -- An exception for 20x20 maps
Spring.Echo("[Default Mex Layout] Map Square Root size is " .. mapSQRT .. " with a teamIDCount of " .. teamIDCount.. ". Placing " .. mexSpotsPerSide .. " mex points per quadrant (This is usually rounded up to the next whole number).")
elseif mapSQRT >= 400 then -- An exception for 20x20 maps
mexSpotsPerSide = mexSpotsPerSide * 1.5
elseif mapSize >= 8192 then -- An exception for 16x16 maps
Spring.Echo("[Default Mex Layout] Map Square Root size is " .. mapSQRT .. " with a teamIDCount of " .. teamIDCount.. ". Placing " .. mexSpotsPerSide .. " mex points per quadrant (This is usually rounded up to the next whole number).")
elseif mapSQRT >= 256 then -- An exception for 16x16 maps
mexSpotsPerSide = mexSpotsPerSide * 1
elseif mapSize >= 7168 then -- An exception for 14x14 maps
Spring.Echo("[Default Mex Layout] Map Square Root size is " .. mapSQRT .. " with a teamIDCount of " .. teamIDCount.. ". Placing " .. mexSpotsPerSide .. " mex points per quadrant (This is usually rounded up to the next whole number).")
elseif mapSQRT >= 196 then -- An exception for 14x14 maps
mexSpotsPerSide = mexSpotsPerSide * 0.75
elseif mapSize >= 6144 then -- An exception for 12x12 and smaller maps
Spring.Echo("[Default Mex Layout] Map Square Root size is " .. mapSQRT .. " with a teamIDCount of " .. teamIDCount.. ". Placing " .. mexSpotsPerSide .. " mex points per quadrant (This is usually rounded up to the next whole number).")
elseif mapSQRT >= 144 then -- An exception for 12x12 and smaller maps
mexSpotsPerSide = mexSpotsPerSide * 0.5
Spring.Echo("[Default Mex Layout] Map Square Root size is " .. mapSQRT .. " with a teamIDCount of " .. teamIDCount.. ". Placing " .. mexSpotsPerSide .. " mex points per quadrant (This is usually rounded up to the next whole number).")
end

randomMirrored = true
Expand Down
2 changes: 1 addition & 1 deletion LuaUI/Widgets_Evo/gui_evo_tooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function GetTooltipWeaponData(ud)
local AOE = weap.damageAreaOfEffect


NewTooltip = NewTooltip.."\n\255\255\255\255"..weap.description.." "..actionStr.." (x2 vs "..damagetype..") AoE: "..AOE.."(r) Range: "..FormatNbr(range,2)
NewTooltip = NewTooltip.."\n\255\255\255\255"..weap.description.." "..actionStr.." (+50% vs "..damagetype..") AoE: "..AOE.."(r) Range: "..FormatNbr(range,2)

if energyPerSecond > 0 then
NewTooltip = NewTooltip.." \255\255\255\0E/s: "..FormatNbr(energyPerSecond,1)
Expand Down
Binary file added Objects3D/epowerplant3x3.s3o
Binary file not shown.
Binary file added Objects3D/zaal/ztiberium_small.s3o
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ unitDef = {
weapons = {
[1] = {
def = "assaulttankcannon",
badTargetCategory = "VTOL LIGHT ARMORED BIO",
},
},
customParams = {
Expand Down Expand Up @@ -142,7 +143,7 @@ weaponDefs = {
weaponVelocity = 1000,
customparams = {
isupgraded = isUpgraded,
damagetype = "antibuilding",
damagetype = "antibuildingarty",
},
damage = {
default = 150,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,34 +162,37 @@ weaponDefs = {
},

riottankshotgun = {
AreaOfEffect = 250,
AreaOfEffect = 75,
avoidFriendly = false,
avoidFeature = false,
collideFriendly = false,
collideFeature = false,
burst = 5,
burstrate = 0.2,
--burstrate = 0.2,
--burst = 5,

cegTag = "bruisercannon",
explosionGenerator = "custom:genericshellexplosion-medium",
edgeeffectiveness = 1,
explosionGenerator = "custom:genericshellexplosion-small",
energypershot = 0,
interceptedByShieldType = 4,
impulseFactor = 0,
name = "Shotgun",
--projectiles = 10,
noSelfDamage = true,
projectiles = 5,
range = 500,
reloadtime = 5,
reloadtime = 1.5,
sprayangle = 2000,
size = 2,
weaponType = "Cannon",
soundHit = "explosions/mediumcannonhit.wav",
soundStart = "weapons/Shotgun Boom 103.wav",
--sprayangle = 2000,

turret = true,
weaponVelocity = 400,
customparams = {
isupgraded = isUpgraded,
damagetype = "light",
nofriendlyfire = true,
},
damage = {
default = 30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ unitDef = {
weapons = {
[1] = {
def = "assimilatorbeamweapon",
badTargetCategory = "VTOL LIGHT ARMORED BIO",
},
},
customParams = {
Expand Down Expand Up @@ -131,7 +132,7 @@ weaponDefs = {
waterweapon = true,
customparams = {
isupgraded = isUpgraded,
damagetype = "antibuilding",
damagetype = "antibuildingarty",
},
damage = {
default = 100,
Expand Down
Loading

0 comments on commit 0892162

Please sign in to comment.