Update to new influences, improve rain skybox

This commit is contained in:
Till Affeldt 2020-04-18 17:26:01 +02:00
parent 497f31918a
commit e0b8d6d835
14 changed files with 79 additions and 46 deletions

View File

@ -12,7 +12,7 @@ climate_api.register_abm({
max_height = regional_weather.settings.max_height, max_height = regional_weather.settings.max_height,
min_humidity = 55, min_humidity = 55,
max_heat = 85, max_heat = 85,
min_light = 15 daylight = 15
}, },
action = function (pos, node, env) action = function (pos, node, env)

View File

@ -37,7 +37,7 @@ minetest.register_node(BLOCK_NAME, {
crumbly = 3, crumbly = 3,
attached_node = 1, attached_node = 1,
slippery = 1, slippery = 1,
replaceable_by_snow = 1 flora = 1
}, },
drop = "", drop = "",
}) })
@ -55,7 +55,7 @@ climate_api.register_abm({
max_height = regional_weather.settings.max_height, max_height = regional_weather.settings.max_height,
min_humidity = 55, min_humidity = 55,
min_heat = 30, min_heat = 30,
min_light = 15 daylight = 15
}, },
pos_override = function(pos) pos_override = function(pos)

View File

@ -6,6 +6,7 @@
local BLOCK_PREFIX = "regional_weather:snow_cover_" local BLOCK_PREFIX = "regional_weather:snow_cover_"
if not minetest.get_modpath("default") if not minetest.get_modpath("default")
or default.node_sound_snow_defaults == nil
or not regional_weather.settings.snow then or not regional_weather.settings.snow then
for i = 1,5 do for i = 1,5 do
minetest.register_alias(BLOCK_PREFIX .. i, "air") minetest.register_alias(BLOCK_PREFIX .. i, "air")
@ -41,6 +42,12 @@ for i = 1,5 do
if minetest.get_node(pos).name == "default:dirt_with_grass" then if minetest.get_node(pos).name == "default:dirt_with_grass" then
minetest.set_node(pos, {name = "default:dirt_with_snow"}) minetest.set_node(pos, {name = "default:dirt_with_snow"})
end end
end,
on_destruct = function(pos)
pos.y = pos.y - 1
if minetest.get_node(pos).name == "default:dirt_with_snow" then
minetest.set_node(pos, {name = "default:dirt_with_grass"})
end
end end
}) })
end end
@ -63,7 +70,7 @@ climate_api.register_abm({
max_height = regional_weather.settings.max_height, max_height = regional_weather.settings.max_height,
min_humidity = 55, min_humidity = 55,
max_heat = 30, max_heat = 30,
min_light = 15 daylight = 15
}, },
pos_override = function(pos) pos_override = function(pos)
@ -87,7 +94,6 @@ climate_api.register_abm({
"group:flora", "group:flora",
"group:grass", "group:grass",
"group:plant", "group:plant",
"group:replaceable_by_snow",
"group:regional_weather_snow_cover" "group:regional_weather_snow_cover"
}, },
interval = 15, interval = 15,
@ -98,7 +104,7 @@ climate_api.register_abm({
max_height = regional_weather.settings.max_height, max_height = regional_weather.settings.max_height,
min_humidity = 55, min_humidity = 55,
max_heat = 30, max_heat = 30,
min_light = 15 daylight = 15
}, },
action = function (pos, node, env) action = function (pos, node, env)
@ -118,9 +124,7 @@ climate_api.register_abm({
chance = 10, chance = 10,
conditions = { conditions = {
min_height = regional_weather.settings.min_height, min_heat = 30
max_height = regional_weather.settings.max_height,
min_heat = 30
}, },
action = function (pos, node, env) action = function (pos, node, env)

View File

@ -2,21 +2,37 @@ local name = "regional_weather:ambient"
local CLOUD_SPEED = 1.8 local CLOUD_SPEED = 1.8
local conditions = { local conditions = {}
min_daylight = 15
}
local function generate_effects(params) local function generate_effects(params)
local override = {} local override = {}
local wind = climate_api.environment.get_wind() local wind = climate_api.environment.get_wind()
override["climate_api:skybox"] = { local skybox = {}
cloud_data = { skybox.cloud_data = {
size = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.98), size = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.98),
speed = vector.multiply(wind, CLOUD_SPEED) speed = vector.multiply(wind, CLOUD_SPEED),
} thickness = climate_api.utility.rangelim(params.base_humidity * 0.2, 1, 18)
} }
if params.height > -100 and params.humidity > 65 then
skybox.sky_data = {
type = "regular",
--base_color = { r = 106, g = 130, b = 142 },
clouds = true,
sky_color = {
day_sky = "#6a828e",
day_horizon = "#5c7a8a",
dawn_sky = "#b2b5d7",
dawn_horizon = "#b7bce1",
night_sky = "#2373e1",
night_horizon = "#315d9b"
}
}
end
override["climate_api:skybox"] = skybox
local movement = params.player:get_player_velocity() local movement = params.player:get_player_velocity()
local movement_direction local movement_direction
if (vector.length(movement) < 0.1) then if (vector.length(movement) < 0.1) then

View File

@ -1,8 +1,8 @@
local name = "regional_weather:deep_cave" local name = "regional_weather:deep_cave"
local conditions = { local conditions = {
max_daylight = 14, max_daylight = minetest.LIGHT_MAX,
max_height = -100 max_height = -100
} }
local effects = {} local effects = {}
@ -12,7 +12,10 @@ effects["climate_api:skybox"] = {
base_color = { r = 0, g = 0, b = 0 }, base_color = { r = 0, g = 0, b = 0 },
clouds = false clouds = false
}, },
sun_data = { visible = false }, sun_data = {
visible = false,
sunrise_visible = false
},
moon_data = { visible = false }, moon_data = { visible = false },
stars_data = { visible = false } stars_data = { visible = false }
} }

View File

@ -6,7 +6,7 @@ local conditions = {
max_heat = 45, max_heat = 45,
min_humidity = 65, min_humidity = 65,
min_windspeed = 2.5, min_windspeed = 2.5,
min_daylight = 15 daylight = 15
} }
local effects = {} local effects = {}

View File

@ -7,7 +7,28 @@ local conditions = {
min_humidity = 30, min_humidity = 30,
max_humidity = 40, max_humidity = 40,
max_windspeed = 2, max_windspeed = 2,
min_daylight = 15 daylight = 15,
has_biome = {
"default",
"deciduous_forest",
"deciduous_forest_ocean",
"deciduous_forest_shore",
"grassland",
"grassland_dunes",
"grassland_ocean",
"snowy_grassland",
"snowy_grassland_ocean",
"grassy",
"grassy_ocean",
"grassytwo",
"grassytwo_ocean",
"mushroom",
"mushroom_ocean",
"plains",
"plains_ocean",
"sakura",
"sakura_ocean"
}
} }
local effects = {} local effects = {}

View File

@ -6,7 +6,7 @@ local conditions = {
min_heat = 30, min_heat = 30,
min_humidity = 50, min_humidity = 50,
max_humidity = 65, max_humidity = 65,
min_daylight = 15 daylight = 15
} }
local effects = {} local effects = {}

View File

@ -5,7 +5,7 @@ local conditions = {
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,
min_daylight = 15 daylight = 15
} }
local effects = {} local effects = {}
@ -15,14 +15,6 @@ effects["climate_api:sound"] = {
gain = 1 gain = 1
} }
effects["climate_api:skybox"] = {
sky_data = {
type = "plain",
base_color = {r = 125, g = 142, b = 145},
clouds = true
}
}
effects["climate_api:particles"] = { effects["climate_api:particles"] = {
min_pos = {x=-9, y=7, z=-9}, min_pos = {x=-9, y=7, z=-9},
max_pos = {x= 9, y=7, z= 9}, max_pos = {x= 9, y=7, z= 9},

View File

@ -6,11 +6,14 @@ local conditions = {
min_heat = 50, min_heat = 50,
max_humidity = 25, max_humidity = 25,
min_windspeed = 6, min_windspeed = 6,
min_daylight = 15, daylight = 15,
has_biome = { has_biome = {
"cold_desert",
"cold_desert_ocean",
"desert", "desert",
"desert_ocean",
"sandstone_desert", "sandstone_desert",
"cold_desert" "sandstone_desert_ocean"
} }
} }

View File

@ -6,7 +6,7 @@ local conditions = {
max_heat = 40, max_heat = 40,
min_humidity = 50, min_humidity = 50,
max_humidity = 65, max_humidity = 65,
min_daylight = 15 daylight = 15
} }
local effects = {} local effects = {}

View File

@ -5,7 +5,7 @@ local conditions = {
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,
min_daylight = 15 daylight = 15
} }
local effects = {} local effects = {}
@ -23,14 +23,6 @@ effects["climate_api:particles"] = {
texture="weather_snow.png" texture="weather_snow.png"
} }
effects["climate_api:skybox"] = {
sky_data = {
type = "plain",
base_color = {r=106, g=130, b=142},
clouds = true
}
}
local function generate_effects(params) local function generate_effects(params)
local avg_humidity = 55 local avg_humidity = 55
local intensity = params.humidity / avg_humidity local intensity = params.humidity / avg_humidity

View File

@ -4,7 +4,7 @@ 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_windspeed = 3, min_windspeed = 3,
min_daylight = 15 daylight = 15
} }
local effects = {} local effects = {}

View File

@ -44,4 +44,6 @@ dofile(modpath.."/ca_effects/speed_buff.lua")
dofile(modpath .. "/abms/puddle.lua") dofile(modpath .. "/abms/puddle.lua")
dofile(modpath .. "/abms/snow_cover.lua") dofile(modpath .. "/abms/snow_cover.lua")
dofile(modpath .. "/abms/fire.lua") dofile(modpath .. "/abms/fire.lua")
dofile(modpath .. "/abms/soil.lua") dofile(modpath .. "/abms/soil.lua")
minetest.log(minetest.LIGHT_MAX)