Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into B-A-Legion
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharsy committed Dec 18, 2024
2 parents 8c9d981 + 6391780 commit 0c50e83
Show file tree
Hide file tree
Showing 104 changed files with 1,078 additions and 1,447 deletions.
13 changes: 13 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# December 2024
• [Impulse] Nukes + Plasma Cannons + Shiva + Catapult + Vanguard + Tzar + Fatboy + Banisher + Poison Arrow + Gunslinger + Ballistic Missile Launchers got impulse added to their weapon. High-HP units with low mass got a mass increase.
• [Tremor] Impulse 140% -> 80%, EdgeEffectiveness 90% -> 15%
• [Calamity + Raghnarok] +10% E/M cost, energycost and damage of individual shot increased, reloadtime increased (same dps as before), AoE lowered
• [Light Mine] Cloakcost 0.5 -> 1e/s, metalcost 5 -> 7, buildtime 50 -> 100
• [Medium Mine] Cloakcost 1 -> 2e/s, metalcost 16 -> 25, buildtime 100 -> 300, EdgeEffectiveness 0.7 -> 0.5, Impulse 1 -> 0.8
• [Heavy Mine] Cloakcost 1.5 -> 6e/s, metalcost 21 -> 50, buildtime 125 -> 700, EdgeEffectiveness 0.7 -> 0.5, Impulse 1 -> 0.8, damage 1390 -> 3000, AoE 300 -> 330
• [Crawling Bombs] Use bigger (self-d) explosion on attack command. Dying to enemy fire still results in small blast (including while being transported). Transportable.
• [Crawling Bombs death explosions] AoE 432 -> 400, damage 3350 -> 2700, damage vs Crawlling Bombs 220 -> 400 (chain easier)
• [Roach] Speed 81 -> 76
• [Skuttle] Metalcost 540 -> 755, energycost 26 000 -> 27 000, cloakcost 150 -> 15, cloakcost moving 400 -> 40
• [Destroyers] Depthcharge turnrate increased -> hits crawling bombs reliably

# October 2024
• [All units] EMP resist for units is standardized, and units that had low emp resists now take full emp damage. Units that had between 50-95% emp resist now all have 80% emp resist. Units that had 95+% emp resist are now fully emp immune.
• [New units] Heavy T1 air transport for arm (Osprey) and for cor (Hephastus) moved to the basegame. These transports can carry the same weight as T2 transports but at a lower movespeed, and are able to transport the commander. Osprey costs 190m 4000E, has 110 speed, and 630 health. Hephaestus costs 190m 4000E, has 100 speed, and 800 health.
Expand Down
40 changes: 8 additions & 32 deletions gamedata/alldefs_post.lua
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,14 @@ function UnitDef_Post(name, uDef)
uDef.collide = false
end
end

if uDef.metalcost and uDef.health and uDef.canmove == true and uDef.mass == nil then
local healthmass = math.ceil(uDef.health/6)
uDef.mass = math.max(uDef.metalcost, healthmass)
--if uDef.metalcost < healthmass then
-- Spring.Echo(name, uDef.mass, uDef.metalcost, uDef.mass - uDef.metalcost)
--end
end

--Juno Rework
if modOptions.junorework == true then
Expand Down Expand Up @@ -1406,38 +1414,6 @@ function WeaponDef_Post(name, wDef)
end
end

if modOptions.proposed_unit_reworks then
if name == 'mine_heavy' then
wDef.damage.default = 3000
wDef.edgeeffectiveness = 0.5
wDef.impulsefactor = 0.8
end
if name == 'mine_medium' then
wDef.edgeeffectiveness = 0.5
wDef.impulsefactor = 0.8
end
if name == 'corsktlSelfd' then
--wDef.damage.hvyboats = wDef.damage.default
--wDef.damage.lboats = wDef.damage.default
wDef.damage.crawlingbombs = 400
end
if name == 'crawl_blast' then
wDef.damage.default = 2700
wDef.damage.commanders = 1000
--wDef.damage.hvyboats = wDef.damage.default
--wDef.damage.lboats = wDef.damage.default
wDef.damage.crawlingbombs = 400
wDef.edgeeffectiveness = 0.35
wDef.areaofeffect = 410
end
if name == 'crawl_blastsml' then
wDef.damage.crawlingbombs = 400
wDef.edgeeffectiveness = 0.35
end

end


----EMP rework

if modOptions.emprework then
Expand Down
10 changes: 5 additions & 5 deletions gamedata/movedefs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ local moveDatas = {
-- armvang corkarg corthermite
HTBOT4 = {
crushstrength = 252,
footprintx = 4,
footprintz = 4,
footprintx = 6,
footprintz = 6,
maxslope = 80,
maxwaterdepth = 22,
depthModParams = {
Expand All @@ -342,10 +342,10 @@ local moveDatas = {
maxwaterslope = 30,
},
-- corjugg
HBOT5 = {
HBOT7 = {
crushstrength = 1400,
footprintx = 5,
footprintz = 5,
footprintx = 7,
footprintz = 7,
maxslope = 36,
maxwaterdepth = 30,
depthModParams = {
Expand Down
13 changes: 13 additions & 0 deletions luarules/configs/critters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,19 @@ local critterConfig = {
{ spawnCircle = { x = 4300, z = 8000, r = 2000 }, unitNames = { ["critter_ant"] = rnd(3, 10) } },
},

["supreme isthmus winter"] = {
{ spawnCircle = { x = 3500, z = 8500, r = 400 }, unitNames = { ["critter_penguin"] = rnd(2, 4) } },
{ spawnCircle = { x = 8800, z = 3800, r = 400 }, unitNames = { ["critter_penguin"] = rnd(2, 4) } },
{ spawnCircle = { x = 990, z = 1900, r = 400 }, unitNames = { ["critter_penguin"] = rnd(3, 5) } },
{ spawnCircle = { x = 11000, z = 10000, r = 400 }, unitNames = { ["critter_penguin"] = rnd(3, 5) } },
{ spawnCircle = { x = 6200, z = 300, r = 400 }, unitNames = { ["critter_penguin"] = rnd(2, 4) } },
{ spawnCircle = { x = 6000, z = 12000, r = 400 }, unitNames = { ["critter_penguin"] = rnd(2, 4) } },
{ spawnCircle = { x = 5500, z = 6400, r = 400 }, unitNames = { ["critter_penguin"] = rnd(2, 4) } },
{ spawnCircle = { x = 6600, z = 6200, r = 400 }, unitNames = { ["critter_penguin"] = rnd(2, 4) } },
{ spawnCircle = { x = 4000, z = 4800, r = 400 }, unitNames = { ["critter_penguin"] = rnd(2, 4) } },
{ spawnCircle = { x = 11800, z = 7300, r = 400 }, unitNames = { ["critter_penguin"] = rnd(2, 4) } },
},

["supreme battlefield"] = {
{ spawnCircle = { x = 11500, z = 12500, r = 2700 }, unitNames = { ["critter_goldfish"] = rnd(3, 10) } },
{ spawnCircle = { x = 15000, z = 10500, r = 300 }, unitNames = { ["critter_goldfish"] = rnd(0, 3) } },
Expand Down
2 changes: 2 additions & 0 deletions luarules/gadgets/ai_namer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ if gadgetHandler:IsSyncedCode() then
"hihoman23",
"Hobo Joe",
"hokomoko",
"Mr. Bob",
"Honkwaddle",
"Hornet",
"IceXuick",
Expand Down Expand Up @@ -170,6 +171,7 @@ if gadgetHandler:IsSyncedCode() then
"rous",
"Rikerss", --Merch $20+
"Sovgut", --Tourney prize $50
"Shadowisperke",
"Spanker",
"SuperMadmax",
"sversuge",
Expand Down
77 changes: 77 additions & 0 deletions luarules/gadgets/dbg_test_env_helper.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
function gadget:GetInfo()
return {
name = "Test Environment Helper",
desc = "Helper to setup test environment conditions",
license = "GNU GPL, v2 or later",
layer = 9999,
handler = true,
enabled = true,
}
end

local ENABLED_RULES_PARAM = 'isTestEnvironmentHelperEnabled'

if not Spring.Utilities.IsDevMode() or not Spring.Utilities.Gametype.IsSinglePlayer() then
return
end

if gadgetHandler:IsSyncedCode() then

local removeGadgets = {'Team Com Ends', 'Game End'}

Spring.SetGameRulesParam(ENABLED_RULES_PARAM, true)

local function SetTestEndConditionsCmd(cmd, line, words, playerID)
if not Spring.IsCheatingEnabled() then
return
end
for _, gadgetName in pairs(removeGadgets) do
local g = gadgetHandler:FindGadget(gadgetName)
gadgetHandler:RemoveGadget(g)
end

Spring.SetGameRulesParam("testEndConditionsOverride", true)
end

local function SetTestReadyPlayersCmd(cmd, line, words, playerID)
if not Spring.IsCheatingEnabled() then
return
end
local playerList = Spring.GetPlayerList()
for _, playerID in pairs(playerList) do
Spring.SetGameRulesParam("player_" .. playerID .. "_readyState", 1)
end
end

function gadget:Initialize()
gadgetHandler.actionHandler.AddChatAction(gadget, 'setTestEndConditions', SetTestEndConditionsCmd)
gadgetHandler.actionHandler.AddChatAction(gadget, 'setTestReadyPlayers', SetTestReadyPlayersCmd)
if Spring.GetGameRulesParam("testEndConditionsOverride") then
SetTestEndConditionsCmd()
end
end

function gadget:Shutdown()
gadgetHandler.actionHandler.RemoveChatAction(gadget, 'setTestEndConditions')
gadgetHandler.actionHandler.RemoveChatAction(gadget, 'setTestReadyPlayers')
Spring.SetGameRulesParam(ENABLED_RULES_PARAM, false)
end

function gadget:RecvLuaMsg(msg, playerID)
if msg == 'testEnvironmentStarting' then
Spring.SetGameRulesParam('testEnvironmentStarting', true)
gadgetHandler:RemoveGadgetCallIn('RecvLuaMsg', self)
end
end
else
-- taken from gui_pregameui.lua, check there for more information
local NETMSG_STARTPLAYING = 4
local SYSTEM_ID = -1

function gadget:Update(n)
if (Spring.GetPlayerTraffic(SYSTEM_ID, NETMSG_STARTPLAYING) or 0) > 0 then
Spring.SendLuaRulesMsg('testEnvironmentStarting')
gadgetHandler:RemoveGadget(self)
end
end
end
6 changes: 3 additions & 3 deletions luarules/gadgets/gaia_critters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ end
local removeCritters = true -- gradually remove critters when unitcont gets higher
local addCrittersAgain = true -- re-add the removed critters again

local minTotalUnits = 1600 -- starting removing critters at this total unit count
local maxTotalunits = 3200 -- finished removing critters at this total unit count
local minimumCritters = 0.15 -- dont remove further than (0.1 == 10%) of critters
local minTotalUnits = 3000 -- starting removing critters at this total unit count
local maxTotalunits = 6000 -- finished removing critters at this total unit count
local minimumCritters = 0.2 -- dont remove further than (0.1 == 10%) of critters
local minCritters = math.ceil((Game.mapSizeX*Game.mapSizeZ)/6000000) -- dont remove below this amount
local companionRadiusStart = 140 -- if mapcritter is spawned this close it will be converted to companion critter
local companionRadiusAfterStart = 13
Expand Down
34 changes: 2 additions & 32 deletions luarules/gadgets/game_energy_conversion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,10 @@ function gadget:GetInfo()
}
end

----------------------------------------------------------------
-- Synced only
----------------------------------------------------------------
if not gadgetHandler:IsSyncedCode() then
return false
end

----------------------------------------------------------------
-- Config
----------------------------------------------------------------

-- gather all metalmaker units
local convertCapacities = {}
for unitDefID, unitDef in pairs(UnitDefs) do
Expand All @@ -34,7 +27,6 @@ local alterLevelRegex = '^' .. string.char(137) .. '(%d+)$'
local mmLevelParamName = 'mmLevel'
local mmCapacityParamName = 'mmCapacity'
local mmUseParamName = 'mmUse'
local mmAvgEfficiencyParamName = 'mmAvgEfficiency'
local mmAvgEffiParamName = 'mmAvgEffi'
local function SetMMRulesParams()
-- make convertCapacities accessible to all
Expand All @@ -54,39 +46,27 @@ local resourceUpdatesPerGameSec = frameRate / resourceRefreshRate

local currentFrameStamp = 0

----------------------------------------------------------------
-- Vars
----------------------------------------------------------------
local teamList = {}
local teamCapacities = {}
local teamUsages = {}
local teamMMList = {}
local teamEfficiencies = {}
local eSteps = {}
local teamActiveMM = {}
local lastPost = {}
local splitMMPointer = 1
local splitMMUpdate = -1
----------------------------------------------------------------
-- Constant
----------------------------------------------------------------

local paralysisRelRate = 75 -- unit HP / paralysisRelRate = paralysis dmg drop rate per slowupdate

----------------------------------------------------------------
-- Speedups
----------------------------------------------------------------

local spGetPlayerInfo = Spring.GetPlayerInfo
local spGetTeamRulesParam = Spring.GetTeamRulesParam
local spSetTeamRulesParam = Spring.SetTeamRulesParam
local spGetTeamResources = Spring.GetTeamResources
local spUseTeamResource = Spring.UseTeamResource
local spAddTeamResource = Spring.AddTeamResource
local spGetUnitHealth = Spring.GetUnitHealth
local spGetUnitTeam = Spring.GetUnitTeam
local spGetUnitDefID = Spring.GetUnitDefID
local spAddUnitResource = Spring.AddUnitResource
local spUseUnitResource = Spring.UseUnitResource
local spSetUnitResourcing = Spring.SetUnitResourcing

----------------------------------------------------------------
Expand Down Expand Up @@ -118,8 +98,6 @@ local function updateUnitConversion(unitID, amount, e)
end

local function UpdateMetalMakers(teamID, energyUse)
local totalTeamEnergyUse = 0

for j = 1, #eSteps do
for unitID, defs in pairs(teamMMList[teamID][eSteps[j]]) do
if defs.built then
Expand Down Expand Up @@ -180,14 +158,12 @@ end
-- EmpedVector Methods
----------------------------------------------------------------
local EmpedVector = { unitBuffer = {} }
--local tableInsert = table.insert

function EmpedVector:push(uID, frameID)
if self.unitBuffer[uID] then
self.unitBuffer[uID] = frameID
else
self.unitBuffer[uID] = frameID
--tableInsert(self.unitBuffer, uID, frameID)
UnitParalysed(uID, spGetUnitDefID(uID), spGetUnitTeam(uID))
end
end
Expand All @@ -196,7 +172,6 @@ function EmpedVector:process(currentFrame)
for uID, frameID in pairs(self.unitBuffer) do
if currentFrame >= frameID then
UnitParalysisOver(uID, spGetUnitDefID(uID), spGetUnitTeam(uID))

self.unitBuffer[uID] = nil
end
end
Expand Down Expand Up @@ -242,7 +217,6 @@ end
function gadget:Initialize()
SetMMRulesParams()
BuildeSteps()
local i = 1
teamList = Spring.GetTeamList()
for i = 1, #teamList do
local tID = teamList[i]
Expand All @@ -251,20 +225,16 @@ function gadget:Initialize()
teamEfficiencies[tID]:init(tID)
teamMMList[tID] = {}
teamActiveMM[tID] = 0
lastPost[tID] = 0
for j = 1, #eSteps do
teamCapacities[tID][eSteps[j]] = 0
teamMMList[tID][eSteps[j]] = {}
end
teamUsages[tID] = 0
spSetTeamRulesParam(tID, mmLevelParamName, 0.75)
spSetTeamRulesParam(tID, mmCapacityParamName, 0)
spSetTeamRulesParam(tID, mmUseParamName, 0)
spSetTeamRulesParam(tID, mmAvgEffiParamName, teamEfficiencies[tID]:avg())

end

splitMMUpdate = math.floor(math.max((frameRate / #teamList), 1))
end

function BuildeSteps()
Expand Down Expand Up @@ -306,7 +276,7 @@ function gadget:GameFrame(n)

local eCur, eStor = spGetTeamResources(tID, 'energy')
local convertAmount = eCur - eStor * spGetTeamRulesParam(tID, mmLevelParamName)
local eConvert, mConvert, eConverted, mConverted, teamUsages = 0, 0, 0, 0, 0
local _, _, eConverted, mConverted, teamUsages = 0, 0, 0, 0, 0

for j = 1, #eSteps do
if teamCapacities[tID][eSteps[j]] > 1 then
Expand Down
Loading

0 comments on commit 0c50e83

Please sign in to comment.