Skip to content
Snippets Groups Projects
Commit 5687ef41 authored by Milan's avatar Milan
Browse files

fix mergeconflict

parents d1f5d5dd 977a16f7
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ mobs:register_mob("mobs_animal:bee", {
walk_end = 65,
},
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, 25, 80, 0, true, nil)
mobs:capture_mob(self, clicker, 50, 90, 0, true, "mobs_animal:bee")
end,
})
......@@ -87,6 +87,15 @@ mobs:register_mob("mobs_animal:bee_angry", {
mobs:register_spawn("mobs_animal:bee", {"group:flower"}, 20, 10, 9000, 2, 31000, true)
mobs:spawn({
name = "mobs_animal:bee",
nodes = {"group:flower"},
min_light = 10,
chance = 9000,
min_height = 0,
day_toggle = true,
})
mobs:register_egg("mobs_animal:bee", S("Bee"), "mobs_bee_inv.png", 0)
mobs:register_egg("mobs_animal:bee_angry", S("Angry Bee"), "mobs_bee_inv.png", 0)
......@@ -109,7 +118,6 @@ minetest.register_craftitem(":mobs:pollen", {
minetest.register_node(":mobs:beehive", {
description = S("Beehive"),
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"mobs_beehive.png"},
inventory_image = "mobs_beehive.png",
paramtype = "light",
......@@ -142,6 +150,18 @@ minetest.register_node(":mobs:beehive", {
minetest.add_entity(pos, "mobs_animal:bee_angry")
minetest.add_entity(pos, "mobs_animal:bee_angry")
end
end,
after_place_node = function(pos, placer, itemstack)
if placer:is_player() then
minetest.set_node(pos, {name = "mobs:beehive", param2 = 1})
if math.random(1, 4) == 1 then
minetest.add_entity(pos, "mobs_animal:bee")
end
end
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
......@@ -221,7 +241,7 @@ minetest.register_abm({
-- is hive full?
local meta = minetest.get_meta(pos)
if not meta then return end -- for older beehives
local inv = minetest.get_meta(pos):get_inventory()
local inv = meta:get_inventory()
local honey = inv:get_stack("beehive", 1):get_count()
-- is hive full?
......
local S = mobs.intllib
-- Bunny by ExeterDad
mobs:register_mob("mobs_animal:bunny", {
......@@ -68,11 +69,12 @@ mobs:register_mob("mobs_animal:bunny", {
})
self.type = "monster"
self.object:set_hp(20)
self.health = 20
return
end
mobs:protect(self, clicker)
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
end,
......@@ -80,10 +82,24 @@ mobs:register_mob("mobs_animal:bunny", {
damage = 5,
})
mobs:register_spawn("mobs_animal:bunny",
{"default:dirt_with_grass", "ethereal:prairie_dirt"}, 20, 10, 15000, 2, 31000, true)
local spawn_on = "default:dirt_with_grass"
if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:prairie_dirt"
end
mobs:spawn({
name = "mobs_animal:bunny",
nodes = {spawn_on},
min_light = 10,
chance = 15000,
min_height = 0,
day_toggle = true,
})
mobs:register_egg("mobs_animal:bunny", S("Bunny"), "mobs_bunny_inv.png", 0)
-- compatibility
mobs:alias_mob("mobs:bunny", "mobs_animal:bunny")
mobs:alias_mob("mobs:bunny", "mobs_animal:bunny") -- compatibility
local S = mobs.intllib
-- Chicken by JK Murray
mobs:register_mob("mobs_animal:chicken", {
......@@ -56,6 +57,7 @@ mobs:register_mob("mobs_animal:chicken", {
return
end
mobs:protect(self, clicker)
mobs:capture_mob(self, clicker, 30, 50, 80, false, nil)
end,
......@@ -78,22 +80,29 @@ mobs:register_mob("mobs_animal:chicken", {
end,
})
--mobs:register_spawn("mobs_animal:chicken",
-- {"default:dirt_with_grass", "ethereal:bamboo_dirt"}, 20, 10, 15000, 2, 31000, true)
local spawn_on = "default:dirt_with_grass"
if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:bamboo_dirt"
end
mobs:spawn({
name = "mobs_animal:chicken",
nodes = {"default:dirt_with_grass", "ethereal:bamboo_dirt"},
interval = 1,
chance = 5000,
nodes = {spawn_on},
min_light = 10,
chance = 15000,
active_object_count = 2,
min_height = 0,
day_toggle = true,
})
mobs:register_egg("mobs_animal:chicken", S("Chicken"), "mobs_chicken_inv.png", 0)
-- compatibility
mobs:alias_mob("mobs:chicken", "mobs_animal:chicken")
mobs:alias_mob("mobs:chicken", "mobs_animal:chicken") -- compatibility
-- egg entity
......@@ -159,6 +168,7 @@ mobs:register_arrow("mobs_animal:egg_entity", {
end
})
-- egg throwing item
local egg_GRAVITY = 9
......@@ -208,6 +218,7 @@ local mobs_shoot_egg = function (item, player, pointed_thing)
return item
end
-- egg
minetest.register_node(":mobs:egg", {
description = S("Chicken Egg"),
......@@ -233,6 +244,7 @@ minetest.register_node(":mobs:egg", {
on_use = mobs_shoot_egg
})
-- fried egg
minetest.register_craftitem(":mobs:chicken_egg_fried", {
description = S("Fried Egg"),
......
local S = mobs.intllib
-- Cow by Krupnovpavel (additional texture by JurajVajda)
mobs:register_mob("mobs_animal:cow", {
......@@ -48,7 +49,11 @@ mobs:register_mob("mobs_animal:cow", {
follow = "farming:wheat",
view_range = 7,
replace_rate = 10,
replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
-- replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
replace_what = {
{"group:grass", "air", 0},
{"default:dirt_with_grass", "default:dirt", -1}
},
replace_with = "air",
fear_height = 2,
on_rightclick = function(self, clicker)
......@@ -59,6 +64,7 @@ mobs:register_mob("mobs_animal:cow", {
end
local tool = clicker:get_wielded_item()
local name = clicker:get_player_name()
-- milk cow with empty bucket
if tool:get_name() == "bucket:bucket_empty" then
......@@ -69,8 +75,8 @@ mobs:register_mob("mobs_animal:cow", {
end
if self.gotten == true then
minetest.chat_send_player(clicker:get_player_name(),
S("Cow already milked!"))
minetest.chat_send_player(name,
S("Cow already milked!"))
return
end
......@@ -91,17 +97,34 @@ mobs:register_mob("mobs_animal:cow", {
return
end
mobs:protect(self, clicker)
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end,
})
mobs:register_spawn("mobs_animal:cow",
{"default:dirt_with_grass", "ethereal:green_dirt"}, 20, 10, 15000, 3, 31000, true)
local spawn_on = "default:dirt_with_grass"
if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:green_dirt"
end
mobs:spawn({
name = "mobs_animal:cow",
nodes = {spawn_on},
min_light = 10,
chance = 15000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
mobs:register_egg("mobs_animal:cow", S("Cow"), "default_grass.png", 1)
-- compatibility
mobs:alias_mob("mobs:cow", "mobs_animal:cow")
mobs:alias_mob("mobs:cow", "mobs_animal:cow") -- compatibility
-- bucket of milk
minetest.register_craftitem(":mobs:bucket_milk", {
......
default
mobs
intllib?
lucky_block?
......@@ -20,5 +20,8 @@ dofile(path .. "/warthog.lua") -- KrupnoPavel
dofile(path .. "/bee.lua") -- KrupnoPavel
dofile(path .. "/bunny.lua") -- ExeterDad
dofile(path .. "/kitten.lua") -- Jordach/BFD
dofile(path .. "/penguin.lua") -- D00Med
dofile(path .. "/lucky_block.lua")
print (S("[MOD] Mobs Redo 'Animals' loaded"))
local S = mobs.intllib
-- Kitten by Jordach / BFD
mobs:register_mob("mobs_animal:kitten", {
......@@ -48,14 +49,24 @@ mobs:register_mob("mobs_animal:kitten", {
return
end
mobs:protect(self, clicker)
mobs:capture_mob(self, clicker, 50, 50, 90, false, nil)
end
})
mobs:register_spawn("mobs_animal:kitten",
{"default:dirt_with_grass", "ethereal:grove_dirt"}, 20, 12, 22000, 2, 31000, true)
mobs:spawn({
name = "mobs_animal:kitten",
nodes = {"default:dirt_with_grass", "ethereal:grove_dirt"},
min_light = 12,
chance = 22000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
mobs:register_egg("mobs_animal:kitten", S("Kitten"), "mobs_kitten_inv.png", 0)
-- compatibility
mobs:alias_mob("mobs:kitten", "mobs_animal:kitten")
mobs:alias_mob("mobs:kitten", "mobs_animal:kitten") -- compatibility
if minetest.get_modpath("lucky_block") then
lucky_block:add_blocks({
{"spw", "mobs:sheep", 5},
{"spw", "mobs:rat", 5},
{"dro", {"mobs:rat_cooked"}, 5},
{"spw", "mobs:bunny", 3},
{"nod", "mobs:honey_block", 0},
{"spw", "mobs:pumba", 5},
{"nod", "mobs:cheeseblock", 0},
{"spw", "mobs:chicken", 5},
{"dro", {"mobs:egg"}, 5},
{"spw", "mobs:cow", 5},
{"dro", {"mobs:bucket_milk"}, 8},
{"spw", "mobs:kitten", 2},
{"tro", "default:nyancat", "mobs_kitten", true},
{"exp"},
})
end
File added
local S = mobs.intllib
-- Penguin by D00Med
mobs:register_mob("mobs_animal:penguin", {
type = "animal",
passive = true,
reach = 1,
hp_min = 5,
hp_max = 10,
armor = 200,
collisionbox = {-0.2, -0.0, -0.2, 0.2, 0.5, 0.2},
visual = "mesh",
mesh = "mobs_penguin.b3d",
visual_size = {x = 0.25, y = 0.25},
textures = {
{"mobs_penguin.png"},
},
sounds = {},
makes_footstep_sound = true,
walk_velocity = 1,
run_velocity = 2,
runaway = true,
jump = false,
stepheight = 1.1,
drops = {
{name = "mobs:meat_raw", chance = 1, min = 1, max = 1},
},
water_damage = 0,
lava_damage = 4,
light_damage = 0,
fear_height = 2,
animation = {
speed_normal = 15,
stand_start = 1,
stand_end = 20,
walk_start = 25,
walk_end = 45,
fly_start = 75, -- swim animation
fly_end = 95,
-- 50-70 is slide/water idle
},
fly_in = "default:water_source",
floats = 0,
follow = {"ethereal:fish_raw"},
view_range = 5,
on_rightclick = function(self, clicker)
-- feed or tame
if mobs:feed_tame(self, clicker, 4, false, true) then
return
end
mobs:protect(self, clicker)
mobs:capture_mob(self, clicker, 5, 50, 80, false, nil)
end,
})
mobs:spawn({
name = "mobs_animal:penguin",
nodes = {"default:snowblock"},
min_light = 10,
chance = 20000,
min_height = 0,
day_toggle = true,
})
mobs:register_egg("mobs_animal:penguin", S("Penguin"), "default_snow.png", 1)
local S = mobs.intllib
-- Rat by PilzAdam
mobs:register_mob("mobs_animal:rat", {
......@@ -29,7 +30,7 @@ mobs:register_mob("mobs_animal:rat", {
light_damage = 0,
fear_height = 2,
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, 25, 80, 0, true, nil)
mobs:capture_mob(self, clicker, 50, 90, 0, true, "mobs_animal:rat")
end,
--[[
do_custom = function(self, dtime)
......@@ -57,23 +58,29 @@ mobs:register_mob("mobs_animal:rat", {
]]
})
--mobs:register_spawn("mobs_animal:rat", {"default:stone"}, 20, 5, 15000, 2, 0)
local function rat_spawn(self, pos)
print (self:get_luaentity().name, pos.x, pos.y, pos.z)
self = self:get_luaentity()
print (self.name, pos.x, pos.y, pos.z)
self.hp_max = 100
self.health = 100
end
mobs:spawn({
name = "mobs_animal:rat",
nodes = {"default:stone"},
min_light = 3,
active_object_count = 2,
max_height = 0,
-- on_spawn = rat_spawn,
})
mobs:register_egg("mobs_animal:rat", S("Rat"), "mobs_rat_inventory.png", 0)
-- compatibility
mobs:alias_mob("mobs:rat", "mobs_animal:rat")
mobs:alias_mob("mobs:rat", "mobs_animal:rat") -- compatibility
-- cooked rat, yummy!
minetest.register_craftitem(":mobs:rat_cooked", {
......
......@@ -33,4 +33,10 @@ Warthog
- Warthogs unlike pigs defend themselves when hit and give 1-3 raw pork when killed, they can also be right-clicked with 8x apples to tame or breed.
Penguin
- These little guys can be found in glacier biomes on top of snow and have the ability to swim if they fall into water.
Note: After breeding animals need to rest for 4 minutes, baby animals take 4 minutes to grow up and feeding them helps them grow quicker...
Lucky Blocks: 14
local S = mobs.intllib
local all_colours = {
{"black", S("Black"), "#000000b0"},
{"blue", S("Blue"), "#015dbb70"},
......@@ -19,9 +20,10 @@ local all_colours = {
{"yellow", S("Yellow"), "#e3ff0070"},
}
-- Sheep by PilzAdam, texture converted to minetest by AMMOnym from Summerfield pack
for _, col in pairs(all_colours) do
for _, col in ipairs(all_colours) do
mobs:register_mob("mobs_animal:sheep_"..col[1], {
type = "animal",
......@@ -165,6 +167,9 @@ for _, col in pairs(all_colours) do
return
end
-- protect mod with mobs:protector item
mobs:protect(self, clicker)
--are we capturing?
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end
......@@ -177,9 +182,22 @@ for _, col in pairs(all_colours) do
end
mobs:register_spawn("mobs_animal:sheep_white",
{"default:dirt_with_grass", "ethereal:green_dirt"}, 20, 10, 15000, 3, 31000, true)
local spawn_on = "default:dirt_with_grass"
if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:green_dirt"
end
mobs:spawn({
name = "mobs_animal:sheep_white",
nodes = {spawn_on},
min_light = 10,
chance = 15000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
-- compatibility
mobs:alias_mob("mobs:sheep", "mobs_animal:sheep_white")
mobs:alias_mob("mobs:sheep", "mobs_animal:sheep_white") -- compatibility
textures/mobs_penguin.png

892 B

local S = mobs.intllib
-- Warthog by KrupnoPavel
mobs:register_mob("mobs_animal:pumba", {
......@@ -51,17 +52,34 @@ mobs:register_mob("mobs_animal:pumba", {
return
end
mobs:protect(self, clicker)
mobs:capture_mob(self, clicker, 0, 5, 50, false, nil)
end,
})
mobs:register_spawn("mobs_animal:pumba",
{"ethereal:mushroom_dirt", "default:dirt_with_dry_grass"}, 20, 10, 15000, 3, 31000, true)
local spawn_on = "default:dirt_with_grass"
if minetest.get_modpath("ethereal") then
spawn_on = "ethereal:mushroom_dirt"
end
mobs:spawn({
name = "mobs_animal:pumba",
nodes = {spawn_on},
min_light = 10,
chance = 15000,
min_height = 0,
max_height = 31000,
day_toggle = true,
})
mobs:register_egg("mobs_animal:pumba", S("Warthog"), "wool_pink.png", 1)
-- compatibility
mobs:alias_mob("mobs:pumba", "mobs_animal:pumba")
mobs:alias_mob("mobs:pumba", "mobs_animal:pumba") -- compatibility
-- raw porkchop
minetest.register_craftitem(":mobs:pork_raw", {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment