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:
18
complex.cpp
18
complex.cpp
@@ -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));
|
||||
|
||||
3
help.cpp
3
help.cpp
@@ -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");
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user