-
Notifications
You must be signed in to change notification settings - Fork 79
Danger Ores: shared main-ores factory, standardized numbers (A-F), fluent API (G) #1573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
grilledham
merged 31 commits into
Refactorio:develop
from
lex:danger-ore-shared-ore-config
Jul 10, 2026
Merged
Changes from 24 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
babe294
Tetrominoes: use shared vanilla_ores_stone ore config
lex d3feca1
Voronoi: use shared vanilla_ores_stone ore config
lex c7fc424
Tetrominoes: enforce the 4-ore minimum at map creation
lex 032d702
Voronoi: enforce the 4-ore minimum at map creation
lex 2448123
Derive 3way_ores from x_cross_ores
lex 732f46b
Add ore config test suite
lex ebf07f4
Danger Ores: add a factory for the standard main-ore configs
lex d82dd74
Danger Ores: derive vanilla_ores from the main-ores factory
lex 22532c2
Danger Ores: derive vanilla_ores_one_direction from the factory
lex ab8c633
Danger Ores: derive vanilla_ores_landfill from the factory
lex c62c175
Danger Ores: derive one_direction_ores_xmas from the factory
lex 325aa7a
Danger Ores: derive x_cross_ores from the factory
lex b5d9ceb
Danger Ores: derive vanilla_ores_gridlocked from the factory
lex 72708e0
Danger Ores: derive joker_starter_area from the factory
lex 54e1694
Danger Ores: derive poor_mans_coal_fields_ores from the factory
lex cead7e5
Danger Ores: build the vanilla_ores_stone stone entry via the factory
lex dd7f5e0
Danger Ores: cover the main-ores factory in the config test suite
lex e6740b5
Danger Ores: silence unused stub argument in ore config tests
lex 2925479
Danger Ores: fold the coal-rich mix into the canonical coal mix
lex 4f86de2
Danger Ores: standardize richness curves on the vanilla pair
lex 06e1dd2
Danger Ores: retire the redundant ore config files
lex 76b2bee
Danger Ores: joker starter coal joins the standard richness budget
lex d751371
Danger Ores: fluent API for the main-ores factory
lex 69bbe6c
Danger Ores: express the standard configs through the fluent API
lex ac71c95
Danger Ores: complete the fluent API, use utils.table's deep_copy
lex 2491ec8
Danger Ores: restore the Joker starter's low coal budget
lex ea42815
Danger Ores: xmas tree keeps default tiles minus grass-4
lex b5806cf
Danger Ores: add :change_mix to the fluent API
lex 912bf06
Danger Ores: express the all-coal config through the fluent API
lex a6b31ea
Danger Ores: express the scrap config through the fluent API
lex ab6a01c
Danger Ores: named arguments for the fluent curve shorthands
lex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,92 +1,14 @@ | ||
| -- The Joker starter area: canonical sectors with time-budgeted richness -- each patch | ||
| -- holds roughly a day of a single electric mining drill's output. Plus a token | ||
| -- super-rich uranium entry. | ||
| local b = require 'map_gen.shared.builders' | ||
| local Factory = require 'map_gen.maps.danger_ores.config.main_ores_factory' | ||
|
|
||
| local mine_speed = 0.5 / 10 -- 0.5 ore/s per electric mining drill | ||
| local low = 60 * 60 * 4 * mine_speed -- 4h | ||
| local medium = 60 * 60 * 24 * mine_speed -- 24h | ||
|
|
||
| local low_value = b.exponential_value(low, 0.07, 1.45) | ||
| local medium_value = b.exponential_value(medium, 0.07, 1.45) | ||
|
|
||
| return { | ||
| { | ||
| name = 'copper-ore', | ||
| tiles = { | ||
| [1] = 'red-desert-0', | ||
| [2] = 'red-desert-1', | ||
| [3] = 'red-desert-2', | ||
| [4] = 'red-desert-3' | ||
| }, | ||
| start = 1, | ||
| weight = 1, | ||
| ratios = { | ||
| {resource = b.resource(b.full_shape, 'iron-ore', medium_value), weight = 15}, | ||
| {resource = b.resource(b.full_shape, 'copper-ore', medium_value), weight = 70}, | ||
| {resource = b.resource(b.full_shape, 'stone', medium_value), weight = 10}, | ||
| {resource = b.resource(b.full_shape, 'coal', medium_value), weight = 5} | ||
| } | ||
| }, | ||
| { | ||
| name = 'coal', | ||
| tiles = { | ||
| [1] = 'dirt-1', | ||
| [2] = 'dirt-2', | ||
| [3] = 'dirt-3', | ||
| [4] = 'dirt-4', | ||
| [5] = 'dirt-5', | ||
| [6] = 'dirt-6', | ||
| [7] = 'dirt-7' | ||
| }, | ||
| start = 1, | ||
| weight = 1, | ||
| ratios = { | ||
| {resource = b.resource(b.full_shape, 'iron-ore', low_value), weight = 18}, | ||
| {resource = b.resource(b.full_shape, 'copper-ore', low_value), weight = 9}, | ||
| {resource = b.resource(b.full_shape, 'stone', low_value), weight = 8}, | ||
| {resource = b.resource(b.full_shape, 'coal', low_value), weight = 65} | ||
| } | ||
| }, | ||
| { | ||
| name = 'iron-ore', | ||
| tiles = { | ||
| [1] = 'grass-1', | ||
| [2] = 'grass-2', | ||
| [3] = 'grass-3', | ||
| [4] = 'grass-4' | ||
| }, | ||
| start = 1, | ||
| weight = 1, | ||
| ratios = { | ||
| {resource = b.resource(b.full_shape, 'iron-ore', medium_value), weight = 75}, | ||
| {resource = b.resource(b.full_shape, 'copper-ore', medium_value), weight = 13}, | ||
| {resource = b.resource(b.full_shape, 'stone', medium_value), weight = 7}, | ||
| {resource = b.resource(b.full_shape, 'coal', medium_value), weight = 5} | ||
| } | ||
| }, | ||
| { | ||
| name = 'stone', | ||
| tiles = { | ||
| [1] = 'sand-1', | ||
| [2] = 'sand-2', | ||
| [3] = 'sand-3' | ||
| }, | ||
| start = 1, | ||
| weight = 1, | ||
| ratios = { | ||
| {resource = b.resource(b.full_shape, 'iron-ore', medium_value), weight = 25}, | ||
| {resource = b.resource(b.full_shape, 'copper-ore', medium_value), weight = 10}, | ||
| {resource = b.resource(b.full_shape, 'stone', medium_value), weight = 60}, | ||
| {resource = b.resource(b.full_shape, 'coal', medium_value), weight = 5} | ||
| } | ||
| }, | ||
| { | ||
| name = 'uranium-ore', | ||
| start = 1, | ||
| weight = 1, | ||
| ratios = { | ||
| { | ||
| resource = b.resource(b.full_shape, 'uranium-ore', function() return 1e6 end), | ||
| weight = 1 | ||
| }, | ||
| } | ||
| } | ||
| } | ||
| return Factory.default() | ||
| :add_ore('stone') | ||
| :add_ore('uranium-ore', {tiles = false, value = function() return 1e6 end}) | ||
| :start_value(1) | ||
| :richness(b.exponential_value(medium, 0.07, 1.45)) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.