1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-06-05 16:04:07 +00:00

Hunting Grounds in >4-valent tilings

This commit is contained in:
Zeno Rogue 2019-06-03 15:36:24 +02:00
parent 29278101ba
commit 7ce26fd5ec

View File

@ -6862,26 +6862,32 @@ int ambush(cell *c, eItem what) {
cell *clast = NULL; cell *clast = NULL;
cell *ccur = c0; cell *ccur = c0;
int v = VALENCE; int v = VALENCE;
for(int tries=0; tries<10000; tries++) { if(v > 4) {
cell *c2 = NULL; for(cell *c: cl.lst) if(cl.getdist(c) == d) around.push_back(c);
if(v == 3) { hrandom_shuffle(&around[0], isize(around));
forCellEx(c1, ccur) }
if(c1 != clast && cl.listed(c1) && cl.getdist(c1) == d) else {
c2 = c1; for(int tries=0; tries<10000; tries++) {
} cell *c2 = NULL;
else { if(v == 3) {
for(int i=0; i<ccur->type; i++) { forCellEx(c1, ccur)
cell *c1 = (cellwalker(ccur, i) + wstep + 1).peek(); if(c1 != clast && cl.listed(c1) && cl.getdist(c1) == d)
if(!c1) continue; c2 = c1;
if(c1 != clast && cl.listed(c1) && cl.getdist(c1) == d)
c2 = c1;
} }
if(v == 4) {
for(int i=0; i<ccur->type; i++) {
cell *c1 = (cellwalker(ccur, i) + wstep + 1).peek();
if(!c1) continue;
if(c1 != clast && cl.listed(c1) && cl.getdist(c1) == d)
c2 = c1;
}
}
if(!c2) break;
if(c2->land == laHunting && c2->wall == waNone && c2->monst == moNone)
around.push_back(c2);
clast = ccur; ccur = c2;
if(c2 == c0) break;
} }
if(!c2) break;
if(c2->land == laHunting && c2->wall == waNone && c2->monst == moNone)
around.push_back(c2);
clast = ccur; ccur = c2;
if(c2 == c0) break;
} }
int N = isize(around); int N = isize(around);
int dogs = ambushSize(c, what); int dogs = ambushSize(c, what);