mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 09:31:07 +01:00
Make monsters less likely to spawn in groups
This commit is contained in:
parent
0aa4e0a395
commit
2f0ca063e9
1 changed files with 2 additions and 1 deletions
|
@ -525,6 +525,7 @@ if mobs_spawn then
|
||||||
local mob_def = mob_library_worker_table[mob_index]
|
local mob_def = mob_library_worker_table[mob_index]
|
||||||
local spawn_in_group = minetest.registered_entities[mob_def.name].spawn_in_group or 4
|
local spawn_in_group = minetest.registered_entities[mob_def.name].spawn_in_group or 4
|
||||||
local spawn_in_group_min = minetest.registered_entities[mob_def.name].spawn_in_group_min or 1
|
local spawn_in_group_min = minetest.registered_entities[mob_def.name].spawn_in_group_min or 1
|
||||||
|
local mob_type = minetest.registered_entities[mob_def.name].type
|
||||||
if spawn_check(spawning_position,mob_def) then
|
if spawn_check(spawning_position,mob_def) then
|
||||||
if mob_def.type_of_spawning == "water" then
|
if mob_def.type_of_spawning == "water" then
|
||||||
spawning_position = get_water_spawn(spawning_position)
|
spawning_position = get_water_spawn(spawning_position)
|
||||||
|
@ -537,7 +538,7 @@ if mobs_spawn then
|
||||||
end
|
end
|
||||||
--everything is correct, spawn mob
|
--everything is correct, spawn mob
|
||||||
local object
|
local object
|
||||||
if spawn_in_group then
|
if spawn_in_group and ( mob_type ~= "monster" or math.random(5) == 1 ) then
|
||||||
object = spawn_group(spawning_position,mob_def,{minetest.get_node(vector.offset(spawning_position,0,-1,0)).name},spawn_in_group,spawn_in_group_min)
|
object = spawn_group(spawning_position,mob_def,{minetest.get_node(vector.offset(spawning_position,0,-1,0)).name},spawn_in_group,spawn_in_group_min)
|
||||||
else
|
else
|
||||||
object = minetest.add_entity(spawning_position, mob_def.name)
|
object = minetest.add_entity(spawning_position, mob_def.name)
|
||||||
|
|
Loading…
Reference in a new issue