From 15982776640f3f8bafaf15e39877548fc0ef2781 Mon Sep 17 00:00:00 2001 From: MewMew Date: Wed, 8 May 2019 01:02:00 +0200 Subject: [PATCH] tweaks --- maps/wave_of_death/WoD.lua | 2 +- maps/wave_of_death/ai.lua | 18 ++++++++++++++---- maps/wave_of_death/game_status.lua | 13 ++++++++++--- maps/wave_of_death/init.lua | 1 + maps/wave_of_death/terrain.lua | 9 ++++++++- modules/floaty_chat.lua | 6 +++--- 6 files changed, 37 insertions(+), 12 deletions(-) diff --git a/maps/wave_of_death/WoD.lua b/maps/wave_of_death/WoD.lua index 5c1240e8..ecadd790 100644 --- a/maps/wave_of_death/WoD.lua +++ b/maps/wave_of_death/WoD.lua @@ -65,7 +65,7 @@ local function on_tick(event) if game.tick % 300 ~= 0 then return end for i = 1, 4, 1 do - game.forces[i].chart(game.surfaces["wave_of_death"], {{-288, -420}, {352, 32}}) + game.forces[i].chart(game.surfaces["wave_of_death"], {{-288, -420}, {352, 64}}) end game_status.restart_server() diff --git a/maps/wave_of_death/ai.lua b/maps/wave_of_death/ai.lua index 7c9b5b87..eca5f3f9 100644 --- a/maps/wave_of_death/ai.lua +++ b/maps/wave_of_death/ai.lua @@ -7,7 +7,9 @@ ai.spawn_wave = function(surface, lane_number, wave_number, amount_modifier) if not global.loaders[lane_number].valid then return end - local spawn_position = {x = global.loaders[lane_number].position.x, y = global.loaders[lane_number].position.y - 288} + local x_modifier = 32 - math.random(0, 64) + + local spawn_position = {x = global.loaders[lane_number].position.x + x_modifier, y = global.loaders[lane_number].position.y - 288} local unit_group = surface.create_unit_group({position = spawn_position, force = "enemy"}) @@ -81,15 +83,23 @@ ai.trigger_new_wave = function(event) entity.force.print(">> There are " .. global.wod_lane[lane_number].alive_biters .. " spawned biters left.", {r = 180, g = 0, b = 0}) return end - + local wave_number = global.wod_lane[lane_number].current_wave if not biter_waves[wave_number] then wave_number = #biter_waves end ai.spawn_wave(entity.surface, lane_number, wave_number, 1) + local player = game.players[event.player_index] + for _, force in pairs(game.forces) do + if force.name == entity.force.name then + force.print(">> " .. player.name .. " has summoned wave #" .. global.wod_lane[lane_number].current_wave - 1 .. "", {r = 0, g = 100, b = 0}) + else + force.print(">> Lane " .. entity.force.name .. " summoned wave #" .. global.wod_lane[lane_number].current_wave - 1 .. "", {r = 0, g = 100, b = 0}) + end + end + for _, player in pairs(game.connected_players) do player.play_sound{path="utility/new_objective", volume_modifier=0.3} - end - game.print(">> Lane " .. entity.force.name .. " summoned wave #" .. global.wod_lane[lane_number].current_wave - 1 .. "", {r = 0, g = 100, b = 0}) + end end ai.prevent_friendly_fire = function(event) diff --git a/maps/wave_of_death/game_status.lua b/maps/wave_of_death/game_status.lua index 98fdea7f..51c7b2bb 100644 --- a/maps/wave_of_death/game_status.lua +++ b/maps/wave_of_death/game_status.lua @@ -30,9 +30,10 @@ game_status.has_lane_lost = function(event) if event.entity.name ~= "loader" then return end local lane_number = tonumber(event.entity.force.name) global.wod_lane[lane_number].game_lost = true - game.forces[lane_number].set_spawn_position({x = 32, y = 0}, event.entity.surface) + local surface = event.entity.surface + game.forces[lane_number].set_spawn_position({x = 32, y = 0}, surface) - event.entity.surface.create_entity({ + surface.create_entity({ name = "atomic-rocket", position = event.entity.position, force = "enemy", @@ -64,7 +65,13 @@ game_status.has_lane_lost = function(event) create_victory_gui(i) global.server_restart_timer = 120 end - end + end + + for _, unit in pairs(surface.find_entities_filtered({type = "unit"})) do + if unit.valid then + unit.die() + end + end end return game_status diff --git a/maps/wave_of_death/init.lua b/maps/wave_of_death/init.lua index a9e08034..de7c8355 100644 --- a/maps/wave_of_death/init.lua +++ b/maps/wave_of_death/init.lua @@ -32,6 +32,7 @@ local function init_forces(surface) for _, force in pairs(game.forces) do if force.name ~= "enemy" then + force.technologies["optics"].researched = true force.technologies["artillery"].enabled = false force.technologies["artillery-shell-range-1"].enabled = false force.technologies["artillery-shell-speed-1"].enabled = false diff --git a/maps/wave_of_death/terrain.lua b/maps/wave_of_death/terrain.lua index 0959f75b..5a6a60d2 100644 --- a/maps/wave_of_death/terrain.lua +++ b/maps/wave_of_death/terrain.lua @@ -104,7 +104,14 @@ local function place_entities(surface, position, noise_position, seed) end if get_noise("rocks", noise_position, seed + 30000) > 0.82 then - if get_noise("random_things", noise_position, seed) > 0.5 then surface.create_entity({name = "rock-big", position = position}) end + local random_noise = get_noise("random_things", noise_position, seed) + if random_noise > 0.5 then + if random_noise > 0.75 then + surface.create_entity({name = "rock-big", position = position}) + else + surface.create_entity({name = "rock-huge", position = position}) + end + end return end diff --git a/modules/floaty_chat.lua b/modules/floaty_chat.lua index 2debcace..8959b1cd 100644 --- a/modules/floaty_chat.lua +++ b/modules/floaty_chat.lua @@ -15,7 +15,7 @@ local function on_console_chat(event) text = event.message, surface = player.surface, target = player.character, - target_offset = {-0.1, -3}, + target_offset = {-0.05, -4}, color = { r = player.color.r * 0.6 + 0.25, g = player.color.g * 0.6 + 0.25, @@ -23,10 +23,10 @@ local function on_console_chat(event) a = 1 }, time_to_live = 600, - scale = 0.9, + scale = 1.50, font = "default-game", alignment = "center", - scale_with_zoom = true + scale_with_zoom = false } end