1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

3d:: binary:: land boundaries

This commit is contained in:
Zeno Rogue 2019-03-09 23:56:12 +01:00
parent e6ff760253
commit 4591c2166e
4 changed files with 32 additions and 11 deletions

View File

@ -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!");

View File

@ -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; i<from->type; 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; i<from->type; 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

View File

@ -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])) {

View File

@ -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();