2017-05-23 00:35:56 -04:00
|
|
|
--MCmobs v0.4
|
2017-05-22 22:27:00 -04:00
|
|
|
--maikerumine
|
|
|
|
--made for MC like Survival game
|
|
|
|
--License for code WTFPL and otherwise stated in readmes
|
|
|
|
|
|
|
|
|
|
|
|
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
|
|
|
|
|
|
--###################
|
|
|
|
--################### POLARBEAR
|
|
|
|
--###################
|
2017-05-23 00:35:56 -04:00
|
|
|
--[[
|
2017-05-22 22:27:00 -04:00
|
|
|
mobs:register_mob("mobs_mc:2polarbear", {
|
|
|
|
type = "animal",
|
|
|
|
passive = true,
|
|
|
|
runaway = true,
|
|
|
|
stepheight = 1.2,
|
|
|
|
hp_min = 30,
|
|
|
|
hp_max = 60,
|
|
|
|
armor = 150,
|
|
|
|
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2, 0.35},
|
|
|
|
rotate = -180,
|
|
|
|
visual = "mesh",
|
|
|
|
mesh = "polarbear.b3d",
|
|
|
|
textures = {
|
|
|
|
{"polarbear.png"},
|
|
|
|
},
|
|
|
|
visual_size = {x=3, y=3},
|
|
|
|
walk_velocity = 0.6,
|
|
|
|
run_velocity = 2,
|
|
|
|
jump = true,
|
|
|
|
animation = {
|
|
|
|
speed_normal = 25, speed_run = 50,
|
|
|
|
stand_start = 0, stand_end = 0,
|
|
|
|
walk_start = 0, walk_end = 40,
|
|
|
|
run_start = 0, run_end = 40,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
mobs:register_egg("mobs_mc:2polarbear", "Polarbear", "polarbear_inv.png", 0)
|
2017-05-23 00:35:56 -04:00
|
|
|
]]
|
2017-05-22 22:27:00 -04:00
|
|
|
|
2017-05-23 00:35:56 -04:00
|
|
|
mobs:register_mob("mobs_mc:polarbear", {
|
2017-05-22 22:27:00 -04:00
|
|
|
type = "animal",
|
2017-05-23 00:35:56 -04:00
|
|
|
runaway = true,
|
|
|
|
stepheight = 1.2,
|
|
|
|
hp_min = 30,
|
|
|
|
hp_max = 60,
|
|
|
|
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2, 0.35},
|
|
|
|
rotate = -180,
|
2017-05-22 22:27:00 -04:00
|
|
|
visual = "mesh",
|
2017-05-23 00:35:56 -04:00
|
|
|
mesh = "polarbear.b3d",
|
2017-05-22 22:27:00 -04:00
|
|
|
textures = {
|
2017-05-23 00:35:56 -04:00
|
|
|
{"polarbear.png"},
|
2017-05-22 22:27:00 -04:00
|
|
|
},
|
2017-05-23 00:35:56 -04:00
|
|
|
visual_size = {x=3, y=3},
|
2017-05-22 22:27:00 -04:00
|
|
|
makes_footstep_sound = true,
|
|
|
|
walk_velocity = 1,
|
|
|
|
armor = 200,
|
|
|
|
drops = {
|
|
|
|
{name = "mobs:beef_raw",
|
|
|
|
chance = 1,
|
|
|
|
min = 1,
|
|
|
|
max = 3,},
|
|
|
|
{name = "mobs:leather",
|
|
|
|
chance = 1,
|
|
|
|
min = 0,
|
|
|
|
max = 2,},
|
|
|
|
},
|
|
|
|
drawtype = "front",
|
|
|
|
water_damage = 1,
|
|
|
|
lava_damage = 5,
|
|
|
|
light_damage = 0,
|
|
|
|
fear_height = 3,
|
|
|
|
sounds = {
|
2017-05-23 00:35:56 -04:00
|
|
|
|
2017-05-22 22:27:00 -04:00
|
|
|
},
|
|
|
|
animation = {
|
2017-05-23 00:35:56 -04:00
|
|
|
speed_normal = 25, speed_run = 50,
|
|
|
|
stand_start = 0, stand_end = 0,
|
|
|
|
walk_start = 0, walk_end = 40,
|
|
|
|
run_start = 0, run_end = 40,
|
2017-05-22 22:27:00 -04:00
|
|
|
},
|
|
|
|
--[[
|
|
|
|
follow = "farming:wheat",
|
|
|
|
view_range = 5,
|
|
|
|
on_rightclick = function(self, clicker)
|
|
|
|
local item = clicker:get_wielded_item()
|
|
|
|
if item:get_name() == "bucket:bucket_empty" and clicker:get_inventory() then
|
|
|
|
local inv = clicker:get_inventory()
|
|
|
|
inv:remove_item("main", "bucket:bucket_empty")
|
|
|
|
-- if room add bucket of milk to inventory, otherwise drop as item
|
|
|
|
if inv:room_for_item("main", {name="mobs:bucket_milk"}) then
|
|
|
|
clicker:get_inventory():add_item("main", "mobs:bucket_milk")
|
|
|
|
else
|
|
|
|
local pos = self.object:getpos()
|
|
|
|
pos.y = pos.y + 0.5
|
|
|
|
minetest.add_item(pos, {name = "mobs:bucket_milk"})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
]]
|
|
|
|
--from mobs_animals
|
|
|
|
follow = "farming:wheat",
|
|
|
|
view_range = 7,
|
|
|
|
replace_rate = 10,
|
|
|
|
replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
|
|
|
|
replace_with = "air",
|
|
|
|
fear_height = 2,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
--mobs:register_spawn("mobs_mc:cow", {"default:dirt_with_grass"}, 20, 8, 7000, 1, 31000)
|
|
|
|
|
|
|
|
|
|
|
|
-- spawn egg
|
2017-05-23 00:35:56 -04:00
|
|
|
--mobs:register_egg("mobs_mc:cow", "Cow", "spawn_egg_cow.png")
|
|
|
|
mobs:register_egg("mobs_mc:polarbear", "Polarbear", "polarbear_inv.png", 0)
|
2017-05-22 22:27:00 -04:00
|
|
|
|
|
|
|
if minetest.setting_get("log_mods") then
|
2017-05-23 00:35:56 -04:00
|
|
|
minetest.log("action", "MC Polar Bear loaded")
|
2017-05-22 22:27:00 -04:00
|
|
|
end
|