mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-06-20 07:14:07 +00:00
refactored buildCamelot as a separate function
This commit is contained in:
parent
036abd2091
commit
000f271552
68
bigstuff.cpp
68
bigstuff.cpp
@ -36,6 +36,7 @@ int roundTableRadius(cell *c) {
|
||||
}
|
||||
|
||||
int celldistAltRelative(cell *c) {
|
||||
if(geometry == gCrystal) return crystal::dist_relative(c);
|
||||
if(sphere || quotient) {
|
||||
return celldist(c) - 3;
|
||||
}
|
||||
@ -1166,38 +1167,7 @@ void buildCamelotWall(cell *c) {
|
||||
}
|
||||
}
|
||||
|
||||
void moreBigStuff(cell *c) {
|
||||
|
||||
if(quotient) return;
|
||||
|
||||
if(c->land == laPalace && !eubinary && c->master->alt) {
|
||||
int d = celldistAlt(c);
|
||||
if(d <= PRADIUS1) generateAlts(c->master);
|
||||
}
|
||||
|
||||
if(c->land == laCanvas && !eubinary && c->master->alt)
|
||||
generateAlts(c->master);
|
||||
|
||||
if(c->land == laStorms)
|
||||
if(!eubinary && !quotient && !sphere) {
|
||||
if(c->master->alt && c->master->alt->distance <= 2) {
|
||||
generateAlts(c->master);
|
||||
preventbarriers(c);
|
||||
int d = celldistAlt(c);
|
||||
if(d <= -2) {
|
||||
c->wall = (c->master->alt->alt->emeraldval & 1) ? waCharged : waGrounded;
|
||||
c->item = itNone;
|
||||
c->monst = moNone;
|
||||
}
|
||||
else if(d <= -1)
|
||||
c->wall = (hrand(100) < 20) ? waSandstone : waNone;
|
||||
else if(d <= 0)
|
||||
c->wall = waNone;
|
||||
}
|
||||
}
|
||||
|
||||
if((bearsCamelot(c->land) && !euclid && !quotient) || c->land == laCamelot)
|
||||
if(eubinary || binarytiling || c->master->alt) if(!(binarytiling && specialland != laCamelot)) {
|
||||
void buildCamelot(cell *c) {
|
||||
int d = celldistAltRelative(c);
|
||||
if(tactic::on || (d <= 14 && roundTableRadius(c) > 20)) {
|
||||
if(!eubinary) generateAlts(c->master);
|
||||
@ -1265,6 +1235,40 @@ void moreBigStuff(cell *c) {
|
||||
}
|
||||
}
|
||||
|
||||
void moreBigStuff(cell *c) {
|
||||
|
||||
if(quotient) return;
|
||||
|
||||
if(c->land == laPalace && !eubinary && c->master->alt) {
|
||||
int d = celldistAlt(c);
|
||||
if(d <= PRADIUS1) generateAlts(c->master);
|
||||
}
|
||||
|
||||
if(c->land == laCanvas && !eubinary && c->master->alt && !quotient)
|
||||
generateAlts(c->master);
|
||||
|
||||
if(c->land == laStorms)
|
||||
if(!eubinary && !quotient && !sphere) {
|
||||
if(c->master->alt && c->master->alt->distance <= 2) {
|
||||
generateAlts(c->master);
|
||||
preventbarriers(c);
|
||||
int d = celldistAlt(c);
|
||||
if(d <= -2) {
|
||||
c->wall = (c->master->alt->alt->emeraldval & 1) ? waCharged : waGrounded;
|
||||
c->item = itNone;
|
||||
c->monst = moNone;
|
||||
}
|
||||
else if(d <= -1)
|
||||
c->wall = (hrand(100) < 20) ? waSandstone : waNone;
|
||||
else if(d <= 0)
|
||||
c->wall = waNone;
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
|
9
cell.cpp
9
cell.cpp
@ -1334,13 +1334,11 @@ int compdist(int dx[]) {
|
||||
int celldist(cell *c) {
|
||||
if(fulltorus)
|
||||
return torusmap()->dists[decodeId(c->master)];
|
||||
if(geometry == gCrystal)
|
||||
return crystal::distance(c, currentmap->gamestart());
|
||||
if(euwrap)
|
||||
return torusconfig::cyldist(decodeId(c->master), 0);
|
||||
if(masterless)
|
||||
return eudist(decodeId(c->master));
|
||||
if(sphere || binarytiling) return celldistance(c, currentmap->gamestart());
|
||||
if(sphere || binarytiling || geometry == gCrystal) return celldistance(c, currentmap->gamestart());
|
||||
if(IRREGULAR) return irr::celldist(c, false);
|
||||
if(archimedean || ctof(c)) return c->master->distance;
|
||||
if(GOLDBERG) return gp::compute_dist(c, celldist);
|
||||
@ -1363,6 +1361,8 @@ int celldistAlt(cell *c) {
|
||||
return euclidAlt(x, y);
|
||||
}
|
||||
if(binarytiling) return c->master->distance + (specialland == laCamelot && !tactic::on? 30 : 0);
|
||||
if(geometry == gCrystal)
|
||||
return crystal::dist_alt(c);
|
||||
if(sphere || quotient) {
|
||||
return celldist(c) - 3;
|
||||
}
|
||||
@ -1738,9 +1738,6 @@ int celldistance(cell *c1, cell *c2) {
|
||||
if(geometry == gFieldQuotient && !GOLDBERG)
|
||||
return currfp.getdist(fieldpattern::fieldval(c1), fieldpattern::fieldval(c2));
|
||||
|
||||
if(geometry == gCrystal)
|
||||
return crystal::distance(c1, c2);
|
||||
|
||||
if(bounded) {
|
||||
|
||||
if(saved_distances.count(make_pair(c1,c2)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user