You've already forked ComfyFactorio
mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2026-06-20 16:32:28 +02:00
add wintery mode
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user