1
0
mirror of https://codeberg.org/tenplus1/mobs_monster.git synced 2025-07-05 09:50:19 +02:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
2021-03-12 12:30:34 +01:00
30 changed files with 431 additions and 49 deletions

View File

@ -1,6 +1,18 @@
local S = mobs.intllib
local stone_types = {
{ nodes = {"default:desert_stone"},
skins = {"mobs_stone_monster3.png"},
drops = {
{name = "default:desert_cobble", chance = 1, min = 0, max = 2},
{name = "default:iron_lump", chance = 5, min = 0, max = 2},
{name = "default:gold_lump", chance = 5, min = 0, max = 2}
}
}
}
-- Stone Monster by PilzAdam
@ -35,7 +47,7 @@ mobs:register_mob("mobs_monster:stone_monster", {
{name = "default:cobble", chance = 1, min = 0, max = 2},
{name = "default:coal_lump", chance = 3, min = 0, max = 2},
{name = "default:iron_lump", chance = 5, min = 0, max = 2},
{name = "maptools:silver_coin", chance = 1, min = 0, max = 1,},
{name = "maptools:silver_coin", chance = 1, min = 0, max = 1},
{name = "default:torch", chance = 2, min = 3, max = 5},
},
water_damage = 0,
@ -61,6 +73,32 @@ mobs:register_mob("mobs_monster:stone_monster", {
{"default:pick_mese", 6},
{"default:pick_diamond", 7},
},
-- check surrounding nodes and spawn a specific spider
on_spawn = function(self)
local pos = self.object:get_pos() ; pos.y = pos.y - 1
local tmp
for n = 1, #stone_types do
tmp = stone_types[n]
if minetest.find_node_near(pos, 1, tmp.nodes) then
self.base_texture = tmp.skins
self.object:set_properties({textures = tmp.skins})
if tmp.drops then
self.drops = tmp.drops
end
return true
end
end
return true -- run only once, false/nil runs every activation
end
})