1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-09-16 09:06:21 +02:00

chrono pollution fix, biter command disabling nests

This commit is contained in:
hanakocz
2020-04-30 15:36:56 +02:00
parent 632dde2062
commit 3003f99aa2
3 changed files with 15 additions and 12 deletions

View File

@@ -232,7 +232,7 @@ function Public.chronojump(choice)
objective.lab_cells = {} objective.lab_cells = {}
objective.active_surface_index = game.create_surface("chronosphere" .. objective.chronojumps, Chrono.get_map_gen_settings()).index objective.active_surface_index = game.create_surface("chronosphere" .. objective.chronojumps, Chrono.get_map_gen_settings()).index
local surface = game.surfaces[objective.active_surface_index] local surface = game.surfaces[objective.active_surface_index]
log("seed of new surface: " .. surface.map_gen_settings.seed) --log("seed of new surface: " .. surface.map_gen_settings.seed)
local planet = objective.planet local planet = objective.planet
if choice then if choice then
Planets.determine_planet(choice) Planets.determine_planet(choice)
@@ -247,7 +247,7 @@ function Public.chronojump(choice)
game.delete_surface(oldsurface) game.delete_surface(oldsurface)
Chrono.post_jump() Chrono.post_jump()
Event_functions.flamer_nerfs() Event_functions.flamer_nerfs()
surface.pollute(objective.locomotive.position, 150 * (4 / (objective.upgrades[2] / 2 + 1)) * (1 + objective.chronojumps) * global.difficulty_vote_value) surface.pollute(objective.locomotive.position, 150 * (3 / (objective.upgrades[2] / 3 + 1)) * (1 + objective.chronojumps) * global.difficulty_vote_value)
::continue:: ::continue::
end end
@@ -305,14 +305,14 @@ local function tick()
objective.chronotimer = objective.chronotimer + 1 objective.chronotimer = objective.chronotimer + 1
objective.passivetimer = objective.passivetimer + 1 objective.passivetimer = objective.passivetimer + 1
if objective.chronojumps > 0 then if objective.chronojumps > 0 then
if objective.locomotive ~= nil then if objective.locomotive ~= nil then
local surface = game.surfaces[objective.active_surface_index] local surface = game.surfaces[objective.active_surface_index]
local pos = objective.locomotive.position or {x=0,y=0} local pos = objective.locomotive.position or {x=0,y=0}
if surface and surface.valid then if surface and surface.valid then
game.surfaces[objective.active_surface_index].pollute( game.surfaces[objective.active_surface_index].pollute(
pos, pos,
(0.5 * objective.chronojumps) * (0.5 * objective.chronojumps) *
(4 / (objective.upgrades[2] / 2 + 1)) * (3 / (objective.upgrades[2] / 3 + 1)) *
global.difficulty_vote_value) global.difficulty_vote_value)
end end
end end
@@ -320,8 +320,8 @@ local function tick()
if objective.planet[1].name.id == 19 then if objective.planet[1].name.id == 19 then
Tick_functions.dangertimer() Tick_functions.dangertimer()
end end
if Tick_functions.check_chronoprogress() then if Tick_functions.check_chronoprogress() then
Public.chronojump(nil) Public.chronojump(nil)
end end
end end
if tick % 120 == 0 then if tick % 120 == 0 then
@@ -595,4 +595,4 @@ end
-- end -- end
--}) --})
return Public return Public

View File

@@ -47,7 +47,7 @@ function Public_tick.charge_chronosphere()
if energy > 3010000 and objective.chronotimer < objective.chrononeeds - 182 and objective.chronotimer > 130 then if energy > 3010000 and objective.chronotimer < objective.chrononeeds - 182 and objective.chronotimer > 130 then
acus[i].energy = acus[i].energy - 3000000 acus[i].energy = acus[i].energy - 3000000
objective.chronotimer = objective.chronotimer + 1 objective.chronotimer = objective.chronotimer + 1
game.surfaces[objective.active_surface_index].pollute(objective.locomotive.position, (10 + 2 * objective.chronojumps) * (4 / (objective.upgrades[2] / 2 + 1)) * global.difficulty_vote_value) game.surfaces[objective.active_surface_index].pollute(objective.locomotive.position, (10 + 2 * objective.chronojumps) * (3 / (objective.upgrades[2] / 3 + 1)) * global.difficulty_vote_value)
end end
end end
end end

View File

@@ -7,6 +7,7 @@ global.biter_command.enabled = true
global.biter_command.whitelist = {} global.biter_command.whitelist = {}
global.biter_command.admin_mode = true --if only admins can see and use the panel global.biter_command.admin_mode = true --if only admins can see and use the panel
global.biter_command.teleporting = false --if teleporting is allowed for non-admins global.biter_command.teleporting = false --if teleporting is allowed for non-admins
global.biter_command.buildings = true ---if player can trigger building nests and worms
local worm_raffle = { local worm_raffle = {
"small-worm-turret", "small-worm-turret", "medium-worm-turret", "small-worm-turret", "small-worm-turret", "small-worm-turret", "medium-worm-turret", "small-worm-turret",
@@ -45,6 +46,7 @@ local function get_evo(force)
end end
local function place_nest_near_unit_group(group) local function place_nest_near_unit_group(group)
if not global.biter_command.buildings then return false end
if not group.members then return false end if not group.members then return false end
if #group.members < 5 then return false end if #group.members < 5 then return false end
local units = group.members local units = group.members
@@ -66,6 +68,7 @@ local function place_nest_near_unit_group(group)
end end
local function build_worm(group) local function build_worm(group)
if not global.biter_command.buildings then return false end
if not group.members then return false end if not group.members then return false end
if #group.members < 5 then return false end if #group.members < 5 then return false end
local units = group.members local units = group.members
@@ -227,7 +230,7 @@ local function settle(group, source_player)
flying_text(nil, 1, group.position, source_player) flying_text(nil, 1, group.position, source_player)
else else
flying_text(nil, 2, group.position, source_player) flying_text(nil, 2, group.position, source_player)
source_player.print("Settling new nest failed. Check if group has enough members(5+) and there is empty space.") source_player.print("Settling new nest failed. Check if group has enough members(5+) and there is empty space (or nests are disabled).")
end end
end end
@@ -237,7 +240,7 @@ local function siege(group, source_player)
flying_text(nil, 1, group.position, source_player) flying_text(nil, 1, group.position, source_player)
else else
flying_text(nil, 2, group.position, source_player) flying_text(nil, 2, group.position, source_player)
source_player.print("Making worm failed. Check if group has enough members(5+) and there is empty space.") source_player.print("Making worm failed. Check if group has enough members(5+) and there is empty space (or worms are disabled).")
end end
end end