1
0
Fork 0

High pitch for baby monsters

This commit is contained in:
Wuzzy 2019-03-08 23:52:41 +01:00
parent 793357cdfe
commit 9434baf991
4 changed files with 12 additions and 5 deletions

View File

@ -384,8 +384,10 @@ local item_drop = function(self, cooked)
-- no drops if disabled by setting -- no drops if disabled by setting
if not mobs_drop_items then return end if not mobs_drop_items then return end
-- no drops for child mobs -- no drops for child mobs (except monster)
if self.child then return end if (self.child and self.type ~= "monster") then
return
end
local obj, item, num local obj, item, num
local pos = self.object:get_pos() local pos = self.object:get_pos()
@ -740,7 +742,7 @@ local do_jump = function(self)
if not self.jump if not self.jump
or self.jump_height == 0 or self.jump_height == 0
or self.fly or self.fly
or self.child or (self.child and self.type ~= "monster")
or self.order == "stand" then or self.order == "stand" then
return false return false
end end
@ -2546,7 +2548,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
-- attack puncher and call other mobs for help -- attack puncher and call other mobs for help
if self.passive == false if self.passive == false
and self.state ~= "flop" and self.state ~= "flop"
and self.child == false and (self.child == false or self.type == "monster")
and hitter:get_player_name() ~= self.owner and hitter:get_player_name() ~= self.owner
and not mobs.invis[ name ] then and not mobs.invis[ name ] then
@ -3064,7 +3066,6 @@ minetest.register_entity(name, {
pause_timer = 0, pause_timer = 0,
horny = false, horny = false,
hornytimer = 0, hornytimer = 0,
child = false,
gotten = false, gotten = false,
health = 0, health = 0,
reach = def.reach or 3, reach = def.reach or 3,
@ -3101,6 +3102,8 @@ minetest.register_entity(name, {
rain_damage = def.rain_damage or 0, rain_damage = def.rain_damage or 0,
glow = def.glow, glow = def.glow,
can_despawn = can_despawn, can_despawn = can_despawn,
child = def.child or false,
-- End of MCL2 extensions
on_spawn = def.on_spawn, on_spawn = def.on_spawn,

View File

@ -216,6 +216,7 @@ functions needed for the mob to work properly which contains the following:
'spawn_small_alternative': name of a smaller mob to use as replacement if 'spawn_small_alternative': name of a smaller mob to use as replacement if
spawning fails due to space requirements spawning fails due to space requirements
'glow' same as in entity definition 'glow' same as in entity definition
'child' if true, spawn mob as child
Node Replacement Node Replacement
---------------- ----------------

View File

@ -92,6 +92,7 @@ baby_zombie.visual_size = {x=zombie.visual_size.x/2, y=zombie.visual_size.y/2}
baby_zombie.walk_velocity = 1.2 baby_zombie.walk_velocity = 1.2
baby_zombie.run_velocity = 2.4 baby_zombie.run_velocity = 2.4
baby_zombie.sunlight_damage = 0 baby_zombie.sunlight_damage = 0
baby_zombie.child = 1
mobs:register_mob("mobs_mc:baby_zombie", baby_zombie) mobs:register_mob("mobs_mc:baby_zombie", baby_zombie)
@ -113,6 +114,7 @@ baby_husk.collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.94, 0.25}
baby_husk.visual_size = {x=zombie.visual_size.x/2, y=zombie.visual_size.y/2} baby_husk.visual_size = {x=zombie.visual_size.x/2, y=zombie.visual_size.y/2}
baby_husk.walk_velocity = 1.2 baby_husk.walk_velocity = 1.2
baby_husk.run_velocity = 2.4 baby_husk.run_velocity = 2.4
baby_husk.child = 1
mobs:register_mob("mobs_mc:baby_husk", baby_husk) mobs:register_mob("mobs_mc:baby_husk", baby_husk)

View File

@ -96,6 +96,7 @@ baby_pigman.textures = { {
baby_pigman.walk_velocity = 1.2 baby_pigman.walk_velocity = 1.2
baby_pigman.run_velocity = 2.4 baby_pigman.run_velocity = 2.4
baby_pigman.light_damage = 0 baby_pigman.light_damage = 0
baby_pigman.child = 1
mobs:register_mob("mobs_mc:baby_pigman", baby_pigman) mobs:register_mob("mobs_mc:baby_pigman", baby_pigman)