diff --git a/mods/ENTITIES/mcl_mobs/init.lua b/mods/ENTITIES/mcl_mobs/init.lua index f4322bd31..fb39fa151 100644 --- a/mods/ENTITIES/mcl_mobs/init.lua +++ b/mods/ENTITIES/mcl_mobs/init.lua @@ -362,12 +362,13 @@ function mcl_mobs.register_arrow(name, def) collisionbox = {0, 0, 0, 0, 0, 0}, -- remove box around arrows timer = 0, switch = 0, - _lifetime = def._lifetime or 150, + _lifetime = def._lifetime or 7, owner_id = def.owner_id, rotate = def.rotate, - on_punch = def.on_punch or function(self) - local vel = self.object:get_velocity() - self.object:set_velocity({x=vel.x * -1, y=vel.y * -1, z=vel.z * -1}) + on_punch = def.on_punch or function(self, puncher, time_from_last_punch, tool_capabilities, dir, damage) + local vel = self.object:get_velocity():length() + self.object:set_velocity({x=dir.x * vel, y=dir.y * vel, z=dir.z * vel}) + self._puncher = puncher end, collisionbox = def.collisionbox or {0, 0, 0, 0, 0, 0}, automatic_face_movement_dir = def.rotate @@ -377,7 +378,7 @@ function mcl_mobs.register_arrow(name, def) on_step = def.on_step or function(self, dtime) - self.timer = self.timer + 1 + self.timer = self.timer + dtime local pos = self.object:get_pos() @@ -443,24 +444,24 @@ function mcl_mobs.register_arrow(name, def) if self.hit_player or self.hit_mob or self.hit_object then - for _,player in pairs(minetest.get_objects_inside_radius(pos, 1.5)) do + for _,object in pairs(minetest.get_objects_inside_radius(pos, 1.5)) do if self.hit_player - and player:is_player() then + and object:is_player() then - self.hit_player(self, player) + self.hit_player(self, object) self.object:remove(); return end - local entity = player:get_luaentity() + local entity = object:get_luaentity() if entity and self.hit_mob and entity.is_mob == true - and tostring(player) ~= self.owner_id + and (tostring(object) ~= self.owner_id or self.timer > 2) and entity.name ~= self.object:get_luaentity().name then - self.hit_mob(self, player) + self.hit_mob(self, object) self.object:remove(); return end @@ -468,9 +469,9 @@ function mcl_mobs.register_arrow(name, def) if entity and self.hit_object and (not entity.is_mob) - and tostring(player) ~= self.owner_id + and (tostring(object) ~= self.owner_id or self.timer > 2) and entity.name ~= self.object:get_luaentity().name then - self.hit_object(self, player) + self.hit_object(self, object) self.object:remove(); return end diff --git a/mods/ENTITIES/mobs_mc/ghast.lua b/mods/ENTITIES/mobs_mc/ghast.lua index b0963526e..83277910e 100644 --- a/mods/ENTITIES/mobs_mc/ghast.lua +++ b/mods/ENTITIES/mobs_mc/ghast.lua @@ -20,7 +20,7 @@ mcl_mobs.register_mob("mobs_mc:ghast", { hp_max = 10, xp_min = 5, xp_max = 5, - collisionbox = {-2, 5, -2, 2, 9, 2}, + collisionbox = {-2, 0, -2, 2, 4, 2, rotate=true}, visual = "mesh", mesh = "mobs_mc_ghast.b3d", spawn_in_group = 1, @@ -53,8 +53,8 @@ mcl_mobs.register_mob("mobs_mc:ghast", { view_range = 64, attack_type = "dogshoot", arrow = "mobs_mc:fireball", - shoot_interval = 3, - shoot_offset = -5, + shoot_interval = 5, + shoot_offset = -0.5, dogshoot_switch = 1, dogshoot_count_max =1, passive = false, @@ -109,6 +109,7 @@ mcl_mobs.register_arrow("mobs_mc:fireball", { textures = {"mcl_fire_fire_charge.png"}, velocity = 5, collisionbox = {-.5, -.5, -.5, .5, .5, .5}, + _lifetime = 10, _is_fireball = true, hit_player = function(self, player) @@ -130,6 +131,10 @@ mcl_mobs.register_arrow("mobs_mc:fireball", { damage_groups = {fleshy = 6}, }, nil) mcl_mobs.mob_class.boom(self,self.object:get_pos(), 1, true) + local ent = mob:get_luaentity() + if not ent or ent.health <= 0 then + awards.unlock(self._puncher:get_player_name(), "mcl:fireball_redir_serv") + end end, hit_node = function(self, pos, node) diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_ghast.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_ghast.b3d index cebc037c0..fefc20ecd 100644 Binary files a/mods/ENTITIES/mobs_mc/models/mobs_mc_ghast.b3d and b/mods/ENTITIES/mobs_mc/models/mobs_mc_ghast.b3d differ diff --git a/mods/ENTITIES/mobs_mc/wither.lua b/mods/ENTITIES/mobs_mc/wither.lua index cda3f0153..f1e1e6e78 100644 --- a/mods/ENTITIES/mobs_mc/wither.lua +++ b/mods/ENTITIES/mobs_mc/wither.lua @@ -463,7 +463,7 @@ mcl_mobs.register_arrow("mobs_mc:wither_skull", { }, velocity = 7, rotate = 90, - _lifetime = 350, + _lifetime = 15, on_punch = function(self) end, -- direct hit @@ -516,7 +516,7 @@ mcl_mobs.register_arrow("mobs_mc:wither_skull_strong", { }, velocity = 4, rotate = 90, - _lifetime = 500, + _lifetime = 25, on_punch = function(self) end, -- direct hit diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua index 61ef9a9f2..361a3e659 100755 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -550,6 +550,13 @@ awards.register_achievement("mcl:obsidian", { type = "Advancement", group = "Overworld", }) +awards.register_achievement("mcl:fireball_redir_serv", { + title = S("Fireball Redirection Service"), + description = S("Defeat a ghast with his own weapon."), + icon = "mcl_fire_fire_charge.png", + type = "Advancement", + group = "Nether", +}) awards.register_achievement("mcl:hero_of_the_village", { title = S("Hero of the Village"),