1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

more lands implemented for cylinders

This commit is contained in:
Zeno Rogue 2018-12-04 19:13:26 +01:00
parent aa1b102b78
commit 05df60ae70
3 changed files with 26 additions and 4 deletions

View File

@ -37,6 +37,7 @@ int roundTableRadius(cell *c) {
int celldistAltRelative(cell *c) { int celldistAltRelative(cell *c) {
if(geometry == gCrystal) return crystal::dist_relative(c); if(geometry == gCrystal) return crystal::dist_relative(c);
if(euwrap) return celldistAlt(c) - roundTableRadius(c);
if(sphere || quotient) { if(sphere || quotient) {
return celldist(c) - 3; return celldist(c) - 3;
} }
@ -71,6 +72,19 @@ int euclidAlt(short x, short y) {
else return eudist(x-(a4 ? 21 : 20), y-10); else return eudist(x-(a4 ? 21 : 20), y-10);
} }
int cylinder_alt(cell *c) {
if(specialland == laPrincessQuest)
return celldistance(c, vec_to_cellwalker(pair_to_vec(EPX, EPY)).at);
if(specialland == laCamelot)
return celldistance(c, vec_to_cellwalker(pair_to_vec(21, 10)).at);
using namespace torusconfig;
int maxmul = 0;
for(int d = 0; d < SG6; d++)
maxmul = max(maxmul, dcross(sdxy(), gp::eudir(d)));
return 5-abs(gdiv(dcross(sdxy(), cell_to_pair(c)), maxmul));
}
const int NOCOMPASS = 1000000; const int NOCOMPASS = 1000000;
int compassDist(cell *c) { int compassDist(cell *c) {
@ -829,6 +843,7 @@ void setLandEuclid(cell *c) {
int x, y; int x, y;
tie(x,y) = cell_to_pair(c); tie(x,y) = cell_to_pair(c);
y += 10; y += 10;
if(euwrap) y = -celldistAlt(c);
if(y == 0) if(y == 0)
{ setland(c, laBarrier); if(ishept(c)) c->land = laRlyeh; } { setland(c, laBarrier); if(ishept(c)) c->land = laRlyeh; }
else if(y<0) setland(c, laRlyeh); else if(y<0) setland(c, laRlyeh);
@ -838,6 +853,7 @@ void setLandEuclid(cell *c) {
int x, y; int x, y;
tie(x,y) = cell_to_pair(c); y = -5 - y; tie(x,y) = cell_to_pair(c); y = -5 - y;
if(specialland == laDungeon) y = -10 - y; if(specialland == laDungeon) y = -10 - y;
if(euwrap) y = -celldistAlt(c);
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);
@ -1239,6 +1255,10 @@ void buildCamelot(cell *c) {
void moreBigStuff(cell *c) { void moreBigStuff(cell *c) {
if((bearsCamelot(c->land) && !euclid && !quotient) || c->land == laCamelot)
if(eubinary || binarytiling || c->master->alt) if(!(binarytiling && specialland != laCamelot))
buildCamelot(c);
if(quotient) return; if(quotient) return;
if(c->land == laPalace && !eubinary && c->master->alt) { if(c->land == laPalace && !eubinary && c->master->alt) {
@ -1267,10 +1287,6 @@ void moreBigStuff(cell *c) {
} }
} }
if((bearsCamelot(c->land) && !euclid && !quotient) || c->land == laCamelot)
if(eubinary || binarytiling || c->master->alt) if(!(binarytiling && specialland != laCamelot))
buildCamelot(c);
if(chaosmode && c->land == laTemple) { if(chaosmode && c->land == laTemple) {
for(int i=0; i<c->type; i++) for(int i=0; i<c->type; i++)
if(pseudohept(c) && c->move(i) && c->move(i)->land != laTemple) if(pseudohept(c) && c->move(i) && c->move(i)->land != laTemple)

View File

@ -357,6 +357,10 @@ namespace torusconfig {
return 2 * (e1.first * e2.first + e1.second*e2.second) + (S3 == 3 ? e1.first*e2.second + e2.first * e1.second : 0); return 2 * (e1.first * e2.first + e1.second*e2.second) + (S3 == 3 ? e1.first*e2.second + e2.first * e1.second : 0);
} }
int dcross(gp::loc e1, gp::loc e2) {
return e1.first * e2.second - e1.second*e2.first;
}
gp::loc sdxy() { return gp::loc(sdx, sdy); } gp::loc sdxy() { return gp::loc(sdx, sdy); }
int mobius_dir_basic() { int mobius_dir_basic() {
@ -1356,6 +1360,7 @@ int celldist(cell *c) {
int celldistAlt(cell *c) { int celldistAlt(cell *c) {
if(masterless) { if(masterless) {
if(fulltorus) return celldist(c); if(fulltorus) return celldist(c);
if(euwrap) return cylinder_alt(c);
int x, y; int x, y;
tie(x,y) = vec_to_pair(decodeId(c->master)); tie(x,y) = vec_to_pair(decodeId(c->master));
return euclidAlt(x, y); return euclidAlt(x, y);

View File

@ -4500,6 +4500,7 @@ namespace ts {
void generate_around(cell *c); void generate_around(cell *c);
int euclidAlt(short x, short y); int euclidAlt(short x, short y);
int cylinder_alt(cell *c);
struct exp_parser { struct exp_parser {
string s; string s;