Merge branch 'AutumnTrees' into 'master'

Autumn trees

See merge request veloren/veloren!4284
This commit is contained in:
maxicarlos08 2024-01-31 11:19:11 +00:00
commit be056ef595
5 changed files with 19 additions and 2 deletions

View File

@ -19,7 +19,7 @@
// Leaves all actually get interpolated.
TemperateLeaves: [
(start: (20, 100, 40), end: (60, 120, 0)),
// TODO: Uncomment when we add autumnal trees
// TODO: Uncomment when we add autumnal trees.
//(start: (178, 216, 0), end: (255, 185, 63)),
//(start: (142, 164, 0), end: (142, 164, 0)),
//(start: (168, 81, 0), end: (54, 150, 31)),
@ -33,6 +33,7 @@
Mangrove: [(start: (20, 60, 0), end: (40, 90, 30))],
Chestnut: [(start: (30, 80, 0), end: (50, 120, 0))],
Baobab: [(start: (50, 100, 40), end: (50, 90, 0))],
MapleLeaves: [(start: (103, 32, 21), end: (131, 24, 26)), (start: (96, 30, 44), end: (92, 9, 46))],
)
// Water blocks ignore color now so this isn't used, but just in case this color was worth

View File

@ -48,6 +48,7 @@ make_case_elim!(
Sign(content: Content, ori: u8) = 28,
KeyholeBars(consumes: String) = 29,
HaniwaKeyhole(consumes: String) = 30,
MapleLeaves = 31,
}
);

View File

@ -19,6 +19,7 @@ pub enum ForestKind {
Swamp,
Frostpine,
Dead,
Mapletree,
}
pub struct Environment {
@ -43,6 +44,7 @@ impl ForestKind {
ForestKind::Mangrove => 0.5..1.3,
ForestKind::Swamp => 0.5..1.1,
ForestKind::Dead => 0.0..1.5,
ForestKind::Mapletree => 0.55..1.25,
_ => 0.0..0.0,
}
}
@ -62,6 +64,7 @@ impl ForestKind {
ForestKind::Mangrove => 0.35..1.6,
ForestKind::Swamp => -0.6..0.8,
ForestKind::Dead => -1.5..1.0,
ForestKind::Mapletree => -0.15..0.25,
_ => 0.0..0.0,
}
}
@ -90,6 +93,7 @@ impl ForestKind {
ForestKind::Mangrove => 2.0,
ForestKind::Swamp => 1.0,
ForestKind::Dead => 0.01,
ForestKind::Mapletree => 0.65,
_ => 0.0,
}
}
@ -107,6 +111,7 @@ impl ForestKind {
ForestKind::Birch => 0.65,
ForestKind::Mangrove => 1.0,
ForestKind::Swamp => 0.4,
ForestKind::Mapletree => 0.4,
_ => 1.0,
}
}

View File

@ -280,7 +280,8 @@ pub fn block_from_structure(
| StructureBlock::Acacia
| StructureBlock::Mangrove
| StructureBlock::Chestnut
| StructureBlock::Baobab => {
| StructureBlock::Baobab
| StructureBlock::MapleLeaves => {
let ranges = sblock
.elim_case_pure(&index.colors.block.structure_blocks)
.as_ref()

View File

@ -224,6 +224,15 @@ pub fn apply_trees_to(
StructureBlock::TemperateLeaves,
);
},
ForestKind::Mapletree => {
break 'model TreeModel::Procedural(
ProceduralTree::generate(
TreeConfig::oak(&mut RandomPerm::new(seed), scale),
&mut RandomPerm::new(seed),
),
StructureBlock::MapleLeaves,
);
},
};
let models = models.read();