From 602e6f27db5b62d5599ac95338e60b943197efa2 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 6 Aug 2019 20:59:43 +0200 Subject: [PATCH] generating various lands in Sol --- bigstuff.cpp | 66 +++++++++++++++++++++++++++++++++++++++++++++++----- cell.cpp | 1 + hyper.h | 3 ++- landgen.cpp | 33 +++++++++++++++++++++++++- pattern2.cpp | 1 + 5 files changed, 96 insertions(+), 8 deletions(-) diff --git a/bigstuff.cpp b/bigstuff.cpp index a1e73876..6cc50b95 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -885,13 +885,13 @@ eLand& get_euland(int c) { void clear_euland(eLand first) { euland.resize(max_vec); for(int i=0; imaster->zebraval + 4) >> 3) << 16) + ((c->master->emeraldval + 4) >> 3); + auto& l = euland3_hash[hash]; + if(l == laNone) l = getNewLand(laNone); + setland(c, l); + return; + } + + switch(specialland) { + case laCrossroads: case laCrossroads4: + setland(c, getEuclidLand(c->master->zebraval)); + if(c->land == laBarrier && c->master->emeraldval % 3) c->wall = waBarrier; + break; + case laCrossroads2: + setland(c, getEuclidLand(c->master->emeraldval)); + if(c->land == laBarrier && c->master->zebraval % 3) c->wall = waBarrier; + break; + case laCrossroads3: { + int ox = c->master->zebraval - 8; + int oy = c->master->emeraldval - 8; + int hash = (((ox + 16) >> 5) << 16) + ((oy + 16) >> 5); + auto& l = euland3_hash[hash]; + if(l == laNone) l = getNewLand(laCrossroads3); + if(ox % 16 == 0) setland(c, laBarrier); + else if(oy % 16 == 0) setland(c, laBarrier); + else setland(c, l); + if(c->land == laBarrier && ((c->master->zebraval & 3) || (c->master->emeraldval & 3))) c->wall = waBarrier; + break; + } + case laElementalWall: { + int ox = c->master->zebraval - 4; + int oy = c->master->emeraldval - 4; + int x = (ox & 7) ? ((ox & 8) ? 1 : -1) : 0; + int y = (oy & 7) ? ((oy & 8) ? 1 : -1) : 0; + elementalXY(c, x, y, (ox & 3) || (oy & 3)); + break; + } + case laTerracotta: + if((c->master->zebraval & 7) == 4 && (c->master->emeraldval & 7) == 4) { + setland(c, laMercuryRiver); + c->wall = waMercury; + } + break; + case laOcean: case laIvoryTower: case laEndorian: case laDungeon: + if(c->master->zebraval <= 0) setland(c, laRlyeh); + else c->landparam = c->master->zebraval; + break; + default: ; + } + } + void setLandEuclid(cell *c) { #if CAP_RACING if(racing::track_ready) { @@ -1523,7 +1577,7 @@ int masterAlt(cell *c) { void moreBigStuff(cell *c) { - if((bearsCamelot(c->land) && !euclid && !quotient) || c->land == laCamelot) + if((bearsCamelot(c->land) && !euclid && !quotient && !nil) || c->land == laCamelot) if(eubinary || binarytiling || c->master->alt) if(!(binarytiling && specialland != laCamelot)) buildCamelot(c); diff --git a/cell.cpp b/cell.cpp index 797fd12b..22282fb5 100644 --- a/cell.cpp +++ b/cell.cpp @@ -443,6 +443,7 @@ int celldistAlt(cell *c) { #if CAP_BT if(binarytiling || sol) return c->master->distance + (specialland == laCamelot && !tactic::on? 30 : 0); #endif + if(nil) return c->master->zebraval + abs(c->master->emeraldval) + (specialland == laCamelot && !tactic::on? 30 : 0);; #if CAP_CRYSTAL if(geometry == gCrystal) return crystal::dist_alt(c); diff --git a/hyper.h b/hyper.h index 560ed5f9..3fe70731 100644 --- a/hyper.h +++ b/hyper.h @@ -106,7 +106,7 @@ void addMessage(string s, char spamtype = 0); #define penrose (ginf[geometry].flags & qPENROSE) // these geometries do not feature alternate structures for horocycles -#define eubinary (euclid || binarytiling || geometry == gCrystal) +#define eubinary (euclid || binarytiling || geometry == gCrystal || nil) #define cgclass (ginf[geometry].cclass) #define euclid (cgclass == gcEuclid) @@ -3076,6 +3076,7 @@ void setLandWeird(cell *c); void moreBigStuff(cell *c); void setLandEuclid(cell *c); void setLandSol(cell *c); +void setLandNil(cell *c); bool checkInTree(cell *c, int maxv); cell *findcompass(cell *c); int edgeDepth(cell *c); diff --git a/landgen.cpp b/landgen.cpp index 5b56bbf9..2bff67be 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -235,7 +235,28 @@ void giantLandSwitch(cell *c, int d, cell *from) { case laPalace: // ------------------------------------------------------------- - if(hyperbolic_not37 || fulltorus || S7 < 5 || archimedean || WDIM == 3) { + if(nil) { + if(fargen) { + int i = hrand(100); + if(c->master->zebraval % 4 == 2 || c->master->emeraldval % 4 == 2) { + if(i < 85) + c->wall = waPalace; + else if(i < 95) + c->wall = waClosedGate; + else + c->wall = waOpenGate; + } + else { + if(i < 10) + c->wall = waTrapdoor; + else if(i < 15) + c->wall = waClosePlate; + else if(i < 20) + c->wall = waOpenPlate; + } + } + } + else if(hyperbolic_not37 || fulltorus || S7 < 5 || archimedean || WDIM == 3) { if(fargen) { int i = hrand(100); if(i < 10) @@ -439,6 +460,11 @@ void giantLandSwitch(cell *c, int d, cell *from) { else if(fulltorus) { c->wall = waCavefloor; } + else if(nil) { + int a = c->master->zebraval % 7; + int b = c->master->emeraldval % 7; + c->wall = (a-3.5) * (a-3.5) + (b-3.5) * (b-3.5) <= 12 ? waCavewall : waCavefloor; + } else if(sol) c->wall = (c->master->zebraval % 7 >= 5 || c->master->emeraldval % 7 >= 5) ? waCavewall : waCavefloor; else if(WDIM == 3 && hyperbolic && !binarytiling) @@ -633,6 +659,10 @@ void giantLandSwitch(cell *c, int d, cell *from) { else if(archimedean && arcm::current.have_line) c->wall = arcm::linespattern(c) ? waVinePlant : waNone; #endif + else if(nil) { + if((c->master->emeraldval & 1) == 1) + c->wall = waVinePlant; + } else if(sol) { if((c->master->distance & 1) == 1 && (c->master->emeraldval % 3)) c->wall = waVinePlant; @@ -2579,6 +2609,7 @@ void setdist(cell *c, int d, cell *from) { else if(euclid) setLandEuclid(c); else if(quotient) { setland(c, specialland); setLandQuotient(c); } else if(sol) setLandSol(c); + else if(nil) setLandNil(c); else if(weirdhyperbolic) setLandWeird(c); } diff --git a/pattern2.cpp b/pattern2.cpp index 526d47ee..dd39310e 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -1296,6 +1296,7 @@ bool pseudohept(cell *c) { if(IRREGULAR) return irr::pseudohept(c); #endif #if CAP_BT + if(nil) return c->master->zebraval & c->master->emeraldval & c->master->fieldval & 1; if(sol) return (c->master->emeraldval % 3 == 2) && (c->master->zebraval % 3 == 2) && (c->master->distance % 2); if(penrose) return kite::getshape(c->master) == kite::pDart; if(binarytiling) return binary::pseudohept(c);