enchantments pt 5? - gems in mapgen

This commit is contained in:
darkrose 2015-08-05 17:34:42 +10:00
parent c958cee813
commit cd9b5bc6fa
13 changed files with 67 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

View File

@ -107,8 +107,6 @@ public:
chardef += std::string(":")+m_parts["hairtone"];
chardef += std::string(":")+m_parts["hair"];
chardef += std::string(":")+m_parts["face"];
printf("chardef '%s'\n",chardef.c_str());
}
private:

View File

@ -3020,11 +3020,8 @@ bool ForgeNodeMetadata::step(float dtime, v3s16 pos, ServerEnvironment *env)
items[i]
&& (items[i]->getContent()&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK
&& items[i]->getData() > 0
) {
printf("CRAFT: pre: %X %X\n",data,items[i]->getData());
)
enchantment_set(&data,items[i]->getData());
printf("CRAFT: post: %X %X\n",data,items[i]->getData());
}
}
result->setData(data);
}

View File

@ -115,6 +115,9 @@ DiggingProperties getDiggingProperties(content_t content, content_t tool, u16 da
case ENCHANTMENT_LONGLASTING:
wear /= (info.level+1);
break;
case ENCHANTMENT_FLAME:
wear *= 2.5;
break;
default:;
}
}

View File

@ -230,7 +230,6 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize)
v2s32 pos = basepos;
pos.Y = (m_fields.size()+1*50);
printf("%d\n",pos.Y);
v2s32 size = DesiredRect.getSize();
rect = core::rect<s32>(size.X/2-150, pos.Y, (size.X/2-150)+300, pos.Y+30);
}else{

View File

@ -1494,12 +1494,32 @@ void make_block(BlockMakeData *data)
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);
// TODO: at random, some should be gems
u8 type = mineralrandom.next()%12;
switch (type) {
case 0:
type = MINERAL_RUBY;
break;
case 1:
type = MINERAL_TURQUOISE;
break;
case 2:
type = MINERAL_AMETHYST;
break;
case 3:
type = MINERAL_SAPPHIRE;
break;
case 4:
type = MINERAL_SUNSTONE;
break;
default:
type = MINERAL_MITHRIL;
}
for (u16 i=0; i<27; i++) {
v3s16 p = v3s16(x,y,z) + g_27dirs[i];
u32 vi = vmanip.m_area.index(p);
// TODO: at random, some should be gems
if (vmanip.m_data[vi].getContent() == base_content && mineralrandom.next()%8 == 0)
vmanip.m_data[vi] = MapNode(base_content,MINERAL_MITHRIL);
vmanip.m_data[vi] = MapNode(base_content,type);
}
}

View File

@ -134,4 +134,39 @@ void init_mineral()
f->texture = "mineral_mithril.png";
f->dug_item = CONTENT_CRAFTITEM_MITHRIL_RAW;
f->min_level = 3;
i = MINERAL_RUBY;
f = &mineral_features(i);
f->texture = "mineral_ruby.png";
f->dug_item = CONTENT_CRAFTITEM_RUBY;
f->min_level = 3;
f->dug_count_max = 2;
i = MINERAL_TURQUOISE;
f = &mineral_features(i);
f->texture = "mineral_turquoise.png";
f->dug_item = CONTENT_CRAFTITEM_TURQUOISE;
f->min_level = 3;
f->dug_count_max = 2;
i = MINERAL_AMETHYST;
f = &mineral_features(i);
f->texture = "mineral_amethyst.png";
f->dug_item = CONTENT_CRAFTITEM_AMETHYST;
f->min_level = 3;
f->dug_count_max = 2;
i = MINERAL_SAPPHIRE;
f = &mineral_features(i);
f->texture = "mineral_sapphire.png";
f->dug_item = CONTENT_CRAFTITEM_SAPPHIRE;
f->min_level = 3;
f->dug_count_max = 2;
i = MINERAL_SUNSTONE;
f = &mineral_features(i);
f->texture = "mineral_sunstone.png";
f->dug_item = CONTENT_CRAFTITEM_SUNSTONE;
f->min_level = 3;
f->dug_count_max = 2;
}

View File

@ -38,6 +38,11 @@
#define MINERAL_GOLD 6
#define MINERAL_QUARTZ 7
#define MINERAL_MITHRIL 8
#define MINERAL_RUBY 9
#define MINERAL_TURQUOISE 10
#define MINERAL_AMETHYST 11
#define MINERAL_SAPPHIRE 12
#define MINERAL_SUNSTONE 13
struct MineralFeatures {
std::string texture;

View File

@ -90,7 +90,7 @@ SHA1::~SHA1()
void SHA1::process()
{
assert( unprocessedBytes == 64 );
//printf( "process: " ); hexPrinter( bytes, 64 ); printf( "\n" );
int t;
Uint32 a, b, c, d, e, K, f, W[80];
// starting values
@ -129,7 +129,6 @@ void SHA1::process()
c = lrot(b,30);
b = a;
a = temp;
//printf( "t=%d %08x %08x %08x %08x %08x\n",t,a,b,c,d,e );
}
/* add variables */
H0 += a;
@ -137,7 +136,6 @@ void SHA1::process()
H2 += c;
H3 += d;
H4 += e;
//printf( "Current: %08x %08x %08x %08x %08x\n",H0,H1,H2,H3,H4 );
/* all bytes have been processed */
unprocessedBytes = 0;
}