mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00:34 +00:00
crystal:: now selectable from the geom exp menu
This commit is contained in:
parent
d2dddc07b6
commit
bc90d0a51a
50
crystal.cpp
50
crystal.cpp
@ -804,29 +804,23 @@ void set_land(cell *c) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_crystal(int sides) {
|
||||||
|
stop_game();
|
||||||
|
set_geometry(gCrystal);
|
||||||
|
set_variation(eVariation::pure);
|
||||||
|
ginf[gCrystal].sides = sides;
|
||||||
|
ginf[gCrystal].vertex = 4;
|
||||||
|
if(sides < MAX_EDGE)
|
||||||
|
ginf[gCrystal].distlimit = distlimit_table[sides];
|
||||||
|
}
|
||||||
|
|
||||||
int readArgs() {
|
int readArgs() {
|
||||||
using namespace arg;
|
using namespace arg;
|
||||||
|
|
||||||
if(0) ;
|
if(0) ;
|
||||||
else if(argis("-crystal")) {
|
else if(argis("-crystal")) {
|
||||||
PHASE(2);
|
PHASEFROM(2);
|
||||||
stop_game();
|
shift(); set_crystal(argi());
|
||||||
geometry = gCrystal; variation = eVariation::pure;
|
|
||||||
shift(); int N = argi();
|
|
||||||
ginf[gCrystal].sides = N;
|
|
||||||
ginf[gCrystal].vertex = 4;
|
|
||||||
if(N < MAX_EDGE)
|
|
||||||
ginf[gCrystal].distlimit = distlimit_table[N];
|
|
||||||
add_bitruncation = false;
|
|
||||||
}
|
|
||||||
else if(argis("-crystalb")) {
|
|
||||||
PHASE(2);
|
|
||||||
stop_game();
|
|
||||||
geometry = gCrystal; variation = eVariation::bitruncated;
|
|
||||||
ginf[gCrystal].sides = 8;
|
|
||||||
ginf[gCrystal].vertex = 3;
|
|
||||||
ginf[gCrystal].distlimit = {7, 5};
|
|
||||||
add_bitruncation = true;
|
|
||||||
}
|
}
|
||||||
else if(argis("-cview")) {
|
else if(argis("-cview")) {
|
||||||
view_coordinates = true;
|
view_coordinates = true;
|
||||||
@ -848,6 +842,26 @@ hrmap *new_map() {
|
|||||||
return new hrmap_crystal;
|
return new hrmap_crystal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void show() {
|
||||||
|
cmode = sm::SIDE | sm::MAYDARK;
|
||||||
|
gamescreen(0);
|
||||||
|
dialog::init(XLAT("multi-dimensional"));
|
||||||
|
for(int i=5; i<=14; i++) {
|
||||||
|
string s;
|
||||||
|
if(i % 2) s = its(i/2) + ".5D";
|
||||||
|
else s = its(i/2) + "D";
|
||||||
|
dialog::addBoolItem(s, geometry == gCrystal && ginf[gCrystal].sides == i && ginf[gCrystal].vertex == 4, 'a' + i - 5);
|
||||||
|
dialog::add_action([i]() { set_crystal(i); start_game(); });
|
||||||
|
}
|
||||||
|
dialog::addBoolItem("4D double bitruncated", ginf[gCrystal].vertex == 3, 'D');
|
||||||
|
dialog::add_action([]() { set_crystal(8); set_variation(eVariation::bitruncated); set_variation(eVariation::bitruncated); });
|
||||||
|
dialog::addBreak(50);
|
||||||
|
dialog::addBoolItem("view coordinates in the cheat mode", view_coordinates, 'v');
|
||||||
|
dialog::add_action([]() { view_coordinates = !view_coordinates; });
|
||||||
|
dialog::addBack();
|
||||||
|
dialog::display();
|
||||||
|
}
|
||||||
|
|
||||||
auto crystalhook = addHook(hooks_args, 100, readArgs)
|
auto crystalhook = addHook(hooks_args, 100, readArgs)
|
||||||
+ addHook(hooks_drawcell, 100, crystal_cell);
|
+ addHook(hooks_drawcell, 100, crystal_cell);
|
||||||
|
|
||||||
|
@ -328,7 +328,9 @@ void showEuclideanMenu() {
|
|||||||
dialog::lastItem().value += validclasses[land_validity(specialland).quality_level];
|
dialog::lastItem().value += validclasses[land_validity(specialland).quality_level];
|
||||||
dialog::add_action([i] {
|
dialog::add_action([i] {
|
||||||
eGeometry targetgeometry = eGeometry(i);
|
eGeometry targetgeometry = eGeometry(i);
|
||||||
if(targetgeometry == gArchimedean)
|
if(targetgeometry == gCrystal)
|
||||||
|
pushScreen(crystal::show);
|
||||||
|
else if(targetgeometry == gArchimedean)
|
||||||
pushScreen(arcm::show);
|
pushScreen(arcm::show);
|
||||||
else {
|
else {
|
||||||
set_geometry(targetgeometry);
|
set_geometry(targetgeometry);
|
||||||
|
1
hyper.h
1
hyper.h
@ -4153,6 +4153,7 @@ namespace crystal {
|
|||||||
void set_land(cell *c);
|
void set_land(cell *c);
|
||||||
int dist_alt(cell *c);
|
int dist_alt(cell *c);
|
||||||
int dist_relative(cell *c);
|
int dist_relative(cell *c);
|
||||||
|
void show();
|
||||||
}
|
}
|
||||||
|
|
||||||
hyperpoint get_warp_corner(cell *c, int cid);
|
hyperpoint get_warp_corner(cell *c, int cid);
|
||||||
|
Loading…
Reference in New Issue
Block a user