diff --git a/bigstuff.cpp b/bigstuff.cpp index 4c372a52..a00ae76a 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -715,6 +715,8 @@ void setLandQuotient(cell *c) { if(fv%4==0 || fv%4 == 2) setland(c, laWarpSea); if(specialland == laElementalWall) setland(c, eLand(laEFire + (fv%4))); + if(specialland == laClearing) + c->land = laClearing; if(specialland == laIvoryTower || specialland == laEndorian || specialland == laDungeon || specialland == laOcean) { int d = celldist(c) - 1; if(d <= 0) @@ -727,6 +729,8 @@ void setLandQuotient(cell *c) { void setLandSphere(cell *c) { if(specialland == laWarpCoast) setland(c, getHemisphere(c, 0) > 0 ? laWarpCoast : laWarpSea); + if(specialland == laClearing) + c->land = laClearing; if(specialland == laElementalWall) { int x = getHemisphere(c, 1); int y = getHemisphere(c, 2); diff --git a/complex.cpp b/complex.cpp index 9223a7a7..7f931660 100644 --- a/complex.cpp +++ b/complex.cpp @@ -741,6 +741,22 @@ namespace clearing { std::map bpdata; + cell *current_root; + + void new_root() { + if(!current_root || current_root->monst != moMutant) { + auto& ac = currentmap->allcells(); + int iter = 0; + while(!current_root || pseudohept(current_root) || current_root->cpdist < 3) { + if(iter++ > 100) return; + current_root = ac[hrand(size(ac))]; + } + current_root->monst = moMutant; + current_root->mondir = NODIR; + current_root->stuntime = (mutantphase + 1) & 15; + } + } + int plantdir(cell *c) { if(!quotient) { generateAlts(c->master); @@ -801,11 +817,10 @@ namespace clearing { vector rpath; void generate(cell *c) { - if(buggyplant) return; - - if(sphere) return; - + if(buggyplant) return; + if(sphere) return; if(gp::on) return; + if(quotient) return; if(euclid) { if(torus) return; diff --git a/game.cpp b/game.cpp index f6cfb28a..6d45afe1 100644 --- a/game.cpp +++ b/game.cpp @@ -4747,9 +4747,9 @@ void movehex_rest(bool mounted) { void movemutant() { vector young; - for(int i=0; imonst == moMutant && dcal[i]->stuntime == mutantphase) - young.push_back(dcal[i]); + for(cell *c: currentmap->allcells()) + if(c->monst == moMutant && c->stuntime == mutantphase) + young.push_back(c); for(int j=1; jland == laOvergrown || !pseudohept(c2)) && passable(c2, c, 0)) { - if(c2->land == laClearing && c2->mpdist > 7) continue; + if(c2->land == laClearing && !bounded && c2->mpdist > 7) continue; c2->monst = moMutant; c2->mondir = c->spn(j); c2->stuntime = mutantphase; @@ -5845,7 +5845,7 @@ void movemonsters() { DEBT("leader"); if(havewhat & HF_LEADER) groupmove(moPirate, 0); DEBT("mutant"); - if(havewhat & HF_MUTANT) movemutant(); + if((havewhat & HF_MUTANT) || (bounded && among(specialland, laOvergrown, laClearing))) movemutant(); DEBT("bugs"); if(havewhat & HF_BUG) hive::movebugs(); DEBT("whirlpool"); diff --git a/graph.cpp b/graph.cpp index 8706cfb4..f2978674 100644 --- a/graph.cpp +++ b/graph.cpp @@ -3669,7 +3669,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { } if(viewdists) { - int cd = celldistance(c, cwt.c); + int cd = (cwt.c == currentmap->gamestart() && numplayers() == 1) ? celldist(c) : celldistance(c, cwt.c); string label = its(cd); // string label = its(fieldpattern::getriverdistleft(c)) + its(fieldpattern::getriverdistright(c)); int dc = distcolors[cd&7]; diff --git a/hyper.h b/hyper.h index 57741406..e9778b97 100644 --- a/hyper.h +++ b/hyper.h @@ -3257,3 +3257,4 @@ bool horo_ok(); ld master_to_c7_angle(); +extern int mutantphase; diff --git a/landlock.cpp b/landlock.cpp index ec4977d2..6ca14325 100644 --- a/landlock.cpp +++ b/landlock.cpp @@ -1173,6 +1173,7 @@ land_validity_t& land_validity(eLand l) { if(l == laClearing) if(!(stdeuc || a38 || (a45 && !nonbitrunc) || (a47 && !nonbitrunc)) || gp::on) + if(!bounded) return not_implemented; // does not work in non-bitrunc a4 diff --git a/monstergen.cpp b/monstergen.cpp index 2d113f18..a943207f 100644 --- a/monstergen.cpp +++ b/monstergen.cpp @@ -303,11 +303,16 @@ void wandering() { int ghostcount = getGhostcount(); if(cwt.c->land == laCA) ghostcount = 0; bool genturn = hrand(100) < 30; + + if(bounded && specialland == laClearing) + clearing::new_root(); if(cwt.c->land == laZebra && cwt.c->wall == waNone && wchance(items[itZebra], 20)) wanderingZebra(cwt.c); - if(smallbounded) { + bool smallbounded_generation = smallbounded || (bounded && specialland == laClearing); + + if(smallbounded_generation) { int maxdist = 0; for(int i=0; icpdist > maxdist) maxdist = dcal[i]->cpdist; for(int i=0; icpdist >= maxdist-1) { first7 = i; break; } @@ -338,7 +343,7 @@ void wandering() { if(isPlayerOn(c)) continue; } - if(smallbounded && !c->item && hrand(5) == 0 && c->land != laHalloween) { + if(smallbounded_generation && !c->item && hrand(5) == 0 && c->land != laHalloween) { if(passable(c, NULL, 0) || specialland == laKraken) { if(c->land != laGraveyard && !haveOrbPower() && specialland != laHell) for(int it=0; it<1000 && !c->item; it++) placeLocalOrbs(c); diff --git a/system.cpp b/system.cpp index 5480a075..b1b8fe9d 100644 --- a/system.cpp +++ b/system.cpp @@ -233,6 +233,7 @@ void initgame() { } princess::squeaked = false; + clearing::current_root = NULL; if(!safety) { usedSafety = false;