forked from oerkki/voxelands
enchantments pt 5? - gems in mapgen
This commit is contained in:
parent
c958cee813
commit
cd9b5bc6fa
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 |
|
@ -107,8 +107,6 @@ public:
|
||||||
chardef += std::string(":")+m_parts["hairtone"];
|
chardef += std::string(":")+m_parts["hairtone"];
|
||||||
chardef += std::string(":")+m_parts["hair"];
|
chardef += std::string(":")+m_parts["hair"];
|
||||||
chardef += std::string(":")+m_parts["face"];
|
chardef += std::string(":")+m_parts["face"];
|
||||||
|
|
||||||
printf("chardef '%s'\n",chardef.c_str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -3020,11 +3020,8 @@ bool ForgeNodeMetadata::step(float dtime, v3s16 pos, ServerEnvironment *env)
|
||||||
items[i]
|
items[i]
|
||||||
&& (items[i]->getContent()&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK
|
&& (items[i]->getContent()&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK
|
||||||
&& items[i]->getData() > 0
|
&& items[i]->getData() > 0
|
||||||
) {
|
)
|
||||||
printf("CRAFT: pre: %X %X\n",data,items[i]->getData());
|
|
||||||
enchantment_set(&data,items[i]->getData());
|
enchantment_set(&data,items[i]->getData());
|
||||||
printf("CRAFT: post: %X %X\n",data,items[i]->getData());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
result->setData(data);
|
result->setData(data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,9 @@ DiggingProperties getDiggingProperties(content_t content, content_t tool, u16 da
|
||||||
case ENCHANTMENT_LONGLASTING:
|
case ENCHANTMENT_LONGLASTING:
|
||||||
wear /= (info.level+1);
|
wear /= (info.level+1);
|
||||||
break;
|
break;
|
||||||
|
case ENCHANTMENT_FLAME:
|
||||||
|
wear *= 2.5;
|
||||||
|
break;
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,7 +230,6 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize)
|
||||||
|
|
||||||
v2s32 pos = basepos;
|
v2s32 pos = basepos;
|
||||||
pos.Y = (m_fields.size()+1*50);
|
pos.Y = (m_fields.size()+1*50);
|
||||||
printf("%d\n",pos.Y);
|
|
||||||
v2s32 size = DesiredRect.getSize();
|
v2s32 size = DesiredRect.getSize();
|
||||||
rect = core::rect<s32>(size.X/2-150, pos.Y, (size.X/2-150)+300, pos.Y+30);
|
rect = core::rect<s32>(size.X/2-150, pos.Y, (size.X/2-150)+300, pos.Y+30);
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -1494,12 +1494,32 @@ void make_block(BlockMakeData *data)
|
||||||
s16 x = mineralrandom.range(node_min.X+1, node_max.X-1);
|
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 y = mineralrandom.range(node_min.Y+1, node_max.Y-1);
|
||||||
s16 z = mineralrandom.range(node_min.Z+1, node_max.Z-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++) {
|
for (u16 i=0; i<27; i++) {
|
||||||
v3s16 p = v3s16(x,y,z) + g_27dirs[i];
|
v3s16 p = v3s16(x,y,z) + g_27dirs[i];
|
||||||
u32 vi = vmanip.m_area.index(p);
|
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)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,4 +134,39 @@ void init_mineral()
|
||||||
f->texture = "mineral_mithril.png";
|
f->texture = "mineral_mithril.png";
|
||||||
f->dug_item = CONTENT_CRAFTITEM_MITHRIL_RAW;
|
f->dug_item = CONTENT_CRAFTITEM_MITHRIL_RAW;
|
||||||
f->min_level = 3;
|
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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,11 @@
|
||||||
#define MINERAL_GOLD 6
|
#define MINERAL_GOLD 6
|
||||||
#define MINERAL_QUARTZ 7
|
#define MINERAL_QUARTZ 7
|
||||||
#define MINERAL_MITHRIL 8
|
#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 {
|
struct MineralFeatures {
|
||||||
std::string texture;
|
std::string texture;
|
||||||
|
|
|
@ -90,7 +90,7 @@ SHA1::~SHA1()
|
||||||
void SHA1::process()
|
void SHA1::process()
|
||||||
{
|
{
|
||||||
assert( unprocessedBytes == 64 );
|
assert( unprocessedBytes == 64 );
|
||||||
//printf( "process: " ); hexPrinter( bytes, 64 ); printf( "\n" );
|
|
||||||
int t;
|
int t;
|
||||||
Uint32 a, b, c, d, e, K, f, W[80];
|
Uint32 a, b, c, d, e, K, f, W[80];
|
||||||
// starting values
|
// starting values
|
||||||
|
@ -129,7 +129,6 @@ void SHA1::process()
|
||||||
c = lrot(b,30);
|
c = lrot(b,30);
|
||||||
b = a;
|
b = a;
|
||||||
a = temp;
|
a = temp;
|
||||||
//printf( "t=%d %08x %08x %08x %08x %08x\n",t,a,b,c,d,e );
|
|
||||||
}
|
}
|
||||||
/* add variables */
|
/* add variables */
|
||||||
H0 += a;
|
H0 += a;
|
||||||
|
@ -137,7 +136,6 @@ void SHA1::process()
|
||||||
H2 += c;
|
H2 += c;
|
||||||
H3 += d;
|
H3 += d;
|
||||||
H4 += e;
|
H4 += e;
|
||||||
//printf( "Current: %08x %08x %08x %08x %08x\n",H0,H1,H2,H3,H4 );
|
|
||||||
/* all bytes have been processed */
|
/* all bytes have been processed */
|
||||||
unprocessedBytes = 0;
|
unprocessedBytes = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue