1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-02-07 22:50:10 +00:00

fixed the issues with Orb of Yendor

This commit is contained in:
Zeno Rogue 2020-09-21 12:04:50 +02:00
parent 7cc9e146cb
commit 4aeb4e6287

View File

@ -253,10 +253,13 @@ EX namespace yendor {
ycw--; if(S3 == 3) ycw--; ycw--; if(S3 == 3) ycw--;
setdist(nyi.path[0], 7, NULL); setdist(nyi.path[0], 7, NULL);
int last_id = 0;
for(int i=0; i<YDIST-1; i++) { for(int i=0; i<YDIST-1; i++) {
if(i > BARLEV-6) { if(i > BARLEV-6) {
setdist(nyi.path[i+7-BARLEV], 7, nyi.path[i+6-BARLEV]); last_id = i+7-BARLEV;
setdist(nyi.path[last_id], 7, nyi.path[i+6-BARLEV]);
if(challenge && !euclid && ycw.at->land != laIvoryTower) { if(challenge && !euclid && ycw.at->land != laIvoryTower) {
eLand ycl = changeland(i, ycw.at->land); eLand ycl = changeland(i, ycw.at->land);
if(ycl) { if(ycl) {
@ -373,10 +376,12 @@ EX namespace yendor {
} }
} }
if(ycw.at->land == laMirror || inmirror(ycw.at)) while(last_id < i && (nyi.path[last_id]->land == laMirror || inmirror(nyi.path[last_id]))) {
setdist(ycw.at, 7, nullptr); last_id++;
setdist(nyi.path[last_id], 7, nullptr);
}
ycw = mirror::reflect(ycw); if(inmirror(ycw.at)) ycw = mirror::reflect(ycw);
ycw += wstep; ycw += wstep;
nyi.path[i+1] = ycw.at; nyi.path[i+1] = ycw.at;
} }
@ -396,11 +401,13 @@ EX namespace yendor {
setdist(nyi.path[YDIST-1], 7, nyi.path[YDIST-2]); setdist(nyi.path[YDIST-1], 7, nyi.path[YDIST-2]);
cell *key = nyi.path[YDIST-1]; cell *key = nyi.path[YDIST-1];
generating = false;
for(int b=10; b>=5; b--) setdist(key, b, nyi.path[YDIST-2]); for(int b=10; b>=5; b--) setdist(key, b, nyi.path[YDIST-2]);
if(inmirror(key) || (geometry == gNormal && celldistance(key, yendor) < YDIST/2)) { if(inmirror(key) || (geometry == gNormal && celldistance(key, yendor) < YDIST/2)) {
creation_attempt++; creation_attempt++;
if(creation_attempt > -100) { if(creation_attempt > 100) {
yendor->item = itNone; yendor->item = itNone;
addMessage(XLAT("%The1 turned out to be an illusion!", itOrbYendor)); addMessage(XLAT("%The1 turned out to be an illusion!", itOrbYendor));
return false; return false;
@ -408,9 +415,6 @@ EX namespace yendor {
goto retry; goto retry;
} }
generating = false;
for(int i=-1; i<key->type; i++) { for(int i=-1; i<key->type; i++) {
cell *c2 = i >= 0 ? key->move(i) : key; cell *c2 = i >= 0 ? key->move(i) : key;
checkTide(c2); checkTide(c2);