From 2c599c4a0e965d60835f73bc4c13991f031f740c Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 11 Mar 2019 13:25:06 +0100 Subject: [PATCH] Refactor mobs_mc a bit --- mods/ENTITIES/mobs_mc/2_throwing.lua | 4 ++-- mods/ENTITIES/mobs_mc/blaze.lua | 4 ++-- mods/ENTITIES/mobs_mc/ender_dragon.lua | 29 -------------------------- mods/ENTITIES/mobs_mc/ghast.lua | 4 ++-- mods/ENTITIES/mobs_mc/shulker.lua | 4 ++-- mods/ENTITIES/mobs_mc/witch.lua | 4 ++-- 6 files changed, 10 insertions(+), 39 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/2_throwing.lua b/mods/ENTITIES/mobs_mc/2_throwing.lua index 1e4c0a5513..5173b5a96d 100644 --- a/mods/ENTITIES/mobs_mc/2_throwing.lua +++ b/mods/ENTITIES/mobs_mc/2_throwing.lua @@ -195,8 +195,8 @@ if c("egg") then }, nil) end, - hit_mob = function(self, player) - player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, { + hit_mob = function(self, mob) + mob:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, { full_punch_interval = 1.0, damage_groups = {}, }, nil) diff --git a/mods/ENTITIES/mobs_mc/blaze.lua b/mods/ENTITIES/mobs_mc/blaze.lua index c832fb70e8..421a90d4b5 100644 --- a/mods/ENTITIES/mobs_mc/blaze.lua +++ b/mods/ENTITIES/mobs_mc/blaze.lua @@ -87,8 +87,8 @@ mobs:register_arrow("mobs_mc:blaze_fireball", { }, nil) end, - hit_mob = function(self, player) - player:punch(self.object, 1.0, { + hit_mob = function(self, mob) + mob:punch(self.object, 1.0, { full_punch_interval = 1.0, damage_groups = {fleshy = 5}, }, nil) diff --git a/mods/ENTITIES/mobs_mc/ender_dragon.lua b/mods/ENTITIES/mobs_mc/ender_dragon.lua index 06fb82bb73..a06f1c460d 100644 --- a/mods/ENTITIES/mobs_mc/ender_dragon.lua +++ b/mods/ENTITIES/mobs_mc/ender_dragon.lua @@ -4,35 +4,6 @@ local S = minetest.get_translator("mobs_mc") ---[[ -mobs:register_mob("mobs_mc:12enderdragon", { - type = "animal", - passive = true, - runaway = true, - stepheight = 1.2, - hp_min = 30, - hp_max = 60, - armor = 150, - collisionbox = {-0.35, -0.01, -0.35, 0.35, 2, 0.35}, - visual = "mesh", - mesh = "enderdragon.b3d", - textures = { - {"enderdragon.png"}, - }, - visual_size = {x=1, y=1}, - walk_velocity = 0.6, - run_velocity = 2, - jump = true, - animation = { - speed_normal = 25, speed_run = 50, - stand_start = 0, stand_end = 20, - walk_start = 0, walk_end = 20, - run_start = 0, run_end = 20, - }, -}) - -mobs:register_egg("mobs_mc:12enderdragon", "Enderdragon", "enderdragon_inv.png", 0) -]] mobs:register_mob("mobs_mc:enderdragon", { type = "monster", pathfinding = 1, diff --git a/mods/ENTITIES/mobs_mc/ghast.lua b/mods/ENTITIES/mobs_mc/ghast.lua index 44cf34962f..029d517a74 100644 --- a/mods/ENTITIES/mobs_mc/ghast.lua +++ b/mods/ENTITIES/mobs_mc/ghast.lua @@ -94,8 +94,8 @@ mobs:register_arrow(":mobs_monster:fireball", { }, nil) end, - hit_mob = function(self, player) - player:punch(self.object, 1.0, { + hit_mob = function(self, mob) + mob:punch(self.object, 1.0, { full_punch_interval = 1.0, damage_groups = {fleshy = 8}, }, nil) diff --git a/mods/ENTITIES/mobs_mc/shulker.lua b/mods/ENTITIES/mobs_mc/shulker.lua index 0d23a14f5d..9eff2132d7 100644 --- a/mods/ENTITIES/mobs_mc/shulker.lua +++ b/mods/ENTITIES/mobs_mc/shulker.lua @@ -66,8 +66,8 @@ mobs:register_arrow("mobs_mc:shulkerbullet", { }, nil) end, - hit_mob = function(self, player) - player:punch(self.object, 1.0, { + hit_mob = function(self, mob) + mob:punch(self.object, 1.0, { full_punch_interval = 1.0, damage_groups = {fleshy = 4}, }, nil) diff --git a/mods/ENTITIES/mobs_mc/witch.lua b/mods/ENTITIES/mobs_mc/witch.lua index 83e7b7b304..8e8d80252a 100644 --- a/mods/ENTITIES/mobs_mc/witch.lua +++ b/mods/ENTITIES/mobs_mc/witch.lua @@ -87,8 +87,8 @@ mobs:register_arrow(":mobs:potion_arrow", { }, nil) end, - hit_mob = function(self, player) - player:punch(self.object, 1.0, { + hit_mob = function(self, mob) + mob:punch(self.object, 1.0, { full_punch_interval = 1.0, damage_groups = {fleshy = 2}, }, nil)