1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

Merge pull request #248 from iltar/small-fixes-after-second-run

Balance changes and fixes based on the second play
This commit is contained in:
Valansch 2018-10-27 00:00:51 +02:00 committed by GitHub
commit 06479dba79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 144 additions and 75 deletions

View File

@ -26,10 +26,14 @@ local Config = {
cheats = {
manual_mining_speed_modifier = 1000,
character_inventory_slots_bonus = 1000,
character_running_speed_modifier = 2,
},
},
DiggyHole = {
enabled = true,
-- enables commands like /clear-void
enable_debug_commands = false,
},
DiggyCaveCollapse = {
enabled = true,
@ -71,6 +75,7 @@ local Config = {
cracking_sounds = {
'CRACK',
'KRRRR',
'R U N',
}
},
RefreshMap = {
@ -102,25 +107,25 @@ local Config = {
-- defines the increased chance of spawning resources
-- calculated_probability = resource_probability + ((distance / distance_probability_modifier) / 100)
distance_probability_modifier = 1.5,
distance_probability_modifier = 10,
-- increases the amount of oil * oil_value_modifier
oil_value_modifier = 750,
-- percentage of chance that resources will spawn after mining
resource_probability = 0.1,
-- min percentage of chance that resources will spawn after mining
resource_probability = 0.01,
-- max chance of spawning resources based on resource_probability + calculated distance_probability_modifier
max_resource_probability = 0.4,
max_resource_probability = 0.30,
-- chances per resource of spawning, sum must be 1.00
resource_chances = {
['coal'] = 0.171,
['copper-ore'] = 0.221,
['iron-ore'] = 0.381,
['stone'] = 0.201,
['coal'] = 0.16,
['copper-ore'] = 0.215,
['iron-ore'] = 0.389,
['stone'] = 0.212,
['uranium-ore'] = 0.021,
['crude-oil'] = 0.005,
['crude-oil'] = 0.003,
},
-- minimum distance from the spawn point required before it spawns
@ -135,12 +140,12 @@ local Config = {
-- defines the chance of which resource_richness_value to spawn, sum must be 1.00
resource_richness_probability = {
['scarce'] = 0.40,
['low'] = 0.28,
['sufficient'] = 0.16,
['good'] = 0.10,
['plenty'] = 0.04,
['jackpot'] = 0.02,
['scarce'] = 0.44,
['low'] = 0.35,
['sufficient'] = 0.164,
['good'] = 0.03,
['plenty'] = 0.01,
['jackpot'] = 0.006,
},
-- defines the min and max range of ores to spawn
@ -166,7 +171,7 @@ local Config = {
enabled = true,
-- percentage * mining productivity level gets added to mining speed
mining_speed_productivity_multiplier = 10,
mining_speed_productivity_multiplier = 5,
-- market config
market_spawn_position = {x = 0, y = 3},
@ -200,7 +205,9 @@ local Config = {
{stone = 450, type = 'buff', prototype = {name = 'inventory_slot', value = 2}},
{stone = 450, type = 'buff', prototype = {name = 'stone_automation', value = 5}},
{stone = 450, type = 'market', prototype = {price = 850, name = 'submachine-gun'}},
{stone = 450, type = 'market', prototype = {price = 850, name = 'shotgun'}},
{stone = 450, type = 'market', prototype = {price = 50, name = 'firearm-magazine'}},
{stone = 450, type = 'market', prototype = {price = 50, name = 'shotgun-shell'}},
{stone = 450, type = 'market', prototype = {price = 500, name = 'light-armor'}},
{stone = 750, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
@ -236,110 +243,156 @@ local Config = {
{stone = 10000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 10000, type = 'market', prototype = {price = 750, name = 'heavy-armor'}},
{stone = 15000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 15000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 15000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 25000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 25000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 25000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 25000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 35000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 35000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 35000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 35000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 35000, type = 'market', prototype = {price = 100, name = 'piercing-rounds-magazine'}},
{stone = 35000, type = 'market', prototype = {price = 100, name = 'piercing-shotgun-shell'}},
{stone = 35000, type = 'market', prototype = {price = 1500, name = 'modular-armor'}},
{stone = 50000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 50000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 50000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 50000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 75000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 75000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 75000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 75000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 100000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 100000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 100000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 100000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 125000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 125000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 125000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 125000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 150000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 150000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 150000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 150000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 175000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 175000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 175000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 175000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 200000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 200000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 200000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 200000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 225000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 225000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 225000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 225000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 250000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 250000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 250000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 250000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 275000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 275000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 275000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 275000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 300000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 300000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 300000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 300000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 350000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 350000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 350000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 2500, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 350000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 400000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 400000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 400000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 400000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 500000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 500000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 500000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 500000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 600000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 600000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 600000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 600000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 700000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 700000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 700000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 700000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 800000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 800000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 800000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 800000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 800000, type = 'market', prototype = {price = 250, name = 'uranium-rounds-magazine'}},
{stone = 800000, type = 'market', prototype = {price = 1000, name = 'combat-shotgun'}},
{stone = 900000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 900000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 900000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 900000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 1000000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 1000000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 1000000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 1000000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 1250000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 1250000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 1250000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 1250000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 1500000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 1500000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 1500000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 1500000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 1750000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 1750000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 1750000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 1750000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 2000000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 2000000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 2000000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 2000000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 2500000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 2500000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 2500000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 2500000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 3000000, type = 'buff', prototype = {name = 'mining_speed', value = 2}},
{stone = 3000000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 3000000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 3000000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 3500000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 3500000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 3500000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 4000000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 4000000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 4000000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 4500000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 4500000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 4500000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 5000000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 5000000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 5000000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 6000000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 6000000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 6000000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 7000000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 7000000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 7000000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 8000000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 8000000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 8000000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 9000000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 9000000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 9000000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
{stone = 10000000, type = 'buff', prototype = {name = 'mining_speed', value = 5}},
{stone = 10000000, type = 'buff', prototype = {name = 'stone_automation', value = 2}},
{stone = 10000000, type = 'buff', prototype = {name = 'inventory_slot', value = 1}},
},
},
},

View File

@ -148,15 +148,17 @@ local function spawn_cracking_sound_text(surface, position)
b = 0
}
local create_entity = surface.create_entity
for i = 1, #text do
local x_offset = (i - #text / 2 - 1) / 3
local char = text:sub(i, i)
surface.create_entity {
name = 'flying-text',
color = color,
text = char,
position = {x = position.x + x_offset, y = position.y - ((i + 1) % 2) / 4}
}.active = true
create_entity {
name = 'flying-text',
color = color,
text = char,
position = {x = position.x + x_offset, y = position.y - ((i + 1) % 2) / 4}
}.active = true
end
end
@ -185,7 +187,6 @@ end
local function on_built_tile(surface, new_tile, tiles)
local new_tile_strength = support_beam_entities[new_tile.name]
for _, tile in pairs(tiles) do
if new_tile_strength then
stress_map_add(surface, tile.position, -1 * new_tile_strength, true)
@ -414,7 +415,7 @@ end
@return number sum of old fraction + new fraction
]]
function add_fraction(stress_map, x, y, fraction)
local function add_fraction(stress_map, x, y, fraction)
x = 2 * floor(x / 2)
y = 2 * floor(y / 2)

View File

@ -63,19 +63,6 @@ local function on_mined_tile(surface, tiles)
Template.insert(surface, new_tiles, {})
end
local function on_built_tile(surface, item, old_tile_and_positions)
if ('landfill' ~= item.name) then
return
end
local tiles = {}
for _, tile in pairs(old_tile_and_positions) do
insert(tiles, {name = 'dirt-' .. random(1, 7), position = tile.position})
end
Template.insert(surface, tiles)
end
--[[--
Registers all event handlers.
]]
@ -113,13 +100,37 @@ function DiggyHole.register(config)
on_mined_tile(game.surfaces[event.surface_index], event.tiles)
end)
Event.add(defines.events.on_robot_built_tile, function (event)
on_built_tile(event.robot.surface, item, tiles)
end)
if config.enable_debug_commands then
commands.add_command('clear-void', '<left top x> <left top y> <width> <height> <surface index> triggers Template.insert for the given area.', function(cmd)
local params = {}
local args = cmd.parameter or ''
for param in string.gmatch(args, '%S+') do
table.insert(params, param)
end
Event.add(defines.events.on_player_built_tile, function (event)
on_built_tile(game.surfaces[event.surface_index], event.item, event.tiles)
end)
if (#params ~= 5) then
game.player.print('/clear-void requires exactly 5 arguments: <left top x> <left top y> <width> <height> <surface index>')
return
end
local left_top_x = tonumber(params[1])
local left_top_y = tonumber(params[2])
local width = tonumber(params[3])
local height = tonumber(params[4])
local surface_index = params[5]
local tiles = {}
local entities = {}
for x = 0, width do
for y = 0, height do
insert(tiles, {name = 'dirt-' .. random(1, 7), position = {x = x + left_top_x, y = y + left_top_y}})
end
end
Template.insert(game.surfaces[surface_index], tiles, entities)
end
)
end
end
function DiggyHole.on_init()

View File

@ -503,7 +503,7 @@ function MarketExchange.register(cfg)
Event.on_nth_tick(config.void_chest_frequency, function ()
local send_to_surface = 0
local find_entities_filtered = game.surfaces.nauvis.find_entities_filtered
local chests = find_entities_filtered({area = area, type = {'container', 'logistics-container'}})
local chests = find_entities_filtered({area = area, type = {'container', 'logistic-container'}})
local to_fetch = stone_collecting.active_modifier
for _, chest in pairs(chests) do

View File

@ -76,7 +76,7 @@ function ScatteredResources.register(config)
local distance = floor(sqrt(x^2 + y^2))
local calculated_probability = config.resource_probability + ((distance / config.distance_probability_modifier) / 100)
local probability = 0.7
local probability = config.max_resource_probability
if (calculated_probability < probability) then
probability = calculated_probability

View File

@ -39,6 +39,7 @@ function SetupPlayer.register(config)
Debug.cheat(function()
player.force.manual_mining_speed_modifier = config.cheats.manual_mining_speed_modifier
player.force.character_inventory_slots_bonus = config.cheats.character_inventory_slots_bonus
player.character_running_speed_modifier = config.cheats.character_running_speed_modifier
end)
end)
end

View File

@ -24,6 +24,7 @@ function StartingZone.register(config)
local function on_chunk_generated(event)
local start_point_area = {{-0.9, -0.9}, {0.9, 0.9}}
local start_point_cleanup = {{-0.9, -0.9}, {1.9, 1.9}}
local surface = event.surface
-- hack to figure out whether the important chunks are generated via Diggy.Feature.RefreshMap.
@ -32,7 +33,7 @@ function StartingZone.register(config)
end
-- ensure a clean starting point
for _, entity in pairs(surface.find_entities_filtered({area = start_point_area, type = 'resource'})) do
for _, entity in pairs(surface.find_entities_filtered({area = start_point_cleanup, type = 'resource'})) do
entity.destroy()
end
@ -81,6 +82,8 @@ function StartingZone.on_init()
surface.daytime = 0.5
surface.freeze_daytime = 1
-- base factorio = pollution_factor = 0.000015
game.map_settings.enemy_evolution.pollution_factor = 0.000002
end