update: multi-textured mobs
@ -25,6 +25,7 @@ This mod contains the following additions:
|
||||
|
||||
Changelog:
|
||||
|
||||
0.6 - Api now supports multi-textured mobs, e.g oerkki, dungeon master, rats and chickens have multiple skins when spawning (sheep fix TODO), also new Honey block
|
||||
0.5 - Mobs now float in water, die from falling, and some code improvements
|
||||
0.4 - Dungeon Masters and Mese Monsters have much better aim due to shoot_offset, also they can both shoot through nodes that aren't walkable (flowers, grass etc) plus new sheep sound :)
|
||||
0.3 - Added LOTT's Spider mob, made Cobwebs, added KPavel's Bee with Honey and Beehives (made texture), Warthogs now have sound and can be tamed, taming of shaved sheep or milked cow with 8 wheat so it will not despawn, many bug fixes :)
|
||||
|
6
api.lua
@ -10,7 +10,7 @@ function mobs:register_mob(name, def)
|
||||
visual = def.visual,
|
||||
visual_size = def.visual_size,
|
||||
mesh = def.mesh,
|
||||
textures = def.textures,
|
||||
--textures = def.textures,
|
||||
makes_footstep_sound = def.makes_footstep_sound,
|
||||
view_range = def.view_range,
|
||||
walk_velocity = def.walk_velocity,
|
||||
@ -636,8 +636,10 @@ local yaw = 0
|
||||
local tmp = {
|
||||
lifetimer = self.lifetimer,
|
||||
tamed = self.tamed,
|
||||
textures = { textures = self.textures },
|
||||
--textures = { textures = self.textures },
|
||||
textures = def.available_textures["texture_"..math.random(1,def.available_textures["total"])],
|
||||
}
|
||||
self.object:set_properties(tmp)
|
||||
return minetest.serialize(tmp)
|
||||
end,
|
||||
|
||||
|
30
bee.lua
@ -8,7 +8,11 @@ mobs:register_mob("mobs:bee", {
|
||||
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.2, 0.2},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_bee.x",
|
||||
textures = {"mobs_bee.png"},
|
||||
--textures = {"mobs_bee.png"},
|
||||
available_textures = {
|
||||
total = 1,
|
||||
texture_1 = {"mobs_bee.png"},
|
||||
},
|
||||
makes_footstep_sound = false,
|
||||
walk_velocity = 1,
|
||||
armor = 200,
|
||||
@ -100,3 +104,27 @@ minetest.register_craft({
|
||||
{"mobs:bee","mobs:bee","mobs:bee"},
|
||||
}
|
||||
})
|
||||
|
||||
-- Honey Block
|
||||
minetest.register_node("mobs:honey_block", {
|
||||
description = "Honey Block",
|
||||
tiles = {"mobs_honey_block.png"},
|
||||
groups = {snappy=3,flammable=2},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mobs:honey_block",
|
||||
recipe = {
|
||||
{"mobs:honey", "mobs:honey", "mobs:honey"},
|
||||
{"mobs:honey", "mobs:honey", "mobs:honey"},
|
||||
{"mobs:honey", "mobs:honey", "mobs:honey"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mobs:honey 9",
|
||||
recipe = {
|
||||
{"mobs:honey_block"},
|
||||
}
|
||||
})
|
||||
|
13
chicken.lua
@ -10,8 +10,17 @@ mobs:register_mob("mobs:chicken", {
|
||||
visual = "mesh",
|
||||
mesh = "chicken.x",
|
||||
-- textures look repetative but they fix the wrapping bug
|
||||
textures = {"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png",
|
||||
"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png"},
|
||||
available_textures = {
|
||||
total = 2,
|
||||
texture_1 = {"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png",
|
||||
"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png",
|
||||
"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png"},
|
||||
texture_2 = {"mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png",
|
||||
"mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png",
|
||||
"mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png"},
|
||||
},
|
||||
--textures = {"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png",
|
||||
-- "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png"},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
armor = 200,
|
||||
|
6
cow.lua
@ -6,7 +6,11 @@ mobs:register_mob("mobs:cow", {
|
||||
hp_min = 5,
|
||||
hp_max = 20,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
|
||||
textures = {"mobs_cow.png"},
|
||||
--textures = {"mobs_cow.png"},
|
||||
available_textures = {
|
||||
total = 1,
|
||||
texture_1 = {"mobs_cow.png"},
|
||||
},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_cow.x",
|
||||
makes_footstep_sound = true,
|
||||
|
@ -7,7 +7,11 @@ mobs:register_mob("mobs:dirt_monster", {
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_stone_monster.x",
|
||||
textures = {"mobs_dirt_monster.png"},
|
||||
--textures = {"mobs_dirt_monster.png"},
|
||||
available_textures = {
|
||||
total = 1,
|
||||
texture_1 = {"mobs_dirt_monster.png"},
|
||||
},
|
||||
visual_size = {x=3, y=2.6},
|
||||
makes_footstep_sound = true,
|
||||
view_range = 15,
|
||||
|
@ -8,7 +8,13 @@ mobs:register_mob("mobs:dungeon_master", {
|
||||
collisionbox = {-0.7, -0.01, -0.7, 0.7, 2.6, 0.7},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_dungeon_master.x",
|
||||
textures = {"mobs_dungeon_master.png"},
|
||||
--textures = {"mobs_dungeon_master.png"},
|
||||
available_textures = {
|
||||
total = 3,
|
||||
texture_1 = {"mobs_dungeon_master.png"},
|
||||
texture_2 = {"mobs_dungeon_master2.png"},
|
||||
texture_3 = {"mobs_dungeon_master3.png"},
|
||||
},
|
||||
visual_size = {x=8, y=8},
|
||||
makes_footstep_sound = true,
|
||||
view_range = 15,
|
||||
|
@ -17,7 +17,11 @@ mobs:register_mob("mobs:lava_flan", {
|
||||
collisionbox = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5},
|
||||
visual = "mesh",
|
||||
mesh = "zmobs_lava_flan.x",
|
||||
textures = {"zmobs_lava_flan.png"},
|
||||
--textures = {"zmobs_lava_flan.png"},
|
||||
available_textures = {
|
||||
total = 1,
|
||||
texture_1 = {"zmobs_lava_flan.png"},
|
||||
},
|
||||
visual_size = {x=1, y=1},
|
||||
makes_footstep_sound = true,
|
||||
view_range = 10,
|
||||
|
@ -19,7 +19,11 @@ mobs:register_mob("mobs:mese_monster", {
|
||||
collisionbox = {-0.5, -1.5, -0.5, 0.5, 0.5, 0.5},
|
||||
visual = "mesh",
|
||||
mesh = "zmobs_mese_monster.x",
|
||||
textures = {"zmobs_mese_monster.png"},
|
||||
--textures = {"zmobs_mese_monster.png"},
|
||||
available_textures = {
|
||||
total = 1,
|
||||
texture_1 = {"zmobs_mese_monster.png"},
|
||||
},
|
||||
visual_size = {x=1, y=1},
|
||||
makes_footstep_sound = true,
|
||||
view_range = 10,
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
models/mobs_chicken_black.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 948 B |
BIN
models/mobs_dungeon_master2.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
models/mobs_dungeon_master3.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
models/mobs_oerkki2.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
models/mobs_rat2.png
Normal file
After Width: | Height: | Size: 834 B |
@ -8,7 +8,12 @@ mobs:register_mob("mobs:oerkki", {
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_oerkki.x",
|
||||
textures = {"mobs_oerkki.png"},
|
||||
--textures = {"mobs_oerkki.png"},
|
||||
available_textures = {
|
||||
total = 2,
|
||||
texture_1 = {"mobs_oerkki.png"},
|
||||
texture_2 = {"mobs_oerkki2.png"},
|
||||
},
|
||||
visual_size = {x=5, y=5},
|
||||
makes_footstep_sound = false,
|
||||
view_range = 15,
|
||||
@ -44,4 +49,4 @@ mobs:register_mob("mobs:oerkki", {
|
||||
step = 0.5,
|
||||
blood_texture = "mobs_blood.png",
|
||||
})
|
||||
mobs:register_spawn("mobs:oerkki", {"default:stone"}, 2, -1, 7000, 1, -10)
|
||||
mobs:register_spawn("mobs:oerkki", {"default:stone"}, 2, -1, 7000, 1, -10)
|
||||
|
9
rat.lua
@ -8,7 +8,12 @@ mobs:register_mob("mobs:rat", {
|
||||
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.2, 0.2},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_rat.x",
|
||||
textures = {"mobs_rat.png"},
|
||||
--textures = {"mobs_rat.png"},
|
||||
available_textures = {
|
||||
total = 2,
|
||||
texture_1 = {"mobs_rat.png"},
|
||||
texture_2 = {"mobs_rat2.png"},
|
||||
},
|
||||
makes_footstep_sound = false,
|
||||
walk_velocity = 1,
|
||||
armor = 200,
|
||||
@ -59,4 +64,4 @@ minetest.register_craft({
|
||||
output = "mobs:rat_cooked",
|
||||
recipe = "mobs:rat",
|
||||
cooktime = 5,
|
||||
})
|
||||
})
|
||||
|
@ -8,7 +8,11 @@ mobs:register_mob("mobs:sand_monster", {
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_sand_monster.x",
|
||||
textures = {"mobs_sand_monster.png"},
|
||||
--textures = {"mobs_sand_monster.png"},
|
||||
available_textures = {
|
||||
total = 1,
|
||||
texture_1 = {"mobs_sand_monster.png"},
|
||||
},
|
||||
visual_size = {x=8,y=8},
|
||||
makes_footstep_sound = true,
|
||||
view_range = 15,
|
||||
@ -44,4 +48,4 @@ mobs:register_mob("mobs:sand_monster", {
|
||||
step = 0.5,
|
||||
blood_texture = "mobs_blood.png",
|
||||
})
|
||||
mobs:register_spawn("mobs:sand_monster", {"default:desert_sand", "default:sand"}, 20, -1, 7000, 1, 31000)
|
||||
mobs:register_spawn("mobs:sand_monster", {"default:desert_sand", "default:sand"}, 20, -1, 7000, 1, 31000)
|
||||
|
@ -6,7 +6,11 @@ mobs:register_mob("mobs:sheep", {
|
||||
hp_min = 8,
|
||||
hp_max = 10,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
|
||||
textures = {"mobs_sheep.png"},
|
||||
--textures = {"mobs_sheep.png"},
|
||||
available_textures = {
|
||||
total = 1,
|
||||
texture_1 = {"mobs_sheep.png"},
|
||||
},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_sheep.x",
|
||||
makes_footstep_sound = true,
|
||||
|
@ -6,7 +6,11 @@ mobs:register_mob("mobs:spider", {
|
||||
hp_min = 20,
|
||||
hp_max = 40,
|
||||
collisionbox = {-0.9, -0.01, -0.7, 0.7, 0.6, 0.7},
|
||||
textures = {"mobs_spider.png"},
|
||||
--textures = {"mobs_spider.png"},
|
||||
available_textures = {
|
||||
total = 1,
|
||||
texture_1 = {"mobs_spider.png"},
|
||||
},
|
||||
visual_size = {x=7,y=7},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_spider.x",
|
||||
|
@ -8,7 +8,11 @@ mobs:register_mob("mobs:stone_monster", {
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_stone_monster.x",
|
||||
textures = {"mobs_stone_monster.png"},
|
||||
--textures = {"mobs_stone_monster.png"},
|
||||
available_textures = {
|
||||
total = 1,
|
||||
texture_1 = {"mobs_stone_monster.png"},
|
||||
},
|
||||
visual_size = {x=3, y=2.6},
|
||||
makes_footstep_sound = true,
|
||||
view_range = 10,
|
||||
|
BIN
textures/mobs_honey_block.png
Normal file
After Width: | Height: | Size: 272 B |
@ -8,7 +8,11 @@ mobs:register_mob("mobs:tree_monster", {
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_tree_monster.x",
|
||||
textures = {"mobs_tree_monster.png"},
|
||||
--textures = {"mobs_tree_monster.png"},
|
||||
available_textures = {
|
||||
total = 1,
|
||||
texture_1 = {"mobs_tree_monster.png"},
|
||||
},
|
||||
visual_size = {x=4.5,y=4.5},
|
||||
makes_footstep_sound = true,
|
||||
view_range = 15,
|
||||
|
@ -5,7 +5,11 @@ mobs:register_mob("mobs:pumba", {
|
||||
hp_min = 5,
|
||||
hp_max = 15,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
|
||||
textures = {"mobs_pumba.png"},
|
||||
--textures = {"mobs_pumba.png"},
|
||||
available_textures = {
|
||||
total = 1,
|
||||
texture_1 = {"mobs_pumba.png"},
|
||||
},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_pumba.x",
|
||||
makes_footstep_sound = true,
|
||||
|