Added Autumn Trees

This commit is contained in:
BigKhan 2024-01-27 21:08:32 +00:00
parent d11c58b75b
commit f626fdc496
5 changed files with 23 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. Hannibal is in charge now.
//(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))],
AutumnLeaves: [(start: (178, 216, 0), end: (255, 185, 63)), (start: (142, 164, 0), end: (142, 164, 0)), (start: (168, 81, 0), end: (54, 150, 31))],
)
// 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,
AutumnLeaves = 31,
}
);

View File

@ -19,6 +19,7 @@ pub enum ForestKind {
Swamp,
Frostpine,
Dead,
Autumntree,
}
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::Autumntree => 0.55..1.5,
_ => 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::Autumntree => -0.15..0.45,
_ => 0.0..0.0,
}
}
@ -90,6 +93,7 @@ impl ForestKind {
ForestKind::Mangrove => 2.0,
ForestKind::Swamp => 1.0,
ForestKind::Dead => 0.01,
ForestKind::Autumntree => 0.35,
_ => 0.0,
}
}
@ -107,6 +111,7 @@ impl ForestKind {
ForestKind::Birch => 0.65,
ForestKind::Mangrove => 1.0,
ForestKind::Swamp => 0.4,
ForestKind::Autumntree => 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::AutumnLeaves => {
let ranges = sblock
.elim_case_pure(&index.colors.block.structure_blocks)
.as_ref()
@ -294,6 +295,7 @@ pub fn block_from_structure(
)
};
range.map(|range| {
if calendar.map_or(false, |c| c.is_event(CalendarEvent::Christmas))
&& field.chance(pos + structure_pos, 0.025)

View File

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