1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 01:00:25 +00:00

Randomized version of Land of Storms, for other hyperbolic geometries

This commit is contained in:
Zeno Rogue 2018-05-16 10:52:23 +02:00
parent 63013f643e
commit 728e57547a
2 changed files with 33 additions and 4 deletions

View File

@ -1141,7 +1141,8 @@ void giantLandSwitch(cell *c, int d, cell *from) {
}
break;
case laStorms:
case laStorms: {
bool randstorm = hyperbolic_not37 || gp::on || quotient == 2;
if(d == 9) {
if(torus) {
@ -1194,6 +1195,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
}
}
}
else if(randstorm) ;
else if(nonbitrunc) {
int i = zebra40(c);
if((i == 5 || i == 8) && hrand(100) < 20) c->wall = hrand(2) ? waCharged : waGrounded;
@ -1219,6 +1221,32 @@ void giantLandSwitch(cell *c, int d, cell *from) {
if(c->mov[i] && c->mov[i]->land != laStorms && c->mov[i]->land != laNone)
c->wall = waNone;
}
if(d == 8 && randstorm) {
c->landparam = hrand(1000000);
}
if(d == 7 && randstorm) {
forCellEx(c2, c) if(c2->landparam < c->landparam) setdist(c2, 7, c);
bool bad = false;
forCellEx(c2, c) if(c2->land != laStorms) bad = true;
if(!bad) {
int wallsnow = 0;
int slp = 0;
forCellEx(c2, c) {
if(c2->wall) wallsnow++;
if(c2->landparam == 1) slp++;
}
if(wallsnow == 0) {
if(hrand(100) < 10)
c->wall = pick(waCharged, waGrounded, waSandstone, waSandstone);
else c->landparam = 1;
}
else if(wallsnow == 1 && slp == 0) {
c->wall = waSandstone;
}
else if(slp == 1 && wallsnow == 0)
c->landparam = 1;
}
}
ONEMPTY {
if(hrand(7500) < 25 + (items[itFulgurite] + yendor::hardness()))
c->monst = (hrand(5) ? moMetalBeast : moMetalBeast2),
@ -1228,6 +1256,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
}
}
break;
}
case laGraveyard:
if(d == 9) {

View File

@ -1100,7 +1100,7 @@ land_validity_t& land_validity(eLand l) {
// does not agree with the pattern
if(l == laStorms && quotient == 2)
return pattern_incompatibility;
return pattern_not_implemented_random;
// pattern not implemented
if(l == laStorms && S7 == 8)
@ -1117,7 +1117,7 @@ land_validity_t& land_validity(eLand l) {
if(among(l, laMirror, laMirrorOld) && gp::on)
return dont_work;
if(l == laWhirlwind && hyperbolic_non37)
if(l == laWhirlwind && hyperbolic_not37)
return pattern_incompatibility;
// available only in non-standard geometries
@ -1291,7 +1291,7 @@ land_validity_t& land_validity(eLand l) {
return not_enough_space;
if(l == laStorms && hyperbolic_not37)
return pattern_incompatibility;
return pattern_not_implemented_random;
if(l == laTrollheim && !stdeuc && !bounded)
return some1;