From 9e3e4cf7a54e8ed28a7483436ba31ff060b40764 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 4 Dec 2018 02:38:44 +0100 Subject: [PATCH] crystal:: more lands --- crystal.cpp | 25 +++++++++++++++++++++++-- game.cpp | 2 +- landlock.cpp | 7 ++++++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/crystal.cpp b/crystal.cpp index 26272a4d..2303edd8 100644 --- a/crystal.cpp +++ b/crystal.cpp @@ -361,6 +361,7 @@ struct hrmap_crystal : hrmap { map hcoords; map heptagon_at; map landmemo; + map landmemo4; unordered_map> distmemo; map sgc; cell *camelot_center; @@ -854,12 +855,32 @@ void set_land(cell *c) { auto co1 = roundcoord(co * 60); int cv = co1[0]; - if(specialland == laCrossroads) { + if(chaosmode) { + setland(c, getCLand(gdiv(cv, 60))); + } + + else if(specialland == laCrossroads) { eLand l1 = getCLand(gdiv(cv, 360)); eLand l2 = getCLand(gdiv(cv+59, 360)); if(l1 != l2) setland(c, laBarrier); else setland(c, l1); } + + else if(specialland == laCrossroads2) { + setland(c, getCLand(dist_alt(c)/4)); + } + + else if(specialland == laCrossroads3) { + coord cx = roundcoord(co / 8); + auto& l = m->landmemo4[cx]; + if(l == laNone) l = getNewLand(laBarrier); + setland(c, l); + println(hlog, "l = ", dnameof(l)); + } + + else if(specialland == laCrossroads4) { + setland(c, getCLand(gdiv(cv, 360))); + } if(specialland == laCamelot) { setland(c, laCrossroads); @@ -872,7 +893,7 @@ void set_land(cell *c) { c->wall = waMercury; } - if(among(specialland, laOcean, laIvoryTower, laDungeon)) { + if(among(specialland, laOcean, laIvoryTower, laDungeon, laEndorian)) { int v = dist_alt(c); if(v == 0) c->land = laCrossroads4; diff --git a/game.cpp b/game.cpp index 8c4dec54..5c152a0c 100644 --- a/game.cpp +++ b/game.cpp @@ -6942,7 +6942,7 @@ bool in_full_game() { if(chaosmode) return true; if(geometry == gEuclid && isCrossroads(specialland)) return true; if(weirdhyperbolic && specialland == laCrossroads4) return true; - if(geometry == gCrystal && specialland == laCrossroads) return true; + if(geometry == gCrystal && isCrossroads(specialland)) return true; if(geometry == gNormal && !NONSTDVAR) return true; return false; } diff --git a/landlock.cpp b/landlock.cpp index f2860b1d..c2ac0a1e 100644 --- a/landlock.cpp +++ b/landlock.cpp @@ -762,7 +762,7 @@ eLand getNewLand(eLand old) { if(old == laEFire && lchance(old)) return hrand(2) ? laEEarth : laEAir; if(tactic::on && !(tactic::trailer && old == specialland)) return specialland; - if(weirdhyperbolic && specialland != old && specialland != laCrossroads4 && !chaosmode) return specialland; + if(weirdhyperbolic && specialland != old && specialland != laCrossroads4 && !chaosmode && old != laBarrier) return specialland; if(yendor::on && (yendor::clev().flags & YF_WALLS)) { if(old != yendor::clev().l) return yendor::clev().l; @@ -1102,6 +1102,11 @@ land_validity_t& land_validity(eLand l) { // horocycles not implemented if(isCyclic(l)) return not_implemented; } + + if(geometry == gCrystal) { + if(l == laCamelot) return interesting; + if(isCrossroads(l)) return full_game; + } // Random Pattern allowed only in some specific lands if(randomPatternsMode && !isRandland(l))