mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
3d:: binary:: land boundaries
This commit is contained in:
parent
e6ff760253
commit
4591c2166e
@ -733,6 +733,9 @@ void buildCrossroads2(cell *c) {
|
|||||||
|
|
||||||
bool buildBarrierNowall(cell *c, eLand l2, int forced_dir) {
|
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) {
|
if(c->land == laNone) {
|
||||||
printf("barrier nowall! [%p]\n", c);
|
printf("barrier nowall! [%p]\n", c);
|
||||||
raiseBuggyGeneration(c, "barrier nowall!");
|
raiseBuggyGeneration(c, "barrier nowall!");
|
||||||
|
27
bigstuff.cpp
27
bigstuff.cpp
@ -1008,34 +1008,41 @@ bool gp_wall_test() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void buildBigStuff(cell *c, cell *from) {
|
bool deep_ocean_at(cell *c, cell *from) {
|
||||||
if(sphere || quotient) return;
|
|
||||||
bool deepOcean = false;
|
if(generatingEquidistant) return false;
|
||||||
|
|
||||||
if(c->land == laOcean) {
|
if(c->land == laOcean) {
|
||||||
if(!from) deepOcean = true;
|
if(!from) return true;
|
||||||
else for(int i=0; i<from->type; i++) {
|
else for(int i=0; i<from->type; i++) {
|
||||||
cell *c2 = from->move(i);
|
cell *c2 = from->move(i);
|
||||||
if(c2 && c2->land == laOcean && c2->landparam > 30) {
|
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)
|
if(c2) forCellEx(c3, c2) if(c3 && c3->land == laOcean && c3->landparam > 30)
|
||||||
deepOcean = true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(c->land == laGraveyard) {
|
if(c->land == laGraveyard) {
|
||||||
if(!from) deepOcean = true;
|
if(!from) return true;
|
||||||
else for(int i=0; i<from->type; i++) {
|
else for(int i=0; i<from->type; i++) {
|
||||||
cell *c2 = from->move(i);
|
cell *c2 = from->move(i);
|
||||||
if(c2 && c2->landparam > HAUNTED_RADIUS+5)
|
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)
|
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;
|
// if(weirdhyperbolic && c->land == laOcean) deepOcean = c->landparam >= 30;
|
||||||
|
|
||||||
// buildgreatwalls
|
// buildgreatwalls
|
||||||
|
@ -87,6 +87,15 @@ namespace binary {
|
|||||||
if(parent->c7) h->c7 = newCell(t, h);
|
if(parent->c7) h->c7 = newCell(t, h);
|
||||||
h->cdata = NULL;
|
h->cdata = NULL;
|
||||||
h->zebraval = side;
|
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
|
#if DEBUG_BINARY_TILING
|
||||||
xcode[h] = expected_xcode(parent, d);
|
xcode[h] = expected_xcode(parent, d);
|
||||||
if(rxcode.count(xcode[h])) {
|
if(rxcode.count(xcode[h])) {
|
||||||
|
2
hyper.h
2
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); }
|
namespace fieldpattern { int fieldval_uniq(cell *c); int fieldval_uniq_rand(cell *c, int d); }
|
||||||
bool warptype(cell *c);
|
bool warptype(cell *c);
|
||||||
bool horo_ok();
|
bool horo_ok();
|
||||||
|
bool deep_ocean_at(cell *c, cell *from);
|
||||||
|
int wallchance(cell *c, bool deepOcean);
|
||||||
|
|
||||||
ld master_to_c7_angle();
|
ld master_to_c7_angle();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user