Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions map_gen/maps/diggy/feature/blueprint_tools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ local Ranks = require 'resources.ranks'
local Settings = require 'utils.redmew_settings'
local Template = require 'map_gen.maps.diggy.template'

local is_diggy_rock = Template.is_diggy_rock
local is_support_beam = Template.is_support_beam
local required_rank = Ranks.regular
local ENTITIES = prototypes.entity
Expand Down Expand Up @@ -189,6 +190,11 @@ local function on_marked_for_deconstruction(event)
name = entity.surface.get_tile(entity.position.x, entity.position.y).name
end

-- Rocks are always allowed
if is_diggy_rock(name) then
return
end

-- Entity is not a support
if not is_support_beam(name) then
return
Expand Down
24 changes: 7 additions & 17 deletions map_gen/maps/diggy/feature/night_time.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
-- @module NightTime
--


-- dependencies
local Event = require 'utils.event'
local RS = require 'map_gen.shared.redmew_surface'
Expand All @@ -19,30 +18,17 @@ local NightTime = {}
local function on_built_entity(event)
local player = game.get_player(event.player_index)
local entity = event.entity
if (entity.name == 'solar-panel') then
Popup.player(
player, {'diggy.night_time_warning'}
)
if entity.name == 'solar-panel' then
Popup.player(player, { 'diggy.night_time_warning' })
end
end

--- Event handler for on_research_finished
-- sets the force, which the research belongs to, recipe for solar-panel-equipment
-- to false, to prevent wastefully crafting. The technology is needed for further progression
-- @param event table containing the on_research_finished event specific attributes
--
local function on_research_finished(event)
local force = event.research.force
force.recipes["solar-panel-equipment"].enabled = false
end

--- Setup of on_built_entity and on_research_finished events
-- assigns the two events to the corresponding local event handlers
-- @param config table containing the configurations for NightTime.lua
--
function NightTime.register()
Event.add(defines.events.on_built_entity, on_built_entity)
Event.add(defines.events.on_research_finished, on_research_finished)
end

--- Sets the daytime to 0.5 and freezes the day/night circle.
Expand All @@ -51,8 +37,12 @@ end
function NightTime.on_init()
local surface = RS.get_surface()

surface.daytime = 0.5
surface.daytime = 0.42 --0.5
surface.freeze_daytime = true
surface.solar_power_multiplier = 0
surface.min_brightness = 0.11
surface.show_clouds = false
surface.brightness_visual_weights = { 1 / 0.85, 1 / 0.85, 1 / 0.85 }
end

return NightTime
2 changes: 1 addition & 1 deletion map_gen/maps/diggy/presets/danger_ores.lua
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ local config = {
entity_name = 'coal',
},
disable_mining_productivity = {
enabled = true,
enabled = false,
load = function() return require 'map_gen.maps.diggy.feature.mining_productivity' end,
replace = script.active_mods['redmew-data'] == nil, -- replace mining productivity with robot cargo capacity
},
Expand Down
2 changes: 1 addition & 1 deletion map_gen/maps/diggy/presets/danger_ores_BnB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ local config = {
entity_name = 'coal',
},
disable_mining_productivity = {
enabled = true,
enabled = false,
load = function() return require 'map_gen.maps.diggy.feature.mining_productivity' end,
replace = script.active_mods['redmew-data'] == nil, -- replace mining productivity with robot cargo capacity
},
Expand Down
1 change: 1 addition & 0 deletions map_gen/maps/diggy/scenario.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function Scenario.register(diggy_config)
-- disabled redmew features for diggy
local redmew_config = storage.config
redmew_config.market.enabled = false
redmew_config.redmew_surface.enabled = false
redmew_config.reactor_meltdown.enabled = false
redmew_config.hodor.enabled = false
redmew_config.paint.enabled = false
Expand Down