added more lands to the Random Pattern Mode

This commit is contained in:
Zeno Rogue 2018-02-13 13:36:50 +01:00
parent afd412f982
commit f436a2bc53
3 changed files with 82 additions and 46 deletions

View File

@ -1649,7 +1649,7 @@ vector<landtacinfo> land_tac = {
vector<eLand> randlands = { vector<eLand> randlands = {
laIce, laDesert, laCaves, laAlchemist, laGraveyard, laPower, laLivefjord, laZebra, laIce, laDesert, laCaves, laAlchemist, laGraveyard, laPower, laLivefjord, laZebra,
laRlyeh, laDryForest, laEmerald, laWineyard, laDeadCaves, laRedRock, laRlyeh, laDryForest, laEmerald, laWineyard, laDeadCaves, laRedRock,
laOvergrown, laWildWest, laWarpCoast, laRuins laOvergrown, laWildWest, laWarpCoast, laRuins, laBull, laDragon, laReptile, laDocks
}; };
geometryinfo ginf[gGUARD] = { geometryinfo ginf[gGUARD] = {

View File

@ -542,20 +542,28 @@ void giantLandSwitch(cell *c, int d, cell *from) {
case laReptile: case laReptile:
if(d == 9) { if(d == 9) {
int i = zebra40(c); if(randomPatternsMode) {
if(i < 40) { int ch = hrand(200);
int cd = getCdata(c, 3); if(RANDPAT) c->wall = waChasm;
cd &= 15; else c->wall = ch < (50 + items[itDodeca] + yendor::hardness()) ? waReptile : waNone;
if(cd >= 4 && cd < 12) c->wall = waChasm;
else {
int ch = hrand(200);
c->wall = ch < (50 + items[itDodeca] + yendor::hardness()) ? waReptile :
waNone;
}
c->wparam = 1 + hrand(reptilemax()); c->wparam = 1 + hrand(reptilemax());
} }
if(reptilecheat) { else {
c->wall = waReptile; c->wparam = 100; int i = zebra40(c);
if(i < 40) {
int cd = getCdata(c, 3);
cd &= 15;
if(cd >= 4 && cd < 12) c->wall = waChasm;
else {
int ch = hrand(200);
c->wall = ch < (50 + items[itDodeca] + yendor::hardness()) ? waReptile :
waNone;
}
c->wparam = 1 + hrand(reptilemax());
}
if(reptilecheat) {
c->wall = waReptile; c->wparam = 100;
}
} }
} }
if(d == 7 && c->wall != waChasm) { if(d == 7 && c->wall != waChasm) {
@ -685,10 +693,15 @@ void giantLandSwitch(cell *c, int d, cell *from) {
case laDragon: case laDragon:
if(d == 9) { if(d == 9) {
int cd = getCdata(c, 3); if(randomPatternsMode) {
cd &= 31; if(RANDPAT) c->wall = waChasm;
if(cd >= 6 && cd<12) c->wall = waChasm; }
else if(hrand(1000) == 0) c->wall = waEternalFire; else {
int cd = getCdata(c, 3);
cd &= 31;
if(cd >= 6 && cd<12) c->wall = waChasm;
else if(hrand(1000) == 0) c->wall = waEternalFire;
}
} }
ONEMPTY { ONEMPTY {
// 40 is the usual rate of dragon generation // 40 is the usual rate of dragon generation
@ -1588,7 +1601,13 @@ void giantLandSwitch(cell *c, int d, cell *from) {
int ce = getCdata(c, 2); int ce = getCdata(c, 2);
ce &= 15; ce &= 15;
if(cd >= 8 && ce >= 8) */ if(cd >= 8 && ce >= 8) */
if(hrand(100) < 25)
if(randomPatternsMode) {
int i = (RANDPAT ? 1 : 0) + (RANDPATV(laHell) ? 2 : 0);
eWall w[4] = {waNone, waSmallTree, waBigTree, waStone};
c->wall = w[i];
}
else if(hrand(100) < 25)
c->wall = safety ? pick(waBigTree, waSmallTree) : pick(waStone, waBigTree, waSmallTree); c->wall = safety ? pick(waBigTree, waSmallTree) : pick(waStone, waBigTree, waSmallTree);
} }
@ -1930,13 +1949,18 @@ void giantLandSwitch(cell *c, int d, cell *from) {
case laRuins: { case laRuins: {
int kf = 10 + items[itRuins] + yendor::hardness(); int kf = 10 + items[itRuins] + yendor::hardness();
if(d == 8) { if(d == 8) {
if(out_ruin(c)) { if(randomPatternsMode) {
if(hrand(100) < 3) c->wall = RANDPAT ? waRuinWall : waNone;
c->wall = waRuinWall;
} }
else if(hrand(100) < 75) { else {
forCellEx(c2, c) if(out_ruin(c2)) if(out_ruin(c)) {
c->wall = waRuinWall; if(hrand(100) < 3)
c->wall = waRuinWall;
}
else if(hrand(100) < 75) {
forCellEx(c2, c) if(out_ruin(c2))
c->wall = waRuinWall;
}
} }
if(hrand(40000) < kf && !c->monst && !c->wall && !shmup::on) { if(hrand(40000) < kf && !c->monst && !c->wall && !shmup::on) {
cell *c1 = c; cell *c1 = c;
@ -1964,30 +1988,42 @@ void giantLandSwitch(cell *c, int d, cell *from) {
case laDocks: { case laDocks: {
if(d == 8) { if(d == 8) {
patterns::patterninfo si; if(randomPatternsMode) {
if(a38) c->wall = RANDPAT ? waDock : waSea;
patterns::val38(c, si, patterns::SPF_DOCKS, patterns::PAT_COLORING); if(c->wall == waSea && RANDPATV(laEAir))
else c->wall = waBoat;
si.id = (zebra40(c)&2) ? 0 : zebra40(c) == 4 ? 8 : 1; }
c->wall = waSea; else {
if(among(si.id, 0, 4, 16, nonbitrunc ? -1 : 24)) patterns::patterninfo si;
c->wall = waDock; if(a38)
if(si.id == 8 && hrand(100) < 75) { patterns::val38(c, si, patterns::SPF_DOCKS, patterns::PAT_COLORING);
c->wall = waBoat; else
if(a38) for(int i=0; i<c->type; i++) { si.id = (zebra40(c)&2) ? 0 : zebra40(c) == 4 ? 8 : 1;
patterns::val38(createMov(c, i), si, patterns::SPF_DOCKS, patterns::PAT_COLORING); c->wall = waSea;
if(si.id == 0) c->mondir = i; if(among(si.id, 0, 4, 16, nonbitrunc ? -1 : 24))
c->wall = waDock;
if(si.id == 8 && hrand(100) < 75) {
c->wall = waBoat;
if(a38) for(int i=0; i<c->type; i++) {
patterns::val38(createMov(c, i), si, patterns::SPF_DOCKS, patterns::PAT_COLORING);
if(si.id == 0) c->mondir = i;
}
} }
} }
} }
if(d == 7 && !safety) { if(d == 7 && !safety) {
patterns::patterninfo si; if(randomPatternsMode) {
if(a38) if(hrand(2000) < PT(30 + kills[moRatling] + kills[moCShark] + kills[moAlbatross] + kills[moPirate] + kills[moFireFairy], 100)) c->item = itDock;
patterns::val38(c, si, patterns::SPF_DOCKS, patterns::PAT_COLORING); }
else else {
si.id = hrand(20); patterns::patterninfo si;
if(si.id == 16 && hrand(250) < PT(30 + kills[moRatling] + kills[moCShark] + kills[moAlbatross] + kills[moPirate] + kills[moFireFairy], 100)) if(a38)
c->item = itDock; patterns::val38(c, si, patterns::SPF_DOCKS, patterns::PAT_COLORING);
else
si.id = hrand(20);
if(si.id == 16 && hrand(250) < PT(30 + kills[moRatling] + kills[moCShark] + kills[moAlbatross] + kills[moPirate] + kills[moFireFairy], 100))
c->item = itDock;
}
if(c->wall == waDock && hrand(6000) < 25 + items[itDock] + yendor::hardness()) if(c->wall == waDock && hrand(6000) < 25 + items[itDock] + yendor::hardness())
c->monst = pick(moPirate, moRatling, moFireFairy); c->monst = pick(moPirate, moRatling, moFireFairy);
if(c->wall == waSea && hrand(6000) < 25 + items[itDock] + yendor::hardness()) if(c->wall == waSea && hrand(6000) < 25 + items[itDock] + yendor::hardness())

View File

@ -585,7 +585,7 @@ bool hyperstonesUnlocked() {
// 2 = always available, 1 = highscore required, 0 = never available // 2 = always available, 1 = highscore required, 0 = never available
int isRandland(eLand l) { int isRandland(eLand l) {
if(l == laIce || l == laDesert || l == laCaves || l == laWildWest) if(l == laIce || l == laDesert || l == laCaves || l == laWildWest || l == laDocks)
return 2; return 2;
for(eLand ll: randlands) if(l == ll) return 1; for(eLand ll: randlands) if(l == ll) return 1;
return 0; return 0;
@ -665,7 +665,7 @@ eLand pickLandRPM(eLand old) {
eLand n = randlands[hrand(size(randlands))]; eLand n = randlands[hrand(size(randlands))];
if(incompatible(n, old)) continue; if(incompatible(n, old)) continue;
if(isRandland(n) == 2) return n; if(isRandland(n) == 2) return n;
if(hiitemsMax(treasureType(n)) < 10) if(!autocheat && !cheater && hiitemsMax(treasureType(n)) < 10)
continue; continue;
return n; return n;
} }