From 1b3f948daaddf4480c29ee16f8b7d0aecedc93bf Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 6 Apr 2020 00:19:56 +0200 Subject: [PATCH 1/6] Use ephemeral sounds --- mummy.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mummy.lua b/mummy.lua index 9c82505..9b00613 100644 --- a/mummy.lua +++ b/mummy.lua @@ -162,7 +162,7 @@ MUMMY_DEF.on_punch = function(self, puncher, time_from_last_punch, tool_capabili } end if puncher ~= nil then - minetest.sound_play(sound_hit, {pos = self.object:get_pos(), loop = false, max_hear_distance = 10, gain = 0.4}) + minetest.sound_play(sound_hit, {pos = self.object:get_pos(), loop = false, max_hear_distance = 10, gain = 0.4}, false) if time_from_last_punch >= 0.45 then hit(self) self.direction = {x=self.object:get_velocity().x, y=self.object:get_velocity().y, z=self.object:get_velocity().z} @@ -178,7 +178,7 @@ MUMMY_DEF.on_punch = function(self, puncher, time_from_last_punch, tool_capabili end MUMMY_DEF.on_death = function(self, killer) - minetest.sound_play(sound_dead, {pos = self.object:get_pos(), max_hear_distance = 10 , gain = 0.3}) + minetest.sound_play(sound_dead, {pos = self.object:get_pos(), max_hear_distance = 10 , gain = 0.3}, false) -- Drop item on death local count = math.random(0,3) if count > 0 then @@ -247,7 +247,7 @@ MUMMY_DEF.on_step = function(self, dtime) else hit(self) self.sound_timer = 0 - minetest.sound_play(sound_hit, {pos = current_pos, max_hear_distance = 10, gain = 0.4}) + minetest.sound_play(sound_hit, {pos = current_pos, max_hear_distance = 10, gain = 0.4}, false) end end else @@ -266,7 +266,7 @@ MUMMY_DEF.on_step = function(self, dtime) --play sound if self.sound_timer > math.random(5,35) then - minetest.sound_play(sound_normal, {pos = current_pos, max_hear_distance = 10, gain = 0.2}) + minetest.sound_play(sound_normal, {pos = current_pos, max_hear_distance = 10, gain = 0.2}, false) self.sound_timer = 0 end From 5e9cd77fdc19b660249e3aa337542d48f5ad79cd Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 6 Apr 2020 00:47:00 +0200 Subject: [PATCH 2/6] Use TRUE ephemeral sounds --- mummy.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mummy.lua b/mummy.lua index 9b00613..2076dde 100644 --- a/mummy.lua +++ b/mummy.lua @@ -162,7 +162,7 @@ MUMMY_DEF.on_punch = function(self, puncher, time_from_last_punch, tool_capabili } end if puncher ~= nil then - minetest.sound_play(sound_hit, {pos = self.object:get_pos(), loop = false, max_hear_distance = 10, gain = 0.4}, false) + minetest.sound_play(sound_hit, {pos = self.object:get_pos(), loop = false, max_hear_distance = 10, gain = 0.4}, true) if time_from_last_punch >= 0.45 then hit(self) self.direction = {x=self.object:get_velocity().x, y=self.object:get_velocity().y, z=self.object:get_velocity().z} @@ -178,7 +178,7 @@ MUMMY_DEF.on_punch = function(self, puncher, time_from_last_punch, tool_capabili end MUMMY_DEF.on_death = function(self, killer) - minetest.sound_play(sound_dead, {pos = self.object:get_pos(), max_hear_distance = 10 , gain = 0.3}, false) + minetest.sound_play(sound_dead, {pos = self.object:get_pos(), max_hear_distance = 10 , gain = 0.3}, true) -- Drop item on death local count = math.random(0,3) if count > 0 then @@ -247,7 +247,7 @@ MUMMY_DEF.on_step = function(self, dtime) else hit(self) self.sound_timer = 0 - minetest.sound_play(sound_hit, {pos = current_pos, max_hear_distance = 10, gain = 0.4}, false) + minetest.sound_play(sound_hit, {pos = current_pos, max_hear_distance = 10, gain = 0.4}, true) end end else @@ -266,7 +266,7 @@ MUMMY_DEF.on_step = function(self, dtime) --play sound if self.sound_timer > math.random(5,35) then - minetest.sound_play(sound_normal, {pos = current_pos, max_hear_distance = 10, gain = 0.2}, false) + minetest.sound_play(sound_normal, {pos = current_pos, max_hear_distance = 10, gain = 0.2}, true) self.sound_timer = 0 end From 0629d3b6ed5ab56c082879ada0b8203dd8fc487c Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 6 Apr 2020 00:47:39 +0200 Subject: [PATCH 3/6] Version 1.0.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2644392..e13dc15 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Pyramids (with Treasurer support) [`tsm_pyramids`] -* Version: 1.0.0 +* Version: 1.0.1 ## Description This is a mod for Minetest Game which adds randomly spawned pyramids in deserts and From 0974de93e460e237520d62360fbabbadf810f7f0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 6 Apr 2020 14:35:54 +0200 Subject: [PATCH 4/6] Fix occassional crash when mummy dies --- mummy.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mummy.lua b/mummy.lua index 2076dde..42bc0fc 100644 --- a/mummy.lua +++ b/mummy.lua @@ -128,6 +128,7 @@ spawner_DEF.on_step = function(self, dtime) if self.timer > 1 then if n and n.name and n.name ~= "tsm_pyramids:spawner_mummy" then self.object:remove() + return end end end @@ -244,6 +245,7 @@ MUMMY_DEF.on_step = function(self, dtime) self.on_death(self) end self.object:remove() + return else hit(self) self.sound_timer = 0 From f5fef5118ddfb9272dd6ad4f867c471dc3958eec Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 6 Apr 2020 14:59:11 +0200 Subject: [PATCH 5/6] Fix broken mummy hit texture --- mummy.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mummy.lua b/mummy.lua index 42bc0fc..1d3c046 100644 --- a/mummy.lua +++ b/mummy.lua @@ -49,15 +49,11 @@ local ANIM_WALK_MINE = 5 local ANIM_MINE = 6 local function hit(self) - local prop = { - mesh = mummy_mesh, - textures = {"tsm_pyramids_mummy.png^tsm_pyramids_hit.png"}, - } - self.object:set_properties(prop) + self.object:set_texture_mod("^tsm_pyramids_hit.png") minetest.after(0.4, function(self) local prop = {textures = mummy_texture,} if self ~= nil and self.object ~= nil then - self.object:set_properties(prop) + self.object:set_texture_mod("") end end, self) end @@ -65,7 +61,6 @@ end local function mummy_update_visuals_def(self) npc_anim = 0 -- Animation will be set further below immediately local prop = { - mesh = mummy_mesh, textures = mummy_texture, } self.object:set_properties(prop) From 0abcd7960ad5db891d900bb6b06682dc42f47021 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 6 Apr 2020 14:59:36 +0200 Subject: [PATCH 6/6] Version 1.0.2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e13dc15..4e752be 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Pyramids (with Treasurer support) [`tsm_pyramids`] -* Version: 1.0.1 +* Version: 1.0.2 ## Description This is a mod for Minetest Game which adds randomly spawned pyramids in deserts and