1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

FACTO-62: added point loss on unit death

This commit is contained in:
Aaron Veden 2022-02-20 15:12:55 -08:00
parent 89f8e9bb00
commit fb724480d7
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
5 changed files with 14 additions and 2 deletions

View File

@ -613,7 +613,7 @@ function upgrade.attempt(universe)
universe.proxyEntityLookup = {}
universe.vanillaEntityLookups = {}
game.print("Rampant - Version 2.2.0")
game.print("Rampant - Version 2.3.0")
end
return (starting ~= global.version) and global.version

View File

@ -50,6 +50,8 @@ local RETREAT_GRAB_RADIUS = constants.RETREAT_GRAB_RADIUS
local RETREAT_SPAWNER_GRAB_RADIUS = constants.RETREAT_SPAWNER_GRAB_RADIUS
local UNIT_DEATH_POINT_COST = constants.UNIT_DEATH_POINT_COST
-- imported functions
local addBasesToAllEnemyStructures = chunkUtils.addBasesToAllEnemyStructures
@ -403,6 +405,10 @@ local function onDeath(event)
end
map.lostEnemyUnits = map.lostEnemyUnits + 1
map.points = map.points - UNIT_DEATH_POINT_COST
if universe.aiPointsPrintSpendingToChat then
game.print(map.surface.name .. ": Points: -" .. UNIT_DEATH_POINT_COST .. ". [Unit Lost] Total: " .. string.format("%.2f", map.points))
end
if (universe.random() < universe.rallyThreshold) and not surface.peaceful_mode then
rallyUnits(chunk, map, tick)

View File

@ -1,7 +1,7 @@
{
"name" : "Rampant",
"factorio_version" : "1.1",
"version" : "2.2.0",
"version" : "2.3.0",
"title" : "Rampant",
"author" : "Veden",
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",

View File

@ -160,6 +160,10 @@ local function planning(map, evolution_factor, tick)
local currentPoints = map.points
if (currentPoints <= 0) then
currentPoints = 0
end
if (currentPoints < maxPoints) then
map.points = currentPoints + points
end

View File

@ -1580,6 +1580,8 @@ constants.HIVE_BUILDINGS_COST["spitter-spawner"] = constants.BASE_SPAWNER_UPGRAD
constants.HIVE_BUILDINGS_COST["biter-spawner"] = constants.BASE_SPAWNER_UPGRADE
constants.HIVE_BUILDINGS_COST["hive"] = constants.BASE_SPAWNER_UPGRADE * 2
constants.UNIT_DEATH_POINT_COST = 1
constants.MINIMUM_BUILDING_COST = constants.MAGIC_MAXIMUM_NUMBER
for _,cost in pairs(constants.HIVE_BUILDINGS_COST) do
if cost < constants.MINIMUM_BUILDING_COST then