mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-11-26 00:07:10 +00:00
bounded Minefield now works according to the standard Minesweeper rules
This commit is contained in:
1 parent
e61c684bca
commit
57f2891826
8 files changed
+52
-2
No files matched your search
@@ -1516,4 +1516,15 @@ void moreBigStuff(cell *c) {
|
||||
}
|
||||
}
|
||||
|
||||
void generate_mines() {
|
||||
vector<cell*> candidates;
|
||||
for(cell *c: currentmap->allcells())
|
||||
if(c->wall == waMineUnknown)
|
||||
candidates.push_back(c);
|
||||
bounded_mine_max = isize(candidates);
|
||||
hrandom_shuffle(&candidates[0], bounded_mine_max);
|
||||
bounded_mine_quantity = int(bounded_mine_max * bounded_mine_percentage + 0.5);
|
||||
for(int i=0; i<bounded_mine_quantity; i++) candidates[i]->wall = waMineMine;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user