mirror of
http://repo.or.cz/minetest_pyramids/tsm_pyramids.git
synced 2025-06-29 06:31:04 +02:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
0629d3b6ed | |||
5e9cd77fdc | |||
1b3f948daa | |||
63572c5c23 | |||
2538680eea |
@ -1,6 +1,6 @@
|
|||||||
# Pyramids (with Treasurer support) [`tsm_pyramids`]
|
# Pyramids (with Treasurer support) [`tsm_pyramids`]
|
||||||
|
|
||||||
* Version: 1.0.0
|
* Version: 1.0.1
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
This is a mod for Minetest Game which adds randomly spawned pyramids in deserts and
|
This is a mod for Minetest Game which adds randomly spawned pyramids in deserts and
|
||||||
|
5
init.lua
5
init.lua
@ -345,11 +345,6 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
minetest.log("verbose", "[tsm_pyramids] Pyramid not placed, no suitable surface. minp="..minetest.pos_to_string(minp))
|
minetest.log("verbose", "[tsm_pyramids] Pyramid not placed, no suitable surface. minp="..minetest.pos_to_string(minp))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Select the material type by the most prominent node type
|
|
||||||
-- E.g. if desert sand is most prominent, we place a desert sandstone pyramid
|
|
||||||
if sand_cnt_max_id then
|
|
||||||
sand = sands[sand_cnt_max_id]
|
|
||||||
end
|
|
||||||
if p2.y < PYRA_MIN_Y then
|
if p2.y < PYRA_MIN_Y then
|
||||||
minetest.log("info", "[tsm_pyramids] Pyramid not placed, too deep. p2="..minetest.pos_to_string(p2))
|
minetest.log("info", "[tsm_pyramids] Pyramid not placed, too deep. p2="..minetest.pos_to_string(p2))
|
||||||
return
|
return
|
||||||
|
@ -162,7 +162,7 @@ MUMMY_DEF.on_punch = function(self, puncher, time_from_last_punch, tool_capabili
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
if puncher ~= nil then
|
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}, true)
|
||||||
if time_from_last_punch >= 0.45 then
|
if time_from_last_punch >= 0.45 then
|
||||||
hit(self)
|
hit(self)
|
||||||
self.direction = {x=self.object:get_velocity().x, y=self.object:get_velocity().y, z=self.object:get_velocity().z}
|
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
|
end
|
||||||
|
|
||||||
MUMMY_DEF.on_death = function(self, killer)
|
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}, true)
|
||||||
-- Drop item on death
|
-- Drop item on death
|
||||||
local count = math.random(0,3)
|
local count = math.random(0,3)
|
||||||
if count > 0 then
|
if count > 0 then
|
||||||
@ -247,7 +247,7 @@ MUMMY_DEF.on_step = function(self, dtime)
|
|||||||
else
|
else
|
||||||
hit(self)
|
hit(self)
|
||||||
self.sound_timer = 0
|
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}, true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -266,7 +266,7 @@ MUMMY_DEF.on_step = function(self, dtime)
|
|||||||
|
|
||||||
--play sound
|
--play sound
|
||||||
if self.sound_timer > math.random(5,35) then
|
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}, true)
|
||||||
self.sound_timer = 0
|
self.sound_timer = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
1
room.lua
1
room.lua
@ -1116,6 +1116,7 @@ function tsm_pyramids.make_traps(pos, stype, rotations, layout_room)
|
|||||||
-- The depth of air between trap stones and lava layer is <depth> - 4
|
-- The depth of air between trap stones and lava layer is <depth> - 4
|
||||||
local deep_trap = math.random(1,2) == 1
|
local deep_trap = math.random(1,2) == 1
|
||||||
local trap_node
|
local trap_node
|
||||||
|
local depth
|
||||||
if deep_trap then
|
if deep_trap then
|
||||||
trap_node = " "
|
trap_node = " "
|
||||||
depth = 14
|
depth = 14
|
||||||
|
Reference in New Issue
Block a user