Desert hum fix

This commit is contained in:
Michał 2023-08-09 15:53:16 +00:00 committed by Isse
parent 58b541490b
commit 5762e62704
3 changed files with 20 additions and 44 deletions

View File

@ -65,7 +65,7 @@ pub const CONFIG: Config = Config {
tropical_temp: 0.4, tropical_temp: 0.4,
desert_temp: 0.8, desert_temp: 0.8,
// humidity // humidity
desert_hum: 0.0, desert_hum: 0.15,
forest_hum: 0.5, forest_hum: 0.5,
jungle_hum: 0.75, jungle_hum: 0.75,
// water // water

View File

@ -597,11 +597,8 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.desert_temp, 0.25).min(close( close(col.temp, CONFIG.desert_temp, 0.25).min(close(col.humidity, 0.0, 0.2))
col.humidity, * MUSH_FACT
CONFIG.desert_hum,
0.1,
)) * MUSH_FACT
* 0.1, * 0.1,
None, None,
) )
@ -613,11 +610,8 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.desert_temp, 0.25).min(close( close(col.temp, CONFIG.desert_temp, 0.25).min(close(col.humidity, 0.0, 0.2))
col.humidity, * MUSH_FACT
CONFIG.desert_hum,
0.1,
)) * MUSH_FACT
* 1.5, * 1.5,
None, None,
) )
@ -629,11 +623,8 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.desert_temp, 0.25).min(close( close(col.temp, CONFIG.desert_temp, 0.25).min(close(col.humidity, 0.0, 0.2))
col.humidity, * MUSH_FACT
CONFIG.desert_hum,
0.1,
)) * MUSH_FACT
* 2.0, * 2.0,
None, None,
) )
@ -645,11 +636,8 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.desert_temp, 0.25).min(close( close(col.temp, CONFIG.desert_temp, 0.25).min(close(col.humidity, 0.0, 0.2))
col.humidity, * MUSH_FACT
CONFIG.desert_hum,
0.1,
)) * MUSH_FACT
* 1.5, * 1.5,
None, None,
) )
@ -661,11 +649,8 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.desert_temp, 0.25).min(close( close(col.temp, CONFIG.desert_temp, 0.25).min(close(col.humidity, 0.0, 0.2))
col.humidity, * MUSH_FACT
CONFIG.desert_hum,
0.1,
)) * MUSH_FACT
* 2.0, * 2.0,
None, None,
) )
@ -677,11 +662,8 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.desert_temp, 0.25).min(close( close(col.temp, CONFIG.desert_temp, 0.25).min(close(col.humidity, 0.0, 0.2))
col.humidity, * MUSH_FACT
CONFIG.desert_hum,
0.1,
)) * MUSH_FACT
* 2.0, * 2.0,
None, None,
) )
@ -693,11 +675,8 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.desert_temp, 0.25).min(close( close(col.temp, CONFIG.desert_temp, 0.25).min(close(col.humidity, 0.0, 0.2))
col.humidity, * MUSH_FACT
CONFIG.desert_hum,
0.1,
)) * MUSH_FACT
* 2.0, * 2.0,
None, None,
) )
@ -709,11 +688,8 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.desert_temp, 0.25).min(close( close(col.temp, CONFIG.desert_temp, 0.25).min(close(col.humidity, 0.0, 0.2))
col.humidity, * MUSH_FACT
CONFIG.desert_hum,
0.1,
)) * MUSH_FACT
* 2.0, * 2.0,
None, None,
) )

View File

@ -447,7 +447,7 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> {
// Rainforest area animals // Rainforest area animals
("world.wildlife.spawn.tropical.rainforest", |c, _col| { ("world.wildlife.spawn.tropical.rainforest", |c, _col| {
close(c.temp, CONFIG.tropical_temp + 0.1, 0.4) close(c.temp, CONFIG.tropical_temp + 0.1, 0.4)
* close(c.humidity, CONFIG.desert_hum, 0.4) * close(c.humidity, CONFIG.jungle_hum, 0.4)
* BASE_DENSITY * BASE_DENSITY
* 2.0 * 2.0
}), }),
@ -456,7 +456,7 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> {
"world.wildlife.spawn.calendar.halloween.tropical.rainforest", "world.wildlife.spawn.calendar.halloween.tropical.rainforest",
|c, _col| { |c, _col| {
close(c.temp, CONFIG.tropical_temp + 0.1, 0.4) close(c.temp, CONFIG.tropical_temp + 0.1, 0.4)
* close(c.humidity, CONFIG.desert_hum, 0.4) * close(c.humidity, CONFIG.jungle_hum, 0.4)
* BASE_DENSITY * BASE_DENSITY
* 2.0 * 2.0
}, },
@ -465,7 +465,7 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> {
"world.wildlife.spawn.calendar.april_fools.tropical.rainforest", "world.wildlife.spawn.calendar.april_fools.tropical.rainforest",
|c, _col| { |c, _col| {
close(c.temp, CONFIG.tropical_temp + 0.1, 0.4) close(c.temp, CONFIG.tropical_temp + 0.1, 0.4)
* close(c.humidity, CONFIG.desert_hum, 0.4) * close(c.humidity, CONFIG.jungle_hum, 0.4)
* BASE_DENSITY * BASE_DENSITY
* 2.0 * 2.0
}, },