1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-11 04:37:38 +00:00

changed chamfered to bitruncated

This commit is contained in:
Zeno Rogue
2018-01-06 22:34:03 +01:00
parent 1427147fbc
commit 5bf6d54c7d
40 changed files with 357 additions and 357 deletions

View File

@@ -8,20 +8,20 @@ bool checkBarriersFront(cellwalker bb, int q, bool cross) {
if(bb.c->mpdist < BARLEV) return false;
if(bb.c->mpdist == BUGLEV) return false;
if(bb.c->bardir != NODIR) return false;
if(bb.spin == (nonchamfered ? 3 : 0)) {q--; if(!q) return true; }
if(bb.spin == (nonbitrunc ? 3 : 0)) {q--; if(!q) return true; }
if(!cross) for(int i=0; i<7; i++) {
cellwalker bb2 = bb;
cwspin(bb2, i); cwstep(bb2);
if(bb2.c->bardir != NODIR) return false;
if(!nonchamfered) {
if(!nonbitrunc) {
cwspin(bb2, 4); cwstep(bb2);
if(bb2.c->bardir != NODIR) return false;
}
}
cwstep(bb);
if(!nonchamfered) { cwspin(bb, 3); cwstep(bb); cwspin(bb, 3); cwstep(bb); }
if(!nonbitrunc) { cwspin(bb, 3); cwstep(bb); cwspin(bb, 3); cwstep(bb); }
return checkBarriersBack(bb, q);
}
@@ -48,13 +48,13 @@ bool checkBarriersBack(cellwalker bb, int q, bool cross) {
cellwalker bb2 = bb;
cwspin(bb2, i); cwstep(bb2);
if(bb2.c->bardir != NODIR) return false;
if(!nonchamfered) {
if(!nonbitrunc) {
cwspin(bb2, 4); cwstep(bb2);
if(bb2.c->bardir != NODIR) return false;
}
}
cwspin(bb, 3); cwstep(bb); cwspin(bb, nonchamfered ? 5 : 4);
cwspin(bb, 3); cwstep(bb); cwspin(bb, nonbitrunc ? 5 : 4);
// bool create = cwstepcreates(bb);
cwstep(bb); cwspin(bb, 3);
// if(create && bb.spin == 0) return true;
@@ -87,12 +87,12 @@ bool checkBarriersNowall(cellwalker bb, int q, int dir, eLand l1=laNone, eLand l
}
}
if(nonchamfered && S3==4) {
if(nonbitrunc && S3==4) {
cwspin(bb, dir);
cwstep(bb);
cwspin(bb, dir);
}
else if(nonchamfered) {
else if(nonbitrunc) {
cwspin(bb, 3*dir);
cwstep(bb);
cwspin(bb, -3*dir);
@@ -158,7 +158,7 @@ void setland(cell *c, eLand l) {
void extendcheck(cell *c) {
return;
if(!nonchamfered && c->landparam == 0 && c->barleft != NOWALLSEP) {
if(!nonbitrunc && c->landparam == 0 && c->barleft != NOWALLSEP) {
raiseBuggyGeneration(c, "extend error");
}
}
@@ -176,7 +176,7 @@ void extendBarrierFront(cell *c) {
cellwalker bb(c, c->bardir); setbarrier(bb.c);
cwstep(bb);
if(!nonchamfered) {
if(!nonbitrunc) {
bb.c->barleft = c->barleft;
bb.c->barright = c->barright;
setbarrier(bb.c);
@@ -212,7 +212,7 @@ void extendBarrierFront(cell *c) {
extendBarrier(bb.c);
for(int a=-3; a<=3; a++) if(a) {
bb.c = c; bb.spin = c->bardir; cwspin(bb, nonchamfered?-a:a); cwstep(bb);
bb.c = c; bb.spin = c->bardir; cwspin(bb, nonbitrunc?-a:a); cwstep(bb);
setland(bb.c, a > 0 ? c->barright : c->barleft);
}
}
@@ -224,8 +224,8 @@ void extendBarrierBack(cell *c) {
extendcheck(c);
cellwalker bb(c, c->bardir); setbarrier(bb.c);
cwspin(bb, 3); cwstep(bb); cwspin(bb, nonchamfered?5:4);
setland(bb.c, nonchamfered ? c->barleft : c->barright);
cwspin(bb, 3); cwstep(bb); cwspin(bb, nonbitrunc?5:4);
setland(bb.c, nonbitrunc ? c->barleft : c->barright);
cwstep(bb); cwspin(bb, 3);
bb.c->bardir = bb.spin;
bb.c->barleft = c->barright;
@@ -236,7 +236,7 @@ void extendBarrierBack(cell *c) {
//printf("[D heat %d]\n", (ht^11));
// needed for CR2 to work
if(!nonchamfered) {
if(!nonbitrunc) {
cwstep(bb);
bb.c->barleft = c->barright;
bb.c->barright = c->barleft;
@@ -255,12 +255,12 @@ void extendNowall(cell *c) {
c->barleft = NOWALLSEP_USED;
cellwalker cw(c, c->bardir);
if(!nonchamfered) {
if(!nonbitrunc) {
cwstep(cw);
setland(cw.c, c->barright);
}
if(nonchamfered && S3 == 4) {
if(nonbitrunc && S3 == 4) {
cwstep(cw);
setland(cw.c, c->barright);
cw.c->barleft = NOWALLSEP_USED;
@@ -270,12 +270,12 @@ void extendNowall(cell *c) {
}
for(int i=-1; i<2; i+=2) {
if(nonchamfered && S3==4) {
if(nonbitrunc && S3==4) {
cwspin(cw, i);
cwstep(cw);
cwspin(cw, i);
}
else if(nonchamfered) {
else if(nonbitrunc) {
cwspin(cw, 3*i);
cwstep(cw);
cwspin(cw, -3*i);
@@ -286,7 +286,7 @@ void extendNowall(cell *c) {
}
if(cw.c->barleft != NOWALLSEP_USED) {
cw.c->barleft = NOWALLSEP;
if(S3 == 4 && nonchamfered) {
if(S3 == 4 && nonbitrunc) {
cw.c->barright = c->barright;
cw.c->bardir = cw.spin;
setland(cw.c, c->land);
@@ -298,19 +298,19 @@ void extendNowall(cell *c) {
printf("barright\n");
}// NONEDEBUG
setland(cw.c, c->barright);
if(!nonchamfered) cwspin(cw, i);
if(!nonbitrunc) cwspin(cw, i);
cw.c->bardir = cw.spin;
if(!nonchamfered) cwspin(cw, -i);
if(!nonbitrunc) cwspin(cw, -i);
}
extendcheck(cw.c);
extendBarrier(cw.c);
}
if(nonchamfered && S3==4) {
if(nonbitrunc && S3==4) {
cwspin(cw, -i);
cwstep(cw);
cwspin(cw, -i);
}
else if(nonchamfered) {
else if(nonbitrunc) {
cwspin(cw, 3*i);
cwstep(cw);
cwspin(cw, -3*i);
@@ -325,7 +325,7 @@ void extendNowall(cell *c) {
bool gotit = false;
void extendCR5(cell *c) {
if(nonchamfered) return;
if(nonbitrunc) return;
// if(c->barright == laCrossroads5) extendCR5(c);
eLand forbidden = c->barleft;
eLand forbidden2 = laNone;
@@ -391,14 +391,14 @@ void extendBarrier(cell *c) {
if(firstmirror && c->barleft == laMirror && hrand(100) < 60) {
cellwalker cw(c, c->bardir);
if(!nonchamfered) cwstep(cw);
if(!nonbitrunc) cwstep(cw);
if(cw.c->land != laMirrorWall)
if(buildBarrier6(cw, 1)) return;
}
if(firstmirror && (nonchamfered?c->barleft == laMirror : c->barright == laMirror) && hrand(100) < 60) {
if(firstmirror && (nonbitrunc?c->barleft == laMirror : c->barright == laMirror) && hrand(100) < 60) {
cellwalker cw(c, c->bardir);
if(nonchamfered) {
if(nonbitrunc) {
cwspin(cw, -3); cwstep(cw); cwspin(cw, -3);
// cwspin(cw, 3); cwstep(cw); cwspin(cw, -2); cwstep(cw); cwspin(cw, 3);
}
@@ -414,7 +414,7 @@ void extendBarrier(cell *c) {
) {
cellwalker cw(c, c->bardir);
if(nonchamfered) {
if(nonbitrunc) {
cwstep(cw);
if(isbar4(cw.c)) {
cwstep(cw); cwspin(cw, 3); cwstep(cw); cwspin(cw, -1); cwstep(cw);
@@ -478,7 +478,7 @@ bool buildBarrier6(cellwalker cw, int type) {
if(buggyGeneration) return true;
if(!nonchamfered) {
if(!nonbitrunc) {
cwstep(b[0]);
cwspin(b[1], 1); cwstep(b[1]); cwspin(b[1], 3); cwstep(b[1]);
cwspin(b[2], 4); cwstep(b[2]);
@@ -506,18 +506,18 @@ bool buildBarrier6(cellwalker cw, int type) {
}
if(type == 1) {
if(!(nonchamfered?checkBarriersFront:checkBarriersBack)(b[1], 6, true)) return false;
if(!(nonchamfered?checkBarriersFront:checkBarriersBack)(b[2], 6, true)) return false;
if(!(nonbitrunc?checkBarriersFront:checkBarriersBack)(b[1], 6, true)) return false;
if(!(nonbitrunc?checkBarriersFront:checkBarriersBack)(b[2], 6, true)) return false;
}
else {
if(!(nonchamfered?checkBarriersFront:checkBarriersBack)(b[0], 6, true)) return false;
if(!(nonchamfered?checkBarriersFront:checkBarriersBack)(b[3], 6, true)) return false;
if(!(nonbitrunc?checkBarriersFront:checkBarriersBack)(b[0], 6, true)) return false;
if(!(nonbitrunc?checkBarriersFront:checkBarriersBack)(b[3], 6, true)) return false;
}
for(int d=0; d<4; d++) {
b[d].c->bardir = b[d].spin;
if(nonchamfered) {
if(nonbitrunc) {
b[0].c->barleft = laMirrored, b[0].c->barright = laMirrored2;
b[1].c->barleft = laMirror, b[1].c->barright = laMirrored;
b[2].c->barleft = laMirrored2, b[2].c->barright = laMirrored;
@@ -530,17 +530,17 @@ bool buildBarrier6(cellwalker cw, int type) {
b[3].c->barleft = laMirrored2, b[3].c->barright = laMirrored;
}
(nonchamfered?extendBarrierFront:extendBarrierBack)(b[d].c);
(nonbitrunc?extendBarrierFront:extendBarrierBack)(b[d].c);
}
if(nonchamfered && false) {
if(nonbitrunc && false) {
for(int z=0; z<4; z++)
b[z].c->item = eItem(1+z+4*type);
for(int a=0; a<4; a++)
extendBarrierBack(cwpeek(b[a],0));
}
if(!nonchamfered) {
if(!nonbitrunc) {
setland(cwpeek(cw, 1), laMirrorWall);
setland(cwpeek(cw, 2), laMirrored);
setland(cwpeek(cw, 3), laMirrorWall2);
@@ -594,11 +594,11 @@ bool buildBarrier4(cell *c, int d, int mode, eLand ll, eLand lr) {
cellwalker b1(c, d);
cellwalker b2(c, d);
if(nonchamfered) cwstep(b2);
if(nonbitrunc) cwstep(b2);
else { cwstep(b2); cwspin(b2, 3); cwstep(b2); cwspin(b2, 3); cwstep(b2); }
cellwalker b3(c, d);
if(nonchamfered) {
if(nonbitrunc) {
cwspin(b3, -1); cwstep(b3); cwspin(b3, 3);
}
else {
@@ -606,7 +606,7 @@ bool buildBarrier4(cell *c, int d, int mode, eLand ll, eLand lr) {
}
cellwalker b4(c, d);
if(nonchamfered) {
if(nonbitrunc) {
cwspin(b4, 1); cwstep(b4); cwspin(b4, -3);
}
else {
@@ -642,16 +642,16 @@ bool buildBarrier4(cell *c, int d, int mode, eLand ll, eLand lr) {
c= b4.c; d=b4.spin;
c->bardir = d, c->barleft = ll, c->barright = xr; extendBarrierFront(c);
if(!nonchamfered) for(int a=-3; a<=3; a++) if(a) {
if(!nonbitrunc) for(int a=-3; a<=3; a++) if(a) {
setland(cwpeek(b1, a), a > 0 ? lr : ll);
setland(cwpeek(b2, a), a > 0 ? xr : xl);
setland(cwpeek(b3, a), a > 0 ? lr : xl);
setland(cwpeek(b4, a), a > 0 ? xr : ll);
}
if(nonchamfered) setbarrier(b1.c), setbarrier(b2.c), setbarrier(b3.c), setbarrier(b4.c);
if(nonbitrunc) setbarrier(b1.c), setbarrier(b2.c), setbarrier(b3.c), setbarrier(b4.c);
if(!nonchamfered) {
if(!nonbitrunc) {
cell *cp;
cp = cwpeek(b1, 0);
cp->barleft = ll; cp->barright = lr; setbarrier(cp);
@@ -782,7 +782,7 @@ bool buildBarrierNowall(cell *c, eLand l2, bool force) {
}
for(int i=0; i<3; i++) {
int d = (S3>3 && nonchamfered) ? (2+(i&1)) : dtab[i];
int d = (S3>3 && nonbitrunc) ? (2+(i&1)) : dtab[i];
if(force) d=1;
cellwalker cw(c, d);