2019-05-10 12:57:30 +02:00
|
|
|
local event = require 'utils.event'
|
|
|
|
|
|
|
|
require "modules.spawners_contain_acid"
|
2019-05-24 21:01:44 +02:00
|
|
|
require "modules.spawners_contain_biters"
|
|
|
|
require "modules.dangerous_goods"
|
2019-05-10 12:57:30 +02:00
|
|
|
require "modules.satellite_score"
|
|
|
|
require "modules.splice_double"
|
|
|
|
require "modules.mineable_wreckage_yields_scrap"
|
|
|
|
|
|
|
|
local function init_surface()
|
|
|
|
if game.surfaces["mixed_railworld"] then return game.surfaces["mixed_railworld"] end
|
|
|
|
|
|
|
|
local map_gen_settings = {}
|
2019-05-17 20:32:52 +02:00
|
|
|
map_gen_settings.water = "0.5"
|
2019-05-24 21:01:44 +02:00
|
|
|
map_gen_settings.starting_area = "2.5"
|
2019-05-10 12:57:30 +02:00
|
|
|
map_gen_settings.cliff_settings = {cliff_elevation_interval = 40, cliff_elevation_0 = 40}
|
|
|
|
map_gen_settings.autoplace_controls = {
|
2019-09-08 00:22:17 +02:00
|
|
|
["coal"] = {frequency = "8", size = "4", richness = "1"},
|
2019-05-10 12:57:30 +02:00
|
|
|
["stone"] = {frequency = "0.3", size = "2.0", richness = "0.5"},
|
|
|
|
["iron-ore"] = {frequency = "0.3", size = "2.0", richness = "0.5"},
|
|
|
|
["copper-ore"] = {frequency = "0.3", size = "2.0", richness = "0.5"},
|
|
|
|
["uranium-ore"] = {frequency = "0.5", size = "1", richness = "0.5"},
|
|
|
|
["crude-oil"] = {frequency = "0.5", size = "1", richness = "1"},
|
2019-05-17 20:32:52 +02:00
|
|
|
["trees"] = {frequency = "0.5", size = "0.75", richness = "1"},
|
2019-05-10 12:57:30 +02:00
|
|
|
["enemy-base"] = {frequency = "1", size = "1", richness = "1"}
|
|
|
|
}
|
|
|
|
|
|
|
|
local surface = game.create_surface("mixed_railworld", map_gen_settings)
|
|
|
|
surface.request_to_generate_chunks({x = 0, y = 0}, 1)
|
|
|
|
surface.force_generate_chunk_requests()
|
2019-05-14 17:09:36 +02:00
|
|
|
surface.daytime = 0.7
|
2019-05-24 21:01:44 +02:00
|
|
|
surface.ticks_per_day = surface.ticks_per_day * 2.5
|
|
|
|
surface.min_brightness = 0.1
|
2019-05-10 12:57:30 +02:00
|
|
|
|
|
|
|
game.forces["player"].set_spawn_position({0,0},game.surfaces["mixed_railworld"])
|
|
|
|
|
|
|
|
return surface
|
|
|
|
end
|
|
|
|
|
|
|
|
local function on_player_joined_game(event)
|
2019-05-14 17:09:36 +02:00
|
|
|
local surface = init_surface()
|
2019-05-10 12:57:30 +02:00
|
|
|
local player = game.players[event.player_index]
|
2019-05-14 17:09:36 +02:00
|
|
|
|
2019-05-10 12:57:30 +02:00
|
|
|
if player.online_time == 0 then
|
|
|
|
player.teleport(surface.find_non_colliding_position("character", {0,0}, 2, 1), "mixed_railworld")
|
|
|
|
player.insert({name = 'car', count = 1})
|
|
|
|
player.insert({name = 'small-lamp', count = 1})
|
|
|
|
end
|
|
|
|
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
|
2019-05-17 20:32:52 +02:00
|
|
|
if math.random(1,2) ~= 1 then
|
2019-05-10 12:57:30 +02:00
|
|
|
event.surface.create_entity({name = "mineable-wreckage", position = coal.position, force = "neutral"})
|
|
|
|
end
|
|
|
|
coal.destroy()
|
2019-05-24 21:01:44 +02:00
|
|
|
end
|
2019-05-10 12:57:30 +02:00
|
|
|
end
|
|
|
|
|
2019-12-20 15:46:20 +02:00
|
|
|
local function on_init()
|
|
|
|
game.difficulty_settings.technology_price_multiplier = 2
|
|
|
|
game.map_settings.enemy_expansion.enabled = false
|
|
|
|
end
|
|
|
|
|
|
|
|
event.on_init(on_init)
|
2019-05-10 12:57:30 +02:00
|
|
|
event.add(defines.events.on_chunk_generated, on_chunk_generated)
|
|
|
|
event.add(defines.events.on_player_joined_game, on_player_joined_game)
|
|
|
|
|
|
|
|
require "modules.ores_are_mixed"
|