Mushroom spore particles

This commit is contained in:
Syniis 2024-02-27 18:12:36 +01:00
parent 2f051f9c6a
commit 50905aebfe
6 changed files with 41 additions and 7 deletions

View File

@ -25,7 +25,7 @@ tracy-server-debuginfo = "run --bin veloren-server-cli --features tracy,simd --p
tracy-server-releasedebuginfo = "run --bin veloren-server-cli --features tracy,simd --profile releasedebuginfo" tracy-server-releasedebuginfo = "run --bin veloren-server-cli --features tracy,simd --profile releasedebuginfo"
tracy-test-server = "run --bin veloren-server-cli --no-default-features --features tracy,simd --profile no_overflow" tracy-test-server = "run --bin veloren-server-cli --no-default-features --features tracy,simd --profile no_overflow"
# voxygen # voxygen
test-voxygen = "run --bin veloren-voxygen --no-default-features --features simd,egui-ui,shaderc-from-source" test-voxygen = "run --bin veloren-voxygen --no-default-features --features simd,egui-ui,shaderc-from-source,hot-reloading"
tracy-voxygen = "run --bin veloren-voxygen --no-default-features --features tracy,simd,egui-ui,shaderc-from-source --profile no_overflow" tracy-voxygen = "run --bin veloren-voxygen --no-default-features --features tracy,simd,egui-ui,shaderc-from-source --profile no_overflow"
dbg-voxygen = "run --bin veloren-voxygen --profile debuginfo" dbg-voxygen = "run --bin veloren-voxygen --profile debuginfo"
# misc # misc

View File

@ -96,6 +96,7 @@ const int PHOENIX_BEAM = 56;
const int PHOENIX_BUILD_UP_AIM = 57; const int PHOENIX_BUILD_UP_AIM = 57;
const int CLAY_SHRAPNEL = 58; const int CLAY_SHRAPNEL = 58;
const int AIRFLOW = 59; const int AIRFLOW = 59;
const int SPORE = 60;
// meters per second squared (acceleration) // meters per second squared (acceleration)
const float earth_gravity = 9.807; const float earth_gravity = 9.807;
@ -1016,6 +1017,18 @@ void main() {
spin_in_axis(perp_axis, asin(inst_dir.z / length(inst_dir)) + PI / 2.0) spin_in_axis(perp_axis, asin(inst_dir.z / length(inst_dir)) + PI / 2.0)
); );
break; break;
case SPORE:
f_reflect = 0.0;
attr = Attr(
linear_motion(
vec3(0),
vec3(0, 0, -1.1)
) + vec3(sin((lifetime + rand9 * 0.1) * 0.5) * 3.0, sin((lifetime+ rand8 * 0.1) * 0.5) * 3.0, sin(lifetime * 0.5) * 1.5),
vec3(0.4 + 0.4 * abs(sin(lifetime))),
vec4(vec3(0.8, 6.0 + rand6 * 1.75, 7.5 + (1.75 + rand5 * 0.5)), 1),
spin_in_axis(vec3(rand1, rand2, rand3), rand4 * 1.5 + lifetime)
);
break;
default: default:
attr = Attr( attr = Attr(
linear_motion( linear_motion(

View File

@ -111,6 +111,7 @@ pub enum ParticleMode {
PhoenixBuildUpAim = 57, PhoenixBuildUpAim = 57,
ClayShrapnel = 58, ClayShrapnel = 58,
Airflow = 59, Airflow = 59,
Spore = 60,
} }
impl ParticleMode { impl ParticleMode {

View File

@ -2186,6 +2186,14 @@ impl ParticleMgr {
mode: ParticleMode::PortalFizz, mode: ParticleMode::PortalFizz,
cond: |_| true, cond: |_| true,
}, },
BlockParticles {
blocks: |boi| BlockParticleSlice::Positions(&boi.spores),
range: 4,
rate: 0.055,
lifetime: 20.0,
mode: ParticleMode::Spore,
cond: |_| true,
},
]; ];
let ecs = scene_data.state.ecs(); let ecs = scene_data.state.ecs();

View File

@ -49,6 +49,7 @@ pub struct BlocksOfInterest {
pub flowers: Vec<Vec3<i32>>, pub flowers: Vec<Vec3<i32>>,
pub fire_bowls: Vec<Vec3<i32>>, pub fire_bowls: Vec<Vec3<i32>>,
pub snow: Vec<Vec3<i32>>, pub snow: Vec<Vec3<i32>>,
pub spores: Vec<Vec3<i32>>,
//This is so crickets stay in place and don't randomly change sounds //This is so crickets stay in place and don't randomly change sounds
pub cricket1: Vec<Vec3<i32>>, pub cricket1: Vec<Vec3<i32>>,
pub cricket2: Vec<Vec3<i32>>, pub cricket2: Vec<Vec3<i32>>,
@ -97,6 +98,7 @@ impl BlocksOfInterest {
let mut cricket3 = Vec::new(); let mut cricket3 = Vec::new();
let mut frogs = Vec::new(); let mut frogs = Vec::new();
let mut one_way_walls = Vec::new(); let mut one_way_walls = Vec::new();
let mut spores = Vec::new();
let mut rng = ChaCha8Rng::from_seed(thread_rng().gen()); let mut rng = ChaCha8Rng::from_seed(thread_rng().gen());
@ -138,6 +140,7 @@ impl BlocksOfInterest {
lavapool.push(pos) lavapool.push(pos)
} }
}, },
BlockKind::GlowingMushroom if rng.gen_range(0..8) == 0 => spores.push(pos),
BlockKind::Snow | BlockKind::Ice if rng.gen_range(0..16) == 0 => snow.push(pos), BlockKind::Snow | BlockKind::Ice if rng.gen_range(0..16) == 0 => snow.push(pos),
_ => { _ => {
if let Some(sprite) = block.get_sprite() { if let Some(sprite) = block.get_sprite() {
@ -225,6 +228,8 @@ impl BlocksOfInterest {
SpriteKind::Sign | SpriteKind::HangingSign => { SpriteKind::Sign | SpriteKind::HangingSign => {
interactables.push((pos, Interaction::Read)) interactables.push((pos, Interaction::Read))
}, },
SpriteKind::MycelBlue => spores.push(pos),
SpriteKind::Mold => spores.push(pos),
_ => {}, _ => {},
} }
} }
@ -268,6 +273,7 @@ impl BlocksOfInterest {
flowers, flowers,
fire_bowls, fire_bowls,
snow, snow,
spores,
cricket1, cricket1,
cricket2, cricket2,
cricket3, cricket3,

View File

@ -1216,20 +1216,26 @@ fn write_column<R: Rng>(
BlockKind::Sand BlockKind::Sand
} else if rand.chance(wpos, biome.leafy) { } else if rand.chance(wpos, biome.leafy) {
BlockKind::ArtLeaves BlockKind::ArtLeaves
} else if ceiling_cover > 0.0 {
BlockKind::Rock
} else { } else {
BlockKind::WeakRock BlockKind::WeakRock
}, },
stalactite.map(|e| e as u8), stalactite.map(|e| e as u8),
) )
} else if z < ceiling && z >= ceiling_drip { } else if z < ceiling && z >= ceiling_drip {
let color = if biome.mushroom > 0.9 { if biome.mushroom > 0.9 {
Rgb::new(10, 70, 148) let block = if rand.chance(wpos2d.with_z(89), 0.05) {
} else if biome.icy > 0.9 { BlockKind::GlowingMushroom
Rgb::new(120, 140, 255)
} else { } else {
Rgb::new(80, 100, 150) BlockKind::GlowingWeakRock
}; };
Block::new(BlockKind::GlowingRock, color) Block::new(block, Rgb::new(10, 70, 148))
} else if biome.icy > 0.9 {
Block::new(BlockKind::GlowingWeakRock, Rgb::new(120, 140, 255))
} else {
Block::new(BlockKind::WeakRock, Rgb::new(80, 100, 150))
}
} else if z >= base && z < floor && !void_below && !sky_above { } else if z >= base && z < floor && !void_below && !sky_above {
let (net_col, total) = [ let (net_col, total) = [
( (