master
root 2021-02-14 01:59:31 +01:00
parent 6af937c39d
commit ce8d535eb0
2 changed files with 7 additions and 11 deletions

View File

@ -2,20 +2,20 @@
climate_min_height = -10 climate_min_height = -10
#Chance of the a new volume climate to be created #Chance of the a new volume climate to be created
##in seconds ##in seconds
climate_change_ratio = 600 climate_change_ratio = 5
#Volume of the regional climates (sphere) #Volume of the regional climates (sphere)
climate_radius = 80 climate_radius = 80
#Average time of the climate #Average time of the climate
climate_duration = 80 climate_duration = 20
#Random deviation for the duration #Random deviation for the duration
climate_duration_random_ratio = 0.45 climate_duration_random_ratio = 0.45
#Await this min time between climates #Await this min time between climates
climate_period = 600 climate_period = 5
#Sounds #Sounds
climate_rain_sound = true climate_rain_sound = true
#Storm Chance #Storm Chance
##Chance of the rain being stormy ##Chance of the rain being stormy
storm_chance = 5 storm_chance = 1
##Lightning Effect ##Lightning Effect
lightning = true lightning = true
lightning_chance = 300 lightning_chance = 300

View File

@ -270,7 +270,6 @@ local function remove_climate_player(player)
--remove the player--> --remove the player-->
array_remove(climatez.players, player_name) array_remove(climatez.players, player_name)
--climatez.players[player_name] = nil
end end
local function create_climate(player) local function create_climate(player)
@ -333,7 +332,6 @@ local function create_climate(player)
center = player_pos, center = player_pos,
downfall = downfall, downfall = downfall,
wind = wind, wind = wind,
lightning = false,
} }
--save the player --save the player
@ -407,21 +405,19 @@ local function apply_climate(player, climate_id)
--Lightning --Lightning
if player_downfall == "storm" and climatez.settings.lightning then if player_downfall == "storm" and climatez.settings.lightning then
local lightning = climatez.climates[climate_id].lightning local lightning = player:get_meta():get_int("climatez:lightning")
--minetest.chat_send_all(tostring(lightning)) --minetest.chat_send_all(tostring(lightning))
--minetest.chat_send_all(tonumber(timer)) --minetest.chat_send_all(tonumber(timer))
if timer >= 0.5 then if timer >= 0.5 then
if not lightning then if lightning <= 0 then
local chance = math.random(climatez.settings.lightning_chance) local chance = math.random(climatez.settings.lightning_chance)
if chance == 1 then if chance == 1 then
show_lightning(player, climate_id) show_lightning(player, climate_id)
climatez.climates[climate_id].lightning = true
end end
end end
end end
if timer >= 0.1 and lightning then if timer >= 0.1 and lightning > 0 then
remove_lightning(player) remove_lightning(player)
climatez.climates[climate_id].lightning = false
end end
end end
end end