From f453f0963620aac09c83a148d6f00bcc1554143b Mon Sep 17 00:00:00 2001 From: oc Date: Tue, 5 Dec 2017 11:06:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A5=BC=E6=A2=AF=E3=80=81=E4=BC=A0=E9=80=81?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/core.js | 35 ++++++++++++++++------------------- libs/data.js | 1 + libs/events.js | 6 +++++- libs/floors/sample0.js | 24 ++++++++++++++++-------- libs/maps.js | 8 ++++++-- 5 files changed, 44 insertions(+), 30 deletions(-) diff --git a/libs/core.js b/libs/core.js index c9c8c9d4..a0d0ae61 100644 --- a/libs/core.js +++ b/libs/core.js @@ -1407,6 +1407,7 @@ core.prototype.changeFloor = function (floorId, stair, heroLoc, callback) { core.lockControl(); core.stopHero(); core.stopAutomaticRoute(); + core.clearContinueAutomaticRoute(); core.dom.floorNameLabel.innerHTML = core.status.maps[floorId].title; if (core.isset(stair)) { // find heroLoc @@ -1438,7 +1439,8 @@ core.prototype.changeFloor = function (floorId, stair, heroLoc, callback) { core.events.afterChangeFloor(floorId); if (core.isset(callback)) callback(); }); - core.setHeroLoc('direction', heroLoc.direction); + if (core.isset(heroLoc.direction)) + core.setHeroLoc('direction', heroLoc.direction); core.setHeroLoc('x', heroLoc.x); core.setHeroLoc('y', heroLoc.y); core.drawHero(core.getHeroLoc('direction'), core.getHeroLoc('x'), core.getHeroLoc('y'), 'stop'); @@ -1591,7 +1593,7 @@ core.prototype.drawMap = function (mapName, callback) { var blockIcon, blockImage; core.clearMap('all'); core.rmGlobalAnimate(null, null, true); - core.enabledAllTrigger(); + // core.enabledAllTrigger(); for (var x = 0; x < 13; x++) { for (var y = 0; y < 13; y++) { blockIcon = core.material.icons.terrains.ground; @@ -1766,28 +1768,23 @@ core.prototype.trigger = function (x, y) { if (noPass) { core.clearAutomaticRouteNode(x, y); } - /* - if(core.isset(mapBlocks[b].fg) && core.isset(mapBlocks[b].fg.trigger) && (core.isset(mapBlocks[b].fg.disabledTrigger) ? mapBlocks[b].fg.disabledTrigger == false : true)) { - core.material.events[mapBlocks[b].fg.trigger](mapBlocks[b], core, function(data) { - - }); - } - */ - if (core.isset(mapBlocks[b].event) && core.isset(mapBlocks[b].event.trigger) && (core.isset(mapBlocks[b].event.disabledTrigger) ? mapBlocks[b].event.disabledTrigger == false : true) - && !(core.isset(mapBlocks[b].event.noTriggerCross) && mapBlocks[b].event.noTriggerCross && (core.status.autoHeroMove || core.status.autoStep