mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-01-19 01:20:23 +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 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 }
|
||||
|
||||
Reference in New Issue
Block a user