started the 'Brownian' land

This commit is contained in:
Zeno Rogue 2018-05-04 02:43:25 +02:00
parent 81e7dfcad0
commit 4aa73c560c
4 changed files with 45 additions and 5 deletions

View File

@ -1417,6 +1417,7 @@ walltype winf[walltypes] = {
{ '=', 0x804000, "dock", "A dock."}, { '=', 0x804000, "dock", "A dock."},
{ '^', 0xFF8000, "burning dock", "A burning dock."}, { '^', 0xFF8000, "burning dock", "A burning dock."},
{ '#', 0xE04030, "ruin wall", ruindesc}, { '#', 0xE04030, "ruin wall", ruindesc},
{ '#', 0xA04060, "Brownian generator", NODESC}
}; };
// --- land types --- // --- land types ---
@ -1613,6 +1614,7 @@ const landtype linf[landtypes] = {
"somehow. In the meantime, its memory has been cleared, since the 'remove faraway cells from the memory'" "somehow. In the meantime, its memory has been cleared, since the 'remove faraway cells from the memory'"
" option was on." " option was on."
}, },
{ 0xA04060, "Brownian", NODESCYET}
}; };
vector<landtacinfo> land_tac = { vector<landtacinfo> land_tac = {

View File

@ -120,7 +120,7 @@ enum eItem {
itOrbPhasing, itOrbMagnetism, itOrbSlaying itOrbPhasing, itOrbMagnetism, itOrbSlaying
}; };
static const int walltypes = 108; static const int walltypes = 109;
struct walltype { struct walltype {
char glyph; char glyph;
@ -161,10 +161,10 @@ enum eWall { waNone, waIcewall, waBarrier, waFloorA, waFloorB, waCavewall, waCav
waTempBridgeBlocked, waTempBridgeBlocked,
waTerraWarrior, waBubble, waTerraWarrior, waBubble,
waArrowTrap, waMercury, waMagma, waArrowTrap, waMercury, waMagma,
waDock, waBurningDock, waRuinWall waDock, waBurningDock, waRuinWall, waBrownian
}; };
static const int landtypes = 84; static const int landtypes = 85;
struct landtype { struct landtype {
int color; int color;
@ -191,7 +191,7 @@ enum eLand { laNone, laBarrier, laCrossroads, laDesert, laIce, laCaves, laJungle
laMirrorOld, laMirrorOld,
laVolcano, laBlizzard, laHunting, laTerracotta, laMercuryRiver, laVolcano, laBlizzard, laHunting, laTerracotta, laMercuryRiver,
laDual, laSnakeNest, laDocks, laRuins, laMagnetic, laDual, laSnakeNest, laDocks, laRuins, laMagnetic,
laSwitch, laMemory laSwitch, laMemory, laBrownian
}; };
enum eGeometry {gNormal, gEuclid, gSphere, gElliptic, gQuotient, gQuotient2, gTorus, gOctagon, g45, g46, g47, gSmallSphere, gTinySphere, gEuclidSquare, gSmallElliptic, gGUARD}; enum eGeometry {gNormal, gEuclid, gSphere, gElliptic, gQuotient, gQuotient2, gTorus, gOctagon, g45, g46, g47, gSmallSphere, gTinySphere, gEuclidSquare, gSmallElliptic, gGUARD};

View File

@ -2656,6 +2656,10 @@ void setcolors(cell *c, int& wcol, int &fcol) {
case laWineyard: fcol = 0x006000; break; case laWineyard: fcol = 0x006000; break;
case laLivefjord: fcol = 0x306030; break; case laLivefjord: fcol = 0x306030; break;
case laBrownian:
fcol = wcol = gradient(0x002000, 0xFFFFFF, 0, c->landparam, 20);
break;
case laVolcano: { case laVolcano: {
int id = lavatide(c, -1)/4; int id = lavatide(c, -1)/4;
if(c->wall == waMagma) { if(c->wall == waMagma) {

View File

@ -106,6 +106,35 @@ eMonster genRuinMonster(cell *c) {
return m; return m;
} }
void start_brownian(cell *c, int d) {
while(true) {
if(c->wall == waBrownian) c->wall = waNone;
c->landparam++;
// snakepile(c, moRedTroll);
// c->wall = waSea;
c->bardir = NOBARRIERS;
if(d == 0) {
if(c->mpdist >= BARLEV) {
c->wall = waBrownian;
return;
}
start_brownian(c, 1);
d = 1;
continue;
}
int q = 0;
cell *good = NULL;
forCellCM(c2, c)
if(c2->mpdist > 7 && (c2->land == laBrownian || c2->land == laNone)) {
q++;
if(q==1 || hrand(q) == 0) good = c2;
}
if(!q) break;
d++; if(d == 7) d = 0;
c = good;
}
}
// the giant switch generating most of the lands... // the giant switch generating most of the lands...
void giantLandSwitch(cell *c, int d, cell *from) { void giantLandSwitch(cell *c, int d, cell *from) {
@ -2113,6 +2142,11 @@ void giantLandSwitch(cell *c, int d, cell *from) {
} }
break; break;
case laBrownian:
if(c->wall == waBrownian || (d == 9 && hrand(10000) < 5))
start_brownian(c, 0);
break;
case laMirrored: case laMirrored:
case laMirrorWall: case laMirrorWall:
case laMirrorWall2: case laMirrorWall2:
@ -2258,7 +2292,7 @@ void repairLandgen(cell *c) {
if(c->wall == waIcewall && c->land != laIce && c->land != laCocytus && c->land != laBlizzard) if(c->wall == waIcewall && c->land != laIce && c->land != laCocytus && c->land != laBlizzard)
c->wall = waNone; c->wall = waNone;
if(c->wall == waRed3 && c->land != laRedRock && c->land != laSnakeNest) if(c->wall == waRed3 && c->land != laRedRock && c->land != laSnakeNest && c->land != laBrownian)
c->wall = waNone; c->wall = waNone;
if(c->item == itRedGem && c->land != laRedRock) if(c->item == itRedGem && c->land != laRedRock)