diff --git a/items.cpp b/items.cpp index f6a465b3..2f22be83 100644 --- a/items.cpp +++ b/items.cpp @@ -61,6 +61,10 @@ EX void pickupMovedItems(cell *c) { } } +EX bool in_lovasz() { + return specialland == laMotion && bounded && ls::single() && !daily::on; + } + EX bool collectItem(cell *c2, bool telekinesis IS(false)) { bool dopickup = true; diff --git a/menus.cpp b/menus.cpp index 2859113a..905adda4 100644 --- a/menus.cpp +++ b/menus.cpp @@ -599,7 +599,21 @@ EX void mode_higlights() { clearMessages(); welcomeMessage(); })); - + + dialog::addItem(XLAT("Lovász Conjecture"), 'L'); + dialog::add_action(dialog::add_confirmation([] { + popScreenAll(); + resetModes(); + set_geometry(gKleinQuartic); + gp::param = gp::loc(1, 1); + set_variation(eVariation::untruncated); + + firstland = specialland = laMotion; + start_game(); + clearMessages(); + welcomeMessage(); + })); + #if CAP_CRYSTAL if(hiitemsMax(itHolyGrail) || cheater || autocheat) { dialog::addItem(XLAT("Knight of the 16-Cell Table"), '1'); diff --git a/monstergen.cpp b/monstergen.cpp index 01633f63..78271e94 100644 --- a/monstergen.cpp +++ b/monstergen.cpp @@ -377,7 +377,7 @@ EX void wandering() { if(smallbounded_generation && !c->item && hrand(5) == 0 && c->land != laHalloween) { if(passable(c, NULL, 0) || specialland == laKraken) { - if(c->land != laGraveyard && (c->land != laMotion || !ls::single() || daily::on) && !haveOrbPower() && specialland != laHell) for(int it=0; it<1000 && !c->item; it++) + if(c->land != laGraveyard && !in_lovasz() && !haveOrbPower() && specialland != laHell) for(int it=0; it<1000 && !c->item; it++) placeLocalOrbs(c); if(!c->item) c->item = wanderingTreasure(c); if(c->item == itShard) { diff --git a/quit.cpp b/quit.cpp index 7ad2c69f..91f6e3e2 100644 --- a/quit.cpp +++ b/quit.cpp @@ -327,9 +327,9 @@ EX void showMission() { const bool sweeper = false; #endif - if(!peace::on && !racing::on && !sweeper) + if(!peace::on && !racing::on && !sweeper && !in_lovasz()) dialog::addInfo(XLAT("Your score: %1", its(gold()))); - if(!peace::on && !racing::on && !sweeper) + if(!peace::on && !racing::on && !sweeper && !in_lovasz()) dialog::addInfo(XLAT("Enemies killed: %1", its(tkills()))); #if CAP_TOUR @@ -352,6 +352,18 @@ EX void showMission() { } } #endif + else if(in_lovasz()) { + int score = 0, all = 0; + for(cell *c: currentmap->allcells()) { + if(c->wall == waChasm || c->item == itOrbInvis) + score++; + all++; + } + dialog::addInfo(XLAT("Dropped floors: %1/%2", its(score), its(all))); + if(score == all) dialog::addInfo(XLAT("CONGRATULATIONS!"), iinf[itOrbYendor].color); + if(score == all && geometry == gKleinQuartic && variation == eVariation::untruncated && gp::param == gp::loc(1,1)) + achievement_gain_once("LOVASZ", rg::special_geometry); + } else { if(0) ; diff --git a/system.cpp b/system.cpp index c81f5d2a..cd4a88fa 100644 --- a/system.cpp +++ b/system.cpp @@ -335,7 +335,7 @@ EX void initgame() { generate_mines(); } - if(specialland == laMotion && bounded && ls::any_order() && !daily::on) { + if(in_lovasz()) { cwt.at->item = itOrbInvis; }