From 07516cb0f682710f580f06b222e4a6988593d185 Mon Sep 17 00:00:00 2001 From: MewMew Date: Mon, 16 Sep 2019 08:40:35 +0200 Subject: [PATCH] less cliffs, tiles underneath silo, tweaks --- maps/biter_battles_v2/biter_battles_v2.lua | 2 +- maps/biter_battles_v2/config.lua | 2 +- maps/biter_battles_v2/game_won.lua | 9 +++++++-- maps/biter_battles_v2/gui.lua | 4 +++- maps/biter_battles_v2/on_tick.lua | 2 +- maps/biter_battles_v2/terrain.lua | 11 ++++++++--- maps/fish_defender/boss_biters.lua | 19 ++++++++++++------- 7 files changed, 33 insertions(+), 16 deletions(-) diff --git a/maps/biter_battles_v2/biter_battles_v2.lua b/maps/biter_battles_v2/biter_battles_v2.lua index 3798be68..a7e1dbca 100644 --- a/maps/biter_battles_v2/biter_battles_v2.lua +++ b/maps/biter_battles_v2/biter_battles_v2.lua @@ -14,7 +14,7 @@ local function init_surface() map_gen_settings.water = math.random(30, 40) * 0.01 map_gen_settings.starting_area = 2.5 map_gen_settings.terrain_segmentation = math.random(30, 40) * 0.1 - map_gen_settings.cliff_settings = {cliff_elevation_interval = math.random(8, 48), cliff_elevation_0 = math.random(8, 48)} + map_gen_settings.cliff_settings = {cliff_elevation_interval = math.random(16, 48), cliff_elevation_0 = math.random(16, 48)} map_gen_settings.autoplace_controls = { ["coal"] = {frequency = math.random(10, 30) * 0.1, size = math.random(5, 15) * 0.1, richness = math.random(5, 15) * 0.1}, ["stone"] = {frequency = math.random(10, 30) * 0.1, size = math.random(5, 15) * 0.1, richness = math.random(5, 15) * 0.1}, diff --git a/maps/biter_battles_v2/config.lua b/maps/biter_battles_v2/config.lua index 18dd6b1b..aed57cd2 100644 --- a/maps/biter_battles_v2/config.lua +++ b/maps/biter_battles_v2/config.lua @@ -14,7 +14,7 @@ bb_config = { ["blueprint_string_importing"] = false, --Allow the importing of blueprints via blueprint strings? --MAP PREGENERATION-- - ["map_pregeneration_radius"] = 32, --Radius in chunks to pregenerate at the start of the map. + ["map_pregeneration_radius"] = 38, --Radius in chunks to pregenerate at the start of the map. ["fast_pregen"] = false, --Force fast pregeneration. --TERRAIN OPTIONS-- diff --git a/maps/biter_battles_v2/game_won.lua b/maps/biter_battles_v2/game_won.lua index 7a268efe..d689e8a4 100644 --- a/maps/biter_battles_v2/game_won.lua +++ b/maps/biter_battles_v2/game_won.lua @@ -16,7 +16,9 @@ end local function create_victory_gui(player) local values = gui_values[global.bb_game_won_by_team] - local frame = player.gui.left.add {type = "frame", name = "bb_victory_gui", direction = "vertical", caption = values.c1 .. " team has won!" } + local c = values.c1 + if global.tm_custom_name[global.bb_game_won_by_team] then c = global.tm_custom_name[global.bb_game_won_by_team] end + local frame = player.gui.left.add {type = "frame", name = "bb_victory_gui", direction = "vertical", caption = c .. " team has won!" } frame.style.font = "heading-1" frame.style.font_color = values.color1 @@ -341,7 +343,10 @@ local function on_entity_died(event) global.spy_fish_timeout["south"] = game.tick + 999999 global.server_restart_timer = 180 - server_commands.to_discord_embed(gui_values[global.bb_game_won_by_team].c1 .. " team has won!") + local c = gui_values[global.bb_game_won_by_team].c1 + if global.tm_custom_name[global.bb_game_won_by_team] then c = global.tm_custom_name[global.bb_game_won_by_team] end + + server_commands.to_discord_embed(c .. " has won!") server_commands.to_discord_embed(global.victory_time) fireworks(event.entity.surface) diff --git a/maps/biter_battles_v2/gui.lua b/maps/biter_battles_v2/gui.lua index 0278d38e..7cfd84db 100644 --- a/maps/biter_battles_v2/gui.lua +++ b/maps/biter_battles_v2/gui.lua @@ -252,7 +252,9 @@ function join_team(player, force_name, forced_join) player.character.destructible = true game.permissions.get_group("Default").add_player(player) if not forced_join then - game.print(player.name .. " has joined team " .. player.force.name .. "!", {r = 0.98, g = 0.66, b = 0.22}) + local c = player.force.name + if global.tm_custom_name[player.force.name] then c = global.tm_custom_name[player.force.name] end + game.print(player.name .. " has joined team " .. c .. "!", {r = 0.98, g = 0.66, b = 0.22}) end local i = player.get_inventory(defines.inventory.character_main) i.clear() diff --git a/maps/biter_battles_v2/on_tick.lua b/maps/biter_battles_v2/on_tick.lua index 570149fa..0df6fc8c 100644 --- a/maps/biter_battles_v2/on_tick.lua +++ b/maps/biter_battles_v2/on_tick.lua @@ -80,4 +80,4 @@ local function on_tick(event) restart_idle_map() end -event.add(defines.events.on_tick, on_tick) +event.add(defines.events.on_tick, on_tick) \ No newline at end of file diff --git a/maps/biter_battles_v2/terrain.lua b/maps/biter_battles_v2/terrain.lua index 457ea273..6b90c640 100644 --- a/maps/biter_battles_v2/terrain.lua +++ b/maps/biter_battles_v2/terrain.lua @@ -135,7 +135,7 @@ local function generate_circle_spawn(event) if global.bb_circle_spawn_generated then return end local surface = event.surface - if surface.is_chunk_generated({6, 6}) then global.bb_circle_spawn_generated = true end + if surface.is_chunk_generated({-8, -8}) then global.bb_circle_spawn_generated = true end local left_top_x = event.area.left_top.x local left_top_y = event.area.left_top.y local r = 101 @@ -212,8 +212,13 @@ local function generate_silos(event) global.bb_silos_generated = true local surface = event.surface - local pos = surface.find_non_colliding_position("rocket-silo", {x = -16 + math.random(0, 24), y = -64 + math.random(0, 16)}, 20, 1) - if not pos then pos = {0,-64} end + + local pos = {x = -12 + math.random(0, 24), y = -64 + math.random(0, 16)} + + for _, t in pairs(surface.find_tiles_filtered({area = {{pos.x - 6, pos.y - 6},{pos.x + 6, pos.y + 6}}, name = {"water", "deepwater"}})) do + surface.set_tiles({{name = get_replacement_tile(surface, t.position), position = t.position}}) + end + global.rocket_silo["north"] = surface.create_entity({ name = "rocket-silo", position = pos, diff --git a/maps/fish_defender/boss_biters.lua b/maps/fish_defender/boss_biters.lua index ca4cd8ee..7364d727 100644 --- a/maps/fish_defender/boss_biters.lua +++ b/maps/fish_defender/boss_biters.lua @@ -4,7 +4,9 @@ local radius = 6 local targets = {} local acid_splashes = { ["big-biter"] = "acid-stream-worm-medium", - ["behemoth-biter"] = "acid-stream-worm-big" + ["behemoth-biter"] = "acid-stream-worm-big", + ["big-spitter"] = "acid-stream-worm-medium", + ["behemoth-spitter"] = "acid-stream-worm-big" } local acid_lines = { ["big-spitter"] = "acid-stream-spitter-medium", @@ -19,7 +21,7 @@ for x = radius * -1, radius, 1 do end local function acid_nova(event) - for _ = 1, math.random(20, 40) do + for _ = 1, math.random(16, 32) do local i = math.random(1, #targets) event.entity.surface.create_entity({ name = acid_splashes[event.entity.name], @@ -42,14 +44,14 @@ end local function acid_line(surface, name, source, target) local distance = math.sqrt((source.x - target.x) ^ 2 + (source.y - target.y) ^ 2) - if distance > 16 then return end + if distance > 16 then return false end local modifier = {(target.x - source.x) / distance, (target.y - source.y) / distance} local position = {source.x, source.y} - for i = 1, distance + 2, 1 do - if math_random(1,3) ~= 1 then + for i = 1, distance + 4, 1 do + if math_random(1,3) == 1 then surface.create_entity({ name = name, position = source, @@ -63,14 +65,17 @@ local function acid_line(surface, name, source, target) position = {position[1] + modifier[1], position[2] + modifier[2]} end - global.acid_lines_delay[event.cause.unit_number] = game.tick + 180 + return true end boss_biter.damaged_entity = function(event) if acid_lines[event.cause.name] then if not global.acid_lines_delay[event.cause.unit_number] then global.acid_lines_delay[event.cause.unit_number] = 0 end + if global.acid_lines_delay[event.cause.unit_number] < game.tick then - acid_line(event.cause.surface, acid_lines[event.cause.name], event.cause.position, event.entity.position) + if acid_line(event.cause.surface, acid_lines[event.cause.name], event.cause.position, event.entity.position) then + global.acid_lines_delay[event.cause.unit_number] = game.tick + 180 + end end end end