mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
BlockKind::ArtSnow
replace BlockKind::Snow with BlockKind::Misc
This commit is contained in:
parent
25ef582f1a
commit
17e4af3c48
@ -618,6 +618,11 @@ impl<const AVERAGE_PALETTE: bool> VoxelImageDecoding for TriPngEncoding<AVERAGE_
|
||||
g: 255,
|
||||
b: 255,
|
||||
},
|
||||
ArtSnow => Rgb {
|
||||
r: 192,
|
||||
g: 255,
|
||||
b: 255,
|
||||
},
|
||||
Ice => Rgb {
|
||||
r: 150,
|
||||
g: 190,
|
||||
|
@ -70,7 +70,10 @@ impl Default for Friction {
|
||||
impl Friction {
|
||||
pub fn can_skate_on(&self, b: BlockKind) -> bool {
|
||||
match self {
|
||||
Friction::Ski => matches!(b, BlockKind::Snow | BlockKind::Ice | BlockKind::Air),
|
||||
Friction::Ski => matches!(
|
||||
b,
|
||||
BlockKind::Snow | BlockKind::ArtSnow | BlockKind::Ice | BlockKind::Air
|
||||
),
|
||||
Friction::Skate => b == BlockKind::Ice,
|
||||
_ => false,
|
||||
}
|
||||
@ -80,6 +83,7 @@ impl Friction {
|
||||
pub fn get_friction(&self, b: BlockKind) -> (f32, f32) {
|
||||
match (self, b) {
|
||||
(Friction::Ski, BlockKind::Snow) => (0.01, 0.95),
|
||||
(Friction::Ski, BlockKind::ArtSnow) => (0.01, 0.95),
|
||||
(Friction::Ski, BlockKind::Ice) => (0.001, 0.5),
|
||||
(Friction::Ski, BlockKind::Water) => (0.1, 0.7),
|
||||
(Friction::Ski, BlockKind::Air) => (0.0, 0.0),
|
||||
|
@ -58,6 +58,8 @@ make_case_elim!(
|
||||
// often want to experiment with new kinds of block without allocating them a
|
||||
// dedicated block kind.
|
||||
Misc = 0xFE,
|
||||
// Snow to use with sites, to not attract snowfall particles
|
||||
ArtSnow = 0xFF,
|
||||
}
|
||||
);
|
||||
|
||||
@ -351,6 +353,7 @@ impl Block {
|
||||
BlockKind::Leaves => (9, 255.0),
|
||||
BlockKind::Wood => (6, 2.0),
|
||||
BlockKind::Snow => (6, 2.0),
|
||||
BlockKind::ArtSnow => (6, 2.0),
|
||||
BlockKind::Ice => (4, 2.0),
|
||||
_ if self.is_opaque() => (0, 255.0),
|
||||
_ => (0, 0.0),
|
||||
@ -494,7 +497,7 @@ impl Block {
|
||||
#[inline]
|
||||
pub fn get_traction(&self) -> f32 {
|
||||
match self.kind() {
|
||||
BlockKind::Snow => 0.8,
|
||||
BlockKind::Snow | BlockKind::ArtSnow => 0.8,
|
||||
_ => 1.0,
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ impl MovementEventMapper {
|
||||
SfxEvent::Sneak
|
||||
} else {
|
||||
match underfoot_block_kind {
|
||||
BlockKind::Snow => SfxEvent::Run(BlockKind::Snow),
|
||||
BlockKind::Snow | BlockKind::ArtSnow => SfxEvent::Run(BlockKind::Snow),
|
||||
BlockKind::Rock
|
||||
| BlockKind::WeakRock
|
||||
| BlockKind::GlowingRock
|
||||
@ -238,7 +238,7 @@ impl MovementEventMapper {
|
||||
SfxEvent::Swim
|
||||
} else if physics_state.on_ground.is_some() && vel.magnitude() > 0.1 {
|
||||
match underfoot_block_kind {
|
||||
BlockKind::Snow => SfxEvent::Run(BlockKind::Snow),
|
||||
BlockKind::Snow | BlockKind::ArtSnow => SfxEvent::Run(BlockKind::Snow),
|
||||
BlockKind::Rock
|
||||
| BlockKind::WeakRock
|
||||
| BlockKind::GlowingRock
|
||||
@ -264,7 +264,7 @@ impl MovementEventMapper {
|
||||
SfxEvent::Swim
|
||||
} else if physics_state.on_ground.is_some() && vel.magnitude() > 0.1 {
|
||||
match underfoot_block_kind {
|
||||
BlockKind::Snow => SfxEvent::QuadRun(BlockKind::Snow),
|
||||
BlockKind::Snow | BlockKind::ArtSnow => SfxEvent::QuadRun(BlockKind::Snow),
|
||||
BlockKind::Rock
|
||||
| BlockKind::WeakRock
|
||||
| BlockKind::GlowingRock
|
||||
|
@ -426,20 +426,27 @@ impl Structure for AdletStronghold {
|
||||
#[cfg_attr(feature = "be-dyn-lib", export_name = "render_adletstronghold")]
|
||||
fn render_inner(&self, _site: &Site, land: &Land, painter: &Painter) {
|
||||
let snow_ice_fill = Fill::Sampling(Arc::new(|wpos| {
|
||||
Some(match (RandomField::new(0).get(wpos)) % 80 {
|
||||
0..=3 => Block::new(BlockKind::Ice, Rgb::new(120, 160, 255)),
|
||||
_ => Block::new(BlockKind::Snow, Rgb::new(255, 255, 255)),
|
||||
Some(match (RandomField::new(0).get(wpos)) % 250 {
|
||||
0..=2 => Block::new(BlockKind::Ice, Rgb::new(120, 160, 255)),
|
||||
3..=10 => Block::new(BlockKind::ArtSnow, Rgb::new(138, 147, 217)),
|
||||
11..=20 => Block::new(BlockKind::ArtSnow, Rgb::new(213, 213, 242)),
|
||||
21..=35 => Block::new(BlockKind::ArtSnow, Rgb::new(231, 230, 247)),
|
||||
36..=62 => Block::new(BlockKind::ArtSnow, Rgb::new(180, 181, 227)),
|
||||
_ => Block::new(BlockKind::ArtSnow, Rgb::new(209, 212, 238)),
|
||||
})
|
||||
}));
|
||||
let snow_ice_air_fill = Fill::Sampling(Arc::new(|wpos| {
|
||||
Some(match (RandomField::new(0).get(wpos)) % 100 {
|
||||
0..=3 => Block::new(BlockKind::Ice, Rgb::new(120, 160, 255)),
|
||||
4..=24 => Block::new(BlockKind::Air, Rgb::new(0, 0, 0)),
|
||||
_ => Block::new(BlockKind::Snow, Rgb::new(255, 255, 255)),
|
||||
Some(match (RandomField::new(0).get(wpos)) % 250 {
|
||||
0..=2 => Block::new(BlockKind::Ice, Rgb::new(120, 160, 255)),
|
||||
3..=5 => Block::new(BlockKind::Air, Rgb::new(0, 0, 0)),
|
||||
6..=10 => Block::new(BlockKind::ArtSnow, Rgb::new(138, 147, 217)),
|
||||
11..=20 => Block::new(BlockKind::ArtSnow, Rgb::new(213, 213, 242)),
|
||||
21..=35 => Block::new(BlockKind::ArtSnow, Rgb::new(231, 230, 247)),
|
||||
36..=62 => Block::new(BlockKind::ArtSnow, Rgb::new(180, 181, 227)),
|
||||
_ => Block::new(BlockKind::ArtSnow, Rgb::new(209, 212, 238)),
|
||||
})
|
||||
}));
|
||||
let bone_fill = Fill::Brick(BlockKind::Misc, Rgb::new(200, 160, 140), 1);
|
||||
let snow_fill = Fill::Block(Block::new(BlockKind::Snow, Rgb::new(255, 255, 255)));
|
||||
let ice_fill = Fill::Block(Block::new(BlockKind::Ice, Rgb::new(120, 160, 255)));
|
||||
let dirt_fill = Fill::Brick(BlockKind::Earth, Rgb::new(55, 25, 8), 24);
|
||||
let grass_fill = Fill::Sampling(Arc::new(|wpos| {
|
||||
@ -465,7 +472,7 @@ impl Structure for AdletStronghold {
|
||||
0..=2 => Block::air(SpriteKind::Bones),
|
||||
4..=5 => Block::air(SpriteKind::GlowIceCrystal),
|
||||
6..=8 => Block::air(SpriteKind::IceCrystal),
|
||||
9..=15 => Block::new(BlockKind::Snow, Rgb::new(255, 255, 255)),
|
||||
9..=15 => Block::new(BlockKind::ArtSnow, Rgb::new(255, 255, 255)),
|
||||
_ => Block::new(BlockKind::Air, Rgb::new(0, 0, 0)),
|
||||
})
|
||||
}));
|
||||
@ -814,7 +821,7 @@ impl Structure for AdletStronghold {
|
||||
// igloo snow
|
||||
painter
|
||||
.sphere_with_radius(igloo_pos.with_z(alt as i32 - 1), igloo_size)
|
||||
.fill(snow_fill.clone());
|
||||
.fill(snow_ice_fill.clone());
|
||||
// 4 hide pieces
|
||||
for dir in CARDINALS {
|
||||
let hide_size = 5
|
||||
@ -958,7 +965,7 @@ impl Structure for AdletStronghold {
|
||||
(igloo_size as i32 - 4) as f32,
|
||||
2.0,
|
||||
)
|
||||
.fill(snow_fill.clone());
|
||||
.fill(snow_ice_fill.clone());
|
||||
// top decor bone with some hide
|
||||
painter
|
||||
.aabb(Aabb {
|
||||
|
Loading…
Reference in New Issue
Block a user