Merge pull request #10 from taikedz/baddies

Baddies use API to despawn; also keep pig
master
D00Med 2016-10-02 05:54:46 +10:00 committed by GitHub
commit 8b68519a27
2 changed files with 17 additions and 16 deletions

View File

@ -1,11 +1,9 @@
-- Fox local pigdef = {
if dmobs.destructive then
mobs:register_mob("dmobs:pig_evil", {
type = "monster", type = "monster",
passive = true, passive = true,
reach = 3, reach = 3,
damage = 2, damage = 2,
attack_type = "explode", attack_type = "dogfight",
explosion_radius = 2, explosion_radius = 2,
hp_min = 12, hp_min = 12,
hp_max = 22, hp_max = 22,
@ -16,10 +14,10 @@ mobs:register_mob("dmobs:pig_evil", {
textures = { textures = {
{"dmobs_flying_pig_mean.png"}, {"dmobs_flying_pig_mean.png"},
}, },
jump = true, jump = true,
fly = true, fly = true,
fall_speed = 0, fall_speed = 0,
stepheight = 1.5, stepheight = 1.5,
blood_texture = "mobs_blood.png", blood_texture = "mobs_blood.png",
visual_size = {x=1, y=1}, visual_size = {x=1, y=1},
makes_footstep_sound = true, makes_footstep_sound = true,
@ -32,8 +30,7 @@ mobs:register_mob("dmobs:pig_evil", {
{name = "mobs:meat_raw", chance = 2, min = 1, max = 1}, {name = "mobs:meat_raw", chance = 2, min = 1, max = 1},
}, },
sounds = { sounds = {
random = "mobs_pig", random = "mobs_pig",
explode = "tnt_explode",
}, },
do_custom = function(self) do_custom = function(self)
if self.state == "attack" then if self.state == "attack" then
@ -65,12 +62,18 @@ mobs:register_mob("dmobs:pig_evil", {
mobs:capture_mob(self, clicker, 0, 5, 50, false, nil) mobs:capture_mob(self, clicker, 0, 5, 50, false, nil)
end, end,
}) }
if dmobs.destructive then
pigdef.sounds.explode = "tnt_explode"
pigdef.attack_type = "explode"
end
mobs:register_mob("dmobs:pig_evil", pigdef)
mobs:register_spawn("dmobs:pig_evil", {"default:pine_needles","default:leaves"}, 20, 10, 32000, 2, 31000) mobs:register_spawn("dmobs:pig_evil", {"default:pine_needles","default:leaves"}, 20, 10, 32000, 2, 31000)
mobs:register_egg("dmobs:pig_evil", "kamikaze Pig", "wool_pink.png", 1) mobs:register_egg("dmobs:pig_evil", "kamikaze Pig", "wool_pink.png", 1)
end
-- Fox -- Fox
mobs:register_mob("dmobs:fox", { mobs:register_mob("dmobs:fox", {

View File

@ -12,11 +12,9 @@ dmobs.dragons = true
-- Enable fireballs/explosions -- Enable fireballs/explosions
dmobs.destructive = false dmobs.destructive = false
--peaceful mobs setting -- load baddies
if not minetest.setting_getbool("only_peaceful_mobs") then dofile(minetest.get_modpath("dmobs").."/baddies.lua")
dofile(minetest.get_modpath("dmobs").."/baddies.lua")
end
--friendly mobs --friendly mobs