mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 20:29:17 +00:00
nih improvements
This commit is contained in:
parent
d6ab96f821
commit
46d127401e
@ -1694,6 +1694,10 @@ EX void moreBigStuff(cell *c) {
|
||||
if(c->master->emeraldval % 3 || c->master->zebraval % 3)
|
||||
c->wall = waColumn;
|
||||
}
|
||||
else if(nih) {
|
||||
if(c->master->emeraldval % 2)
|
||||
c->wall = waColumn;
|
||||
}
|
||||
else if(geometry == gHoroTris || geometry == gHoroRec) {
|
||||
if(c->c.spin(binary::updir()) != 0) c->wall = waColumn;
|
||||
}
|
||||
|
8
cell.cpp
8
cell.cpp
@ -439,7 +439,7 @@ EX int celldist(cell *c) {
|
||||
if(masterless)
|
||||
return eudist(decodeId(c->master));
|
||||
if(euclid && (penrose || archimedean)) return celldistance(currentmap->gamestart(), c);
|
||||
if(sphere || binarytiling || WDIM == 3 || cryst || sol || penrose) return celldistance(currentmap->gamestart(), c);
|
||||
if(sphere || binarytiling || WDIM == 3 || cryst || solnih || penrose) return celldistance(currentmap->gamestart(), c);
|
||||
#if CAP_IRR
|
||||
if(IRREGULAR) return irr::celldist(c, false);
|
||||
#endif
|
||||
@ -477,7 +477,7 @@ EX int celldistAlt(cell *c) {
|
||||
return euclidAlt(x, y);
|
||||
}
|
||||
#if CAP_BT
|
||||
if(binarytiling || sol) return c->master->distance + (specialland == laCamelot && !tactic::on? 30 : 0);
|
||||
if(binarytiling || solnih) return c->master->distance + (specialland == laCamelot && !tactic::on? 30 : 0);
|
||||
#endif
|
||||
if(nil) return c->master->zebraval + abs(c->master->emeraldval) + (specialland == laCamelot && !tactic::on? 30 : 0);;
|
||||
#if CAP_CRYSTAL
|
||||
@ -914,7 +914,7 @@ EX int heptdistance(heptagon *h1, heptagon *h2) {
|
||||
if(cryst) return crystal::space_distance(h1->c7, h2->c7);
|
||||
#endif
|
||||
#if CAP_SOLV
|
||||
if(sol) return solv::approx_distance(h1, h2);
|
||||
if(solnih) return solv::approx_distance(h1, h2);
|
||||
#endif
|
||||
while(true) {
|
||||
if(h1 == h2) return d;
|
||||
@ -1016,7 +1016,7 @@ EX int celldistance(cell *c1, cell *c2) {
|
||||
if(cryst) return crystal::precise_distance(c1, c2);
|
||||
#endif
|
||||
|
||||
if(masterless || archimedean || quotient || sol || (penrose && euclid) || experimental || sl2) {
|
||||
if(masterless || archimedean || quotient || solnih || (penrose && euclid) || experimental || sl2) {
|
||||
|
||||
if(saved_distances.count(make_pair(c1,c2)))
|
||||
return saved_distances[make_pair(c1,c2)];
|
||||
|
@ -590,7 +590,7 @@ vector<geometryinfo> ginf = {
|
||||
{"product","none", "product space", "product", 7, 3, qHYBRID, giProduct, 0x00000, {{7, 3}}, eVariation::pure},
|
||||
{"twisted","none", "rotation space", "twisted", 7, 3, qHYBRID, giSL2, 0x00000, {{6, 4}}, eVariation::pure},
|
||||
{"ternary","none", "standard ternary tiling", "ternary", 6, 3, qBINARY, giHyperb2, 0x48400, {{6, 4}}, eVariation::pure},
|
||||
{"NIH", "none", "non-isotropic hyperbolic", "NIH", 11, 3, qBINARY | qEXPERIMENTAL, giH23, 0x49000, {{6, 4}}, eVariation::pure},
|
||||
{"NIH", "none", "non-isotropic hyperbolic", "NIH", 11, 3, qBINARY, giH23, 0x49000, {{6, 4}}, eVariation::pure},
|
||||
};
|
||||
|
||||
// bits: 9, 10, 15, 16, (reserved for later) 17, 18
|
||||
|
@ -57,7 +57,7 @@ bool move_camera(transmatrix T) {
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace solv { pair<heptagon*,heptagon*> getcoord(heptagon *h); }
|
||||
namespace solnihv { pair<heptagon*,heptagon*> getcoord(heptagon *h); }
|
||||
|
||||
bignum bdiff(heptagon *h1, heptagon *h2) {
|
||||
if(h1 == h2) return 0;
|
||||
@ -101,8 +101,8 @@ void get_b4_distance() {
|
||||
if(h1->distance != h2->distance)
|
||||
println(hlog, "Z difference: ", h2->distance - h1->distance);
|
||||
else {
|
||||
auto c1 = solv::getcoord(h1);
|
||||
auto c2 = solv::getcoord(h2);
|
||||
auto c1 = solnihv::getcoord(h1);
|
||||
auto c2 = solnihv::getcoord(h2);
|
||||
println(hlog, "X difference: ", bdiff(c1.first, c2.first).get_str(10000));
|
||||
println(hlog, "Y difference: ", bdiff(c1.second, c2.second).get_str(10000));
|
||||
println(hlog, "X difference> ", bdiff(c2.first, c1.first).get_str(10000));
|
||||
|
@ -5119,7 +5119,7 @@ EX void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||
}
|
||||
noclipped++;
|
||||
}
|
||||
if(pmodel == mdGeodesic && sol) {
|
||||
if(pmodel == mdGeodesic && solnih) {
|
||||
hyperpoint H = tC0(V);
|
||||
if(abs(H[0]) <= 3 && abs(H[1]) <= 3 && abs(H[2]) <= 3 ) ;
|
||||
else {
|
||||
@ -6057,7 +6057,7 @@ EX void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||
|
||||
for(int a=0; a<c->type; a++)
|
||||
if(c->move(a) && !isWall3(c->move(a), dummy)) {
|
||||
if(pmodel == mdPerspective && !sphere && !quotient && !penrose && !nonisotropic && !hybri && !experimental) {
|
||||
if(pmodel == mdPerspective && !sphere && !quotient && !penrose && !nonisotropic && !hybri && !experimental && !nih) {
|
||||
if(a < 4 && among(geometry, gHoroTris, gBinary3) && celldistAlt(c) >= celldistAlt(viewcenter())) continue;
|
||||
else if(a < 2 && among(geometry, gHoroRec) && celldistAlt(c) >= celldistAlt(viewcenter())) continue;
|
||||
else if(c->move(a)->master->distance > c->master->distance && c->master->distance > viewctr.at->distance && !quotient) continue;
|
||||
|
2
hyper.h
2
hyper.h
@ -408,7 +408,7 @@ typedef function<int(struct cell*)> cellfunction;
|
||||
// passable flags
|
||||
|
||||
#define SAGEMELT .1
|
||||
#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 TEMPLE_EACH (among(geometry, gHoroRec, gHoroHex, gKiteDart3) ? 3 : sol ? 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
|
||||
|
@ -1377,6 +1377,7 @@ EX bool pseudohept(cell *c) {
|
||||
#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(nih) return c->master->zebraval % 3 == 2 && c->master->emeraldval % 2 == 1 && (c->master->distance % 2);
|
||||
if(penrose) return kite::getshape(c->master) == kite::pDart;
|
||||
if(binarytiling) return binary::pseudohept(c);
|
||||
#endif
|
||||
|
@ -1000,10 +1000,10 @@ void geometry_information::create_wall3d() {
|
||||
auto pt = [&] (int x, int y, int z) { return xpush(bwh*x) * ypush(bwh*y) * zpush(zstep*z) * C0; };
|
||||
println(hlog, xpush(1) * ypush(1) * zpush(1) * xpush(-2) * ypush(-3) * zpush(-1) * C0);
|
||||
println(hlog, xpush(1) * ypush(1) * zpush(-1) * xpush(-2) * ypush(-3) * zpush(1) * C0);
|
||||
make_wall(0, {pt(+3,-3,-1), pt(+3,-3,+1), pt(+3,+3,+1), pt(+3,+3,-1) });
|
||||
make_wall(1, {pt(-3,+3,-1), pt(-3,+3,+1), pt(+3,+3,+1), pt(+3,+3,-1)});
|
||||
make_wall(2, {pt(-3,-3,-1), pt(-3,-3,+1), pt(-3,+3,+1), pt(-3,+3,-1) });
|
||||
make_wall(3, {pt(-3,-3,-1), pt(-3,-3,+1), pt(+3,-3,+1), pt(+3,-3,-1)});
|
||||
make_wall(0, {pt(+3,-3,-1), pt(+3,-3,+1), pt(+3,+3,+1), pt(+3,+3,-1), pt(+3,+1,-1), pt(+3,-1,-1) });
|
||||
make_wall(1, {pt(-3,+3,-1), pt(-3,+3,+1), pt(+3,+3,+1), pt(+3,+3,-1), pt(+0,+3,-1) });
|
||||
make_wall(2, {pt(-3,-3,-1), pt(-3,-3,+1), pt(-3,+3,+1), pt(-3,+3,-1), pt(-3,+1,-1), pt(-3,-1,-1) });
|
||||
make_wall(3, {pt(-3,-3,-1), pt(-3,-3,+1), pt(+3,-3,+1), pt(+3,-3,-1), pt(+0,-3,-1)});
|
||||
|
||||
make_wall(4, {pt(-3,-3,+1), pt(-3,+3,+1), pt(+3,+3,+1), pt(+3,-3,+1)});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user