1
0
mirror of https://github.com/t-affeldt/regional_weather.git synced 2024-11-18 00:18:21 +01:00

Tweak weather conditions

This commit is contained in:
Till Affeldt 2020-04-13 13:40:36 +02:00
parent 5b3ddf895c
commit c43e972e83
6 changed files with 12 additions and 10 deletions

View File

@ -3,6 +3,8 @@ if not minetest.get_modpath("lightning") then return end
local LIGHTNING_CHANCE = 10
lightning.auto = false
local rng = PcgRandom(82492402425)
local function handle_effect(player_data)
for playername, data in pairs(player_data) do
local player = minetest.get_player_by_name(playername)

View File

@ -4,8 +4,8 @@ local conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_heat = 30,
min_humidity = 40,
max_humidity = 60
min_humidity = 50,
max_humidity = 65
}
local effects = {}

View File

@ -3,8 +3,8 @@ local name = "regional_weather:rain_heavy"
local conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
min_heat = 30,
min_humidity = 60
min_heat = 40,
min_humidity = 65
}
local effects = {}

View File

@ -4,8 +4,8 @@ local conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
max_heat = 40,
min_humidity = 40,
max_humidity = 55
min_humidity = 50,
max_humidity = 65
}
local effects = {}

View File

@ -3,8 +3,8 @@ local name = "regional_weather:snow_heavy"
local conditions = {
min_height = regional_weather.settings.min_height,
max_height = regional_weather.settings.max_height,
max_heat = 40,
min_humidity = 55
max_heat = 30,
min_humidity = 65
}
local effects = {}

View File

@ -9,12 +9,12 @@ local function generate_effects(params)
override["climate_api:skybox"] = {
clouds_data = {
speed = params.state.wind * CLOUD_SPEED_MULTIPLICATOR
speed = params.wind * CLOUD_SPEED_MULTIPLICATOR
}
}
local movement_direction = vector.normalize(params.player:get_player_velocity())
local vector_product = vector.dot(movement_direction, params.state.wind)
local vector_product = vector.dot(movement_direction, params.wind)
local movement_penalty = climate_api.utility.logistic_growth(vector_product, 1.6, 0.15, 0.8) + 0.1
override["regional_weather:speed_buff"] = movement_penalty