From 28d6c3bd1dfe92551b41bdf04e405ce28a10ed24 Mon Sep 17 00:00:00 2001 From: MewMew Date: Sat, 2 May 2020 22:20:54 +0200 Subject: [PATCH] tweaks --- functions/basic_markets.lua | 3 ++- maps/mountain_fortress_v2/locomotive.lua | 22 ++++++++++++++++------ maps/mountain_fortress_v2/main.lua | 2 +- maps/mountain_fortress_v2/terrain.lua | 9 +++++++-- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/functions/basic_markets.lua b/functions/basic_markets.lua index 21d06d1b..354f7d08 100644 --- a/functions/basic_markets.lua +++ b/functions/basic_markets.lua @@ -9,7 +9,7 @@ market.weapons = { ["combat-shotgun"] = {value = 400, rarity = 5}, ["rocket-launcher"] = {value = 250, rarity = 4}, ["flamethrower"] = {value = 750, rarity = 6}, - ["land-mine"] = {value = 5, rarity = 5}, + ["land-mine"] = {value = 3, rarity = 5}, } market.ammo = { @@ -227,6 +227,7 @@ function Public.mountain_market(surface, position, rarity) ["locomotive"] = true, ["artillery-wagon"] = true, ["fluid-wagon"] = true, + ["land-mine"] = true, } for i = 1, math.random(5, 10), 1 do diff --git a/maps/mountain_fortress_v2/locomotive.lua b/maps/mountain_fortress_v2/locomotive.lua index 8149daa8..27319410 100644 --- a/maps/mountain_fortress_v2/locomotive.lua +++ b/maps/mountain_fortress_v2/locomotive.lua @@ -3,13 +3,14 @@ local Public = {} local market_offers = { {price = {{'coin', 4}}, offer = {type = 'give-item', item = "raw-fish"}}, - {price = {{"coin", 16}}, offer = {type = 'give-item', item = 'wood', count = 50}}, - {price = {{"coin", 16}}, offer = {type = 'give-item', item = 'iron-ore', count = 50}}, - {price = {{"coin", 16}}, offer = {type = 'give-item', item = 'copper-ore', count = 50}}, - {price = {{"coin", 16}}, offer = {type = 'give-item', item = 'stone', count = 50}}, - {price = {{"coin", 16}}, offer = {type = 'give-item', item = 'coal', count = 50}}, - {price = {{"coin", 24}}, offer = {type = 'give-item', item = 'uranium-ore', count = 50}}, + {price = {{"coin", 12}}, offer = {type = 'give-item', item = 'wood', count = 50}}, + {price = {{"coin", 12}}, offer = {type = 'give-item', item = 'iron-ore', count = 50}}, + {price = {{"coin", 12}}, offer = {type = 'give-item', item = 'copper-ore', count = 50}}, + {price = {{"coin", 12}}, offer = {type = 'give-item', item = 'stone', count = 50}}, + {price = {{"coin", 12}}, offer = {type = 'give-item', item = 'coal', count = 50}}, + {price = {{"coin", 20}}, offer = {type = 'give-item', item = 'uranium-ore', count = 50}}, {price = {{"coin", 8}}, offer = {type = 'give-item', item = 'crude-oil-barrel', count = 1}}, + {price = {{"explosives", 5}, {"steel-plate", 1}, {"coin", 1}}, offer = {type = 'give-item', item = 'land-mine', count = 1}}, } function Public.locomotive_spawn(surface, position) @@ -65,6 +66,15 @@ function Public.locomotive_spawn(surface, position) if math.random(1, 2) == 1 then surface.spill_item_stack({x + math.random(0, 9) * 0.1, y + math.random(0, 9) * 0.1},{name = "raw-fish", count = 1}, false) end + surface.set_tiles({{name = "blue-refined-concrete", position = {x, y}}}, true) + end + end + for x = center_position.x - 3, center_position.x + 3, 1 do + for y = center_position.y - 3, center_position.y + 3, 1 do + if math.random(1, 2) == 1 then + surface.spill_item_stack({x + math.random(0, 9) * 0.1, y + math.random(0, 9) * 0.1},{name = "raw-fish", count = 1}, false) + end + surface.set_tiles({{name = "cyan-refined-concrete", position = {x, y}}}, true) end end end diff --git a/maps/mountain_fortress_v2/main.lua b/maps/mountain_fortress_v2/main.lua index 70bf736f..db5353b2 100644 --- a/maps/mountain_fortress_v2/main.lua +++ b/maps/mountain_fortress_v2/main.lua @@ -479,7 +479,7 @@ local function on_init() T.main_caption_color = {r = 150, g = 150, b = 0} T.sub_caption_color = {r = 0, g = 150, b = 0} global.rocks_yield_ore_maximum_amount = 500 - global.rocks_yield_ore_base_amount = 50 + global.rocks_yield_ore_base_amount = 40 global.rocks_yield_ore_distance_modifier = 0.020 global.explosion_cells_destructible_tiles = { diff --git a/maps/mountain_fortress_v2/terrain.lua b/maps/mountain_fortress_v2/terrain.lua index b08a2cdb..2b8fc2cb 100644 --- a/maps/mountain_fortress_v2/terrain.lua +++ b/maps/mountain_fortress_v2/terrain.lua @@ -7,7 +7,7 @@ local math_floor = math.floor local math_abs = math.abs local simplex_noise = require "utils.simplex_noise".d2 local rock_raffle = {"sand-rock-big","sand-rock-big", "rock-big","rock-big","rock-big","rock-big","rock-big","rock-big","rock-big","rock-huge"} -local wagon_raffle = {"cargo-wagon", "cargo-wagon", "cargo-wagon", "cargo-wagon", "cargo-wagon", "locomotive", "fluid-wagon"} +local wagon_raffle = {"cargo-wagon", "cargo-wagon", "cargo-wagon", "locomotive", "fluid-wagon"} local size_of_rock_raffle = #rock_raffle local spawner_raffle = {"biter-spawner", "biter-spawner", "biter-spawner", "spitter-spawner"} local noises = { @@ -23,9 +23,14 @@ local noises = { ["cave_rivers_4"] = {{modifier = 0.001, weight = 1}, {modifier = 0.01, weight = 0.11}, {modifier = 0.05, weight = 0.01}}, ["scrapyard"] = {{modifier = 0.005, weight = 1}, {modifier = 0.01, weight = 0.35}, {modifier = 0.05, weight = 0.23}, {modifier = 0.1, weight = 0.11}}, } + local level_depth = 704 local worm_level_modifier = 0.18 +local average_number_of_wagons_per_level = 2 +local chunks_per_level = ((level_depth - 32) / 32) ^ 2 +local chance_for_wagon_spawn = math_floor(chunks_per_level / average_number_of_wagons_per_level) + local function get_noise(name, pos, seed) local noise = 0 local d = 0 @@ -984,7 +989,7 @@ local function process_chunk(surface, left_top) end if left_top.y < 0 then rock_chunk(surface, left_top) - if math_random(1, 160) == 1 then place_wagon(surface, left_top) end + if math_random(1, chance_for_wagon_spawn) == 1 then place_wagon(surface, left_top) end return end if left_top.y > 96 then out_of_map(surface, left_top) return end