2020-04-13 01:58:27 +02:00
|
|
|
local name = "regional_weather:sandstorm"
|
|
|
|
|
|
|
|
local conditions = {
|
|
|
|
min_height = regional_weather.settings.min_height,
|
|
|
|
max_height = regional_weather.settings.max_height,
|
|
|
|
min_heat = 50,
|
|
|
|
max_humidity = 25,
|
2020-04-22 00:54:27 +02:00
|
|
|
min_windspeed = 4.5,
|
2020-04-18 08:03:02 +02:00
|
|
|
has_biome = {
|
2020-04-18 17:26:01 +02:00
|
|
|
"cold_desert",
|
|
|
|
"cold_desert_ocean",
|
2020-04-18 08:03:02 +02:00
|
|
|
"desert",
|
2020-04-18 17:26:01 +02:00
|
|
|
"desert_ocean",
|
2020-04-18 08:03:02 +02:00
|
|
|
"sandstone_desert",
|
2020-04-18 17:26:01 +02:00
|
|
|
"sandstone_desert_ocean"
|
2020-04-18 08:03:02 +02:00
|
|
|
}
|
2020-04-13 01:58:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
local effects = {}
|
|
|
|
|
2020-04-16 08:04:06 +02:00
|
|
|
effects["climate_api:hud_overlay"] = {
|
|
|
|
file = "weather_hud_sand.png",
|
2020-04-24 19:52:03 +02:00
|
|
|
z_index = -100,
|
|
|
|
color_correction = true
|
2020-04-16 08:04:06 +02:00
|
|
|
}
|
2020-04-13 01:58:27 +02:00
|
|
|
|
2020-04-28 01:23:46 +02:00
|
|
|
effects["climate_api:damage"] = {
|
2020-05-13 16:05:21 +02:00
|
|
|
rarity = 3,
|
2020-04-28 01:23:46 +02:00
|
|
|
value = 1,
|
|
|
|
check = {
|
|
|
|
type = "raycast",
|
|
|
|
height = 0,
|
|
|
|
velocity = 0.3
|
|
|
|
}
|
2020-04-22 00:54:27 +02:00
|
|
|
}
|
|
|
|
|
2020-04-13 01:58:27 +02:00
|
|
|
effects["climate_api:particles"] = {
|
2020-04-28 01:23:46 +02:00
|
|
|
boxsize = { x = 8, y = 4.5, z = 8 },
|
|
|
|
velocity = 0.6,
|
|
|
|
acceleration = -0.2,
|
|
|
|
amount = 12,
|
|
|
|
expirationtime = 0.7,
|
|
|
|
size = 25,
|
|
|
|
texture = {
|
2020-04-22 00:54:27 +02:00
|
|
|
"weather_sandstorm.png",
|
2020-04-28 01:23:46 +02:00
|
|
|
"weather_sandstorm.png^[transformFY",
|
|
|
|
"weather_sandstorm.png^[transformR180",
|
|
|
|
"weather_sandstorm.png^[transformFYR180"
|
2020-04-22 00:54:27 +02:00
|
|
|
}
|
2020-04-13 01:58:27 +02:00
|
|
|
}
|
|
|
|
|
2020-04-22 00:54:27 +02:00
|
|
|
effects["climate_api:skybox"] = {
|
2020-04-24 01:36:58 +02:00
|
|
|
sky_data = {
|
|
|
|
type = "plain",
|
|
|
|
clouds = true,
|
|
|
|
},
|
2020-04-22 00:54:27 +02:00
|
|
|
cloud_data = {
|
|
|
|
density = 1,
|
|
|
|
color = "#f7e4bfc0",
|
|
|
|
thickness = 40,
|
|
|
|
speed = {x=0,y=0,z=0}
|
|
|
|
},
|
|
|
|
priority = 60
|
|
|
|
}
|
|
|
|
|
|
|
|
local function generate_effects(params)
|
2020-04-24 01:36:58 +02:00
|
|
|
local override = {}
|
2020-04-24 19:52:03 +02:00
|
|
|
local light = math.max(params.light / 15, 0.2)
|
|
|
|
local color = {r = 247 * light, g = 228 * light, b = 191 * light, a = 256}
|
2020-04-22 00:54:27 +02:00
|
|
|
override["climate_api:skybox"] = {
|
2020-04-24 19:52:03 +02:00
|
|
|
sky_data = {
|
|
|
|
base_color = color
|
|
|
|
},
|
|
|
|
cloud_data = {
|
2020-04-24 01:36:58 +02:00
|
|
|
height = params.player:get_pos().y - 20
|
2020-04-22 00:54:27 +02:00
|
|
|
}
|
|
|
|
}
|
2020-04-24 01:36:58 +02:00
|
|
|
override = climate_api.utility.merge_tables(effects, override)
|
2020-04-22 00:54:27 +02:00
|
|
|
if params.daylight < 15 then
|
|
|
|
local result = {}
|
|
|
|
result["climate_api:skybox"] = override["climate_api:skybox"]
|
|
|
|
return result
|
|
|
|
end
|
|
|
|
return override
|
|
|
|
end
|
|
|
|
|
|
|
|
climate_api.register_weather(name, conditions, generate_effects)
|