mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 12:19:18 +00:00
land improvements in Sol/Penrose/B4
This commit is contained in:
parent
b2e8a869cb
commit
fff0cd1d3e
38
bigstuff.cpp
38
bigstuff.cpp
@ -884,6 +884,11 @@ void clear_euland(eLand first) {
|
||||
euland3[0] = laCrossroads;
|
||||
}
|
||||
|
||||
bool valid_wall_at(int c) {
|
||||
if(sol) return true;
|
||||
return short(c) % 3 == 0;
|
||||
}
|
||||
|
||||
eLand switchable(eLand nearland, eLand farland, int c) {
|
||||
if(chaosmode) {
|
||||
if(hrand(6) == 0)
|
||||
@ -893,10 +898,12 @@ eLand switchable(eLand nearland, eLand farland, int c) {
|
||||
else if(specialland == laCrossroads4) {
|
||||
if((dual::state && nearland == laCrossroads4) || hrand(15) == 0)
|
||||
return getNewLand(nearland);
|
||||
if(nearland == laCrossroads4 && sol && hrand(5) == 0)
|
||||
return getNewLand(nearland);
|
||||
return nearland;
|
||||
}
|
||||
else if(nearland == laCrossroads) {
|
||||
if(hrand(4) == 0 && (short(c)%3==0))
|
||||
if(hrand(4) == 0 && valid_wall_at(c))
|
||||
return laBarrier;
|
||||
return laCrossroads;
|
||||
}
|
||||
@ -904,7 +911,7 @@ eLand switchable(eLand nearland, eLand farland, int c) {
|
||||
return getNewLand(farland);
|
||||
}
|
||||
else {
|
||||
if(hrand(20) == 0 && (short(c)%3==0))
|
||||
if(hrand(20) == 0 && valid_wall_at(c))
|
||||
return laBarrier;
|
||||
return nearland;
|
||||
}
|
||||
@ -923,6 +930,27 @@ eLand getEuclidLand(int c) {
|
||||
return la = laCrossroads;
|
||||
}
|
||||
|
||||
void setLandSol(cell *c) {
|
||||
setland(c, specialland);
|
||||
switch(specialland) {
|
||||
case laCrossroads4: case laCrossroads: case laCrossroads2:
|
||||
setland(c, getEuclidLand(c->master->distance));
|
||||
if(c->land == laBarrier && c->master->emeraldval % 3) c->wall = waBarrier;
|
||||
break;
|
||||
case laTerracotta:
|
||||
if((c->master->distance & 15) == 1) {
|
||||
setland(c, laMercuryRiver);
|
||||
if(c->master->emeraldval % 3) c->wall = waMercury;
|
||||
}
|
||||
break;
|
||||
case laOcean: case laIvoryTower: case laEndorian: case laDungeon:
|
||||
if(c->master->distance <= 0) setland(c, laRlyeh);
|
||||
else c->landparam = c->master->distance;
|
||||
break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
|
||||
void setLandEuclid(cell *c) {
|
||||
#if CAP_RACING
|
||||
if(racing::track_ready) {
|
||||
@ -1209,7 +1237,7 @@ bool good_for_wall(cell *c) {
|
||||
}
|
||||
|
||||
void buildBigStuff(cell *c, cell *from) {
|
||||
if(sphere || quotient || sol || penrose) return;
|
||||
if(sphere || quotient || sol || (penrose && !binarytiling)) return;
|
||||
if(chaosmode > 1) return;
|
||||
bool deepOcean = deep_ocean_at(c, from);
|
||||
|
||||
@ -1535,6 +1563,10 @@ void moreBigStuff(cell *c) {
|
||||
forCellCM(c2, c) if(celldistAlt(c2) < celldistAlt(c)) i++;
|
||||
if(i > 1) c->wall = waColumn;
|
||||
}
|
||||
else if(sol) {
|
||||
if(c->master->emeraldval % 3 || c->master->zebraval % 3)
|
||||
c->wall = waColumn;
|
||||
}
|
||||
else if(geometry == gHoroTris || geometry == gHoroRec) {
|
||||
if(c->c.spin(binary::updir()) != 0) c->wall = waColumn;
|
||||
}
|
||||
|
@ -89,16 +89,7 @@ namespace binary {
|
||||
ld hororec_scale = 0.25;
|
||||
ld horohex_scale = 0.6;
|
||||
|
||||
heptagon *build(heptagon *parent, int d, int d1, int t, int side, int delta) {
|
||||
auto h = buildHeptagon1(tailored_alloc<heptagon> (t), parent, d, hsA, d1);
|
||||
h->distance = parent->distance + delta;
|
||||
h->dm4 = parent->dm4 + delta;
|
||||
h->c7 = NULL;
|
||||
if(parent->c7) h->c7 = newCell(t, h);
|
||||
h->cdata = NULL;
|
||||
h->zebraval = side;
|
||||
h->emeraldval = 0;
|
||||
if(WDIM == 3 && h->c7) {
|
||||
void make_binary_lands(heptagon *parent, heptagon *h) {
|
||||
if(!parent->emeraldval) parent->emeraldval = currentmap->gamestart()->land;
|
||||
eLand z = eLand(parent->emeraldval);
|
||||
int chance = 0;
|
||||
@ -114,6 +105,23 @@ namespace binary {
|
||||
else
|
||||
h->emeraldval = z;
|
||||
}
|
||||
|
||||
heptagon *build(heptagon *parent, int d, int d1, int t, int side, int delta) {
|
||||
auto h = buildHeptagon1(tailored_alloc<heptagon> (t), parent, d, hsA, d1);
|
||||
h->distance = parent->distance + delta;
|
||||
h->dm4 = parent->dm4 + delta;
|
||||
h->c7 = NULL;
|
||||
if(parent->c7) h->c7 = newCell(t, h);
|
||||
h->cdata = NULL;
|
||||
h->zebraval = side;
|
||||
h->emeraldval = 0;
|
||||
if(geometry == gBinary4) {
|
||||
if(d < 2)
|
||||
h->emeraldval = (parent->emeraldval * 2 + d) % 15015;
|
||||
else
|
||||
h->emeraldval = ((parent->emeraldval - d1) * 7508) % 15015;
|
||||
}
|
||||
if(WDIM == 3 && h->c7) make_binary_lands(parent, h);
|
||||
#if DEBUG_BINARY_TILING
|
||||
xcode[h] = expected_xcode(parent, d);
|
||||
if(rxcode.count(xcode[h])) {
|
||||
@ -901,10 +909,10 @@ namespace solv {
|
||||
h = tailored_alloc<heptagon> (S7);
|
||||
h->c7 = newCell(S7, h);
|
||||
coords[h] = make_pair(x, y);
|
||||
h->distance = 0;
|
||||
h->distance = x->distance;
|
||||
h->dm4 = 0;
|
||||
h->zebraval = 0;
|
||||
h->emeraldval = 0;
|
||||
h->zebraval = x->emeraldval;
|
||||
h->emeraldval = y->emeraldval;
|
||||
h->fieldval = 0;
|
||||
h->cdata = NULL;
|
||||
return h;
|
||||
@ -922,6 +930,8 @@ namespace solv {
|
||||
alt->cdata = NULL;
|
||||
alt->c7 = NULL;
|
||||
alt->zebraval = 0;
|
||||
alt->distance = 0;
|
||||
alt->emeraldval = 0;
|
||||
binary_map = binary::new_alt_map(alt);
|
||||
}
|
||||
|
||||
|
2
cell.cpp
2
cell.cpp
@ -436,7 +436,7 @@ int celldistAlt(cell *c) {
|
||||
return euclidAlt(x, y);
|
||||
}
|
||||
#if CAP_BT
|
||||
if(binarytiling) return c->master->distance + (specialland == laCamelot && !tactic::on? 30 : 0);
|
||||
if(binarytiling || sol) return c->master->distance + (specialland == laCamelot && !tactic::on? 30 : 0);
|
||||
#endif
|
||||
#if CAP_CRYSTAL
|
||||
if(geometry == gCrystal)
|
||||
|
@ -393,6 +393,7 @@ bool sizes_known() {
|
||||
if(binarytiling) return false;
|
||||
// not implemented
|
||||
if(archimedean) return false;
|
||||
if(penrose) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
3
hyper.h
3
hyper.h
@ -1610,7 +1610,7 @@ bool bearsCamelot(eLand l);
|
||||
extern bool safety;
|
||||
|
||||
#define SAGEMELT .1
|
||||
#define TEMPLE_EACH (among(geometry, gHoroRec, gHoroHex, gKiteDart3) ? 3 : (WDIM == 3 && binarytiling) ? 2 : geometry == gSpace435 ? 4 : (WDIM == 3 && hyperbolic) ? 3 : 6)
|
||||
#define TEMPLE_EACH (among(geometry, gHoroRec, gHoroHex, gKiteDart3) ? 3 : (sol && binarytiling) ? 6 : (WDIM == 3 && binarytiling) ? 2 : geometry == gSpace435 ? 4 : (WDIM == 3 && hyperbolic) ? 3 : 6)
|
||||
#define PT(x, y) ((tactic::on || quotient == 2 || daily::on) ? (y) : inv::on ? min(2*(y),x) : (x))
|
||||
#define ROCKSNAKELENGTH 50
|
||||
#define WORMLENGTH 15
|
||||
@ -3060,6 +3060,7 @@ void setLandSphere(cell *c);
|
||||
void setLandWeird(cell *c);
|
||||
void moreBigStuff(cell *c);
|
||||
void setLandEuclid(cell *c);
|
||||
void setLandSol(cell *c);
|
||||
bool checkInTree(cell *c, int maxv);
|
||||
cell *findcompass(cell *c);
|
||||
int edgeDepth(cell *c);
|
||||
|
@ -2573,6 +2573,7 @@ void setdist(cell *c, int d, cell *from) {
|
||||
else if(sphere || fulltorus) setLandSphere(c);
|
||||
else if(euclid) setLandEuclid(c);
|
||||
else if(quotient) { setland(c, specialland); setLandQuotient(c); }
|
||||
else if(sol) setLandSol(c);
|
||||
else if(weirdhyperbolic) setLandWeird(c);
|
||||
}
|
||||
|
||||
|
@ -152,6 +152,7 @@ struct hrmap_kite : hrmap {
|
||||
|
||||
heptagon *hspawn(heptagon *of, int our, int their, pshape s) {
|
||||
auto h = newtile(s, of->distance + (our ? 1 : -1));
|
||||
if(binarytiling) binary::make_binary_lands(of, h);
|
||||
of->c.connect(our, h, their, false);
|
||||
return h;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user