zombie spawner looks like tombstone

master
xisd 2019-06-11 03:35:17 +02:00
parent d863472d72
commit b24c896b1a
4 changed files with 44 additions and 8 deletions

View File

@ -123,7 +123,7 @@ local SPRITE_VERSION = minetest.settings:get_bool("mobs.animal_fish.sprite_versi
light_damage = 0,
animation = l_anims,
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, l_cc_hand, l_cc_net, 0, true, nil)
mobs:capture_mob(self, clicker, l_cc_hand, 100, 0, true, nil)
end
})
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height

View File

@ -149,6 +149,25 @@ mobs:register_special_spawner({
-- Chances that spawner drop nothing
-- empty_drop_chance = 2
-- Mob Spawned by spawner
mob = mob_id,
mob = mob_id,
tiles = {
"default_stone_block.png", -- Top
"default_stone_block.png^mobs_zombie_spawner.png", -- Bottom
"default_stone_block.png",
"default_stone_block.png",
"default_stone_block.png^mobs_zombie_spawner.png", -- Front
"default_stone_block.png^mobs_zombie_spawner.png", -- Back
},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, -0.375, 0.375, -0.3125, 0.375}, -- NodeBox1
{-0.3125, -0.5, -0.3125, 0.3125, -0.25, 0.3125}, -- NodeBox2
{-0.25, -0.4375, -0.125, 0.25, 0.1875, 0.125}, -- NodeBox4
{-0.1875, -0.4375, -0.125, 0.1875, 0.25, 0.125}, -- NodeBox3
}
}
})

View File

@ -59,7 +59,7 @@ function mobs:spawn_abm_check(pos, node, name)
local apos = math.max(math.abs(pos.x), math.abs(pos.y), math.abs(pos.z))
if nohostile_radius and ( ent.type == "monster" ) and apos < nohostile_radius then
if no_monster_radius and ( ent.type == "monster" ) and apos < no_monster_radius then
return true
end
@ -384,7 +384,10 @@ function mobs:register_special_spawner(def)
spawnerdef.empty_drop_chance = def.empty_drop_chance or 2
-- Mob Spawned by spawner
spawnerdef.mob = def.mob
spawnerdef.tiles = def.tiles
spawnerdef.drawtype = def.drawtype or "normal"
spawnerdef.node_box = def.node_box or nil
spawnerdef.after_dig_node = def.after_dig_node or function (pos, oldnode)
-- -- Might spawn a mob -- --
@ -442,17 +445,23 @@ function mobs:register_special_spawner(def)
local ttr = spawnerdef.base_texture
local tls = {ttr,ttr,ttr..'^' .. spawnerdef.glyph } --sides
if spawnerdef.texture_face == "all" then
if spawnerdef.tiles then
tls = spawnerdef.tiles
elseif spawnerdef.texture_face == "all" then
tls = {ttr..'^' .. spawnerdef.glyph }
end
local drw = spawnerdef.drawtype
local nbdx = spawnerdef.node_box
minetest.register_node(spawnerdef.name, {
description = spawnerdef.description,
_doc_items_longdesc = spawnerdef.longdesc,
paramtype = "light",
tiles = tls,
is_ground_content = false,
drawtype = "normal",
groups = {cracky = 3, stone = 2},
drawtype = drw,
node_box = nbdx,
groups = {cracky = 3, stone = 2},
drop = "",
after_dig_node = spawnerdef.after_dig_node
})

View File

@ -15,6 +15,15 @@
--
-[x] Inventory image for all mobs
-[x] Settings
-[ ] Safe zone
* no monster inside a certain radius around spawn
* all mobs are passive and will run away inside a certain radius
-[ ] Progressive increment of mob damages and health (in a determined radius)
* Mobs health and damages are proportionnal to distance from the orgin point until a defined max distance
-[ ] Alternative 'square pokeball' option for piched up mobs
-[-] Support for doc_identifier ( long description and usage )
@ -52,6 +61,5 @@
-[ ] Potions to cure zombies
-[ ] books
-[ ] npcs
___________________________________________________