add weather intensity (WIP)

This commit is contained in:
MihailRis
2025-02-26 02:24:16 +03:00
parent 830e05733f
commit fe503d1192
5 changed files with 38 additions and 6 deletions
+3 -3
View File
@@ -115,7 +115,7 @@ void Decorator::updateRandom(
return;
}
}
if (dst2 < 128 && rainSplash.has_value()) {
if (dst2 < 128 && random.randFloat() < glm::pow(weather.intensity, 2.0f) && rainSplash.has_value()) {
auto treg = util::get_texture_region(
assets, "particles:rain_splash_0", ""
);
@@ -131,13 +131,13 @@ void Decorator::updateRandom(
2
));
}
if (random.rand() % 200 < 2 && pos.y < areaCenter.y + 1) {
if (random.rand() % 200 < 3 && pos.y < areaCenter.y + 1) {
auto sound = assets.get<audio::Sound>(weather.fall.noise);
audio::play(
sound,
pos,
false,
1.0f,
weather.intensity * weather.intensity,
1.0f,
false,
audio::PRIORITY_LOW,