lovasz completed

This commit is contained in:
Zeno Rogue 2021-04-15 18:21:05 +02:00
parent 9ffc5cd03f
commit 91bd0c2018
5 changed files with 35 additions and 5 deletions

View File

@ -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;

View File

@ -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');

View File

@ -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) {

View File

@ -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)
;

View File

@ -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;
}