Compare commits

...

4 Commits

4 changed files with 60 additions and 12 deletions

View File

@ -560,6 +560,7 @@ EX bool isbar4(cell *c) {
EX bool barrier_cross(eLand l, eLand r) {
if(l == laCrossroads3 || r == laCrossroads3) return hrand(100) < 66;
if(land_structure == lsCrossWalls) return hrand(100) < 90;
if(isElemental(l) && isElemental(r)) return hrand(100) < 75;
return false;
}

View File

@ -1771,6 +1771,21 @@ EX void build_walls(cell *c, cell *from) {
else if(good_for_wall(c) && isWarpedType(c->land) && hrand(10000) < 3000 && c->land &&
buildBarrierNowall(c, eLand(c->land ^ laWarpSea ^ laWarpCoast))) { }
else if(land_structure == lsVineWalls) {
int ev = emeraldval(c);
if((ev | 11) == 43 && c->bardir == NODIR) {
for(int i=0; i<c->type; i++) if(emeraldval(c->cmove(i)) == ev-4) {
bool oldleft = true;
for(int j=1; j<=3; j++)
if(c->modmove(i+j) && c->modmove(i+j)->mpdist < c->mpdist)
oldleft = false;
buildBarrierStrong(c, i, oldleft, getNewLand(c->land));
extendBarrier(c);
}
}
return;
}
else if(ls::single()) return;
@ -1792,11 +1807,11 @@ EX void build_walls(cell *c, cell *from) {
return;
}
else if(good_for_wall(c) && c->land == laCrossroads4 && hrand(10000) < 7000 && c->land && !c->master->alt && !tactic::on && !racing::on &&
else if(good_for_wall(c) && ls::any_wall() && c->land == laCrossroads4 && hrand(10000) < 7000 && c->land && !c->master->alt && !tactic::on && !racing::on &&
buildBarrierNowall(c, getNewLand(laCrossroads4))) ;
else if(good_for_wall(c) && hrand(I10000) < 20 && !generatingEquidistant && !yendor::on && !tactic::on && !racing::on && !isCrossroads(c->land) &&
gold() >= R200 && !weirdhyperbolic && !c->master->alt && c->bardir != NOBARRIERS &&
else if(good_for_wall(c) && ls::any_wall() && hrand(I10000) < 20 && !generatingEquidistant && !yendor::on && !tactic::on && !racing::on && !isCrossroads(c->land) &&
landUnlockedIngame(laCrossroads4) && !weirdhyperbolic && !c->master->alt && c->bardir != NOBARRIERS &&
!inmirror(c) && !isSealand(c->land) && !isHaunted(c->land) && !isGravityLand(c->land) &&
(c->land != laRlyeh || rlyehComplete()) &&
c->land != laTortoise && c->land != laPrairie && c->land &&

View File

@ -288,6 +288,7 @@ EX void gen_baby_tortoise(cell *c) {
EX int rebalance_treasure(int x, int y, eLand l) {
int res = ((tactic::on || quotient == 2 || daily::on) ? (y) : inv::on ? min(2*(y),x) : (x));
if(use_custom_land_list) res = (res * custom_land_treasure[l] + 50) / 100;
res *= ls::ls_mul();
return res;
}
@ -936,7 +937,13 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
case laTrollheim:
if(fargen) {
if(hrand(50000) < (ls::tame_chaos() ? 1000: ls::any_chaos() ?50:5) && c->wall != waBarrier && celldist(c) >= 7 && !safety && !peace::on) {
int freq =
land_structure == lsVineWalls ? 10000 :
ls::wall_chaos() ? 2500 :
ls::tame_chaos() ? 1000 :
ls::any_chaos() ? 50 :
5;
if(hrand(50000) < freq && c->wall != waBarrier && celldist(c) >= 7 && !safety && !peace::on) {
bool okay = true;
forCellCM(c2, c) forCellCM(c3, c2) forCellCM(c4, c3) forCellCM(c5, c4) {
cell *cx = ls::any_chaos() ? c3 : c5;
@ -1280,7 +1287,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
if(d == 8) {
bool ok = c->landparam == 0;
forCellEx(c2, c) if(c2->landparam) ok = false;
if(ok && hrand(doCross ?450:15000) < 20 + (2 * items[itMutant] + yendor::hardness()) && !safety) {
if(ok && hrand(doCross ?450:15000) < (20 + (2 * items[itMutant] + yendor::hardness())) * ls::ls_mul_big() && !safety) {
if(!peace::on) c->item = itMutant;
c->landparam = items[itMutant] + 5 + hrand(11);
c->wall = waNone;
@ -2065,7 +2072,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
case laHunting:
if(d == 7 && c->land == laHunting && !racing::on && !safety && !reptilecheat) {
if(hrand(1000) < 20) {
if(hrand(1000) < 20 * ls::ls_mul_big()) {
if(openplains(c)) {
if(hrand(2) == 0) {
if(!items[itHunting]) {
@ -2273,11 +2280,11 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
c->monst = moMonkey;
else if(hrand_monster(80000) < 5 + items[itRuby] + yendor::hardness())
c->monst = moEagle;
else if(pseudohept_r(c) && c != currentmap->gamestart() && hrand_monster(4000) < 300 + items[itRuby] && !c->monst) {
else if(pseudohept_r(c) && c != currentmap->gamestart() && hrand_monster(4000) < (300 + items[itRuby]) * ls::ls_mul_big() && !c->monst) {
int hardchance = items[itRuby] + yendor::hardness();
if(hardchance > 25) hardchance = 25;
bool hardivy = hrand(100) < hardchance;
if((cgflags & qFRACTAL) ? buildIvy(c, 0, 2) : hat::in() ? buildIvy(c, 0, 4) : (hardivy ? buildIvy(c, 1, 9) : buildIvy(c, 0, c->type)) && !peace::on)
if(land_structure == lsVineWalls ? buildIvy(c, 0, 2) : (cgflags & qFRACTAL) ? buildIvy(c, 0, 2) : hat::in() ? buildIvy(c, 0, 4) : (hardivy ? buildIvy(c, 1, 9) : buildIvy(c, 0, c->type)) && !peace::on)
c->item = itRuby;
}
}

View File

@ -81,7 +81,7 @@ EX eLand firstland = laIce;
EX eLand specialland = laIce;
#if HDR
enum eLandStructure { lsNiceWalls, lsChaos, lsPatchedChaos, lsTotalChaos, lsChaosRW, lsWallChaos, lsSingle, lsNoWalls, lsHorodisks, lsVoronoi, lsLandscape, lsGUARD };
enum eLandStructure { lsNiceWalls, lsChaos, lsPatchedChaos, lsTotalChaos, lsChaosRW, lsWallChaos, lsSingle, lsNoWalls, lsHorodisks, lsVoronoi, lsLandscape, lsCrossWalls, lsVineWalls, lsGUARD };
#endif
EX eLandStructure land_structure;
@ -90,9 +90,9 @@ EX namespace ls {
EX bool single() { return land_structure == lsSingle; }
EX bool any_chaos() { return among(land_structure, lsChaos, lsPatchedChaos, lsWallChaos, lsTotalChaos, lsChaosRW, lsLandscape); }
EX bool any_chaos() { return among(land_structure, lsChaos, lsPatchedChaos, lsWallChaos, lsTotalChaos, lsChaosRW, lsCrossWalls, lsVineWalls, lsLandscape); }
EX bool std_chaos() { return land_structure == lsChaos; }
EX bool wall_chaos() { return land_structure == lsWallChaos; }
EX bool wall_chaos() { return among(land_structure, lsWallChaos, lsCrossWalls, lsVineWalls); }
EX bool patched_chaos() { return land_structure == lsPatchedChaos; }
EX bool any_order() { return among(land_structure, lsNiceWalls, lsNoWalls, lsHorodisks, lsVoronoi); }
@ -112,11 +112,28 @@ EX int chaoticity() {
if(land_structure == lsChaos) return 40;
if(land_structure == lsLandscape) return 35;
if(land_structure == lsWallChaos) return 30;
if(land_structure == lsCrossWalls) return 32;
if(land_structure == lsVoronoi) return 20;
if(land_structure == lsSingle) return 0;
return 10;
}
/** a multiplier to make stuff more frequent in Wall Chaos and Cross Wall Chaos: treasure */
EX int ls_mul() {
if(land_structure == lsWallChaos) return 2;
if(land_structure == lsCrossWalls) return 3;
if(land_structure == lsVineWalls) return 3;
return 1;
}
/** a multiplier to make stuff more frequent in Wall Chaos and Cross Wall Chaos: even bigger */
EX int ls_mul_big() {
if(land_structure == lsWallChaos) return 5;
if(land_structure == lsCrossWalls) return 10;
if(land_structure == lsVineWalls) return 10;
return 1;
}
EX bool tame_chaos() { return any_chaos() && chaoticity() < 35; }
EX }
@ -144,6 +161,10 @@ EX string land_structure_name(bool which) {
return XLAT("landscape");
case lsNoWalls:
return XLAT("wall-less");
case lsCrossWalls:
return XLAT("excessive crossing walls");
case lsVineWalls:
return XLAT("regular walls");
default:
return "error structure";
}
@ -164,6 +185,10 @@ EX void fix_land_structure_choice() {
land_structure = lsNoWalls;
if(!nice_walls_available() && land_structure == lsWallChaos)
land_structure = lsChaos;
if(!nice_walls_available() && land_structure == lsCrossWalls)
land_structure = lsChaos;
if(land_structure == lsVineWalls && (geometry != gNormal || !BITRUNCATED))
land_structure = lsNiceWalls;
if(ls::hv_structure() && (!hyperbolic || bt::in() || quotient))
land_structure = lsSingle;
if(walls_not_implemented() && among(land_structure, lsChaos, lsNoWalls))
@ -1152,7 +1177,7 @@ EX land_validity_t& land_validity(eLand l) {
if(l == laWhirlwind && hyperbolic_not37)
return pattern_incompatibility;
bool better_mirror = !geometry && STDVAR && !ls::hv_structure() && !among(land_structure, lsTotalChaos, lsPatchedChaos, lsLandscape);
bool better_mirror = !geometry && STDVAR && !ls::hv_structure() && !among(land_structure, lsTotalChaos, lsPatchedChaos, lsLandscape, lsVineWalls);
// available only in non-standard geometries
if(l == laMirrorOld && better_mirror)