From a9cbdbd27043c5a49093d24fafd941b16c293036 Mon Sep 17 00:00:00 2001 From: Gerkiz Date: Sun, 28 Nov 2021 21:20:23 +0100 Subject: [PATCH] add wintery mode --- comfy_panel/config.lua | 15 +++++++++++++++ maps/mountain_fortress_v3/generate.lua | 9 ++++++--- maps/mountain_fortress_v3/locomotive/market.lua | 17 +++++++++++++++++ maps/mountain_fortress_v3/table.lua | 2 +- modules/wave_defense/table.lua | 2 +- 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/comfy_panel/config.lua b/comfy_panel/config.lua index 62bce505..6c263ba7 100644 --- a/comfy_panel/config.lua +++ b/comfy_panel/config.lua @@ -340,6 +340,16 @@ local fortress_functions = { WPT.set('allow_decon', false) get_actor(event, '[Decon]', 'has disabled decon on car/tanks/trains.', true) end + end, + ['comfy_panel_christmas_mode'] = function(event) + local WPT = is_loaded('maps.mountain_fortress_v3.table') + if event.element.switch_state == 'left' then + WPT.set('winter_mode', true) + get_actor(event, '[WinteryMode]', 'has enabled wintery mode.', true) + else + WPT.set('winter_mode', false) + get_actor(event, '[WinteryMode]', 'has disabled wintery mode.', true) + end end } @@ -726,6 +736,11 @@ local function build_config_gui(data) 'On = Allows decon on car/tanks/trains.\nOff = Disables decon on car/tanks/trains.' ) scroll_pane.add({type = 'line'}) + if Module.christmas_mode then + switch_state = 'left' + end + add_switch(scroll_pane, switch_state, 'comfy_panel_christmas_mode', 'Wintery Mode', 'On = Enables wintery mode.\nOff = Disables wintery mode.') + scroll_pane.add({type = 'line'}) end end for _, e in pairs(scroll_pane.children) do diff --git a/maps/mountain_fortress_v3/generate.lua b/maps/mountain_fortress_v3/generate.lua index 3d9d1153..fce63ea5 100644 --- a/maps/mountain_fortress_v3/generate.lua +++ b/maps/mountain_fortress_v3/generate.lua @@ -326,11 +326,14 @@ local function wintery(ent, extra_lights) end if wintery_type[ent.type] then if ent.type == 'simple-entity' then - if random(1, 8) ~= 1 then - return + if random(1, 64) == 1 then + return add_light(ent) + end + else + if random(1, 4) == 1 then + return add_light(ent) end end - add_light(ent) end return true end diff --git a/maps/mountain_fortress_v3/locomotive/market.lua b/maps/mountain_fortress_v3/locomotive/market.lua index 876bc9d9..9a7498bd 100644 --- a/maps/mountain_fortress_v3/locomotive/market.lua +++ b/maps/mountain_fortress_v3/locomotive/market.lua @@ -1341,6 +1341,23 @@ local function create_market(data, rebuild) this.market = surface.create_entity {name = 'market', position = center_position, force = 'player'} + for y = -1, 0, 0.05 do + local scale = random(50, 100) * 0.01 + rendering.draw_sprite( + { + sprite = 'item/coin', + orientation = random(0, 100) * 0.01, + x_scale = scale, + y_scale = scale, + tint = {random(60, 255), random(60, 255), random(60, 255)}, + render_layer = 'selection-box', + target = this.market, + target_offset = {-0.7 + random(0, 140) * 0.01, y}, + surface = surface + } + ) + end + if this.mystical_chest_enabled then if this.mystical_chest and this.mystical_chest.entity then this.mystical_chest.entity.destroy() diff --git a/maps/mountain_fortress_v3/table.lua b/maps/mountain_fortress_v3/table.lua index 0a5d2923..faf93f00 100644 --- a/maps/mountain_fortress_v3/table.lua +++ b/maps/mountain_fortress_v3/table.lua @@ -205,7 +205,7 @@ function Public.reset_table() this.void_or_tile = 'out-of-map' this.validate_spider = {} this.check_afk_players = true - this.winter_mode = false + this.winter_mode = true this.sent_to_discord = false this.difficulty = { multiply = 0.25, diff --git a/modules/wave_defense/table.lua b/modules/wave_defense/table.lua index 4dcfd655..a0cfca0b 100644 --- a/modules/wave_defense/table.lua +++ b/modules/wave_defense/table.lua @@ -32,7 +32,7 @@ function Public.reset_wave_defense() this.nest_building_density = 48 this.next_wave = game.tick + 3600 * 20 this.enable_grace_time = { - enabled = false, + enabled = true, set = nil } this.side_targets = {}