mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-03-05 15:05:57 +02:00
Added mining speed bonus on mining productivity research
This commit is contained in:
parent
0a9235ad4d
commit
ddfe58ba1f
@ -41,6 +41,9 @@ local Config = {
|
||||
enabled = true,
|
||||
register = require 'map_gen.Diggy.Feature.DiggyHole'.register,
|
||||
initialize = require 'map_gen.Diggy.Feature.DiggyHole'.initialize,
|
||||
|
||||
-- percentage * mining productivity level gets added to mining speed
|
||||
mining_speed_productivity_multiplier = 15,
|
||||
},
|
||||
DiggyCaveCollapse = {
|
||||
enabled = true,
|
||||
|
@ -7,6 +7,7 @@
|
||||
local Event = require 'utils.event'
|
||||
local Scanner = require 'map_gen.Diggy.Scanner'
|
||||
local Template = require 'map_gen.Diggy.Template'
|
||||
local Debug = require 'map_gen.Diggy.Debug'
|
||||
|
||||
-- this
|
||||
local DiggyHole = {}
|
||||
@ -56,7 +57,9 @@ local artificial_tiles = {
|
||||
--[[--
|
||||
Registers all event handlers.
|
||||
]]
|
||||
function DiggyHole.register(config)
|
||||
function DiggyHole.register(cfg)
|
||||
local config = cfg.features.DiggyHole
|
||||
|
||||
Event.add(defines.events.on_entity_died, function (event)
|
||||
diggy_hole(event.entity)
|
||||
end)
|
||||
@ -94,6 +97,11 @@ function DiggyHole.register(config)
|
||||
|
||||
Template.insert(game.surfaces[event.surface_index], tiles, {})
|
||||
end)
|
||||
|
||||
Event.add(defines.events.on_research_finished, function(event)
|
||||
local player = game.forces.player
|
||||
player.manual_mining_speed_modifier = player.mining_drill_productivity_bonus * config.mining_speed_productivity_multiplier / 2
|
||||
end)
|
||||
end
|
||||
|
||||
--[[--
|
||||
|
@ -18,6 +18,7 @@ local StartingZone = {}
|
||||
]]
|
||||
function StartingZone.register(config)
|
||||
local callback_token
|
||||
local starting_zone_size = config.features.StartingZone.starting_size
|
||||
|
||||
local function on_chunk_generated(event)
|
||||
local start_point_area = {{-1, -1}, {0, 0}}
|
||||
@ -37,18 +38,18 @@ function StartingZone.register(config)
|
||||
local tiles = {}
|
||||
local rocks = {}
|
||||
|
||||
Mask.circle(0, 0, config.features.StartingZone.starting_size, function(x, y, tile_distance_to_center)
|
||||
if (tile_distance_to_center > math.floor(config.features.StartingZone.starting_size / 2)) then
|
||||
Mask.circle(0, 0, starting_zone_size, function(x, y, tile_distance_to_center)
|
||||
if (tile_distance_to_center > math.floor(starting_zone_size / 2)) then
|
||||
table.insert(tiles, {name = 'dirt-' .. math.random(1, 7), position = {x = x, y = y}})
|
||||
else
|
||||
table.insert(tiles, {name = 'stone-path', position = {x = x, y = y}})
|
||||
end
|
||||
|
||||
if (tile_distance_to_center > config.features.StartingZone.starting_size - 2) then
|
||||
if (tile_distance_to_center > starting_zone_size - 2) then
|
||||
table.insert(rocks, {name = 'sand-rock-big', position = {x = x, y = y}})
|
||||
end
|
||||
|
||||
if (tile_distance_to_center > math.floor(config.features.StartingZone.starting_size / 10)) then
|
||||
if (tile_distance_to_center > math.floor(starting_zone_size / 10)) then
|
||||
Mask.blur(x, y, -0.3, function (x, y, fraction)
|
||||
StressMap.add(event.surface, {x = x, y = y}, fraction)
|
||||
end)
|
||||
|
Loading…
x
Reference in New Issue
Block a user