1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-06 00:23:49 +02:00

junkyard update

This commit is contained in:
MewMew 2019-03-06 19:42:19 +01:00
parent 59ce11259d
commit b136f016a3
2 changed files with 13 additions and 4 deletions

View File

@ -266,7 +266,7 @@ local function on_chunk_generated(event)
if math_random(1,3) ~= 1 then
surface.create_entity({name = "mineable-wreckage", position = pos})
else
if math_random(1,1024) == 1 then
if math_random(1,512) == 1 then
create_shipwreck(surface, pos)
else
if math_random(1,65536) == 1 then
@ -286,6 +286,15 @@ local function on_chunk_generated(event)
for _, e in pairs(surface.find_entities_filtered({area = event.area})) do
process_entity(e)
end
if global.spawn_generated then return end
if left_top.x < 96 then return end
map_functions.draw_rainbow_patch({x = 0, y = 0}, surface, 16, 2000)
for _, wreck in pairs (surface.find_entities_filtered({area = {{-10, -10},{10, 10}}, name = "mineable-wreckage"})) do
local distance_to_center = math.sqrt(wreck.position.x^2 + wreck.position.y^2)
if distance_to_center < 8 then wreck.destroy() end
end
global.spawn_generated = true
end
local function on_chunk_charted(event)

View File

@ -8,10 +8,10 @@ local mining_chance_weights = {
{name = "copper-plate", chance = 75},
{name = "copper-cable", chance = 50},
{name = "electronic-circuit", chance = 30},
{name = "steel-plate", chance = 15},
{name = "steel-plate", chance = 20},
{name = "solid-fuel", chance = 15},
{name = "pipe", chance = 10},
{name = "iron-stick", chance = 10},
{name = "solid-fuel", chance = 10},
{name = "iron-stick", chance = 10},
{name = "empty-barrel", chance = 10},
{name = "battery", chance = 1},
{name = "land-mine", chance = 1}