mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00:34 +00:00
fixed circle/horocycle/equidistant-based lands in euclid4
This commit is contained in:
parent
5f4dbf9193
commit
cafe34ad48
39
bigstuff.cpp
39
bigstuff.cpp
@ -42,25 +42,36 @@ int celldistAltRelative(cell *c) {
|
|||||||
|
|
||||||
int euclidAlt(short x, short y) {
|
int euclidAlt(short x, short y) {
|
||||||
if(specialland == laTemple || specialland == laClearing) {
|
if(specialland == laTemple || specialland == laClearing) {
|
||||||
return max(int(x), x+y);
|
if(euclid6)
|
||||||
|
return max(int(x), x+y);
|
||||||
|
else if(nontruncated)
|
||||||
|
return x + abs(y);
|
||||||
|
else
|
||||||
|
return max(x, y);
|
||||||
}
|
}
|
||||||
else if(specialland == laCaribbean || specialland == laWhirlpool || specialland == laMountain) {
|
else if(specialland == laCaribbean || specialland == laWhirlpool || specialland == laMountain) {
|
||||||
return
|
if(euclid6)
|
||||||
min(
|
return
|
||||||
min(max(int(-x), -x-y) + 3,
|
min(
|
||||||
max(int(x+y), int(y)) + 3),
|
min(max(int(-x), -x-y) + 3,
|
||||||
max(int(x), int(-y)) + 3
|
max(int(x+y), int(y)) + 3),
|
||||||
);
|
max(int(x), int(-y)) + 3
|
||||||
|
);
|
||||||
|
else if(nontruncated)
|
||||||
|
return 3 - min(abs(x-y), abs(x+y));
|
||||||
|
else
|
||||||
|
return 3 - min(abs(x), abs(y));
|
||||||
}
|
}
|
||||||
else if(specialland == laPrincessQuest)
|
else if(specialland == laPrincessQuest)
|
||||||
return eudist(x-EPX, y-EPY);
|
return eudist(x-EPX, y-EPY);
|
||||||
else return eudist(x-20, y-10);
|
else return eudist(x-(a4 ? 21 : 20), y-10);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int NOCOMPASS = 1000000;
|
const int NOCOMPASS = 1000000;
|
||||||
|
|
||||||
int compassDist(cell *c) {
|
int compassDist(cell *c) {
|
||||||
if(c->master->alt) return celldistAlt(c);
|
if(sphere || quotient) return 0;
|
||||||
|
if(euclid || c->master->alt) return celldistAlt(c);
|
||||||
if(isHaunted(c->land) || c->land == laGraveyard) return getHauntedDepth(c);
|
if(isHaunted(c->land) || c->land == laGraveyard) return getHauntedDepth(c);
|
||||||
return NOCOMPASS;
|
return NOCOMPASS;
|
||||||
}
|
}
|
||||||
@ -70,7 +81,8 @@ cell *findcompass(cell *c) {
|
|||||||
if(d == NOCOMPASS) return NULL;
|
if(d == NOCOMPASS) return NULL;
|
||||||
|
|
||||||
while(inscreenrange(c)) {
|
while(inscreenrange(c)) {
|
||||||
generateAlts(c->master);
|
if(!euclid && !sphere && !quotient)
|
||||||
|
generateAlts(c->master);
|
||||||
forCellEx(c2, c) if(compassDist(c2) < d) {
|
forCellEx(c2, c) if(compassDist(c2) < d) {
|
||||||
c = c2;
|
c = c2;
|
||||||
d = compassDist(c2);
|
d = compassDist(c2);
|
||||||
@ -238,14 +250,14 @@ void generateTreasureIsland(cell *c) {
|
|||||||
if((euclid || (c->master->alt && c2->master->alt)) && celldistAlt(c2) < celldistAlt(c)) {
|
if((euclid || (c->master->alt && c2->master->alt)) && celldistAlt(c2) < celldistAlt(c)) {
|
||||||
ctab[qc++] = c2;
|
ctab[qc++] = c2;
|
||||||
qlo = i; qhi = i;
|
qlo = i; qhi = i;
|
||||||
while(true) {
|
while(true && qc < MAX_EDGE) {
|
||||||
qlo--;
|
qlo--;
|
||||||
c2 = createMovR(c, qlo);
|
c2 = createMovR(c, qlo);
|
||||||
if(!euclid && !c2->master->alt) break;
|
if(!euclid && !c2->master->alt) break;
|
||||||
if(celldistAlt(c2) >= celldistAlt(c)) break;
|
if(celldistAlt(c2) >= celldistAlt(c)) break;
|
||||||
ctab[qc++] = c2;
|
ctab[qc++] = c2;
|
||||||
}
|
}
|
||||||
while(true) {
|
while(true && qc < MAX_EDGE) {
|
||||||
qhi++;
|
qhi++;
|
||||||
c2 = createMovR(c, qhi);
|
c2 = createMovR(c, qhi);
|
||||||
if(!euclid && !c2->master->alt) break;
|
if(!euclid && !c2->master->alt) break;
|
||||||
@ -812,7 +824,8 @@ void setLandEuclid(cell *c) {
|
|||||||
}
|
}
|
||||||
if(specialland == laIvoryTower || specialland == laDungeon) {
|
if(specialland == laIvoryTower || specialland == laDungeon) {
|
||||||
int x, y;
|
int x, y;
|
||||||
tie(x,y) = cell_to_pair(c); y -= 5;
|
tie(x,y) = cell_to_pair(c); y = -5 - y;
|
||||||
|
if(specialland == laDungeon) y = -10 - y;
|
||||||
if(y == 0)
|
if(y == 0)
|
||||||
{setland(c, laBarrier); if(ishept(c)) setland(c, laAlchemist); }
|
{setland(c, laBarrier); if(ishept(c)) setland(c, laAlchemist); }
|
||||||
else if(y<0) setland(c, laAlchemist);
|
else if(y<0) setland(c, laAlchemist);
|
||||||
|
12
complex.cpp
12
complex.cpp
@ -3395,7 +3395,7 @@ namespace dungeon {
|
|||||||
if(torus) return;
|
if(torus) return;
|
||||||
int x, y;
|
int x, y;
|
||||||
tie(x, y) = cell_to_pair(c);
|
tie(x, y) = cell_to_pair(c);
|
||||||
string tab[] = {
|
string tab6[] = {
|
||||||
".####...",
|
".####...",
|
||||||
"L...L...",
|
"L...L...",
|
||||||
".L..L...",
|
".L..L...",
|
||||||
@ -3403,13 +3403,21 @@ namespace dungeon {
|
|||||||
"........",
|
"........",
|
||||||
"........"
|
"........"
|
||||||
};
|
};
|
||||||
|
string tab4[] = {
|
||||||
|
"L####L..",
|
||||||
|
"L....L..",
|
||||||
|
"L....L..",
|
||||||
|
"L....L..",
|
||||||
|
"........",
|
||||||
|
"........"
|
||||||
|
};
|
||||||
int y0 = y; if(y>32768) y0 -= 65536;
|
int y0 = y; if(y>32768) y0 -= 65536;
|
||||||
|
|
||||||
y0 += 5; y0 %= 12; if(y0<0) y0+=12;
|
y0 += 5; y0 %= 12; if(y0<0) y0+=12;
|
||||||
|
|
||||||
if(y0 >= 6) { y0 -= 6; x += 4; }
|
if(y0 >= 6) { y0 -= 6; x += 4; }
|
||||||
|
|
||||||
char ch = tab[y0][(x+(y+1)/2)&7];
|
char ch = euclid6 ? tab6[y0][(x+(y+1)/2)&7] : tab4[y0][x&7];
|
||||||
|
|
||||||
if(ch == '#')
|
if(ch == '#')
|
||||||
c->wall = waPlatform;
|
c->wall = waPlatform;
|
||||||
|
3
init.cpp
3
init.cpp
@ -352,8 +352,7 @@ void addMessage(string s, char spamtype = 0);
|
|||||||
#define ALPHA (M_PI*2/S7)
|
#define ALPHA (M_PI*2/S7)
|
||||||
#define S7 ginf[geometry].sides
|
#define S7 ginf[geometry].sides
|
||||||
#define S3 ginf[geometry].vertex
|
#define S3 ginf[geometry].vertex
|
||||||
#define weirdhyperbolic (S7 > 7 || S3 > 3)
|
#define weirdhyperbolic ((S7 > 7 || S3 > 3) && hyperbolic)
|
||||||
#define weirdhyperbolic (S7 > 7 || S3 > 3)
|
|
||||||
#define stdhyperbolic (S7 == 7 && S3 == 3)
|
#define stdhyperbolic (S7 == 7 && S3 == 3)
|
||||||
|
|
||||||
#define cgclass (ginf[geometry].cclass)
|
#define cgclass (ginf[geometry].cclass)
|
||||||
|
Loading…
Reference in New Issue
Block a user