Camas/mods/mobs/mob_boar.lua

111 lines
2.2 KiB
Lua
Raw Permalink Normal View History

2015-09-01 17:15:24 +02:00
-- Warthog(Boar) by KrupnoPavel
-- Changed to Boar and tweaked by KaadmY
2015-09-01 17:15:24 +02:00
2019-08-28 17:31:41 +02:00
local S = minetest.get_translator("mobs")
mobs:register_mob(
"mobs:boar",
{
type = "animal",
passive = false,
attack_type = "dogfight",
damage = 2,
2015-10-23 19:34:09 +02:00
hp_min = 16,
hp_max = 20,
breath_max = 5,
armor = 200,
collisionbox = {-0.5, -1, -0.5, 0.5, 0.1, 0.5},
visual = "mesh",
mesh = "mobs_boar.x",
textures = {
{"mobs_boar.png"},
},
makes_footstep_sound = true,
sounds = {
random = "mobs_boar",
2019-09-22 13:39:16 +02:00
damage = "mobs_boar",
attack = "mobs_boar_angry",
2019-09-03 20:01:56 +02:00
death = "mobs_boar_angry",
2021-08-08 14:38:33 +02:00
eat = "mobs_eat",
distance = 16,
},
walk_velocity = 2,
run_velocity = 3,
jump = false,
follow = "default:apple",
view_range = 10,
drops = {
{name = "mobs:pork_raw",
chance = 1, min = 1, max = 4},
},
water_damage = 0,
lava_damage = 5,
light_damage = 0,
animation = {
speed_normal = 20,
stand_start = 0,
stand_end = 60,
walk_start = 61,
walk_end = 80,
punch_start = 90,
2015-10-05 01:29:26 +02:00
punch_end = 101,
},
on_rightclick = function(self, clicker)
mobs:feed_tame(self, clicker, 8, true)
mobs:capture_mob(self, clicker, 0, 5, 40, false, nil)
end,
})
mobs:register_spawn(
"mobs:boar",
{
"default:dirt_with_grass"
},
20,
10,
15000,
1,
31000
)
2015-09-01 17:15:24 +02:00
2019-08-28 17:31:41 +02:00
mobs:register_egg("mobs:boar", S("Boar"), "mobs_boar_inventory.png")
2015-09-01 17:15:24 +02:00
-- Raw porkchop
minetest.register_craftitem(
2015-09-01 17:15:24 +02:00
"mobs:pork_raw",
{
2019-08-28 17:31:41 +02:00
description = S("Raw Porkchop"),
2019-12-05 10:30:46 +01:00
_tt_food = true,
_tt_food_hp = 4,
_tt_food_satiation = 30,
2015-09-01 17:15:24 +02:00
inventory_image = "mobs_pork_raw.png",
2019-08-31 14:06:32 +02:00
groups = { food = 2 },
on_use = minetest.item_eat({hp = 4, sat = 30}),
})
-- Cooked porkchop
2015-09-01 17:15:24 +02:00
minetest.register_craftitem(
2015-09-01 17:15:24 +02:00
"mobs:pork",
{
2019-08-28 17:31:41 +02:00
description = S("Cooked Porkchop"),
2019-12-05 10:30:46 +01:00
_tt_food = true,
_tt_food_hp = 8,
_tt_food_satiation = 50,
2015-09-01 17:15:24 +02:00
inventory_image = "mobs_pork_cooked.png",
2019-08-31 14:06:32 +02:00
groups = { food = 2 },
on_use = minetest.item_eat({hp = 8, sat = 50}),
})
2015-09-01 17:15:24 +02:00
minetest.register_craft(
2015-09-01 17:15:24 +02:00
{
type = "cooking",
output = "mobs:pork",
recipe = "mobs:pork_raw",
cooktime = 5,
})