Merge branch 'christof/fix-kelp' into 'master'

Reintroduce underwater plants

See merge request veloren/veloren!4230
This commit is contained in:
Christof Petig 2023-12-26 20:35:21 +00:00
commit 1f71892897

View File

@ -717,7 +717,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: Mud, kind: Mud,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Earth), permit: |b| matches!(b, BlockKind::Earth | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
MUSH_FACT MUSH_FACT
@ -735,7 +735,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: GrassBlue, kind: GrassBlue,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
MUSH_FACT MUSH_FACT
@ -753,7 +753,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: Seagrass, kind: Seagrass,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.temperate_temp, 0.8) close(col.temp, CONFIG.temperate_temp, 0.8)
@ -774,7 +774,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: Seagrass, kind: Seagrass,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
MUSH_FACT MUSH_FACT
@ -794,7 +794,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: SeaweedTemperate, kind: SeaweedTemperate,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.temperate_temp, 0.8) close(col.temp, CONFIG.temperate_temp, 0.8)
@ -815,7 +815,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: SeaweedTropical, kind: SeaweedTropical,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Grass), permit: |b| matches!(b, BlockKind::Grass | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
close(col.temp, 1.0, 0.95) close(col.temp, 1.0, 0.95)
@ -836,7 +836,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: SeaGrapes, kind: SeaGrapes,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Earth), permit: |b| matches!(b, BlockKind::Earth | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
MUSH_FACT MUSH_FACT
@ -856,7 +856,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: WavyAlgae, kind: WavyAlgae,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Earth), permit: |b| matches!(b, BlockKind::Earth | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
MUSH_FACT MUSH_FACT
@ -876,7 +876,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: MermaidsFan, kind: MermaidsFan,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Earth), permit: |b| matches!(b, BlockKind::Earth | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
close(col.temp, 1.0, 0.95) close(col.temp, 1.0, 0.95)
@ -897,7 +897,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: SeaAnemone, kind: SeaAnemone,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Earth), permit: |b| matches!(b, BlockKind::Earth | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.temperate_temp, 0.8) close(col.temp, CONFIG.temperate_temp, 0.8)
@ -918,7 +918,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: GiantKelp, kind: GiantKelp,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Earth), permit: |b| matches!(b, BlockKind::Earth | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.temperate_temp, 0.8) close(col.temp, CONFIG.temperate_temp, 0.8)
@ -939,7 +939,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: BullKelp, kind: BullKelp,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Earth), permit: |b| matches!(b, BlockKind::Earth | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
close(col.temp, CONFIG.temperate_temp, 0.7) close(col.temp, CONFIG.temperate_temp, 0.7)
@ -960,7 +960,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: StonyCoral, kind: StonyCoral,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Earth), permit: |b| matches!(b, BlockKind::Earth | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
close(col.temp, 1.0, 0.9) close(col.temp, 1.0, 0.9)
@ -981,7 +981,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: SoftCoral, kind: SoftCoral,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Earth), permit: |b| matches!(b, BlockKind::Earth | BlockKind::Sand),
f: |_, col| { f: |_, col| {
( (
close(col.temp, 1.0, 0.9) close(col.temp, 1.0, 0.9)
@ -1002,7 +1002,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: Seashells, kind: Seashells,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Earth), permit: |b| matches!(b, BlockKind::Earth | BlockKind::Sand),
f: |c, col| { f: |c, col| {
( (
(c.rockiness - 0.5).max(0.0) (c.rockiness - 0.5).max(0.0)
@ -1021,7 +1021,7 @@ pub fn apply_scatter_to(canvas: &mut Canvas, _rng: &mut impl Rng, calendar: Opti
ScatterConfig { ScatterConfig {
kind: Stones, kind: Stones,
water_mode: Underwater, water_mode: Underwater,
permit: |b| matches!(b, BlockKind::Earth), permit: |b| matches!(b, BlockKind::Earth | BlockKind::Sand),
f: |c, col| { f: |c, col| {
( (
(c.rockiness - 0.5).max(0.0) (c.rockiness - 0.5).max(0.0)