1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

fixed glitches in Warp+Mirror

This commit is contained in:
Zeno Rogue 2017-11-06 23:11:40 +01:00
parent 42b1e36cbc
commit 483e335db8
6 changed files with 55 additions and 12 deletions

View File

@ -354,7 +354,7 @@ int killtypes() {
}
bool isWarped(cell *c) {
return isWarped(c->land) || (items[itOrb37] && c->cpdist <= 4);
return isWarped(c->land) || (!inmirrororwall(c->land) && (items[itOrb37] && c->cpdist <= 4));
}
// returns ishept in the normal tiling;

View File

@ -3647,8 +3647,10 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
else if(isWarped(c) && !nontruncated && !shmup::on) {
int np = mapeditor::nopattern(c);
if(c->landparam == 1337) np = 0; // for the achievement screenshot
if(np < 11)
if(np < 13)
qfloor(c, Vf, applyPatterndir(c), shTriheptaFloor[np], darkena(fcol, fd, 0xFF));
else
qfloor(c, Vf, shFloor[ctof(c)], darkena(fcol, fd, 0xFF));
}
else if(wmplain) {

View File

@ -2107,3 +2107,5 @@ void runGeometryExperiments();
extern vector<eLand> landlist;
template<class T> void generateLandList(T t);
int isLandValid(eLand l);
bool inmirrororwall(eLand l);

View File

@ -350,6 +350,10 @@ bool inmirror(eLand l) {
return l == laMirrored || l == laMirrorWall2 || l == laMirrored2;
}
bool inmirrororwall(eLand l) {
return l == laMirrored || l == laMirrorWall2 || l == laMirrored2 || l == laMirrorWall;
}
bool inmirror(cell *c) {
return inmirror(c->land);
}

View File

@ -285,6 +285,7 @@ namespace mapeditor {
u += 2;
if(!ishept(c->mov[v])) qhex++;
}
if(u == 8 && qhex == 2) return 12;
if(u == 2 && qhex == 1) return 8;
if(u == 6 && qhex == 2) return 10;
return u;
@ -294,10 +295,17 @@ namespace mapeditor {
bool reflectPatternAt(cell *c, char p = whichPattern) {
if(p == 'p' && polarb50(c)) return true;
if(p == 0 && nopattern(c) == 4) {
if(p == 0) {
int np = nopattern(c);
if(np == 4) {
int d = patterndir(c);
return !isWarped(createMov(c, (d+1)%6));
}
}
if(np == 12) {
int d = patterndir(c);
return !isWarped(createMov(c, (d+1)%6));
}
}
return false;
}
@ -367,33 +375,54 @@ namespace mapeditor {
if(euclid) return 0;
int u = nopattern(c);
if(u == 6)
if(u == 6) {
for(int i=1; i<c->type; i+=2) if(!isWarped(createMov(c,i)))
return i;
}
if(u == 2 || u == 3 || u == 8)
else if(u == 2 || u == 3 || u == 8) {
for(int i=0; i<c->type; i++) if(!isWarped(createMov(c,i)))
return i;
}
if(u == 4 || u == 10)
else if(u == 4 || u == 10) {
for(int i=0; i<c->type; i+=2) if(!isWarped(createMov(c,i)))
return i;
}
if(u == 6)
else if(u == 6) {
for(int i=1; i<c->type; i+=2) if(!isWarped(createMov(c,i)))
return i;
}
if(u == 5)
else if(u == 5) {
for(int i=0; i<c->type; i++) if(!isWarped(createMov(c,(i+3)%7)) && !isWarped(createMov(c,(i+4)%7)))
return i;
}
if(u == 9)
else if(u == 9) {
for(int i=0; i<c->type; i++) if(!isWarped(createMov(c,(i+2)%7)) && !isWarped(createMov(c,(i+5)%7)))
return i;
}
if(u == 7)
else if(u == 11) {
for(int i=0; i<c->type; i++) if(isWarped(createMov(c,(i)%7)) && isWarped(createMov(c,(i+1)%7)))
return i;
}
else if(u == 12) {
for(int i=0; i<c->type; i+=2) if(isWarped(createMov(c,i)))
return i;
}
else if(u == 7) {
for(int i=0; i<c->type; i++) if(!isWarped(createMov(c,(i+1)%7)) && !isWarped(createMov(c,(i+6)%7)))
return i;
}
else if(u < 2) return 0;
printf("unhandled: u=%d\n", u);
}
}
return 0;

View File

@ -740,7 +740,7 @@ hpcshape
shMercuryBridge[2],
shLeafFloor[2],
shBarrowFloor[3],
shTriheptaFloor[11], shTriheptaFloor2[2], shTriheptaEuc[3],
shTriheptaFloor[13], shTriheptaFloor2[2], shTriheptaEuc[3],
shCross, shGiantStar[2], shLake, shMirror,
shHalfFloor[3], shHalfMirror[3],
shGem[2], shStar, shDisk, shDiskT, shDiskS, shDiskM, shDiskSq, shRing,
@ -1624,8 +1624,10 @@ void buildpolys() {
bshape(shTriheptaFloor[5], PPR_FLOOR, scalef, 35);
bshape(shTriheptaFloor[6], PPR_FLOOR, scalef, 36);
bshape(shTriheptaFloor[7], PPR_FLOOR, scalef, 37);
bshape(shTriheptaFloor[12], PPR_FLOOR, scalef, 373);
bshape(shTriheptaFloor[9], PPR_FLOOR, scalef, 38);
bshape(shTriheptaFloor[10], PPR_FLOOR, scalef, 39);
bshape(shTriheptaFloor[11], PPR_FLOOR, scalef, 372);
bshape(shTriheptaFloor2[0], PPR_FLOOR, scalef, 40);
bshape(shTriheptaFloor2[1], PPR_FLOOR, scalef, 41);
bshape(shSemiFloorShadow, PPR_FLOOR, scalef, 263);
@ -3148,6 +3150,10 @@ NEWSHAPE, 368, 5, 1, -0.722750,-0.522024, -0.310675,-0.189104, -0.809015,-0.0528
NEWSHAPE, 369, 6, 1, 1.125689,-0.648796, 0.574166,-0.456509, 0.822679,-1.131184, 0.174168,-0.605003, 0.411340,-1.336854,
NEWSHAPE, 370, 7, 1, 1.034599,-1.366924, 0.528060,-0.892063, 0.490794,-1.701844, 0.081991,-0.819912, 0.042928,-1.637383,
NEWSHAPE, 371, 1, 1, -0.013726,-0.304365, 0.244972,-0.147728, 0.266167,0.130112, 0.156825,0.210539, -0.271641,0.147226, -0.281599,-0.145412,
NEWSHAPE, 372, 1, 1, -0.514563,-0.238476, -0.340659,0.172987, -0.100245,0.368967, 0.214334,0.276255, 0.349294,-0.008293, 0.203063,-0.280225, -0.078470,-0.352806,
NEWSHAPE, 373, 1, 1, -0.019312,0.304743, -0.289045,0.177117, -0.127176,-0.240665, 0.007400,-0.336712, 0.257684,-0.184398, 0.234654,0.191587,
NEWSHAPE
};