From e960b82e172caf76ac25c9ea07d6c84750c279fb Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 23 Apr 2021 19:45:50 +0200 Subject: [PATCH] fixed Crossroads in ls::single, also enabled Crossroads V --- barriers.cpp | 7 ++++++- bigstuff.cpp | 32 ++++++++++++++++++++++++++++---- classes.cpp | 2 +- landgen.cpp | 5 ++++- landlock.cpp | 4 ++-- system.cpp | 1 - 6 files changed, 41 insertions(+), 10 deletions(-) diff --git a/barriers.cpp b/barriers.cpp index a7339c9a..7f362882 100644 --- a/barriers.cpp +++ b/barriers.cpp @@ -326,6 +326,8 @@ EX void extendCR5(cell *c) { eLand nland = forbidden; for(int i=0; i<10 && (nland == forbidden || nland == forbidden2); i++) nland = getNewLand(laCrossroads5); + if(ls::single() && specialland == laCrossroads5) + nland = laCrossroads5; cw.at->barleft = forbidden2 = nland; landcount[nland]++; extendBarrier(cw.at); @@ -731,7 +733,10 @@ EX void buildCrossroads2(cell *c) { oldleft = false; c->landparam = h; - buildBarrierStrong(c, i, oldleft); + if(ls::single()) + buildBarrierStrong(c, i, oldleft, specialland); + else + buildBarrierStrong(c, i, oldleft); c->landparam = h; extendBarrier(c); } diff --git a/bigstuff.cpp b/bigstuff.cpp index 8ee03002..2ca6b8db 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -1461,9 +1461,36 @@ EX void build_walls(cell *c, cell *from) { buildBarrier(c, bd, laTerracotta); return; } + + if(ctof(c) && ls::single() && specialland == laCrossroads && hrand(I10000) < 5000) { + int bd = 2 + hrand(2) * 3; + buildBarrier(c, bd, laCrossroads); + return; + } + + if(ctof(c) && ls::single() && specialland == laCrossroads3) { + int bd = 2 + hrand(2) * 3; + buildBarrier(c, bd, laCrossroads3); + return; + } + + if(ctof(c) && ls::single() && specialland == laCrossroads5) { + int bd = 2 + hrand(2) * 3; + buildBarrier(c, bd, laCrossroads5); + return; + } + + if(ctof(c) && ls::single() && specialland == laCrossroads2 && false) { + int bd = 2 + hrand(2) * 3; + buildBarrier(c, bd, laCrossroads2); + return; + } } - if(ls::single()) return; + if(c->land == laCrossroads2 && BITRUNCATED) + buildCrossroads2(c); + + else if(ls::single()) return; if(geometry == gNormal && celldist(c) < 3 && !GOLDBERG) { if(top_land && c == cwt.at->master->move(3)->c7) { @@ -1518,9 +1545,6 @@ EX void build_walls(cell *c, cell *from) { else if(!nice_walls_available()) ; // non-Nowall barriers not implemented yet in weird hyperbolic - else if(c->land == laCrossroads2 && BITRUNCATED) - buildCrossroads2(c); - #if CAP_FIELD else if(c->land == laPrairie && c->LHU.fi.walldist == 0 && !euclid && ls::nice_walls()) { for(int bd=0; bd<7; bd++) { diff --git a/classes.cpp b/classes.cpp index 000b2d79..052c62ef 100644 --- a/classes.cpp +++ b/classes.cpp @@ -691,7 +691,7 @@ EX vector land_tac = { {laElementalWall, 10, 1}, {laTrollheim, 5, 2}, {laPrairie, 5, 2}, {laBull, 5, 2}, {laTerracotta, 10, 1}, - {laCrossroads, 10, 1}, {laCrossroads2, 10, 1}, {laCrossroads3, 10, 1}, {laCrossroads4, 10, 1}, + {laCrossroads, 10, 1}, {laCrossroads2, 10, 1}, {laCrossroads3, 10, 1}, {laCrossroads4, 10, 1}, {laCrossroads5, 5, 2}, {laCamelot, 1, 100}, {laWildWest, 10, 1}, diff --git a/landgen.cpp b/landgen.cpp index 7d45af1d..b0fa5d27 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -2461,7 +2461,10 @@ EX void giantLandSwitch(cell *c, int d, cell *from) { else { if(hyperstonesUnlocked() && hrand(25000) < min(PT(tkills(), 2000), 5000) && notDippingFor(itHyperstone)) c->item = itHyperstone; - if(hrand_monster(4000) < items[itHyperstone] && !c->monst) { + int freq = 4000; + if(ls::single() && specialland == laCrossroads5) + freq = 250; + if(hrand_monster(freq) < items[itHyperstone] && !c->monst) { // only interesting monsters here! eMonster cm = crossroadsMonster(); if(cm == moIvyRoot) buildIvy(c, 0, c->type); diff --git a/landlock.cpp b/landlock.cpp index 94986fa2..4c1f66d8 100644 --- a/landlock.cpp +++ b/landlock.cpp @@ -231,7 +231,7 @@ EX void countHyperstoneQuest(int& i1, int& i2) { EX bool hyperstonesUnlocked() { int i1, i2; - if(tactic::on && isCrossroads(specialland)) return true; + if(ls::single() && isCrossroads(specialland)) return true; countHyperstoneQuest(i1, i2); return i1 == i2; } @@ -878,7 +878,7 @@ EX land_validity_t& land_validity(eLand l) { return not_in_chaos; // standard, non-PTM specific - if(l == laCrossroads5 && tactic::on) + if(l == laCrossroads5 && old_daily_id < 999 && tactic::on) return not_in_ptm; // standard non-PTM non-chaos specific diff --git a/system.cpp b/system.cpp index 7137b1c9..28847d0a 100644 --- a/system.cpp +++ b/system.cpp @@ -180,7 +180,6 @@ EX void initgame() { if(firstland == laNone || firstland == laBarrier) firstland = laCrossroads; - if(firstland == laCrossroads5 && !tactic::on) firstland = laCrossroads2; // could not fit! if(firstland == laOceanWall) firstland = laOcean; if(firstland == laHauntedWall) firstland = laGraveyard; if(firstland == laMercuryRiver) firstland = laTerracotta;