diff --git a/README.md b/README.md index 0c63654..8851644 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,27 @@ +# Regional Weather +A weather pack for __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. +Experience the humid air of the rain forest and harsh desert sandstorms. + ## Assets -- Rain sounds CC0 by Q.K., taken from mymonths -- Thunder sound and puddle texture DWYWPL by Don, Nathan from mymonths at https://github.com/minetest-mods/mymonths -- Snow cover texture WTFPL, taken from mymonths -- Rain texture CC-BY-SA 3.0 from TeddyDesTodes, taken from his weather branch at https://github.com/TeddyDesTodes/minetest/tree/weather -- 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 composited from individual snow flakes by paramat. CC-BY-SA (3.0) -- 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/ \ No newline at end of file +### 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 + +### 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 + +### Sounds +- 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/ + +### Assets in screenshots +- All screenshots and editing by me: *CC BY-SA (4.0)* +- 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 \ No newline at end of file diff --git a/ca_effects/lightning.lua b/ca_effects/lightning.lua index d5bb479..d8dc666 100644 --- a/ca_effects/lightning.lua +++ b/ca_effects/lightning.lua @@ -1,17 +1,43 @@ if not minetest.get_modpath("lightning") then return end -local LIGHTNING_CHANCE = 10 +local LIGHTNING_CHANCE = 1 lightning.auto = false local rng = PcgRandom(82492402425) +-- simplified position chooser by Auke Kok (sofar) taken from lightning mod itself +-- see https://github.com/minetest-mods/lightning/blob/master/init.lua#L53-L91 +-- "lightning" is licensed under GNU Lesser Public License 2.1 or any later revision +local function choose_pos(pos) + pos.x = math.floor(pos.x - (lightning.range_h / 2) + rng:next(1, lightning.range_h)) + pos.y = pos.y + (lightning.range_v / 2) + pos.z = math.floor(pos.z - (lightning.range_h / 2) + rng:next(1, lightning.range_h)) + + local b, pos2 = minetest.line_of_sight(pos, {x = pos.x, y = pos.y - lightning.range_v, z = pos.z}, 1) + + -- nothing but air found + if b then + return nil + end + + local n = minetest.get_node({x = pos2.x, y = pos2.y - 1/2, z = pos2.z}) + if n.name == "air" or n.name == "ignore" then + return nil + end + + return pos2 +end + local function handle_effect(player_data) for playername, data in pairs(player_data) do - local player = minetest.get_player_by_name(playername) - local ppos = player:get_pos() local random = rng:next(1, LIGHTNING_CHANCE) if random == 1 then - lightning.strike(ppos) + local player = minetest.get_player_by_name(playername) + local ppos = player:get_pos() + local position = choose_pos(ppos) + if position ~= nil then + lightning.strike(position) + end end end end diff --git a/ca_weathers/ambient.lua b/ca_weathers/ambient.lua index 61a5d8f..35c7277 100644 --- a/ca_weathers/ambient.lua +++ b/ca_weathers/ambient.lua @@ -1,4 +1,4 @@ -local name = "regional_weather:wind" +local name = "regional_weather:ambient" local CLOUD_SPEED = 1.8 @@ -8,7 +8,7 @@ local function generate_effects(params) local override = {} override["climate_api:clouds"] = { - size = climate_api.utility.rangelim(params.humidity, 0.25, 0.9), + size = climate_api.utility.rangelim(params.humidity / 100, 0.25, 0.98), speed = vector.multiply(params.wind, CLOUD_SPEED) } diff --git a/ca_weathers/pollen.lua b/ca_weathers/pollen.lua index ed5f331..0e3dd9d 100644 --- a/ca_weathers/pollen.lua +++ b/ca_weathers/pollen.lua @@ -15,9 +15,9 @@ effects["climate_api:particles"] = { min_pos = {x=-12, y=-4, z=-12}, max_pos = {x= 12, y= 1, z= 12}, falling_speed=-0.1, - amount=2, + amount=1, exptime=5, - size=1, + size=0.8, texture="weather_pollen.png" } diff --git a/mod.conf b/mod.conf index fd50cdc..ba9a30c 100644 --- a/mod.conf +++ b/mod.conf @@ -5,8 +5,8 @@ release = 1 depends = climate_api optional_depends = lightning 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. +Not every biome is the same and neither should their weather be. +Regional Weather controls it's effects with the local climate in mind. - Experience the humid air of the rain forest and harsh desert sandstorms. +Experience the humid air of the rain forest and harsh desert sandstorms. """ \ No newline at end of file diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..4010a27 Binary files /dev/null and b/screenshot.png differ