mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-23 08:29:34 +01:00
Make creepers even more dangerous
This commit is contained in:
parent
576621169b
commit
486959515c
3 changed files with 9 additions and 2 deletions
|
@ -346,6 +346,7 @@ function mobs:register_mob(name, def)
|
|||
fire_damage_resistant = def.fire_damage_resistant or false,
|
||||
ignited_by_sunlight = def.ignited_by_sunlight or false,
|
||||
eye_height = def.eye_height or 1.5,
|
||||
defuse_reach = def.defuse_reach or 4,
|
||||
-- End of MCL2 extensions
|
||||
|
||||
on_spawn = def.on_spawn,
|
||||
|
|
|
@ -23,8 +23,13 @@ mobs.explode_attack_walk = function(self,dtime)
|
|||
|
||||
mobs.set_yaw_while_attacking(self)
|
||||
|
||||
local distance_from_attacking = vector_distance(self.object:get_pos(), self.attacking:get_pos())
|
||||
|
||||
--make mob walk up to player within 2 nodes distance then start exploding
|
||||
if vector_distance(self.object:get_pos(), self.attacking:get_pos()) >= self.reach then
|
||||
if distance_from_attacking >= self.reach and
|
||||
--don't allow explosion to cancel unless out of the reach boundary
|
||||
not (self.explosion_animation ~= nil and self.explosion_animation > 0 and distance_from_attacking <= self.defuse_reach) then
|
||||
|
||||
mobs.set_velocity(self, self.run_velocity)
|
||||
mobs.set_mob_animation(self,"run")
|
||||
|
||||
|
|
|
@ -48,7 +48,8 @@ mobs:register_mob("mobs_mc:creeper", {
|
|||
explosion_radius = 4,
|
||||
explosion_damage_radius = 6,
|
||||
explosiontimer_reset_radius = 6,
|
||||
reach = 3,
|
||||
reach = 1.5,
|
||||
defuse_reach = 4,
|
||||
explosion_timer = 0.3,
|
||||
allow_fuse_reset = true,
|
||||
stop_to_explode = true,
|
||||
|
|
Loading…
Reference in a new issue