forked from mtcontrib/regional_weather
Add meta information, tweak effects, properly implement lightning
This commit is contained in:
parent
79fb0a234d
commit
263c21db1d
34
README.md
34
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
|
## Assets
|
||||||
- Rain sounds CC0 by Q.K., taken from mymonths
|
### Particles
|
||||||
- Thunder sound and puddle texture DWYWPL by Don, Nathan from mymonths at https://github.com/minetest-mods/mymonths
|
- Rain sounds: *CC0* by Q.K., taken from mymonths at https://github.com/minetest-mods/mymonths/tree/master/sounds
|
||||||
- Snow cover texture WTFPL, taken from mymonths
|
- Snow flake and rain drop textures: *CC BY-SA (3.0)* by paramat, found in snowdrift mod at https://github.com/paramat/snowdrift
|
||||||
- Rain texture CC-BY-SA 3.0 from TeddyDesTodes, taken from his weather branch at https://github.com/TeddyDesTodes/minetest/tree/weather
|
- Snow texture: *CC BY-SA (3.0)* composited from individual snow flakes by paramat.
|
||||||
- Snow flake and rain drop textures CC BY-SA (3.0) by paramat, found in snowdrift mod at https://github.com/paramat/snowdrift
|
- Rain texture: *CC BY-SA (3.0)* from TeddyDesTodes, taken from his weather branch at https://github.com/TeddyDesTodes/minetest/tree/weather
|
||||||
- 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/
|
### Block Textures
|
||||||
- Hail sound CC0 by ikayuka from https://freesound.org/people/ikayuka/sounds/240742/
|
- 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
|
@ -1,17 +1,43 @@
|
|||||||
if not minetest.get_modpath("lightning") then return end
|
if not minetest.get_modpath("lightning") then return end
|
||||||
|
|
||||||
local LIGHTNING_CHANCE = 10
|
local LIGHTNING_CHANCE = 1
|
||||||
lightning.auto = false
|
lightning.auto = false
|
||||||
|
|
||||||
local rng = PcgRandom(82492402425)
|
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)
|
local function handle_effect(player_data)
|
||||||
for playername, data in pairs(player_data) do
|
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)
|
local random = rng:next(1, LIGHTNING_CHANCE)
|
||||||
if random == 1 then
|
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
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local name = "regional_weather:wind"
|
local name = "regional_weather:ambient"
|
||||||
|
|
||||||
local CLOUD_SPEED = 1.8
|
local CLOUD_SPEED = 1.8
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ local function generate_effects(params)
|
|||||||
local override = {}
|
local override = {}
|
||||||
|
|
||||||
override["climate_api:clouds"] = {
|
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)
|
speed = vector.multiply(params.wind, CLOUD_SPEED)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@ effects["climate_api:particles"] = {
|
|||||||
min_pos = {x=-12, y=-4, z=-12},
|
min_pos = {x=-12, y=-4, z=-12},
|
||||||
max_pos = {x= 12, y= 1, z= 12},
|
max_pos = {x= 12, y= 1, z= 12},
|
||||||
falling_speed=-0.1,
|
falling_speed=-0.1,
|
||||||
amount=2,
|
amount=1,
|
||||||
exptime=5,
|
exptime=5,
|
||||||
size=1,
|
size=0.8,
|
||||||
texture="weather_pollen.png"
|
texture="weather_pollen.png"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
mod.conf
6
mod.conf
@ -5,8 +5,8 @@ release = 1
|
|||||||
depends = climate_api
|
depends = climate_api
|
||||||
optional_depends = lightning
|
optional_depends = lightning
|
||||||
description = """
|
description = """
|
||||||
Not every biome is the same and neither should their weather be.
|
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 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.
|
||||||
"""
|
"""
|
BIN
screenshot.png
Normal file
BIN
screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 MiB |
Loading…
Reference in New Issue
Block a user