Fix ghasts horrible collisionbox

This commit is contained in:
jordan4ibanez 2021-04-22 22:40:16 -04:00
parent 0a8fff6524
commit 5037ec3736
2 changed files with 27 additions and 15 deletions

View File

@ -529,9 +529,12 @@ function mobs:register_arrow(name, def)
if self.hit_player if self.hit_player
and player:is_player() then and player:is_player() then
mobs.arrow_hit(self, player) if self.hit_player then
self.hit_player(self, player)
else
mobs.arrow_hit(self, player)
end
print("wow everything is fucked")
self.object:remove(); self.object:remove();
return return
end end

View File

@ -13,13 +13,15 @@ local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:ghast", { mobs:register_mob("mobs_mc:ghast", {
type = "monster", type = "monster",
spawn_class = "hostile", spawn_class = "hostile",
pathfinding = 1,
group_attack = true, group_attack = true,
hostile = true,
hp_min = 10, hp_min = 10,
hp_max = 10, hp_max = 10,
xp_min = 5, xp_min = 5,
xp_max = 5, xp_max = 5,
collisionbox = {-2, 5, -2, 2, 9, 2}, reach = 60,
eye_height = 3,
collisionbox = {-2, 0, -2, 2, 4, 2},
visual = "mesh", visual = "mesh",
mesh = "mobs_mc_ghast.b3d", mesh = "mobs_mc_ghast.b3d",
textures = { textures = {
@ -35,8 +37,10 @@ mobs:register_mob("mobs_mc:ghast", {
-- TODO: damage -- TODO: damage
-- TODO: better death -- TODO: better death
}, },
walk_velocity = 1.6, walk_velocity = 1.6,
run_velocity = 3.2, run_velocity = 3.2,
drops = { drops = {
{name = mobs_mc.items.gunpowder, chance = 1, min = 0, max = 2, looting = "common"}, {name = mobs_mc.items.gunpowder, chance = 1, min = 0, max = 2, looting = "common"},
{name = mobs_mc.items.ghast_tear, chance = 10/6, min = 0, max = 1, looting = "common", looting_ignore_chance = true}, {name = mobs_mc.items.ghast_tear, chance = 10/6, min = 0, max = 1, looting = "common", looting_ignore_chance = true},
@ -47,22 +51,21 @@ mobs:register_mob("mobs_mc:ghast", {
walk_start = 0, walk_end = 40, walk_start = 0, walk_end = 40,
run_start = 0, run_end = 40, run_start = 0, run_end = 40,
}, },
fall_damage = 0, fall_damage = 0,
view_range = 100, view_range = 100,
attack_type = "projectile", attack_type = "projectile",
arrow = "mobs_mc:fireball", arrow = "mobs_mc:fireball",
shoot_interval = 3.5,
shoot_offset = -5,
dogshoot_switch = 1,
dogshoot_count_max =1,
passive = false,
jump = true,
jump_height = 4,
floats=1, floats=1,
fly = true, fly = true,
makes_footstep_sound = false, makes_footstep_sound = false,
instant_death = true,
fire_resistant = true, fire_resistant = true,
shoot_arrow = function(self, pos, dir)
-- 2-4 damage per arrow
local dmg = math.random(2,4)
mcl_bows.shoot_arrow("mobs_mc:fireball", pos, dir, self.object:get_yaw(), self.object, nil, dmg)
end,
--[[
do_custom = function(self) do_custom = function(self)
if self.firing == true then if self.firing == true then
self.base_texture = {"mobs_mc_ghast_firing.png"} self.base_texture = {"mobs_mc_ghast_firing.png"}
@ -72,6 +75,7 @@ mobs:register_mob("mobs_mc:ghast", {
self.object:set_properties({textures=self.base_texture}) self.object:set_properties({textures=self.base_texture})
end end
end, end,
]]--
}) })
@ -102,11 +106,14 @@ mobs:register_arrow("mobs_mc:fireball", {
if rawget(_G, "armor") and armor.last_damage_types then if rawget(_G, "armor") and armor.last_damage_types then
armor.last_damage_types[player:get_player_name()] = "fireball" armor.last_damage_types[player:get_player_name()] = "fireball"
end end
--[[
player:punch(self.object, 1.0, { player:punch(self.object, 1.0, {
full_punch_interval = 1.0, full_punch_interval = 1.0,
damage_groups = {fleshy = 6}, damage_groups = {fleshy = 6},
}, nil) }, nil)
mobs:boom(self, self.object:get_pos(), 1, true) ]]--
--mobs:boom(self, self.object:get_pos(), 1, true)
mcl_explosions.explode(self.object:get_pos(), 3,{ drop_chance = 1.0 })
end, end,
hit_mob = function(self, mob) hit_mob = function(self, mob)
@ -114,11 +121,13 @@ mobs:register_arrow("mobs_mc:fireball", {
full_punch_interval = 1.0, full_punch_interval = 1.0,
damage_groups = {fleshy = 6}, damage_groups = {fleshy = 6},
}, nil) }, nil)
mobs:boom(self, self.object:get_pos(), 1, true) --mobs:boom(self, self.object:get_pos(), 1, true)
mcl_explosions.explode(self.object:get_pos(), 3,{ drop_chance = 1.0 })
end, end,
hit_node = function(self, pos, node) hit_node = function(self, pos, node)
mobs:boom(self, pos, 1, true) --mobs:boom(self, pos, 1, true)
mcl_explosions.explode(self.object:get_pos(), 3,{ drop_chance = 1.0 })
end end
}) })