forked from VoxeLibre/VoxeLibre
Reverse piglin transformation timer + support brute transformation
This commit is contained in:
parent
a61c0922a5
commit
3a4f91f944
|
@ -104,20 +104,17 @@ local piglin = {
|
|||
end,
|
||||
do_custom = function(self, dtime)
|
||||
if self.object:get_pos().y > mcl_vars.mg_overworld_min then
|
||||
if self._zombie_transform_timer == nil then
|
||||
self._zombie_transform_timer = 15
|
||||
elseif self._zombie_transform_timer <= 0 then
|
||||
local zog = minetest.add_entity(self.object:get_pos(), "mobs_mc:zombified_piglin")
|
||||
zog:set_rotation(self.object:get_rotation())
|
||||
mcl_potions.give_effect("nausea", zog, 1, 10)
|
||||
self.object:remove()
|
||||
return
|
||||
else
|
||||
self._zombie_transform_timer = self._zombie_transform_timer - dtime
|
||||
end
|
||||
self._zombie_transform_timer = (self._zombie_transform_timer or 0) + dtime
|
||||
else
|
||||
self._zombie_transform_timer = nil
|
||||
end
|
||||
if self._zombie_transform_timer >= 15 then
|
||||
local zog = minetest.add_entity(self.object:get_pos(), "mobs_mc:zombified_piglin")
|
||||
zog:set_rotation(self.object:get_rotation())
|
||||
mcl_potions.give_effect("nausea", zog, 1, 10)
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
if self.trading == true then
|
||||
self.state = "trading"
|
||||
self.object:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(20,-20,18))
|
||||
|
@ -371,8 +368,19 @@ piglin_brute.xp_max = 20
|
|||
piglin_brute.hp_min = 50
|
||||
piglin_brute.hp_max = 50
|
||||
piglin_brute.fire_resistant = 1
|
||||
piglin_brute.do_custom = function()
|
||||
return
|
||||
piglin_brute.do_custom = function(self, dtime)
|
||||
if self.object:get_pos().y > mcl_vars.mg_overworld_min then
|
||||
self._zombie_transform_timer = (self._zombie_transform_timer or 0) + dtime
|
||||
else
|
||||
self._zombie_transform_timer = nil
|
||||
end
|
||||
if self._zombie_transform_timer >= 15 then
|
||||
local zog = minetest.add_entity(self.object:get_pos(), "mobs_mc:zombified_piglin")
|
||||
zog:set_rotation(self.object:get_rotation())
|
||||
mcl_potions.give_effect("nausea", zog, 1, 10)
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
end
|
||||
piglin_brute.on_spawn = function()
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue