forked from mtcontrib/regional_weather
Compare commits
3 Commits
v1.1.1
...
caeff69f27
Author | SHA1 | Date | |
---|---|---|---|
caeff69f27 | |||
6c150faaaf | |||
1a20676883 |
@ -14,7 +14,9 @@ end
|
|||||||
|
|
||||||
-- maps range of 0 to 1 to any other range
|
-- maps range of 0 to 1 to any other range
|
||||||
local function map_range(val, low, high)
|
local function map_range(val, low, high)
|
||||||
return (val + low) * (high - low)
|
local cal_val = math.min(math.max(val, 0), 1)
|
||||||
|
local range = high - low
|
||||||
|
return low + (cal_val * range)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function generate_effects(params)
|
local function generate_effects(params)
|
||||||
@ -36,8 +38,8 @@ local function generate_effects(params)
|
|||||||
-- zero at dawn / dusk and one at midday
|
-- zero at dawn / dusk and one at midday
|
||||||
local daytime_shadows = 1 - (math.abs(0.5 - daytime) * 2 / daylight_duration)
|
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 shadow_intensity = map_range(cloud_shadows + daytime_shadows, 0.15, 0.4)
|
||||||
local light_saturation = map_range(cloud_shadows + daytime_shadows, 0.8, 1.2)
|
local light_saturation = map_range(cloud_shadows + daytime_shadows, 0.9, 1.1)
|
||||||
|
|
||||||
local skybox = {priority = 10}
|
local skybox = {priority = 10}
|
||||||
skybox.cloud_data = {
|
skybox.cloud_data = {
|
||||||
@ -88,7 +90,7 @@ local function generate_effects(params)
|
|||||||
local movement_penalty = climate_api.utility.sigmoid(vector_product, 1.5, 0.15, 0.9) + 0.2
|
local movement_penalty = climate_api.utility.sigmoid(vector_product, 1.5, 0.15, 0.9) + 0.2
|
||||||
override["regional_weather:speed_buff"] = movement_penalty
|
override["regional_weather:speed_buff"] = movement_penalty
|
||||||
end
|
end
|
||||||
|
|
||||||
return override
|
return override
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
# textdomain:regional_weather
|
# 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
|
Thin Ice=Dünnes Eis
|
||||||
Puddle=Pfütze
|
Puddle=Pfütze
|
||||||
Snow Cover=Schnee
|
Snow Cover=Schnee
|
@ -1,5 +1,4 @@
|
|||||||
# textdomain:regional_weather
|
# textdomain:regional_weather
|
||||||
Disable MTG weather for the best experience=
|
|
||||||
Thin Ice=
|
Thin Ice=
|
||||||
Puddle=
|
Puddle=
|
||||||
Snow Cover=
|
Snow Cover=
|
Reference in New Issue
Block a user