rebase_mobs_mc #6

Merged
fusselkater merged 3 commits from rebase_mobs_mc into main 2023-01-10 18:05:32 +01:00

View file

@ -9,7 +9,7 @@ local S = minetest.get_translator("mobs_mc")
mcl_mobs:register_mob("mobs_mc:creeper", { mcl_mobs.register_mob("mobs_mc:creeper", {
type = "monster", type = "monster",
spawn_class = "hostile", spawn_class = "hostile",
spawn_in_group = 1, spawn_in_group = 1,
@ -81,7 +81,7 @@ mcl_mobs:register_mob("mobs_mc:creeper", {
if self._forced_explosion_countdown_timer ~= nil then if self._forced_explosion_countdown_timer ~= nil then
self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime
if self._forced_explosion_countdown_timer <= 0 then if self._forced_explosion_countdown_timer <= 0 then
mcl_mobs:boom(self, mcl_util.get_object_center(self.object), self.explosion_strength) self:boom(mcl_util.get_object_center(self.object), self.explosion_strength)
end end
end end
end, end,
@ -133,7 +133,7 @@ mcl_mobs:register_mob("mobs_mc:creeper", {
view_range = 16, view_range = 16,
}) })
mcl_mobs:register_mob("mobs_mc:creeper_charged", { mcl_mobs.register_mob("mobs_mc:creeper_charged", {
description = S("Creeper"), description = S("Creeper"),
type = "monster", type = "monster",
spawn_class = "hostile", spawn_class = "hostile",
@ -203,7 +203,7 @@ mcl_mobs:register_mob("mobs_mc:creeper_charged", {
if self._forced_explosion_countdown_timer ~= nil then if self._forced_explosion_countdown_timer ~= nil then
self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime
if self._forced_explosion_countdown_timer <= 0 then if self._forced_explosion_countdown_timer <= 0 then
mcl_mobs:boom(self, mcl_util.get_object_center(self.object), self.explosion_strength) self:boom(mcl_util.get_object_center(self.object), self.explosion_strength)
end end
end end
end, end,
@ -219,6 +219,10 @@ mcl_mobs:register_mob("mobs_mc:creeper_charged", {
end end
end end
end, end,
on_lightning_strike = function(self, pos, pos2, objects)
mcl_util.replace_mob(self.object, "mobs_mc:creeper_charged")
return true
end,
maxdrops = 2, maxdrops = 2,
drops = { drops = {
{name = "mcl_mobitems:gunpowder", {name = "mcl_mobitems:gunpowder",