add more maskito adjustments
This commit is contained in:
parent
63406d4447
commit
f9f28cb97f
@ -79,7 +79,9 @@ minetest.register_node("water_life:moskito", {
|
||||
local killer = math.floor(os.time()) - mmeta:get_int("mlife")
|
||||
local mmintime = water_life.moskitolifetime / 3
|
||||
local mmaxtime = water_life.moskitolifetime
|
||||
if (ptime and ptime < 3 and level and level > 7) or killer > water_life.moskitolifetime then
|
||||
if (ptime and ptime < 3 and level and
|
||||
level > water_life.moskito_lightmax) or
|
||||
killer > water_life.moskitolifetime then
|
||||
mmeta:set_int("mlife", 0)
|
||||
minetest.set_node(pos, {name = "air"})
|
||||
else
|
||||
@ -88,10 +90,12 @@ minetest.register_node("water_life:moskito", {
|
||||
{x=pos.x+4, y=pos.y+1, z=pos.z+4}, {"air"})
|
||||
if nodes and #nodes > 0 then
|
||||
local spos = nodes[random(#nodes)]
|
||||
local rnd = random (200)
|
||||
local rnd = random (water_life.moskito_humidity)
|
||||
--minetest.chat_send_all("Temp = "..bdata.temp.." Humidity = "..bdata.humid.." <<< "..dump(rnd))
|
||||
if bdata.temp > 20 and spos and spos.y > -10 and spos.y < 100 and not
|
||||
water_life.ihateinsects then
|
||||
if bdata.temp > water_life.moskito_mintemp and spos and
|
||||
spos.y > water_life.moskito_minpos and
|
||||
spos.y < water_life.moskito_maxpos and
|
||||
not water_life.ihateinsects then
|
||||
if rnd < bdata.humid then
|
||||
minetest.set_node(spos, {name = "water_life:moskito"})
|
||||
minetest.get_node_timer(spos):start(random(mmintime, mmaxtime))
|
||||
|
4
init.lua
4
init.lua
@ -38,6 +38,10 @@ water_life.soundadjust = tonumber(minetest.settings:get("water_life_soundadjust"
|
||||
water_life.moskitolifetime = tonumber(minetest.settings:get("water_life_moskitolifetime")) or 120
|
||||
water_life.moskito_minpos = tonumber(minetest.settings:get("water_life_moskito_minpos")) or -10
|
||||
water_life.moskito_maxpos = tonumber(minetest.settings:get("water_life_moskito_maxpos")) or 100
|
||||
water_life.moskito_lightmax = tonumber(minetest.settings:get("water_life_moskito_lightmax")) or 8
|
||||
water_life.moskito_humidity = tonumber(minetest.settings:get("water_life_moskito_humidity")) or 200
|
||||
water_life.moskito_mintemp = tonumber(minetest.settings:get("water_life_moskito_mintemp")) or 20
|
||||
|
||||
water_life.radar_debug = minetest.settings:get_bool("water_life_radar_debug") or false
|
||||
water_life.muddy_water = minetest.settings:get_bool("water_life_muddy_water") or false
|
||||
|
||||
|
@ -51,6 +51,18 @@ water_life_water_life_moskito_minpos (no moskitos in heights smaller than this)
|
||||
# moskitos do not spawn in heights larger than this value (default 100)
|
||||
water_life_water_life_moskito_maxpos (no moskitos in heights larger than this) int 100
|
||||
|
||||
# -
|
||||
# moskitos will die in areas with lightlevel above this (default 8)
|
||||
water_life_water_life_moskito_lightmax (die if brighter than this) int 8
|
||||
|
||||
# -
|
||||
# moskitos need at least this temperature to show up (default 20)
|
||||
water_life_water_life_moskito_mintemp (noshow if colder than this) int 20
|
||||
|
||||
# -
|
||||
# moskitos love humid biomes, small values will make them love dry biomes as well (default 200)
|
||||
water_life_water_life_moskito_humidity (the smaller the more likely) int 200
|
||||
|
||||
# -
|
||||
# total max number of animals in an aktive area
|
||||
# other mods might not care about this setting
|
||||
|
@ -131,14 +131,15 @@ local function spawnstep(dtime)
|
||||
end
|
||||
-- mosqitos only bettween -10 < y < 100
|
||||
if moskitopos and not water_life.dangerous
|
||||
and moskitopos.y > water_life.moskito_minpos and moskitopos.y < water_life.moskito_maxpos then
|
||||
and moskitopos.y > water_life.moskito_minpos and
|
||||
moskitopos.y < water_life.moskito_maxpos then
|
||||
local mlevel = minetest.get_node_light(moskitopos)
|
||||
local ptime = water_life.get_game_time()
|
||||
local mdata = water_life.get_biome_data(moskitopos)
|
||||
local mmintime = water_life.moskitolifetime / 3
|
||||
local mmaxtime = water_life.moskitolifetime
|
||||
if ((ptime and ptime > 2) or mlevel < 8)
|
||||
and mdata.temp > 20 then
|
||||
if ((ptime and ptime > 2) or mlevel < water_life.moskito_lightmax)
|
||||
and mdata.temp > water_life.moskito_mintemp then
|
||||
minetest.set_node(moskitopos,
|
||||
{name = "water_life:moskito"})
|
||||
minetest.get_node_timer(moskitopos):start(
|
||||
|
Loading…
x
Reference in New Issue
Block a user