More work on local features - hell temple

develop
Petr Mrázek 2010-04-27 23:48:25 +02:00
parent df3efe23fb
commit c37f164c39
3 changed files with 33 additions and 28 deletions

@ -14,10 +14,17 @@ namespace DFHack
enum e_feature enum e_feature
{ {
feature_Other,
feature_Adamantine_Tube, feature_Adamantine_Tube,
feature_Underworld, feature_Underworld,
// add stuff here, don't reorder or delete feature_Hell_Temple,
feature_Other = 10000, };
static char * sa_feature[]=
{
"Other",
"Adamantine Tube",
"Underworld",
"Hell Temple"
}; };
union planecoord union planecoord
{ {

@ -767,6 +767,12 @@ bool Maps::ReadLocalFeatures( std::map <planecoord, std::vector<t_feature *> > &
tftemp.sub_material = p->readDWord( cur_ptr + sub_mat_offset ); tftemp.sub_material = p->readDWord( cur_ptr + sub_mat_offset );
tftemp.type = feature_Adamantine_Tube; tftemp.type = feature_Adamantine_Tube;
} }
else if(name == "feature_init_deep_surface_portalst")
{
tftemp.main_material = p->readWord( cur_ptr + main_mat_offset );
tftemp.sub_material = p->readDWord( cur_ptr + sub_mat_offset );
tftemp.type = feature_Hell_Temple;
}
else else
{ {
tftemp.main_material = -1; tftemp.main_material = -1;

@ -439,20 +439,17 @@ void do_features(API& DF, mapblock40d * block, uint32_t blockX, uint32_t blockY,
gotoxy(printX,printY+1); gotoxy(printX,printY+1);
cprintf("You've discovered it already!"); cprintf("You've discovered it already!");
} }
if(ftr.type == feature_Underworld)
char * matname = "unknown";
// is stone?
if(ftr.main_material == 0)
{ {
char * matname = "unknown"; matname = stonetypes[ftr.sub_material].id;
// is stone?
if(ftr.main_material == 0)
{
matname = stonetypes[ftr.sub_material].id;
}
gotoxy(printX,printY+2);
cprintf("Underworld, material %d/%d : %s", ftr.main_material, ftr.sub_material, matname);
} }
else gotoxy(printX,printY+2);
cprintf("%d:%s, material %d/%d : %s", ftr.type, sa_feature[ftr.type], ftr.main_material, ftr.sub_material, matname);
{ {
gotoxy(printX,printY+2); gotoxy(printX,printY+3);
string name = p->readClassName(p->readDWord( ftr.origin )); string name = p->readClassName(p->readDWord( ftr.origin ));
cprintf("%s", name.c_str()); cprintf("%s", name.c_str());
} }
@ -471,23 +468,18 @@ void do_features(API& DF, mapblock40d * block, uint32_t blockX, uint32_t blockY,
gotoxy(printX,printY+ 5); gotoxy(printX,printY+ 5);
cprintf("You've discovered it already!"); cprintf("You've discovered it already!");
} }
if(ftr.type == feature_Adamantine_Tube) char * matname = "unknown";
{ // is stone?
char * matname = "unknown"; if(ftr.main_material == 0)
// is stone?
if(ftr.main_material == 0)
{
matname = stonetypes[ftr.sub_material].id;
}
gotoxy(printX,printY+6);
cprintf("Underworld, material %d/%d : %s", ftr.main_material, ftr.sub_material, matname);
}
else
{ {
gotoxy(printX,printY+6); matname = stonetypes[ftr.sub_material].id;
string name = p->readClassName(p->readDWord( ftr.origin ));
cprintf("%s", name.c_str());
} }
gotoxy(printX,printY+6);
cprintf("%d:%s, material %d/%d : %s", ftr.type, sa_feature[ftr.type], ftr.main_material, ftr.sub_material, matname);
gotoxy(printX,printY+7);
string name = p->readClassName(p->readDWord( ftr.origin ));
cprintf("%s", name.c_str());
} }
else else
{ {