1
0
Fork 0

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
and player:is_player() then
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();
return
end

View File

@ -13,13 +13,15 @@ local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:ghast", {
type = "monster",
spawn_class = "hostile",
pathfinding = 1,
group_attack = true,
hostile = true,
hp_min = 10,
hp_max = 10,
xp_min = 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",
mesh = "mobs_mc_ghast.b3d",
textures = {
@ -35,8 +37,10 @@ mobs:register_mob("mobs_mc:ghast", {
-- TODO: damage
-- TODO: better death
},
walk_velocity = 1.6,
run_velocity = 3.2,
drops = {
{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},
@ -47,22 +51,21 @@ mobs:register_mob("mobs_mc:ghast", {
walk_start = 0, walk_end = 40,
run_start = 0, run_end = 40,
},
fall_damage = 0,
view_range = 100,
attack_type = "projectile",
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,
fly = true,
makes_footstep_sound = false,
instant_death = 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)
if self.firing == true then
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})
end
end,
]]--
})
@ -102,11 +106,14 @@ mobs:register_arrow("mobs_mc:fireball", {
if rawget(_G, "armor") and armor.last_damage_types then
armor.last_damage_types[player:get_player_name()] = "fireball"
end
--[[
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 6},
}, 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,
hit_mob = function(self, mob)
@ -114,11 +121,13 @@ mobs:register_arrow("mobs_mc:fireball", {
full_punch_interval = 1.0,
damage_groups = {fleshy = 6},
}, 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,
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
})