1
0
mirror of https://github.com/t-affeldt/regional_weather.git synced 2024-09-28 23:40:22 +02:00

Compare commits

..

No commits in common. "master" and "v1.1.1" have entirely different histories.

3 changed files with 8 additions and 6 deletions

View File

@ -14,7 +14,7 @@ end
-- maps range of 0 to 1 to any other range
local function map_range(val, low, high)
return val * (high - low) + low
return (val + low) * (high - low)
end
local function generate_effects(params)
@ -26,8 +26,8 @@ local function generate_effects(params)
local wind = climate_api.environment.get_wind({ x = 0, y = cloud_height, z = 0 })
-- diffuse shadows when cloudy
-- cloud_shadows at zero at cloud density 0.65 and one at 0.15
local cloud_shadows = 1 - ((cloud_density - 0.15) / (0.65 - 0.15))
-- zero at density 0.65 and one at 0.15
local cloud_shadows = 1.075 - (cloud_density / 0.5)
-- diffuse shadows at dawn / dusk
-- 15 hours between dawn and dusk accoring to https://wiki.minetest.net/Time_of_day
@ -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) / 2, 0.5, 2)
local light_saturation = map_range((cloud_shadows + daytime_shadows) / 2, 0.75, 1.25)
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 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

@ -1,4 +1,5 @@
# 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,4 +1,5 @@
# textdomain:regional_weather
Disable MTG weather for the best experience=
Thin Ice=
Puddle=
Snow Cover=