1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-03-17 21:08:08 +02:00

Add Danger Ore Expensive Grid Factory (#1366)

This commit is contained in:
Cinecraft 2023-07-01 20:45:05 +02:00 committed by GitHub
parent f1aec82d6c
commit 5a63ac8337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 371 additions and 1 deletions

View File

@ -76,7 +76,7 @@ exclude_files = {
'**/combat-tester/',
'**/test-maker/',
'**/trailer/',
--Ignore map luas
'**/map_gen/data/presets/',
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -0,0 +1,70 @@
return {
height = 64,
width = 64,
data = {
{1,27,2,10,1,27,},
{1,27,2,10,1,27,},
{1,26,2,12,1,26,},
{1,26,2,12,1,26,},
{1,26,2,12,1,26,},
{1,25,2,14,1,25,},
{1,11,2,4,1,10,2,14,1,10,2,4,1,11,},
{1,10,2,6,1,8,2,16,1,8,2,6,1,10,},
{1,9,2,9,1,4,2,20,1,4,2,9,1,9,},
{1,8,2,48,1,8,},
{1,7,2,50,1,7,},
{1,6,2,52,1,6,},
{1,6,2,52,1,6,},
{1,6,2,52,1,6,},
{1,6,2,52,1,6,},
{1,7,2,50,1,7,},
{1,8,2,48,1,8,},
{1,8,2,48,1,8,},
{1,9,2,46,1,9,},
{1,9,2,46,1,9,},
{1,9,2,46,1,9,},
{1,9,2,19,1,2,2,4,1,2,2,19,1,9,},
{1,8,2,18,1,4,2,4,1,4,2,18,1,8,},
{1,8,2,17,1,5,2,4,1,5,2,17,1,8,},
{1,7,2,17,1,6,2,4,1,6,2,17,1,7,},
{1,5,2,18,1,7,2,4,1,7,2,18,1,5,},
{1,2,2,20,1,8,2,4,1,8,2,20,1,2,},
{2,22,1,8,2,4,1,8,2,22,},
{2,21,1,9,2,4,1,9,2,21,},
{2,21,1,9,2,4,1,9,2,21,},
{2,64,},
{2,64,},
{2,64,},
{2,64,},
{2,21,1,9,2,4,1,9,2,21,},
{2,21,1,9,2,4,1,9,2,21,},
{2,22,1,8,2,4,1,8,2,22,},
{1,2,2,20,1,8,2,4,1,8,2,20,1,2,},
{1,5,2,18,1,7,2,4,1,7,2,18,1,5,},
{1,7,2,17,1,6,2,4,1,6,2,17,1,7,},
{1,8,2,17,1,5,2,4,1,5,2,17,1,8,},
{1,8,2,18,1,4,2,4,1,4,2,18,1,8,},
{1,9,2,19,1,2,2,4,1,2,2,19,1,9,},
{1,9,2,46,1,9,},
{1,9,2,46,1,9,},
{1,9,2,46,1,9,},
{1,8,2,48,1,8,},
{1,8,2,48,1,8,},
{1,7,2,50,1,7,},
{1,6,2,52,1,6,},
{1,6,2,52,1,6,},
{1,6,2,52,1,6,},
{1,6,2,52,1,6,},
{1,7,2,50,1,7,},
{1,8,2,48,1,8,},
{1,9,2,9,1,4,2,20,1,4,2,9,1,9,},
{1,10,2,6,1,8,2,16,1,8,2,6,1,10,},
{1,11,2,4,1,10,2,14,1,10,2,4,1,11,},
{1,25,2,14,1,25,},
{1,26,2,12,1,26,},
{1,26,2,12,1,26,},
{1,26,2,12,1,26,},
{1,27,2,10,1,27,},
{1,27,2,10,1,27,},
}
}

View File

@ -0,0 +1,121 @@
local b = require 'map_gen.shared.builders'
local gear_pic = b.decompress(require 'map_gen.data.presets.gear_64by64')
return function(config)
local main_ores = config.main_ores
local shuffle_order = config.main_ores_shuffle_order
local gear = b.picture(gear_pic)
return function(tile_builder, ore_builder, spawn_shape, _, random_gen)
local grid_tile_size = 64
local shapes = {}
for _, ore_data in pairs(main_ores) do
local ore_name = ore_data.name
local tiles = {
[1] = 'concrete'
}
local land = tile_builder(tiles)
local ratios = ore_data.ratios
local weighted = b.prepare_weighted_array(ratios)
local amount = ore_data.start
local ore = ore_builder(ore_name, amount, ratios, weighted)
local shape = b.apply_entity(land, ore)
shapes[#shapes + 1] = shape
end
local count = #shapes
local pattern = {}
for r = 1, count do
local row = {}
pattern[r] = row
for c = 1, count do
local index = (c - r) % count + 1
row[c] = shapes[index]
end
end
local ores = b.grid_pattern_no_offset(pattern, count, count, grid_tile_size, grid_tile_size)
if shuffle_order then
local outer_pattern = {}
for r = 1, 50 do
local row = {}
outer_pattern[r] = row
for c = 1, 50 do
local index = random_gen(count)
row[c] = shapes[index]
end
end
local outer_ores = b.grid_pattern_no_offset(outer_pattern, 50, 50, grid_tile_size, grid_tile_size)
local start_size = grid_tile_size * 3
ores = b.choose(b.rectangle(start_size), ores, outer_ores)
end
-- concrete grid below ores
local concrete_ores = b.change_tile(ores, 'concrete', 'refined-concrete')
local plus64 = b.add(b.rectangle(64, 2), b.rectangle(2, 64))
local plus_grid = b.single_pattern(plus64, grid_tile_size, grid_tile_size)
ores = b.choose(plus_grid, concrete_ores, ores)
-- water via throttle
-- ores = b.translate(ores, 31, 31)
-- local concrete_map = b.throttle_xy(ores, 62, 64, 62, 64)
-- concrete_map = b.translate(concrete_map, -31, -31)
-- local water_map = b.change_tile(concrete_map, false, 'water-shallow')
-- spawn setup::
local gear_shape = b.add(b.scale(gear, 1), b.circle(16))
local square_o = b.subtract(b.rectangle(64, 64), b.rectangle(62, 62))
gear_shape = b.subtract(gear_shape, square_o) -- trim 1 tile around
gear_shape = b.choose(gear_shape, b.tile('orange-refined-concrete'), b.empty_shape)
local cc_gear_shadow = b.choose(b.circle((grid_tile_size / 2) - 1), b.tile('concrete'), b.empty_shape)
local spawn_cc_rect = b.choose(b.rectangle(grid_tile_size), concrete_ores, ores) --overlay ores
spawn_cc_rect = b.any({spawn_shape, gear_shape, cc_gear_shadow, spawn_cc_rect})
-- walkways::
local left_tile = b.tile('refined-hazard-concrete-left')
local right_tile = b.tile('refined-hazard-concrete-right')
local water_tiles = {
[1] = b.tile('water'),
[2] = b.tile('deepwater'),
[3] = b.tile('water-shallow'),
[4] = b.tile('water-wube')
}
local water_tile = water_tiles[random_gen(#water_tiles)]
local walk_pattern = {}
for i = 1, grid_tile_size do
walk_pattern[i] = {}
for j = 1, grid_tile_size do
walk_pattern[i][j] = b.empty_shape()
if i == 1 or i == 64 then
walk_pattern[i][j] = water_tile
end
if j == 1 or j == 64 then
walk_pattern[i][j] = water_tile
end
end
end
-- middle x
-- top
walk_pattern[ 1][32] = right_tile -- b.tile('red-refined-concrete')
walk_pattern[ 1][33] = left_tile -- b.tile('green-refined-concrete')
-- bottom
walk_pattern[64][32] = left_tile -- b.tile('blue-refined-concrete')
walk_pattern[64][33] = right_tile -- b.tile('yellow-refined-concrete')
-- middle y
-- left
walk_pattern[32][ 1] = right_tile -- b.tile('orange-refined-concrete')
walk_pattern[33][ 1] = left_tile -- b.tile('pink-refined-concrete')
-- right
walk_pattern[32][64] = left_tile -- b.tile('purple-refined-concrete')
walk_pattern[33][64] = right_tile -- b.tile('cyan-refined-concrete')
local hazard_grid = b.grid_pattern_no_offset(walk_pattern, 64, 64, 1, 1)
hazard_grid = b.translate(hazard_grid, 33, 33)
local map = b.any {hazard_grid, spawn_cc_rect, ores}
return b.set_hidden_tile(map, 'sand-1') -- tile below concrete
end
end

View File

@ -59,6 +59,11 @@ local maps = {
mod_pack = normal_mod_pack,
display_name = 'chessboard uniform (fixed squares)'
},
{
name = 'danger-ore-expensive-grid-factory-beltboxes-ore-only',
mod_pack = normal_mod_pack,
display_name = 'Concrete-chessboard uniform (fixed squares)'
},
{
name = 'danger-ore-circles-beltboxes-ore-only',
mod_pack = normal_mod_pack,

View File

@ -0,0 +1,173 @@
local RS = require 'map_gen.shared.redmew_surface'
local MGSP = require 'resources.map_gen_settings'
local MDFS = require 'resources.difficulty_settings'
local Event = require 'utils.event'
local b = require 'map_gen.shared.builders'
local Config = require 'config'
local ScenarioInfo = require 'features.gui.info'
ScenarioInfo.set_map_name('Danger Ore Expensive Grid Factory Beltboxes (ore only)')
ScenarioInfo.set_map_description([[
Clear the ore to expand the factory,
focus mining efforts on specific sectors to ensure
proper material ratios, expand the map with pollution!
]])
ScenarioInfo.add_map_extra_info([[
This map is split in three sectors [item=iron-ore] [item=copper-ore] [item=coal].
Each sector has a main resource and the other resources at a lower ratio.
You may not build the factory on ore patches. Exceptions:
[item=burner-mining-drill] [item=electric-mining-drill] [item=pumpjack] [item=small-electric-pole] [item=medium-electric-pole] [item=big-electric-pole] [item=substation] [item=car] [item=tank] [item=spidertron] [item=locomotive] [item=cargo-wagon] [item=fluid-wagon] [item=artillery-wagon]
[item=transport-belt] [item=fast-transport-belt] [item=express-transport-belt] [item=underground-belt] [item=fast-underground-belt] [item=express-underground-belt] [item=rail] [item=rail-signal] [item=rail-chain-signal] [item=train-stop]
The map size is restricted to the pollution generated. A significant amount of
pollution must affect a section of the map before it is revealed. Pollution
does not affect biter evolution.]])
ScenarioInfo.set_new_info([[
2019-04-24:
- Stone ore density reduced by 1/2
- Ore quadrants randomized
- Increased time factor of biter evolution from 5 to 7
- Added win conditions (+5% evolution every 5 rockets until 100%, +100 rockets until biters are wiped)
2019-03-30:
- Uranium ore patch threshold increased slightly
- Bug fix: Cars and tanks can now be placed onto ore!
- Starting minimum pollution to expand map set to 650
View current pollution via Debug Settings [F4] show-pollution-values,
then open map and turn on pollution via the red box.
- Starting water at spawn increased from radius 8 to radius 16 circle.
2019-03-27:
- Ore arranged into quadrants to allow for more controlled resource gathering.
2020-09-02:
- Destroyed chests dump their content as coal ore.
2020-12-28:
- Changed win condition. First satellite kills all biters, launch 500 to win the map.
2021-04-06:
- Rail signals and train stations now allowed on ore.
]])
ScenarioInfo.add_extra_rule({'info.rules_text_danger_ore'})
global.config.redmew_qol.loaders = false
local map = require 'map_gen.maps.danger_ores.modules.map'
local main_ores_config = require 'map_gen.maps.danger_ores.config.deadlock_beltboxes_ores_landfill'
-- local resource_patches = require 'map_gen.maps.danger_ores.modules.resource_patches'
-- local resource_patches_config = require 'map_gen.maps.danger_ores.config.deadlock_beltboxes_resource_patches'
local water = require 'map_gen.maps.danger_ores.modules.water'
local trees = require 'map_gen.maps.danger_ores.modules.trees'
local enemy = require 'map_gen.maps.danger_ores.modules.enemy'
-- local dense_patches = require 'map_gen.maps.danger_ores.modules.dense_patches'
local banned_entities = require 'map_gen.maps.danger_ores.modules.banned_entities'
local allowed_entities = require 'map_gen.maps.danger_ores.config.deadlock_beltboxes_allowed_entities'
banned_entities(allowed_entities)
RS.set_map_gen_settings({
MGSP.grass_only,
MGSP.enable_water,
{terrain_segmentation = 'normal', water = 'normal'},
MGSP.starting_area_very_low,
MGSP.ore_oil_none,
MGSP.enemy_none,
MGSP.cliff_none,
MGSP.tree_none
})
RS.set_difficulty_settings({
MDFS.expensive_recipe
})
Config.market.enabled = false
Config.player_rewards.enabled = false
Config.player_create.starting_items = {}
Config.dump_offline_inventories = {
enabled = true,
offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team
}
Config.paint.enabled = false
Event.on_init(function()
-- game.draw_resource_selection = false
game.forces.player.technologies['mining-productivity-1'].enabled = false
game.forces.player.technologies['mining-productivity-2'].enabled = false
game.forces.player.technologies['mining-productivity-3'].enabled = false
game.forces.player.technologies['mining-productivity-4'].enabled = false
game.difficulty_settings.technology_price_multiplier = 20
game.forces.player.technologies.logistics.researched = true
game.forces.player.technologies.automation.researched = true
-- game.forces.player.technologies['logistic-system'].enabled = false
-- game.forces.player.technologies['warehouse-logistics-research-2'].enabled = false
game.map_settings.enemy_evolution.time_factor = 0.000007 -- default 0.000004
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
game.forces.player.manual_mining_speed_modifier = 1
RS.get_surface().always_day = true
RS.get_surface().peaceful_mode = true
end)
local terraforming = require 'map_gen.maps.danger_ores.modules.terraforming'
terraforming({start_size = 8 * 32, min_pollution = 600, max_pollution = 24000, pollution_increment = 9})
local rocket_launched = require 'map_gen.maps.danger_ores.modules.rocket_launched_simple'
rocket_launched({win_satellite_count = 1000})
local restart_command = require 'map_gen.maps.danger_ores.modules.restart_command'
restart_command({scenario_name = 'danger-ore-expensive-grid-factory-beltboxes-ore-only'})
local container_dump = require 'map_gen.maps.danger_ores.modules.container_dump'
container_dump({entity_name = 'coal'})
local concrete_on_landfill = require 'map_gen.maps.danger_ores.modules.concrete_on_landfill'
concrete_on_landfill({tile = 'blue-refined-concrete'})
local remove_non_ore_stacked_recipes = require 'map_gen.maps.danger_ores.modules.remove_non_ore_stacked_recipes'
remove_non_ore_stacked_recipes()
require 'map_gen.maps.danger_ores.modules.biter_drops'
require 'map_gen.maps.danger_ores.modules.map_poll'
local main_ores_builder = require 'map_gen.maps.danger_ores.modules.main_ores_grid_factory'
local config = {
spawn_shape = b.circle(20),
start_ore_shape = b.circle(40),
no_resource_patch_shape = b.circle(80),
main_ores_builder = main_ores_builder,
main_ores = main_ores_config,
main_ores_shuffle_order = false,
spawn_tile = 'orange-refined-concrete',
-- spawn_tile = 'lab-dark-1',
-- resource_patches = resource_patches,
-- resource_patches_config = resource_patches_config,
water = water,
water_scale = 1 / 96,
water_threshold = 0.4,
deepwater_threshold = 0.45,
trees = trees,
trees_scale = 1 / 64,
trees_threshold = 0.4,
trees_chance = 0.875,
enemy = enemy,
enemy_factor = 10 / (768 * 32),
enemy_max_chance = 1 / 6,
enemy_scale_factor = 32,
fish_spawn_rate = 0.025,
-- dense_patches = dense_patches,
dense_patches_scale = 1 / 48,
dense_patches_threshold = 0.55,
dense_patches_multiplier = 25
}
return map(config)

View File

@ -0,0 +1 @@
return require 'map_gen.maps.danger_ores.presets.danger_ore_expensive_grid_factory_beltboxes_ore_only'