1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-10-31 19:36:16 +00:00

clearing in gBinaryTiling

This commit is contained in:
Zeno Rogue 2021-04-25 11:10:09 +02:00
parent 42b440c1f4
commit a99be21653
2 changed files with 14 additions and 23 deletions

View File

@ -835,35 +835,29 @@ EX namespace clearing {
} }
int plantdir(cell *c) { int plantdir(cell *c) {
if(!quotient) { if(have_alt(c))
currentmap->generateAlts(c->master); gen_alt_around(c);
for(int i=0; i<S7; i++)
currentmap->generateAlts(c->master->move(i));
}
int d = celldistAlt(c); int d = celldistAlt(c);
if(PURE) { if(PURE) {
for(int i=0; i<S7; i++) { forCellIdCM(c2, i, c) {
cell *c2 = createMov(c, i);
if(!pseudohept(c2) && celldistAlt(c2) == d-1) if(!pseudohept(c2) && celldistAlt(c2) == d-1)
return i; return i;
} }
for(int i=0; i<S7; i++) { forCellIdCM(c2, i, c) {
cell *c2 = createMov(c, i);
if(celldistAlt(c2) == d-1) if(celldistAlt(c2) == d-1)
return (i+1) % S7; return geometry == gBinary4 ? i : (i+1) % c->type;
} }
} }
for(int i=1; i<S6; i+=2) { forCellIdCM(c2, i, c) {
cell *c2 = createMov(c, i); if(!pseudohept(c2) && celldistAlt(c2) == d-1)
if(celldistAlt(c2) == d-1)
return i; return i;
} }
int quseful = 0, tuseful = 0, tuseful2 = 0; int quseful = 0, tuseful = 0, tuseful2 = 0;
for(int i=1; i<S6; i+=2) {
cell *c2 = c->move(i); forCellIdCM(c2, i, c) if(!pseudohept(c2)) {
if(celldistAlt(c2) == d) { if(celldistAlt(c2) == d) {
bool useful = false; bool useful = false;
for(int j=1; j<S6; j++) { for(int j=1; j<S6; j++) {
@ -882,7 +876,7 @@ EX namespace clearing {
if(tuseful == (1<<1)+(1<<3)) i = 1; if(tuseful == (1<<1)+(1<<3)) i = 1;
if(tuseful == (1<<5)+(1<<7)) i = 5; if(tuseful == (1<<5)+(1<<7)) i = 5;
if(tuseful == (1<<7)+(1<<1)) i = 7; if(tuseful == (1<<7)+(1<<1)) i = 7;
if((d & 7) < 4) i = (i+2) % S6; if((d & 7) < 4) i = (i+2) % c->type;
return i; return i;
} }
printf("error in plantdir\n"); printf("error in plantdir\n");
@ -894,10 +888,6 @@ EX namespace clearing {
vector<cell*> rpath; vector<cell*> rpath;
EX void generate(cell *c) { EX void generate(cell *c) {
if(sphere) return;
if(NONSTDVAR) return;
if(quotient) return;
if(euclid) { if(euclid) {
if(quotient) return; // fix cylinder if(quotient) return; // fix cylinder
if(pseudohept(c)) return; if(pseudohept(c)) return;
@ -917,10 +907,11 @@ EX namespace clearing {
return; return;
} }
if(!eubinary && !horo_ok()) return;
// cell *oc = c; // cell *oc = c;
if(!euclid) currentmap->generateAlts(c->master); gen_alt(c);
if(pseudohept(c)) return; if(pseudohept(c)) return;
heptagon *a = euclid ? NULL : c->master->alt->alt; heptagon *a = eubinary ? NULL : c->master->alt->alt;
clearingdata& bd(bpdata[a]); clearingdata& bd(bpdata[a]);
if(!bd.root) { bd.root = c; bd.dist = 8; bd.buggy = false; } if(!bd.root) { bd.root = c; bd.dist = 8; bd.buggy = false; }
if(bd.buggy) return; if(bd.buggy) return;

View File

@ -965,7 +965,7 @@ EX land_validity_t& land_validity(eLand l) {
return not_in_chaos; return not_in_chaos;
if(l == laClearing) if(l == laClearing)
if(!(stdeucx || a38 || (a45 && BITRUNCATED) || (a47 && BITRUNCATED)) || NONSTDVAR) if(!(stdeucx || geometry == gBinaryTiling || a38 || (a45 && BITRUNCATED) || (a47 && BITRUNCATED)) || NONSTDVAR)
if(!bounded) if(!bounded)
return not_implemented; return not_implemented;