mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2024-12-26 22:56:43 +02:00
rock spawn guarantee
This commit is contained in:
parent
66dda1bebc
commit
84ca14db05
@ -22,7 +22,7 @@ end
|
||||
|
||||
local function set_biter_endgame_modifiers(force)
|
||||
if force.evolution_factor ~= 1 then return end
|
||||
local damage_mod = math.round((global.bb_evolution[force.name] - 1) * 0.25, 3)
|
||||
local damage_mod = math.round((global.bb_evolution[force.name] - 1) * 0.50, 3)
|
||||
force.set_ammo_damage_modifier("melee", damage_mod)
|
||||
force.set_ammo_damage_modifier("biological", damage_mod)
|
||||
force.set_ammo_damage_modifier("artillery-shell", damage_mod)
|
||||
|
@ -118,6 +118,7 @@ function Public.source_surface()
|
||||
|
||||
Terrain.draw_spawn_area(surface)
|
||||
Terrain.generate_additional_spawn_ore(surface)
|
||||
Terrain.generate_additional_rocks(surface)
|
||||
Terrain.generate_silo(surface)
|
||||
Terrain.draw_spawn_circle(surface)
|
||||
--Terrain.generate_spawn_goodies(surface)
|
||||
|
@ -522,6 +522,20 @@ function Public.generate_additional_spawn_ore(surface)
|
||||
end
|
||||
end
|
||||
|
||||
function Public.generate_additional_rocks(surface)
|
||||
local r = 130
|
||||
if surface.count_entities_filtered({type = "simple-entity", area = {{r * -1, r * -1}, {r, 0}}}) >= 12 then return end
|
||||
local position = {x = -96 + math_random(0, 192), y = -40 - math_random(0, 96)}
|
||||
local rocks = {"rock-huge", "rock-big", "rock-big", "rock-big", "sand-rock-big"}
|
||||
for _ = 1, math_random(6, 12) do
|
||||
local name = rocks[math_random(1, 5)]
|
||||
local p = surface.find_non_colliding_position(name, {position.x + (-10 + math_random(0, 20)), position.y + (-10 + math_random(0, 20))}, 16, 1)
|
||||
if p and p.y < -16 then
|
||||
surface.create_entity({name = name, position = p})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Public.generate_silo(surface)
|
||||
local pos = {x = -32 + math_random(0, 64), y = -72}
|
||||
local mirror_position = {x = pos.x * -1, y = pos.y * -1}
|
||||
|
Loading…
Reference in New Issue
Block a user