brownian:: nicer finding, and theme/balance improvements

This commit is contained in:
Zeno Rogue 2019-01-02 22:01:00 +01:00
parent 72417638d7
commit 5598bf3e08
5 changed files with 56 additions and 16 deletions

View File

@ -1136,6 +1136,9 @@ void buildBigStuff(cell *c, cell *from) {
(quickfind(laWhirlpool) || (
hrand(2000) < (PURE ? 500 : 1000) && !tactic::on && !racing::on && !yendor::on)))
createAlternateMap(c, 2, hsA);
if(c->land == laOcean && deepOcean && !generatingEquidistant && hrand(10000) < 20 && no_barriers_in_radius(c, 2) && !weirdhyperbolic)
brownian::init_further(c);
if(c->land == laCaribbean && horo_ok() && ctof(c) && !c->master->alt)
createAlternateMap(c, 2, hsA);
@ -1286,9 +1289,6 @@ void moreBigStuff(cell *c) {
if(c->land == laCanvas && !eubinary && c->master->alt && !quotient)
generateAlts(c->master);
if(c->land == laOcean && !generatingEquidistant && hrand(10000) < 10 && no_barriers_in_radius(c, 2))
brownian::init(c);
if(c->land == laStorms)
if(!eubinary && !quotient && !sphere) {
if(c->master->alt && c->master->alt->distance <= 2) {

View File

@ -779,7 +779,11 @@ monstertype minf[motypes] = {
{ '@', 0xC00000, "Red Jelly", jellydesc},
{ '@', 0x0000C0, "Blue Jelly", jellydesc},
{ 'B', 0xE07000, "Bronze Beast", NODESCYET},
{ 'B', 0xE07060, "Acid Bird", NODESCYET},
{ 'B', 0xE07060, "Acid Gull",
"Where did this strange bird come from?...\n\n"
"Acid Gulls dissolve the land on which they fall. "
},
{ 'W', 0xA04060, "Mutant", NODESCYET},
{ 'W', 0xC04040, "Falling Dog", NODESCYET},
{ 'B', 0xC0C040, "Western Hawk", NODESCYET},
@ -1243,7 +1247,7 @@ itemtype iinf[ittypes] = {
{ 'o', 0x202020, "Orb of Slaying",
"This Orb lets you defeat Raiders and other tough single-cell monsters in melee."
},
{ '*', 0x20C0C0, "Brownie",
{ '*', 0xFFA860, "Sphalerite",
"Tasty cookie."
},
{ '$', 0xF0C0C0, "Meteorite", NODESCYET},
@ -1633,7 +1637,7 @@ const landtype linf[landtypes] = {
"somehow. In the meantime, its memory has been cleared, since the 'remove faraway cells from the memory'"
" option was on."
},
{ 0x804000, "Brown Islands", NODESCYET},
{ 0x804000, "Brown Island", NODESCYET},
{ 0x211F6F, "Free Fall", NODESCYET},
{ 0x30FF30, "Irradiated Field", NODESCYET}
};

View File

@ -1,9 +1,8 @@
// Hyperbolic Rogue
// namespaces for complex features (whirlwind, whirlpool, elec, princess, clearing,
// mirror, hive, heat + livecaves, etc.)
// namespaces for new complex lands for HR11
// Copyright (C) 2011-2018 Zeno Rogue, see 'hyper.cpp' for details
// Copyright (C) 2011-2019 Zeno Rogue, see 'hyper.cpp' for details
#ifdef CAP_COMPLEX2
@ -35,10 +34,10 @@ namespace brownian {
c->landparam += val;
}
void recurse(cell *c, bool fat) {
void recurse(cell *c, bool fat, int fatten_limit = 0) {
while(true) {
totalsteps++;
if(celldist(c) >= (fat ? 30 : 20) + celldist(cwt.at)) {
if(!fatten_limit && celldist(c) >= (fat ? 30 : ISMOBILE ? 12 : 20) + celldist(cwt.at)) {
cell *c1 = c;
while(true) {
cell *c2 = ts::left_parent(c1, celldist);
@ -56,7 +55,11 @@ namespace brownian {
if(c->mpdist <= 7) { centersteps++; return; }
// while(hrand(1000) < 1000 * chance) recurse(c);
if(fat) recurse(c, false);
if(!fat && hrand(100000) == 0) recurse(c, true);
if(!fat && (fatten_limit == 1 || hrand(20000) == 0)) {
recurse(c, true);
fat = true;
}
if(fatten_limit) fatten_limit--;
rise(c, fat ? 256 : 1);
c = c->cmove(hrand(c->type));
}
@ -90,8 +93,40 @@ namespace brownian {
}
void init(cell *c) {
recurse(cwt.at, true);
recurse(cwt.at, true);
recurse(c, true);
recurse(c, true);
}
void init_further(cell *c) {
dynamicval<bool> be(generatingEquidistant, true);
int gdir = -1;
for(int i=0; i<c->type; i++) {
if(c->move(i) && c->move(i)->mpdist < c->mpdist) gdir = i;
}
if(gdir < 0) return;
cellwalker cw(c, gdir);
for(int i=0; i<4; i++) {
cw += revstep;
setdist(cw.at, BARLEV, cw.peek());
buildEquidistant(cw.at);
println(hlog, "from ", cw.peek(), " to ", cw.at, ", land = ", dnameof(cw.at->land), " lp = ", cw.at->landparam);
}
if(c->land != laOcean || !no_barriers_in_radius(cw.at, 2)) return;
println(hlog, "brownian::init ", cw.at, " in distance ", celldistance(cw.at, cwt.at));
recurse(cw.at, false, 50 + hrand(100));
recurse(cw.at, false, 50 + hrand(100));
cell *c2 = c;
while(c2->mpdist > 7) {
forCellEx(c3, c2) if(c3->mpdist < c2->mpdist) { c2 = c3; goto next; }
break;
next: ;
}
if(!c2->monst && c2->wall != waBoat) c2->monst = moAcidBird;
}
void build(cell *c, int d) {
@ -103,7 +138,7 @@ namespace brownian {
}
ONEMPTY {
if(hrand(10000) < min(250, 100 + 2 * PT(kills[moAcidBird] + kills[moBrownBug], 50)) && c->landparam >= 4 && c->landparam < 24)
if(hrand(10000) < min(250, 100 + 2 * PT(kills[moAcidBird] + kills[moBrownBug], 50)) * (25 + min(items[itBrownian], 100)) / 25 && c->landparam >= 4 && c->landparam < 24)
c->item = itBrownian;
if(hrand(8000) < 15 + items[itBrownian])
c->monst = moAcidBird;

View File

@ -4725,5 +4725,6 @@ bool normal_gravity_at(cell *c);
void build_pool(cell *c, bool with_boat);
void createArrowTrapAt(cell *c, eLand land);
bool no_barriers_in_radius(cell *c, int rad);
}

View File

@ -21,7 +21,7 @@ void playSeenSound(cell *c) {
bool nearme = c->cpdist <= 7;
forCellEx(c2, c) if(c2->cpdist <= 7) nearme = true;
if(!nearme) return;
if(c->monst == moEagle || c->monst == moWindCrow)
if(among(c->monst, moEagle, moWindCrow, moAcidBird))
playSound(c, "seen-eagle");
else if(c->monst == moEarthElemental)
playSound(c, "seen-earth");