mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-10-23 09:57:41 +00:00
improved mission screen in Minesweeper, and also in non-full games
This commit is contained in:
22
complex2.cpp
22
complex2.cpp
@@ -509,6 +509,24 @@ EX }
|
|||||||
|
|
||||||
EX namespace mine {
|
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) {
|
EX bool uncoverMines(cell *c, int lev, int dist, bool just_checking) {
|
||||||
bool b = false;
|
bool b = false;
|
||||||
if(c->wall == waMineMine && just_checking) return true;
|
if(c->wall == waMineMine && just_checking) return true;
|
||||||
@@ -612,9 +630,11 @@ EX void uncover_full(cell *c2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EX void auto_teleport_charges() {
|
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;
|
items[itOrbTeleport] = isFire(cwt.at->wall) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EX }
|
EX }
|
||||||
|
|
||||||
|
@@ -318,11 +318,8 @@ EX eItem wanderingTreasure(cell *c) {
|
|||||||
|
|
||||||
/** generate the wandering monsters */
|
/** generate the wandering monsters */
|
||||||
EX void wandering() {
|
EX void wandering() {
|
||||||
if(bounded && specialland == laMinefield) {
|
if(mine::in_minesweeper()) {
|
||||||
kills[moBomberbird] = 0;
|
mine::count_status();
|
||||||
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]++;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!canmove) return;
|
if(!canmove) return;
|
||||||
|
19
quit.cpp
19
quit.cpp
@@ -321,9 +321,11 @@ EX void showMission() {
|
|||||||
);
|
);
|
||||||
keyhandler = handleKeyQuit;
|
keyhandler = handleKeyQuit;
|
||||||
|
|
||||||
if(!peace::on && !racing::on)
|
bool sweeper = mine::in_minesweeper();
|
||||||
|
|
||||||
|
if(!peace::on && !racing::on && !sweeper)
|
||||||
dialog::addInfo(XLAT("Your score: %1", its(gold())));
|
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())));
|
dialog::addInfo(XLAT("Enemies killed: %1", its(tkills())));
|
||||||
|
|
||||||
#if CAP_TOUR
|
#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("Orbs of Yendor found: %1", its(items[itOrbYendor])), iinf[itOrbYendor].color);
|
||||||
dialog::addInfo(XLAT("CONGRATULATIONS!"), 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 {
|
else {
|
||||||
if(0)
|
if(0)
|
||||||
;
|
;
|
||||||
@@ -343,6 +356,7 @@ EX void showMission() {
|
|||||||
else if(racing::on) ;
|
else if(racing::on) ;
|
||||||
else if(princess::challenge)
|
else if(princess::challenge)
|
||||||
dialog::addInfo(XLAT("Follow the Mouse and escape with %the1!", moPrincess));
|
dialog::addInfo(XLAT("Follow the Mouse and escape with %the1!", moPrincess));
|
||||||
|
else if(!in_full_game()) ;
|
||||||
else if(gold() < R30)
|
else if(gold() < R30)
|
||||||
dialog::addInfo(XLAT("Collect %1 $$$ to access more worlds", its(R30)));
|
dialog::addInfo(XLAT("Collect %1 $$$ to access more worlds", its(R30)));
|
||||||
else if(gold() < R60)
|
else if(gold() < R60)
|
||||||
@@ -370,6 +384,7 @@ EX void showMission() {
|
|||||||
#endif
|
#endif
|
||||||
else if(peace::on) ;
|
else if(peace::on) ;
|
||||||
else if(racing::on) ;
|
else if(racing::on) ;
|
||||||
|
else if(!in_full_game()) ;
|
||||||
else if(tkills() < R100)
|
else if(tkills() < R100)
|
||||||
dialog::addInfo(XLAT("Defeat %1 enemies to access the Graveyard", its(R100)));
|
dialog::addInfo(XLAT("Defeat %1 enemies to access the Graveyard", its(R100)));
|
||||||
else if(kills[moVizier] == 0 && (items[itFernFlower] < U5 || items[itGold] < U5))
|
else if(kills[moVizier] == 0 && (items[itFernFlower] < U5 || items[itGold] < U5))
|
||||||
|
Reference in New Issue
Block a user