inforder:: wall generation

This commit is contained in:
Zeno Rogue 2019-10-10 13:09:31 +02:00
parent b5f6e6f3f5
commit 43f629e9c4
5 changed files with 29 additions and 3 deletions

View File

@ -822,6 +822,8 @@ EX bool buildBarrier3D(cell *c, eLand l2, int forced_dir) {
EX bool buildBarrierNowall(cell *c, eLand l2, int forced_dir IS(NODIR)) {
if(S3 >= OINF) { c->land = l2; return true; }
if(geometry == gBinary4) return false;
#if MAXMDIM >= 4
// 3D binary tilings create walls using their own methods

View File

@ -179,6 +179,7 @@ void hrmap::generateAlts(heptagon *h, int levs, bool link_cdata) {
ho->alt = hm;
if(link_cdata) hm->cdata = (cdata*) ho;
if(levs) currentmap->generateAlts(ho, levs-1, link_cdata);
if(S3 >= OINF) preventbarriers(ho->c7);
}
}
@ -531,6 +532,11 @@ EX void buildEquidistant(cell *c) {
int cv = coastval(createMov(c,i), b);
if(cv < mcv) mcv = cv;
}
if(S3 == OINF) {
c->landparam = mcv + 1;
return;
}
int mcv2 = 0;
@ -1289,6 +1295,11 @@ EX int wallchance(cell *c, bool deepOcean) {
princess::challenge ? 0 :
isElemental(l) ? 4000 :
(yendor::on && (yendor::generating || !(yendor::clev().flags & YF_WALLS))) ? 0 :
(S3 >= OINF && l == laCrossroads) ? 2000 :
(S3 >= OINF && l == laCrossroads2) ? 2500 :
(S3 >= OINF && l == laCrossroads3) ? 3333 :
(S3 >= OINF && l == laCrossroads4) ? 5000 :
(S3 >= OINF && l == laCrossroads5) ? 10000 :
l == laCrossroads3 ? 10000 :
l == laCrossroads ? 5000 :
l == laCrossroads2 ? 10000 :
@ -1415,6 +1426,9 @@ EX void buildBigStuff(cell *c, cell *from) {
else if(weirdhyperbolic && specialland == laElementalWall && hrand(I10000) < 1000 && gp_wall_test())
buildBarrierNowall(c, getNewLand(c->land));
else if(S3 >= OINF && c->land && hrand(I10000) < wallchance(c, deepOcean) && c->bardir != NOBARRIERS)
buildBarrierNowall(c, getNewLand(c->land));
else if(weirdhyperbolic) ; // non-Nowall barriers not implemented yet in weird hyperbolic
@ -1542,6 +1556,7 @@ EX bool openplains(cell *c) {
}
EX void buildCamelotWall(cell *c) {
if(S3 >= OINF) { c->wall = waRubble; return; }
c->wall = waCamelot;
for(int i=0; i<c->type; i++) {
cell *c2 = createMov(c, i);
@ -1715,6 +1730,7 @@ EX void moreBigStuff(cell *c) {
else if(WDIM == 3) {
if(c->master->zebraval != 1) c->wall = waColumn;
}
else if(S3 >= OINF) { }
else if(weirdhyperbolic && !BITRUNCATED) {
if(hrand(100) < 50) c->wall = waColumn;
}

View File

@ -18,7 +18,7 @@ struct hrmap {
virtual vector<cell*>& allcells() { return dcal; }
virtual void verify() { }
virtual void link_alt(const cellwalker& hs) { }
virtual void generateAlts(heptagon *h, int levs = IRREGULAR ? 1 : S3-3, bool link_cdata = true);
virtual void generateAlts(heptagon *h, int levs = IRREGULAR ? 1 : S3 >= OINF ? 1 : S3-3, bool link_cdata = true);
heptagon *may_create_step(heptagon *h, int direction) {
if(h->move(direction)) return h->move(direction);
return create_step(h, direction);
@ -764,7 +764,11 @@ cdata *getHeptagonCdata(heptagon *h) {
cdata mydata = *getHeptagonCdata(h->cmove(dir));
if(S3 == 4) {
if(S3 >= OINF) {
setHeptagonRval(h);
affect(mydata, h->rval0, 1);
}
else if(S3 == 4) {
heptspin hs(h, 0);
while(dmeq((hs+1).cpeek()->dm4, (hs.at->dm4 - 1))) hs = hs + 1 + wstep + 1;
while(dmeq((hs-1).cpeek()->dm4, (hs.at->dm4 - 1))) hs = hs - 1 + wstep - 1;

View File

@ -408,7 +408,7 @@ typedef function<int(struct cell*)> cellfunction;
// passable flags
#define SAGEMELT .1
#define TEMPLE_EACH (among(geometry, gHoroRec, gHoroHex, gKiteDart3) ? 3 : sol ? 6 : (WDIM == 3 && binarytiling) ? 2 : geometry == gSpace435 ? 4 : (WDIM == 3 && hyperbolic) ? 3 : 6)
#define TEMPLE_EACH (among(geometry, gHoroRec, gHoroHex, gKiteDart3) ? 3 : sol ? 6 : (WDIM == 3 && binarytiling) ? 2 : geometry == gSpace435 ? 4 : (WDIM == 3 && hyperbolic) ? 3 : (S3 == OINF) ? 4 : 6)
#define PT(x, y) ((tactic::on || quotient == 2 || daily::on) ? (y) : inv::on ? min(2*(y),x) : (x))
#define ROCKSNAKELENGTH 50
#define WORMLENGTH 15

View File

@ -1205,6 +1205,7 @@ EX bool geosupport_chessboard() {
(archimedean && DUAL) ? arcm::current.support_threecolor_bitruncated() :
#endif
(binarytiling || penrose) ? 0 :
(S3 >= OINF) ? true :
(VALENCE % 2 == 0);
}
@ -1220,6 +1221,7 @@ EX int geosupport_threecolor() {
if(S7 % 2) return 1;
return 2;
}
if(S3 >= OINF) return 0;
if((S7 % 2 == 0) && (S3 == 3))
return 2;
if(a46 && PURE)
@ -1311,6 +1313,7 @@ EX int pattern_threecolor(cell *c) {
if(a4 && PURE) return eupattern4(c);
return eupattern(c) % 3;
}
if(S3 >= OINF) return c->master->distance % 3;
if(S7 == 4 && S3 == 3) {
int codesN[6] = {0,1,2,1,2,0};
#if CAP_GP
@ -1381,6 +1384,7 @@ EX bool pseudohept(cell *c) {
if(penrose) return kite::getshape(c->master) == kite::pDart;
if(binarytiling) return binary::pseudohept(c);
#endif
if(S3 >= OINF) return c->master->distance % 3 == 1;
#if MAXMDIM == 4
if(WDIM == 3) {
if(geometry == gField435) return false;