From 41df30107969b112568d9640aa10599b0af07191 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 25 Nov 2018 13:04:30 +0800 Subject: [PATCH] Fix changeFloor Time --- _server/blockly/MotaAction.g4 | 2 +- _server/comment.js | 26 +++++++++++++------------- _server/editor_file.js | 7 +++---- project/floors/MT0.js | 2 +- project/floors/sample1.js | 18 +++--------------- 5 files changed, 21 insertions(+), 34 deletions(-) diff --git a/_server/blockly/MotaAction.g4 b/_server/blockly/MotaAction.g4 index d1e4757d..2edfa2d9 100644 --- a/_server/blockly/MotaAction.g4 +++ b/_server/blockly/MotaAction.g4 @@ -197,7 +197,7 @@ if (Floor_List_0!='floorId') toFloorId = Floor_List_0; var loc = ', "loc": ['+Number_0+', '+Number_1+']'; if (Stair_List_0!=='loc')loc = ', "stair": "'+Stair_List_0+'"'; DirectionEx_List_0 = DirectionEx_List_0 && (', "direction": "'+DirectionEx_List_0+'"'); -Int_0 = Int_0 ?(', "time": '+Int_0):''; +Int_0 = (Int_0!=='') ?(', "time": '+Int_0):''; Bool_0 = Bool_0 ?'':(', "portalWithoutTrigger": false'); var code = '{"floorId": "'+toFloorId+'"'+loc+DirectionEx_List_0+Int_0+Bool_0+' }\n'; return code; diff --git a/_server/comment.js b/_server/comment.js index 2258721c..06765ec0 100644 --- a/_server/comment.js +++ b/_server/comment.js @@ -307,6 +307,19 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc = "_bool": "bool", "_data": "该层是否不允许被浏览地图看到;如果勾上则浏览地图会跳过该层" }, + "firstArrive": { + "_leaf": true, + "_type": "event", + "_event": "firstArrive", + "_data": "第一次到该楼层触发的事件,可以双击进入事件编辑器。" + }, + "parallelDo": { + "_leaf": true, + "_type": "textarea", + "_string": true, + "_lint": true, + "_data": "在该层楼时执行的并行事件处理。\n可以在这里写上任意需要自动执行的脚本,比如打怪自动开门等。\n详见文档-事件-并行事件处理。" + }, "upFloor": { "_leaf": true, "_type": "textarea", @@ -353,19 +366,6 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc = "_range": "(thiseval==~~thiseval && thiseval>=0)||thiseval==null", "_data": "每一层的宝石/血瓶效果,即获得宝石和血瓶时框内\"ratio\"的值。" }, - "firstArrive": { - "_leaf": true, - "_type": "event", - "_event": "firstArrive", - "_data": "第一次到该楼层触发的事件,可以双击进入事件编辑器。" - }, - "parallelDo": { - "_leaf": true, - "_type": "textarea", - "_string": true, - "_lint": true, - "_data": "在该层楼时执行的并行事件处理。\n可以在这里写上任意需要自动执行的脚本,比如打怪自动开门等。\n详见文档-事件-并行事件处理。" - }, "underGround": { "_leaf": true, "_type": "checkbox", diff --git a/_server/editor_file.js b/_server/editor_file.js index b44dfd5b..8f1d5d31 100644 --- a/_server/editor_file.js +++ b/_server/editor_file.js @@ -132,11 +132,10 @@ editor_file = function (editor, callback) { var currData=editor.currentFloorData; var saveStatus = document.getElementById('newMapStatus').checked; - var floorId = saveFilename; var title = saveStatus?currData.title:"新建楼层"; var name = saveStatus?currData.name:"0"; - if (/^mt\d+$/i.test(floorId)) { - name = floorId.substring(2); + if (/^mt\d+$/i.test(saveFilename)) { + name = saveFilename.substring(2); title = "主塔 "+name+" 层"; } editor.currentFloorData = { @@ -157,7 +156,7 @@ editor_file = function (editor, callback) { color: saveStatus?currData.color:null, weather: saveStatus?currData.weather:null, firstArrive: [], - parallelDo: null, + parallelDo: "", events: {}, changeFloor: {}, afterBattle: {}, diff --git a/project/floors/MT0.js b/project/floors/MT0.js index 0b5151b5..e4f506ab 100644 --- a/project/floors/MT0.js +++ b/project/floors/MT0.js @@ -25,11 +25,11 @@ main.floors.MT0= [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ], "firstArrive": [], + "parallelDo": "", "events": {}, "changeFloor": {}, "afterBattle": {}, "afterGetItem": {}, "afterOpenDoor": {}, "cannotMove": {}, - "upFloor": null, } \ No newline at end of file diff --git a/project/floors/sample1.js b/project/floors/sample1.js index 659098a7..ad77484b 100644 --- a/project/floors/sample1.js +++ b/project/floors/sample1.js @@ -769,19 +769,7 @@ main.floors.sample1= ], "10,12": null }, -"afterGetItem": { - "10,12": null -}, -"afterOpenDoor": { - "10,12": null -}, -"cannotMove": { - "10,12": null -}, -"bgmap": [ - -], -"fgmap": [ - -], +"afterGetItem": {}, +"afterOpenDoor": {}, +"cannotMove": {}, } \ No newline at end of file