mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Mushroom spore particles
This commit is contained in:
parent
2f051f9c6a
commit
50905aebfe
@ -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-test-server = "run --bin veloren-server-cli --no-default-features --features tracy,simd --profile no_overflow"
|
||||
# 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"
|
||||
dbg-voxygen = "run --bin veloren-voxygen --profile debuginfo"
|
||||
# misc
|
||||
|
@ -96,6 +96,7 @@ const int PHOENIX_BEAM = 56;
|
||||
const int PHOENIX_BUILD_UP_AIM = 57;
|
||||
const int CLAY_SHRAPNEL = 58;
|
||||
const int AIRFLOW = 59;
|
||||
const int SPORE = 60;
|
||||
|
||||
// meters per second squared (acceleration)
|
||||
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)
|
||||
);
|
||||
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:
|
||||
attr = Attr(
|
||||
linear_motion(
|
||||
|
@ -111,6 +111,7 @@ pub enum ParticleMode {
|
||||
PhoenixBuildUpAim = 57,
|
||||
ClayShrapnel = 58,
|
||||
Airflow = 59,
|
||||
Spore = 60,
|
||||
}
|
||||
|
||||
impl ParticleMode {
|
||||
|
@ -2186,6 +2186,14 @@ impl ParticleMgr {
|
||||
mode: ParticleMode::PortalFizz,
|
||||
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();
|
||||
|
@ -49,6 +49,7 @@ pub struct BlocksOfInterest {
|
||||
pub flowers: Vec<Vec3<i32>>,
|
||||
pub fire_bowls: 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
|
||||
pub cricket1: Vec<Vec3<i32>>,
|
||||
pub cricket2: Vec<Vec3<i32>>,
|
||||
@ -97,6 +98,7 @@ impl BlocksOfInterest {
|
||||
let mut cricket3 = Vec::new();
|
||||
let mut frogs = Vec::new();
|
||||
let mut one_way_walls = Vec::new();
|
||||
let mut spores = Vec::new();
|
||||
|
||||
let mut rng = ChaCha8Rng::from_seed(thread_rng().gen());
|
||||
|
||||
@ -138,6 +140,7 @@ impl BlocksOfInterest {
|
||||
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),
|
||||
_ => {
|
||||
if let Some(sprite) = block.get_sprite() {
|
||||
@ -225,6 +228,8 @@ impl BlocksOfInterest {
|
||||
SpriteKind::Sign | SpriteKind::HangingSign => {
|
||||
interactables.push((pos, Interaction::Read))
|
||||
},
|
||||
SpriteKind::MycelBlue => spores.push(pos),
|
||||
SpriteKind::Mold => spores.push(pos),
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
@ -268,6 +273,7 @@ impl BlocksOfInterest {
|
||||
flowers,
|
||||
fire_bowls,
|
||||
snow,
|
||||
spores,
|
||||
cricket1,
|
||||
cricket2,
|
||||
cricket3,
|
||||
|
@ -1216,20 +1216,26 @@ fn write_column<R: Rng>(
|
||||
BlockKind::Sand
|
||||
} else if rand.chance(wpos, biome.leafy) {
|
||||
BlockKind::ArtLeaves
|
||||
} else if ceiling_cover > 0.0 {
|
||||
BlockKind::Rock
|
||||
} else {
|
||||
BlockKind::WeakRock
|
||||
},
|
||||
stalactite.map(|e| e as u8),
|
||||
)
|
||||
} else if z < ceiling && z >= ceiling_drip {
|
||||
let color = if biome.mushroom > 0.9 {
|
||||
Rgb::new(10, 70, 148)
|
||||
if biome.mushroom > 0.9 {
|
||||
let block = if rand.chance(wpos2d.with_z(89), 0.05) {
|
||||
BlockKind::GlowingMushroom
|
||||
} else {
|
||||
BlockKind::GlowingWeakRock
|
||||
};
|
||||
Block::new(block, Rgb::new(10, 70, 148))
|
||||
} else if biome.icy > 0.9 {
|
||||
Rgb::new(120, 140, 255)
|
||||
Block::new(BlockKind::GlowingWeakRock, Rgb::new(120, 140, 255))
|
||||
} else {
|
||||
Rgb::new(80, 100, 150)
|
||||
};
|
||||
Block::new(BlockKind::GlowingRock, color)
|
||||
Block::new(BlockKind::WeakRock, Rgb::new(80, 100, 150))
|
||||
}
|
||||
} else if z >= base && z < floor && !void_below && !sky_above {
|
||||
let (net_col, total) = [
|
||||
(
|
||||
|
Loading…
Reference in New Issue
Block a user