2020-04-09 09:03:02 +02:00
|
|
|
local name = weather_mod.modname .. ":rain"
|
|
|
|
|
2020-04-09 18:31:52 +02:00
|
|
|
local config = {}
|
|
|
|
|
|
|
|
config.environment = {
|
2020-04-09 09:03:02 +02:00
|
|
|
spawn_puddles = true,
|
2020-04-09 18:31:52 +02:00
|
|
|
wetten_farmland = true
|
|
|
|
}
|
|
|
|
|
|
|
|
config.sound = {
|
|
|
|
name = "weather_rain",
|
|
|
|
gain = 1
|
2020-04-09 09:03:02 +02:00
|
|
|
}
|
|
|
|
|
2020-04-09 18:31:52 +02:00
|
|
|
config.particles = {
|
2020-04-09 09:03:02 +02:00
|
|
|
min_pos = {x=-9, y=7, z=-9},
|
|
|
|
max_pos = {x= 9, y=7, z= 9},
|
|
|
|
falling_speed=10,
|
2020-04-09 18:31:52 +02:00
|
|
|
amount=40,
|
2020-04-09 09:03:02 +02:00
|
|
|
exptime=0.8,
|
2020-04-09 18:31:52 +02:00
|
|
|
size=1,
|
|
|
|
texture = "weather_raindrop.png"
|
2020-04-09 09:03:02 +02:00
|
|
|
}
|
|
|
|
|
2020-04-09 18:31:52 +02:00
|
|
|
config.conditions = {
|
|
|
|
min_height = weather_mod.settings.min_height,
|
|
|
|
max_height = weather_mod.settings.max_height,
|
2020-04-09 09:03:02 +02:00
|
|
|
min_heat = 30,
|
2020-04-09 18:31:52 +02:00
|
|
|
min_humidity = 40,
|
|
|
|
max_humidity = 60
|
2020-04-09 09:03:02 +02:00
|
|
|
}
|
|
|
|
|
2020-04-09 18:31:52 +02:00
|
|
|
local function override(params)
|
|
|
|
local avg_humidity = 40
|
|
|
|
local intensity = params.humidity / avg_humidity
|
|
|
|
local dynamic_config = {
|
|
|
|
sound = {
|
|
|
|
gain = math.min(intensity, 1.2)
|
|
|
|
},
|
|
|
|
particles = {
|
|
|
|
amount = 20 * math.min(intensity, 1.5),
|
|
|
|
falling_speed = 10 / math.min(intensity, 1.3)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return dynamic_config
|
|
|
|
end
|
|
|
|
|
|
|
|
weather_mod.register_effect(name, config, override)
|