forked from mtcontrib/regional_weather
Add additional constraints
This commit is contained in:
parent
d04daec67d
commit
222f708760
@ -12,7 +12,8 @@ climate_api.register_abm({
|
|||||||
conditions = {
|
conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
min_humidity = 55,
|
min_humidity = 50,
|
||||||
|
min_biome_humidity = 26,
|
||||||
max_heat = 85,
|
max_heat = 85,
|
||||||
daylight = 15,
|
daylight = 15,
|
||||||
indoors = false
|
indoors = false
|
||||||
|
@ -42,7 +42,7 @@ climate_api.register_abm({
|
|||||||
conditions = {
|
conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
max_heat = 25,
|
max_heat = 35,
|
||||||
daylight = 15,
|
daylight = 15,
|
||||||
indoors = false
|
indoors = false
|
||||||
},
|
},
|
||||||
@ -62,7 +62,7 @@ climate_api.register_abm({
|
|||||||
conditions = {
|
conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
min_heat = 40,
|
min_heat = 35,
|
||||||
daylight = 15,
|
daylight = 15,
|
||||||
indoors = false
|
indoors = false
|
||||||
},
|
},
|
||||||
|
@ -20,7 +20,7 @@ climate_api.register_abm({
|
|||||||
|
|
||||||
action = function (pos, node, env)
|
action = function (pos, node, env)
|
||||||
local wetness = minetest.get_item_group(node.name, "wet") or 0
|
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)
|
pedology.wetten(pos)
|
||||||
elseif wetness > 0 and wetness < 3 and env.humidity < 40 then
|
elseif wetness > 0 and wetness < 3 and env.humidity < 40 then
|
||||||
pedology.dry(pos)
|
pedology.dry(pos)
|
||||||
|
@ -109,12 +109,22 @@ climate_api.register_abm({
|
|||||||
catch_up = false,
|
catch_up = false,
|
||||||
|
|
||||||
conditions = {
|
conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
min_humidity = 55,
|
min_heat = 35,
|
||||||
min_heat = 30,
|
min_humidity = 50,
|
||||||
daylight = 15,
|
min_biome_humidity = 26,
|
||||||
indoors = false
|
daylight = 15,
|
||||||
|
indoors = false,
|
||||||
|
not_biome = {
|
||||||
|
"cold_desert",
|
||||||
|
"cold_desert_ocean",
|
||||||
|
"desert",
|
||||||
|
"desert_ocean",
|
||||||
|
"sandstone_desert",
|
||||||
|
"sandstone_desert_ocean",
|
||||||
|
"tundra"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
pos_override = function(pos)
|
pos_override = function(pos)
|
||||||
|
@ -70,11 +70,12 @@ climate_api.register_abm({
|
|||||||
catch_up = false,
|
catch_up = false,
|
||||||
|
|
||||||
conditions = {
|
conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
min_humidity = 55,
|
max_heat = 35,
|
||||||
max_heat = 30,
|
min_humidity = 50,
|
||||||
not_biome = {
|
min_biome_humidity = 26,
|
||||||
|
not_biome = {
|
||||||
"cold_desert",
|
"cold_desert",
|
||||||
"cold_desert_ocean",
|
"cold_desert_ocean",
|
||||||
"desert",
|
"desert",
|
||||||
|
@ -12,8 +12,8 @@ if farming ~= nil and farming.mod == "redo" then
|
|||||||
conditions = {
|
conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
min_humidity = 55,
|
min_humidity = 50,
|
||||||
min_heat = 30,
|
min_heat = 35,
|
||||||
daylight = 15,
|
daylight = 15,
|
||||||
indoors = false
|
indoors = false
|
||||||
},
|
},
|
||||||
@ -34,8 +34,8 @@ else
|
|||||||
conditions = {
|
conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
min_humidity = 55,
|
min_humidity = 50,
|
||||||
min_heat = 30,
|
min_heat = 35,
|
||||||
daylight = 15,
|
daylight = 15,
|
||||||
indoors = false
|
indoors = false
|
||||||
},
|
},
|
||||||
|
@ -21,7 +21,7 @@ local function generate_effects(params)
|
|||||||
local override = {}
|
local override = {}
|
||||||
|
|
||||||
local cloud_density = climate_api.utility.rangelim(params.humidity / 100, 0.15, 0.65)
|
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 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 })
|
local wind = climate_api.environment.get_wind({ x = 0, y = cloud_height, z = 0 })
|
||||||
|
|
||||||
|
@ -8,7 +8,16 @@ local conditions = {
|
|||||||
max_windspeed = 2,
|
max_windspeed = 2,
|
||||||
max_heat = 50,
|
max_heat = 50,
|
||||||
min_time = 4 / 24,
|
min_time = 4 / 24,
|
||||||
max_time = 8 / 24
|
max_time = 8 / 24,
|
||||||
|
not_biome = {
|
||||||
|
"cold_desert",
|
||||||
|
"cold_desert_ocean",
|
||||||
|
"desert",
|
||||||
|
"desert_ocean",
|
||||||
|
"sandstone_desert",
|
||||||
|
"sandstone_desert_ocean",
|
||||||
|
"tundra"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local effects = {}
|
local effects = {}
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
local name = "regional_weather:hail"
|
local name = "regional_weather:hail"
|
||||||
|
|
||||||
local conditions = {
|
local conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
min_heat = 30,
|
min_heat = 30,
|
||||||
max_heat = 45,
|
max_heat = 45,
|
||||||
min_humidity = 65,
|
min_humidity = 65,
|
||||||
min_windspeed = 2.5,
|
min_biome_humidity = 26,
|
||||||
indoors = false,
|
min_windspeed = 2.5,
|
||||||
not_biome = {
|
indoors = false,
|
||||||
|
not_biome = {
|
||||||
"cold_desert",
|
"cold_desert",
|
||||||
"cold_desert_ocean",
|
"cold_desert_ocean",
|
||||||
"desert",
|
"desert",
|
||||||
|
@ -1,12 +1,22 @@
|
|||||||
local name = "regional_weather:rain"
|
local name = "regional_weather:rain"
|
||||||
|
|
||||||
local conditions = {
|
local conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
min_heat = 35,
|
min_heat = 35,
|
||||||
min_humidity = 50,
|
min_humidity = 50,
|
||||||
max_humidity = 65,
|
max_humidity = 65,
|
||||||
indoors = false
|
min_biome_humidity = 26,
|
||||||
|
indoors = false,
|
||||||
|
not_biome = {
|
||||||
|
"cold_desert",
|
||||||
|
"cold_desert_ocean",
|
||||||
|
"desert",
|
||||||
|
"desert_ocean",
|
||||||
|
"sandstone_desert",
|
||||||
|
"sandstone_desert_ocean",
|
||||||
|
"tundra"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local effects = {}
|
local effects = {}
|
||||||
|
@ -1,11 +1,21 @@
|
|||||||
local name = "regional_weather:rain_heavy"
|
local name = "regional_weather:rain_heavy"
|
||||||
|
|
||||||
local conditions = {
|
local conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
min_heat = 40,
|
min_heat = 40,
|
||||||
min_humidity = 65,
|
min_humidity = 65,
|
||||||
indoors = false
|
min_biome_humidity = 26,
|
||||||
|
indoors = false,
|
||||||
|
not_biome = {
|
||||||
|
"cold_desert",
|
||||||
|
"cold_desert_ocean",
|
||||||
|
"desert",
|
||||||
|
"desert_ocean",
|
||||||
|
"sandstone_desert",
|
||||||
|
"sandstone_desert_ocean",
|
||||||
|
"tundra"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local effects = {}
|
local effects = {}
|
||||||
|
@ -3,16 +3,11 @@ local name = "regional_weather:sandstorm"
|
|||||||
local conditions = {
|
local conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
min_heat = 50,
|
min_windspeed = 3,
|
||||||
max_humidity = 25,
|
|
||||||
min_windspeed = 4.5,
|
|
||||||
has_biome = {
|
has_biome = {
|
||||||
"cold_desert",
|
"cold_desert",
|
||||||
"cold_desert_ocean",
|
|
||||||
"desert",
|
"desert",
|
||||||
"desert_ocean",
|
"sandstone_desert"
|
||||||
"sandstone_desert",
|
|
||||||
"sandstone_desert_ocean"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,11 +3,12 @@ local name = "regional_weather:snow"
|
|||||||
local conditions = {
|
local conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
max_heat = 35,
|
max_heat = 35,
|
||||||
min_humidity = 50,
|
min_humidity = 50,
|
||||||
max_humidity = 65,
|
max_humidity = 65,
|
||||||
indoors = false,
|
min_biome_humidity = 26,
|
||||||
not_biome = {
|
indoors = false,
|
||||||
|
not_biome = {
|
||||||
"cold_desert",
|
"cold_desert",
|
||||||
"cold_desert_ocean",
|
"cold_desert_ocean",
|
||||||
"desert",
|
"desert",
|
||||||
|
@ -3,10 +3,11 @@ local name = "regional_weather:snow_heavy"
|
|||||||
local conditions = {
|
local conditions = {
|
||||||
min_height = regional_weather.settings.min_height,
|
min_height = regional_weather.settings.min_height,
|
||||||
max_height = regional_weather.settings.max_height,
|
max_height = regional_weather.settings.max_height,
|
||||||
max_heat = 30,
|
max_heat = 30,
|
||||||
min_humidity = 65,
|
min_humidity = 65,
|
||||||
indoors = false,
|
min_biome_humidity = 26,
|
||||||
not_biome = {
|
indoors = false,
|
||||||
|
not_biome = {
|
||||||
"cold_desert",
|
"cold_desert",
|
||||||
"cold_desert_ocean",
|
"cold_desert_ocean",
|
||||||
"desert",
|
"desert",
|
||||||
|
@ -19,7 +19,7 @@ local function generate_effects(params)
|
|||||||
local override = {}
|
local override = {}
|
||||||
|
|
||||||
override["climate_api:sound"] = {
|
override["climate_api:sound"] = {
|
||||||
gain = math.min(intensity, 1.2)
|
gain = math.min(intensity, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
return climate_api.utility.merge_tables(effects, override)
|
return climate_api.utility.merge_tables(effects, override)
|
||||||
|
Loading…
Reference in New Issue
Block a user