From f41990c1d0ec2dab1a9a0a3b630d47b832750a71 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Sun, 21 Jan 2024 07:15:08 +0100 Subject: [PATCH 1/3] Fixed ghast hitbox --- mods/ENTITIES/mobs_mc/ghast.lua | 2 +- .../ENTITIES/mobs_mc/models/mobs_mc_ghast.b3d | Bin 75657 -> 75657 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/ghast.lua b/mods/ENTITIES/mobs_mc/ghast.lua index b0963526e..0a9a95613 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, diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_ghast.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_ghast.b3d index cebc037c05efdcf2343c4232099b12fffc4c5c89..fefc20ecd2a26a62b7a5d2661193cd19ae8062ed 100644 GIT binary patch delta 22 ecmeA?&(e9GWkML!gaeZ=hKo1mZ_Q_vQU?HXpa~fO delta 22 dcmeA?&(e9GWkMJe1H Date: Thu, 25 Jan 2024 03:50:00 +0100 Subject: [PATCH 2/3] Improved ghast combat * ghast fireballs can now hit the shooter (used to just fly through) * improved ghast aim * increased ghast fireball lifetime * mob projectile lifetime is now counted in seconds (was in ticks) * improved variable naming * improved default mob projectile deflecting (applies to ghast fireball) --- mods/ENTITIES/mcl_mobs/init.lua | 26 +++++++++++++------------- mods/ENTITIES/mobs_mc/ghast.lua | 3 ++- mods/ENTITIES/mobs_mc/wither.lua | 4 ++-- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/init.lua b/mods/ENTITIES/mcl_mobs/init.lua index f4322bd31..15ca47050 100644 --- a/mods/ENTITIES/mcl_mobs/init.lua +++ b/mods/ENTITIES/mcl_mobs/init.lua @@ -362,12 +362,12 @@ 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}) end, collisionbox = def.collisionbox or {0, 0, 0, 0, 0, 0}, automatic_face_movement_dir = def.rotate @@ -377,7 +377,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 +443,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 +468,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 0a9a95613..01e01f079 100644 --- a/mods/ENTITIES/mobs_mc/ghast.lua +++ b/mods/ENTITIES/mobs_mc/ghast.lua @@ -54,7 +54,7 @@ mcl_mobs.register_mob("mobs_mc:ghast", { attack_type = "dogshoot", arrow = "mobs_mc:fireball", shoot_interval = 3, - shoot_offset = -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) 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 From a8ad631864c7468a625a5338bdf513f815f54bc3 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Thu, 25 Jan 2024 14:16:09 +0100 Subject: [PATCH 3/3] Added ghast achievement and nerfed ghast * ghast now attacks less frequently * killing ghast with a ghast fireball now awards an achievement --- mods/ENTITIES/mcl_mobs/init.lua | 1 + mods/ENTITIES/mobs_mc/ghast.lua | 6 +++++- mods/HUD/mcl_achievements/init.lua | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/init.lua b/mods/ENTITIES/mcl_mobs/init.lua index 15ca47050..fb39fa151 100644 --- a/mods/ENTITIES/mcl_mobs/init.lua +++ b/mods/ENTITIES/mcl_mobs/init.lua @@ -368,6 +368,7 @@ function mcl_mobs.register_arrow(name, def) 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 diff --git a/mods/ENTITIES/mobs_mc/ghast.lua b/mods/ENTITIES/mobs_mc/ghast.lua index 01e01f079..83277910e 100644 --- a/mods/ENTITIES/mobs_mc/ghast.lua +++ b/mods/ENTITIES/mobs_mc/ghast.lua @@ -53,7 +53,7 @@ mcl_mobs.register_mob("mobs_mc:ghast", { view_range = 64, attack_type = "dogshoot", arrow = "mobs_mc:fireball", - shoot_interval = 3, + shoot_interval = 5, shoot_offset = -0.5, dogshoot_switch = 1, dogshoot_count_max =1, @@ -131,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/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"),