Merge branch 'master' into typo

This commit is contained in:
maikerumine 2017-06-14 10:39:47 -04:00 committed by GitHub
commit 3d302dd720
7 changed files with 7244 additions and 75 deletions

View File

@ -48,7 +48,9 @@ mobs:register_mob("mobs_mc:rabbit", {
hp_min = 1,
hp_max = 4,
armor = 150,
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
--collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
--collisionbox = {-0.268, -0.5, -0.268, 0.268, 0.167, 0.268},
collisionbox = {-0.268, -0.01, -0.268, 0.268, 0.37, 0.268},
rotate = -180,
visual = "mesh",
mesh = "rabbit.b3d",

View File

@ -43,13 +43,17 @@ mobs:register_egg("mobs_mc:6chicken", "Chicken", "chicken_inv.png", 0)
mobs:register_mob("mobs_mc:chicken", {
type = "animal",
hp_max = 24,
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.69, 0.25},
rotate = -180,
visual = "mesh",
mesh = "chicken.b3d",
textures = {
{"chicken.png"},
},
child_texture = {
{"chicken.png", "chicken.png", "chicken.png", "chicken.png",
"chicken.png", "chicken.png", "chicken.png", "chicken.png", "chicken.png"},
},
visual_size = {x=3, y=3},
makes_footstep_sound = true,
walk_velocity = 1,
@ -85,17 +89,21 @@ mobs:register_mob("mobs_mc:chicken", {
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 8, true, true) then
return
end
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
if mobs:feed_tame(self, clicker, 8, true, true) then return end
if mobs:protect(self, clicker) then return end
if mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) then return end
end,
do_custom = function(self)
do_custom = function(self, dtime)
self.egg_timer = (self.egg_timer or 0) + dtime
if self.egg_timer < 10 then
return
end
self.egg_timer = 0
if self.child
or math.random(1, 5000) > 1 then
or math.random(1, 100) > 1 then
return
end
@ -121,14 +129,14 @@ mobs:register_arrow("mobs_mc:egg_entity", {
velocity = 6,
hit_player = function(self, player)
player:punch(self.object, 1.0, {
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 1},
}, nil)
end,
hit_mob = function(self, player)
player:punch(self.object, 1.0, {
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 1},
}, nil)
@ -136,43 +144,42 @@ mobs:register_arrow("mobs_mc:egg_entity", {
hit_node = function(self, pos, node)
local num = math.random(1, 10)
if num == 1 then
pos.y = pos.y + 1
local nod = minetest.get_node_or_nil(pos)
if not nod
or not minetest.registered_nodes[nod.name]
or minetest.registered_nodes[nod.name].walkable == true then
return
end
local mob = minetest.add_entity(pos, "mobs_mc:chicken")
local ent2 = mob:get_luaentity()
mob:set_properties({
textures = ent2.child_texture[1],
visual_size = {
x = ent2.base_size.x / 2,
y = ent2.base_size.y / 2
},
collisionbox = {
ent2.base_colbox[1] / 2,
ent2.base_colbox[2] / 2,
ent2.base_colbox[3] / 2,
ent2.base_colbox[4] / 2,
ent2.base_colbox[5] / 2,
ent2.base_colbox[6] / 2
},
})
ent2.child = true
ent2.tamed = true
ent2.owner = self.playername
if math.random(1, 10) > 1 then
return
end
pos.y = pos.y + 1
local nod = minetest.get_node_or_nil(pos)
if not nod
or not minetest.registered_nodes[nod.name]
or minetest.registered_nodes[nod.name].walkable == true then
return
end
local mob = minetest.add_entity(pos, "mobs_mc:chicken")
local ent2 = mob:get_luaentity()
mob:set_properties({
textures = ent2.child_texture[1],
visual_size = {
x = ent2.base_size.x / 2,
y = ent2.base_size.y / 2
},
collisionbox = {
ent2.base_colbox[1] / 2,
ent2.base_colbox[2] / 2,
ent2.base_colbox[3] / 2,
ent2.base_colbox[4] / 2,
ent2.base_colbox[5] / 2,
ent2.base_colbox[6] / 2
},
})
ent2.child = true
ent2.tamed = true
ent2.owner = self.playername
end
})

View File

@ -41,7 +41,7 @@ mobs:register_mob("mobs_mc:13enderman", {
mobs:register_egg("mobs_mc:13enderman", "Enderman", "enderman_inv.png", 0)
]]
mobs:register_mob("mobs_mc:enderman", {
mobs:register_mob("mobs_mc:ender_man", {
type = "monster",
runaway = true,
pathfinding = 2,
@ -109,14 +109,16 @@ minetest.register_craft({
}
})
-- compatibility
mobs:alias_mob("mobs_mc:enderman", "mobs_mc:ender_man")
--spawn
mobs:register_spawn("mobs_mc:enderman", { "default:sand", "default:desert_sand"}, 7, -1, 5000, 4, 31000)
mobs:register_spawn("mobs_mc:ender_man", { "default:sand", "default:desert_sand"}, 7, -1, 9000, 1, 31000)
mobs:register_spawn("mobs_mc:ender_man", { "default:end_stone"}, 7, -1, 5000, 5, -5000)
-- spawn eggs
mobs:register_egg("mobs_mc:enderman", "Enderman", "enderman_inv.png", 0)
mobs:register_egg("mobs_mc:ender_man", "Ender man", "enderman_inv.png", 0)
if minetest.setting_get("log_mods") then
minetest.log("action", "MC Enderman loaded")
minetest.log("action", "MC Ender man loaded")
end

7050
models/mobs_sheep.x Normal file

File diff suppressed because it is too large Load Diff

View File

@ -40,14 +40,15 @@ mobs:register_mob("mobs_mc:2polarbear", {
mobs:register_egg("mobs_mc:2polarbear", "Polarbear", "polarbear_inv.png", 0)
]]
mobs:register_mob("mobs_mc:polarbear", {
mobs:register_mob("mobs_mc:polar_bear", {
type = "animal",
runaway = false,
passive = false,
stepheight = 1.2,
hp_min = 20,
hp_max = 30,
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2, 0.35},
--collisionbox = {-0.35, -0.01, -0.35, 0.35, 2, 0.35},
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.09, 0.45},
rotate = -180,
visual = "mesh",
mesh = "polarbear.b3d",
@ -116,12 +117,20 @@ mobs:register_mob("mobs_mc:polarbear", {
})
mobs:register_spawn("mobs_mc:polarbear", {"default:snowblock"}, 20, 8, 17000, 3, 31000)
-- compatibility
mobs:alias_mob("mobs_mc:polarbear", "mobs_mc:polar_bear")
mobs:register_spawn("mobs_mc:polar_bear", {"default:snowblock"}, 20, 8, 17000, 3, 31000)
-- spawn egg
mobs:register_egg("mobs_mc:polarbear", "Polar Bear", "polarbear_inv.png", 0)
mobs:register_egg("mobs_mc:polar_bear", "Polar bear", "polarbear_inv.png", 0)
if minetest.setting_get("log_mods") then
minetest.log("action", "MC Polar Bear loaded")

135
sheep.lua
View File

@ -42,25 +42,48 @@ mobs:register_mob("mobs_mc:24sheep", {
mobs:register_egg("mobs_mc:24sheep", "Sheep", "sheep_inv.png", 0)
]]
local colors = {
-- dyecolor = { woolcolor, textures }
white = { "white", { "mobs_sheep.png" } },
brown = { "brown", { "mobs_sheep_brown.png" } },
grey = { "silver", { "mobs_sheep_grey.png" } },
dark_grey = { "grey", { "mobs_sheep_dark_grey.png" } },
blue = { "blue", { "mobs_sheep_blue.png" } },
lightblue = { "light_blue", { "mobs_sheep_lightblue.png" } },
dark_green = { "green", { "mobs_sheep_dark_green.png" } },
green = { "lime", { "mobs_sheep_green.png" } },
violet = { "purple", { "mobs_sheep_violet.png" } },
pink = { "pink", { "mobs_sheep_pink.png" } },
yellow = { "yellow", { "mobs_sheep_yellow.png" } },
orange = { "orange", { "mobs_sheep_orange.png" } },
red = { "red", { "mobs_sheep_red.png" } },
cyan = { "cyan", { "mobs_sheep_cyan.png" } },
magenta = { "magenta", { "mobs_sheep_magenta.png" } },
black = { "black", { "mobs_sheep_black.png" } },
}
--mcsheep
mobs:register_mob("mobs_mc:sheep", {
type = "animal",
hp_max = 25,
collisionbox = {-0.5, -0.01, -0.5, 0.5, 1.5, 0.5},
--collisionbox = {-0.5, -1, -0.5, 0.5, 0.3, 0.5},
rotate = -180,
hp_min = 8,
hp_max = 8,
-- FIXME: Should be 1.3 blocks high
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.09, 0.45},
visual = "mesh",
mesh = "sheep.b3d",
visual_size = {x=0.6, y=0.6},
--mesh = "sheep.b3d",
mesh = "mobs_sheep.x",
textures = {
{"sheep.png"},
{"mobs_sheep.png"},--was sheep
},
gotten_texture = {"sheeps.png"},
gotten_mesh = "sheeps.b3d",
visual_size = {x=3, y=3},
--gotten_texture = {"sheeps.png"},
--gotten_mesh = "sheeps.b3d",
--visual_size = {x=3, y=3},
makes_footstep_sound = true,
walk_velocity = 1,
armor = 200,
--[[
drops = {
{name = "mobs:mutton_raw",
chance = 1,
@ -71,6 +94,7 @@ mobs:register_mob("mobs_mc:sheep", {
min = 1,
max = 1,},
},
]]
drawtype = "front",
water_damage = 1,
lava_damage = 5,
@ -82,14 +106,88 @@ mobs:register_mob("mobs_mc:sheep", {
damage = "Sheep3",
},
animation = {
speed_normal = 25, speed_run = 50,
stand_start = 40, stand_end = 80,
walk_start = 0, walk_end = 40,
run_start = 0, run_end = 40,
speed_normal = 24,
stand_start = 0,
stand_end = 23,
walk_start = 24,
walk_end = 49,
hurt_start = 118,
hurt_end = 154,
death_start = 154,
death_end = 179,
eat_start = 49,
eat_end = 78,
look_start = 78,
look_end = 108,
},
follow = "farming:wheat",
view_range = 5,
replace_rate = 10,
replace_what = "default:dirt_with_grass",
replace_with = "default:dirt",
--Wuzzy code for color keep
do_custom = function(self)
if not self.initial_color_set then
local r = math.random(0,100000)
local textures
if r <= 81836 then
-- 81.836%
self.color = colors["white"][1]
textures = colors["white"][2]
self.base_texture = colors["white"][2]
elseif r <= 81836 + 5000 then
-- 5%
self.color = colors["grey"][1]
textures = colors["grey"][2]
self.base_texture = colors["grey"][2]
elseif r <= 81836 + 5000 + 5000 then
-- 5%
self.color = colors["dark_grey"][1]
textures = colors["dark_grey"][2]
self.base_texture = colors["dark_grey"][2]
elseif r <= 81836 + 5000 + 5000 + 5000 then
-- 5%
self.color = colors["black"][1]
textures = colors["black"][2]
self.base_texture = colors["black"][2]
elseif r <= 81836 + 5000 + 5000 + 5000 + 3000 then
-- 3%
self.color = colors["brown"][1]
textures = colors["brown"][2]
self.base_texture = colors["brown"][2]
else
-- 0.164%
self.color = colors["pink"][1]
textures = colors["pink"][2]
self.base_texture = colors["pink"][2]
end
self.textures = { textures },
self.object:set_properties({ textures = textures })
self.drops = {
{name = "mcl_mobitems:mutton",
chance = 1,
min = 1,
max = 2,},
{name = "mcl_wool:"..self.color,
chance = 1,
min = 1,
max = 1,},
{name = "mobs:mutton",
chance = 1,
min = 1,
max = 2,},
{name = "wool:"..self.color,
chance = 1,
min = 1,
max = 1,},
}
self.initial_color_set = true
end
end,
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
if item:get_name() == "farming:wheat" then
@ -109,7 +207,7 @@ mobs:register_mob("mobs_mc:sheep", {
self.food = 0
self.naked = false
self.object:set_properties({
textures = {"sheep.png"},
textures = {"mobs_sheep_"..pname..".png"}, --was sheep.png
})
end
end
@ -126,8 +224,9 @@ mobs:register_mob("mobs_mc:sheep", {
minetest.add_item(pos, ItemStack("wool:"..self.color.." "..math.random(1,3)))
end
self.object:set_properties({
textures = {"sheeps.png"},
mesh = "sheeps.b3d",
textures = {"mobs_sheep_sheared.png"},
--textures = {"sheeps.png"},
--mesh = "sheeps.b3d",
})
if not minetest.setting_getbool("creative_mode") then
item:add_wear(300)
@ -135,13 +234,13 @@ mobs:register_mob("mobs_mc:sheep", {
end
end
if minetest.get_item_group(item:get_name(), "dye") == 1 and not self.naked then
print(item:get_name(), minetest.get_item_group(item:get_name(), "dye"))
print(item:get_name(), minetest.get_item_group(item:get_name(), "dye"))
local name = item:get_name()
local pname = name:split(":")[2]
self.object:set_properties({
textures = {"mobs_sheep_"..pname..".png"},
mesh = "sheeps.b3d",
--mesh = "sheeps.b3d",
})
self.color = pname
self.drops = {

View File

@ -69,7 +69,7 @@ local zombie = {
fear_height = 8,
pathfinding = 1,
jump = true,
jump_height = 3,
--jump_height = 3,
group_attack = true,
drops = {
{name = "mobs:rotten_flesh",