From f950eed42174c850c1854b5f3f3ec8ca579cb353 Mon Sep 17 00:00:00 2001 From: Gerkiz Date: Wed, 20 May 2020 09:10:17 +0200 Subject: [PATCH] fixes --- maps/mountain_fortress_v3/locomotive.lua | 6 ++++++ maps/mountain_fortress_v3/main.lua | 9 +++------ maps/mountain_fortress_v3/table.lua | 15 ++++----------- maps/mountain_fortress_v3/terrain.lua | 6 +++--- utils/task.lua | 9 --------- 5 files changed, 16 insertions(+), 29 deletions(-) diff --git a/maps/mountain_fortress_v3/locomotive.lua b/maps/mountain_fortress_v3/locomotive.lua index 6e2f955a..b1dc5735 100644 --- a/maps/mountain_fortress_v3/locomotive.lua +++ b/maps/mountain_fortress_v3/locomotive.lua @@ -124,6 +124,12 @@ end local function set_locomotive_health() local this = WPT.get() + if not this.locomotive then + return + end + if not this.locomotive.valid then + return + end local locomotive_health = WPT.get('locomotive_health') local locomotive_max_health = WPT.get('locomotive_max_health') local m = locomotive_health / locomotive_max_health diff --git a/maps/mountain_fortress_v3/main.lua b/maps/mountain_fortress_v3/main.lua index 55b08b1c..0067b0e3 100644 --- a/maps/mountain_fortress_v3/main.lua +++ b/maps/mountain_fortress_v3/main.lua @@ -194,6 +194,7 @@ function Public.reset_map() disable_tech() local surface = game.surfaces[this.active_surface_index] + surface.min_brightness = 0.5 Explosives.set_surface_whitelist({[surface.name] = true}) @@ -221,9 +222,6 @@ function Public.reset_map() Collapse.set_direction('north') Collapse.start_now(false) - surface.brightness_visual_weights = {1, 0, 0, 0} - surface.freeze_daytime = false - surface.solar_power_multiplier = 1 this.locomotive_health = 10000 this.locomotive_max_health = 10000 this.cargo_health = 10000 @@ -243,9 +241,8 @@ function Public.reset_map() set_difficulty() - Task.reset_queue() Task.start_queue() - Task.set_queue_speed(10) + Task.set_queue_speed(2) this.chunk_load_tick = game.tick + 500 end @@ -468,7 +465,7 @@ local function chunk_load() if this.chunk_load_tick then if this.chunk_load_tick < game.tick then this.chunk_load_tick = nil - Task.set_queue_speed(1) + Task.set_queue_speed(0.8) end end end diff --git a/maps/mountain_fortress_v3/table.lua b/maps/mountain_fortress_v3/table.lua index d7f0dd0a..b2143233 100644 --- a/maps/mountain_fortress_v3/table.lua +++ b/maps/mountain_fortress_v3/table.lua @@ -20,32 +20,25 @@ function Public.reset_table() this.locomotive_index = nil this.loco_surface = nil this.game_lost = false - this.game_won = false - this.energy = {} - this.wave_counter = 0 this.locomotive_health = 10000 this.locomotive_max_health = 10000 this.cargo_health = 10000 this.cargo_max_health = 10000 - this.revealed_spawn = 0 - this.left_top = { - x = 0, - y = 0 - } this.train_upgrades = 0 - this.energy_purchased = false - this.freeze_daytime = false this.offline_players = {} this.biter_pets = {} this.mined_scrap = 0 this.biters_killed = 0 this.locomotive_xp_aura = 40 - this.randomness = 0 this.xp_points = 0 this.xp_points_upgrade = 0 this.aura_upgrades = 0 this.health_upgrades = 0 this.threat_upgrades = 0 + this.left_top = { + x = 0, + y = 0 + } end function Public.get(key) diff --git a/maps/mountain_fortress_v3/terrain.lua b/maps/mountain_fortress_v3/terrain.lua index ca3afa98..9e1fe5da 100644 --- a/maps/mountain_fortress_v3/terrain.lua +++ b/maps/mountain_fortress_v3/terrain.lua @@ -11,8 +11,8 @@ local math_random = math.random local math_floor = math.floor local math_abs = math.abs Public.level_depth = 704 -Public.level_width = 448 -local worm_level_modifier = 0.18 +Public.level_width = 512 +local worm_level_modifier = 0.19 local average_number_of_wagons_per_level = 2 local chunks_per_level = ((Public.level_depth - 32) / 32) ^ 2 local chance_for_wagon_spawn = math_floor(chunks_per_level / average_number_of_wagons_per_level) @@ -1373,7 +1373,7 @@ local function on_chunk_generated(event) local pl = WPT.get().locomotive.position for _, entity in pairs( surface.find_entities_filtered( - {area = {{pl.x - 3, pl.y - 4}, {pl.x + 3, pl.y + 10}}, type = 'simple-entity'} + {area = {{pl.x - 5, pl.y - 6}, {pl.x + 5, pl.y + 10}}, type = 'simple-entity'} ) ) do entity.destroy() diff --git a/utils/task.lua b/utils/task.lua index 52d2cf7c..a113c27c 100644 --- a/utils/task.lua +++ b/utils/task.lua @@ -155,15 +155,6 @@ function Task.start_queue() end end -function Task.reset_queue() - if #task_queue > 50 then - task_queue = { - _head = 1, - _tail = 0 - } - end -end - function Task.get_task_queue() return task_queue end