2015-09-01 17:15:24 +02:00
|
|
|
|
|
|
|
-- Warthog(Boar) by KrupnoPavel
|
2017-07-25 22:28:40 +02:00
|
|
|
-- 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")
|
|
|
|
|
2015-09-06 03:38:44 +02:00
|
|
|
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,
|
2015-09-06 03:38:44 +02:00
|
|
|
hp_max = 20,
|
2019-09-25 13:43:57 +02:00
|
|
|
breath_max = 5,
|
2015-09-06 03:38:44 +02:00
|
|
|
armor = 200,
|
2015-10-25 02:12:37 +02:00
|
|
|
collisionbox = {-0.5, -1, -0.5, 0.5, 0.1, 0.5},
|
2015-09-06 03:38:44 +02:00
|
|
|
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",
|
2015-09-06 03:38:44 +02:00
|
|
|
attack = "mobs_boar_angry",
|
2019-09-03 20:01:56 +02:00
|
|
|
death = "mobs_boar_angry",
|
2015-09-06 03:38:44 +02:00
|
|
|
distance = 16,
|
|
|
|
},
|
|
|
|
walk_velocity = 2,
|
|
|
|
run_velocity = 3,
|
2016-02-27 20:10:02 +01:00
|
|
|
jump = false,
|
2015-09-06 03:38:44 +02:00
|
|
|
follow = "default:apple",
|
|
|
|
view_range = 10,
|
|
|
|
drops = {
|
|
|
|
{name = "mobs:pork_raw",
|
|
|
|
chance = 1, min = 1, max = 4},
|
|
|
|
},
|
2019-09-25 13:43:57 +02:00
|
|
|
water_damage = 0,
|
2015-09-06 03:38:44 +02:00
|
|
|
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,
|
2015-09-06 03:38:44 +02:00
|
|
|
},
|
2017-05-16 04:48:28 +02:00
|
|
|
|
2015-09-06 03:38:44 +02:00
|
|
|
on_rightclick = function(self, clicker)
|
2017-05-16 04:48:28 +02:00
|
|
|
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
|
|
|
|
2017-05-16 04:48:28 +02:00
|
|
|
-- Raw porkchop
|
|
|
|
|
2017-05-12 04:29:55 +02:00
|
|
|
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 },
|
2017-05-12 04:29:55 +02:00
|
|
|
on_use = minetest.item_eat({hp = 4, sat = 30}),
|
2017-05-16 04:48:28 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
-- Cooked porkchop
|
2015-09-01 17:15:24 +02:00
|
|
|
|
2017-05-12 04:29:55 +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 },
|
2017-05-12 04:29:55 +02:00
|
|
|
on_use = minetest.item_eat({hp = 8, sat = 50}),
|
2017-05-16 04:48:28 +02:00
|
|
|
})
|
2015-09-01 17:15:24 +02:00
|
|
|
|
2017-05-12 04:29:55 +02:00
|
|
|
minetest.register_craft(
|
2015-09-01 17:15:24 +02:00
|
|
|
{
|
|
|
|
type = "cooking",
|
|
|
|
output = "mobs:pork",
|
|
|
|
recipe = "mobs:pork_raw",
|
|
|
|
cooktime = 5,
|
2017-05-16 04:48:28 +02:00
|
|
|
})
|