1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2026-06-20 16:32:28 +02:00
This commit is contained in:
MewMew
2020-04-01 17:10:29 +02:00
parent 5f319d88f6
commit b438e6fa6c
4 changed files with 104 additions and 5 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
--enable / disable collapsing of the map
local collapse_enabled = false
local darkness = true
local darkness = false
require "player_modifiers"
require "functions.soft_reset"
+6 -4
View File
@@ -179,9 +179,9 @@ local function draw_east_side(surface, left_top)
if is_out_of_map(position) then
surface.set_tiles({{name = "out-of-map", position = position}}, true)
else
if math_random(1, 5000) == 1 and left_top.x > 0 then
if math_random(1, 4096) == 1 and left_top.x > -32 and math_abs(left_top.y) > 2 then
table_insert(entities, {name = infini_ores[math_random(1, #infini_ores)], position = position, amount = 99999999})
table_insert(entities, {name = "burner-mining-drill", position = position, force = "neutral"})
table_insert(entities, {name = "electric-mining-drill", position = position, force = "enemy"})
end
end
end
@@ -189,7 +189,7 @@ local function draw_east_side(surface, left_top)
for _, entity in pairs(entities) do
local e = surface.create_entity(entity)
if e.name == "burner-mining-drill" then
if e.name == "electric-mining-drill" then
if e.position.y < 0 then
e.direction = 4
else
@@ -197,7 +197,7 @@ local function draw_east_side(surface, left_top)
end
e.minable = false
e.destructible = false
e.insert({name = "coal", count = math_random(8, 36)})
--e.insert({name = "coal", count = math_random(8, 36)})
end
end
end
@@ -237,6 +237,8 @@ local type_whitelist = {
["transport-belt"] = true,
["underground-belt"] = true,
["wall"] = true,
["gate"] = true,
["beacon"] = true,
}
local function deny_building(event)
+18
View File
@@ -1,3 +1,21 @@
--[[
Exchange Strings:
for "terrain_layouts.scrap_01"
>>>eNpjYBBiEGQAgwYHBgYHBw6W5PzEHAaGA0Begz2I5krOLyhIL
dLNL0pFFuZMLipNSdXNz0RVnJqXmlupm5RYnAoRgmCOzKL8PHQTW
ItL8vNQRUqKUlOLQazVq1bZgUS5S4sS8zJLc9H1MjCeOHC8uKFFj
gGE/9czKPz/D8JA1gOgX0CYgbEB7ClGoBgMsCbnZKalMTAoODIwF
DiDFTEyVousc39YNcWeEaJGzwHK+AAVOZAEE/GEMfwccEqpwBgmD
oz/weC+PaMxGHxGYkAsLQFaAVXO4YBgQCRbQJKMjL1vty74fuyCH
eOflR8v+SYl2DMauoq8+2C0zg4oyQ7yAhOcmDUTBHbCvMIAM/OBP
VTqpj3j2TMg8MaekQukwwhETKgDEg+WAq0T4AOyFvQACQUZBpjT7
GDGiDgwpoHBN5hPHsMYl+3R/QEMCBuQ4XIg4gSIYGWAGwl0GSOE6
dDvwOggD5OVRCgB6jdiQHZDCsKHJ2HWHkayH80hyBGB6Q80ERUHL
NEADqAUOPGCGe4aYHheYIfxHOY7MDKDGCBVX4BiEB5IBmYUhBZwY
GZAAGDyOnLntR4A3uWt/A==<<<
]]
local Biters = require "modules.towny.biters"
local Combat_balance = require "modules.towny.combat_balance"
local Building = require "modules.towny.building"
+79
View File
@@ -0,0 +1,79 @@
local math_abs = math.abs
local math_floor = math.floor
local math_sqrt = math.sqrt
local math_round = math.round
local math_random = math.random
local table_shuffle_table = table.shuffle_table
local table_insert = table.insert
local table_remove = table.remove
require "functions.noise_vector_path"
local function pos_to_key(position)
return tostring(position.x .. "_" .. position.y)
end
local function get_vector(position)
local x = 1000 - math_random(0, 2000)
local y = -1000 + math_random(0, 1100)
x = x * 0.001
y = y * 0.001
return {x, y}
end
local function can_draw_branch(surface, chunk_position)
for x = -3, 3, 1 do
for y = -3, 3, 1 do
if not surface.is_chunk_generated({chunk_position[1] + x, chunk_position[2] + y}) then return false end
end
end
return true
end
local function draw_branch(surface, key)
local position = global.tree_points[key][1]
local vector = global.tree_points[key][3]
local size = global.tree_points[key][4]
if surface.count_tiles_filtered({name = "green-refined-concrete", area = {{position.x - 32, position.y - 32}, {position.x + 32, position.y + 32}}}) > 960 then
table_remove(global.tree_points, key)
return
end
local tiles = noise_vector_tile_path(surface, "green-refined-concrete", position, vector, size * 4, size * 0.25)
for i = #tiles - math_random(0, 3), #tiles, 1 do
table_insert(global.tree_points, {
tiles[i].position,
{math_floor(tiles[i].position.x / 32), math_floor(tiles[i].position.y / 32)},
get_vector(position),
math_random(8, 16)
})
end
table_remove(global.tree_points, key)
end
local function on_init()
global.chunks_charted = {}
global.tree_points = {}
global.tree_points[1] = {{x = 0, y = 0}, {0, 0}, {0, -1}, 16}
--position | chunk position | vector | size
end
local function tick()
local surface = game.surfaces[1]
for key, point in pairs(global.tree_points) do
if can_draw_branch(surface, point[2]) then
draw_branch(surface, key)
end
end
game.print(#global.tree_points)
end
local Event = require 'utils.event'
Event.on_init(on_init)
Event.on_nth_tick(120, tick)