mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-30 04:30:58 +02:00
use weighted segments
This commit is contained in:
parent
ae31250f24
commit
598888a3ee
@ -52,6 +52,8 @@ local ores_names = {
|
||||
'stone',
|
||||
'uranium-ore',
|
||||
'bauxite-ore',
|
||||
'cobalt-ore',
|
||||
'gem-ore',
|
||||
'gold-ore',
|
||||
'lead-ore',
|
||||
'nickel-ore',
|
||||
@ -160,8 +162,7 @@ Global.register_init(
|
||||
random.re_seed(seed)
|
||||
table.shuffle_table(ores_shapes, random)
|
||||
|
||||
--ores = b.circular_spiral_pattern(32, 32, ores_shapes)
|
||||
ores = b.segment_pattern(ores_shapes)
|
||||
ores = b.segment_weighted_pattern(ores_shapes)
|
||||
end
|
||||
)
|
||||
|
||||
|
@ -23,12 +23,6 @@ local uranium_threshold = 0.63
|
||||
local thorium_scale = 1 / 72
|
||||
local thorium_threshold = 0.63
|
||||
|
||||
local gem_scale = 1 / 72
|
||||
local gem_threshold = 0.63
|
||||
|
||||
local cobalt_scale = 1 / 72
|
||||
local cobalt_threshold = 0.63
|
||||
|
||||
local density_scale = 1 / 48
|
||||
local density_threshold = 0.5
|
||||
local density_multiplier = 50
|
||||
@ -43,12 +37,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 10,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 150},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -70,12 +67,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 10,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 150},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -100,12 +100,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 10,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 67},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -126,12 +129,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 10,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 67},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -153,12 +159,78 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 2,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 100},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'quartz', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'rutile-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'silver-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'sulfur', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'tin-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'tungsten-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'zinc-ore', value(0, 0.5)), weight = 10}
|
||||
}
|
||||
},
|
||||
['cobalt-ore'] = {
|
||||
['tiles'] = {
|
||||
[1] = 'red-desert-0',
|
||||
[2] = 'red-desert-1',
|
||||
[3] = 'red-desert-2',
|
||||
[4] = 'red-desert-3'
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 0.05,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 100},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'quartz', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'rutile-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'silver-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'sulfur', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'tin-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'tungsten-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'zinc-ore', value(0, 0.5)), weight = 10}
|
||||
}
|
||||
},
|
||||
['gem-ore'] = {
|
||||
['tiles'] = {
|
||||
[1] = 'dirt-1',
|
||||
[2] = 'dirt-2',
|
||||
[3] = 'dirt-3',
|
||||
[4] = 'dirt-4',
|
||||
[5] = 'dirt-5',
|
||||
[6] = 'dirt-6',
|
||||
[7] = 'dirt-7'
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 0.05,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 100},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -179,12 +251,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 1,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 100},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -206,12 +281,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 2,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 100},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -233,12 +311,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 2,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 100},
|
||||
@ -263,12 +344,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 2,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -289,12 +373,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 1,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -316,12 +403,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 1,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -343,12 +433,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 1,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -373,12 +466,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 2,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -399,12 +495,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 1,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -426,12 +525,15 @@ local ores = {
|
||||
},
|
||||
['start'] = value(125, 0),
|
||||
['non_mixed_value'] = value(0, 0.5),
|
||||
['weight'] = 2,
|
||||
['ratios'] = {
|
||||
{resource = b.resource(b.full_shape, 'iron-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'copper-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'stone', value(0, 0.5)), weight = 2},
|
||||
{resource = b.resource(b.full_shape, 'coal', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'bauxite-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'cobalt-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gem-ore', value(0, 0.5)), weight = 1},
|
||||
{resource = b.resource(b.full_shape, 'gold-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'lead-ore', value(0, 0.5)), weight = 10},
|
||||
{resource = b.resource(b.full_shape, 'nickel-ore', value(0, 0.5)), weight = 10},
|
||||
@ -451,16 +553,12 @@ local oil_resource = b.resource(oil_shape, 'crude-oil', value(250000, 150))
|
||||
|
||||
local uranium_resource = b.resource(b.full_shape, 'uranium-ore', value(200, 1))
|
||||
local thorium_resource = b.resource(b.full_shape, 'thorium-ore', value(200, 1))
|
||||
local gem_resource = b.resource(b.full_shape, 'gem-ore', value(200, 1))
|
||||
local cobalt_resource = b.resource(b.full_shape, 'cobalt-ore', value(200, 1))
|
||||
|
||||
local function init(seed)
|
||||
local oil_seed = seed * 2
|
||||
local uranium_seed = seed * 3
|
||||
local density_seed = seed * 4
|
||||
local thorium_seed = seed * 5
|
||||
local gem_seed = seed * 6
|
||||
local cobalt_seed = seed * 7
|
||||
|
||||
local function tile_builder(tiles)
|
||||
local count = #tiles / 2
|
||||
@ -499,18 +597,6 @@ local function init(seed)
|
||||
return thorium_resource(x, y, world)
|
||||
end
|
||||
|
||||
local gem_x, gem_y = x * gem_scale, y * gem_scale
|
||||
local gem_noise = perlin_noise(gem_x, gem_y, gem_seed)
|
||||
if gem_noise > gem_threshold then
|
||||
return gem_resource(x, y, world)
|
||||
end
|
||||
|
||||
local cobalt_x, cobalt_y = x * cobalt_scale, y * cobalt_scale
|
||||
local cobalt_noise = perlin_noise(cobalt_x, cobalt_y, cobalt_seed)
|
||||
if cobalt_noise > cobalt_threshold then
|
||||
return cobalt_resource(x, y, world)
|
||||
end
|
||||
|
||||
local i = random() * total
|
||||
local index = binary_search(weighted, i)
|
||||
if index < 0 then
|
||||
@ -558,18 +644,6 @@ local function init(seed)
|
||||
return thorium_resource(x, y, world)
|
||||
end
|
||||
|
||||
local gem_x, gem_y = x * gem_scale, y * gem_scale
|
||||
local gem_noise = perlin_noise(gem_x, gem_y, gem_seed)
|
||||
if gem_noise > gem_threshold then
|
||||
return gem_resource(x, y, world)
|
||||
end
|
||||
|
||||
local cobalt_x, cobalt_y = x * cobalt_scale, y * cobalt_scale
|
||||
local cobalt_noise = perlin_noise(cobalt_x, cobalt_y, cobalt_seed)
|
||||
if cobalt_noise > cobalt_threshold then
|
||||
return cobalt_resource(x, y, world)
|
||||
end
|
||||
|
||||
local entity = resource(x, y, world)
|
||||
local density_x, density_y = x * density_scale, y * density_scale
|
||||
local density_noise = perlin_noise(density_x, density_y, density_seed)
|
||||
@ -604,7 +678,7 @@ local function init(seed)
|
||||
end
|
||||
|
||||
local shape = b.apply_entity(land, ore)
|
||||
shapes[#shapes + 1] = shape
|
||||
shapes[#shapes + 1] = {shape = shape, weight = v.weight}
|
||||
end
|
||||
|
||||
return shapes
|
||||
|
Loading…
x
Reference in New Issue
Block a user