forked from VoxeLibre/VoxeLibre
Fix #3710
Hoglins transform into zoglins after 15 seconds consecutively spent in the overworld. The new zoglin gets the nausea effect for 10 seconds (but no particles appear at the moment because not all effects are properly applied to mobs)
This commit is contained in:
parent
65d6cb1d83
commit
c14f2a325c
|
@ -77,11 +77,20 @@ local hoglin = {
|
|||
}, nil)
|
||||
end
|
||||
end,
|
||||
do_custom = function(self)
|
||||
do_custom = function(self, dtime)
|
||||
if self.object:get_pos().y > -100 then
|
||||
if self._zoglin_transform_timer == nil then
|
||||
self._zoglin_transform_timer = 15
|
||||
elseif self._zoglin_transform_timer <= 0 then
|
||||
local zog = minetest.add_entity(self.object:get_pos(), "mobs_mc:zoglin")
|
||||
zog:set_rotation(self.object:get_rotation())
|
||||
mcl_potions.give_effect("nausea", zog, 1, 10)
|
||||
self.object:remove()
|
||||
else
|
||||
self._zoglin_transform_timer = self._zoglin_transform_timer - dtime
|
||||
end
|
||||
else
|
||||
self._zoglin_transform_timer = nil
|
||||
end
|
||||
end,
|
||||
attack_animals = true,
|
||||
|
|
Loading…
Reference in New Issue