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

fixed some lands in Archimedean dual

This commit is contained in:
Zeno Rogue 2018-08-30 16:08:05 +02:00
parent 706fb5d9f8
commit 80e0ad5cd0
6 changed files with 46 additions and 17 deletions

View File

@ -453,7 +453,17 @@ bool checkInTree(cell *c, int maxv) {
return false; return false;
} }
int loopval = 0;
struct loopchecker {
loopchecker() { loopval++; }
~loopchecker() { loopval--; }
};
void buildEquidistant(cell *c) { void buildEquidistant(cell *c) {
loopchecker lc;
// sometimes crashes in Archimedean
if(loopval > 100) { c->landparam = 0; return; }
if(!c) return; if(!c) return;
if(c->landparam) return; if(c->landparam) return;
/* if(weirdhyperbolic) { /* if(weirdhyperbolic) {

View File

@ -10,6 +10,7 @@ namespace hr {
namespace whirlwind { namespace whirlwind {
int fzebra3(cell *c) { int fzebra3(cell *c) {
if(archimedean) return 0;
if(euclid) { if(euclid) {
if(torus) return 0; if(torus) return 0;
int x, y; int x, y;

View File

@ -2611,13 +2611,19 @@ bool drawstaratvec(double dx, double dy) {
} }
int reptilecolor(cell *c) { int reptilecolor(cell *c) {
int i = zebra40(c); int i;
if(!masterless) { if(archimedean)
if(i >= 4 && i < 16) i = 0; i = c->master->rval0 & 3;
else if(i >= 16 && i < 28) i = 1; else {
else if(i >= 28 && i < 40) i = 2; int i = zebra40(c);
else i = 3;
if(!masterless) {
if(i >= 4 && i < 16) i = 0;
else if(i >= 16 && i < 28) i = 1;
else if(i >= 28 && i < 40) i = 2;
else i = 3;
}
} }
int fcoltab[4] = {0xe3bb97, 0xc2d1b0, 0xebe5cb, 0xA0A0A0}; int fcoltab[4] = {0xe3bb97, 0xc2d1b0, 0xebe5cb, 0xA0A0A0};

View File

@ -82,8 +82,8 @@ 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 hyperbolic_37 (S7 == 7 && S3 == 3 && !binarytiling) #define hyperbolic_37 (S7 == 7 && S3 == 3 && !binarytiling && !archimedean)
#define hyperbolic_not37 ((S7 > 7 || S3 > 3 || binarytiling) && hyperbolic) #define hyperbolic_not37 ((S7 > 7 || S3 > 3 || binarytiling || archimedean) && hyperbolic)
#define weirdhyperbolic ((S7 > 7 || S3 > 3 || !STDVAR || binarytiling || archimedean) && hyperbolic) #define weirdhyperbolic ((S7 > 7 || S3 > 3 || !STDVAR || binarytiling || archimedean) && hyperbolic)
#define stdhyperbolic (S7 == 7 && S3 == 3 && STDVAR && !binarytiling && !archimedean) #define stdhyperbolic (S7 == 7 && S3 == 3 && STDVAR && !binarytiling && !archimedean)

View File

@ -190,7 +190,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
case laPalace: // ------------------------------------------------------------- case laPalace: // -------------------------------------------------------------
if(hyperbolic_not37 || torus || S7 < 5) { if(hyperbolic_not37 || torus || S7 < 5 || archimedean) {
if(d == 9) { if(d == 9) {
int i = hrand(100); int i = hrand(100);
if(i < 10) if(i < 10)
@ -210,7 +210,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
else { else {
if(d == 9) { if(d == 9) {
cell *c2 = (GOLDBERG || IRREGULAR) ? c->master->c7 : c; cell *c2 = NONSTDVAR ? c->master->c7 : c;
if(cdist50(c2) == 3 && polarb50(c2) == 1) if(cdist50(c2) == 3 && polarb50(c2) == 1)
c->wall = waPalace; c->wall = waPalace;
} }
@ -405,7 +405,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
c->wall = waCavewall; c->wall = waCavewall;
else c->wall = waCavefloor; else c->wall = waCavefloor;
} }
else if(a4) else if(a4 || archimedean)
c->wall = hrand(100) < 50 ? waCavefloor : waCavewall; c->wall = hrand(100) < 50 ? waCavefloor : waCavewall;
else if(!BITRUNCATED) { else if(!BITRUNCATED) {
if(polarb50(c)) if(polarb50(c))
@ -550,8 +550,10 @@ void giantLandSwitch(cell *c, int d, cell *from) {
if(y&1) c->wall = waTrapdoor; if(y&1) c->wall = waTrapdoor;
else c->wall = waNone; else c->wall = waNone;
} }
else
if(archimedean) c->wall = hrand(2) ? waTrapdoor : waNone;
else else
c->wall = (randomPatternsMode ? RANDPAT : (zebra40(c)&2)) ? waTrapdoor : waNone; c->wall = (randomPatternsMode ? RANDPAT : (zebra40(c)&2)) ? waTrapdoor : waNone;
} }
ONEMPTY { ONEMPTY {
if(c->wall == waNone && hrand(2500) < PT(100 + 2 * (kills[moOrangeDog]), 300) && notDippingFor(itZebra)) if(c->wall == waNone && hrand(2500) < PT(100 + 2 * (kills[moOrangeDog]), 300) && notDippingFor(itZebra))
@ -617,9 +619,9 @@ void giantLandSwitch(cell *c, int d, cell *from) {
c->item = itDodeca; c->item = itDodeca;
} }
else { else {
int i = zebra40(c); int i = archimedean ? hrand(50) : zebra40(c);
if(i < 40) { if(i < 40) {
int cd = getCdata(c, 3); int cd = hyperbolic_37 ? getCdata(c, 3) : hrand(16);
cd &= 15; cd &= 15;
if(cd >= 4 && cd < 12) c->wall = waChasm; if(cd >= 4 && cd < 12) c->wall = waChasm;
else { else {
@ -1109,7 +1111,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
if(d == 9) { if(d == 9) {
if(randomPatternsMode) if(randomPatternsMode)
c->wall = RANDPAT ? waNone : waSaloon; c->wall = RANDPAT ? waNone : waSaloon;
else if(cdist50(c) <= 2) c->wall = waSaloon; else if(hyperbolic_37 ? cdist50(c) <= 2 : hrand(100) < 20) c->wall = waSaloon;
} }
ONEMPTY { ONEMPTY {
if(hrand(25000) < 2 + (2 * items[itBounty] + yendor::hardness()) + (items[itRevolver] ? 150:0)) if(hrand(25000) < 2 + (2 * items[itBounty] + yendor::hardness()) + (items[itRevolver] ? 150:0))
@ -1129,6 +1131,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
if(S7 == 4 && celldistance(c, currentmap->gamestart()) == 2 && ctof(c)) if(S7 == 4 && celldistance(c, currentmap->gamestart()) == 2 && ctof(c))
c->wall = waChasm; c->wall = waChasm;
} }
else if(archimedean) ;
else if(!euclid && zebra3(c) == 0) c->wall = waFan; else if(!euclid && zebra3(c) == 0) c->wall = waFan;
else if(pseudohept(c) && hrand(2000) < 150 && !reptilecheat) else if(pseudohept(c) && hrand(2000) < 150 && !reptilecheat)
c->wall = waChasm; c->wall = waChasm;
@ -2116,7 +2119,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
if(a38) if(a38)
patterns::val38(c, si, patterns::SPF_DOCKS, patterns::PAT_COLORING); patterns::val38(c, si, patterns::SPF_DOCKS, patterns::PAT_COLORING);
else else
si.id = (zebra40(c)&2) ? 0 : zebra40(c) == 4 ? 8 : 1; si.id = archimedean ? (hrand(6)*4) : (zebra40(c)&2) ? 0 : zebra40(c) == 4 ? 8 : 1;
c->wall = waSea; c->wall = waSea;
if(among(si.id, 0, 4, 16, PURE ? -1 : 24)) if(among(si.id, 0, 4, 16, PURE ? -1 : 24))
c->wall = waDock; c->wall = waDock;

View File

@ -1189,15 +1189,23 @@ land_validity_t& land_validity(eLand l) {
if(IRREGULAR && among(l, laPrairie, laMirror, laMirrorOld)) if(IRREGULAR && among(l, laPrairie, laMirror, laMirrorOld))
return dont_work; return dont_work;
if(archimedean && l == laPrairie) return dont_work;
if(IRREGULAR && among(laBlizzard, laVolcano) && !sphere) if((IRREGULAR || archimedean) && among(l, laBlizzard, laVolcano) && !sphere)
return dont_work; return dont_work;
if(archimedean && DUAL && l == laCrossroads4)
return not_implemented;
// equidistant-based lands // equidistant-based lands
if(isEquidLand(l)) { if(isEquidLand(l)) {
// no equidistants supported in chaos mode // no equidistants supported in chaos mode
if(chaosmode) if(chaosmode)
return not_in_chaos; return not_in_chaos;
// the algorithm fails in Archimedean DUAL
if(archimedean && DUAL)
return not_implemented;
// no equidistants supported in these geometries (big sphere is OK though) // no equidistants supported in these geometries (big sphere is OK though)
if(quotient || elliptic || smallsphere || torus) if(quotient || elliptic || smallsphere || torus)
return unbounded_only_except_bigsphere; return unbounded_only_except_bigsphere;
@ -1245,6 +1253,7 @@ land_validity_t& land_validity(eLand l) {
return special_chaos; return special_chaos;
return not_in_chaos; return not_in_chaos;
} }
if(archimedean) return not_implemented;
if(bounded) return unbounded_only; if(bounded) return unbounded_only;
} }