From 8e5d86506aecc0a28d4b072a3cddd939fd429ae3 Mon Sep 17 00:00:00 2001 From: Gerkiz Date: Sat, 20 Nov 2021 20:04:13 +0100 Subject: [PATCH] minor fixes --- maps/mountain_fortress_v3/entities.lua | 17 ++++++++++++++--- maps/mountain_fortress_v3/functions.lua | 12 ++++++++++++ modules/wave_defense/table.lua | 20 ++++++++++++++++++-- 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/maps/mountain_fortress_v3/entities.lua b/maps/mountain_fortress_v3/entities.lua index ff8b93f7..c0b6f777 100644 --- a/maps/mountain_fortress_v3/entities.lua +++ b/maps/mountain_fortress_v3/entities.lua @@ -1153,7 +1153,8 @@ local function show_mvps(player) local miners_label = t.add({type = 'label', caption = 'Miners >> '}) miners_label.style.font = 'default-listbox' miners_label.style.font_color = {r = 0.22, g = 0.77, b = 0.44} - local miners_label_text = t.add({type = 'label', caption = mvp.mined_entities.name .. ' mined a total of ' .. mvp.mined_entities.score .. ' entities!'}) + local miners_label_text = + t.add({type = 'label', caption = mvp.mined_entities.name .. ' mined a total of ' .. mvp.mined_entities.score .. ' entities!'}) miners_label_text.style.font = 'default-bold' miners_label_text.style.font_color = {r = 0.33, g = 0.66, b = 0.9} @@ -1335,7 +1336,12 @@ local function on_built_entity(event) return end - if entity.type == 'mining-drill' then + local valid_drills = { + ['burner-mining-drill'] = true, + ['electric-mining-drill'] = true + } + + if valid_drills[entity.name] then entity.force = 'bonus_drill' return end @@ -1408,7 +1414,12 @@ local function on_robot_built_entity(event) return end - if entity.type == 'mining-drill' then + local valid_drills = { + ['burner-mining-drill'] = true, + ['electric-mining-drill'] = true + } + + if valid_drills[entity.name] then entity.force = 'bonus_drill' return end diff --git a/maps/mountain_fortress_v3/functions.lua b/maps/mountain_fortress_v3/functions.lua index c37bf70a..03a079b3 100644 --- a/maps/mountain_fortress_v3/functions.lua +++ b/maps/mountain_fortress_v3/functions.lua @@ -1123,6 +1123,10 @@ function Public.boost_difficulty() WPT.set('bonus_xp_on_join', 500) WD.set('next_wave', game.tick + 3600 * 15) WPT.set('spidertron_unlocked_at_zone', 10) + WD.set_normal_unit_current_health(1.2) + WD.set_normal_unit_current_per_wave(0.08) + WD.set_boss_unit_current_health(2) + WD.set_boss_unit_current_per_wave(0.15) unit_modifiers.limit_value = 30 unit_modifiers.health_increase_per_boss_wave = 0.04 WPT.set('difficulty_set', true) @@ -1138,6 +1142,10 @@ function Public.boost_difficulty() WPT.set('bonus_xp_on_join', 300) WD.set('next_wave', game.tick + 3600 * 8) WPT.set('spidertron_unlocked_at_zone', 8) + WD.set_normal_unit_current_health(1.6) + WD.set_normal_unit_current_per_wave(0.12) + WD.set_boss_unit_current_health(3) + WD.set_boss_unit_current_per_wave(0.20) unit_modifiers.limit_value = 40 unit_modifiers.health_increase_per_boss_wave = 0.06 WPT.set('difficulty_set', true) @@ -1151,6 +1159,10 @@ function Public.boost_difficulty() WPT.set('locomotive_max_health', 5000) WPT.set('bonus_xp_on_join', 50) WD.set('next_wave', game.tick + 3600 * 5) + WD.set_normal_unit_current_health(2) + WD.set_normal_unit_current_per_wave(0.2) + WD.set_boss_unit_current_health(4) + WD.set_boss_unit_current_per_wave(0.4) WPT.set('spidertron_unlocked_at_zone', 6) unit_modifiers.limit_value = 50 unit_modifiers.health_increase_per_boss_wave = 0.08 diff --git a/modules/wave_defense/table.lua b/modules/wave_defense/table.lua index bfea8ccb..cfce3690 100644 --- a/modules/wave_defense/table.lua +++ b/modules/wave_defense/table.lua @@ -73,8 +73,8 @@ function Public.reset_wave_defense() this.increase_health_per_wave = false this.fill_tiles_so_biter_can_path = true this.modified_unit_health = { - current_value = 1.02, - limit_value = 60, + current_value = 1.2, + limit_value = 90, health_increase_per_boss_wave = 0.08 } this.modified_boss_unit_health = { @@ -214,6 +214,22 @@ function Public.increase_damage_per_wave(boolean) return this.increase_damage_per_wave end +function Public.set_normal_unit_current_health(int) + this.modified_unit_health.current_value = int or 1.2 +end + +function Public.set_boss_unit_current_health(int) + this.modified_boss_unit_health.current_value = int or 2 +end + +function Public.set_normal_unit_current_per_wave(int) + this.modified_unit_health.health_increase_per_boss_wave = int or 0.08 +end + +function Public.set_boss_unit_current_per_wave(int) + this.modified_boss_unit_health.health_increase_per_boss_wave = int or 0.15 +end + function Public.pause(boolean) this.paused = boolean or false end