climate_api/weathers/storm.lua
2020-04-09 18:31:52 +02:00

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)