Added mottled bark to birch

This commit is contained in:
Treeco 2021-10-05 18:26:27 +01:00
parent c502bc177a
commit dafa1327d0
3 changed files with 25 additions and 13 deletions

View File

@ -36,6 +36,7 @@ make_case_elim!(
Sprite(kind: SpriteKind) = 18,
Chestnut = 19,
Baobab = 20,
BirchWood = 21,
}
);

View File

@ -323,5 +323,18 @@ pub fn block_from_structure(
)
})
},
StructureBlock::BirchWood => {
let wpos = pos + structure_pos;
if field.chance(
(wpos + Vec3::new(wpos.z, wpos.z, 0) / 2)
/ Vec3::new(1 + wpos.z % 2, 1 + (wpos.z + 1) % 2, 1),
0.25,
) && wpos.z % 2 == 0
{
Some(Block::new(BlockKind::Wood, Rgb::new(70, 35, 25)))
} else {
Some(Block::new(BlockKind::Wood, Rgb::new(220, 170, 160)))
}
},
}
}

View File

@ -234,9 +234,7 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) {
StructureBlock::Filled(BlockKind::Wood, Rgb::new(150, 98, 41))
},
(_, _, _, true) => StructureBlock::None,
(true, _, _, _) => {
StructureBlock::Filled(BlockKind::Wood, t.config.wood_color)
},
(true, _, _, _) => t.config.trunk_block,
(_, true, _, _) => *leaf_block,
_ => StructureBlock::None,
},
@ -338,7 +336,7 @@ pub struct TreeConfig {
pub inhabited: bool,
pub hanging_sprites: &'static [(f32, SpriteKind)],
/// The colour of branches and the trunk.
pub wood_color: Rgb<u8>,
pub trunk_block: StructureBlock,
}
impl TreeConfig {
@ -363,7 +361,7 @@ impl TreeConfig {
proportionality: 0.0,
inhabited: false,
hanging_sprites: &[(0.0002, SpriteKind::Apple), (0.00007, SpriteKind::Beehive)],
wood_color: Rgb::new(90, 45, 15),
trunk_block: StructureBlock::Filled(BlockKind::Wood, Rgb::new(90, 45, 15)),
}
}
@ -388,7 +386,7 @@ impl TreeConfig {
proportionality: 0.8,
inhabited: false,
hanging_sprites: &[(0.00007, SpriteKind::Beehive), (0.015, SpriteKind::Liana)],
wood_color: Rgb::new(118, 67, 42),
trunk_block: StructureBlock::Filled(BlockKind::Wood, Rgb::new(118, 67, 42)),
}
}
@ -413,7 +411,7 @@ impl TreeConfig {
proportionality: 1.0,
inhabited: false,
hanging_sprites: &[(0.00007, SpriteKind::Beehive)],
wood_color: Rgb::new(125, 60, 6),
trunk_block: StructureBlock::Filled(BlockKind::Wood, Rgb::new(125, 60, 6)),
}
}
@ -438,7 +436,7 @@ impl TreeConfig {
proportionality: 0.0,
inhabited: false,
hanging_sprites: &[(0.00007, SpriteKind::Beehive)],
wood_color: Rgb::new(110, 68, 65),
trunk_block: StructureBlock::Filled(BlockKind::Wood, Rgb::new(110, 68, 65)),
}
}
@ -463,7 +461,7 @@ impl TreeConfig {
proportionality: 0.0,
inhabited: false,
hanging_sprites: &[(0.00007, SpriteKind::Beehive)],
wood_color: Rgb::new(220, 170, 160),
trunk_block: StructureBlock::BirchWood,
}
}
@ -488,7 +486,7 @@ impl TreeConfig {
proportionality: 1.0,
inhabited: false,
hanging_sprites: &[(0.00005, SpriteKind::Beehive)],
wood_color: Rgb::new(150, 95, 65),
trunk_block: StructureBlock::Filled(BlockKind::Wood, Rgb::new(150, 95, 65)),
}
}
@ -513,7 +511,7 @@ impl TreeConfig {
proportionality: 0.5,
inhabited: false,
hanging_sprites: &[(0.00007, SpriteKind::Beehive)],
wood_color: Rgb::new(110, 42, 28),
trunk_block: StructureBlock::Filled(BlockKind::Wood, Rgb::new(110, 42, 28)),
}
}
@ -538,7 +536,7 @@ impl TreeConfig {
proportionality: 1.0,
inhabited: false,
hanging_sprites: &[(0.0001, SpriteKind::Beehive)],
wood_color: Rgb::new(90, 35, 15),
trunk_block: StructureBlock::Filled(BlockKind::Wood, Rgb::new(90, 35, 15)),
}
}
@ -562,7 +560,7 @@ impl TreeConfig {
proportionality: 0.0,
inhabited,
hanging_sprites: &[(0.00025, SpriteKind::Apple), (0.00025, SpriteKind::Beehive)],
wood_color: Rgb::new(110, 68, 22),
trunk_block: StructureBlock::Filled(BlockKind::Wood, Rgb::new(110, 68, 22)),
}
}
}