mobs_mc/polar_bear.lua
2017-05-25 20:39:12 -04:00

126 lines
2.9 KiB
Lua

--MCmobs v0.4
--maikerumine
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### POLARBEAR
--###################
--[[
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)
]]
mobs:register_mob("mobs_mc:polarbear", {
type = "animal",
runaway = false,
stepheight = 1.2,
hp_min = 40,
hp_max = 60,
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},
makes_footstep_sound = true,
damage = 2,
walk_velocity = 1.2,
run_velocity = 2.4,
group_attack = true,
attack_type = "dogfight",
armor = 80,
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 = {
random = "Cowhurt1",
},
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,
},
--[[
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 = "fishing:clownfish_raw","fishing:fish_raw",
view_range = 12,
replace_rate = 10,
replace_what = {"default:grass_3", "default:grass_4", "default:grass_5", "farming:wheat_8"},
replace_with = "air",
})
mobs:register_spawn("mobs_mc:polarbear", {"default:snowblock", "default:snow"}, 20, 8, 7000, 1, 31000)
-- spawn egg
mobs:register_egg("mobs_mc:polarbear", "Polarbear", "polarbear_inv.png", 0)
if minetest.setting_get("log_mods") then
minetest.log("action", "MC Polar Bear loaded")
end