From 4591c2166ecc634fd70598e14ec537794463ae43 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 9 Mar 2019 23:56:12 +0100 Subject: [PATCH] 3d:: binary:: land boundaries --- barriers.cpp | 3 +++ bigstuff.cpp | 29 ++++++++++++++++++----------- binary-tiling.cpp | 9 +++++++++ hyper.h | 2 ++ 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/barriers.cpp b/barriers.cpp index a8552d65..879350cc 100644 --- a/barriers.cpp +++ b/barriers.cpp @@ -733,6 +733,9 @@ void buildCrossroads2(cell *c) { bool buildBarrierNowall(cell *c, eLand l2, int forced_dir) { + // 3D binary tilings create walls using their own methods + if(DIM == 3 && binarytiling) return false; + if(c->land == laNone) { printf("barrier nowall! [%p]\n", c); raiseBuggyGeneration(c, "barrier nowall!"); diff --git a/bigstuff.cpp b/bigstuff.cpp index 7196f909..70c8e8ee 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -1007,35 +1007,42 @@ bool gp_wall_test() { #endif return true; } - -void buildBigStuff(cell *c, cell *from) { - if(sphere || quotient) return; - bool deepOcean = false; + +bool deep_ocean_at(cell *c, cell *from) { + + if(generatingEquidistant) return false; if(c->land == laOcean) { - if(!from) deepOcean = true; + if(!from) return true; else for(int i=0; itype; i++) { cell *c2 = from->move(i); if(c2 && c2->land == laOcean && c2->landparam > 30) { - deepOcean = true; + return true; } if(c2) forCellEx(c3, c2) if(c3 && c3->land == laOcean && c3->landparam > 30) - deepOcean = true; + return true; } } if(c->land == laGraveyard) { - if(!from) deepOcean = true; + if(!from) return true; else for(int i=0; itype; i++) { cell *c2 = from->move(i); if(c2 && c2->landparam > HAUNTED_RADIUS+5) - deepOcean = true; + return true; if(c2) forCellEx(c3, c2) if(c3 && c3->land == laGraveyard && c3->landparam > HAUNTED_RADIUS+5) - deepOcean = true; + return true; } } - if(generatingEquidistant) deepOcean = false; + return false; + } + + +void buildBigStuff(cell *c, cell *from) { + if(sphere || quotient) return; + bool deepOcean = deep_ocean_at(c, from); + // if(weirdhyperbolic && c->land == laOcean) deepOcean = c->landparam >= 30; // buildgreatwalls diff --git a/binary-tiling.cpp b/binary-tiling.cpp index 568c50c6..20227ca4 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -87,6 +87,15 @@ namespace binary { if(parent->c7) h->c7 = newCell(t, h); h->cdata = NULL; h->zebraval = side; + if(DIM == 3) { + int chance = 0; + if(specialland == laCrossroads4) chance = wallchance(parent->c7, deep_ocean_at(parent->c7, parent->c7)); + if(chaosmode) chance = 1000; + if(chance && hrand(40000) < chance) + h->c7->land = getNewLand(parent->c7->land); + else + h->c7->land = parent->c7->land; + } #if DEBUG_BINARY_TILING xcode[h] = expected_xcode(parent, d); if(rxcode.count(xcode[h])) { diff --git a/hyper.h b/hyper.h index 3afdab91..98f0cfb6 100644 --- a/hyper.h +++ b/hyper.h @@ -3965,6 +3965,8 @@ bool ishex1(cell *c); namespace fieldpattern { int fieldval_uniq(cell *c); int fieldval_uniq_rand(cell *c, int d); } bool warptype(cell *c); bool horo_ok(); +bool deep_ocean_at(cell *c, cell *from); +int wallchance(cell *c, bool deepOcean); ld master_to_c7_angle();