Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
084ee8c9f5 | |||
677382c142 | |||
32ab2c4d23 | |||
e0b8d6d835 | |||
497f31918a | |||
52f06da30f |
41
README.md
@ -1,31 +1,48 @@
|
||||
# Regional Weather
|
||||
A weather pack for __Climate API__ by Till Affeldt (TestificateMods)
|
||||
A weather pack for [__Climate API__](https://github.com/t-affeldt/climate_api) by Till Affeldt (TestificateMods)
|
||||
|
||||

|
||||
|
||||
Not every biome is the same and neither should their weather be.
|
||||
Regional Weather controls it's effects with the local climate in mind.
|
||||
Regional Weather controls its effects with the local climate in mind.
|
||||
Experience the humid air of the rain forest and harsh desert sandstorms.
|
||||
|
||||
## Assets
|
||||
## License information
|
||||
### Source Code
|
||||
Unless otherwise stated, this source code is written entirely by myself.
|
||||
You are free to use it under a GNU Lesser General Public License version 3.
|
||||
You can find respective rights and conditions in the attached [LICENSE](https://github.com/t-affeldt/regional_weather/blob/master/LICENSE.md) file.
|
||||
The entire source code is available on [Github](https://github.com/t-affeldt/regional_weather).
|
||||
|
||||
### Particles
|
||||
- Rain sounds: *CC0* by Q.K., taken from mymonths at https://github.com/minetest-mods/mymonths/tree/master/sounds
|
||||
- Snow flake and rain drop textures: *CC BY-SA (3.0)* by paramat, found in snowdrift mod at https://github.com/paramat/snowdrift
|
||||
- Snow texture: *CC BY-SA (3.0)* composited from individual snow flakes by paramat.
|
||||
- Rain texture: *CC BY-SA (3.0)* from TeddyDesTodes, taken from his weather branch at https://github.com/TeddyDesTodes/minetest/tree/weather
|
||||
- Hail textures: *CC BY-SA (3.0)* made by me
|
||||
- Snow flake textures: *CC BY-SA (3.0)* by paramat, found in snowdrift mod at https://github.com/paramat/snowdrift
|
||||
- Snow composite texture: *CC BY-SA (3.0)* by Cap, created from aforementioned snow flakes by paramat (please credit original artist as well)
|
||||
- Rain textures: *CC BY-SA (3.0)* by Cap (an original design for this mod)
|
||||
|
||||
### Block Textures
|
||||
- Puddle texture: *DWYWPL* by Don, Nathan from mymonths at https://github.com/minetest-mods/mymonths/blob/master/textures/weather_puddle.png
|
||||
- Snow cover texture: *WTFPL*, taken from mymonths at https://github.com/minetest-mods/mymonths/blob/master/textures/weather_snow_cover.png
|
||||
- Puddle textures: *CC BY-SA (3.0)* by Cap
|
||||
- Snow layers and ice block using textures from *default* (not included)
|
||||
|
||||
### Sounds
|
||||
- Heavy Rain sounds: *CC0* by Q.K., taken from mymonths at https://github.com/minetest-mods/mymonths/tree/master/sounds
|
||||
- Light Rain sounds: *CC BY 3.0* by Arctura from https://freesound.org/people/Arctura/sounds/34065/
|
||||
- Wind sound: *CC BY (3.0)* by InspectorJ from https://freesound.org/people/InspectorJ/sounds/376415/
|
||||
- Hail sound: *CC0* by ikayuka from https://freesound.org/people/ikayuka/sounds/240742/
|
||||
- Puddle footstep sound: *CC0* by swordofkings128 from https://freesound.org/people/swordofkings128/sounds/398032/
|
||||
|
||||
### HUD Overlays
|
||||
- Original texture for frost hud: *CC0* by Simon Matzinger from https://freestocktextures.com/texture/winter-snow-frozen,995.html, edits by me under *CC0* as well
|
||||
- Original texture for sandstorm hud: *CC0* from https://freestocktextures.com/texture/dirty-baking-paper,1202.html, edits by me under *CC0* as well
|
||||
- Frost HUD: *CC BY-SA (3.0)* by Cap
|
||||
- Original texture for sand storm HUD: *CC0* from https://freestocktextures.com/texture/dirty-baking-paper,1202.html, edits by me under *CC0* as well
|
||||
|
||||
### Assets in screenshots
|
||||
- All screenshots and editing by me: *CC BY-SA (4.0)*
|
||||
- Screenshots and editing: *CC BY-SA (3.0)* by me
|
||||
- Logos and artwork: *CC BY-SA (3.0)* by Cap
|
||||
- Lato Font (for the Logo): *OFL* by Łukasz Dziedzic from http://www.latofonts.com/lato-free-fonts/
|
||||
- Liberation Fonts (for the text): *OFL*, see https://github.com/liberationfonts/liberation-fonts
|
||||
- Used texture pack: Polygonia (128px edition) *CC BY-SA (4.0)* by Lokrates. See https://forum.minetest.net/viewtopic.php?f=4&t=19043
|
||||
|
||||
### Full License Conditions
|
||||
- [GNU Lesser General Public License version 4](https://github.com/t-affeldt/regional_weather/blob/master/LICENSE.md)
|
||||
- [Creative Commons Licenses](https://creativecommons.org/licenses/)
|
||||
- [SIL Open Font License](https://opensource.org/licenses/OFL-1.1)
|
@ -6,13 +6,14 @@ climate_api.register_abm({
|
||||
nodenames = { "fire:basic_flame" },
|
||||
interval = 10,
|
||||
chance = 2,
|
||||
catch_up = false,
|
||||
|
||||
conditions = {
|
||||
min_height = regional_weather.settings.min_height,
|
||||
max_height = regional_weather.settings.max_height,
|
||||
min_humidity = 55,
|
||||
max_heat = 85,
|
||||
min_light = 15
|
||||
daylight = 15
|
||||
},
|
||||
|
||||
action = function (pos, node, env)
|
||||
|
62
abms/ice.lua
Normal file
@ -0,0 +1,62 @@
|
||||
if not regional_weather.settings.ice
|
||||
or not minetest.get_modpath("default")
|
||||
or default.node_sound_glass_defaults == nil
|
||||
then return end
|
||||
|
||||
local BLOCK_NAME = "regional_weather:ice"
|
||||
|
||||
minetest.register_node(BLOCK_NAME, {
|
||||
tiles = {"(default_ice.png^[colorize:#ffffff:50)^[opacity:200"},
|
||||
paramtype = "light",
|
||||
groups = {cracky = 3, cools_lava = 1, slippery = 3, dig_immediate = 2},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
use_texture_alpha = true,
|
||||
drop = "",
|
||||
on_destruct = function(pos)
|
||||
-- asynchronous to avoid destruction loop
|
||||
minetest.after(0, function(pos)
|
||||
if minetest.get_node(pos).name ~= "air" then return end
|
||||
minetest.set_node(pos, { name = "default:river_water_source" })
|
||||
end, pos)
|
||||
end
|
||||
})
|
||||
|
||||
climate_api.register_abm({
|
||||
label = "freeze river water",
|
||||
nodenames = { "default:river_water_source" },
|
||||
neighbors = { "air" },
|
||||
interval = 10,
|
||||
chance = 2,
|
||||
catch_up = false,
|
||||
|
||||
conditions = {
|
||||
min_height = regional_weather.settings.min_height,
|
||||
max_height = regional_weather.settings.max_height,
|
||||
max_heat = 25,
|
||||
daylight = 15
|
||||
},
|
||||
|
||||
action = function (pos, node, env)
|
||||
minetest.set_node(pos, { name = BLOCK_NAME })
|
||||
end
|
||||
})
|
||||
|
||||
climate_api.register_abm({
|
||||
label = "unfreeze river water",
|
||||
nodenames = { BLOCK_NAME },
|
||||
neighbors = { "air" },
|
||||
interval = 15,
|
||||
chance = 4,
|
||||
catch_up = true,
|
||||
|
||||
conditions = {
|
||||
min_height = regional_weather.settings.min_height,
|
||||
max_height = regional_weather.settings.max_height,
|
||||
min_heat = 40,
|
||||
daylight = 15
|
||||
},
|
||||
|
||||
action = function (pos, node, env)
|
||||
minetest.set_node(pos, { name = "default:river_water_source" })
|
||||
end
|
||||
})
|
@ -1,28 +1,38 @@
|
||||
-- code of this file is partially taken from and otherwise inspired by
|
||||
-- mymonths on https://github.com/minetest-mods/mymonths (licensed under DWYWPL)
|
||||
-- contributers available at https://github.com/minetest-mods/mymonths/graphs/contributors
|
||||
-- all changes of mine remain under LGPL v3
|
||||
|
||||
local BLOCK_NAME = "regional_weather:puddle"
|
||||
local MIN_DISTANCE = 12
|
||||
local BLOCK_PREFIX = "regional_weather:puddle_"
|
||||
local VARIANT_COUNT = 30
|
||||
local MIN_DISTANCE = 2
|
||||
|
||||
if not regional_weather.settings.puddles then
|
||||
minetest.register_alias(BLOCK_NAME, "air")
|
||||
for i=1,VARIANT_COUNT do
|
||||
for r=0,270,90 do
|
||||
minetest.register_alias(BLOCK_PREFIX .. i .. "_" .. r, "air")
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
--Puddle node
|
||||
local node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.375, 0.125, -0.4875, 0.3125},
|
||||
{-0.25, -0.5, -0.3125, 0.3125, -0.4925, 0.25},
|
||||
{-0.3125, -0.5, -0.1875, 0.375, -0.4975, 0.1875},
|
||||
}
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -0.49, 0.5}
|
||||
}
|
||||
|
||||
minetest.register_node(BLOCK_NAME, {
|
||||
tiles = { "weather_puddle.png" },
|
||||
for i = 1,VARIANT_COUNT do
|
||||
for rotation = 0,270,90 do
|
||||
for flip = 0,1 do
|
||||
local name = BLOCK_PREFIX .. i .. "_" .. rotation
|
||||
local texture = "weather_puddle." .. i .. ".png^[opacity:128"
|
||||
if flip == 1 or rotation > 0 then
|
||||
texture = texture .. "^[transform"
|
||||
end
|
||||
if flip == 1 then
|
||||
name = name .. "_flipped"
|
||||
texture = texture .. "FX"
|
||||
end
|
||||
if rotation > 0 then
|
||||
texture = texture .. "R" .. rotation
|
||||
end
|
||||
minetest.register_node(name, {
|
||||
tiles = { texture },
|
||||
drawtype = "nodebox",
|
||||
pointable = false,
|
||||
buildable_to = true,
|
||||
@ -30,17 +40,41 @@ minetest.register_node(BLOCK_NAME, {
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
alpha = 50,
|
||||
use_texture_alpha = true,
|
||||
node_box = node_box,
|
||||
groups = {
|
||||
not_in_creative_inventory = 1,
|
||||
crumbly = 3,
|
||||
attached_node = 1,
|
||||
slippery = 1,
|
||||
replaceable_by_snow = 1
|
||||
flora = 1,
|
||||
water = 1,
|
||||
regional_weather_puddle = 1
|
||||
},
|
||||
drop = "",
|
||||
sounds = {
|
||||
footstep = {
|
||||
name = "weather_puddle",
|
||||
gain = 0.8
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_alias("regional_weather:puddle", BLOCK_PREFIX .. "14_0")
|
||||
|
||||
local function get_random_puddle()
|
||||
local index = math.random(1, VARIANT_COUNT)
|
||||
local rotation = math.random(0, 3) * 90
|
||||
local flip = math.random(0, 1)
|
||||
local name = BLOCK_PREFIX .. index .. "_" .. rotation
|
||||
if flip == 1 then
|
||||
name = name .. "_flipped"
|
||||
end
|
||||
return name
|
||||
end
|
||||
|
||||
-- Makes Puddles when raining
|
||||
climate_api.register_abm({
|
||||
@ -49,13 +83,14 @@ climate_api.register_abm({
|
||||
neighbors = { "air" },
|
||||
interval = 10,
|
||||
chance = 50,
|
||||
catch_up = false,
|
||||
|
||||
conditions = {
|
||||
min_height = regional_weather.settings.min_height,
|
||||
max_height = regional_weather.settings.max_height,
|
||||
min_humidity = 55,
|
||||
min_heat = 30,
|
||||
min_light = 15
|
||||
daylight = 15
|
||||
},
|
||||
|
||||
pos_override = function(pos)
|
||||
@ -64,17 +99,19 @@ climate_api.register_abm({
|
||||
|
||||
action = function (pos, node, env)
|
||||
if minetest.get_node(pos).name ~= "air" then return end
|
||||
if minetest.find_node_near(pos, MIN_DISTANCE, BLOCK_NAME) then return end
|
||||
minetest.set_node(pos, {name = BLOCK_NAME})
|
||||
if minetest.find_node_near(pos, MIN_DISTANCE, "group:regional_weather_puddle") then return end
|
||||
local puddle_name = get_random_puddle()
|
||||
minetest.set_node(pos, {name = puddle_name})
|
||||
end
|
||||
})
|
||||
|
||||
-- Makes puddles dry up when not raining
|
||||
climate_api.register_abm({
|
||||
label = "remove rain puddles",
|
||||
nodenames = { BLOCK_NAME },
|
||||
nodenames = { "group:regional_weather_puddle" },
|
||||
interval = 5,
|
||||
chance = 5,
|
||||
catch_up = true,
|
||||
|
||||
action = function (pos, node, env)
|
||||
if env.humidity < 55 then
|
||||
|
@ -1,17 +1,21 @@
|
||||
-- code of this file is partially taken from and otherwise inspired by
|
||||
-- mymonths on https://github.com/minetest-mods/mymonths (licensed under DWYWPL)
|
||||
-- contributers available at https://github.com/minetest-mods/mymonths/graphs/contributors
|
||||
-- all changes of mine remain under LGPL v3
|
||||
|
||||
local BLOCK_PREFIX = "regional_weather:snow_cover_"
|
||||
|
||||
if not regional_weather.settings.puddles then
|
||||
if not minetest.get_modpath("default")
|
||||
or default.node_sound_snow_defaults == nil
|
||||
or not regional_weather.settings.snow then
|
||||
for i = 1,5 do
|
||||
minetest.register_alias(BLOCK_PREFIX .. i, "air")
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local destruction_handler = 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
|
||||
|
||||
for i = 1,5 do
|
||||
local node_box = {
|
||||
type = "fixed",
|
||||
@ -40,7 +44,9 @@ for i = 1,5 do
|
||||
if minetest.get_node(pos).name == "default:dirt_with_grass" then
|
||||
minetest.set_node(pos, {name = "default:dirt_with_snow"})
|
||||
end
|
||||
end
|
||||
end,
|
||||
on_destruct = destruction_handler,
|
||||
on_flood = destruction_handler
|
||||
})
|
||||
end
|
||||
|
||||
@ -55,14 +61,15 @@ climate_api.register_abm({
|
||||
},
|
||||
neighbors = { "air" },
|
||||
interval = 15,
|
||||
chance = 20,
|
||||
chance = 30,
|
||||
catch_up = false,
|
||||
|
||||
conditions = {
|
||||
min_height = regional_weather.settings.min_height,
|
||||
max_height = regional_weather.settings.max_height,
|
||||
min_humidity = 55,
|
||||
max_heat = 30,
|
||||
min_light = 15
|
||||
daylight = 15
|
||||
},
|
||||
|
||||
pos_override = function(pos)
|
||||
@ -86,18 +93,18 @@ climate_api.register_abm({
|
||||
"group:flora",
|
||||
"group:grass",
|
||||
"group:plant",
|
||||
"group:replaceable_by_snow",
|
||||
"group:regional_weather_snow_cover"
|
||||
},
|
||||
interval = 15,
|
||||
chance = 15,
|
||||
chance = 25,
|
||||
catch_up = false,
|
||||
|
||||
conditions = {
|
||||
min_height = regional_weather.settings.min_height,
|
||||
max_height = regional_weather.settings.max_height,
|
||||
min_humidity = 55,
|
||||
max_heat = 30,
|
||||
min_light = 15
|
||||
daylight = 15
|
||||
},
|
||||
|
||||
action = function (pos, node, env)
|
||||
@ -115,10 +122,9 @@ climate_api.register_abm({
|
||||
nodenames = { "group:regional_weather_snow_cover" },
|
||||
interval = 15,
|
||||
chance = 10,
|
||||
catch_up = true,
|
||||
|
||||
conditions = {
|
||||
min_height = regional_weather.settings.min_height,
|
||||
max_height = regional_weather.settings.max_height,
|
||||
min_heat = 30
|
||||
},
|
||||
|
||||
|
@ -7,6 +7,7 @@ if farming ~= nil and farming.mod == "redo" then
|
||||
nodenames = { "farming:soil" },
|
||||
interval = 8,
|
||||
chance = 2,
|
||||
catch_up = false,
|
||||
|
||||
conditions = {
|
||||
min_height = regional_weather.settings.min_height,
|
||||
@ -27,6 +28,7 @@ else
|
||||
nodenames = { "group:field" },
|
||||
interval = 8,
|
||||
chance = 2,
|
||||
catch_up = false,
|
||||
|
||||
conditions = {
|
||||
min_height = regional_weather.settings.min_height,
|
||||
|
@ -1,17 +1,22 @@
|
||||
if not regional_weather.settings.damage then return end
|
||||
if not minetest.is_yes(minetest.settings:get_bool("enable_damage"))
|
||||
or not regional_weather.settings.damage then return end
|
||||
|
||||
local EFFECT_NAME = "regional_weather:damage"
|
||||
|
||||
local rng = PcgRandom(7819792)
|
||||
|
||||
local function handle_effect(player_data)
|
||||
for playername, data in pairs(player_data) do
|
||||
local player = minetest.get_player_by_name(playername)
|
||||
local hp = player:get_hp()
|
||||
for weather, value in pairs(data) do
|
||||
hp = hp - value
|
||||
for weather, dmg in pairs(data) do
|
||||
if rng:next(1, dmg.chance) == 1 then
|
||||
hp = hp - dmg.value
|
||||
end
|
||||
end
|
||||
player:set_hp(hp, "weather damage")
|
||||
end
|
||||
end
|
||||
|
||||
climate_api.register_effect(EFFECT_NAME, handle_effect, "tick")
|
||||
climate_api.set_effect_cycle(EFFECT_NAME, climate_api.LONG_CYCLE)
|
||||
climate_api.set_effect_cycle(EFFECT_NAME, climate_api.MEDIUM_CYCLE)
|
@ -1,7 +1,7 @@
|
||||
local EFFECT_NAME = "regional_weather:speed_buff"
|
||||
|
||||
local function handle_effect(player_data)
|
||||
for playername, data in ipairs(player_data) do
|
||||
for playername, data in pairs(player_data) do
|
||||
local player = minetest.get_player_by_name(playername)
|
||||
local product = 1
|
||||
for weather, value in pairs(data) do
|
||||
|
@ -1,18 +1,35 @@
|
||||
local name = "regional_weather:ambient"
|
||||
|
||||
local CLOUD_SPEED = 1.8
|
||||
|
||||
local conditions = {
|
||||
min_light = 15
|
||||
}
|
||||
local conditions = {}
|
||||
|
||||
local function generate_effects(params)
|
||||
local override = {}
|
||||
local wind = climate_api.environment.get_wind()
|
||||
|
||||
--[[override["climate_api:clouds"] = {
|
||||
size = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.98),
|
||||
speed = vector.multiply(params.wind, CLOUD_SPEED)
|
||||
}]]
|
||||
local skybox = {priority = 10}
|
||||
skybox.cloud_data = {
|
||||
density = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.75),
|
||||
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",
|
||||
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_direction
|
||||
@ -21,7 +38,7 @@ local function generate_effects(params)
|
||||
else
|
||||
movement_direction = vector.normalize(movement)
|
||||
end
|
||||
local vector_product = vector.dot(movement_direction, params.wind)
|
||||
local vector_product = vector.dot(movement_direction, wind)
|
||||
local movement_penalty = climate_api.utility.sigmoid(vector_product, 1.6, 0.2, 0.8) + 0.2
|
||||
override["regional_weather:speed_buff"] = movement_penalty
|
||||
return override
|
||||
|
@ -1,7 +1,7 @@
|
||||
local name = "regional_weather:deep_cave"
|
||||
|
||||
local conditions = {
|
||||
max_light = 14,
|
||||
max_daylight = minetest.LIGHT_MAX,
|
||||
max_height = -100
|
||||
}
|
||||
|
||||
@ -12,9 +12,13 @@ effects["climate_api:skybox"] = {
|
||||
base_color = { r = 0, g = 0, b = 0 },
|
||||
clouds = false
|
||||
},
|
||||
sun_data = { visible = false },
|
||||
sun_data = {
|
||||
visible = false,
|
||||
sunrise_visible = false
|
||||
},
|
||||
moon_data = { visible = false },
|
||||
stars_data = { visible = false }
|
||||
star_data = { visible = false },
|
||||
priority = 100
|
||||
}
|
||||
|
||||
climate_api.register_weather(name, conditions, effects)
|
||||
|
38
ca_weathers/fog.lua
Normal file
@ -0,0 +1,38 @@
|
||||
local name = "regional_weather:fog"
|
||||
|
||||
local conditions = {
|
||||
min_height = regional_weather.settings.min_height,
|
||||
max_height = regional_weather.settings.max_height,
|
||||
min_humidity = 40,
|
||||
max_humidity = 50,
|
||||
max_windspeed = 2,
|
||||
min_heat = 40,
|
||||
max_heat = 50
|
||||
}
|
||||
|
||||
local effects = {}
|
||||
|
||||
effects["climate_api:skybox"] = {
|
||||
sky_data = {
|
||||
clouds = true
|
||||
},
|
||||
cloud_data = {
|
||||
density = 1,
|
||||
color = "#ffffff80",
|
||||
thickness = 40,
|
||||
speed = {x=0,y=0,z=0}
|
||||
},
|
||||
priority = 50
|
||||
}
|
||||
|
||||
local function generate_effects(params)
|
||||
local override = {}
|
||||
override["climate_api:skybox"] = {
|
||||
cloud_data = {
|
||||
height = params.player:get_pos().y - 20
|
||||
}
|
||||
}
|
||||
return climate_api.utility.merge_tables(effects, override)
|
||||
end
|
||||
|
||||
climate_api.register_weather(name, conditions, generate_effects)
|
32
ca_weathers/fog_heavy.lua
Normal file
@ -0,0 +1,32 @@
|
||||
local name = "regional_weather:fog_heavy"
|
||||
|
||||
local conditions = {
|
||||
min_height = regional_weather.settings.min_height * 0.9,
|
||||
max_height = regional_weather.settings.max_height * 0.9,
|
||||
min_humidity = 43,
|
||||
max_humidity = 47,
|
||||
max_windspeed = 1.5,
|
||||
min_heat = 43,
|
||||
max_heat = 47
|
||||
}
|
||||
|
||||
local effects = {}
|
||||
|
||||
effects["climate_api:hud_overlay"] = {
|
||||
file = "weather_hud_fog.png^[opacity:100",
|
||||
z_index = -200,
|
||||
color_correction = true
|
||||
}
|
||||
|
||||
effects["climate_api:skybox"] = {
|
||||
sky_data = {
|
||||
type = "plain",
|
||||
base_color = "#c0c0c08f"
|
||||
},
|
||||
cloud_data = {
|
||||
color = "#ffffffc0",
|
||||
},
|
||||
priority = 51
|
||||
}
|
||||
|
||||
climate_api.register_weather(name, conditions, effects)
|
@ -6,12 +6,15 @@ local conditions = {
|
||||
max_heat = 45,
|
||||
min_humidity = 65,
|
||||
min_windspeed = 2.5,
|
||||
min_light = 15
|
||||
daylight = 15
|
||||
}
|
||||
|
||||
local effects = {}
|
||||
|
||||
effects["regional_weather:damage"] = 1
|
||||
effects["regional_weather:damage"] = {
|
||||
chance = 15,
|
||||
value = 3
|
||||
}
|
||||
|
||||
effects["climate_api:sound"] = {
|
||||
name = "weather_hail",
|
||||
@ -21,9 +24,9 @@ effects["climate_api:sound"] = {
|
||||
effects["climate_api:particles"] = {
|
||||
min_pos = {x=-9, y=7, z=-9},
|
||||
max_pos = {x= 9, y=7, z= 9},
|
||||
falling_speed=15,
|
||||
amount=5,
|
||||
exptime=0.8,
|
||||
falling_speed=20,
|
||||
amount=6,
|
||||
exptime=0.7,
|
||||
size=1,
|
||||
textures = {}
|
||||
}
|
||||
|
@ -7,7 +7,28 @@ local conditions = {
|
||||
min_humidity = 30,
|
||||
max_humidity = 40,
|
||||
max_windspeed = 2,
|
||||
min_light = 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 = {}
|
||||
@ -16,6 +37,7 @@ effects["climate_api:particles"] = {
|
||||
min_pos = {x=-12, y=-4, z=-12},
|
||||
max_pos = {x= 12, y= 1, z= 12},
|
||||
falling_speed = -0.1,
|
||||
acceleration = {x=0,y=-0.03,z=0},
|
||||
amount = 1,
|
||||
exptime = 5,
|
||||
size = 0.8,
|
||||
|
@ -6,20 +6,21 @@ local conditions = {
|
||||
min_heat = 30,
|
||||
min_humidity = 50,
|
||||
max_humidity = 65,
|
||||
min_light = 15
|
||||
daylight = 15
|
||||
}
|
||||
|
||||
local effects = {}
|
||||
|
||||
effects["climate_api:sound"] = {
|
||||
name = "weather_rain"
|
||||
name = "weather_rain",
|
||||
gain = 1.5
|
||||
}
|
||||
|
||||
effects["climate_api:particles"] = {
|
||||
min_pos = {x=-9, y=7, z=-9},
|
||||
max_pos = {x= 9, y=7, z= 9},
|
||||
exptime=0.8,
|
||||
size=1,
|
||||
size=2,
|
||||
texture = "weather_raindrop.png"
|
||||
}
|
||||
|
||||
@ -33,7 +34,7 @@ local function generate_effects(params)
|
||||
}
|
||||
|
||||
override["climate_api:particles"] = {
|
||||
amount = 20 * math.min(intensity, 1.5),
|
||||
amount = 25 * math.min(intensity, 1.5),
|
||||
falling_speed = 10 / math.min(intensity, 1.3)
|
||||
}
|
||||
|
||||
|
@ -5,24 +5,29 @@ local conditions = {
|
||||
max_height = regional_weather.settings.max_height,
|
||||
min_heat = 40,
|
||||
min_humidity = 65,
|
||||
min_light = 15
|
||||
daylight = 15
|
||||
}
|
||||
|
||||
local effects = {}
|
||||
|
||||
effects["climate_api:sound"] = {
|
||||
name = "weather_rain",
|
||||
name = "weather_rain_heavy",
|
||||
gain = 1
|
||||
}
|
||||
|
||||
effects["climate_api:particles"] = {
|
||||
min_pos = {x=-9, y=7, z=-9},
|
||||
max_pos = {x= 9, y=7, z= 9},
|
||||
falling_speed=10,
|
||||
amount=20,
|
||||
falling_speed=7,
|
||||
amount=17,
|
||||
exptime=0.8,
|
||||
size=25,
|
||||
texture="weather_rain.png"
|
||||
min_size=25,
|
||||
max_size=35,
|
||||
textures={
|
||||
"weather_rain.png",
|
||||
"weather_rain.png",
|
||||
"weather_rain_medium.png"
|
||||
}
|
||||
}
|
||||
|
||||
climate_api.register_weather(name, conditions, effects)
|
||||
|
@ -5,25 +5,77 @@ local conditions = {
|
||||
max_height = regional_weather.settings.max_height,
|
||||
min_heat = 50,
|
||||
max_humidity = 25,
|
||||
min_windspeed = 6,
|
||||
min_light = 15
|
||||
min_windspeed = 4.5,
|
||||
has_biome = {
|
||||
"cold_desert",
|
||||
"cold_desert_ocean",
|
||||
"desert",
|
||||
"desert_ocean",
|
||||
"sandstone_desert",
|
||||
"sandstone_desert_ocean"
|
||||
}
|
||||
}
|
||||
|
||||
local effects = {}
|
||||
|
||||
effects["climate_api:hud_overlay"] = {
|
||||
file = "weather_hud_sand.png",
|
||||
z_index = -100
|
||||
z_index = -100,
|
||||
color_correction = true
|
||||
}
|
||||
|
||||
effects["regional_weather:damage"] = {
|
||||
chance = 3,
|
||||
value = 1
|
||||
}
|
||||
|
||||
effects["climate_api:particles"] = {
|
||||
min_pos = {x=-9, y=-5, z=-9},
|
||||
max_pos = {x= 9, y= 5, z= 9},
|
||||
falling_speed=1,
|
||||
min_pos = {x=-5, y=-4, z=-5},
|
||||
max_pos = {x= 5, y= 4.5, z= 5},
|
||||
falling_speed=1.2,
|
||||
acceleration={x=0,y=0.8,z=0},
|
||||
amount=40,
|
||||
exptime=0.8,
|
||||
size=15,
|
||||
texture="weather_sand.png"
|
||||
exptime=1.8,
|
||||
size=20,
|
||||
textures={
|
||||
"weather_sandstorm.png",
|
||||
"weather_sandstorm.png^[transformR180"
|
||||
}
|
||||
}
|
||||
|
||||
climate_api.register_weather(name, conditions, effects)
|
||||
effects["climate_api:skybox"] = {
|
||||
sky_data = {
|
||||
type = "plain",
|
||||
clouds = true,
|
||||
},
|
||||
cloud_data = {
|
||||
density = 1,
|
||||
color = "#f7e4bfc0",
|
||||
thickness = 40,
|
||||
speed = {x=0,y=0,z=0}
|
||||
},
|
||||
priority = 60
|
||||
}
|
||||
|
||||
local function generate_effects(params)
|
||||
local override = {}
|
||||
local light = math.max(params.light / 15, 0.2)
|
||||
local color = {r = 247 * light, g = 228 * light, b = 191 * light, a = 256}
|
||||
override["climate_api:skybox"] = {
|
||||
sky_data = {
|
||||
base_color = color
|
||||
},
|
||||
cloud_data = {
|
||||
height = params.player:get_pos().y - 20
|
||||
}
|
||||
}
|
||||
override = climate_api.utility.merge_tables(effects, override)
|
||||
if params.daylight < 15 then
|
||||
local result = {}
|
||||
result["climate_api:skybox"] = override["climate_api:skybox"]
|
||||
return result
|
||||
end
|
||||
return override
|
||||
end
|
||||
|
||||
climate_api.register_weather(name, conditions, generate_effects)
|
||||
|
@ -6,7 +6,7 @@ local conditions = {
|
||||
max_heat = 40,
|
||||
min_humidity = 50,
|
||||
max_humidity = 65,
|
||||
min_light = 15
|
||||
daylight = 15
|
||||
}
|
||||
|
||||
local effects = {}
|
||||
|
@ -5,47 +5,32 @@ local conditions = {
|
||||
max_height = regional_weather.settings.max_height,
|
||||
max_heat = 30,
|
||||
min_humidity = 65,
|
||||
min_light = 15
|
||||
daylight = 15
|
||||
}
|
||||
|
||||
local effects = {}
|
||||
|
||||
effects["climate_api:hud_overlay"] = {
|
||||
file = "weather_hud_ice.png",
|
||||
z_index = -100
|
||||
file = "weather_hud_frost.png",
|
||||
z_index = -100,
|
||||
color_correction = true
|
||||
}
|
||||
|
||||
effects["climate_api:particles"] = {
|
||||
min_pos = {x=-8, y=3, z=-8},
|
||||
max_pos = {x= 8, y=6, z= 8},
|
||||
exptime=6,
|
||||
size=12,
|
||||
size=10,
|
||||
texture="weather_snow.png"
|
||||
}
|
||||
|
||||
effects["climate_api:skybox"] = {
|
||||
sky_data = {
|
||||
type = "plain",
|
||||
base_color = {r=106, g=130, b=142},
|
||||
clouds = true
|
||||
},
|
||||
cloud_data = {
|
||||
size = 0.98,
|
||||
speed = {x = 4, y = 0, z = -1.3}
|
||||
}
|
||||
}
|
||||
|
||||
local function generate_effects(params)
|
||||
local avg_humidity = 55
|
||||
local intensity = params.humidity / avg_humidity
|
||||
local override = {}
|
||||
|
||||
override["climate_api:sound"] = {
|
||||
gain = math.min(intensity, 1.2)
|
||||
}
|
||||
|
||||
override["climate_api:particles"] = {
|
||||
amount = 8 * math.min(intensity, 1.5),
|
||||
amount = 16 * math.min(intensity, 1.5),
|
||||
falling_speed = 1 / math.min(intensity, 1.3)
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@ local conditions = {
|
||||
min_height = regional_weather.settings.min_height,
|
||||
max_height = regional_weather.settings.max_height,
|
||||
min_windspeed = 3,
|
||||
min_light = 15
|
||||
daylight = 15
|
||||
}
|
||||
|
||||
local effects = {}
|
||||
|
11
init.lua
@ -20,12 +20,22 @@ regional_weather.settings.snow = get_setting_bool("snow_layers", true)
|
||||
regional_weather.settings.puddles = get_setting_bool("puddles", true)
|
||||
regional_weather.settings.soil = get_setting_bool("soil", true)
|
||||
regional_weather.settings.fire = get_setting_bool("fire", true)
|
||||
regional_weather.settings.ice = get_setting_bool("ice", true)
|
||||
regional_weather.settings.max_height = get_setting_number("max_height", 120)
|
||||
regional_weather.settings.min_height = get_setting_number("min_height", -50)
|
||||
|
||||
-- warn about clouds being overriden by MTG weather
|
||||
if climate_mod.settings.skybox
|
||||
and minetest.get_modpath("weather")
|
||||
and get_setting_bool("enable_weather", true) then
|
||||
minetest.log("warning", "[Regional Weather] Disable MTG weather for the best experience")
|
||||
end
|
||||
|
||||
-- import individual weather types
|
||||
dofile(modpath.."/ca_weathers/ambient.lua")
|
||||
dofile(modpath.."/ca_weathers/deep_cave.lua")
|
||||
dofile(modpath.."/ca_weathers/fog.lua")
|
||||
dofile(modpath.."/ca_weathers/fog_heavy.lua")
|
||||
dofile(modpath.."/ca_weathers/hail.lua")
|
||||
dofile(modpath.."/ca_weathers/pollen.lua")
|
||||
dofile(modpath.."/ca_weathers/rain.lua")
|
||||
@ -44,4 +54,5 @@ dofile(modpath.."/ca_effects/speed_buff.lua")
|
||||
dofile(modpath .. "/abms/puddle.lua")
|
||||
dofile(modpath .. "/abms/snow_cover.lua")
|
||||
dofile(modpath .. "/abms/fire.lua")
|
||||
dofile(modpath .. "/abms/ice.lua")
|
||||
dofile(modpath .. "/abms/soil.lua")
|
4
mod.conf
@ -2,8 +2,8 @@ name = regional_weather
|
||||
title = Regional Weather
|
||||
author = TestificateMods
|
||||
release = 1
|
||||
depends = default, climate_api
|
||||
optional_depends = lightning, farming
|
||||
depends = climate_api
|
||||
optional_depends = default, lightning, farming, fire
|
||||
description = """
|
||||
Not every biome is the same and neither should their weather be.
|
||||
Regional Weather controls it's effects with the local climate in mind.
|
||||
|
BIN
screenshot.2.png
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
screenshot.3.png
Normal file
After Width: | Height: | Size: 989 KiB |
BIN
screenshot.4.png
Normal file
After Width: | Height: | Size: 554 KiB |
BIN
screenshot.png
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.6 MiB |
BIN
screenshot.webp
Normal file
After Width: | Height: | Size: 5.0 MiB |
@ -1,7 +1,31 @@
|
||||
regional_weather_damage (Storms and hail cause damage to players) bool true
|
||||
regional_weather_snow_layers (Place snow layers on ground) bool true
|
||||
regional_weather_puddles (Place rain puddles on ground) bool true
|
||||
regional_weather_soil (Turn farmland wet during rain) bool true
|
||||
regional_weather_fire (Extinguish fire during rain) bool true
|
||||
[Features]
|
||||
|
||||
# If set to true, sand storms and hail will damage affected players over time.
|
||||
regional_weather_damage (Cause player damage) bool true
|
||||
|
||||
# If set to true, snow layers will stack up during snowy weather.
|
||||
regional_weather_snow_layers (Place snow layers) bool true
|
||||
|
||||
# If set to true, river water sources will freeze at low temperatures and melt when it gets warmer again.
|
||||
# This process does not affect regular ice blocks because it adds its own temporary ones.
|
||||
regional_weather_ice (Freeze river water) bool true
|
||||
|
||||
# If set to true, water puddles will form during rain or when snow layers have melted.
|
||||
regional_weather_puddles (Place rain puddles) bool true
|
||||
|
||||
# If set to true, rain will cause dry farmland to turn wet.
|
||||
regional_weather_soil (Hydrate farmland) bool true
|
||||
|
||||
# If set to true, fires will be extinguished during rain showers.
|
||||
regional_weather_fire (Extinguish fire) bool true
|
||||
|
||||
|
||||
[World Configuration]
|
||||
|
||||
# No visual effects will be applied above this height.
|
||||
# This value defaults to normal cloud height (120 nodes above sea level).
|
||||
regional_weather_max_height (Maximum height of weather effects) int 120
|
||||
|
||||
# No visual effects will be applied below this height.
|
||||
# This will prevent unwanted visuals within large underground caves.
|
||||
regional_weather_min_height (Minimum height of weather effects) int -50
|
BIN
sounds/weather_puddle.ogg
Normal file
BIN
sounds/weather_rain_heavy.ogg
Normal file
BIN
textures/weather_hud_fog.png
Normal file
After Width: | Height: | Size: 72 B |
BIN
textures/weather_hud_frost.png
Normal file
After Width: | Height: | Size: 138 KiB |
Before Width: | Height: | Size: 131 KiB |
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 510 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 402 B |
BIN
textures/weather_puddle.1.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
textures/weather_puddle.10.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
textures/weather_puddle.11.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
textures/weather_puddle.12.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
textures/weather_puddle.13.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
textures/weather_puddle.14.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
textures/weather_puddle.15.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
textures/weather_puddle.16.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
textures/weather_puddle.17.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
textures/weather_puddle.18.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
textures/weather_puddle.19.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
textures/weather_puddle.2.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
textures/weather_puddle.20.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
textures/weather_puddle.21.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
textures/weather_puddle.22.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
textures/weather_puddle.23.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
textures/weather_puddle.24.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
textures/weather_puddle.25.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
textures/weather_puddle.26.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
textures/weather_puddle.27.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
textures/weather_puddle.28.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
textures/weather_puddle.29.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
textures/weather_puddle.3.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
textures/weather_puddle.30.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
textures/weather_puddle.4.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
textures/weather_puddle.5.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
textures/weather_puddle.6.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
textures/weather_puddle.7.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
textures/weather_puddle.8.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
textures/weather_puddle.9.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 37 KiB |
BIN
textures/weather_rain_medium.png
Normal file
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 184 B |
BIN
textures/weather_sandstorm.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 20 KiB |