Update file structure

This commit is contained in:
Till Affeldt 2020-04-16 10:04:34 +02:00
parent bac1618a3c
commit 6d3e33bf9f
6 changed files with 14 additions and 9 deletions

View File

@ -20,8 +20,9 @@ Experience the humid air of the rain forest and harsh desert sandstorms.
- 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/
### Other
- Original ice hud overlay: *CC0* by Simon Matzinger from https://freestocktextures.com/texture/winter-snow-frozen,995.html, edits by me under *CC0* as well
### 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
### Assets in screenshots
- All screenshots and editing by me: *CC BY-SA (4.0)*

View File

@ -1,5 +1,7 @@
if not minetest.get_modpath("lightning") then return end
local EFFECT_NAME = "regional_weather:lightning"
local LIGHTNING_CHANCE = 20
lightning.auto = false
@ -42,5 +44,5 @@ local function handle_effect(player_data)
end
end
climate_api.register_effect("regional_weather:lightning", handle_effect, "tick")
climate_api.set_effect_cycle("regional_weather:lightning", climate_api.LONG_CYCLE)
climate_api.register_effect(EFFECT_NAME, handle_effect, "tick")
climate_api.set_effect_cycle(EFFECT_NAME, climate_api.LONG_CYCLE)

View File

@ -1,3 +1,5 @@
local EFFECT_NAME = "regional_weather:speed_buff"
local function handle_effect(player_data)
for playername, data in ipairs(player_data) do
local player = minetest.get_player_by_name(playername)
@ -5,17 +7,17 @@ local function handle_effect(player_data)
for weather, value in pairs(data) do
product = product * value
end
climate_api.utility.add_physics("regional_weather:speed_buff", player, "speed", product)
climate_api.utility.add_physics(EFFECT_NAME, player, "speed", product)
end
end
local function remove_effect(player_data)
for playername, data in ipairs(player_data) do
local player = minetest.get_player_by_name(playername)
climate_api.utility.remove_physics("regional_weather:speed_buff", player, "speed")
climate_api.utility.remove_physics(EFFECT_NAME, player, "speed")
end
end
climate_api.register_effect("regional_weather:speed_buff", handle_effect, "tick")
climate_api.register_effect("regional_weather:speed_buff", remove_effect, "stop")
climate_api.set_effect_cycle("regional_weather:speed_buff", climate_api.SHORT_CYCLE)
climate_api.register_effect(EFFECT_NAME, handle_effect, "tick")
climate_api.register_effect(EFFECT_NAME, remove_effect, "stop")
climate_api.set_effect_cycle(EFFECT_NAME, climate_api.SHORT_CYCLE)