Added the punch_anim to the icelizard and removed the particles from its explosion

This commit is contained in:
npx 2016-12-08 15:56:20 +01:00
parent ac5dbc9560
commit 7b800a93d9
3 changed files with 15 additions and 8 deletions

View File

@ -55,6 +55,7 @@ mobs:register_mob("nssm:icelizard", {
animation = { animation = {
speed_normal = 20, speed_normal = 20,
speed_run = 40, speed_run = 40,
speed_punch = 5,
stand_start = 0, stand_start = 0,
stand_end = 80, stand_end = 80,
walk_start = 110, walk_start = 110,
@ -67,9 +68,13 @@ mobs:register_mob("nssm:icelizard", {
punch_end = 170, punch_end = 170,
}, },
custom_attack = function(self) custom_attack = function(self)
self.icelizard_timer = self.icelizard_timer or os.time()
set_animation(self, "punch")
if (os.time()-self.icelizard_timer) > 0.9 then
local pos = self.object:getpos() local pos = self.object:getpos()
tnt_boom_nssm(pos, {damage_radius=0,radius=4,ignore_protection=false},"nssm:coldest_ice") tnt_boom_nssm(pos, {damage_radius=0,radius=4,ignore_protection=false},"nssm:coldest_ice", false)
self.object:remove() self.object:remove()
end
end, end,
do_custom = function(self) do_custom = function(self)
putting_ability(self, "default:ice", self.run_velocity) putting_ability(self, "default:ice", self.run_velocity)

View File

@ -363,7 +363,7 @@ mobs:register_mob("nssm:morvalar5", {
local p = self.attack:getpos() local p = self.attack:getpos()
minetest.after(2, function(self) minetest.after(2, function(self)
set_animation(self, "punch") set_animation(self, "punch")
tnt_boom_nssm(p, {damage_radius=6,radius=5,ignore_protection=false}) tnt_boom_nssm(p, {damage_radius=6,radius=5,ignore_protection=false}, nil, true)
self.morvalar5_timer = os.time() self.morvalar5_timer = os.time()
end,self) end,self)
end end
@ -874,14 +874,14 @@ minetest.register_entity("nssm:kamehameha_bad", {
local objects = minetest.env:get_objects_inside_radius(pos, 1) local objects = minetest.env:get_objects_inside_radius(pos, 1)
for _,obj in ipairs(objects) do for _,obj in ipairs(objects) do
if obj:is_player() then if obj:is_player() then
tnt_boom_nssm(pos, {damage_radius=6,radius=5,ignore_protection=false}) tnt_boom_nssm(pos, {damage_radius=6,radius=5,ignore_protection=false}, nil, true)
self.object:remove() self.object:remove()
minetest.chat_send_all("Dentro il raggio piccolo") minetest.chat_send_all("Dentro il raggio piccolo")
end end
if obj:get_luaentity() then if obj:get_luaentity() then
local name = obj:get_luaentity().name local name = obj:get_luaentity().name
if name ~= "nssm:morvalar0" and name ~="nssm:kamehameha_bad" then if name ~= "nssm:morvalar0" and name ~="nssm:kamehameha_bad" then
tnt_boom_nssm(pos, {damage_radius=6,radius=5,ignore_protection=false}) tnt_boom_nssm(pos, {damage_radius=6,radius=5,ignore_protection=false}, nil, true)
self.object:remove() self.object:remove()
end end
end end

View File

@ -874,7 +874,7 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast, bloc
return drops, radius return drops, radius
end end
function tnt_boom_nssm(pos, def, block) function tnt_boom_nssm(pos, def, block, effects)
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64}) minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
minetest.set_node(pos, {name = "tnt:boom"}) minetest.set_node(pos, {name = "tnt:boom"})
local drops, radius = tnt_explode(pos, def.radius, def.ignore_protection, def.ignore_on_blast, block) local drops, radius = tnt_explode(pos, def.radius, def.ignore_protection, def.ignore_on_blast, block)
@ -884,5 +884,7 @@ function tnt_boom_nssm(pos, def, block)
if not def.disable_drops then if not def.disable_drops then
eject_drops(drops, pos, radius) eject_drops(drops, pos, radius)
end end
if effects then
add_effects(pos, radius, drops) add_effects(pos, radius, drops)
end
end end