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

fixed land_structure for princess/racing/heptagonal achievements

This commit is contained in:
Zeno Rogue 2022-02-02 03:01:31 +01:00
parent fae4ceb672
commit fd634e6de8
4 changed files with 23 additions and 12 deletions

View File

@ -109,7 +109,7 @@ EX bool wrongMode(char flags) {
if(casual) return true; if(casual) return true;
if(flags == rg::global) return false; if(flags == rg::global) return false;
if(flags != rg::special_geometry) { if(flags != rg::special_geometry && flags != rg::special_geometry_nicewalls) {
if(!BITRUNCATED) return true; if(!BITRUNCATED) return true;
if(geometry != gNormal) return true; if(geometry != gNormal) return true;
} }
@ -128,12 +128,13 @@ EX bool wrongMode(char flags) {
#if CAP_TOUR #if CAP_TOUR
if(tour::on) return true; if(tour::on) return true;
#endif #endif
if(flags == rg::special_geometry && !ls::single()) eLandStructure dls = lsNiceWalls;
return true; if(flags == rg::special_geometry || flags == rg::racing || flags == rg::princess)
if(flags != rg::special_geometry && ineligible_starting_land) dls = lsSingle;
return true; if(flags == rg::chaos)
if(flags == rg::chaos && !ls::std_chaos()) return true; dls = lsChaos;
if(flags != rg::chaos && flags != rg::special_geometry && !ls::nice_walls()) return true;
if(land_structure != dls) return true;
if((numplayers() > 1) != (flags == rg::multi)) return true; if((numplayers() > 1) != (flags == rg::multi)) return true;
return false; return false;
} }

View File

@ -643,7 +643,7 @@ struct info {
} }
if(newdist == OUT_OF_PRISON && princess::challenge) { if(newdist == OUT_OF_PRISON && princess::challenge) {
addMessage(XLAT("Congratulations! Your score is %1.", its(i->value))); addMessage(XLAT("Congratulations! Your score is %1.", its(i->value)));
achievement_gain_once("PRINCESS2"); achievement_gain_once("PRINCESS2", rg::princess);
if(!cheater) achievement_score(36, i->value); if(!cheater) achievement_score(36, i->value);
LATE( showMissionScreen(); ) LATE( showMissionScreen(); )
} }

View File

@ -204,7 +204,15 @@ int modecodetable[42][6] = {
EX modecode_t legacy_modecode() { EX modecode_t legacy_modecode() {
if(int(geometry) > 3 || int(variation) > 1) return UNKNOWN; if(int(geometry) > 3 || int(variation) > 1) return UNKNOWN;
if(!ls::nice_walls() && !ls::std_chaos() && !yendor::on && !tactic::on) return UNKNOWN;
bool is_default_land_structure =
(princess::challenge || tactic::on) ? ls::single() :
racing::on ? (land_structure == lsSingle) :
yendor::on ? (land_structure == yendor::get_land_structure()) :
ls::nice_walls();
if(!is_default_land_structure && !ls::std_chaos()) return UNKNOWN;
// compute the old code // compute the old code
int xcode = 0; int xcode = 0;
@ -219,7 +227,7 @@ EX modecode_t legacy_modecode() {
if(elliptic) xcode += 6; if(elliptic) xcode += 6;
} }
if(ls::any_chaos()) xcode += 21; if(ls::any_chaos() && !yendor::on) xcode += 21;
int np = numplayers()-1; if(np<0 || np>5) np=5; int np = numplayers()-1; if(np<0 || np>5) np=5;

View File

@ -31,8 +31,10 @@ namespace rg {
static const char global = 'x'; static const char global = 'x';
/** \brief wrongmode only -- change vid.scfg.players then restart_game(rg::nothing) instead */ /** \brief wrongmode only -- change vid.scfg.players then restart_game(rg::nothing) instead */
static const char multi = 'm'; static const char multi = 'm';
/** \brief wrongmode only -- mark achievements for special geometries/variations */ /** \brief wrongmode only -- mark achievements for special geometries/variations, this automatically marks the expected land_structure as lsSingle */
static const char special_geometry = 'g'; static const char special_geometry = 'g';
/** \brief wrongmode only -- mark achievements for special geometries/variations */
static const char special_geometry_nicewalls = 'G';
} }
#endif #endif
@ -1495,7 +1497,7 @@ EX void switch_game_mode(char switchWhat) {
peace::on = false; peace::on = false;
tour::on = false; tour::on = false;
inv::on = false; inv::on = false;
land_structure = lsSingle; land_structure = racing::on ? lsSingle : lsNiceWalls;
princess::challenge = false; princess::challenge = false;
dual::disable(); dual::disable();
break; break;