diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index b7e5cc71..406af2c3 100755 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -593,7 +593,7 @@ function mobs:register_mob(name, def) pos.x = math.floor(pos.x+0.5) pos.y = math.floor(pos.y+0.5) pos.z = math.floor(pos.z+0.5) - do_tnt_physics(pos, 3) -- on applique le principe le la tnt + do_tnt_physics(pos, 3, self) -- on applique le principe le la tnt local meta = minetest.get_meta(pos) minetest.sound_play("tnt_explode", {pos = pos,gain = 1.0,max_hear_distance = 16,}) if minetest.get_node(pos).name == "default:water_source" or minetest.get_node(pos).name == "default:water_flowing" or minetest.is_protected(pos, "tnt") then @@ -1021,7 +1021,7 @@ function check_for_death(self) end end -function do_tnt_physics(tnt_np,tntr) +function do_tnt_physics(tnt_np,tntr,entity) local objs = minetest.get_objects_inside_radius(tnt_np, tntr) for k, obj in pairs(objs) do local oname = obj:get_entity_name() @@ -1031,7 +1031,11 @@ function do_tnt_physics(tnt_np,tntr) obj:setvelocity({x=(p.x - tnt_np.x) + (tntr / 4) + v.x, y=(p.y - tnt_np.y) + (tntr / 2) + v.y, z=(p.z - tnt_np.z) + (tntr / 4) + v.z}) else if obj:get_player_name() ~= nil then - obj:set_hp(obj:get_hp() - 16) -- loose 16 life points when detonate + if entity.object ~= nil then + obj:punch(entity.object, 1.0, {full_punch_interval=1.0,damage_groups = {fleshy=entity.damage}}) + else + obj:set_hp(obj:get_hp() - 21) + end end end end diff --git a/mods/mobs/creeper.lua b/mods/mobs/creeper.lua index 7e7823b7..c4cd74df 100644 --- a/mods/mobs/creeper.lua +++ b/mods/mobs/creeper.lua @@ -7,7 +7,7 @@ mobs:register_mob("mobs:creeper", { -- agressive, does 4 damage to player when hit passive = false, attack_type = "kamicaze", - damage = 0, + damage = 21, -- health & armor hp_min = 40, hp_max = 50, armor = 90, -- textures and model