Compare commits

...

5 Commits

Author SHA1 Message Date
Till Affeldt 6c150faaaf Decrease strength of lighting effects 2023-04-02 10:58:41 +02:00
Till Affeldt 1a20676883 Remove unused translation 2023-04-02 10:58:22 +02:00
Till Affeldt 222f708760 Add additional constraints 2023-02-24 09:51:14 +01:00
Till Affeldt d04daec67d Reconfigure fog to only show up in the morning and always heavy, remove puddle sound 2023-02-24 08:24:31 +01:00
Till Affeldt 5edea29484 Move check for MTG weather to Climate API instead 2023-02-23 04:33:44 +01:00
22 changed files with 116 additions and 112 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.code-workspace

View File

@ -87,7 +87,6 @@ The entire source code is available on [Github](https://github.com/t-affeldt/reg
- Light Rain sounds: *CC BY 3.0* by Arctura from https://freesound.org/people/Arctura/sounds/34065/
- Wind sound: *CC BY (3.0)* by InspectorJ from https://freesound.org/people/InspectorJ/sounds/376415/
- Hail sound: *CC0* by ikayuka from https://freesound.org/people/ikayuka/sounds/240742/
- Puddle footstep sound: *CC0* by swordofkings128 from https://freesound.org/people/swordofkings128/sounds/398032/
### HUD Overlays
- Frost HUD: *CC BY-SA (3.0)* by Cap

View File

@ -12,7 +12,8 @@ climate_api.register_abm({
conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_humidity = 55,
min_humidity = 50,
min_biome_humidity = 26,
max_heat = 85,
daylight = 15,
indoors = false

View File

@ -42,7 +42,7 @@ climate_api.register_abm({
conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
max_heat = 25,
max_heat = 35,
daylight = 15,
indoors = false
},
@ -62,7 +62,7 @@ climate_api.register_abm({
conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_heat = 40,
min_heat = 35,
daylight = 15,
indoors = false
},

View File

@ -20,7 +20,7 @@ climate_api.register_abm({
action = function (pos, node, env)
local wetness = minetest.get_item_group(node.name, "wet") or 0
if wetness < 2 and env.humidity > 55 then
if wetness < 2 and env.humidity > 50 then
pedology.wetten(pos)
elseif wetness > 0 and wetness < 3 and env.humidity < 40 then
pedology.dry(pos)

View File

@ -80,13 +80,7 @@ for i = 1, VARIANT_COUNT do
water = apply_water_group,
weather_puddle = 1
},
drop = "",
sounds = {
footstep = {
name = "weather_puddle",
gain = 0.8
}
}
drop = ""
})
end
end
@ -115,12 +109,22 @@ climate_api.register_abm({
catch_up = false,
conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_humidity = 55,
min_heat = 30,
daylight = 15,
indoors = false
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_heat = 35,
min_humidity = 50,
min_biome_humidity = 26,
daylight = 15,
indoors = false,
not_biome = {
"cold_desert",
"cold_desert_ocean",
"desert",
"desert_ocean",
"sandstone_desert",
"sandstone_desert_ocean",
"tundra"
}
},
pos_override = function(pos)

View File

@ -70,11 +70,12 @@ climate_api.register_abm({
catch_up = false,
conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_humidity = 55,
max_heat = 30,
not_biome = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
max_heat = 35,
min_humidity = 50,
min_biome_humidity = 26,
not_biome = {
"cold_desert",
"cold_desert_ocean",
"desert",

View File

@ -12,8 +12,8 @@ if farming ~= nil and farming.mod == "redo" then
conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_humidity = 55,
min_heat = 30,
min_humidity = 50,
min_heat = 35,
daylight = 15,
indoors = false
},
@ -34,8 +34,8 @@ else
conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_humidity = 55,
min_heat = 30,
min_humidity = 50,
min_heat = 35,
daylight = 15,
indoors = false
},

View File

@ -21,7 +21,7 @@ local function generate_effects(params)
local override = {}
local cloud_density = climate_api.utility.rangelim(params.humidity / 100, 0.15, 0.65)
local cloud_thickness = climate_api.utility.rangelim(params.base_humidity * 0.2, 1, 18)
local cloud_thickness = climate_api.utility.rangelim(params.biome_humidity * 0.2, 1, 18)
local cloud_height = calc_cloud_height(params.heat, params.humidity, params.dewpoint)
local wind = climate_api.environment.get_wind({ x = 0, y = cloud_height, z = 0 })
@ -36,8 +36,8 @@ local function generate_effects(params)
-- zero at dawn / dusk and one at midday
local daytime_shadows = 1 - (math.abs(0.5 - daytime) * 2 / daylight_duration)
local shadow_intensity = map_range(cloud_shadows + daytime_shadows, 0.15, 0.5)
local light_saturation = map_range(cloud_shadows + daytime_shadows, 0.8, 1.2)
local shadow_intensity = map_range(cloud_shadows + daytime_shadows, 0.15, 0.4)
local light_saturation = map_range(cloud_shadows + daytime_shadows, 0.9, 1.1)
local skybox = {priority = 10}
skybox.cloud_data = {
@ -88,7 +88,7 @@ local function generate_effects(params)
local movement_penalty = climate_api.utility.sigmoid(vector_product, 1.5, 0.15, 0.9) + 0.2
override["regional_weather:speed_buff"] = movement_penalty
end
return override
end

View File

@ -3,17 +3,35 @@ local name = "regional_weather:fog"
local conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_humidity = 40,
min_humidity = 25,
max_humidity = 50,
max_windspeed = 2,
min_heat = 40,
max_heat = 50
max_heat = 50,
min_time = 4 / 24,
max_time = 8 / 24,
not_biome = {
"cold_desert",
"cold_desert_ocean",
"desert",
"desert_ocean",
"sandstone_desert",
"sandstone_desert_ocean",
"tundra"
}
}
local effects = {}
effects["climate_api:hud_overlay"] = {
file = "weather_hud_fog.png^[opacity:100",
z_index = -200,
color_correction = true
}
effects["climate_api:skybox"] = {
sky_data = {
type = "plain",
base_color = "#c0c0c08f",
clouds = true
},
cloud_data = {
@ -22,6 +40,10 @@ effects["climate_api:skybox"] = {
thickness = 40,
speed = {x=0,y=0,z=0}
},
light_data = {
shadow_intensity = 0.1,
saturation = 0.5
},
priority = 50
}

View File

@ -1,32 +0,0 @@
local name = "regional_weather:fog_heavy"
local conditions = {
min_height = regional_weather.settings.min_height * 0.9,
max_height = regional_weather.settings.max_height * 0.9,
min_humidity = 43,
max_humidity = 47,
max_windspeed = 1.5,
min_heat = 43,
max_heat = 47
}
local effects = {}
effects["climate_api:hud_overlay"] = {
file = "weather_hud_fog.png^[opacity:100",
z_index = -200,
color_correction = true
}
effects["climate_api:skybox"] = {
sky_data = {
type = "plain",
base_color = "#c0c0c08f"
},
cloud_data = {
color = "#ffffffc0",
},
priority = 51
}
climate_api.register_weather(name, conditions, effects)

View File

@ -1,14 +1,15 @@
local name = "regional_weather:hail"
local conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_heat = 30,
max_heat = 45,
min_humidity = 65,
min_windspeed = 2.5,
indoors = false,
not_biome = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_heat = 30,
max_heat = 45,
min_humidity = 65,
min_biome_humidity = 26,
min_windspeed = 2.5,
indoors = false,
not_biome = {
"cold_desert",
"cold_desert_ocean",
"desert",

View File

@ -1,12 +1,22 @@
local name = "regional_weather:rain"
local conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_heat = 35,
min_humidity = 50,
max_humidity = 65,
indoors = false
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_heat = 35,
min_humidity = 50,
max_humidity = 65,
min_biome_humidity = 26,
indoors = false,
not_biome = {
"cold_desert",
"cold_desert_ocean",
"desert",
"desert_ocean",
"sandstone_desert",
"sandstone_desert_ocean",
"tundra"
}
}
local effects = {}

View File

@ -1,11 +1,21 @@
local name = "regional_weather:rain_heavy"
local conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_heat = 40,
min_humidity = 65,
indoors = false
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_heat = 40,
min_humidity = 65,
min_biome_humidity = 26,
indoors = false,
not_biome = {
"cold_desert",
"cold_desert_ocean",
"desert",
"desert_ocean",
"sandstone_desert",
"sandstone_desert_ocean",
"tundra"
}
}
local effects = {}

View File

@ -3,16 +3,11 @@ 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,
min_windspeed = 4.5,
min_windspeed = 3,
has_biome = {
"cold_desert",
"cold_desert_ocean",
"desert",
"desert_ocean",
"sandstone_desert",
"sandstone_desert_ocean"
"sandstone_desert"
}
}

View File

@ -3,11 +3,12 @@ local name = "regional_weather:snow"
local conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
max_heat = 35,
min_humidity = 50,
max_humidity = 65,
indoors = false,
not_biome = {
max_heat = 35,
min_humidity = 50,
max_humidity = 65,
min_biome_humidity = 26,
indoors = false,
not_biome = {
"cold_desert",
"cold_desert_ocean",
"desert",

View File

@ -3,10 +3,11 @@ local name = "regional_weather:snow_heavy"
local conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
max_heat = 30,
min_humidity = 65,
indoors = false,
not_biome = {
max_heat = 30,
min_humidity = 65,
min_biome_humidity = 26,
indoors = false,
not_biome = {
"cold_desert",
"cold_desert_ocean",
"desert",

View File

@ -19,7 +19,7 @@ local function generate_effects(params)
local override = {}
override["climate_api:sound"] = {
gain = math.min(intensity, 1.2)
gain = math.min(intensity, 1)
}
return climate_api.utility.merge_tables(effects, override)

View File

@ -37,18 +37,10 @@ regional_weather.settings.cloud_scale = get_setting_number("cloud_scale", 40)
local S = minetest.get_translator("regional_weather")
regional_weather.i18n = S
-- warn about clouds being overriden by MTG weather
if climate_mod.settings.skybox
and minetest.get_modpath("weather")
and get_setting_bool("enable_weather", true, true) then
minetest.log("warning", "[Regional Weather] " .. S("Disable MTG weather for the best experience. Check the forum for more information."))
end
-- import individual weather types
dofile(modpath.."/ca_weathers/ambient.lua")
dofile(modpath.."/ca_weathers/deep_cave.lua")
dofile(modpath.."/ca_weathers/fog.lua")
dofile(modpath.."/ca_weathers/fog_heavy.lua")
dofile(modpath.."/ca_weathers/hail.lua")
dofile(modpath.."/ca_weathers/pollen.lua")
dofile(modpath.."/ca_weathers/rain.lua")

View File

@ -1,5 +1,4 @@
# textdomain:regional_weather
Disable MTG weather for the best experience. Check the forum for more information.=Deaktiviere MTG weather für die beste Spielerfahrung. Mehr Informationen im Forum.
Thin Ice=Dünnes Eis
Puddle=Pfütze
Snow Cover=Schnee

View File

@ -1,5 +1,4 @@
# textdomain:regional_weather
Disable MTG weather for the best experience=
Thin Ice=
Puddle=
Snow Cover=

Binary file not shown.