From db0be3ce64a48750fc196b44dc71d598850c70a7 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sun, 9 May 2021 02:49:05 +0300 Subject: [PATCH] Updated Resources: spread functions (markdown) --- Resources:-spread-functions.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Resources:-spread-functions.md b/Resources:-spread-functions.md index 863caf5..116c93d 100644 --- a/Resources:-spread-functions.md +++ b/Resources:-spread-functions.md @@ -4,10 +4,14 @@ Resource **spread models** are bits of JavaScript code applied for cell to check Technically spread models are functional expressions evaluated for each cell to return a Boolean: `true` indicates that resource can be placed in cells and `false` indicates the opposite. The expressions are vanilla JS function, you can use any logical operators (`!` for not, `||` for OR, `&&` for and etc.) and other features. Build-in functions make models syntax easier to read: -* `nth(number)`: return true for each nth cell only, e.g. `nth(2)` will skip 50% of cells +* `nth(number)`: true for each nth cell only, e.g. `nth(2)` will skip 50% of cells * `biome(biomeId, biomeId, ...)`: check against biome id, see below to get id reference -* `minHeight(number)`: true if number cell height >= number. Number is in range [0-100], where 0 is deep ocean and 20 is minimal land elevation -* `maxHeight(number)`: true if number cell height <= number +* `minHeight(number)`: true if cell height >= number. Number is in range `[0-100]`, where `0` is deep ocean and `20` is minimal land elevation +* `maxHeight(number)`: true if cell height <= number +* `minTemp(number)`: true if cell temperature (in Celsius) >= number +* `maxTemp(number)`: true if cell temperature <= number +* `shore(number)`: check against cell distance to shore, where `1` is land next to water (coastline cells), `2` - next land ring, `-1` - water cells next to land (shallow water), `-2, -3, ...` - next water rings, `0` - value not assigned, usually values are assigned only for first 2 land rings, so other land cells have zero value + Default biome ids: * 0: Marine