mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
niltorus improvements
This commit is contained in:
parent
8ba303f0f4
commit
d4b2e0f88b
2
cell.cpp
2
cell.cpp
@ -434,7 +434,7 @@ EX int celldist(cell *c) {
|
||||
}
|
||||
if(fulltorus && WDIM == 2)
|
||||
return get_torus_dist(decodeId(c->master));
|
||||
if(nil) return DISTANCE_UNKNOWN;
|
||||
if(nil && !quotient) return DISTANCE_UNKNOWN;
|
||||
if(euwrap && WDIM == 2)
|
||||
return torusconfig::cyldist(decodeId(c->master), 0);
|
||||
if(masterless)
|
||||
|
@ -778,7 +778,7 @@ EX namespace nilv {
|
||||
|
||||
EX int zgmod(int a, int b) { return b ? gmod(a, b) : a; }
|
||||
|
||||
array<int,3> nilperiod, nilperiod_edit;
|
||||
EX array<int,3> nilperiod, nilperiod_edit;
|
||||
|
||||
struct hrmap_nil : hrmap {
|
||||
unordered_map<mvec, heptagon*> at;
|
||||
@ -854,6 +854,13 @@ EX namespace nilv {
|
||||
}
|
||||
};
|
||||
|
||||
void set_flags() {
|
||||
int coords = 0;
|
||||
for(int a=0; a<3; a++) if(nilperiod[a]) coords++;
|
||||
set_flag(ginf[gNil].flags, qANYQ, coords);
|
||||
set_flag(ginf[gNil].flags, qBOUNDED, coords == 3);
|
||||
}
|
||||
|
||||
EX hyperpoint on_geodesic(hyperpoint s0, hyperpoint s1, ld x) {
|
||||
hyperpoint local = inverse(nisot::translate(s0)) * s1;
|
||||
hyperpoint h = get_inverse_exp(local, 100);
|
||||
@ -907,6 +914,7 @@ EX void show_niltorus3() {
|
||||
dialog::add_action([] {
|
||||
stop_game();
|
||||
nilperiod = nilperiod_edit;
|
||||
set_flags();
|
||||
geometry = gNil;
|
||||
start_game();
|
||||
});
|
||||
@ -1844,6 +1852,13 @@ EX namespace nisot {
|
||||
shift_arg_formula(rots::underlying_scale);
|
||||
return 0;
|
||||
}
|
||||
else if(argis("-nilperiod")) {
|
||||
PHASEFROM(2);
|
||||
if(nil) stop_game();
|
||||
for(int a=0; a<3; a++) { shift(); nilv::nilperiod[a] = argi(); }
|
||||
nilv::set_flags();
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user