瞬移穿过绿点&短距离瞬移录像

This commit is contained in:
ckcz123 2020-06-12 15:40:22 +08:00
parent e11532ed3c
commit d5888c49fd
2 changed files with 22 additions and 6 deletions

View File

@ -1588,7 +1588,8 @@ control.prototype._replayAction_moveDirectly = function (action) {
var pos=action.substring(5).split(":");
var x=parseInt(pos[0]), y=parseInt(pos[1]);
var nowx=core.getHeroLoc('x'), nowy=core.getHeroLoc('y');
if (!core.moveDirectly(x, y)) return false;
var ignoreSteps = core.canMoveDirectly(x, y);
if (!core.moveDirectly(x, y, ignoreSteps)) return false;
if (core.status.replay.speed == 24) {
core.replay();
return true;
@ -1596,10 +1597,12 @@ control.prototype._replayAction_moveDirectly = function (action) {
core.ui.drawArrow('ui', 32*nowx+16-core.bigmap.offsetX, 32*nowy+16-core.bigmap.offsetY,
32*x+16-core.bigmap.offsetX, 32*y+16-core.bigmap.offsetY, '#FF0000', 3);
var timeout = this.__replay_getTimeout();
if (ignoreSteps < 10) timeout = timeout * ignoreSteps / 10;
setTimeout(function () {
core.clearMap('ui');
core.replay();
}, core.control.__replay_getTimeout());
}, timeout);
return true;
}

View File

@ -638,7 +638,12 @@ maps.prototype._canMoveDirectly_bfs = function (sx, sy, locs, number, ans) {
// if (nx == ex && ny == ey) return visited[nindex];
for (var i in ans) {
if (locs[i][0] == nx && locs[i][1] == ny && ans[i] == null) {
ans[i] = visited[nindex];
// 不可以绿点为终点
if (blocksObj[nx + "," + ny] && blocksObj[nx + "," + ny].event.trigger) {
ans[i] = -1;
} else {
ans[i] = visited[nindex];
}
number--;
if (number == 0) return ans;
}
@ -655,9 +660,17 @@ maps.prototype._canMoveDirectly_bfs = function (sx, sy, locs, number, ans) {
maps.prototype._canMoveDirectly_checkNextPoint = function (blocksObj, x, y) {
var index = x + "," + y;
// 该点是否有事件
if (blocksObj[index] && (blocksObj[index].event.trigger || blocksObj[index].event.noPass
|| blocksObj[index].event.script)) return false;
// 该点是否不可通行或有脚本
if (blocksObj[index] && (blocksObj[index].event.noPass || blocksObj[index].event.script))
return false;
// 该点是否是绿点可触发
if (blocksObj[index] && blocksObj[index].event.trigger) {
if (blocksObj[index].event.trigger != 'changeFloor') return false;
var ignore = core.flags.ignoreChangeFloor;
if (blocksObj[index].event.data && blocksObj[index].event.data.ignoreChangeFloor != null)
ignore = blocksObj[index].event.data.ignoreChangeFloor;
if (!ignore) return false;
}
// 是否存在阻激夹域伤害
if (core.status.checkBlock.damage[index]) return false;
// 是否存在捕捉