From 43292bd8e0507ec55c0e8586b038af2f6c6a6929 Mon Sep 17 00:00:00 2001 From: MewMew Date: Tue, 14 May 2019 17:09:36 +0200 Subject: [PATCH] tweaks --- maps/fish_defender/bouncy_shells.lua | 8 ++++---- maps/mixed_railworld.lua | 8 ++++---- modules/dangerous_nights.lua | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/maps/fish_defender/bouncy_shells.lua b/maps/fish_defender/bouncy_shells.lua index f247afc2..ef9a3951 100644 --- a/maps/fish_defender/bouncy_shells.lua +++ b/maps/fish_defender/bouncy_shells.lua @@ -1,4 +1,4 @@ -local radius = 16 +local radius = 12 local math_random = math.random local math_sqrt = math.sqrt @@ -24,10 +24,10 @@ local function bounce(surface, position, ammo) for _, e in pairs(surface.find_entities_filtered({area = {{position.x - radius, position.y - radius},{position.x + radius, position.y + radius}}})) do if e.health then if e.force.name ~= "player" then - local distance_from_center = math_sqrt((e.position.x - position.x) ^ 2 + (e.position.y - position.y) ^ 2) - if distance_from_center <= radius then + --local distance_from_center = math_sqrt((e.position.x - position.x) ^ 2 + (e.position.y - position.y) ^ 2) + --if distance_from_center <= radius then valid_entities[#valid_entities + 1] = e - end + --end end end end diff --git a/maps/mixed_railworld.lua b/maps/mixed_railworld.lua index 117b8422..b65e4ab8 100644 --- a/maps/mixed_railworld.lua +++ b/maps/mixed_railworld.lua @@ -13,7 +13,7 @@ local function init_surface() local map_gen_settings = {} map_gen_settings.water = "0.3" - map_gen_settings.starting_area = "2" + map_gen_settings.starting_area = "2.2" map_gen_settings.cliff_settings = {cliff_elevation_interval = 40, cliff_elevation_0 = 40} map_gen_settings.autoplace_controls = { ["coal"] = {frequency = "7", size = "0.5", richness = "0.5"}, @@ -32,6 +32,7 @@ local function init_surface() local surface = game.create_surface("mixed_railworld", map_gen_settings) surface.request_to_generate_chunks({x = 0, y = 0}, 1) surface.force_generate_chunk_requests() + surface.daytime = 0.7 game.forces["player"].set_spawn_position({0,0},game.surfaces["mixed_railworld"]) @@ -39,10 +40,9 @@ local function init_surface() end local function on_player_joined_game(event) - local surface = init_surface() - + local surface = init_surface() local player = game.players[event.player_index] - local surface = game.surfaces["mixed_railworld"] + if player.online_time == 0 then player.teleport(surface.find_non_colliding_position("character", {0,0}, 2, 1), "mixed_railworld") player.insert({name = 'car', count = 1}) diff --git a/modules/dangerous_nights.lua b/modules/dangerous_nights.lua index b06043e3..d3bf824a 100644 --- a/modules/dangerous_nights.lua +++ b/modules/dangerous_nights.lua @@ -17,6 +17,7 @@ local immune_tiles = { local function on_player_changed_position(event) local player = game.players[event.player_index] + if not player.character then return end if player.character.driving == true then return end if player.surface.daytime < 0.33 then return end if player.surface.daytime > 0.66 then return end