update mobs mod
@ -28,7 +28,7 @@ This mod contains the following additions:
|
|||||||
|
|
||||||
Changelog:
|
Changelog:
|
||||||
|
|
||||||
1.26- Pathfinding feature added thanks to rnd, when monsters attack they become scary smart in finding you :)
|
1.26- Pathfinding feature added thanks to rnd, when monsters attack they become scary smart in finding you :) also, beehive produces honey now :)
|
||||||
1.25- Mobs no longer spawn within 12 blocks of player or despawn within same range, spawners now have player detection, Code tidy and tweak.
|
1.25- Mobs no longer spawn within 12 blocks of player or despawn within same range, spawners now have player detection, Code tidy and tweak.
|
||||||
1.24- Added feature where certain animals run away when punched (runaway = true in mob definition)
|
1.24- Added feature where certain animals run away when punched (runaway = true in mob definition)
|
||||||
1.23- Added mob spawner block for admin to setup spawners in-game (place and right click to enter settings)
|
1.23- Added mob spawner block for admin to setup spawners in-game (place and right click to enter settings)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
-- Mobs Api (16th February 2016)
|
-- Mobs Api (17th February 2016)
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
|
|
||||||
@ -917,6 +917,7 @@ minetest.register_entity(name, {
|
|||||||
fear_height = def.fear_height or 0,
|
fear_height = def.fear_height or 0,
|
||||||
runaway = def.runaway,
|
runaway = def.runaway,
|
||||||
runaway_timer = 0,
|
runaway_timer = 0,
|
||||||
|
pathfinding = def.pathfinding,
|
||||||
|
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
|
|
||||||
@ -1669,7 +1670,9 @@ minetest.register_entity(name, {
|
|||||||
if dist > self.reach then
|
if dist > self.reach then
|
||||||
|
|
||||||
-- path finding by rnd
|
-- path finding by rnd
|
||||||
if enable_pathfinding then
|
if self.pathfinding -- only if mob has pathfinding enabled
|
||||||
|
and enable_pathfinding then
|
||||||
|
|
||||||
smart_mobs(self, s, p, dist, dtime)
|
smart_mobs(self, s, p, dist, dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -73,6 +73,20 @@ minetest.register_node("mobs:beehive", {
|
|||||||
on_use = minetest.item_eat(4),
|
on_use = minetest.item_eat(4),
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
|
|
||||||
|
on_construct = function(pos)
|
||||||
|
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
|
||||||
|
meta:set_string("formspec", "size[8,6]"
|
||||||
|
..default.gui_bg..default.gui_bg_img..default.gui_slots
|
||||||
|
.. "image[3,0.8;0.8,0.8;mobs_bee_inv.png]"
|
||||||
|
.. "list[current_name;beehive;4,0.5;1,1;]"
|
||||||
|
.. "list[current_player;main;0,2.35;8,4;]"
|
||||||
|
.. "listring[]")
|
||||||
|
|
||||||
|
meta:get_inventory():set_size("beehive", 1)
|
||||||
|
end,
|
||||||
|
|
||||||
after_place_node = function(pos, placer, itemstack)
|
after_place_node = function(pos, placer, itemstack)
|
||||||
|
|
||||||
if placer:is_player() then
|
if placer:is_player() then
|
||||||
@ -84,7 +98,30 @@ minetest.register_node("mobs:beehive", {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
on_punch = function(pos, node, puncher)
|
||||||
|
|
||||||
|
-- yep, bee's don't like having their home punched by players
|
||||||
|
puncher:set_hp(puncher:get_hp() - 4)
|
||||||
|
end,
|
||||||
|
|
||||||
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
|
|
||||||
|
if listname == "beehive" then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
return stack:get_count()
|
||||||
|
end,
|
||||||
|
|
||||||
|
can_dig = function(pos,player)
|
||||||
|
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
|
||||||
|
-- only dig beehive if no honey inside
|
||||||
|
return meta:get_inventory():is_empty("beehive")
|
||||||
|
end,
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@ -117,3 +154,37 @@ minetest.register_craft({
|
|||||||
{"mobs:honey_block"},
|
{"mobs:honey_block"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- beehive workings
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"mobs:beehive"},
|
||||||
|
interval = 6,
|
||||||
|
chance = 5,
|
||||||
|
catch_up = false,
|
||||||
|
action = function(pos, node)
|
||||||
|
|
||||||
|
-- bee's only make honey during the day
|
||||||
|
local tod = (minetest.get_timeofday() or 0) * 24000
|
||||||
|
|
||||||
|
if tod < 4500 or tod > 19500 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- find flowers in area around hive
|
||||||
|
local flowers = minetest.find_nodes_in_area_under_air(
|
||||||
|
{x = pos.x - 10, y = pos.y - 5, z = pos.z - 10},
|
||||||
|
{x = pos.x + 10, y = pos.y + 5, z = pos.z + 10},
|
||||||
|
"group:flower")
|
||||||
|
|
||||||
|
-- no flowers no honey, nuff said!
|
||||||
|
if #flowers > 3 then
|
||||||
|
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
|
||||||
|
-- error check just incase it's an old beehive
|
||||||
|
if meta then
|
||||||
|
meta:get_inventory():add_item("beehive", "mobs:honey")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
@ -7,6 +7,7 @@ mobs:register_mob("mobs:dirt_monster", {
|
|||||||
-- aggressive, deals 6 damage to player when hit
|
-- aggressive, deals 6 damage to player when hit
|
||||||
passive = false,
|
passive = false,
|
||||||
attack_type = "dogfight",
|
attack_type = "dogfight",
|
||||||
|
pathfinding = true,
|
||||||
reach = 2,
|
reach = 2,
|
||||||
damage = 5,
|
damage = 5,
|
||||||
-- health & armor
|
-- health & armor
|
||||||
|
@ -18,6 +18,7 @@ mobs:register_mob("mobs:npc", {
|
|||||||
damage = 5, -- 3 damages if tamed
|
damage = 5, -- 3 damages if tamed
|
||||||
attack_type = "dogfight",
|
attack_type = "dogfight",
|
||||||
attacks_monsters = true,
|
attacks_monsters = true,
|
||||||
|
pathfinding = true,
|
||||||
-- health & armor
|
-- health & armor
|
||||||
hp_min = 20,
|
hp_min = 20,
|
||||||
hp_max = 20,
|
hp_max = 20,
|
||||||
|
@ -18,6 +18,7 @@ mobs:register_mob("mobs:npc_female", {
|
|||||||
damage = 5, -- 3 damages if tamed
|
damage = 5, -- 3 damages if tamed
|
||||||
attack_type = "dogfight",
|
attack_type = "dogfight",
|
||||||
attacks_monsters = true,
|
attacks_monsters = true,
|
||||||
|
pathfinding = true,
|
||||||
-- health & armor
|
-- health & armor
|
||||||
hp_min = 20,
|
hp_min = 20,
|
||||||
hp_max = 20,
|
hp_max = 20,
|
||||||
|
@ -7,6 +7,7 @@ mobs:register_mob("mobs:oerkki", {
|
|||||||
-- aggressive, deals 7 damage when player hit
|
-- aggressive, deals 7 damage when player hit
|
||||||
passive = false,
|
passive = false,
|
||||||
attack_type = "dogfight",
|
attack_type = "dogfight",
|
||||||
|
pathfinding = true,
|
||||||
reach = 2,
|
reach = 2,
|
||||||
damage = 6,
|
damage = 6,
|
||||||
-- health & armor
|
-- health & armor
|
||||||
|
@ -7,6 +7,7 @@ mobs:register_mob("mobs:sand_monster", {
|
|||||||
-- aggressive, deals 5 damage to player when hit
|
-- aggressive, deals 5 damage to player when hit
|
||||||
passive = false,
|
passive = false,
|
||||||
attack_type = "dogfight",
|
attack_type = "dogfight",
|
||||||
|
pathfinding = true,
|
||||||
reach = 2,
|
reach = 2,
|
||||||
damage = 4,
|
damage = 4,
|
||||||
-- health & armor
|
-- health & armor
|
||||||
|
@ -1,14 +1,28 @@
|
|||||||
|
|
||||||
local all_colours = {
|
local all_colours = {
|
||||||
"grey", "black", "red", "yellow", "green", "cyan", "blue", "magenta",
|
{"black", "Black", "#000000b0"},
|
||||||
"white", "orange", "violet", "brown", "pink", "dark_grey", "dark_green"
|
{"blue", "Blue", "#015dbb70"},
|
||||||
|
{"brown", "Brown", "#663300a0"},
|
||||||
|
{"cyan", "Cyan", "#01ffd870"},
|
||||||
|
{"dark_green", "Dark Green", "#005b0770"},
|
||||||
|
{"dark_grey", "Dark Grey", "#303030b0"},
|
||||||
|
{"green", "Green", "#61ff0170"},
|
||||||
|
{"grey", "Grey", "#5b5b5bb0"},
|
||||||
|
{"magenta", "Magenta", "#ff05bb70"},
|
||||||
|
{"orange", "Orange", "#ff840170"},
|
||||||
|
{"pink", "Pink", "#ff65b570"},
|
||||||
|
{"red", "Red", "#ff0000a0"},
|
||||||
|
{"violet", "Violet", "#2000c970"},
|
||||||
|
{"white", "White", "#abababc0"},
|
||||||
|
{"yellow", "Yellow", "#e3ff0070"},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Sheep by PilzAdam
|
-- Sheep by PilzAdam, texture converted to minetest by AMMOnym from Summerfield pack
|
||||||
|
|
||||||
for _, col in pairs(all_colours) do
|
for _, col in pairs(all_colours) do
|
||||||
|
|
||||||
mobs:register_mob("mobs:sheep_"..col, {
|
mobs:register_mob("mobs:sheep_"..col[1], {
|
||||||
|
|
||||||
-- animal, monster, npc, barbarian
|
-- animal, monster, npc, barbarian
|
||||||
type = "animal",
|
type = "animal",
|
||||||
-- not aggressive
|
-- not aggressive
|
||||||
@ -22,7 +36,7 @@ for _, col in pairs(all_colours) do
|
|||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_sheep.b3d",
|
mesh = "mobs_sheep.b3d",
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_sheep_"..col..".png"},
|
{"mobs_sheep_wool.png^[colorize:" .. col[3] .. "^mobs_sheep_base.png"},
|
||||||
},
|
},
|
||||||
-- specific texture and mesh for gotten
|
-- specific texture and mesh for gotten
|
||||||
gotten_texture = {"mobs_sheep_shaved.png"},
|
gotten_texture = {"mobs_sheep_shaved.png"},
|
||||||
@ -40,7 +54,7 @@ for _, col in pairs(all_colours) do
|
|||||||
-- drops raw meat and woll of its color when dead
|
-- drops raw meat and woll of its color when dead
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 2, max = 3},
|
{name = "mobs:meat_raw", chance = 1, min = 2, max = 3},
|
||||||
{name = "wool:"..col, chance = 1, min = 1, max = 1},
|
{name = "wool:"..col[1], chance = 1, min = 1, max = 1},
|
||||||
},
|
},
|
||||||
-- damaged by
|
-- damaged by
|
||||||
water_damage = 1,
|
water_damage = 1,
|
||||||
@ -65,7 +79,9 @@ for _, col in pairs(all_colours) do
|
|||||||
replace_offset = -1,
|
replace_offset = -1,
|
||||||
fear_height = 3,
|
fear_height = 3,
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
|
|
||||||
local shpcolor = string.split(self.name,"_")[2]
|
local shpcolor = string.split(self.name,"_")[2]
|
||||||
|
|
||||||
if shpcolor =="dark" then
|
if shpcolor =="dark" then
|
||||||
shpcolor = shpcolor.."_"..string.split(self.name,"_")[3]
|
shpcolor = shpcolor.."_"..string.split(self.name,"_")[3]
|
||||||
end
|
end
|
||||||
@ -76,7 +92,7 @@ for _, col in pairs(all_colours) do
|
|||||||
--if full grow fuzz
|
--if full grow fuzz
|
||||||
if self.gotten == false then
|
if self.gotten == false then
|
||||||
self.object:set_properties({
|
self.object:set_properties({
|
||||||
textures = {"mobs_sheep_"..shpcolor..".png"},
|
textures = {"mobs_sheep_wool.png^[colorize:" .. col[3] .. "^mobs_sheep_base.png"},
|
||||||
mesh = "mobs_sheep.b3d",
|
mesh = "mobs_sheep.b3d",
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@ -133,17 +149,17 @@ for _, col in pairs(all_colours) do
|
|||||||
and self.tamed == true
|
and self.tamed == true
|
||||||
and name == self.owner then
|
and name == self.owner then
|
||||||
|
|
||||||
local col = string.split(itemname,":")[2]
|
local colr = string.split(itemname,":")[2]
|
||||||
|
|
||||||
for _,c in pairs(all_colours) do
|
for _,c in pairs(all_colours) do
|
||||||
|
|
||||||
if c == col then
|
if c[1] == colr then
|
||||||
|
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
|
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
|
|
||||||
local mob = minetest.add_entity(pos, "mobs:sheep_"..col)
|
local mob = minetest.add_entity(pos, "mobs:sheep_"..colr)
|
||||||
local ent = mob:get_luaentity()
|
local ent = mob:get_luaentity()
|
||||||
|
|
||||||
ent.owner = name
|
ent.owner = name
|
||||||
@ -168,7 +184,7 @@ for _, col in pairs(all_colours) do
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:register_egg("mobs:sheep_"..col, "Sheep ("..col..")", "mobs_sheep_"..col.."_inv.png", 1)
|
mobs:register_egg("mobs:sheep_"..col[1], col[2] .. "Sheep", "mobs_sheep_white_inv.png^[colorize:" .. col[3], 1)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ mobs:register_mob("mobs:stone_monster", {
|
|||||||
-- aggressive, deals 8 damage to player when hit
|
-- aggressive, deals 8 damage to player when hit
|
||||||
passive = false,
|
passive = false,
|
||||||
attack_type = "dogfight",
|
attack_type = "dogfight",
|
||||||
|
pathfinding = true,
|
||||||
reach = 2,
|
reach = 2,
|
||||||
damage = 6,
|
damage = 6,
|
||||||
-- health & armor
|
-- health & armor
|
||||||
@ -19,6 +20,7 @@ mobs:register_mob("mobs:stone_monster", {
|
|||||||
mesh = "mobs_stone_monster.b3d",
|
mesh = "mobs_stone_monster.b3d",
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_stone_monster.png"},
|
{"mobs_stone_monster.png"},
|
||||||
|
{"mobs_stone_monster2.png"}, -- by AMMOnym
|
||||||
},
|
},
|
||||||
blood_texture = "default_stone.png",
|
blood_texture = "default_stone.png",
|
||||||
-- sounds
|
-- sounds
|
||||||
@ -61,7 +63,7 @@ mobs:register_mob("mobs:stone_monster", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- spawns on stone between -1 and 5 light, 1 in 7000 chance, 1 in area below -25
|
-- spawns on stone between -1 and 5 light, 1 in 7000 chance, 1 in area below -25
|
||||||
mobs:spawn_specific("mobs:stone_monster", {"default:stone", "default:sandstone"}, {"air"}, -1, 5, 30, 7000, 1, -31000, -25, false)
|
mobs:spawn_specific("mobs:stone_monster", {"default:stone", "default:desert_stone"}, {"air"}, -1, 5, 30, 7000, 1, -31000, -25, false)
|
||||||
|
|
||||||
-- register spawn egg
|
-- register spawn egg
|
||||||
mobs:register_egg("mobs:stone_monster", "Stone Monster", "mobs_stone_monster_inv.png", 1)
|
mobs:register_egg("mobs:stone_monster", "Stone Monster", "mobs_stone_monster_inv.png", 1)
|
||||||
|
BIN
mods/mobs/textures/mobs_sheep_base.png
Executable file
After Width: | Height: | Size: 649 B |
Before Width: | Height: | Size: 694 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 735 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 693 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 760 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 775 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 726 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 729 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 712 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 735 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 704 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 721 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 723 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 927 B |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 750 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.2 KiB |
BIN
mods/mobs/textures/mobs_sheep_wool.png
Executable file
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 721 B |
Before Width: | Height: | Size: 2.1 KiB |
BIN
mods/mobs/textures/mobs_stone_monster2.png
Executable file
After Width: | Height: | Size: 3.6 KiB |