From 0f4eeb7fe1d0f966a3e22d72f97ef7031606bd31 Mon Sep 17 00:00:00 2001 From: NekoBaron <30418155+NekoBaron@users.noreply.github.com> Date: Sun, 18 Jul 2021 14:31:34 +0100 Subject: [PATCH] Update terrain.lua add rocks to stone area at start plus increase in starting ores amounts and tiny size increase. --- maps/fish_defender_v2/terrain.lua | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/maps/fish_defender_v2/terrain.lua b/maps/fish_defender_v2/terrain.lua index d0feadaf..e7b0001d 100644 --- a/maps/fish_defender_v2/terrain.lua +++ b/maps/fish_defender_v2/terrain.lua @@ -7,6 +7,15 @@ local math_random = math.random local math_abs = math.abs local math_sqrt = math.sqrt +--rock spawning code for stone pile +local rock_raffle = {'sand-rock-big', 'sand-rock-big', 'rock-big', 'rock-big', 'rock-big', 'rock-huge'} +local size_of_rock_raffle = #rock_raffle +local function place_rock(surface, position) + local a = (math_random(-250, 250)) * 0.05 + local b = (math_random(-250, 250)) * 0.05 + surface.create_entity({name = rock_raffle[math_random(1, size_of_rock_raffle)], position = {position.x + a, position.y + b}}) +end + local function shuffle(tbl) local size = #tbl for i = size, 1, -1 do @@ -191,10 +200,15 @@ local function generate_spawn_area(surface) {x = spawn_position_x - 52, y = _y * -1} } shuffle(ore_positions) - map_functions.draw_smoothed_out_ore_circle(ore_positions[1], 'copper-ore', surface, 15, 2500) - map_functions.draw_smoothed_out_ore_circle(ore_positions[2], 'iron-ore', surface, 15, 2500) - map_functions.draw_smoothed_out_ore_circle(ore_positions[3], 'coal', surface, 15, 1500) - map_functions.draw_smoothed_out_ore_circle(ore_positions[4], 'stone', surface, 15, 1500) + map_functions.draw_smoothed_out_ore_circle(ore_positions[1], 'copper-ore', surface, 16, 3500) + map_functions.draw_smoothed_out_ore_circle(ore_positions[2], 'iron-ore', surface, 16, 3500) + map_functions.draw_smoothed_out_ore_circle(ore_positions[3], 'coal', surface, 16, 2500) + map_functions.draw_smoothed_out_ore_circle(ore_positions[4], 'stone', surface, 16, 2500) + + for ii = 0,10,1 do + place_rock(surface, ore_positions[4]) --add rocks to stone area + end + map_functions.draw_noise_tile_circle({x = spawn_position_x - 20, y = 0}, 'water', surface, 16) map_functions.draw_oil_circle(ore_positions[5], 'crude-oil', surface, 8, 200000)