From c14f2a325c7839a4894a4d87fc7ff826b79b5893 Mon Sep 17 00:00:00 2001 From: WillConker Date: Wed, 5 Jun 2024 20:00:16 +0000 Subject: [PATCH] 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) --- mods/ENTITIES/mobs_mc/hoglin+zoglin.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/hoglin+zoglin.lua b/mods/ENTITIES/mobs_mc/hoglin+zoglin.lua index 08f9a46ad..9b42f662c 100644 --- a/mods/ENTITIES/mobs_mc/hoglin+zoglin.lua +++ b/mods/ENTITIES/mobs_mc/hoglin+zoglin.lua @@ -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 - local zog = minetest.add_entity(self.object:get_pos(), "mobs_mc:zoglin") - zog:set_rotation(self.object:get_rotation()) - self.object:remove() + 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,