1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-20 23:50:27 +00:00

3d::binary:: make the land barriers more like planes by pushing them by a number depending on btwidth

This commit is contained in:
Zeno Rogue 2019-03-10 12:04:29 +01:00
parent 4633231721
commit 225282a3eb
3 changed files with 21 additions and 5 deletions

View File

@ -87,14 +87,22 @@ namespace binary {
if(parent->c7) h->c7 = newCell(t, h);
h->cdata = NULL;
h->zebraval = side;
if(DIM == 3) {
h->emeraldval = 0;
if(DIM == 3 && h->c7) {
if(!parent->emeraldval) parent->emeraldval = currentmap->gamestart()->land;
eLand z = eLand(parent->emeraldval);
int chance = 0;
if(specialland == laCrossroads4) chance = wallchance(parent->c7, deep_ocean_at(parent->c7, parent->c7));
if(specialland == laCrossroads4) {
eLand x = parent->c7->land;
parent->c7->land = z;
chance = wallchance(parent->c7, deep_ocean_at(parent->c7, parent->c7));
parent->c7->land = x;
}
if(chaosmode) chance = 1000;
if(chance && hrand(40000) < chance)
h->c7->land = getNewLand(parent->c7->land);
h->emeraldval = getNewLand(z);
else
h->c7->land = parent->c7->land;
h->emeraldval = z;
}
#if DEBUG_BINARY_TILING
xcode[h] = expected_xcode(parent, d);

View File

@ -67,7 +67,7 @@ hrmap_hyperbolic::hrmap_hyperbolic() {
binary::xcode[&h] = (1 << 16);
binary::rxcode[1<<16] = &h;
#endif
h.zebraval = 0,
h.zebraval = 0, h.emeraldval = 0,
h.c7 = newCell(DIM == 3 ? S7 : 6, origin);
}
#endif

View File

@ -2452,6 +2452,14 @@ void setdist(cell *c, int d, cell *from) {
if(d >= BARLEV) {
if(binarytiling && DIM == 3 && !c->land) {
ld z = vid.binary_width;
cell *cseek = c;
int step = 0;
while(z < 3.999 && step < 10) cseek = cseek->cmove(S7-1), z *= 2;
if(cseek->master->emeraldval) setland(c, eLand(cseek->master->emeraldval));
}
if(!c->land && from && from->land != laElementalWall && from->land != laHauntedWall && from->land != laOceanWall &&
from->land != laBarrier && !quotient) {
if(!hasbardir(c)) setland(c, from->land);