修复阻击推下悬崖问题

This commit is contained in:
ckcz123 2020-05-26 22:27:03 +08:00
parent 91f73e7c49
commit fa6f6cf0af
3 changed files with 13 additions and 8 deletions

View File

@ -776,7 +776,7 @@ events.prototype.pushBox = function (data) {
// 检测能否推上去
if (!core.canMoveHero()) return;
var canGoDeadZone = core.flags.canGoDeadZone;
core.flags.canGoDeadZone = false;
core.flags.canGoDeadZone = true;
if (!core.canMoveHero(data.x, data.y, direction)) {
core.flags.canGoDeadZone = canGoDeadZone;
return;

View File

@ -511,9 +511,9 @@ maps.prototype._canMoveHero_checkPoint = function (x, y, direction, floorId, ext
return false;
// 3. 检查是否能进将死的领域
if (floorId == core.status.floorId
&& core.status.hero.hp <= (core.status.checkBlock.damage[nx + "," + ny]||0)
&& !core.flags.canGoDeadZone && extraData.eventArray[ny][nx] == 0)
if (floorId == core.status.floorId && !core.flags.canGoDeadZone &&
core.status.hero.hp <= (core.status.checkBlock.damage[nx + "," + ny]||0)
&& extraData.eventArray[ny][nx] == 0)
return false;
return true;

View File

@ -126,6 +126,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// ---------- 重绘新地图这一步将会设置core.status.floorId ---------- //
core.drawMap(floorId);
// item_ratio兼容性...
if (core.status.thisMap.ratio == null && core.status.thisMap.item_ratio != null) {
core.status.thisMap.ratio = core.status.thisMap.item_ratio;
}
// 切换楼层BGM
if (core.status.maps[floorId].bgm) {
@ -546,6 +550,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}
// TODO如果有其他类型光环怪物在这里仿照添加检查
// 注新增新的类光环属性需要遍历全图的需要在特殊属性定义那里的第五项写1参见光环和支援的特殊属性定义。
}
});
@ -1061,6 +1066,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
repulse = {}, // 每个点的阻击怪信息
ambush = {}; // 每个点的捕捉信息
var needCache = false;
var canGoDeadZone = core.flags.canGoDeadZone;
core.flags.canGoDeadZone = true;
// 计算血网和领域、阻击、激光的伤害,计算捕捉信息
for (var loc in blocks) {
@ -1116,10 +1123,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
type[currloc]["阻击伤害"] = true;
var rdir = core.turnDirection(":back", dir);
// 检查下一个点是否存在事件(从而判定是否移动)
var rnx = x + core.utils.scan[rdir].x,
rny = y + core.utils.scan[rdir].y;
if (rnx >= 0 && rnx < width && rny >= 0 && rny < height && core.getBlock(rnx, rny, floorId) == null) {
if (core.canMoveHero(x, y, rdir, floorId)) {
repulse[currloc] = (repulse[currloc] || []).concat([
[x, y, id, rdir]
]);
@ -1217,6 +1221,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}
}
core.flags.canGoDeadZone = canGoDeadZone;
core.status.checkBlock = {
damage: damage,
type: type,