1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-05-13 21:56:29 +02:00
This commit is contained in:
MewMew 2019-06-24 18:54:29 +02:00
parent 4a44a3dc45
commit 98cb656e34
3 changed files with 21 additions and 3 deletions

View File

@ -62,7 +62,7 @@ local function process_chunk(surface)
local surface = game.surfaces["biter_battles"]
if not surface then return end
local force_chunk_requests = 1
local force_chunk_requests = 2
if config.fast_pregen then force_chunk_requests = 16 end
for i = #global.chunk_gen_coords, 1, -1 do

View File

@ -143,7 +143,7 @@ end
room.single_oil = function(surface, cell_left_top, direction)
local left_top = {x = cell_left_top.x * grid_size, y = cell_left_top.y * grid_size}
surface.create_entity({name = "crude-oil", position = {left_top.x + grid_size * 0.5, left_top.y + grid_size * 0.5}, amount = 100000 + global.maze_depth * 1000})
surface.create_entity({name = "crude-oil", position = {left_top.x + grid_size * 0.5, left_top.y + grid_size * 0.5}, amount = 100000 + global.maze_depth * 4000})
room.spitters(surface, cell_left_top, direction)
room.biters(surface, cell_left_top, direction)
end
@ -304,7 +304,7 @@ local room_weights = {
--{func = room.tons_of_scrap, weight = 2},
--{func = room.empty, weight = 1},
{func = room.pond, weight = 10},
{func = room.pond, weight = 8},
{func = room.loot_crate, weight = 10},
{func = room.tree_ring, weight = 10}

View File

@ -17,6 +17,14 @@ local event = require 'utils.event'
local table_insert = table.insert
local math_random = math.random
local disabled_for_deconstruction = {
["fish"] = true,
["rock-huge"] = true,
["rock-big"] = true,
["sand-rock-big"] = true,
["mineable-wreckage"] = true
}
local rooms_1x1 = require 'maps.stone_maze.1x1_rooms'
local multirooms = {}
multirooms["2x2"] = require 'maps.stone_maze.2x2_rooms'
@ -340,6 +348,15 @@ local function on_research_finished(event)
event.research.force.manual_mining_speed_modifier = manual_mining_speed_modifier + 2
end
local function on_marked_for_deconstruction(event)
if disabled_for_deconstruction[event.entity.name] then
event.entity.cancel_deconstruction(game.players[event.player_index].force.name)
end
if event.entity.type == "tree" then
event.entity.cancel_deconstruction(game.players[event.player_index].force.name)
end
end
local function on_init(event)
global.maze_cells = {}
global.maze_depth = 0
@ -359,6 +376,7 @@ local function on_init(event)
end
event.on_init(on_init)
event.add(defines.events.on_marked_for_deconstruction, on_marked_for_deconstruction)
event.add(defines.events.on_player_changed_position, on_player_changed_position)
event.add(defines.events.on_player_joined_game, on_player_joined_game)
event.add(defines.events.on_chunk_generated, on_chunk_generated)