update for 2.0 mostly done
This commit is contained in:
parent
cb0b405a73
commit
72e53ff4e3
17 changed files with 396 additions and 113 deletions
51
lead-ore.lua
51
lead-ore.lua
|
|
@ -1,23 +1,29 @@
|
|||
local resource_autoplace = require('resource-autoplace');
|
||||
local noise = require('noise');
|
||||
|
||||
local util = require("__bzlead__.data-util");
|
||||
|
||||
data.raw.planet.nauvis.map_gen_settings.autoplace_controls["lead-ore"] = {}
|
||||
data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["lead-ore"] = {}
|
||||
resource_autoplace.initialize_patch_set("lead-ore", true)
|
||||
|
||||
|
||||
|
||||
data:extend({
|
||||
{
|
||||
type = "autoplace-control",
|
||||
category = "resource",
|
||||
name = "lead-ore",
|
||||
richness = true,
|
||||
order = "b-e"
|
||||
},
|
||||
{
|
||||
type = "noise-layer",
|
||||
name = "lead-ore"
|
||||
order = "a-l"
|
||||
},
|
||||
--{
|
||||
-- type = "noise-layer",
|
||||
-- name = "lead-ore"
|
||||
--},
|
||||
{
|
||||
type = "resource",
|
||||
icon_size = 64, icon_mipmaps = 3,
|
||||
category="basic-solid",
|
||||
name = "lead-ore",
|
||||
icon = "__bzlead__/graphics/icons/lead-ore.png",
|
||||
flags = {"placeable-neutral"},
|
||||
|
|
@ -35,7 +41,7 @@ data:extend({
|
|||
|
||||
autoplace = resource_autoplace.resource_autoplace_settings{
|
||||
name = "lead-ore",
|
||||
order = "b-z",
|
||||
order = "a-t",
|
||||
base_density = 6,
|
||||
base_spots_per_km2 = 1,
|
||||
has_starting_area_placement = true,
|
||||
|
|
@ -71,10 +77,10 @@ data:extend({
|
|||
icon_size = 64, icon_mipmaps = 3,
|
||||
icon = "__bzlead__/graphics/icons/lead-ore.png",
|
||||
pictures = {
|
||||
{filename="__bzlead__/graphics/icons/lead-ore.png", size=64, scale=0.25},
|
||||
{filename="__bzlead__/graphics/icons/lead-ore-1.png", size=64, scale=0.25},
|
||||
{filename="__bzlead__/graphics/icons/lead-ore-2.png", size=64, scale=0.25},
|
||||
{filename="__bzlead__/graphics/icons/lead-ore-3.png", size=64, scale=0.25},
|
||||
{filename="__bzlead__/graphics/icons/lead-ore.png", size=64, scale=0.5},
|
||||
{filename="__bzlead__/graphics/icons/lead-ore-1.png", size=64, scale=0.5},
|
||||
{filename="__bzlead__/graphics/icons/lead-ore-2.png", size=64, scale=0.5},
|
||||
{filename="__bzlead__/graphics/icons/lead-ore-3.png", size=64, scale=0.5},
|
||||
},
|
||||
subgroup = "raw-resource",
|
||||
order = "t-c-a",
|
||||
|
|
@ -82,15 +88,24 @@ data:extend({
|
|||
},
|
||||
})
|
||||
|
||||
local richness = data.raw.resource["lead-ore"].autoplace.richness_expression
|
||||
|
||||
-- Modify lead autoplace richness:
|
||||
-- Up to 200 tiles it's standard
|
||||
-- From 200 to 700 tiles, richness scales linearly down, until
|
||||
-- From 700 tiles onward, it's about 1/6th the richness.
|
||||
data.raw.resource["lead-ore"].autoplace.richness_expression =
|
||||
richness * noise.if_else_chain(
|
||||
noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(200)), 1,
|
||||
noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(700)),
|
||||
100 / (noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")) - 100),
|
||||
0.17)
|
||||
local richness = data.raw.resource["lead-ore"].autoplace.richness_expression
|
||||
log("Lead richness pre")
|
||||
log(richness)
|
||||
data.raw.resource["lead-ore"].autoplace.richness_expression = richness..[[*
|
||||
if(distance_from_nearest_point{x = x, y = y, points = starting_positions} < 200, 1,
|
||||
if(distance_from_nearest_point{x = x, y = y, points = starting_positions} < 700,
|
||||
100/(distance_from_nearest_point{x = x, y = y, points = starting_positions} - 100), 0.17))
|
||||
]]
|
||||
local richness = data.raw.resource["lead-ore"].autoplace.richness_expression
|
||||
log("Lead richness post")
|
||||
log(richness)
|
||||
-- richness * noise.if_else_chain(
|
||||
-- noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(200)), 1,
|
||||
-- noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(700)),
|
||||
-- 100 / (noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")) - 100),
|
||||
-- 0.17)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue