Change shortname to “tsm_pyramids”
@ -14,9 +14,9 @@ License of mesh model: WTFPL
|
|||||||
|
|
||||||
License of textures
|
License of textures
|
||||||
-------------------
|
-------------------
|
||||||
-pyramids_eye.png by bas080, CC-BY-SA 3.0
|
-tsm_pyramids_eye.png by bas080, CC-BY-SA 3.0
|
||||||
-pyramids_men.png by bas080, CC-BY-SA 3.0
|
-tsm_pyramids_men.png by bas080, CC-BY-SA 3.0
|
||||||
-pyramids_sun.png by bas080, CC-BY-SA 3.0
|
-tsm_pyramids_sun.png by bas080, CC-BY-SA 3.0
|
||||||
|
|
||||||
all other: BlockMen, WTFPL
|
all other: BlockMen, WTFPL
|
||||||
|
|
||||||
|
8
init.lua
@ -1,8 +1,8 @@
|
|||||||
pyramids = {}
|
pyramids = {}
|
||||||
|
|
||||||
dofile(minetest.get_modpath("pyramids").."/mummy.lua")
|
dofile(minetest.get_modpath("tsm_pyramids").."/mummy.lua")
|
||||||
dofile(minetest.get_modpath("pyramids").."/nodes.lua")
|
dofile(minetest.get_modpath("tsm_pyramids").."/nodes.lua")
|
||||||
dofile(minetest.get_modpath("pyramids").."/room.lua")
|
dofile(minetest.get_modpath("tsm_pyramids").."/room.lua")
|
||||||
|
|
||||||
local chest_stuff = {
|
local chest_stuff = {
|
||||||
{name="default:apple", max = 3},
|
{name="default:apple", max = 3},
|
||||||
@ -36,7 +36,7 @@ function pyramids.fill_chest(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function add_spawner(pos)
|
local function add_spawner(pos)
|
||||||
minetest.set_node(pos, {name="pyramids:spawner_mummy"})
|
minetest.set_node(pos, {name="tsm_pyramids:spawner_mummy"})
|
||||||
if not minetest.setting_getbool("only_peaceful_mobs") then pyramids.spawn_mummy({x=pos.x,y=pos.y,z=pos.z-2},2) end
|
if not minetest.setting_getbool("only_peaceful_mobs") then pyramids.spawn_mummy({x=pos.x,y=pos.y,z=pos.z-2},2) end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
30
mummy.lua
@ -7,8 +7,8 @@ local mummy_animation_speed = 10
|
|||||||
local mummy_animation_blend = 0
|
local mummy_animation_blend = 0
|
||||||
|
|
||||||
-- Default player appearance
|
-- Default player appearance
|
||||||
local mummy_mesh = "pyramids_mummy.x"
|
local mummy_mesh = "tsm_pyramids_mummy.x"
|
||||||
local mummy_texture = {"pyramids_mummy.png"}
|
local mummy_texture = {"tsm_pyramids_mummy.png"}
|
||||||
local mummy_hp = 20
|
local mummy_hp = 20
|
||||||
local mummy_drop = "default:papyrus"
|
local mummy_drop = "default:papyrus"
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ local ANIM_MINE = 6
|
|||||||
function hit(self)
|
function hit(self)
|
||||||
prop = {
|
prop = {
|
||||||
mesh = mummy_mesh,
|
mesh = mummy_mesh,
|
||||||
textures = {"pyramids_mummy.png^pyramids_hit.png"},
|
textures = {"tsm_pyramids_mummy.png^tsm_pyramids_hit.png"},
|
||||||
}
|
}
|
||||||
self.object:set_properties(prop)
|
self.object:set_properties(prop)
|
||||||
minetest.after(0.4, function()
|
minetest.after(0.4, function()
|
||||||
@ -120,7 +120,7 @@ spawner_DEF.on_step = function(self, dtime)
|
|||||||
self.timer = self.timer + 0.01
|
self.timer = self.timer + 0.01
|
||||||
local n = minetest.get_node_or_nil(self.object:getpos())
|
local n = minetest.get_node_or_nil(self.object:getpos())
|
||||||
if self.timer > 1 then
|
if self.timer > 1 then
|
||||||
if n and n.name and n.name ~= "pyramids:spawner_mummy" then
|
if n and n.name and n.name ~= "tsm_pyramids:spawner_mummy" then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -334,20 +334,20 @@ MUMMY_DEF.on_step = function(self, dtime)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_entity("pyramids:mummy", MUMMY_DEF)
|
minetest.register_entity("tsm_pyramids:mummy", MUMMY_DEF)
|
||||||
minetest.register_entity("pyramids:mummy_spawner", spawner_DEF)
|
minetest.register_entity("tsm_pyramids:mummy_spawner", spawner_DEF)
|
||||||
|
|
||||||
|
|
||||||
--spawn-egg/spawner
|
--spawn-egg/spawner
|
||||||
|
|
||||||
minetest.register_craftitem("pyramids:spawn_egg", {
|
minetest.register_craftitem("tsm_pyramids:spawn_egg", {
|
||||||
description = "Mummy spawn-egg",
|
description = "Mummy spawn-egg",
|
||||||
inventory_image = "pyramids_mummy_egg.png",
|
inventory_image = "tsm_pyramids_mummy_egg.png",
|
||||||
liquids_pointable = false,
|
liquids_pointable = false,
|
||||||
stack_max = 99,
|
stack_max = 99,
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
if pointed_thing.type == "node" then
|
if pointed_thing.type == "node" then
|
||||||
minetest.env:add_entity(pointed_thing.above,"pyramids:mummy")
|
minetest.env:add_entity(pointed_thing.above,"tsm_pyramids:mummy")
|
||||||
if not minetest.setting_getbool("creative_mode") then itemstack:take_item() end
|
if not minetest.setting_getbool("creative_mode") then itemstack:take_item() end
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -357,21 +357,21 @@ minetest.register_craftitem("pyramids:spawn_egg", {
|
|||||||
|
|
||||||
function pyramids.spawn_mummy (pos, number)
|
function pyramids.spawn_mummy (pos, number)
|
||||||
for i=0,number do
|
for i=0,number do
|
||||||
minetest.env:add_entity(pos,"pyramids:mummy")
|
minetest.env:add_entity(pos,"tsm_pyramids:mummy")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("pyramids:spawner_mummy", {
|
minetest.register_node("tsm_pyramids:spawner_mummy", {
|
||||||
description = "Mummy spawner",
|
description = "Mummy spawner",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
tiles = {"pyramids_spawner.png"},
|
tiles = {"tsm_pyramids_spawner.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
drawtype = "allfaces",--_optional",
|
drawtype = "allfaces",--_optional",
|
||||||
groups = {cracky=1,level=1},
|
groups = {cracky=1,level=1},
|
||||||
drop = "",
|
drop = "",
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
pos.y = pos.y - 0.28
|
pos.y = pos.y - 0.28
|
||||||
minetest.env:add_entity(pos,"pyramids:mummy_spawner")
|
minetest.env:add_entity(pos,"tsm_pyramids:mummy_spawner")
|
||||||
end,
|
end,
|
||||||
on_destruct = function(pos)
|
on_destruct = function(pos)
|
||||||
for _,obj in ipairs(minetest.env:get_objects_inside_radius(pos, 1)) do
|
for _,obj in ipairs(minetest.env:get_objects_inside_radius(pos, 1)) do
|
||||||
@ -385,7 +385,7 @@ minetest.register_node("pyramids:spawner_mummy", {
|
|||||||
})
|
})
|
||||||
if not minetest.setting_getbool("only_peaceful_mobs") then
|
if not minetest.setting_getbool("only_peaceful_mobs") then
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"pyramids:spawner_mummy"},
|
nodenames = {"tsm_pyramids:spawner_mummy"},
|
||||||
interval = 2.0,
|
interval = 2.0,
|
||||||
chance = 20,
|
chance = 20,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
@ -402,7 +402,7 @@ if not minetest.setting_getbool("only_peaceful_mobs") then
|
|||||||
if mobs < spawner_max_mobs then
|
if mobs < spawner_max_mobs then
|
||||||
pos.x = pos.x+1
|
pos.x = pos.x+1
|
||||||
local p = minetest.find_node_near(pos, 5, {"air"})
|
local p = minetest.find_node_near(pos, 5, {"air"})
|
||||||
minetest.env:add_entity(p,"pyramids:mummy")
|
minetest.env:add_entity(p,"tsm_pyramids:mummy")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
14
nodes.lua
@ -1,9 +1,9 @@
|
|||||||
local img = {"eye", "men", "sun"}
|
local img = {"eye", "men", "sun"}
|
||||||
|
|
||||||
for i=1,3 do
|
for i=1,3 do
|
||||||
minetest.register_node("pyramids:deco_stone"..i, {
|
minetest.register_node("tsm_pyramids:deco_stone"..i, {
|
||||||
description = "Sandstone with "..img[i],
|
description = "Sandstone with "..img[i],
|
||||||
tiles = {"default_sandstone.png^pyramids_"..img[i]..".png"},
|
tiles = {"default_sandstone.png^tsm_pyramids_"..img[i]..".png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {crumbly=2,cracky=3},
|
groups = {crumbly=2,cracky=3},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
@ -16,7 +16,7 @@ trap_on_timer = function (pos, elapsed)
|
|||||||
if obj:is_player() then
|
if obj:is_player() then
|
||||||
local n = minetest.get_node(pos)
|
local n = minetest.get_node(pos)
|
||||||
if n and n.name and minetest.registered_nodes[n.name].crack < 2 then
|
if n and n.name and minetest.registered_nodes[n.name].crack < 2 then
|
||||||
minetest.set_node(pos, {name="pyramids:trap_2"})
|
minetest.set_node(pos, {name="tsm_pyramids:trap_2"})
|
||||||
nodeupdate(pos)
|
nodeupdate(pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -24,9 +24,9 @@ trap_on_timer = function (pos, elapsed)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("pyramids:trap", {
|
minetest.register_node("tsm_pyramids:trap", {
|
||||||
description = "Cracked sandstone brick",
|
description = "Cracked sandstone brick",
|
||||||
tiles = {"default_sandstone_brick.png^pyramids_crack.png"},
|
tiles = {"default_sandstone_brick.png^tsm_pyramids_crack.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {crumbly=2,cracky=3},
|
groups = {crumbly=2,cracky=3},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
@ -38,9 +38,9 @@ minetest.register_node("pyramids:trap", {
|
|||||||
drop = "",
|
drop = "",
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("pyramids:trap_2", {
|
minetest.register_node("tsm_pyramids:trap_2", {
|
||||||
description = "trapstone",
|
description = "trapstone",
|
||||||
tiles = {"default_sandstone_brick.png^pyramids_crack.png^[transformR90"},
|
tiles = {"default_sandstone_brick.png^tsm_pyramids_crack.png^[transformR90"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {crumbly=2,cracky=3,falling_node=1,not_in_creative_inventory=1},
|
groups = {crumbly=2,cracky=3,falling_node=1,not_in_creative_inventory=1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
6
room.lua
@ -32,15 +32,15 @@ code["t"] = "trap"
|
|||||||
local function replace(str,iy)
|
local function replace(str,iy)
|
||||||
local out = "default:"
|
local out = "default:"
|
||||||
if iy < 4 and str == "c" then str = "a" end
|
if iy < 4 and str == "c" then str = "a" end
|
||||||
if iy == 0 and str == "s" then out = "pyramids:" str = "sun" end
|
if iy == 0 and str == "s" then out = "tsm_pyramids:" str = "sun" end
|
||||||
if iy == 3 and str == "s" then out = "pyramids:" str = "men" end
|
if iy == 3 and str == "s" then out = "tsm_pyramids:" str = "men" end
|
||||||
if str == "a" then out = "" end
|
if str == "a" then out = "" end
|
||||||
return out..code[str]
|
return out..code[str]
|
||||||
end
|
end
|
||||||
|
|
||||||
local function replace2(str,iy)
|
local function replace2(str,iy)
|
||||||
local out = "default:"
|
local out = "default:"
|
||||||
if iy == 0 and str == "l" then out = "pyramids:" str = "t"
|
if iy == 0 and str == "l" then out = "tsm_pyramids:" str = "t"
|
||||||
elseif iy < 3 and str == "l" then str = "a" end
|
elseif iy < 3 and str == "l" then str = "a" end
|
||||||
|
|
||||||
if str == "a" then out = "" end
|
if str == "a" then out = "" end
|
||||||
|
Before Width: | Height: | Size: 390 B After Width: | Height: | Size: 390 B |
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 248 B |
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 731 B After Width: | Height: | Size: 731 B |
Before Width: | Height: | Size: 453 B After Width: | Height: | Size: 453 B |
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 231 B |