mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-01 13:08:05 +02:00
chrono pollution fix, biter command disabling nests
This commit is contained in:
parent
632dde2062
commit
3003f99aa2
@ -232,7 +232,7 @@ function Public.chronojump(choice)
|
||||
objective.lab_cells = {}
|
||||
objective.active_surface_index = game.create_surface("chronosphere" .. objective.chronojumps, Chrono.get_map_gen_settings()).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
|
||||
if choice then
|
||||
Planets.determine_planet(choice)
|
||||
@ -247,7 +247,7 @@ function Public.chronojump(choice)
|
||||
game.delete_surface(oldsurface)
|
||||
Chrono.post_jump()
|
||||
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::
|
||||
end
|
||||
|
||||
@ -305,14 +305,14 @@ local function tick()
|
||||
objective.chronotimer = objective.chronotimer + 1
|
||||
objective.passivetimer = objective.passivetimer + 1
|
||||
if objective.chronojumps > 0 then
|
||||
if objective.locomotive ~= nil then
|
||||
if objective.locomotive ~= nil then
|
||||
local surface = game.surfaces[objective.active_surface_index]
|
||||
local pos = objective.locomotive.position or {x=0,y=0}
|
||||
if surface and surface.valid then
|
||||
game.surfaces[objective.active_surface_index].pollute(
|
||||
pos,
|
||||
(0.5 * objective.chronojumps) *
|
||||
(4 / (objective.upgrades[2] / 2 + 1)) *
|
||||
pos,
|
||||
(0.5 * objective.chronojumps) *
|
||||
(3 / (objective.upgrades[2] / 3 + 1)) *
|
||||
global.difficulty_vote_value)
|
||||
end
|
||||
end
|
||||
@ -320,8 +320,8 @@ local function tick()
|
||||
if objective.planet[1].name.id == 19 then
|
||||
Tick_functions.dangertimer()
|
||||
end
|
||||
if Tick_functions.check_chronoprogress() then
|
||||
Public.chronojump(nil)
|
||||
if Tick_functions.check_chronoprogress() then
|
||||
Public.chronojump(nil)
|
||||
end
|
||||
end
|
||||
if tick % 120 == 0 then
|
||||
@ -595,4 +595,4 @@ end
|
||||
-- end
|
||||
--})
|
||||
|
||||
return Public
|
||||
return Public
|
||||
|
@ -47,7 +47,7 @@ function Public_tick.charge_chronosphere()
|
||||
if energy > 3010000 and objective.chronotimer < objective.chrononeeds - 182 and objective.chronotimer > 130 then
|
||||
acus[i].energy = acus[i].energy - 3000000
|
||||
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
|
||||
|
@ -7,6 +7,7 @@ global.biter_command.enabled = true
|
||||
global.biter_command.whitelist = {}
|
||||
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.buildings = true ---if player can trigger building nests and worms
|
||||
|
||||
local worm_raffle = {
|
||||
"small-worm-turret", "small-worm-turret", "medium-worm-turret", "small-worm-turret",
|
||||
@ -45,6 +46,7 @@ local function get_evo(force)
|
||||
end
|
||||
|
||||
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 #group.members < 5 then return false end
|
||||
local units = group.members
|
||||
@ -66,6 +68,7 @@ local function place_nest_near_unit_group(group)
|
||||
end
|
||||
|
||||
local function build_worm(group)
|
||||
if not global.biter_command.buildings then return false end
|
||||
if not group.members then return false end
|
||||
if #group.members < 5 then return false end
|
||||
local units = group.members
|
||||
@ -227,7 +230,7 @@ local function settle(group, source_player)
|
||||
flying_text(nil, 1, group.position, source_player)
|
||||
else
|
||||
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
|
||||
|
||||
@ -237,7 +240,7 @@ local function siege(group, source_player)
|
||||
flying_text(nil, 1, group.position, source_player)
|
||||
else
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user