ambush || []
This commit is contained in:
parent
84213fd528
commit
4b32b0c571
@ -684,7 +684,7 @@ control.prototype.automaticRoute = function (destX, destY) {
|
|||||||
}
|
}
|
||||||
deepAdd+=core.status.checkBlock.damage[nid]*10;
|
deepAdd+=core.status.checkBlock.damage[nid]*10;
|
||||||
// 绕过捕捉
|
// 绕过捕捉
|
||||||
if (core.status.checkBlock.ambush[nid])
|
if ((core.status.checkBlock.ambush||[])[nid])
|
||||||
deepAdd += 10000;
|
deepAdd += 10000;
|
||||||
|
|
||||||
if (nx == destX && ny == destY) {
|
if (nx == destX && ny == destY) {
|
||||||
@ -1288,7 +1288,7 @@ control.prototype.checkBlock = function () {
|
|||||||
core.snipe(snipe);
|
core.snipe(snipe);
|
||||||
}
|
}
|
||||||
// 检查捕捉
|
// 检查捕捉
|
||||||
var ambush = core.status.checkBlock.ambush[x+core.bigmap.width*y];
|
var ambush = (core.status.checkBlock.ambush||[])[x+core.bigmap.width*y];
|
||||||
if (core.isset(ambush)) {
|
if (core.isset(ambush)) {
|
||||||
// 捕捉效果
|
// 捕捉效果
|
||||||
var actions = [];
|
var actions = [];
|
||||||
|
|||||||
@ -427,7 +427,7 @@ maps.prototype.canMoveDirectly = function (destX,destY) {
|
|||||||
if (!core.canMoveHero(nowX, nowY, dir)) continue;
|
if (!core.canMoveHero(nowX, nowY, dir)) continue;
|
||||||
var nx=nowX+directions[dir][0], ny=nowY+directions[dir][1];
|
var nx=nowX+directions[dir][0], ny=nowY+directions[dir][1];
|
||||||
if (nx<0||nx>=core.bigmap.width||ny<0||ny>=core.bigmap.height||visited[nx+core.bigmap.width*ny]||core.getBlock(nx,ny)!=null
|
if (nx<0||nx>=core.bigmap.width||ny<0||ny>=core.bigmap.height||visited[nx+core.bigmap.width*ny]||core.getBlock(nx,ny)!=null
|
||||||
||core.status.checkBlock.damage[nx+core.bigmap.width*ny]>0||core.status.checkBlock.ambush[nx+core.bigmap.width*ny]) continue;
|
||core.status.checkBlock.damage[nx+core.bigmap.width*ny]>0||(core.status.checkBlock.ambush||[])[nx+core.bigmap.width*ny]) continue;
|
||||||
visited[nx+core.bigmap.width*ny]=visited[nowX+core.bigmap.width*nowY]+1;
|
visited[nx+core.bigmap.width*ny]=visited[nowX+core.bigmap.width*nowY]+1;
|
||||||
if (nx==destX&&ny==destY) return visited[nx+core.bigmap.width*ny];
|
if (nx==destX&&ny==destY) return visited[nx+core.bigmap.width*ny];
|
||||||
queue.push(nx+core.bigmap.width*ny);
|
queue.push(nx+core.bigmap.width*ny);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user