mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-06 00:23:49 +02:00
update
This commit is contained in:
parent
32ebb877b7
commit
9aa6985926
@ -3,6 +3,7 @@
|
||||
require "modules.dynamic_landfill"
|
||||
require "modules.satellite_score"
|
||||
require "modules.spawners_contain_biters"
|
||||
require "modules.surrounded_by_worms"
|
||||
|
||||
local simplex_noise = require 'utils.simplex_noise'
|
||||
simplex_noise = simplex_noise.d2
|
||||
@ -34,7 +35,8 @@ local function on_player_joined_game(event)
|
||||
local player = game.players[event.player_index]
|
||||
if not global.map_init_done then
|
||||
game.forces["player"].technologies["landfill"].researched=true
|
||||
global.map_init_done = true
|
||||
global.average_worm_amount_per_chunk = 6
|
||||
global.map_init_done = true
|
||||
end
|
||||
|
||||
if player.online_time == 0 then
|
||||
|
@ -246,7 +246,7 @@ end
|
||||
local function draw_evolution_gui()
|
||||
for _, player in pairs(game.connected_players) do
|
||||
if player.gui.top.evolution_gui then player.gui.top.evolution_gui.destroy() end
|
||||
local element = player.gui.top.add({type = "sprite-button", name = "evolution_gui", caption = "Evolution: " .. global.evolution_factor .. "%", tooltip = "Can go above 100%"})
|
||||
local element = player.gui.top.add({type = "sprite-button", name = "evolution_gui", caption = "Evolution: " .. global.evolution_factor * 100 .. "%", tooltip = "Can go above 100%"})
|
||||
local style = element.style
|
||||
style.minimal_height = 38
|
||||
style.maximal_height = 38
|
||||
|
@ -81,12 +81,6 @@ local function process_entity(e)
|
||||
e.destroy()
|
||||
return
|
||||
end
|
||||
if e.type == "unit-spawner" then
|
||||
for _, entity in pairs (e.surface.find_entities_filtered({area = {{e.position.x - 6, e.position.y - 6},{e.position.x + 6, e.position.y + 6}}, force = "neutral"})) do
|
||||
if entity.valid then entity.destroy() end
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local function on_chunk_generated(event)
|
||||
@ -128,11 +122,16 @@ local function on_chunk_generated(event)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
surface.set_tiles(tiles, true)
|
||||
|
||||
for _, e in pairs(surface.find_entities_filtered({area = event.area, type = "unit-spawner"})) do
|
||||
for _, entity in pairs (e.surface.find_entities_filtered({area = {{e.position.x - 7, e.position.y - 7},{e.position.x + 7, e.position.y + 7}}, force = "neutral"})) do
|
||||
if entity.valid then entity.destroy() end
|
||||
end
|
||||
end
|
||||
surface.set_tiles(tiles, true)
|
||||
|
||||
local decorative_names = {}
|
||||
for k,v in pairs(game.decorative_prototypes) do
|
||||
@ -192,13 +191,13 @@ local tree_yield = {
|
||||
|
||||
local function get_amount(entity)
|
||||
local distance_to_center = math.sqrt(entity.position.x^2 + entity.position.y^2)
|
||||
local amount = 35 + (distance_to_center * 0.25)
|
||||
if amount > 500 then amount = 500 end
|
||||
local amount = 25 + (distance_to_center * 0.1)
|
||||
if amount > 1000 then amount = 1000 end
|
||||
amount = math.random(math.ceil(amount * 0.5), math.ceil(amount * 1.5))
|
||||
return amount
|
||||
end
|
||||
|
||||
local function trap(entity)
|
||||
local function trap(entity)
|
||||
if math_random(1,1024) == 1 then tick_tack_trap(entity.surface, entity.position) return end
|
||||
if math_random(1,256) == 1 then unearthing_worm(entity.surface, entity.position) end
|
||||
if math_random(1,128) == 1 then unearthing_biters(entity.surface, entity.position, math_random(4,8)) end
|
||||
|
@ -10,7 +10,6 @@ require "modules.spawners_contain_biters"
|
||||
require "modules.splice_double"
|
||||
|
||||
local ore_spawn_raffle = {"iron-ore","iron-ore","iron-ore","iron-ore","copper-ore","copper-ore","copper-ore","coal","coal","coal","stone","uranium-ore","crude-oil"}
|
||||
local stars = {"☆", "☆", "☆", "★", "★"}
|
||||
|
||||
local function get_noise(name, pos)
|
||||
local seed = game.surfaces[1].map_gen_settings.seed
|
||||
|
@ -10,6 +10,7 @@ require "modules.biters_yield_coins"
|
||||
--require "maps.modules.fluids_are_explosive"
|
||||
--require "maps.modules.explosives_are_explosive"
|
||||
require "modules.dangerous_nights"
|
||||
require "modules.dangerous_goods"
|
||||
|
||||
require "maps.junkyard_map_intro"
|
||||
|
||||
@ -256,17 +257,17 @@ local function place_random_scrap_entity(surface, position)
|
||||
e.active = false
|
||||
return
|
||||
end
|
||||
if r < 25 then
|
||||
local e = surface.create_entity({name = "substation", position = position, force = "scrap"})
|
||||
e.active = false
|
||||
return
|
||||
end
|
||||
if r < 70 then
|
||||
local e = surface.create_entity({name = "medium-electric-pole", position = position, force = "scrap"})
|
||||
e.active = false
|
||||
return
|
||||
end
|
||||
if r < 90 then
|
||||
--if r < 25 then
|
||||
-- local e = surface.create_entity({name = "substation", position = position, force = "scrap"})
|
||||
-- e.active = false
|
||||
-- return
|
||||
--end
|
||||
--if r < 70 then
|
||||
-- local e = surface.create_entity({name = "medium-electric-pole", position = position, force = "scrap"})
|
||||
-- e.active = false
|
||||
-- return
|
||||
--end
|
||||
if r < 100 then
|
||||
local e = surface.create_entity({name = "gun-turret", position = position, force = "scrap_defense"})
|
||||
e.insert({name = "piercing-rounds-magazine", count = math.random(8, 128)})
|
||||
return
|
||||
@ -438,6 +439,8 @@ local function on_player_joined_game(event)
|
||||
game.forces["player"].technologies["optics"].researched = true
|
||||
|
||||
game.surfaces["nauvis"].ticks_per_day = game.surfaces["nauvis"].ticks_per_day * 2
|
||||
game.surfaces["nauvis"].min_brightness = 0.08
|
||||
game.surfaces["nauvis"].daytime = 0.7
|
||||
|
||||
game.create_force("scrap")
|
||||
game.create_force("scrap_defense")
|
||||
|
@ -1,12 +1,11 @@
|
||||
local event = require 'utils.event'
|
||||
|
||||
require "modules.spawners_contain_acid"
|
||||
require "modules.spawners_contain_biters"
|
||||
require "modules.dynamic_landfill"
|
||||
require "modules.dangerous_goods"
|
||||
require "modules.satellite_score"
|
||||
require "modules.dangerous_nights"
|
||||
require "on_tick_schedule"
|
||||
require "modules.splice_double"
|
||||
require "modules.biters_avoid_damage"
|
||||
require "modules.mineable_wreckage_yields_scrap"
|
||||
|
||||
local function init_surface()
|
||||
@ -14,7 +13,7 @@ local function init_surface()
|
||||
|
||||
local map_gen_settings = {}
|
||||
map_gen_settings.water = "0.5"
|
||||
map_gen_settings.starting_area = "2.2"
|
||||
map_gen_settings.starting_area = "2.5"
|
||||
map_gen_settings.cliff_settings = {cliff_elevation_interval = 40, cliff_elevation_0 = 40}
|
||||
map_gen_settings.autoplace_controls = {
|
||||
["coal"] = {frequency = "10", size = "7", richness = "1"},
|
||||
@ -34,8 +33,8 @@ local function init_surface()
|
||||
surface.request_to_generate_chunks({x = 0, y = 0}, 1)
|
||||
surface.force_generate_chunk_requests()
|
||||
surface.daytime = 0.7
|
||||
surface.ticks_per_day = surface.ticks_per_day * 3
|
||||
surface.min_brightness = 0.07
|
||||
surface.ticks_per_day = surface.ticks_per_day * 2.5
|
||||
surface.min_brightness = 0.1
|
||||
|
||||
game.forces["player"].set_spawn_position({0,0},game.surfaces["mixed_railworld"])
|
||||
|
||||
@ -56,12 +55,11 @@ end
|
||||
local function on_chunk_generated(event)
|
||||
for _, coal in pairs(event.surface.find_entities_filtered({area = event.area, name = {"coal"}})) do
|
||||
local pos = coal.position
|
||||
--event.surface.set_tiles({{name = "dirt-7", position = pos}}, true)
|
||||
if math.random(1,2) ~= 1 then
|
||||
event.surface.create_entity({name = "mineable-wreckage", position = coal.position, force = "neutral"})
|
||||
end
|
||||
coal.destroy()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
event.add(defines.events.on_chunk_generated, on_chunk_generated)
|
||||
|
Loading…
Reference in New Issue
Block a user