1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-05-08 08:11:21 +00:00

land help message when failed to construct pattern

This commit is contained in:
Zeno Rogue
2026-04-19 00:44:52 +02:00
parent 9ffec4f163
commit dc3f9cb918
3 changed files with 18 additions and 4 deletions

View File

@@ -3662,6 +3662,8 @@ EX namespace windmap {
}
}
EX int wind_failed = 0;
EX void create() {
if(disable_bigstuff) return;
if(cgflags & qPORTALSPACE) return;
@@ -3709,9 +3711,15 @@ EX namespace windmap {
vector<int> tocheck;
for(int i=0; i<N; i++) tocheck.push_back(i);
hrandom_shuffle(tocheck);
wind_failed = 0;
for(int a=0; a<isize(tocheck); a++) {
if(a >= 200*N) { printf("does not converge\n"); break; }
if(a >= 200*N) {
println(hlog, "does not converge");
wind_failed |= 1;
break;
}
int bestval = 1000000000, best = 0;
int i = tocheck[a];
for(int k=0; k<256; k++) {
@@ -3740,8 +3748,10 @@ EX namespace windmap {
if(tries < maxtries) goto tryagain;
}
if(debug_geometry) println(hlog, "windmap: tries = ", tries, " N = ", N);
if(tries >= maxtries && maxtries >= 20) {
addMessage("Failed to generate an interesting wind/lava pattern.");
if(tries >= maxtries) {
if(maxtries >= 20)
addMessage("Failed to generate an interesting wind/lava pattern.");
wind_failed |= 2;
}
else if(false) {
printf("tocheck size = %d\n", isize(tocheck));

View File

@@ -829,6 +829,9 @@ EX string generateHelpForLand(eLand l) {
if(l == laWildWest)
s += XLAT("Bonus land, available only in some special modes.\n");
if(among(l, laBlizzard, laVolcano) && windmap::wind_failed)
s += XLAT("Failed to construct a wind/lava pattern. This land will not work correctly.\n");
if(l == laWhirlpool)
s += XLAT("Orbs of Safety always appear here, and may be used to escape.\n");

View File

@@ -846,6 +846,7 @@ EX bool isLandIngame(eLand l) {
if((eubinary || sol) && isCyclic(l) && l != specialland) return false;
if(l == laCamelot && hyperbolic && WDIM == 3) return false;
if(!(land_validity(l).flags & lv::appears_in_full)) return false;
if(among(l, laBlizzard, laVolcano) && windmap::wind_failed) return false;
return landAccessibleFromIngame(l);
}