diff --git a/bigstuff.cpp b/bigstuff.cpp index d2482258..8f6344af 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -33,6 +33,9 @@ int roundTableRadius(cell *c) { } int celldistAltRelative(cell *c) { + if(sphere || quotient) { + return celldist(c) - 3; + } if(tactic::on) return getAnthraxData(c, false); return celldistAlt(c) - roundTableRadius(c); } @@ -81,7 +84,7 @@ cell *findcompass(cell *c) { } bool grailWasFound(cell *c) { - if(euclid) return items[itHolyGrail]; + if(euclid || quotient || sphere) return items[itHolyGrail]; return c->master->alt->alt->emeraldval & GRAIL_FOUND; } @@ -1079,6 +1082,8 @@ void doOvergenerate() { int dcs = size(dcal); for(int i=0; iland == laCaribbean)) continue; + if(weirdhyperbolic && (c->land == laStorms || c->land == laCamelot || c->land == laTemple || c->land == laOcean)) continue; if(c->cpdist <= sightrange-6) setdist(c, 1, NULL); } } @@ -1099,7 +1104,7 @@ void moreBigStuff(cell *c) { } if(c->land == laStorms) - if(!euclid) { + if(!euclid && !quotient && !sphere) { if(c->master->alt && c->master->alt->distance <= 2) { generateAlts(c->master); preventbarriers(c); diff --git a/cell.cpp b/cell.cpp index 6c155c1c..8f7a520d 100644 --- a/cell.cpp +++ b/cell.cpp @@ -810,9 +810,12 @@ int celldistAlt(cell *c) { decodeMaster(c->master, x, y); return euclidAlt(x, y); } + if(sphere || quotient) { + return celldist(c) - 3; + } if(!c->master->alt) return 0; if(ctof(c)) return c->master->alt->distance; - int dx[MAX_S3]; + int dx[MAX_S3]; dx[0] = 0; for(int u=0; umaster->alt == NULL) return ALTDIST_UNKNOWN; for(int u=0; u= d2) { cl1 = chosenDown(cl1, -1, 0, celldist); diff --git a/complex.cpp b/complex.cpp index 71ab30f4..e345742e 100644 --- a/complex.cpp +++ b/complex.cpp @@ -508,7 +508,7 @@ namespace princess { } info *getPrisonInfo(cell *c) { - if(euclid) return NULL; + if(euclid || quotient || sphere) return NULL; if(c->land != laPalace) return NULL; if(!c->master->alt) return NULL; int ev = c->master->alt->alt->emeraldval; // NEWYEARFIX @@ -734,50 +734,54 @@ namespace clearing { std::map bpdata; int plantdir(cell *c) { - generateAlts(c->master); - for(int i=0; i<7; i++) - generateAlts(c->master->move[i]); + if(!quotient) { + generateAlts(c->master); + for(int i=0; imaster->move[i]); + } int d = celldistAlt(c); if(nontruncated) { - for(int i=0; i<7; i++) { + for(int i=0; imov[i]; if(celldistAlt(c2) == d) { bool useful = false; - for(int j=1; j<6; j++) { + for(int j=1; j celldistAlt(bd.root)) { + stepcount++; + if(stepcount > 1000) { + printf("buggy #1\n"); + return; + } if(c->mpdist <= 6) { if(c->monst != moMutant) return; // already cut! @@ -853,7 +865,7 @@ namespace clearing { } rpath.push_back(bd.root); // printf("r [%4d] %p -> %p\n", celldistAlt(bd.root), bd.root, bd.root->mov[plantdir(bd.root)]); - bd.root = bd.root->mov[plantdir(bd.root)]; + bd.root = createMov(bd.root, plantdir(bd.root)); } } @@ -3363,6 +3375,7 @@ namespace dungeon { */ if(euclid) { + if(torus) return; eucoord x, y; decodeMaster(c->master, x, y); string tab[] = { diff --git a/landgen.cpp b/landgen.cpp index 94c38af9..80cf4b09 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -633,7 +633,7 @@ void giantLandSwitch(cell *c, int d, cell *from) { havewhat |= HF_DRAGON; // printf("dragon generated with dchance = %d\n", dchance); vector possi; - for(int t=0; t<6; t++) if(c->mov[t]->mpdist > c->mpdist) possi.push_back(t); + for(int t=0; ttype; t++) if(c->mov[t]->mpdist > c->mpdist) possi.push_back(t); if(size(possi)) { int i = possi[hrand(size(possi))]; int dragonlength = 6 + items[itDragon] / 2; @@ -1565,7 +1565,7 @@ void giantLandSwitch(cell *c, int d, cell *from) { } else if(items[itHunting] < 10) { vector next; - forCellEx(c2, c) if(c2->mpdist > 7 && c2->type == 6) next.push_back(c2); + forCellEx(c2, c) if(c2->mpdist > 7 && (nontruncated || !ctof(c2))) next.push_back(c2); if(size(next)) { c->item = itHunting; cell *c3 = next[hrand(size(next))]; @@ -2066,7 +2066,7 @@ void setdist(cell *c, int d, cell *from) { if(d >= BARLEV) { - if(!c->land && from->land != laElementalWall && from->land != laHauntedWall && from->land != laOceanWall && + if(!c->land && from && from->land != laElementalWall && from->land != laHauntedWall && from->land != laOceanWall && from->land != laBarrier) { if(!hasbardir(c)) setland(c, from->land); }