diff --git a/complex2.cpp b/complex2.cpp index 11c490b2..9704f9b9 100644 --- a/complex2.cpp +++ b/complex2.cpp @@ -509,6 +509,24 @@ EX } EX namespace mine { +EX int victory_time; + +EX void count_status() { + bool last = kills[moBomberbird]; + kills[moBomberbird] = 0; + kills[moTameBomberbird] = 0; + for(cell *c: currentmap->allcells()) if(c->wall == waMineUnknown) kills[moBomberbird]++; + for(cell *c: currentmap->allcells()) if(among(c->wall, waMineMine, waMineUnknown) && mine::marked_mine(c)) kills[moTameBomberbird]++; + if(last && !kills[moBomberbird]) { + mine::victory_time = getgametime(); + pushScreen(showMission); + } + } + +EX bool in_minesweeper() { + return bounded && specialland == laMinefield; + } + EX bool uncoverMines(cell *c, int lev, int dist, bool just_checking) { bool b = false; if(c->wall == waMineMine && just_checking) return true; @@ -612,8 +630,10 @@ EX void uncover_full(cell *c2) { } EX void auto_teleport_charges() { - if(specialland == laMinefield && firstland == laMinefield && bounded) + if(in_minesweeper()) { + mine::count_status(); items[itOrbTeleport] = isFire(cwt.at->wall) ? 0 : 1; + } } EX } diff --git a/monstergen.cpp b/monstergen.cpp index 5a7e7a94..116ce29e 100644 --- a/monstergen.cpp +++ b/monstergen.cpp @@ -318,11 +318,8 @@ EX eItem wanderingTreasure(cell *c) { /** generate the wandering monsters */ EX void wandering() { - if(bounded && specialland == laMinefield) { - kills[moBomberbird] = 0; - kills[moTameBomberbird] = 0; - for(cell *c: currentmap->allcells()) if(c->wall == waMineUnknown) kills[moBomberbird]++; - for(cell *c: currentmap->allcells()) if(among(c->wall, waMineMine, waMineUnknown) && mine::marked_mine(c)) kills[moTameBomberbird]++; + if(mine::in_minesweeper()) { + mine::count_status(); return; } if(!canmove) return; diff --git a/quit.cpp b/quit.cpp index c20a4d70..c7bea4f7 100644 --- a/quit.cpp +++ b/quit.cpp @@ -320,10 +320,12 @@ EX void showMission() { 0xC00000, 200, 100 ); keyhandler = handleKeyQuit; + + bool sweeper = mine::in_minesweeper(); - if(!peace::on && !racing::on) + if(!peace::on && !racing::on && !sweeper) dialog::addInfo(XLAT("Your score: %1", its(gold()))); - if(!peace::on && !racing::on) + if(!peace::on && !racing::on && !sweeper) dialog::addInfo(XLAT("Enemies killed: %1", its(tkills()))); #if CAP_TOUR @@ -333,6 +335,17 @@ EX void showMission() { dialog::addInfo(XLAT("Orbs of Yendor found: %1", its(items[itOrbYendor])), iinf[itOrbYendor].color); dialog::addInfo(XLAT("CONGRATULATIONS!"), iinf[itOrbYendor].color); } + else if(mine::in_minesweeper()) { + int to_uncover = kills[moBomberbird]; + if(to_uncover) { + dialog::addInfo(XLAT("Uncover all cells which do not contain mines")); + dialog::addInfo(XLAT("Cells to uncover: %1", its(to_uncover))); + } + else { + dialog::addInfo(XLAT("CONGRATULATIONS!"), iinf[itOrbYendor].color); + dialog::addInfo(XLAT("You won in %1", getgametime_s(mine::victory_time))); + } + } else { if(0) ; @@ -343,6 +356,7 @@ EX void showMission() { else if(racing::on) ; else if(princess::challenge) dialog::addInfo(XLAT("Follow the Mouse and escape with %the1!", moPrincess)); + else if(!in_full_game()) ; else if(gold() < R30) dialog::addInfo(XLAT("Collect %1 $$$ to access more worlds", its(R30))); else if(gold() < R60) @@ -370,6 +384,7 @@ EX void showMission() { #endif else if(peace::on) ; else if(racing::on) ; + else if(!in_full_game()) ; else if(tkills() < R100) dialog::addInfo(XLAT("Defeat %1 enemies to access the Graveyard", its(R100))); else if(kills[moVizier] == 0 && (items[itFernFlower] < U5 || items[itGold] < U5))