Move damage effect to API, add advanced damage checks, add dewpoint influence

This commit is contained in:
Till Affeldt
2020-04-28 01:22:27 +02:00
parent 9e0ed0c256
commit 4df9a61374
6 changed files with 295 additions and 79 deletions

View File

@ -14,6 +14,19 @@ climate_api.register_influence("base_humidity", function(pos)
return minetest.get_humidity(pos)
end)
-- see https://en.wikipedia.org/wiki/Dew_point#Simple_approximation
climate_api.register_influence("dewpoint", function(pos)
local heat = climate_api.environment.get_heat(pos)
local humidity = climate_api.environment.get_humidity(pos)
return heat - (9/25 * (100 - humidity))
end)
climate_api.register_influence("base_dewpoint", function(pos)
local heat = minetest.get_heat(pos)
local humidity = minetest.get_humidity(pos)
return heat - (9/25 * (100 - humidity))
end)
climate_api.register_influence("biome", function(pos)
local data = minetest.get_biome_data(pos)
local biome = minetest.get_biome_name(data.biome)