mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-06-28 07:52:53 +00:00
generating various lands in Sol
This commit is contained in:
parent
632957b678
commit
602e6f27db
64
bigstuff.cpp
64
bigstuff.cpp
@ -885,13 +885,13 @@ eLand& get_euland(int c) {
|
|||||||
void clear_euland(eLand first) {
|
void clear_euland(eLand first) {
|
||||||
euland.resize(max_vec);
|
euland.resize(max_vec);
|
||||||
for(int i=0; i<max_vec; i++) euland[i] = laNone;
|
for(int i=0; i<max_vec; i++) euland[i] = laNone;
|
||||||
euland[0] = euland[1] = euland[max_vec-1] = first;
|
if(!nonisotropic) euland[0] = euland[1] = euland[max_vec-1] = first;
|
||||||
euland3.clear();
|
euland3.clear();
|
||||||
euland3[0] = laCrossroads;
|
euland3[0] = laCrossroads;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool valid_wall_at(int c) {
|
bool valid_wall_at(int c) {
|
||||||
if(sol) return true;
|
if(nonisotropic) return true;
|
||||||
return short(c) % 3 == 0;
|
return short(c) % 3 == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -904,11 +904,11 @@ eLand switchable(eLand nearland, eLand farland, int c) {
|
|||||||
else if(specialland == laCrossroads4) {
|
else if(specialland == laCrossroads4) {
|
||||||
if((dual::state && nearland == laCrossroads4) || hrand(15) == 0)
|
if((dual::state && nearland == laCrossroads4) || hrand(15) == 0)
|
||||||
return getNewLand(nearland);
|
return getNewLand(nearland);
|
||||||
if(nearland == laCrossroads4 && sol)
|
if(nearland == laCrossroads4 && nonisotropic)
|
||||||
return getNewLand(nearland);
|
return getNewLand(nearland);
|
||||||
return nearland;
|
return nearland;
|
||||||
}
|
}
|
||||||
else if(nearland == laCrossroads && sol) {
|
else if(nearland == laCrossroads && nonisotropic) {
|
||||||
return laBarrier;
|
return laBarrier;
|
||||||
}
|
}
|
||||||
else if(nearland == laCrossroads) {
|
else if(nearland == laCrossroads) {
|
||||||
@ -964,6 +964,60 @@ void setLandSol(cell *c) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setLandNil(cell *c) {
|
||||||
|
setland(c, specialland);
|
||||||
|
|
||||||
|
if(chaosmode) {
|
||||||
|
int hash = (((c->master->zebraval + 4) >> 3) << 16) + ((c->master->emeraldval + 4) >> 3);
|
||||||
|
auto& l = euland3_hash[hash];
|
||||||
|
if(l == laNone) l = getNewLand(laNone);
|
||||||
|
setland(c, l);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(specialland) {
|
||||||
|
case laCrossroads: case laCrossroads4:
|
||||||
|
setland(c, getEuclidLand(c->master->zebraval));
|
||||||
|
if(c->land == laBarrier && c->master->emeraldval % 3) c->wall = waBarrier;
|
||||||
|
break;
|
||||||
|
case laCrossroads2:
|
||||||
|
setland(c, getEuclidLand(c->master->emeraldval));
|
||||||
|
if(c->land == laBarrier && c->master->zebraval % 3) c->wall = waBarrier;
|
||||||
|
break;
|
||||||
|
case laCrossroads3: {
|
||||||
|
int ox = c->master->zebraval - 8;
|
||||||
|
int oy = c->master->emeraldval - 8;
|
||||||
|
int hash = (((ox + 16) >> 5) << 16) + ((oy + 16) >> 5);
|
||||||
|
auto& l = euland3_hash[hash];
|
||||||
|
if(l == laNone) l = getNewLand(laCrossroads3);
|
||||||
|
if(ox % 16 == 0) setland(c, laBarrier);
|
||||||
|
else if(oy % 16 == 0) setland(c, laBarrier);
|
||||||
|
else setland(c, l);
|
||||||
|
if(c->land == laBarrier && ((c->master->zebraval & 3) || (c->master->emeraldval & 3))) c->wall = waBarrier;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case laElementalWall: {
|
||||||
|
int ox = c->master->zebraval - 4;
|
||||||
|
int oy = c->master->emeraldval - 4;
|
||||||
|
int x = (ox & 7) ? ((ox & 8) ? 1 : -1) : 0;
|
||||||
|
int y = (oy & 7) ? ((oy & 8) ? 1 : -1) : 0;
|
||||||
|
elementalXY(c, x, y, (ox & 3) || (oy & 3));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case laTerracotta:
|
||||||
|
if((c->master->zebraval & 7) == 4 && (c->master->emeraldval & 7) == 4) {
|
||||||
|
setland(c, laMercuryRiver);
|
||||||
|
c->wall = waMercury;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case laOcean: case laIvoryTower: case laEndorian: case laDungeon:
|
||||||
|
if(c->master->zebraval <= 0) setland(c, laRlyeh);
|
||||||
|
else c->landparam = c->master->zebraval;
|
||||||
|
break;
|
||||||
|
default: ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void setLandEuclid(cell *c) {
|
void setLandEuclid(cell *c) {
|
||||||
#if CAP_RACING
|
#if CAP_RACING
|
||||||
if(racing::track_ready) {
|
if(racing::track_ready) {
|
||||||
@ -1523,7 +1577,7 @@ int masterAlt(cell *c) {
|
|||||||
|
|
||||||
void moreBigStuff(cell *c) {
|
void moreBigStuff(cell *c) {
|
||||||
|
|
||||||
if((bearsCamelot(c->land) && !euclid && !quotient) || c->land == laCamelot)
|
if((bearsCamelot(c->land) && !euclid && !quotient && !nil) || c->land == laCamelot)
|
||||||
if(eubinary || binarytiling || c->master->alt) if(!(binarytiling && specialland != laCamelot))
|
if(eubinary || binarytiling || c->master->alt) if(!(binarytiling && specialland != laCamelot))
|
||||||
buildCamelot(c);
|
buildCamelot(c);
|
||||||
|
|
||||||
|
1
cell.cpp
1
cell.cpp
@ -443,6 +443,7 @@ int celldistAlt(cell *c) {
|
|||||||
#if CAP_BT
|
#if CAP_BT
|
||||||
if(binarytiling || sol) return c->master->distance + (specialland == laCamelot && !tactic::on? 30 : 0);
|
if(binarytiling || sol) return c->master->distance + (specialland == laCamelot && !tactic::on? 30 : 0);
|
||||||
#endif
|
#endif
|
||||||
|
if(nil) return c->master->zebraval + abs(c->master->emeraldval) + (specialland == laCamelot && !tactic::on? 30 : 0);;
|
||||||
#if CAP_CRYSTAL
|
#if CAP_CRYSTAL
|
||||||
if(geometry == gCrystal)
|
if(geometry == gCrystal)
|
||||||
return crystal::dist_alt(c);
|
return crystal::dist_alt(c);
|
||||||
|
3
hyper.h
3
hyper.h
@ -106,7 +106,7 @@ void addMessage(string s, char spamtype = 0);
|
|||||||
#define penrose (ginf[geometry].flags & qPENROSE)
|
#define penrose (ginf[geometry].flags & qPENROSE)
|
||||||
|
|
||||||
// these geometries do not feature alternate structures for horocycles
|
// these geometries do not feature alternate structures for horocycles
|
||||||
#define eubinary (euclid || binarytiling || geometry == gCrystal)
|
#define eubinary (euclid || binarytiling || geometry == gCrystal || nil)
|
||||||
|
|
||||||
#define cgclass (ginf[geometry].cclass)
|
#define cgclass (ginf[geometry].cclass)
|
||||||
#define euclid (cgclass == gcEuclid)
|
#define euclid (cgclass == gcEuclid)
|
||||||
@ -3076,6 +3076,7 @@ void setLandWeird(cell *c);
|
|||||||
void moreBigStuff(cell *c);
|
void moreBigStuff(cell *c);
|
||||||
void setLandEuclid(cell *c);
|
void setLandEuclid(cell *c);
|
||||||
void setLandSol(cell *c);
|
void setLandSol(cell *c);
|
||||||
|
void setLandNil(cell *c);
|
||||||
bool checkInTree(cell *c, int maxv);
|
bool checkInTree(cell *c, int maxv);
|
||||||
cell *findcompass(cell *c);
|
cell *findcompass(cell *c);
|
||||||
int edgeDepth(cell *c);
|
int edgeDepth(cell *c);
|
||||||
|
33
landgen.cpp
33
landgen.cpp
@ -235,7 +235,28 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
|||||||
|
|
||||||
case laPalace: // -------------------------------------------------------------
|
case laPalace: // -------------------------------------------------------------
|
||||||
|
|
||||||
if(hyperbolic_not37 || fulltorus || S7 < 5 || archimedean || WDIM == 3) {
|
if(nil) {
|
||||||
|
if(fargen) {
|
||||||
|
int i = hrand(100);
|
||||||
|
if(c->master->zebraval % 4 == 2 || c->master->emeraldval % 4 == 2) {
|
||||||
|
if(i < 85)
|
||||||
|
c->wall = waPalace;
|
||||||
|
else if(i < 95)
|
||||||
|
c->wall = waClosedGate;
|
||||||
|
else
|
||||||
|
c->wall = waOpenGate;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(i < 10)
|
||||||
|
c->wall = waTrapdoor;
|
||||||
|
else if(i < 15)
|
||||||
|
c->wall = waClosePlate;
|
||||||
|
else if(i < 20)
|
||||||
|
c->wall = waOpenPlate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(hyperbolic_not37 || fulltorus || S7 < 5 || archimedean || WDIM == 3) {
|
||||||
if(fargen) {
|
if(fargen) {
|
||||||
int i = hrand(100);
|
int i = hrand(100);
|
||||||
if(i < 10)
|
if(i < 10)
|
||||||
@ -439,6 +460,11 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
|||||||
else if(fulltorus) {
|
else if(fulltorus) {
|
||||||
c->wall = waCavefloor;
|
c->wall = waCavefloor;
|
||||||
}
|
}
|
||||||
|
else if(nil) {
|
||||||
|
int a = c->master->zebraval % 7;
|
||||||
|
int b = c->master->emeraldval % 7;
|
||||||
|
c->wall = (a-3.5) * (a-3.5) + (b-3.5) * (b-3.5) <= 12 ? waCavewall : waCavefloor;
|
||||||
|
}
|
||||||
else if(sol)
|
else if(sol)
|
||||||
c->wall = (c->master->zebraval % 7 >= 5 || c->master->emeraldval % 7 >= 5) ? waCavewall : waCavefloor;
|
c->wall = (c->master->zebraval % 7 >= 5 || c->master->emeraldval % 7 >= 5) ? waCavewall : waCavefloor;
|
||||||
else if(WDIM == 3 && hyperbolic && !binarytiling)
|
else if(WDIM == 3 && hyperbolic && !binarytiling)
|
||||||
@ -633,6 +659,10 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
|||||||
else if(archimedean && arcm::current.have_line)
|
else if(archimedean && arcm::current.have_line)
|
||||||
c->wall = arcm::linespattern(c) ? waVinePlant : waNone;
|
c->wall = arcm::linespattern(c) ? waVinePlant : waNone;
|
||||||
#endif
|
#endif
|
||||||
|
else if(nil) {
|
||||||
|
if((c->master->emeraldval & 1) == 1)
|
||||||
|
c->wall = waVinePlant;
|
||||||
|
}
|
||||||
else if(sol) {
|
else if(sol) {
|
||||||
if((c->master->distance & 1) == 1 && (c->master->emeraldval % 3))
|
if((c->master->distance & 1) == 1 && (c->master->emeraldval % 3))
|
||||||
c->wall = waVinePlant;
|
c->wall = waVinePlant;
|
||||||
@ -2579,6 +2609,7 @@ void setdist(cell *c, int d, cell *from) {
|
|||||||
else if(euclid) setLandEuclid(c);
|
else if(euclid) setLandEuclid(c);
|
||||||
else if(quotient) { setland(c, specialland); setLandQuotient(c); }
|
else if(quotient) { setland(c, specialland); setLandQuotient(c); }
|
||||||
else if(sol) setLandSol(c);
|
else if(sol) setLandSol(c);
|
||||||
|
else if(nil) setLandNil(c);
|
||||||
else if(weirdhyperbolic) setLandWeird(c);
|
else if(weirdhyperbolic) setLandWeird(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1296,6 +1296,7 @@ bool pseudohept(cell *c) {
|
|||||||
if(IRREGULAR) return irr::pseudohept(c);
|
if(IRREGULAR) return irr::pseudohept(c);
|
||||||
#endif
|
#endif
|
||||||
#if CAP_BT
|
#if CAP_BT
|
||||||
|
if(nil) return c->master->zebraval & c->master->emeraldval & c->master->fieldval & 1;
|
||||||
if(sol) return (c->master->emeraldval % 3 == 2) && (c->master->zebraval % 3 == 2) && (c->master->distance % 2);
|
if(sol) return (c->master->emeraldval % 3 == 2) && (c->master->zebraval % 3 == 2) && (c->master->distance % 2);
|
||||||
if(penrose) return kite::getshape(c->master) == kite::pDart;
|
if(penrose) return kite::getshape(c->master) == kite::pDart;
|
||||||
if(binarytiling) return binary::pseudohept(c);
|
if(binarytiling) return binary::pseudohept(c);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user