From c644f9f410562df4b797fe2d33aa5c6a11d68a4e Mon Sep 17 00:00:00 2001 From: oc Date: Sat, 10 Feb 2018 11:47:21 +0800 Subject: [PATCH 1/5] Update Map Generator4 --- 常用工具/地图生成器.exe | Bin 20480 -> 20480 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/常用工具/地图生成器.exe b/常用工具/地图生成器.exe index 286aa26b602ab2ecad1a8db0074e005624133e98..6d56bf065f7b86ecda050259391be5283b2594f8 100644 GIT binary patch delta 647 zcmX}qL1+^}6b9h`&5})^X=!SxF~+7rlLnJ$ZGwjiYD*J?hZ1ZtRa8Xd!BPl_f``~7 zDkU`{SqI}mC@JP5cqpuAK`eS`FShpJo@gLUAjjfY>4_37x^{kMn45)!(()0jx{WThY~7@JxbfRojTX_13sI}GDb$CKt+tRC@qx%YOXjG}`TG0L=g1nOTy%CI=%LC7Yy@k`ISkIGU#{B7D$(^K< zIeq-4o)GJCUbbc84v4=O70VG#181ftrtSnsPyOioJ6V6gHZFZwz7;hSX(x5h*}Ec- hJ>p}Ty{u9&LSFMm<{_Cq*F|90&04?+rUUuv)ve)~cJko4SU&{d4IMR9m^aV2CMXMReHq;$E^SFeq0o zMB9j&o@_`LBQHURVva=~k~(;Dy@?@027wVor?5Zoy%`&L10R0h_xrtJ-smii&XPH) zeVRXG75CC3>%{;iIZ?A`D+`3Vm2Tq~shOtv7!_heIjAQi-V7cL9|i8W0VG@t=)HD~ zz1OIlZ+O<}G5@GHQl4+>`JDlM&xKujK#!UtdNRxN-m(wmmtAJ)PPN@<{0J5@aoKzf zgER~uOjkE)1QpnHHAz$Oh<8G% z|5`v4TS_G?vqdx@)qYJztGA6X&h@(r%`QA7V+pp`NNBq6lZ=d>8QS6>sd9qQH`1Zxlop`Ay#C5nN z+cL4j;+KW4ij@ZX`aAmXMvis;toqwie89?AmY&^;+sD&hs=Vyp4Y_TEpX;n+LpduJ aw8uLi5>Jue-jVs`VP?_}^n54lkoO;+YKHaz From 025f37911b4f2bf23735125e414e6f9a4837f84a Mon Sep 17 00:00:00 2001 From: oc Date: Sun, 11 Feb 2018 21:26:08 +0800 Subject: [PATCH 2/5] Update doc --- docs/event.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/event.md b/docs/event.md index 8bdf07cb..296357f9 100644 --- a/docs/event.md +++ b/docs/event.md @@ -954,6 +954,8 @@ core.insertAction(list) //往当前事件列表中插入一系列事件。使用 由于NPC是自定义事件,因此我们需要写events。注意到events中不覆盖trigger,则还是怪物时,存在系统trigger因此会战斗;变成NPC后没有系统trigger因此会触发自定义事件。 +请注意打死怪物时默认会禁用该点,因此替换后需要手动进行show来启用。 + ``` js "events": { "x,y": [ @@ -962,7 +964,8 @@ core.insertAction(list) //往当前事件列表中插入一系列事件。使用 }, "afterBattle": { "x,y": [ - {"type": "setBlock", "number": 121} // 变成老人 + {"type": "setBlock", "number": 121}, // 变成老人 + {"type": "show", "loc": [x,y]} // 启用该点 ] } ``` From f9a147b0ba47fd5717c89b568da7a318975871ed Mon Sep 17 00:00:00 2001 From: oc Date: Mon, 12 Feb 2018 14:18:11 +0800 Subject: [PATCH 3/5] Fix a Bug --- libs/core.js | 10 ++++++---- libs/floors/sample0.js | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/core.js b/libs/core.js index 56d32eec..8176977a 100644 --- a/libs/core.js +++ b/libs/core.js @@ -1943,9 +1943,11 @@ core.prototype.canMoveHero = function(x,y,direction,floorId) { if (!core.isset(floorId)) floorId=core.status.floorId; // 检查当前块的cannotMove - var cannotMove = core.floors[floorId].cannotMove[x+","+y]; - if (core.isset(cannotMove) && cannotMove instanceof Array && cannotMove.indexOf(direction)>=0) - return false; + if (core.isset(core.floors[floorId].cannotMove)) { + var cannotMove = core.floors[floorId].cannotMove[x+","+y]; + if (core.isset(cannotMove) && cannotMove instanceof Array && cannotMove.indexOf(direction)>=0) + return false; + } var nowBlock = core.getBlock(x,y,floorId); if (nowBlock!=null){ @@ -2344,7 +2346,7 @@ core.prototype.trigger = function (x, y) { var trigger = mapBlocks[b].event.trigger; // 转换楼层能否穿透 - if (trigger=='changeFloor') { + if (trigger=='changeFloor' && !noPass) { var canCross = core.flags.portalWithoutTrigger; if (core.isset(mapBlocks[b].event.data) && core.isset(mapBlocks[b].event.data.portalWithoutTrigger)) canCross=mapBlocks[b].event.data.portalWithoutTrigger; diff --git a/libs/floors/sample0.js b/libs/floors/sample0.js index 5fb84bfd..5f0fa6d7 100644 --- a/libs/floors/sample0.js +++ b/libs/floors/sample0.js @@ -34,7 +34,6 @@ main.floors.sample0 = { "本层主要对道具、门、怪物等进行介绍,有关事件的各种信息在下一层会有更为详细的说明。", ], "events": { // 该楼的所有可能事件列表 - "10,9": [ // 守着道具的老人 "\t[老人,man]这些是本样板支持的所有的道具。\n\n道具分为三类:items, constants, tools。\nitems 为即捡即用类道具,例如宝石、血瓶、剑盾等。\nconstants 为永久道具,例如怪物手册、楼层传送器、幸运金币等。\ntools 为消耗类道具,例如破墙镐、炸弹、中心对称飞行器等。\n\n后两类道具在工具栏中可以看到并使用。", "\t[老人,man]\b[up]有关道具效果,定义在items.js中。\n目前大多数道具已有默认行为,如有自定义的需求则需在items.js中修改代码。", @@ -77,6 +76,7 @@ main.floors.sample0 = { }, }, "changeFloor": { // 楼层转换事件;该事件不能和上面的events有冲突(同位置点),否则会被覆盖 + "7,9": {"floorId": "sample1", "stair": "downFloor"}, "6,0": {"floorId": "sample1", "stair": "downFloor"}, // 目标点:sample1层的下楼梯位置 "0,11": {"floorId": "sample0", "loc": [0,12]}, // 目标点:sample0层的x=0,y=12位置 "0,12": {"floorId": "sample0", "stair": "upFloor"}, // 注意,目标层有多个楼梯的话,写stair可能会导致到达位置不确定。这时候推荐写loc指明目标点位置。 From 27e6dc802d178518a2c40ba5124ff283288bf76c Mon Sep 17 00:00:00 2001 From: oc Date: Mon, 12 Feb 2018 14:32:46 +0800 Subject: [PATCH 4/5] Fix Shop Bug --- libs/events.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/events.js b/libs/events.js index 533cb8f6..457cedea 100644 --- a/libs/events.js +++ b/libs/events.js @@ -1229,6 +1229,7 @@ events.prototype.clickShop = function(x,y) { core.status.route.push("shop:"+core.status.event.data.id+":"+core.status.event.data.actions.join("")); } + core.status.event.data.actions = []; core.status.boxAnimateObjs = []; if (core.status.event.data.fromList) core.ui.drawQuickShop(); @@ -1258,6 +1259,8 @@ events.prototype.keyUpShop = function (keycode) { core.status.route.push("shop:"+core.status.event.data.id+":"+core.status.event.data.actions.join("")); } + core.status.event.data.actions = []; + core.status.boxAnimateObjs = []; if (core.status.event.data.fromList) From 6829e60d435fa97b12bcd52ea705008c5b6a713e Mon Sep 17 00:00:00 2001 From: oc Date: Mon, 12 Feb 2018 16:41:39 +0800 Subject: [PATCH 5/5] Update Autosave Bug --- libs/core.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libs/core.js b/libs/core.js index 8176977a..b84dccd9 100644 --- a/libs/core.js +++ b/libs/core.js @@ -2220,17 +2220,16 @@ core.prototype.openDoor = function (id, x, y, needKey, callback) { var speed=30; if (needKey) { var key = id.replace("Door", "Key"); - if (!core.removeItem(key)) { + if (!core.hasItem(key)) { if (key != "specialKey") core.drawTip("你没有" + core.material.items[key].name); else core.drawTip("无法开启此门"); core.clearContinueAutomaticRoute(); return; } - } - - if (!core.isset(core.status.event.id)) // 自动存档 core.autosave(true); + core.removeItem(key); + } // open core.playSound("door.ogg"); @@ -4363,11 +4362,11 @@ core.prototype.openSettings = function (need) { ////// 自动存档 ////// core.prototype.autosave = function (removeLast) { - var x; + var x=null; if (removeLast) x=core.status.route.pop(); core.saveData("autoSave"); - if (removeLast) + if (removeLast && core.isset(x)) core.status.route.push(x); }