mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-12 10:04:40 +02:00
Merge pull request #930 from linaori/diggy-tweaks
Some diggy tweaks based on feedback
This commit is contained in:
commit
f73039a55e
@ -2,6 +2,7 @@ local table = require 'utils.table'
|
||||
local Event = require 'utils.event'
|
||||
local Global = require 'utils.global'
|
||||
local Info = require 'features.gui.info'
|
||||
local pairs = pairs
|
||||
|
||||
local get_random_weighted = table.get_random_weighted
|
||||
|
||||
|
@ -26,8 +26,11 @@ local Config = {
|
||||
{name = 'iron-gear-wheel', count = 8},
|
||||
{name = 'iron-plate', count = 16}
|
||||
},
|
||||
-- applied when _CHEATS is set to true and _DEBUG is NOT true. It's recommended to tweak this to your needs
|
||||
-- when playing with cheats on (recommended for single player or LAN with limited players)
|
||||
|
||||
-- 0.01 bonus equals 1% in game. This value is recommended to be tweaked for single player
|
||||
initial_mining_speed_bonus = 1,
|
||||
|
||||
-- applied when _CHEATS is set to true and _DEBUG is NOT true.
|
||||
-- see config.lua -> config.player_create.cheats for available options
|
||||
cheats = {
|
||||
enabled = true,
|
||||
@ -52,7 +55,10 @@ local Config = {
|
||||
-- initial damage per tick it damages a rock to mine, can be enhanced by robot_damage_per_mining_prod_level
|
||||
robot_initial_mining_damage = 4,
|
||||
-- damage added per level of mining productivity level research
|
||||
robot_damage_per_mining_prod_level = 1
|
||||
robot_damage_per_mining_prod_level = 1,
|
||||
|
||||
-- turn this setting on if you want to bring back landfill research, default is off due to griefing
|
||||
allow_landfill_research = false,
|
||||
},
|
||||
-- adds the ability to collapse caves
|
||||
diggy_cave_collapse = {
|
||||
|
@ -31,7 +31,7 @@ local collapse_rocks_size = #collapse_rocks
|
||||
-- this
|
||||
local DiggyCaveCollapse = {}
|
||||
|
||||
local config = {}
|
||||
local config
|
||||
|
||||
local n = 9
|
||||
local radius = 0
|
||||
|
@ -11,7 +11,6 @@ local ScoreTable = require 'map_gen.maps.diggy.score_table'
|
||||
local Command = require 'utils.command'
|
||||
local CreateParticles = require 'features.create_particles'
|
||||
local Ranks = require 'resources.ranks'
|
||||
|
||||
local random = math.random
|
||||
local tonumber = tonumber
|
||||
local pairs = pairs
|
||||
@ -23,6 +22,7 @@ local raise_event = script.raise_event
|
||||
|
||||
-- this
|
||||
local DiggyHole = {}
|
||||
local config
|
||||
|
||||
-- keeps track of the amount of times per player when they mined with a full inventory in a row
|
||||
local full_inventory_mining_cache = {}
|
||||
@ -151,8 +151,9 @@ end)
|
||||
--[[--
|
||||
Registers all event handlers.
|
||||
]]
|
||||
function DiggyHole.register(config)
|
||||
robot_mining.damage = config.robot_initial_mining_damage
|
||||
function DiggyHole.register(cfg)
|
||||
config = cfg
|
||||
robot_mining.damage = cfg.robot_initial_mining_damage
|
||||
ScoreTable.set('Robot mining damage', robot_mining.damage)
|
||||
ScoreTable.reset('Mine size')
|
||||
|
||||
@ -241,7 +242,7 @@ function DiggyHole.register(config)
|
||||
increment_score('Mine size')
|
||||
end)
|
||||
|
||||
local robot_damage_per_mining_prod_level = config.robot_damage_per_mining_prod_level
|
||||
local robot_damage_per_mining_prod_level = cfg.robot_damage_per_mining_prod_level
|
||||
Event.add(defines.events.on_research_finished, function (event)
|
||||
local new_modifier = event.research.force.mining_drill_productivity_bonus * 50 * robot_damage_per_mining_prod_level
|
||||
|
||||
@ -256,7 +257,7 @@ function DiggyHole.register(config)
|
||||
end
|
||||
|
||||
function DiggyHole.on_init()
|
||||
game.forces.player.technologies['landfill'].enabled = false
|
||||
game.forces.player.technologies['landfill'].enabled = config.allow_landfill_research
|
||||
game.forces.player.technologies['atomic-bomb'].enabled = false
|
||||
end
|
||||
|
||||
|
@ -58,7 +58,7 @@ Global.register(
|
||||
end
|
||||
)
|
||||
|
||||
local config = {}
|
||||
local config
|
||||
|
||||
local gain_xp_color = Color.light_sky_blue
|
||||
local lose_xp_color = Color.red
|
||||
@ -263,8 +263,6 @@ local function on_research_finished(event)
|
||||
Experience.update_inventory_slots(force, 0)
|
||||
Experience.update_mining_speed(force, 0)
|
||||
Experience.update_health_bonus(force, 0)
|
||||
|
||||
game.forces.player.technologies['landfill'].enabled = false
|
||||
end
|
||||
|
||||
---Awards experience when a rocket has been launched based on percentage of total experience
|
||||
|
@ -1,27 +1,28 @@
|
||||
local Event = require 'utils.event'
|
||||
|
||||
local SetupPlayer = {}
|
||||
local config
|
||||
|
||||
global.SetupPlayer = {
|
||||
first_player_spawned = false
|
||||
}
|
||||
|
||||
function SetupPlayer.register(config)
|
||||
function SetupPlayer.register(cfg)
|
||||
config = cfg
|
||||
Event.add(
|
||||
defines.events.on_player_created,
|
||||
function()
|
||||
local redmew_player_create = global.config.player_create
|
||||
|
||||
if #config.starting_items > 0 then
|
||||
redmew_player_create.starting_items = config.starting_items
|
||||
if #cfg.starting_items > 0 then
|
||||
redmew_player_create.starting_items = cfg.starting_items
|
||||
end
|
||||
|
||||
if not _DEBUG then
|
||||
local cheats = config.cheats
|
||||
redmew_player_create.cheats = cheats
|
||||
redmew_player_create.cheats = cfg.cheats
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
function SetupPlayer.on_init()
|
||||
game.forces.player.manual_mining_speed_modifier = config.initial_mining_speed_bonus
|
||||
end
|
||||
|
||||
return SetupPlayer
|
||||
|
@ -38,7 +38,7 @@ return {
|
||||
['iron-ore'] = 389,
|
||||
['stone'] = 212,
|
||||
['uranium-ore'] = 21,
|
||||
['crude-oil'] = 3,
|
||||
['crude-oil'] = 8,
|
||||
},
|
||||
distances = {
|
||||
['coal'] = 16,
|
||||
|
@ -210,8 +210,8 @@ return {
|
||||
},
|
||||
},
|
||||
weights = {
|
||||
['skip'] = 997,
|
||||
['crude-oil'] = 3,
|
||||
['skip'] = 990,
|
||||
['crude-oil'] = 10,
|
||||
},
|
||||
distances = {
|
||||
['crude-oil'] = 57,
|
||||
|
@ -198,8 +198,8 @@ return {
|
||||
},
|
||||
},
|
||||
weights = {
|
||||
['skip'] = 997,
|
||||
['crude-oil'] = 3,
|
||||
['skip'] = 990,
|
||||
['crude-oil'] = 10,
|
||||
},
|
||||
distances = {
|
||||
['crude-oil'] = 57,
|
||||
|
Loading…
Reference in New Issue
Block a user