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:
parent
aa1b102b78
commit
05df60ae70
24
bigstuff.cpp
24
bigstuff.cpp
@ -37,6 +37,7 @@ int roundTableRadius(cell *c) {
|
||||
|
||||
int celldistAltRelative(cell *c) {
|
||||
if(geometry == gCrystal) return crystal::dist_relative(c);
|
||||
if(euwrap) return celldistAlt(c) - roundTableRadius(c);
|
||||
if(sphere || quotient) {
|
||||
return celldist(c) - 3;
|
||||
}
|
||||
@ -71,6 +72,19 @@ int euclidAlt(short x, short y) {
|
||||
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;
|
||||
|
||||
int compassDist(cell *c) {
|
||||
@ -829,6 +843,7 @@ void setLandEuclid(cell *c) {
|
||||
int x, y;
|
||||
tie(x,y) = cell_to_pair(c);
|
||||
y += 10;
|
||||
if(euwrap) y = -celldistAlt(c);
|
||||
if(y == 0)
|
||||
{ setland(c, laBarrier); if(ishept(c)) c->land = laRlyeh; }
|
||||
else if(y<0) setland(c, laRlyeh);
|
||||
@ -838,6 +853,7 @@ void setLandEuclid(cell *c) {
|
||||
int x, y;
|
||||
tie(x,y) = cell_to_pair(c); y = -5 - y;
|
||||
if(specialland == laDungeon) y = -10 - y;
|
||||
if(euwrap) y = -celldistAlt(c);
|
||||
if(y == 0)
|
||||
{setland(c, laBarrier); if(ishept(c)) setland(c, laAlchemist); }
|
||||
else if(y<0) setland(c, laAlchemist);
|
||||
@ -1239,6 +1255,10 @@ void buildCamelot(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(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) {
|
||||
for(int i=0; i<c->type; i++)
|
||||
if(pseudohept(c) && c->move(i) && c->move(i)->land != laTemple)
|
||||
|
5
cell.cpp
5
cell.cpp
@ -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);
|
||||
}
|
||||
|
||||
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); }
|
||||
|
||||
int mobius_dir_basic() {
|
||||
@ -1356,6 +1360,7 @@ int celldist(cell *c) {
|
||||
int celldistAlt(cell *c) {
|
||||
if(masterless) {
|
||||
if(fulltorus) return celldist(c);
|
||||
if(euwrap) return cylinder_alt(c);
|
||||
int x, y;
|
||||
tie(x,y) = vec_to_pair(decodeId(c->master));
|
||||
return euclidAlt(x, y);
|
||||
|
Loading…
Reference in New Issue
Block a user