mirror of
https://github.com/t-affeldt/climate_api.git
synced 2024-11-16 15:40:23 +01:00
28 lines
526 B
Lua
28 lines
526 B
Lua
local name = weather_mod.modname .. ":storm"
|
|
|
|
local config = {}
|
|
|
|
config.sound = {
|
|
name = "weather_wind",
|
|
gain = 1
|
|
}
|
|
|
|
config.conditions = {
|
|
min_height = weather_mod.settings.min_height,
|
|
max_height = weather_mod.settings.max_height,
|
|
min_windspeed = 5
|
|
}
|
|
|
|
local function override(params)
|
|
local avg_windspeed = 6
|
|
local intensity = params.windspeed / avg_windspeed
|
|
local dynamic_config = {
|
|
sound = {
|
|
gain = math.min(intensity, 1.2)
|
|
}
|
|
}
|
|
return dynamic_config
|
|
end
|
|
|
|
weather_mod.register_effect(name, config, override)
|