1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-26 11:27:39 +00:00

An option to play on a disk (and use bounded space rules). Also renamed 'bounded' flag to 'closed' or similar, and improved Halloween

This commit is contained in:
Zeno Rogue
2022-05-21 13:08:42 +02:00
parent 9bc0623022
commit 793148729b
40 changed files with 218 additions and 171 deletions

View File

@@ -335,18 +335,20 @@ EX void wandering() {
if(cwt.at->land == laCA) ghostcount = 0;
bool genturn = hrand(100) < 30;
if(bounded && specialland == laClearing)
if(closed_or_bounded && specialland == laClearing)
clearing::new_root();
if(cwt.at->land == laZebra && cwt.at->wall == waNone && wchance(items[itZebra], 20))
wanderingZebra(cwt.at);
bool smallbounded_generation = smallbounded || (bounded && specialland == laClearing);
bool smallbounded_generation = smallbounded || (closed_manifold && specialland == laClearing);
auto valid = [] (cell *c) { if(disksize && !is_in_disk(c)) return false; if(inmirror(c)) return false; return true; };
if(smallbounded_generation) {
int maxdist = 0;
for(int i=0; i<isize(dcal); i++) if(dcal[i]->cpdist > maxdist) maxdist = dcal[i]->cpdist;
for(int i=0; i<isize(dcal); i++) if(dcal[i]->cpdist >= maxdist-1) { first7 = i; break; }
for(int i=0; i<isize(dcal); i++) if(valid(dcal[i])) if(dcal[i]->cpdist > maxdist) maxdist = dcal[i]->cpdist;
for(int i=0; i<isize(dcal); i++) if(valid(dcal[i])) if(dcal[i]->cpdist >= maxdist-1) { first7 = i; break; }
if(hrand(5) == 0) {
// spawn treasure
@@ -362,10 +364,12 @@ EX void wandering() {
}
}
int iter = 0;
while(first7 < isize(dcal)) {
iter++; if(iter > 1000) break;
int i = first7 + hrand(isize(dcal) - first7);
cell *c = dcal[i];
if(inmirror(c)) continue;
if(!valid(c)) continue;
if(isPlayerOn(c)) break;
if(specialland == laStorms) {