forked from oerkki/voxelands
add limestone
This commit is contained in:
parent
da1b9756c8
commit
459efc5ee1
Binary file not shown.
After Width: | Height: | Size: 808 B |
Binary file not shown.
Before Width: | Height: | Size: 809 B After Width: | Height: | Size: 410 B |
|
@ -273,6 +273,23 @@ void content_mapnode_init(bool repeat)
|
|||
lists::add("creative",i);
|
||||
lists::add("decrafting",i);
|
||||
|
||||
i = CONTENT_LIMESTONE;
|
||||
f = &content_features(i);
|
||||
f->description = wgettext("Limestone");
|
||||
f->setAllTextures("limestone.png");
|
||||
f->setInventoryTextureCube("limestone.png", "limestone.png", "limestone.png");
|
||||
f->param_type = CPT_MINERAL;
|
||||
f->draw_type = CDT_CUBELIKE;
|
||||
f->is_ground_content = true;
|
||||
f->often_contains_mineral = true;
|
||||
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_LIMESTONE)+" 1";
|
||||
f->type = CMT_STONE;
|
||||
f->hardness = 0.6;
|
||||
if (invisible_stone)
|
||||
f->solidness = 0; // For debugging, hides regular stone
|
||||
lists::add("creative",i);
|
||||
lists::add("decrafting",i);
|
||||
|
||||
i = CONTENT_ICE;
|
||||
f = &content_features(i);
|
||||
f->description = wgettext("Ice");
|
||||
|
|
|
@ -47,7 +47,7 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version);
|
|||
*/
|
||||
|
||||
#define CONTENT_STONE 0x000
|
||||
// FREE 0x001
|
||||
#define CONTENT_LIMESTONE 0x001
|
||||
#define CONTENT_WATER 0x002
|
||||
#define CONTENT_TORCH_LEGACY 0x003
|
||||
#define CONTENT_GLASSLIGHT 0x004
|
||||
|
|
|
@ -1433,6 +1433,12 @@ void make_block(BlockMakeData *data)
|
|||
sl.X, sl.Y, sl.Z);
|
||||
}
|
||||
|
||||
|
||||
bool limestone = (noisebuf_ground_wetness.get(node_min.X+8,node_min.Y+8,node_min.Z+8) > 0.5);
|
||||
content_t base_content = CONTENT_STONE;
|
||||
if (limestone)
|
||||
base_content = CONTENT_LIMESTONE;
|
||||
|
||||
/*
|
||||
Make base ground level
|
||||
*/
|
||||
|
@ -1464,7 +1470,7 @@ void make_block(BlockMakeData *data)
|
|||
}else if (noisebuf_cave.get(x,y,z) > CAVE_NOISE_THRESHOLD) {
|
||||
vmanip.m_data[i] = MapNode(CONTENT_AIR);
|
||||
}else{
|
||||
vmanip.m_data[i] = MapNode(CONTENT_STONE);
|
||||
vmanip.m_data[i] = MapNode(base_content);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1491,7 +1497,7 @@ void make_block(BlockMakeData *data)
|
|||
for (u16 i=0; i<27; i++) {
|
||||
v3s16 p = v3s16(x,y,z) + g_27dirs[i];
|
||||
u32 vi = vmanip.m_area.index(p);
|
||||
if (vmanip.m_data[vi].getContent() == CONTENT_STONE && mineralrandom.next()%8 == 0)
|
||||
if (vmanip.m_data[vi].getContent() == base_content && mineralrandom.next()%8 == 0)
|
||||
vmanip.m_data[vi] = MapNode(CONTENT_MESE);
|
||||
}
|
||||
|
||||
|
@ -1500,6 +1506,42 @@ void make_block(BlockMakeData *data)
|
|||
/*
|
||||
Add others
|
||||
*/
|
||||
if (limestone) {
|
||||
/*
|
||||
Add tin/quartz (and rare coal)
|
||||
*/
|
||||
u16 a = mineralrandom.range(0,15);
|
||||
a = a*a*a;
|
||||
u16 amount = 20;
|
||||
u16 rareness = 40 / amount;
|
||||
if (rareness == 0)
|
||||
rareness = 1;
|
||||
if (mineralrandom.next()%rareness == 0) {
|
||||
u16 a = mineralrandom.next() % 16;
|
||||
u16 amnt = amount * a*a*a / 1000;
|
||||
for (s16 i=0; i<amnt; i++) {
|
||||
s16 x = mineralrandom.range(node_min.X+1, node_max.X-1);
|
||||
s16 y = mineralrandom.range(node_min.Y+1, node_max.Y-1);
|
||||
s16 z = mineralrandom.range(node_min.Z+1, node_max.Z-1);
|
||||
u8 type = mineralrandom.next()%12;
|
||||
if (type == 0) {
|
||||
type = MINERAL_COAL;
|
||||
}else if (type > 8) {
|
||||
type = MINERAL_QUARTZ;
|
||||
}else if (type > 4) {
|
||||
type = MINERAL_COPPER;
|
||||
}else{
|
||||
type = MINERAL_TIN;
|
||||
}
|
||||
for (u16 i=0; i<27; i++) {
|
||||
v3s16 p = v3s16(x,y,z) + g_27dirs[i];
|
||||
u32 vi = vmanip.m_area.index(p);
|
||||
if (vmanip.m_data[vi].getContent() == CONTENT_LIMESTONE && mineralrandom.next()%8 == 0)
|
||||
vmanip.m_data[vi] = MapNode(CONTENT_LIMESTONE, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
{
|
||||
u16 a = mineralrandom.range(0,15);
|
||||
a = a*a*a;
|
||||
|
@ -1584,12 +1626,13 @@ void make_block(BlockMakeData *data)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Add mud and sand and others underground (in place of stone)
|
||||
*/
|
||||
content_t liquid_type = CONTENT_LAVASOURCE;
|
||||
if (blockpos.Y > -1 || ((blockpos.X + blockpos.Z)/blockpos.Y+1)%16 == 0)
|
||||
if (limestone || blockpos.Y > -1 || ((blockpos.X + blockpos.Z)/blockpos.Y+1)%16 == 0)
|
||||
liquid_type = CONTENT_WATERSOURCE;
|
||||
|
||||
for (s16 x=node_min.X; x<=node_max.X; x++)
|
||||
|
@ -1601,7 +1644,7 @@ void make_block(BlockMakeData *data)
|
|||
v3s16 em = vmanip.m_area.getExtent();
|
||||
u32 i = vmanip.m_area.index(v3s16(p2d.X, node_max.Y, p2d.Y));
|
||||
for (s16 y=node_max.Y; y>=node_min.Y; y--) {
|
||||
if (vmanip.m_data[i].getContent() == CONTENT_STONE) {
|
||||
if (vmanip.m_data[i].getContent() == base_content) {
|
||||
if (noisebuf_ground_crumbleness.get(x,y,z) > 1.3) {
|
||||
if (noisebuf_ground_wetness.get(x,y,z) > 0.0) {
|
||||
vmanip.m_data[i] = MapNode(CONTENT_MUD);
|
||||
|
@ -1626,6 +1669,7 @@ void make_block(BlockMakeData *data)
|
|||
}
|
||||
}
|
||||
|
||||
if (!limestone) {
|
||||
/*
|
||||
Add dungeons
|
||||
*/
|
||||
|
@ -1694,6 +1738,7 @@ void make_block(BlockMakeData *data)
|
|||
if (ncrandom.range(0, 1000) == 0 && blockpos.Y <= -3)
|
||||
make_nc(vmanip, ncrandom);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Add top and bottom side of water to transforming_liquid queue
|
||||
|
@ -1764,7 +1809,7 @@ void make_block(BlockMakeData *data)
|
|||
|
||||
if (
|
||||
(
|
||||
vmanip.m_data[i].getContent() == CONTENT_STONE
|
||||
vmanip.m_data[i].getContent() == base_content
|
||||
|| vmanip.m_data[i].getContent() == CONTENT_GRASS
|
||||
|| vmanip.m_data[i].getContent() == CONTENT_MUD
|
||||
|| vmanip.m_data[i].getContent() == CONTENT_SAND
|
||||
|
@ -1806,7 +1851,7 @@ void make_block(BlockMakeData *data)
|
|||
}else{
|
||||
if(vmanip.m_data[i].getContent() == CONTENT_MUD
|
||||
|| vmanip.m_data[i].getContent() == CONTENT_GRASS)
|
||||
vmanip.m_data[i] = MapNode(CONTENT_STONE);
|
||||
vmanip.m_data[i] = MapNode(base_content);
|
||||
}
|
||||
|
||||
current_depth++;
|
||||
|
|
Loading…
Reference in New Issue