From 8060928237835dd7ecb281b695ff02bc7726d1c0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 31 Mar 2018 03:51:49 +0200 Subject: [PATCH] Fix some creeper issues - Fix fuse sound sometimes not playing - Timer = 1.5s - Distance behaviour like in MC --- mods/ENTITIES/mobs/api.lua | 4 ++-- mods/ENTITIES/mobs_mc/creeper.lua | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/mods/ENTITIES/mobs/api.lua b/mods/ENTITIES/mobs/api.lua index 1f9d03c0b7..dc686f2c32 100644 --- a/mods/ENTITIES/mobs/api.lua +++ b/mods/ENTITIES/mobs/api.lua @@ -1850,10 +1850,10 @@ local do_states = function(self, dtime) mob_sound(self, self.sounds.fuse) -- print ("=== explosion timer started", self.explosion_timer) - -- stop timer if out of blast radius or direct line of sight + -- stop timer if out of reach or direct line of sight elseif self.allow_fuse_reset and self.v_start - and (dist > max(self.reach, entity_damage_radius) + 0.5 + and (dist > self.reach or not line_of_sight(self, s, p, 2)) then self.v_start = false self.timer = 0 diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index e0f9d9ce4c..40b02d1667 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -28,20 +28,24 @@ mobs:register_mob("mobs_mc:creeper", { visual_size = {x=3, y=3}, sounds = { attack = "tnt_ignite", - death = "Creeperdeath", -- TODO: Replace - damage = "Creeper4", -- TODO: Replce - war_cry = "tnt_ignite", + --TODO: death = "", + --TODO: damage = "", + fuse = "tnt_ignite", explode = "tnt_explode", distance = 16, }, makes_footstep_sound = true, - walk_velocity = 1.5, - run_velocity = 3, + walk_velocity = 1.05, + run_velocity = 2.1, runaway_from = { "mobs_mc:ocelot", "mobs_mc:cat" }, attack_type = "explode", explosion_radius = 3, - explosion_fire = false, + reach = 4, + explosion_damage_radius = 7, + explosion_timer = 1.5, + allow_fuse_reset = true, + stop_to_explode = true, -- Force-ignite creeper with flint and steel and explode after 1.5 seconds. -- TODO: Make creeper flash after doing this as well. @@ -62,7 +66,7 @@ mobs:register_mob("mobs_mc:creeper", { end clicker:set_wielded_item(item) end - self._forced_explosion_countdown_timer = 1.5 + self._forced_explosion_countdown_timer = self.explosion_timer minetest.sound_play(self.sounds.attack, {pos = self.object:getpos(), gain = 1, max_hear_distance = 16}) end end,