mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-10-28 20:37:40 +00:00
Hunting Grounds in >4-valent tilings
This commit is contained in:
8
game.cpp
8
game.cpp
@@ -6862,6 +6862,11 @@ int ambush(cell *c, eItem what) {
|
|||||||
cell *clast = NULL;
|
cell *clast = NULL;
|
||||||
cell *ccur = c0;
|
cell *ccur = c0;
|
||||||
int v = VALENCE;
|
int v = VALENCE;
|
||||||
|
if(v > 4) {
|
||||||
|
for(cell *c: cl.lst) if(cl.getdist(c) == d) around.push_back(c);
|
||||||
|
hrandom_shuffle(&around[0], isize(around));
|
||||||
|
}
|
||||||
|
else {
|
||||||
for(int tries=0; tries<10000; tries++) {
|
for(int tries=0; tries<10000; tries++) {
|
||||||
cell *c2 = NULL;
|
cell *c2 = NULL;
|
||||||
if(v == 3) {
|
if(v == 3) {
|
||||||
@@ -6869,7 +6874,7 @@ int ambush(cell *c, eItem what) {
|
|||||||
if(c1 != clast && cl.listed(c1) && cl.getdist(c1) == d)
|
if(c1 != clast && cl.listed(c1) && cl.getdist(c1) == d)
|
||||||
c2 = c1;
|
c2 = c1;
|
||||||
}
|
}
|
||||||
else {
|
if(v == 4) {
|
||||||
for(int i=0; i<ccur->type; i++) {
|
for(int i=0; i<ccur->type; i++) {
|
||||||
cell *c1 = (cellwalker(ccur, i) + wstep + 1).peek();
|
cell *c1 = (cellwalker(ccur, i) + wstep + 1).peek();
|
||||||
if(!c1) continue;
|
if(!c1) continue;
|
||||||
@@ -6883,6 +6888,7 @@ int ambush(cell *c, eItem what) {
|
|||||||
clast = ccur; ccur = c2;
|
clast = ccur; ccur = c2;
|
||||||
if(c2 == c0) break;
|
if(c2 == c0) break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
int N = isize(around);
|
int N = isize(around);
|
||||||
int dogs = ambushSize(c, what);
|
int dogs = ambushSize(c, what);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user