tsm_pyramids/room.lua

717 lines
19 KiB
Lua
Raw Normal View History

local S = minetest.get_translator("tsm_pyramids")
2019-08-20 00:27:25 +02:00
-- ROOM LAYOUTS
local room_types = {
-- Pillar room
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" ","^"," ","^"," ","^"," ","^"," ",
2019-08-20 00:27:25 +02:00
" ","s"," ","s"," ","s"," ","s"," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" ","s"," ","s"," ","s"," ","s"," ",
2019-08-20 00:43:04 +02:00
" ","v"," ","v"," ","v"," ","v"," ",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," "
},
traps = true,
},
-- Hieroglyph walls
{
style = "yrepeat",
layout = {
"s","s","s","s","s","s","s","s","s",
"s"," "," "," "," "," "," "," ","s",
"s"," "," "," "," "," "," "," ","s",
"s"," "," "," "," "," "," "," ","s",
2019-08-20 00:43:04 +02:00
" "," "," "," ","<"," "," "," ","s",
2019-08-20 00:27:25 +02:00
"s"," "," "," "," "," "," "," ","s",
"s"," "," "," "," "," "," "," ","s",
"s"," "," "," "," "," "," "," ","s",
"s","s","s","s","s","s","s","s","s"
},
},
-- 4 large pillars
{
style = "yrepeat",
layout = {
2019-08-20 00:43:04 +02:00
" "," "," "," ","v"," "," "," "," ",
2019-08-20 00:27:25 +02:00
" ","s","s"," "," "," ","s","s"," ",
" ","s","s"," "," "," ","s","s"," ",
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" "," "," "," "," "," "," "," ","<",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
" ","s","s"," "," "," ","s","s"," ",
" ","s","s"," "," "," ","s","s"," ",
2019-08-20 00:43:04 +02:00
" "," "," "," ","^"," "," "," "," "
2019-08-20 00:27:25 +02:00
},
},
-- hidden room
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," ","s","S","s","S","s"," "," ",
" "," ","S"," "," "," ","S"," "," ",
2019-08-20 00:43:04 +02:00
" "," ","s"," ",">"," ","s"," ","<",
2019-08-20 00:27:25 +02:00
" "," ","S"," "," "," ","S"," "," ",
" "," ","s","S","s","S","s"," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," "
},
},
-- spiral 1
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
" ","S","S","S","S","S","S","S"," ",
" ","S"," "," "," "," "," ","S"," ",
" ","S"," ","s","s","s"," ","S"," ",
2019-08-20 00:43:04 +02:00
" ","S"," ","s","v","s"," ","S"," ",
2019-08-20 00:27:25 +02:00
"S","S"," ","s"," ","s"," ","S"," ",
"S","S"," ","s"," "," "," ","S"," ",
2019-08-20 00:43:04 +02:00
"v","S"," ","S","S","S","S","S"," ",
2019-08-20 00:27:25 +02:00
" ","S"," "," "," "," "," "," "," "
},
},
-- spiral 2
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
" ","S","S","S","S","S","S","S"," ",
" "," "," ","s"," "," "," ","S"," ",
"S","S"," ","s"," ","s"," ","S"," ",
2019-08-20 00:43:04 +02:00
" ","S"," ","s","^","s"," ","S"," ",
2019-08-20 00:27:25 +02:00
" ","S"," ","s","s","s"," ","S"," ",
" ","S"," "," "," "," "," ","S"," ",
" ","S","S","S","S","S","S","S"," ",
" "," "," "," "," "," "," "," "," "
},
},
-- pillar mania
{
style = "yrepeat",
layout = {
2019-08-20 00:43:04 +02:00
" "," ","v"," ","v"," ","v"," ","v",
2019-08-20 00:27:25 +02:00
" ","s"," ","s"," ","s"," ","s"," ",
" "," "," "," "," "," "," "," "," ",
" ","s"," ","s"," ","s"," ","s"," ",
" "," "," "," "," "," "," "," "," ",
" ","s"," ","s"," ","s"," ","s"," ",
" "," "," "," "," "," "," "," "," ",
" ","s"," ","s"," ","s"," ","s"," ",
2019-08-20 00:43:04 +02:00
" "," ","^"," ","^"," ","^"," ","^",
2019-08-20 00:27:25 +02:00
},
2019-08-20 00:45:46 +02:00
--traps = true,
2019-08-20 00:27:25 +02:00
},
-- plusses
{
style = "yrepeat",
layout = {
"s"," "," "," "," "," "," "," ","s",
2019-08-20 00:43:04 +02:00
" "," ","s",">"," ","<","s"," "," ",
2019-08-20 00:27:25 +02:00
" ","s","s","s"," ","s","s","s"," ",
" "," ","s"," "," "," ","s"," "," ",
2019-08-20 00:43:04 +02:00
" "," "," "," ","<"," "," "," "," ",
2019-08-20 00:27:25 +02:00
" "," ","s"," "," "," ","s"," "," ",
" ","s","s","s"," ","s","s","s"," ",
2019-08-20 00:43:04 +02:00
" "," ","s",">"," ","<","s"," "," ",
2019-08-20 00:27:25 +02:00
"s"," "," "," "," "," "," "," ","s",
},
2019-08-20 00:45:46 +02:00
--traps = true,
2019-08-20 00:27:25 +02:00
},
-- diamond
{
style = "yrepeat",
layout = {
2019-08-20 00:43:04 +02:00
">","s","s","s","s","s","s","s","s",
2019-08-20 00:27:25 +02:00
"s","s","s"," "," "," ","s","s","s",
"s","s"," "," "," "," "," ","s","s",
"s"," "," "," "," "," "," "," ","s",
2019-08-20 00:43:04 +02:00
" "," "," "," "," "," "," ","<","s",
2019-08-20 00:27:25 +02:00
"s"," "," "," "," "," "," "," ","s",
"s","s"," "," "," "," "," ","s","s",
"s","s","s"," "," "," ","s","s","s",
2019-08-20 00:43:04 +02:00
">","s","s","s","s","s","s","s","s",
2019-08-20 00:27:25 +02:00
},
2019-08-20 00:45:46 +02:00
--traps = true,
2019-08-20 00:27:25 +02:00
},
2019-08-20 06:16:03 +02:00
-- square
2019-08-20 00:27:25 +02:00
{
style = "yrepeat",
layout = {
2019-08-20 06:16:03 +02:00
" "," "," "," "," "," "," "," "," ",
" ","S","S","S","^","S","S","S"," ",
" ","S","S","S","S","S","S","S"," ",
" ","S","S","S","S","S","S","S"," ",
" ","S","S","S","S","S","S",">"," ",
" ","S","S","S","S","S","S","S"," ",
" ","S","S","S","S","S","S","S"," ",
" ","S","S","S","v","S","S","S"," ",
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:27:25 +02:00
},
},
-- hallway 2
{
style = "yrepeat",
layout = {
2019-08-20 00:43:04 +02:00
"S","S","S","S",">"," "," "," "," ",
"S","S","S","S","S","^","S","S"," ",
2019-08-20 00:27:25 +02:00
"S","S","S","S","S","S","S","S"," ",
"S","S","S","S","S","S","S","S"," ",
" "," "," "," "," "," "," "," "," ",
"S","S","S","S","S","S","S","S"," ",
"S","S","S","S","S","S","S","S"," ",
2019-08-20 00:43:04 +02:00
"S","S","S","S","S","v","S","S"," ",
"S","S","S","S",">"," "," "," "," ",
2019-08-20 00:27:25 +02:00
},
},
-- hallway 3
{
style = "yrepeat",
layout = {
"S","S","S","S","S"," "," "," "," ",
2019-08-20 00:43:04 +02:00
"S","S","S","S","s",">"," "," "," ",
2019-08-20 00:27:25 +02:00
"S","s","S","s","S","s","S"," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
"S","s","S","s","S","s","S"," "," ",
2019-08-20 00:43:04 +02:00
"S","S","S","S","s",">"," "," "," ",
2019-08-20 00:27:25 +02:00
"S","S","S","S","S"," "," "," "," ",
},
},
-- hallway 4
{
style = "yrepeat",
layout = {
2019-08-20 00:43:04 +02:00
"S","S","S","S","S","v","S","S","S",
2019-08-20 00:27:25 +02:00
"S","S","S","S","S","S","S","S","S",
"s","S","s","S","s","S","s","S","s",
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" "," "," "," "," "," "," "," ","<",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
"s","S","s","S","s","S","s","S","s",
"S","S","S","S","S","S","S","S","S",
2019-08-20 00:43:04 +02:00
"S","S","S","S","S","^","S","S","S",
2019-08-20 00:27:25 +02:00
},
},
-- tiny
{
style = "yrepeat",
layout = {
2019-08-20 00:43:04 +02:00
"S","S","S","S","S","S","S","S","v",
2019-08-20 00:27:25 +02:00
"S","S","S","S","S","S","S","S"," ",
"S","S","S","S","S","S","S","S"," ",
"S","S","S"," "," "," ","S","S"," ",
2019-08-20 00:43:04 +02:00
" "," "," "," ","<"," ","S","S"," ",
2019-08-20 00:27:25 +02:00
"S","S","S"," "," "," ","S","S"," ",
"S","S","S","S","S","S","S","S"," ",
"S","S","S","S","S","S","S","S"," ",
2019-08-20 00:43:04 +02:00
"S","S","S","S","S","S","S","S","^",
2019-08-20 00:27:25 +02:00
},
},
-- small
{
style = "yrepeat",
layout = {
"S","S","S","S","S","S","S","S","S",
"S","S","S","S","S","S","S","S","S",
2019-08-20 00:43:04 +02:00
"S","S"," ","v"," ","v"," ","S","S",
"S","S",">"," "," "," ","<","S"," ",
2019-08-20 00:27:25 +02:00
" "," "," "," ","s"," "," ","S"," ",
2019-08-20 00:43:04 +02:00
"S","S",">"," "," "," ","<","S"," ",
"S","S"," ","^"," ","^"," ","S","S",
2019-08-20 00:27:25 +02:00
"S","S","S","S","S","S","S","S","S",
"S","S","S","S","S","S","S","S","S",
},
},
-- small 2
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
" ","S","S","S","S","S","S","S"," ",
2019-08-20 00:43:04 +02:00
" ","S"," "," ","v"," "," ","S"," ",
2019-08-20 00:27:25 +02:00
"S","S"," "," "," "," "," ","S"," ",
2019-08-20 00:43:04 +02:00
" "," "," "," "," "," ","<","S"," ",
2019-08-20 00:27:25 +02:00
"S","S"," "," "," "," "," ","S"," ",
2019-08-20 00:43:04 +02:00
" ","S"," "," ","^"," "," ","S"," ",
2019-08-20 00:27:25 +02:00
" ","S","S","S","S","S","S","S"," ",
" "," "," "," "," "," "," "," "," ",
},
},
-- big pillar
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" "," "," "," ","^"," "," "," "," ",
2019-08-20 00:27:25 +02:00
" "," "," ","s","s","s"," "," "," ",
2019-08-20 00:43:04 +02:00
" "," ","<","s","S","s",">"," "," ",
2019-08-20 00:27:25 +02:00
" "," "," ","s","s","s"," "," "," ",
2019-08-20 00:43:04 +02:00
" "," "," "," ","v"," "," "," "," ",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
},
2019-08-20 00:45:46 +02:00
--traps = true,
2019-08-20 00:27:25 +02:00
},
-- pacman
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," ","s","s","s"," "," "," ",
2019-08-20 00:43:04 +02:00
" "," ","s","s","v","s","s"," "," ",
" "," ","s",">"," "," "," "," "," ",
" "," ","s","s","^","s","s"," "," ",
2019-08-20 00:27:25 +02:00
" "," "," ","s","s","s"," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
},
},
-- the wall
{
style = "yrepeat",
layout = {
2019-08-20 00:43:04 +02:00
"S","S","S","S","S","S","S"," ","<",
2019-08-20 00:27:25 +02:00
"s","s","s","s","s","S","S"," ","s",
2019-08-20 00:43:04 +02:00
"s"," "," "," "," ","s","S"," ","<",
2019-08-20 00:27:25 +02:00
"s"," "," "," "," ","s","S"," ","s",
2019-08-20 00:43:04 +02:00
" "," "," "," ","<","s","S"," ","<",
2019-08-20 00:27:25 +02:00
"s"," "," "," "," ","s","S"," ","s",
2019-08-20 00:43:04 +02:00
"s"," "," "," "," ","s","S"," ","<",
2019-08-20 00:27:25 +02:00
"s","s","s","s","s","s","S"," ","s",
2019-08-20 00:43:04 +02:00
"S","S","S","S","S","S","S"," ","<",
2019-08-20 00:27:25 +02:00
},
},
-- split
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" "," "," ","^"," ","^"," "," "," ",
2019-08-20 00:27:25 +02:00
" "," "," ","s"," ","s"," "," "," ",
2019-08-20 00:43:04 +02:00
" "," "," ","v"," ","v"," "," "," ",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
},
},
-- 4 small pillars
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" "," "," "," ","^"," "," "," "," ",
2019-08-20 00:27:25 +02:00
" "," "," "," ","s"," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" ","<","s"," "," "," ","s",">"," ",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
" "," "," "," ","s"," "," "," "," ",
2019-08-20 00:43:04 +02:00
" "," "," "," ","v"," "," "," "," ",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
},
},
-- 6 pillars
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" "," ","^"," ","^"," ","^"," "," ",
2019-08-20 00:27:25 +02:00
" "," ","s"," ","s"," ","s"," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," ","s"," ","s"," ","s"," "," ",
2019-08-20 00:43:04 +02:00
" "," ","v"," ","v"," ","v"," "," ",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
},
traps = true,
},
-- stripes
{
style = "yrepeat",
layout = {
2019-08-20 00:43:04 +02:00
" ","S","v","S","v","S","v","S","v",
2019-08-20 00:27:25 +02:00
" ","S"," ","S"," ","S"," ","S"," ",
" ","s"," ","s"," ","s"," ","s"," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" ","s"," ","s"," ","s"," ","s"," ",
" ","S"," ","S"," ","S"," ","S"," ",
2019-08-20 00:43:04 +02:00
" ","S","^","S","^","S","^","S","^",
2019-08-20 00:27:25 +02:00
},
},
-- inside
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
" ","s"," "," "," "," "," ","s"," ",
" "," "," "," "," "," "," "," "," ",
" "," "," ","s","S","s"," "," "," ",
2019-08-20 00:43:04 +02:00
" "," "," ","S",">"," "," "," "," ",
2019-08-20 00:27:25 +02:00
" "," "," ","s","S","s"," "," "," ",
" "," "," "," "," "," "," "," "," ",
" ","s"," "," "," "," "," ","s"," ",
" "," "," "," "," "," "," "," "," ",
},
},
-- 1 chest
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" "," "," "," ","<"," "," "," "," ",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
},
},
-- 2 chests
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" "," "," "," "," "," "," "," ","<",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" "," "," "," "," "," "," "," ","<",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
},
traps = true,
},
-- X
{
style = "yrepeat",
layout = {
"s"," "," "," "," "," "," "," ","s",
2019-08-20 00:43:04 +02:00
"s","s",">"," "," "," ","<","s","s",
2019-08-20 00:27:25 +02:00
" ","s","s"," "," "," ","s","s"," ",
" "," ","s","s"," ","s","s"," "," ",
" "," "," "," "," "," "," "," "," ",
" "," ","s","s"," ","s","s"," "," ",
" ","s","s"," "," "," ","s","s"," ",
2019-08-20 00:43:04 +02:00
"s","s",">"," "," "," ","<","s","s",
2019-08-20 00:27:25 +02:00
"s"," "," "," "," "," "," "," ","s",
},
},
-- split 2
{
style = "yrepeat",
layout = {
"S","S","S","S","S","S","S","S","S",
"S","S","S"," "," "," "," "," "," ",
"S","S","S"," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
"S","S","S"," "," ","^","^","^","^",
2019-08-20 00:27:25 +02:00
" "," "," "," "," ","s","s","s","s",
2019-08-20 00:43:04 +02:00
"S","S","S"," "," ","v","v","v","v",
2019-08-20 00:27:25 +02:00
"S","S","S"," "," "," "," "," "," ",
"S","S","S"," "," "," "," "," "," ",
"S","S","S","S","S","S","S","S","S",
},
},
-- split 3
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" ","^"," ","^"," ","^"," ","^"," ",
2019-08-20 00:27:25 +02:00
" ","s"," ","s"," ","s"," ","s"," ",
2019-08-20 00:43:04 +02:00
" ","v"," ","v"," ","v"," ","v"," ",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," "," ",
},
},
-- diamond 2
{
style = "yrepeat",
layout = {
"S","S"," "," "," "," "," ","S","S",
"S"," "," "," ","s"," "," "," ","S",
2019-08-20 00:43:04 +02:00
" "," ","<","S","S","S",">"," "," ",
2019-08-20 00:27:25 +02:00
" "," ","S","S","S","S","S"," "," ",
" ","s","S","S","S","S","S","s"," ",
" "," ","S","S","S","S","S"," "," ",
2019-08-20 00:43:04 +02:00
" "," ","<","S","S","S",">"," "," ",
2019-08-20 00:27:25 +02:00
"S"," "," "," ","s"," "," "," ","S",
"S","S"," "," "," "," "," ","S","S",
},
},
-- ultra pillars
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" ","s","^","s"," ","s","^","s"," ",
2019-08-20 00:27:25 +02:00
" ","s","s","s"," ","s","s","s"," ",
" ","s","s","s"," ","s","s","s"," ",
" "," "," "," "," "," "," "," "," ",
" ","s","s","s"," ","s","s","s"," ",
" ","s","s","s"," ","s","s","s"," ",
2019-08-20 00:43:04 +02:00
" ","s","v","s"," ","s","v","s"," ",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
},
},
-- vstripes
{
style = "yrepeat",
layout = {
"S"," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
"S"," "," ","^"," "," ","^"," "," ",
2019-08-20 00:27:25 +02:00
"S"," "," ","s"," "," ","s"," "," ",
"S"," "," "," "," "," "," "," "," ",
" "," "," ","s"," "," ","s"," "," ",
"S"," "," "," "," "," "," "," "," ",
"S"," "," ","s"," "," ","s"," "," ",
2019-08-20 00:43:04 +02:00
"S"," "," ","v"," "," ","v"," "," ",
2019-08-20 00:27:25 +02:00
"S"," "," "," "," "," "," "," "," ",
},
},
-- sides
{
style = "yrepeat",
layout = {
"s"," ","s"," ","s"," ","s"," ","s",
2019-08-20 00:43:04 +02:00
" "," ","v"," ","v"," ","v"," "," ",
2019-08-20 00:27:25 +02:00
"s"," "," "," "," "," "," "," ","s",
" "," "," "," "," "," "," "," "," ",
" "," "," "," "," "," "," "," ","s",
" "," "," "," "," "," "," "," "," ",
"s"," "," "," "," "," "," "," ","s",
2019-08-20 00:43:04 +02:00
" "," ","^"," ","^"," ","^"," "," ",
2019-08-20 00:27:25 +02:00
"s"," ","s"," ","s"," ","s"," ","s",
},
traps = true,
},
-- 9 pillars
{
style = "yrepeat",
layout = {
" "," "," "," "," "," "," "," "," ",
2019-08-20 00:43:04 +02:00
" "," ","^"," ","^"," ","^"," "," ",
2019-08-20 00:27:25 +02:00
" "," ","s"," ","s"," ","s"," "," ",
" "," "," "," "," "," "," "," "," ",
" "," ","s"," ","s"," ","s"," "," ",
" "," "," "," "," "," "," "," "," ",
" "," ","s"," ","s"," ","s"," "," ",
2019-08-20 00:43:04 +02:00
" "," ","v"," ","v"," ","v"," "," ",
2019-08-20 00:27:25 +02:00
" "," "," "," "," "," "," "," "," ",
},
2019-08-20 00:45:46 +02:00
--traps = true,
2019-08-20 00:27:25 +02:00
},
2019-08-19 18:38:48 +02:00
}
2013-10-01 14:37:40 +02:00
2019-08-20 00:27:25 +02:00
local layout_traps
2019-08-19 19:41:20 +02:00
local layout_traps_template = {
"S","S","S","S","S","S","S","S","S",
"?","S","?","S","?","S","?","S","S",
"?","S","?","S","?","S","?","S","S",
"?","?","?","?","?","?","?","?","S",
"?","?","?","?","?","?","?","?","S", -- << entrance on left side
"?","?","?","?","?","?","?","?","S",
"?","S","?","S","?","S","?","S","S",
"?","S","?","S","?","S","?","S","S",
"S","S","S","S","S","S","S","S","S"
}
2018-05-25 00:23:05 +02:00
local code_sandstone = {
2019-08-19 18:38:48 +02:00
[" "] = "air",
2018-05-25 00:23:05 +02:00
["s"] = "sandstone",
2019-08-19 18:38:48 +02:00
["S"] = "sandstonebrick",
2018-05-25 00:23:05 +02:00
["1"] = "deco_stone1",
["2"] = "deco_stone2",
["3"] = "deco_stone3",
2019-08-20 00:43:04 +02:00
["^"] = "chest",
["<"] = "chest",
[">"] = "chest",
["v"] = "chest",
2019-08-19 18:38:48 +02:00
["~"] = "lava_source",
2018-05-25 00:23:05 +02:00
["t"] = "trap",
}
local code_desert = table.copy(code_sandstone)
code_desert["s"] = "desert_sandstone"
code_desert["1"] = "deco_stone4"
code_desert["2"] = "deco_stone5"
code_desert["3"] = "deco_stone6"
2019-08-19 18:38:48 +02:00
code_desert["S"] = "desert_sandstone_brick"
2019-08-19 17:26:05 +02:00
code_desert["t"] = "desert_trap"
2019-08-20 05:16:29 +02:00
local function replace(str, iy, code_table, deco, column_style)
local out = "default:"
2019-08-20 00:43:04 +02:00
if iy < 4 and (str == "<" or str == ">" or str == "^" or str == "v") then str = " " end
2019-08-20 05:16:29 +02:00
if column_style == 1 or column_style == 2 then
if iy == 0 and str == "s" then out = "tsm_pyramids:" str = deco[1] end
if iy == 3 and str == "s" then out = "tsm_pyramids:" str = deco[2] end
elseif column_style == 3 then
if iy == 0 and str == "s" then out = "tsm_pyramids:" str = deco[1] end
if iy == 2 and str == "s" then out = "tsm_pyramids:" str = deco[2] end
elseif column_style == 4 then
if iy == 2 and str == "s" then out = "tsm_pyramids:" str = deco[1] end
end
2019-08-19 18:38:48 +02:00
if str == " " then out = "" end
2018-05-25 00:23:05 +02:00
return out..code_table[str]
end
2018-05-25 00:23:05 +02:00
local function replace2(str, iy, code_table)
2013-10-01 14:37:40 +02:00
local out = "default:"
2019-08-19 18:38:48 +02:00
if iy == 0 and str == "~" then out = "tsm_pyramids:" str = "t"
elseif iy < 3 and str == "~" then str = " " end
2013-10-01 14:37:40 +02:00
2019-08-19 18:38:48 +02:00
if str == " " then out = "" end
2018-05-25 00:23:05 +02:00
return out..code_table[str]
2013-10-01 14:37:40 +02:00
end
function tsm_pyramids.make_room(pos, stype, room_id)
2018-05-25 00:23:05 +02:00
local code_table = code_sandstone
if stype == "desert" then
code_table = code_desert
end
2018-05-25 00:34:33 +02:00
-- Select random deco block
local deco_ids = {"1", "2", "3"}
local deco = {}
for i=1, 2 do
local r = math.random(1, #deco_ids)
table.insert(deco, deco_ids[r])
table.remove(deco_ids, r)
end
2018-05-25 00:23:05 +02:00
local hole = {x=pos.x+7,y=pos.y+5, z=pos.z+7}
if room_id == nil then
room_id = math.random(1, #room_types)
end
local room
if room_id < 1 or room_id > #room_types then
return false, S("Incorrect room type ID: @1", room_id)
end
local room = room_types[room_id]
local chests = {}
2019-08-20 05:16:29 +02:00
local column_style = math.random(0,4)
2019-08-20 00:27:25 +02:00
if room.style == "yrepeat" then
for iy=0,4,1 do
for ix=0,8,1 do
for iz=0,8,1 do
local n_str = room.layout[tonumber(ix*9+iz+1)]
local p2 = 0
2019-08-20 00:43:04 +02:00
if n_str == "<" then
p2 = 0
elseif n_str == ">" then
p2 = 2
elseif n_str == "^" then
p2 = 1
elseif n_str == "v" then
p2 = 3
2019-08-20 00:27:25 +02:00
end
local cpos = {x=hole.x+ix,y=hole.y-iy,z=hole.z+iz}
2019-08-20 05:16:29 +02:00
local nn = replace(n_str, iy, code_table, deco, column_style)
minetest.set_node(cpos, {name=nn, param2=p2})
if nn == "default:chest" then
table.insert(chests, cpos)
end
2016-12-30 14:22:38 +01:00
end
end
end
2019-08-20 00:27:25 +02:00
else
minetest.log("error", "Invalid pyramid room style! room type ID="..r)
2019-08-20 00:27:25 +02:00
end
2019-08-20 03:26:54 +02:00
local sanded = room.flood_sand ~= false and math.random(1,8) == 1
if #chests > 0 then
-- Make at least 8 attempts to fill chests
local filled = 0
while filled < 8 do
for c=1, #chests do
2019-08-20 03:26:54 +02:00
tsm_pyramids.fill_chest(chests[c], stype, sanded)
filled = filled + 1
end
end
end
2019-08-20 00:27:25 +02:00
if room.traps then
tsm_pyramids.make_traps(pos, stype)
end
2019-08-20 03:26:54 +02:00
if sanded then
tsm_pyramids.flood_sand(pos, stype)
2019-08-20 02:58:37 +02:00
end
return true, nil, sanded
end
2013-10-01 14:37:40 +02:00
2019-08-19 19:41:20 +02:00
local shuffle_traps = function(chance)
layout_traps = table.copy(layout_traps_template)
for a=1, #layout_traps do
if layout_traps[a] == "?" then
if math.random(1,100) <= chance then
layout_traps[a] = "~"
else
layout_traps[a] = "S"
end
end
end
end
2019-08-19 18:06:55 +02:00
function tsm_pyramids.make_traps(pos, stype)
2018-05-25 00:23:05 +02:00
local code_table = code_sandstone
if stype == "desert" then
code_table = code_desert
end
2019-08-19 19:41:20 +02:00
shuffle_traps(math.random(10,100))
2018-05-25 00:23:05 +02:00
local hole = {x=pos.x+7,y=pos.y, z=pos.z+7}
2016-12-30 14:22:38 +01:00
for iy=0,4,1 do
for ix=0,8,1 do
for iz=0,8,1 do
2019-08-19 19:41:20 +02:00
local n_str = layout_traps[tonumber(ix*9+iz+1)]
2016-12-30 14:22:38 +01:00
local p2 = 0
2018-05-25 00:23:05 +02:00
minetest.set_node({x=hole.x+ix,y=hole.y-iy,z=hole.z+iz}, {name=replace2(n_str, iy, code_table), param2=p2})
2016-12-30 14:22:38 +01:00
end
2013-10-01 14:37:40 +02:00
end
end
end
2019-08-20 02:58:37 +02:00
function tsm_pyramids.flood_sand(pos, stype)
local set_to_sand = {}
2019-08-20 02:58:37 +02:00
local nn = "default:sand"
if stype == "desert" then
nn = "default:desert_sand"
end
local hole = {x=pos.x+7,y=pos.y+1, z=pos.z+7}
local maxh = math.random(1,4)
local chance = math.random(1,7)
for ix=0,8,1 do
for iz=0,8,1 do
if math.random(1,chance) == 1 then
local h = math.random(1,maxh)
for iy=0,h,1 do
local p = {x=hole.x+ix,y=hole.y+iy,z=hole.z+iz}
if minetest.get_node(p).name == "air" then
table.insert(set_to_sand, p)
2019-08-20 02:58:37 +02:00
end
end
end
end
end
minetest.bulk_set_node(set_to_sand, {name=nn})
2019-08-20 02:58:37 +02:00
end