mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-05-19 15:44:08 +00:00
canReachPlayer now can put frogs
This commit is contained in:
parent
3597342f28
commit
03dcd5fa17
@ -253,14 +253,21 @@ EX bool canReachPlayer(cell *cf, eMonster m) {
|
|||||||
cl.add(cf);
|
cl.add(cf);
|
||||||
for(int i=0; i<isize(cl.lst) && i < 10000; i++) {
|
for(int i=0; i<isize(cl.lst) && i < 10000; i++) {
|
||||||
cell *c = cl.lst[i];
|
cell *c = cl.lst[i];
|
||||||
for(int j=0; j<c->type; j++) {
|
bool found = false;
|
||||||
cell *c2 = c->move(j);
|
|
||||||
if(!c2) continue;
|
auto test = [&] (cell *c2) {
|
||||||
if(cl.listed(c2)) continue;
|
if(cl.listed(c2)) return;
|
||||||
if(!passable_for(m, c2, c, P_MONSTER | P_ONPLAYER | P_CHAIN)) continue;
|
if(!passable_for(m, c2, c, P_MONSTER | P_ONPLAYER | P_CHAIN)) return;
|
||||||
if(isPlayerOn(c2)) return true;
|
if(isPlayerOn(c2)) found = true;
|
||||||
cl.add(c2);
|
cl.add(c2);
|
||||||
|
};
|
||||||
|
|
||||||
|
forCellEx(c2, c) {
|
||||||
|
if(among(m, moFrog, moVaulter, moPhaser)) forCellEx(c3, c2) test(c3);
|
||||||
|
test(c2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(found) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user