mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-06 00:23:49 +02:00
some small things
This commit is contained in:
parent
a643b3f107
commit
4df25be258
@ -13,15 +13,6 @@ local threat_values = {
|
||||
["behemoth-biter"] = 24
|
||||
}
|
||||
|
||||
local function shuffle(tbl)
|
||||
local size = #tbl
|
||||
for i = size, 1, -1 do
|
||||
local rand = math_random(size)
|
||||
tbl[i], tbl[rand] = tbl[rand], tbl[i]
|
||||
end
|
||||
return tbl
|
||||
end
|
||||
|
||||
ai.send_near_biters_to_silo = function()
|
||||
if game.tick < 108000 then return end
|
||||
if not global.rocket_silo["north"] then return end
|
||||
|
@ -19,7 +19,7 @@ room.single_nest = function(surface, cell_left_top, direction)
|
||||
end
|
||||
|
||||
room.biters = function(surface, cell_left_top, direction)
|
||||
local amount = math.random(1, math.floor(1 + (global.maze_depth * 0.25)))
|
||||
local amount = math.random(1, math.floor(1 + (global.maze_depth * 0.3)))
|
||||
local tile_positions = {}
|
||||
local left_top = {x = cell_left_top.x * grid_size, y = cell_left_top.y * grid_size}
|
||||
for x = 0.5, grid_size - 0.5, 1 do
|
||||
@ -39,7 +39,7 @@ room.biters = function(surface, cell_left_top, direction)
|
||||
end
|
||||
|
||||
room.spitters = function(surface, cell_left_top, direction)
|
||||
local amount = math.random(1, math.floor(1 + (global.maze_depth * 0.25)))
|
||||
local amount = math.random(1, math.floor(1 + (global.maze_depth * 0.3)))
|
||||
local tile_positions = {}
|
||||
local left_top = {x = cell_left_top.x * grid_size, y = cell_left_top.y * grid_size}
|
||||
for x = 0.5, grid_size - 0.5, 1 do
|
||||
@ -180,15 +180,15 @@ room.pond = function(surface, cell_left_top, direction)
|
||||
end
|
||||
|
||||
local room_weights = {
|
||||
--{func = room.biters, weight = 25},
|
||||
--{func = room.spitters, weight = 15},
|
||||
--{func = room.single_worm, weight = 15},
|
||||
--{func = room.single_nest, weight = 8},
|
||||
{func = room.biters, weight = 25},
|
||||
{func = room.spitters, weight = 15},
|
||||
{func = room.single_worm, weight = 15},
|
||||
{func = room.single_nest, weight = 8},
|
||||
|
||||
--{func = room.tons_of_trees, weight = 15},
|
||||
{func = room.tons_of_trees, weight = 15},
|
||||
|
||||
--{func = room.lots_of_rocks, weight = 25},
|
||||
--{func = room.tons_of_rocks, weight = 15},
|
||||
{func = room.lots_of_rocks, weight = 25},
|
||||
{func = room.tons_of_rocks, weight = 15},
|
||||
{func = room.quad_rocks, weight = 10},
|
||||
{func = room.three_rocks, weight = 3},
|
||||
{func = room.single_rock, weight = 10},
|
||||
|
@ -6,10 +6,10 @@ end
|
||||
|
||||
room.stone_block = function(surface, cell_left_top, direction)
|
||||
local left_top = {x = cell_left_top.x * grid_size, y = cell_left_top.y * grid_size}
|
||||
for x = 2.5, grid_size * 3 - 2.5, 1 do
|
||||
for y = 2.5, grid_size * 3 - 2.5, 1 do
|
||||
for x = 3.5, grid_size * 3 - 3.5, 1 do
|
||||
for y = 3.5, grid_size * 3 - 3.5, 1 do
|
||||
local pos = {left_top.x + x, left_top.y + y}
|
||||
if math.random(1,6) ~= 1 then surface.create_entity({name = rock_raffle[math.random(1, #rock_raffle)], position = pos, force = "neutral"}) end
|
||||
if math.random(1,5) ~= 1 then surface.create_entity({name = rock_raffle[math.random(1, #rock_raffle)], position = pos, force = "neutral"}) end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -23,7 +23,7 @@ multirooms["2x2"] = require 'maps.stone_maze.2x2_rooms'
|
||||
multirooms["3x3"] = require 'maps.stone_maze.3x3_rooms'
|
||||
|
||||
map_functions = require "tools.map_functions"
|
||||
grid_size = 8
|
||||
grid_size = 24
|
||||
rock_raffle = {"rock-huge", "rock-big", "rock-big", "rock-big"}
|
||||
tree_raffle = {"tree-01", "tree-02", "tree-03", "tree-04", "tree-05", "tree-06", "tree-07", "tree-08", "tree-09", "tree-02-red", "tree-06-brown", "tree-08-brown", "tree-08-red","tree-09-brown","tree-09-red","dead-dry-hairy-tree","dry-hairy-tree","dry-tree","dead-tree-desert","dead-grey-trunk"}
|
||||
|
||||
|
@ -73,7 +73,7 @@ local function on_init(event)
|
||||
global.evolution_factor = 0
|
||||
global.color_counter = 0
|
||||
|
||||
local hours_to_max_evo = 12
|
||||
local hours_to_max_evo = 15
|
||||
local ticks_to_max_evo = 12 * 60 * 60 * 60
|
||||
global.tick_gain = math.round((1 / ticks_to_max_evo) * gui_refreshrate, 8)
|
||||
end
|
||||
|
@ -3,6 +3,7 @@
|
||||
local event = require 'utils.event'
|
||||
|
||||
local function get_random_close_spawner(surface)
|
||||
if not game.connected_players[1] then return false end
|
||||
local surface = game.connected_players[1].surface
|
||||
local spawners = surface.find_entities_filtered({type = "unit-spawner", force = "enemy"})
|
||||
if not spawners[1] then return false end
|
||||
|
Loading…
Reference in New Issue
Block a user