diff --git a/assets/voxygen/voxel/sprite/lantern/lantern-orange.vox b/assets/voxygen/voxel/sprite/lantern/lantern-orange.vox new file mode 100644 index 0000000000..104ccaec39 --- /dev/null +++ b/assets/voxygen/voxel/sprite/lantern/lantern-orange.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:267dad1374260e2e072027ba005389ba66082f74e7c8ba64a83bb58d41a04fc3 +size 1860 diff --git a/assets/voxygen/voxel/sprite_manifest.ron b/assets/voxygen/voxel/sprite_manifest.ron index c4aff9d909..158bb5e386 100644 --- a/assets/voxygen/voxel/sprite_manifest.ron +++ b/assets/voxygen/voxel/sprite_manifest.ron @@ -2824,4 +2824,16 @@ SapphireSmall: Some(( ], wind_sway: 0.0, )), + +// Lantern +Lantern: Some(( + variations: [ + ( + model: "voxygen.voxel.sprite.lantern.lantern-orange", + offset: (-2.5, -2.5, 0.0), + lod_axes: (0.0, 0.0, 0.0), + ), + ], + wind_sway: 0.0, +)), ) diff --git a/common/src/terrain/block.rs b/common/src/terrain/block.rs index 37d1d5d3c7..f72ef8e950 100644 --- a/common/src/terrain/block.rs +++ b/common/src/terrain/block.rs @@ -189,6 +189,7 @@ impl Block { | SpriteKind::RubySmall | SpriteKind::EmeraldSmall | SpriteKind::SapphireSmall => Some(3), + SpriteKind::Lantern => Some(24), _ => None, } } diff --git a/common/src/terrain/sprite.rs b/common/src/terrain/sprite.rs index de7e8fd6ff..bf67e20c43 100644 --- a/common/src/terrain/sprite.rs +++ b/common/src/terrain/sprite.rs @@ -142,6 +142,7 @@ make_case_elim!( Seagrass = 0x73, RedAlgae = 0x74, UnderwaterVent = 0x75, + Lantern = 0x76, } ); @@ -201,6 +202,7 @@ impl SpriteKind { | SpriteKind::DropGate => 1.0, // TODO: Figure out if this should be solid or not. SpriteKind::Shelf => 1.0, + SpriteKind::Lantern => 0.9, _ => return None, }) } @@ -289,6 +291,7 @@ impl SpriteKind { | SpriteKind::Bowl | SpriteKind::VialEmpty | SpriteKind::FireBowlGround + | SpriteKind::Lantern ) } } diff --git a/world/src/all.rs b/world/src/all.rs index ecd63e04b3..d1a7cc98ec 100644 --- a/world/src/all.rs +++ b/world/src/all.rs @@ -87,4 +87,5 @@ pub struct TreeAttr { pub seed: u32, pub scale: f32, pub forest_kind: ForestKind, + pub lanterns: bool, } diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index becc22045a..7f0f05a0c9 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -60,7 +60,7 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { canvas.foreach_col(|canvas, wpos2d, col| { let trees = info.land().get_near_trees(wpos2d); - for TreeAttr { pos, seed, scale, forest_kind } in trees { + for TreeAttr { pos, seed, scale, forest_kind, lanterns } in trees { let tree = if let Some(tree) = tree_cache.entry(pos).or_insert_with(|| { let col = ColumnGen::new(info.land()).get((pos, info.index()))?; @@ -202,8 +202,8 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { ) .map(|block| { // Add mushrooms to the tree - if last_block.is_air() && block.kind() == BlockKind::Wood && dynamic_rng.gen_range(0..48) == 0 { - canvas.set(wpos + Vec3::unit_z(), Block::air(SpriteKind::CaveMushroom)); + if lanterns && last_block.is_air() && block.kind() == BlockKind::Wood && dynamic_rng.gen_range(0..48) == 0 { + canvas.set(wpos + Vec3::unit_z(), Block::air(SpriteKind::Lantern)); // Add a snow covering to the block above under certain circumstances } else if col.snow_cover && ((block.kind() == BlockKind::Leaves && is_leaf_top) diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 51914c28d9..676039ed10 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -2017,11 +2017,12 @@ impl WorldSim { .enumerate() .map(|(i, fk)| { const CLUSTER_SIZE: f64 = 48.0; - let nz = (FastNoise2d::new(i as u32).get(pos.map(|e| e as f64) / CLUSTER_SIZE) + 1.0) / 2.0; + let nz = (FastNoise2d::new(i as u32 * 37).get(pos.map(|e| e as f64) / CLUSTER_SIZE) + 1.0) / 2.0; (fk.proclivity(&env) * nz, fk) }) .collect::>()) .choose_seeded(seed), + lanterns: false, }) }); @@ -2033,6 +2034,7 @@ impl WorldSim { seed, scale: 4.0, forest_kind: ForestKind::Giant, + lanterns: true, }); normal_trees.chain(giant_trees)