From 64a89e732fe86cce4c5684ea09011acd55d318ce Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 22 Sep 2023 12:36:27 +0200 Subject: [PATCH] horocycle-based Elemental Plains --- bigstuff.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/bigstuff.cpp b/bigstuff.cpp index 3c3b3e37..64820f19 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -2125,6 +2125,27 @@ EX void gen_temple(cell *c) { /* -2 should be perfect */ EX int horodisk_from = -2; +EX void pick_hv_subland(cell *c, eLand l, int depth) { + if(l == laElementalWall) { + auto land_at = [] (int dp) { + int i = dp - 12; + if((i & 7) == 7) return laElementalWall; + i >>= 3; + eLand tab[4] = { laEAir, laEWater, laEEarth, laEFire }; + return tab[i&3]; + }; + + setland(c, land_at(depth)); + if(c->land == laElementalWall) { + c->barleft = land_at(depth-1); + c->barright = land_at(depth+1); + if(hrand(100) < 75) + c->wall = getElementalWall(hrand(2) ? c->barleft : c->barright); + } + } + else setland(c, l); + } + EX void moreBigStuff(cell *c) { if(disable_bigstuff) return; @@ -2148,7 +2169,7 @@ EX void moreBigStuff(cell *c) { auto ph = p.first; if(ph) { eLand l = hv_land[ph]; - setland(c, l); + pick_hv_subland(c, l, p.second); if(isEquidLand(l)) c->landparam = 1-p.second; } else { @@ -2166,7 +2187,7 @@ EX void moreBigStuff(cell *c) { } else if(have_alt(c) && celldistAlt(c) <= horodisk_from) { eLand l = hv_land[c->master->alt->alt]; - setland(c, l); + pick_hv_subland(c, l, celldistAlt(c)); if(l == laCaribbean) generateTreasureIsland(c); if(l == laWhirlpool && celldistAlt(c) >= -1) { setland(c, laOcean);