You've already forked ComfyFactorio
mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-09-16 09:06:21 +02:00
update
This commit is contained in:
@@ -77,7 +77,6 @@ require "modules.floaty_chat"
|
||||
--require "maps.rocky_waste"
|
||||
--require "maps.labyrinth"
|
||||
--require "maps.junkyard"
|
||||
--require "maps.rocky_junkyard"
|
||||
--require "maps.spooky_forest"
|
||||
--require "maps.mixed_railworld"
|
||||
--require "maps.nightfall"
|
||||
|
@@ -6,7 +6,7 @@ function locomotive_spawn(surface, position)
|
||||
global.locomotive.get_inventory(defines.inventory.fuel).insert({name = "wood", count = 100})
|
||||
|
||||
global.locomotive_cargo = surface.create_entity({name = "cargo-wagon", position = {position.x, position.y + 3}, force = "player"})
|
||||
global.locomotive_cargo.get_inventory(defines.inventory.cargo_wagon).insert({name = "raw-fish", count = 4000})
|
||||
global.locomotive_cargo.get_inventory(defines.inventory.cargo_wagon).insert({name = "raw-fish", count = 8})
|
||||
|
||||
global.locomotive.color = {0, 255, 0}
|
||||
global.locomotive.minable = false
|
||||
@@ -37,7 +37,7 @@ end
|
||||
local function set_player_spawn_and_refill_fish()
|
||||
if not global.locomotive_cargo then return end
|
||||
if not global.locomotive_cargo.valid then return end
|
||||
global.locomotive_cargo.get_inventory(defines.inventory.cargo_wagon).insert({name = "raw-fish", count = 4000})
|
||||
global.locomotive_cargo.get_inventory(defines.inventory.cargo_wagon).insert({name = "raw-fish", count = 8})
|
||||
local position = global.locomotive_cargo.surface.find_non_colliding_position("stone-furnace", global.locomotive_cargo.position, 16, 2)
|
||||
if not position then return end
|
||||
game.forces.player.set_spawn_position({x = position.x, y = position.y}, global.locomotive_cargo.surface)
|
||||
|
@@ -96,7 +96,9 @@ function reset_map()
|
||||
global.wave_defense.surface = global.active_surface
|
||||
global.wave_defense.target = global.locomotive_cargo
|
||||
|
||||
if global.rpg then rpg_reset_all_players() end
|
||||
global.wave_defense.wave_interval = 1500
|
||||
|
||||
rpg_reset_all_players()
|
||||
end
|
||||
|
||||
local function protect_train(event)
|
||||
|
@@ -278,5 +278,5 @@ local function on_chunk_generated(event)
|
||||
end
|
||||
|
||||
local event = require 'utils.event'
|
||||
event.on_nth_tick(1, process_chunk_queue)
|
||||
event.on_nth_tick(6, process_chunk_queue)
|
||||
event.add(defines.events.on_chunk_generated, on_chunk_generated)
|
@@ -365,7 +365,7 @@ function reset_wave_defense()
|
||||
unit_groups = {},
|
||||
unit_group_last_command = {},
|
||||
unit_group_command_delay = 3600 * 5,
|
||||
unit_group_command_step_length = 64,
|
||||
unit_group_command_step_length = 48,
|
||||
max_group_size = 256,
|
||||
max_active_unit_groups = 8,
|
||||
max_active_biters = 1280,
|
||||
@@ -383,10 +383,10 @@ function reset_wave_defense()
|
||||
threat = 0,
|
||||
simple_entity_shredding_count_modifier = 0.0003,
|
||||
simple_entity_shredding_cost_modifier = 0.01, --threat cost for one health
|
||||
nest_building_density = 16, --lower values = more dense building
|
||||
nest_building_chance = 8, --high value = less chance
|
||||
worm_building_density = 16, --lower values = more dense building
|
||||
worm_building_chance = 8, --high value = less chance
|
||||
nest_building_density = 32, --lower values = more dense building
|
||||
nest_building_chance = 16, --high value = less chance
|
||||
worm_building_density = 8, --lower values = more dense building
|
||||
worm_building_chance = 4, --high value = less chance
|
||||
}
|
||||
end
|
||||
|
||||
|
@@ -16,11 +16,11 @@ function build_nest()
|
||||
if not group.members then return end
|
||||
if not group.members[1] then return end
|
||||
local unit = group.members[math_random(1, #group.members)]
|
||||
if not unit.valid then return end
|
||||
local r = global.wave_defense.nest_building_density
|
||||
if unit.surface.count_entities_filtered({type = "unit-spawner", area = {{unit.position.x - r, unit.position.y - r},{unit.position.x + r, unit.position.y + r}}}) > 0 then return end
|
||||
local position = unit.surface.find_non_colliding_position("biter-spawner", unit.position, 5, 1)
|
||||
if not unit.valid then return end
|
||||
local position = unit.surface.find_non_colliding_position("biter-spawner", unit.position, 8, 1)
|
||||
if not position then return end
|
||||
local r = global.wave_defense.nest_building_density
|
||||
if unit.surface.count_entities_filtered({type = "unit-spawner", area = {{position.x - r, position.y - r},{position.x + r, position.y + r}}}) > 0 then return end
|
||||
unit.surface.create_entity({name = "biter-spawner", position = position, force = unit.force})
|
||||
unit.surface.create_entity({name = "blood-explosion-huge", position = position})
|
||||
unit.surface.create_entity({name = "blood-explosion-huge", position = unit.position})
|
||||
@@ -39,12 +39,12 @@ function build_worm()
|
||||
if not group.members[1] then return end
|
||||
local unit = group.members[math_random(1, #group.members)]
|
||||
if not unit.valid then return end
|
||||
local r = global.wave_defense.worm_building_density
|
||||
if unit.surface.count_entities_filtered({type = "turret", area = {{unit.position.x - r, unit.position.y - r},{unit.position.x + r, unit.position.y + r}}}) > 0 then return end
|
||||
wave_defense_set_worm_raffle(global.wave_defense.wave_number)
|
||||
local worm = wave_defense_roll_worm_name()
|
||||
local position = unit.surface.find_non_colliding_position(worm, unit.position, 5, 1)
|
||||
local position = unit.surface.find_non_colliding_position(worm, unit.position, 8, 1)
|
||||
if not position then return end
|
||||
local r = global.wave_defense.worm_building_density
|
||||
if unit.surface.count_entities_filtered({type = "turret", area = {{position.x - r, position.y - r},{position.x + r, position.y + r}}}) > 0 then return end
|
||||
unit.surface.create_entity({name = worm, position = position, force = unit.force})
|
||||
unit.surface.create_entity({name = "blood-explosion-huge", position = position})
|
||||
unit.surface.create_entity({name = "blood-explosion-huge", position = unit.position})
|
||||
@@ -111,7 +111,7 @@ end
|
||||
|
||||
local function shred_simple_entities(entity)
|
||||
if math_random(1, 2) ~= 1 then return end
|
||||
if global.wave_defense.threat < 10000 then return end
|
||||
if global.wave_defense.threat < 5000 then return end
|
||||
local simple_entities = entity.surface.find_entities_filtered({type = "simple-entity", area = {{entity.position.x - 3, entity.position.y - 3},{entity.position.x + 3, entity.position.y + 3}}})
|
||||
if #simple_entities == 0 then return end
|
||||
if #simple_entities > 1 then table.shuffle_table(simple_entities) end
|
||||
|
Reference in New Issue
Block a user