From b8c6a4fdf71934505431980480b0ee790df11be2 Mon Sep 17 00:00:00 2001 From: oc Date: Sat, 24 Nov 2018 01:19:17 +0800 Subject: [PATCH 01/15] Auto fill new floor title --- _server/editor_file.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/_server/editor_file.js b/_server/editor_file.js index 71d03d5d..e9e857db 100644 --- a/_server/editor_file.js +++ b/_server/editor_file.js @@ -131,10 +131,18 @@ 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); + title = "主塔 "+name+" 层"; + } editor.currentFloorData = { floorId: saveFilename, - title: saveStatus?currData.title:"新建楼层", - name: saveStatus?currData.name:"0", + title: title, + name: name, width: parseInt(document.getElementById('newMapWidth').value), height: parseInt(document.getElementById('newMapHeight').value), canFlyTo: saveStatus?currData.canFlyTo:true, From c848ca8c13961b86bd44a8cbde316f2ce7f32ac3 Mon Sep 17 00:00:00 2001 From: oc Date: Sat, 24 Nov 2018 16:17:53 +0800 Subject: [PATCH 02/15] animate noPass --- libs/maps.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/maps.js b/libs/maps.js index 510141d3..00879f0f 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -89,9 +89,7 @@ maps.prototype.addInfo = function (block) { block.event.trigger = 'getItem'; } if (!core.isset(block.event.noPass)) { - if (block.event.cls.indexOf("enemy")==0 || block.event.cls.indexOf("npc")==0 || block.event.cls=='terrains' || block.event.cls=='autotile') { - block.event.noPass = true; - } + block.event.noPass = true; } if (!core.isset(block.event.animate)) { if (block.event.cls=='enemys' || block.event.cls=='npcs') { From d4337a5f32fad30a0c68a97ca05ada9bf137526e Mon Sep 17 00:00:00 2001 From: oc Date: Sat, 24 Nov 2018 17:53:50 +0800 Subject: [PATCH 03/15] Fix Compress Bug & Error Message --- libs/events.js | 2 +- libs/ui.js | 14 +++++++------- 常用工具/JS代码压缩工具.exe | Bin 8192 -> 8704 bytes 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libs/events.js b/libs/events.js index 72d6eacd..5a688f59 100644 --- a/libs/events.js +++ b/libs/events.js @@ -919,7 +919,7 @@ events.prototype.doAction = function() { case "switch": // 条件选择 var key = core.calValue(data.condition) for (var i = 0; i < data.caseList.length; i++) { - if (data.caseList[i].case=="default" || core.calValue(data.caseList[i].case) == key) { + if (data.caseList[i]["case"]=="default" || core.calValue(data.caseList[i]["case"]) == key) { core.events.insertAction(data.caseList[i].action); break; } diff --git a/libs/ui.js b/libs/ui.js index a9ad53e9..ecf31465 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -534,17 +534,17 @@ ui.prototype.drawTextBox = function(content, showAll) { } // get next character - var char = content.charAt(index++); + var ch = content.charAt(index++); // \n, \\n - if (char == '\n' || (char=='\\' && content.charAt(index)=='n')) { + if (ch == '\n' || (ch=='\\' && content.charAt(index)=='n')) { offsetx = content_left; offsety += textfont+5; - if (char=='\\') index++; + if (ch=='\\') index++; return drawNext(); } // \r, \\r - if (char == '\r' || (char=='\\' && content.charAt(index)=='r')) { - if (char == '\\') index++; + if (ch == '\r' || (ch=='\\' && content.charAt(index)=='r')) { + if (ch == '\\') index++; changed = true; // 检查是不是 [] var index2; @@ -559,7 +559,7 @@ ui.prototype.drawTextBox = function(content, showAll) { return drawNext(); } // 检查是不是自动换行 - var charwidth = core.canvas.ui.measureText(char).width; + var charwidth = core.canvas.ui.measureText(ch).width; if (offsetx + charwidth > content_left + validWidth) { index--; offsetx = content_left; @@ -567,7 +567,7 @@ ui.prototype.drawTextBox = function(content, showAll) { return drawNext(); } // 输出 - core.fillText('ui', char, offsetx, offsety); + core.fillText('ui', ch, offsetx, offsety); offsetx += charwidth; return true; }; diff --git a/常用工具/JS代码压缩工具.exe b/常用工具/JS代码压缩工具.exe index 318afa287a52ed65a2d97bd5f5e4b98a7b1a33db..f0447910ce05278399e12b4108804b690f96fad3 100644 GIT binary patch delta 1977 zcmZWqYitx%6h1Svv#++(Jv-akXLo12eJoIDgsyGRZyjoo~*) z_nhy{ojKTXubxfGkx=6#y|J{0{ki+r)*9TBr?Rl^{9*wyP6ay>dH1 zCHX%r21xO&+|0K~O~D;eqD&ew{+cvTO7KsmCduSeQk~gBD~RhE8ZxNhZvwci0Z8Q2 z@bVXpR=!U5$g914qr6N0S><2K1A#ckjZE_yjPn*HS(PyKWP1gLV*-!dPJk1Fs)^*|llhMt35|fyCeQ?=t_a8j)HK)9+k7ne< zVzxhT(v4+a7L1t3zI9PV*L+Vj%OpO#$JcneOSM>QmtSj9fk zJ=4Blh?2(4X+7j+izx_0>BPJty5Uscas}b#N^y-J3OYy~ZO4$UZr$i`T|t*MuGN-ZCPGheM!tU!F#YMd?LT!G(pN%NI z+p}hO9oE^E)s-u=Yt|#a`98*J!aS8(B!XUpnw~TC`t}=iRxpS4r*#7(=%EIQ{xo2N z;XQ{9QLG^wV`pe8fjAmu6ZTs`fZz7klp<)b4@D~CMYMAyF{5tnh9hQlx^|}w`kwBZU!1&TB*vFL}zmlT%i> zw#bEt=!=JFiRwOm-$i-)H1!1==SrJNL|6v;28a?x$L2naAClJBy7+rZgcARi{P*Wd znI~N7Df6njwNEYcgg;VkJ}u|x^4q@r(wlUAa|Zy{DFC-=8X& z%$K2w9|+tm-GcX&!*B~O+V(r;X?PP3$;ZfES5CoM_*Hoe02ln(A2H4>6=z{L$&%(63eD6SUcy!Pjf}O?DzSV<6#qO~^FBBQ992#A;&?Y;r z-D7)(%Cs9*u*TRxaq_s_H tOlA$A6mD;GwF2lC*qq23az`8A8vU5J%I2gNyQ|9E+a@vnyEM`2`ww0MXXF3? delta 1504 zcmZ`(U1%It6h1RM`(H9jT`Xp6}KKP<2wJ3;Uvz|M%8=o9F-<CVTym- z1&|g6wIU8HeW9m&h{}^0;#sAvSmFbvPsxgPrI??g5#)0xnF?O`qZiQxAK^LG`$LT@#|GdnR`$Fk$eY0Or>) zVPcTb;y2we;e<(k%?<4WK*&adbz6MzDeSjzkv^bh9%2?+Xg)tTyr|IFm*OQ zM@q5`W(;o9kZYJRv76B1JKQkggdIUL{|Q2~Pf<#Zwj@+}2&4Q#86_#og$^+<5f^DT z^wv_c9Un%;N7{~h7PHQ3v+imm>o&t&*e+5I4Va>(Bi867h3t|9sa;3%G)bPuG^R-M z&o^2vAAg)?boJIp-MH3mJ#ZOQvISGstCY|je#}!TP zkh3?k<$8$4FwX0;IeB8*XN>i9#E83M^!$$)1rnox1(J|U{W@WxpKTk z1o2lpyerKO8P*+@N?KbRzOw0cc{|(_9nUst&@KI>fO0DV3Q~Y7imLDSmvmK+O~)P%1TwmOV$;q$Hch_x&e#~}T)J|-X Date: Sat, 24 Nov 2018 22:30:54 +0900 Subject: [PATCH 04/15] levelUp event --- _server/blockly/MotaAction.g4 | 34 +++++++++++++++++++++++++++++ _server/data.comment.js | 5 +++-- _server/editor_blockly.js | 1 + docs/event.md | 41 +++++++++++++++++------------------ editor.html | 1 + libs/control.js | 2 +- libs/events.js | 17 ++------------- project/data.js | 38 +++++++++++++++++++++++++++----- project/functions.js | 2 +- 9 files changed, 95 insertions(+), 46 deletions(-) diff --git a/_server/blockly/MotaAction.g4 b/_server/blockly/MotaAction.g4 index 92c52eb2..d1e4757d 100644 --- a/_server/blockly/MotaAction.g4 +++ b/_server/blockly/MotaAction.g4 @@ -37,6 +37,31 @@ var code = '{"type": "choices", "choices": [\n'+choicesContext_0+']}\n'; return code; */; +//升级 事件编辑器入口之一 +level_m + : '等级提升' BGNL? Newline levelCase+ BEND + + +/* level_m +tooltip : 升级事件 +helpUrl : https://ckcz123.github.io/mota-js/#/event?id=%e7%bb%8f%e9%aa%8c%e5%8d%87%e7%ba%a7%ef%bc%88%e8%bf%9b%e9%98%b6%2f%e5%a2%83%e7%95%8c%e5%a1%94%ef%bc%89 +var code = '[\n'+levelCase_0+']\n'; +return code; +*/; + +levelCase + : '需求' expression '称号' EvalString? BGNL? Newline action+ + + +/* levelCase +tooltip : 升级设定 +helpUrl : https://ckcz123.github.io/mota-js/#/event?id=%e7%bb%8f%e9%aa%8c%e5%8d%87%e7%ba%a7%ef%bc%88%e8%bf%9b%e9%98%b6%2f%e5%a2%83%e7%95%8c%e5%a1%94%ef%bc%89 +default : [0,"",null] +colour : this.subColor +var code = '{"need": "'+expression_0+'", "title": "'+EvalString_0+'", "action": [\n'+action_0+']},\n'; +return code; +*/; + //商店 事件编辑器入口之一 shop_m : '全局商店列表' BGNL? Newline shoplist+ @@ -1679,6 +1704,15 @@ ActionParser.prototype.parse = function (obj,type) { } return MotaActionBlocks['point_m'].xmlText([text_choices]); + case 'level': + if(!obj)obj={}; + var text_choices = null; + for(var ii=obj.length-1,choice;choice=obj[ii];ii--) { + text_choices=MotaActionBlocks['levelCase'].xmlText([ + MotaActionBlocks['evalString_e'].xmlText([choice.need]),choice.title,this.parseList(choice.action),text_choices]); + } + return MotaActionBlocks['level_m'].xmlText([text_choices]); + case 'shop': var buildsub = function(obj,parser,next){ var text_choices = null; diff --git a/_server/data.comment.js b/_server/data.comment.js index 6d277522..24537bd3 100644 --- a/_server/data.comment.js +++ b/_server/data.comment.js @@ -268,9 +268,10 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = }, "levelUp": { "_leaf": true, - "_type": "textarea", + "_type": "event", + "_event": "level", "_range": "thiseval==null || thiseval instanceof Array", - "_data": "经验升级所需要的数值,是一个数组,可以双击进行编辑。 \n 第一项为初始等级,可以简单留空,也可以写name \n 每一个里面可以含有三个参数 need, name, effect \n need为所需要的经验数值,是一个正整数。请确保need所需的依次递增 \n name为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 \n effect为本次升级所执行的操作,可由若干项组成,由分号分开 \n 其中每一项写法和上面的商店完全相同,同样必须是X+=Y的形式,Y是一个表达式,同样可以使用status:xxx或item:xxx代表勇士的某项数值/道具个数" + "_data": "经验升级所需要的数值,是一个数组,可以双击进行编辑。 \n 第一项为初始等级,仅title生效 \n 每一个里面可以含有三个参数 need, title, action \n need为所需要的经验数值,可以是个表达式。请确保need依次递增 \n title为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 \n action为本次升级所执行的事件,可由若干项组成" } } }, diff --git a/_server/editor_blockly.js b/_server/editor_blockly.js index 1c1c2f21..dddcbddd 100644 --- a/_server/editor_blockly.js +++ b/_server/editor_blockly.js @@ -52,6 +52,7 @@ editor_blockly = function () { MotaActionBlocks['afterGetItem_m'].xmlText(), MotaActionBlocks['afterOpenDoor_m'].xmlText(), MotaActionBlocks['firstArrive_m'].xmlText(), + MotaActionBlocks['level_m'].xmlText(), ], '显示文字':[ MotaActionBlocks['text_0_s'].xmlText(), diff --git a/docs/event.md b/docs/event.md index 12b2aacb..40372c37 100644 --- a/docs/event.md +++ b/docs/event.md @@ -1950,37 +1950,36 @@ core.insertAction([ 要经验升级,你需要先在`data.js`中的全局变量中启用。你需要将`enableExperience`启用经验,且`enableLevelUp`启用进阶。同时你也可以将`enableLv`置为true以在状态栏中显示当前等级(境界)。 -同时,你还需要在`data.js`中的`levelUp`来定义每一个进阶所需要的生命值,以及进阶时的效果。 +同时,你还需要在`data.js`中的`levelUp`来定义每一个进阶所需要的经验值,以及进阶时的效果。 ``` js "levelUp": [ // 经验升级所需要的数值,是一个数组 - {}, // 第一项为初始等级,可以简单留空,也可以写name + {"need": "0", "title": "", "action": []}, // 第一项为初始等级,仅title生效 - // 每一个里面可以含有三个参数 need, name, effect - // need为所需要的经验数值,是一个正整数。请确保need所需的依次递增 - // name为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 - // effect为本次升级所执行的操作,可由若干项组成,由分号分开 - // 其中每一项写法和上面的商店完全相同,同样必须是X+=Y的形式,Y是一个表达式,同样可以使用status:xxx或item:xxx代表勇士的某项数值/道具个数 - {"need": 20, "name": "第二级", "effect": "status:hp+=2*(status:atk+status:def);status:atk+=10;status:def+=10"}, // 先将生命提升攻防和的2倍;再将攻击+10,防御+10 + // 每一个里面可以含有三个参数 need, title, action + // need为所需要的经验数值,可以是个表达式。请确保need依次递增 + // title为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 + // action为本次升级所执行的操作,可由若干项组成 + {"need": 20, "title": "第二级", "action": [ + {"type": "setValue","name": "status:atk","value": "status:atk+10"}, // 攻击+10 + {"type": "setValue","name": "status:def","value": "status:def+10"} // 防御+10 + ] + }, - // effect也允许写一个function,代表本次升级将会执行的操作,比如可以显示一段提示文字,或者触发一个事件 - {"need": 40, "effect": function () { - core.drawTip("恭喜升级!"); - core.status.hero.hp *= 2; - core.status.hero.atk += 100; - core.status.hero.def += 100; - }}, + // action也允许其他操作,比如可以显示一段提示文字,或者触发一个事件 + {"need": 40, "effect": [ + {"type": "tip", "text": "恭喜升级"}, + ] + }, // 依次往下写需要的数值即可 ] ``` -`levelUp`是一个数组,里面分别定义了每个等级的信息。里面每一项是一个object,主要有三个参数`need`, `name`, `effect` -- `need` 该等级所需要的经验值,是一个正整数。请确保数组中的need依次递增。 -- `name` 该等级的名称,比如“佣兵下级”等。该项可以忽略,以使用系统默认的等级。该项将显示在状态栏中。 -- `effect` 为本次等级执行的操作。它有两种写法:字符串,或函数。 - - 如果`effect`为字符串,则和上面的全局商店的写法完全相同。可由分号分开,每一项为X+=Y的形式,X为你要修改的勇士属性/道具个数,Y为一个表达式。 - - 如果`effect`为函数,则也允许写一个`function`,来代表本次升级将会执行的操作。 +`levelUp`是一个数组,里面分别定义了每个等级的信息。里面每一项有三个参数`need`, `title`, `effect` +- `need` 该等级所需要的经验值,可以是个表达式。请确保数组中的need依次递增。 +- `title` 该等级的名称,比如“佣兵下级”等。该项可以忽略,以使用系统默认的等级。该项将显示在状态栏中。 +- `action` 为本次等级执行的操作。 ## 开始,难度分歧,获胜与失败,多结局 diff --git a/editor.html b/editor.html index 0ae3917b..21325312 100644 --- a/editor.html +++ b/editor.html @@ -167,6 +167,7 @@ + diff --git a/libs/control.js b/libs/control.js index 134ae37f..f291252e 100644 --- a/libs/control.js +++ b/libs/control.js @@ -2513,7 +2513,7 @@ control.prototype.getStatus = function (statusName) { ////// 获得某个等级的名称 ////// control.prototype.getLvName = function () { - return ((core.firstData.levelUp||[])[core.status.hero.lv-1]||{}).name || core.status.hero.lv; + return ((core.firstData.levelUp||[])[core.status.hero.lv-1]||{}).title || core.status.hero.lv; } ////// 设置某个自定义变量或flag ////// diff --git a/libs/events.js b/libs/events.js index 72d6eacd..34285aa8 100644 --- a/libs/events.js +++ b/libs/events.js @@ -1685,25 +1685,12 @@ events.prototype.checkLvUp = function () { if (!core.flags.enableLevelUp || !core.isset(core.firstData.levelUp) || core.status.hero.lv>=core.firstData.levelUp.length) return; // 计算下一个所需要的数值 - var need=(core.firstData.levelUp[core.status.hero.lv]||{}).need; + var need=core.calValue((core.firstData.levelUp[core.status.hero.lv]||{}).need); if (!core.isset(need)) return; if (core.status.hero.experience>=need) { // 升级 core.status.hero.lv++; - var effect = core.firstData.levelUp[core.status.hero.lv-1].effect; - if (typeof effect == "string") { - if (effect.indexOf("function")==0) { - eval("("+effect+")()"); - } - else { - effect.split(";").forEach(function (t) { - core.doEffect(t); - }); - } - } - else if (effect instanceof Function) { - effect(); - } + core.insertAction(core.firstData.levelUp[core.status.hero.lv-1].action); this.checkLvUp(); } } diff --git a/project/data.js b/project/data.js index e8c3c64b..072fa120 100644 --- a/project/data.js +++ b/project/data.js @@ -162,15 +162,41 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = } ], "levelUp": [ - {}, { - "need": 20, - "name": "第二级", - "effect": "status:hp+=2*(status:atk+status:def);status:atk+=10;status:def+=10" + "need": "0", + "title": "", + "action": [ + { + "type": "comment", + "text": "此处是初始等级,只需填写称号" + } + ] }, { - "need": 40, - "effect": "function () {\r\n\t\t\tcore.insertAction(\"恭喜升级!\");\r\n\t\t\tcore.status.hero.hp *= 2;\r\n\t\t\tcore.status.hero.atk += 100;\r\n\t\t\tcore.status.hero.def += 100;\r\n\t\t}" + "need": "20", + "title": "第二级", + "action": [ + { + "type": "setValue", + "name": "status:atk", + "value": "status:atk+10" + }, + { + "type": "setValue", + "name": "status:def", + "value": "status:def+10" + } + ] + }, + { + "need": "40", + "title": "", + "action": [ + { + "type": "tip", + "text": "恭喜升级" + } + ] } ] }, diff --git a/project/functions.js b/project/functions.js index ca618442..f3d3bf5d 100644 --- a/project/functions.js +++ b/project/functions.js @@ -817,7 +817,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = // 进阶 if (core.flags.enableLevelUp && core.status.hero.lv Date: Sat, 24 Nov 2018 22:46:46 +0900 Subject: [PATCH 05/15] fix typo --- docs/event.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/event.md b/docs/event.md index 40372c37..1d7f484e 100644 --- a/docs/event.md +++ b/docs/event.md @@ -1960,14 +1960,14 @@ core.insertAction([ // need为所需要的经验数值,可以是个表达式。请确保need依次递增 // title为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 // action为本次升级所执行的操作,可由若干项组成 - {"need": 20, "title": "第二级", "action": [ + {"need": "20", "title": "第二级", "action": [ {"type": "setValue","name": "status:atk","value": "status:atk+10"}, // 攻击+10 {"type": "setValue","name": "status:def","value": "status:def+10"} // 防御+10 ] }, // action也允许其他操作,比如可以显示一段提示文字,或者触发一个事件 - {"need": 40, "effect": [ + {"need": "40", "effect": [ {"type": "tip", "text": "恭喜升级"}, ] }, From 873f2d3a9cf3a3c1a39604afacf7e2d803ee01b2 Mon Sep 17 00:00:00 2001 From: tocque <364004564@qq.com> Date: Sat, 24 Nov 2018 22:51:06 +0900 Subject: [PATCH 06/15] fix more typo --- editor-mobile.html | 1 + editor.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/editor-mobile.html b/editor-mobile.html index cd51f4ed..9141fe2d 100644 --- a/editor-mobile.html +++ b/editor-mobile.html @@ -168,6 +168,7 @@ + diff --git a/editor.html b/editor.html index 21325312..41e3e25c 100644 --- a/editor.html +++ b/editor.html @@ -167,7 +167,7 @@ - + From cd530d62b47cc682a5ad8ed455f8d1d5bcc7a645 Mon Sep 17 00:00:00 2001 From: oc Date: Sun, 25 Nov 2018 00:12:32 +0800 Subject: [PATCH 07/15] Fix Replay Bug --- libs/control.js | 2 +- libs/maps.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/control.js b/libs/control.js index f291252e..09b16d1c 100644 --- a/libs/control.js +++ b/libs/control.js @@ -462,7 +462,7 @@ control.prototype.setAutomaticRoute = function (destX, destY, stepPostfix) { if (core.timeout.turnHeroTimeout!=null) return; // 单击瞬间移动 - if (core.status.heroStop) { + if (core.status.heroStop && core.status.heroMoving==0) { if (stepPostfix.length<=1 && core.getFlag('clickMove', true) && core.control.tryMoveDirectly(destX, destY)) return; } diff --git a/libs/maps.js b/libs/maps.js index 00879f0f..a28e3b1c 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -89,7 +89,9 @@ maps.prototype.addInfo = function (block) { block.event.trigger = 'getItem'; } if (!core.isset(block.event.noPass)) { - block.event.noPass = true; + if (block.event.cls != 'items') { + block.event.noPass = true; + } } if (!core.isset(block.event.animate)) { if (block.event.cls=='enemys' || block.event.cls=='npcs') { From 69e44861aae0f02e3d9bf2d6a80e6d6739a75a7b Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 25 Nov 2018 12:14:07 +0800 Subject: [PATCH 08/15] Floor ParallelDo --- _server/comment.js | 7 +++++++ _server/editor_file.js | 1 + docs/event.md | 27 +++++++++++++++++++++++++++ libs/items.js | 18 ++++++++++++++++-- libs/ui.js | 5 ++++- project/functions.js | 20 ++++++++++++++++---- 6 files changed, 71 insertions(+), 7 deletions(-) diff --git a/_server/comment.js b/_server/comment.js index 7477667b..ac58c192 100644 --- a/_server/comment.js +++ b/_server/comment.js @@ -359,6 +359,13 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc = "_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 e9e857db..b44dfd5b 100644 --- a/_server/editor_file.js +++ b/_server/editor_file.js @@ -157,6 +157,7 @@ editor_file = function (editor, callback) { color: saveStatus?currData.color:null, weather: saveStatus?currData.weather:null, firstArrive: [], + parallelDo: null, events: {}, changeFloor: {}, afterBattle: {}, diff --git a/docs/event.md b/docs/event.md index 1d7f484e..70ef6199 100644 --- a/docs/event.md +++ b/docs/event.md @@ -1611,6 +1611,8 @@ core.insertAction([ 在脚本编辑里面提供了一个parallelDo函数,这个函数可以用来做并行处理内容。 +从V2.5.2开始,每层楼的楼层属性中也增加了一个parallelDo选项,可以在里面写任何脚本代码。该部分代码仅在人物在该楼层时才会被反复执行。 + ``` js "parallelDo": function (timestamp) { // 并行事件处理,可以在这里写任何需要并行处理的脚本或事件 @@ -1619,6 +1621,15 @@ core.insertAction([ // 检查当前是否处于游戏开始状态 if (!core.isPlaying()) return; + + // 执行当前楼层的并行事件处理 + if (core.isset(core.status.floorId)) { + try { + eval(core.floors[core.status.floorId].parallelDo); + } catch (e) { + console.log(e); + } + } // 下面是一个并行事件开门的样例 /* @@ -1644,6 +1655,22 @@ core.insertAction([ !> 判定flag后千万别忘了将该flag清空!否则下次仍然会执行这段代码。 +每层楼的并行事件处理类似,只有角色在当前楼层时才会反复执行当前楼层中parallelDo部分的代码。 + +下面是一个打怪开门的样例:(假设每打一个怪的战后事件把`flag:door`+1) + +``` js +// 每层楼的并行事件处理代码样例 +if (core.getFlag("door",0)==2) { + // 将该flag清空 + core.setFlag("door", 0); + // 开门,如果是当前层则无需写floorId + core.insertAction([ + {"type":"openDoor", "loc":[0,0]} + ]); +} +``` + ## 加点事件 打败怪物后可以进行加点。 diff --git a/libs/items.js b/libs/items.js index bf20d5bb..a20c62aa 100644 --- a/libs/items.js +++ b/libs/items.js @@ -28,7 +28,14 @@ items.prototype.getItemEffect = function(itemId, itemNum) { if (itemCls === 'items') { var ratio = parseInt(core.status.thisMap.item_ratio) || 1; var curr_hp = core.status.hero.hp; - if (itemId in this.itemEffect)eval(this.itemEffect[itemId]); + if (itemId in this.itemEffect) { + try { + eval(this.itemEffect[itemId]); + } + catch (e) { + console.log(e); + } + } core.status.hero.statistics.hp += core.status.hero.hp - curr_hp; } else { @@ -42,7 +49,14 @@ items.prototype.getItemEffectTip = function(itemId) { // 消耗品 if (itemCls === 'items') { var ratio = parseInt(core.status.thisMap.item_ratio) || 1; - if (itemId in this.itemEffectTip) return eval(this.itemEffectTip[itemId])||""; + if (itemId in this.itemEffectTip) { + try { + return eval(this.itemEffectTip[itemId])||""; + } catch (e) { + console.log(e); + return ""; + } + } } return ""; } diff --git a/libs/ui.js b/libs/ui.js index ecf31465..dec5c0a6 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -2311,7 +2311,10 @@ ui.prototype.drawStatistics = function () { if (cls[id]=='items' && id!='superPotion') { var ratio = floor.item_ratio||1; if (core.isset(core.items.itemEffect[id])) { - eval(core.items.itemEffect[id]); + try { + eval(core.items.itemEffect[id]); + } + catch (e) {} } hp = core.status.hero.hp - temp.hp; atk = core.status.hero.atk - temp.atk; diff --git a/project/functions.js b/project/functions.js index f3d3bf5d..78d475af 100644 --- a/project/functions.js +++ b/project/functions.js @@ -87,9 +87,11 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = "afterChangeFloor": function (floorId, fromLoad) { // 转换楼层结束的事件 // floorId是切换到的楼层;fromLoad若为true则代表是从读档行为造成的楼层切换 - if (!core.hasFlag("visited_"+floorId)) { + var visited = core.getFlag("__visited__", []); + if (visited.indexOf(floorId)===-1) { core.insertAction(core.floors[floorId].firstArrive); - core.setFlag("visited_"+floorId, true); + visited.push(floorId); + core.setFlag("__visited__", visited); } }, "addPoint": function (enemy) { @@ -1034,7 +1036,16 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = // 检查当前是否处于游戏开始状态 if (!core.isPlaying()) return; - + + // 执行当前楼层的并行事件处理 + if (core.isset(core.status.floorId)) { + try { + eval(core.floors[core.status.floorId].parallelDo); + } catch (e) { + console.log(e); + } + } + // 下面是一个并行事件开门的样例 /* // 如果某个flag为真 @@ -1048,7 +1059,8 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = // 也可以写任意其他的脚本代码 } */ - + + }, "plugin": function () { ////// 插件编写,可以在这里写自己额外需要执行的脚本 ////// From 8c4946ffad1fd154c382fc9bef88cd45f9847e92 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 25 Nov 2018 12:16:13 +0800 Subject: [PATCH 09/15] Floor ParallelDo --- _server/comment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_server/comment.js b/_server/comment.js index ac58c192..2258721c 100644 --- a/_server/comment.js +++ b/_server/comment.js @@ -364,7 +364,7 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc = "_type": "textarea", "_string": true, "_lint": true, - "_data": "在该层楼时执行的并行事件处理。\n可以在这里写上任意需要自动执行的脚本,比如打怪自动开门等。\n详见文档-个性化-并行事件处理。" + "_data": "在该层楼时执行的并行事件处理。\n可以在这里写上任意需要自动执行的脚本,比如打怪自动开门等。\n详见文档-事件-并行事件处理。" }, "underGround": { "_leaf": true, From 41df30107969b112568d9640aa10599b0af07191 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 25 Nov 2018 13:04:30 +0800 Subject: [PATCH 10/15] 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 From 360ed87ba0e9adb70367212cd8ad10446cbc7735 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 25 Nov 2018 13:08:30 +0800 Subject: [PATCH 11/15] Replace Docs URL --- _server/blockly/MotaAction.g4 | 160 +++++++++++++++++----------------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/_server/blockly/MotaAction.g4 b/_server/blockly/MotaAction.g4 index 2edfa2d9..318ee7bf 100644 --- a/_server/blockly/MotaAction.g4 +++ b/_server/blockly/MotaAction.g4 @@ -10,7 +10,7 @@ event_m /* event_m tooltip : 编辑魔塔的事件 -helpUrl : https://ckcz123.github.io/mota-js/#/event +helpUrl : https://h5mota.com/games/template/docs/#/event default : [false,null,null,null] B_0_List_0=eval(B_0_List_0); var code = { @@ -32,7 +32,7 @@ point_m /* point_m tooltip : 加点事件 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=%e5%8a%a0%e7%82%b9%e4%ba%8b%e4%bb%b6 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=%e5%8a%a0%e7%82%b9%e4%ba%8b%e4%bb%b6 var code = '{"type": "choices", "choices": [\n'+choicesContext_0+']}\n'; return code; */; @@ -44,7 +44,7 @@ level_m /* level_m tooltip : 升级事件 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=%e7%bb%8f%e9%aa%8c%e5%8d%87%e7%ba%a7%ef%bc%88%e8%bf%9b%e9%98%b6%2f%e5%a2%83%e7%95%8c%e5%a1%94%ef%bc%89 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=%e7%bb%8f%e9%aa%8c%e5%8d%87%e7%ba%a7%ef%bc%88%e8%bf%9b%e9%98%b6%2f%e5%a2%83%e7%95%8c%e5%a1%94%ef%bc%89 var code = '[\n'+levelCase_0+']\n'; return code; */; @@ -55,7 +55,7 @@ levelCase /* levelCase tooltip : 升级设定 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=%e7%bb%8f%e9%aa%8c%e5%8d%87%e7%ba%a7%ef%bc%88%e8%bf%9b%e9%98%b6%2f%e5%a2%83%e7%95%8c%e5%a1%94%ef%bc%89 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=%e7%bb%8f%e9%aa%8c%e5%8d%87%e7%ba%a7%ef%bc%88%e8%bf%9b%e9%98%b6%2f%e5%a2%83%e7%95%8c%e5%a1%94%ef%bc%89 default : [0,"",null] colour : this.subColor var code = '{"need": "'+expression_0+'", "title": "'+EvalString_0+'", "action": [\n'+action_0+']},\n'; @@ -68,7 +68,7 @@ shop_m /* shop_m tooltip : 全局商店列表 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=%e5%85%a8%e5%b1%80%e5%95%86%e5%ba%97 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=%e5%85%a8%e5%b1%80%e5%95%86%e5%ba%97 var code = '['+shoplist_0+']\n'; return code; */; @@ -93,7 +93,7 @@ shopsub /* shopsub tooltip : 全局商店,消耗填-1表示每个选项的消耗不同,正数表示消耗数值 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=%e5%85%a8%e5%b1%80%e5%95%86%e5%ba%97 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=%e5%85%a8%e5%b1%80%e5%95%86%e5%ba%97 default : ["shop1","贪婪之神","blueShop","1F金币商店",false,false,null,"20+10*times*(times+1)","勇敢的武士啊, 给我${need}金币就可以:"] var code = { 'id': IdString_0, @@ -117,7 +117,7 @@ shopChoices /* shopChoices tooltip : 商店选项,商店消耗是-1时,这里的消耗对应各自选项的消耗,商店消耗不是-1时这里的消耗不填 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=%e5%85%a8%e5%b1%80%e5%95%86%e5%ba%97 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=%e5%85%a8%e5%b1%80%e5%95%86%e5%ba%97 default : ["攻击+1",""] colour : this.subColor EvalString_1 = EvalString_1 && (', "need": "'+EvalString_1+'"'); @@ -142,7 +142,7 @@ afterBattle_m /* afterBattle_m tooltip : 系统引发的自定义事件 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=%e7%b3%bb%e7%bb%9f%e5%bc%95%e5%8f%91%e7%9a%84%e8%87%aa%e5%ae%9a%e4%b9%89%e4%ba%8b%e4%bb%b6 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=%e7%b3%bb%e7%bb%9f%e5%bc%95%e5%8f%91%e7%9a%84%e8%87%aa%e5%ae%9a%e4%b9%89%e4%ba%8b%e4%bb%b6 var code = '[\n'+action_0+']\n'; return code; */; @@ -154,7 +154,7 @@ afterGetItem_m /* afterGetItem_m tooltip : 系统引发的自定义事件 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=%e7%b3%bb%e7%bb%9f%e5%bc%95%e5%8f%91%e7%9a%84%e8%87%aa%e5%ae%9a%e4%b9%89%e4%ba%8b%e4%bb%b6 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=%e7%b3%bb%e7%bb%9f%e5%bc%95%e5%8f%91%e7%9a%84%e8%87%aa%e5%ae%9a%e4%b9%89%e4%ba%8b%e4%bb%b6 var code = '[\n'+action_0+']\n'; return code; */; @@ -166,7 +166,7 @@ afterOpenDoor_m /* afterOpenDoor_m tooltip : 系统引发的自定义事件 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=%e7%b3%bb%e7%bb%9f%e5%bc%95%e5%8f%91%e7%9a%84%e8%87%aa%e5%ae%9a%e4%b9%89%e4%ba%8b%e4%bb%b6 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=%e7%b3%bb%e7%bb%9f%e5%bc%95%e5%8f%91%e7%9a%84%e8%87%aa%e5%ae%9a%e4%b9%89%e4%ba%8b%e4%bb%b6 var code = '[\n'+action_0+']\n'; return code; */; @@ -178,7 +178,7 @@ firstArrive_m /* firstArrive_m tooltip : 首次到达楼层 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=%e7%b3%bb%e7%bb%9f%e5%bc%95%e5%8f%91%e7%9a%84%e8%87%aa%e5%ae%9a%e4%b9%89%e4%ba%8b%e4%bb%b6 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=%e7%b3%bb%e7%bb%9f%e5%bc%95%e5%8f%91%e7%9a%84%e8%87%aa%e5%ae%9a%e4%b9%89%e4%ba%8b%e4%bb%b6 var code = '[\n'+action_0+']\n'; return code; */; @@ -190,7 +190,7 @@ changeFloor_m /* changeFloor_m tooltip : 楼梯, 传送门, 如果目标楼层有多个楼梯, 写upFloor或downFloor可能会导致到达的楼梯不确定, 这时候请使用loc方式来指定具体的点位置 -helpUrl : https://ckcz123.github.io/mota-js/#/element?id=%e8%b7%af%e9%9a%9c%ef%bc%8c%e6%a5%bc%e6%a2%af%ef%bc%8c%e4%bc%a0%e9%80%81%e9%97%a8 +helpUrl : https://h5mota.com/games/template/docs/#/element?id=%e8%b7%af%e9%9a%9c%ef%bc%8c%e6%a5%bc%e6%a2%af%ef%bc%8c%e4%bc%a0%e9%80%81%e9%97%a8 default : [null,"MT1",null,0,0,null,500,null] var toFloorId = IdString_0; if (Floor_List_0!='floorId') toFloorId = Floor_List_0; @@ -281,7 +281,7 @@ text_0_s /* text_0_s tooltip : text:显示一段文字(剧情) -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=text%EF%BC%9A%E6%98%BE%E7%A4%BA%E4%B8%80%E6%AE%B5%E6%96%87%E5%AD%97%EF%BC%88%E5%89%A7%E6%83%85%EF%BC%89 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=text%EF%BC%9A%E6%98%BE%E7%A4%BA%E4%B8%80%E6%AE%B5%E6%96%87%E5%AD%97%EF%BC%88%E5%89%A7%E6%83%85%EF%BC%89 default : ["欢迎使用事件编辑器(双击方块进入多行编辑)"] var code = '"'+EvalString_0+'",\n'; return code; @@ -293,7 +293,7 @@ text_1_s /* text_1_s tooltip : text:显示一段文字(剧情),选项较多请右键点击帮助 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=text%EF%BC%9A%E6%98%BE%E7%A4%BA%E4%B8%80%E6%AE%B5%E6%96%87%E5%AD%97%EF%BC%88%E5%89%A7%E6%83%85%EF%BC%89 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=text%EF%BC%9A%E6%98%BE%E7%A4%BA%E4%B8%80%E6%AE%B5%E6%96%87%E5%AD%97%EF%BC%88%E5%89%A7%E6%83%85%EF%BC%89 default : ["小妖精","fairy","","欢迎使用事件编辑器(双击方块进入多行编辑)"] var title=''; if (EvalString_0==''){ @@ -317,7 +317,7 @@ comment_s /* comment_s tooltip : comment:添加一段会被游戏跳过的注释内容 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=comment%ef%bc%9a%e6%b7%bb%e5%8a%a0%e6%b3%a8%e9%87%8a +helpUrl : https://h5mota.com/games/template/docs/#/event?id=comment%ef%bc%9a%e6%b7%bb%e5%8a%a0%e6%b3%a8%e9%87%8a default : ["可以在这里写添加任何注释内容"] colour : this.commentColor var code = '{"type": "comment", "text": "'+EvalString_0+'"},\n'; @@ -330,7 +330,7 @@ autoText_s /* autoText_s tooltip : autoText:自动剧情文本,用户无法跳过自动剧情文本,大段剧情文本请添加“是否跳过剧情”的提示 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=autotext%EF%BC%9A%E8%87%AA%E5%8A%A8%E5%89%A7%E6%83%85%E6%96%87%E6%9C%AC +helpUrl : https://h5mota.com/games/template/docs/#/event?id=autotext%EF%BC%9A%E8%87%AA%E5%8A%A8%E5%89%A7%E6%83%85%E6%96%87%E6%9C%AC default : ["小妖精","fairy","",3000,"双击方块进入多行编辑\\n自动剧情文本\\n自动剧情文本\\n自动剧情文本"] var title=''; if (EvalString_0==''){ @@ -354,7 +354,7 @@ setText_s /* setText_s tooltip : setText:设置剧情文本的属性,颜色为RGB三元组或RGBA四元组,打字间隔为剧情文字添加的时间间隔,为整数或不填 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=settext%EF%BC%9A%E8%AE%BE%E7%BD%AE%E5%89%A7%E6%83%85%E6%96%87%E6%9C%AC%E7%9A%84%E5%B1%9E%E6%80%A7 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=settext%EF%BC%9A%E8%AE%BE%E7%BD%AE%E5%89%A7%E6%83%85%E6%96%87%E6%9C%AC%E7%9A%84%E5%B1%9E%E6%80%A7 default : [null,"","","","",null,"","",""] SetTextPosition_List_0 =SetTextPosition_List_0==='null'?'': ', "position": "'+SetTextPosition_List_0+'"'; var colorRe = /^(25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d),(25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d),(25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(,0(\.\d+)?|,1)?$/; @@ -397,7 +397,7 @@ tip_s /* tip_s tooltip : tip:显示一段提示文字 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=tip%EF%BC%9A%E6%98%BE%E7%A4%BA%E4%B8%80%E6%AE%B5%E6%8F%90%E7%A4%BA%E6%96%87%E5%AD%97 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=tip%EF%BC%9A%E6%98%BE%E7%A4%BA%E4%B8%80%E6%AE%B5%E6%8F%90%E7%A4%BA%E6%96%87%E5%AD%97 default : ["这段话将在左上角以气泡形式显示"] var code = '{"type": "tip", "text": "'+EvalString_0+'"},\n'; return code; @@ -409,7 +409,7 @@ setValue_s /* setValue_s tooltip : setValue:设置勇士的某个属性、道具个数, 或某个变量/Flag的值 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=setvalue%EF%BC%9A%E8%AE%BE%E7%BD%AE%E5%8B%87%E5%A3%AB%E7%9A%84%E6%9F%90%E4%B8%AA%E5%B1%9E%E6%80%A7%E3%80%81%E9%81%93%E5%85%B7%E4%B8%AA%E6%95%B0%EF%BC%8C%E6%88%96%E6%9F%90%E4%B8%AA%E5%8F%98%E9%87%8Fflag%E7%9A%84%E5%80%BC +helpUrl : https://h5mota.com/games/template/docs/#/event?id=setvalue%EF%BC%9A%E8%AE%BE%E7%BD%AE%E5%8B%87%E5%A3%AB%E7%9A%84%E6%9F%90%E4%B8%AA%E5%B1%9E%E6%80%A7%E3%80%81%E9%81%93%E5%85%B7%E4%B8%AA%E6%95%B0%EF%BC%8C%E6%88%96%E6%9F%90%E4%B8%AA%E5%8F%98%E9%87%8Fflag%E7%9A%84%E5%80%BC colour : this.dataColor var code = '{"type": "setValue", "name": "'+idString_e_0+'", "value": "'+expression_0+'"},\n'; return code; @@ -421,7 +421,7 @@ setFloor_s /* setFloor_s tooltip : setFloor:设置楼层属性;该楼层属性和编辑器中的楼层属性一一对应 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=setFloor%ef%bc%9a%e8%ae%be%e7%bd%ae%e6%a5%bc%e5%b1%82%e5%b1%9e%e6%80%a7 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=setFloor%ef%bc%9a%e8%ae%be%e7%bd%ae%e6%a5%bc%e5%b1%82%e5%b1%9e%e6%80%a7 default : ["title","","'字符串类型的值要加引号,其他类型则不用'"] colour : this.dataColor IdString_0 = IdString_0 && (', "floorId": "'+IdString_0+'"'); @@ -436,7 +436,7 @@ show_s /* show_s tooltip : show: 将禁用事件启用,楼层和动画时间可不填,xy可用逗号分隔表示多个点 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=show%EF%BC%9A%E5%B0%86%E4%B8%80%E4%B8%AA%E7%A6%81%E7%94%A8%E4%BA%8B%E4%BB%B6%E5%90%AF%E7%94%A8 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=show%EF%BC%9A%E5%B0%86%E4%B8%80%E4%B8%AA%E7%A6%81%E7%94%A8%E4%BA%8B%E4%BB%B6%E5%90%AF%E7%94%A8 default : ["","","",500] colour : this.eventColor var floorstr = ''; @@ -468,7 +468,7 @@ hide_s /* hide_s tooltip : hide: 将一个启用事件禁用,所有参数均可不填,代表禁用事件自身,xy可用逗号分隔表示多个点 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=hide%EF%BC%9A%E5%B0%86%E4%B8%80%E4%B8%AA%E5%90%AF%E7%94%A8%E4%BA%8B%E4%BB%B6%E7%A6%81%E7%94%A8 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=hide%EF%BC%9A%E5%B0%86%E4%B8%80%E4%B8%AA%E5%90%AF%E7%94%A8%E4%BA%8B%E4%BB%B6%E7%A6%81%E7%94%A8 default : ["","","",500] colour : this.eventColor var floorstr = ''; @@ -500,7 +500,7 @@ trigger_s /* trigger_s tooltip : trigger: 立即触发另一个地点的事件 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=trigger%EF%BC%9A%E7%AB%8B%E5%8D%B3%E8%A7%A6%E5%8F%91%E5%8F%A6%E4%B8%80%E4%B8%AA%E5%9C%B0%E7%82%B9%E7%9A%84%E4%BA%8B%E4%BB%B6 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=trigger%EF%BC%9A%E7%AB%8B%E5%8D%B3%E8%A7%A6%E5%8F%91%E5%8F%A6%E4%B8%80%E4%B8%AA%E5%9C%B0%E7%82%B9%E7%9A%84%E4%BA%8B%E4%BB%B6 default : ["0","0"] colour : this.eventColor var code = '{"type": "trigger", "loc": ['+PosString_0+','+PosString_1+']},\n'; @@ -513,7 +513,7 @@ insert_s /* insert_s tooltip : insert: 立即插入另一个地点的事件执行,当前事件不会中断,事件坐标不会改变 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=insert%ef%bc%9a%e6%8f%92%e5%85%a5%e5%8f%a6%e4%b8%80%e4%b8%aa%e5%9c%b0%e7%82%b9%e7%9a%84%e4%ba%8b%e4%bb%b6 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=insert%ef%bc%9a%e6%8f%92%e5%85%a5%e5%8f%a6%e4%b8%80%e4%b8%aa%e5%9c%b0%e7%82%b9%e7%9a%84%e4%ba%8b%e4%bb%b6 default : ["0","0",""] colour : this.eventColor IdString_0 = IdString_0 && (', "floorId": "'+IdString_0+'"'); @@ -527,7 +527,7 @@ revisit_s /* revisit_s tooltip : revisit: 立即重启当前事件 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=revisit%EF%BC%9A%E7%AB%8B%E5%8D%B3%E9%87%8D%E5%90%AF%E5%BD%93%E5%89%8D%E4%BA%8B%E4%BB%B6 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=revisit%EF%BC%9A%E7%AB%8B%E5%8D%B3%E9%87%8D%E5%90%AF%E5%BD%93%E5%89%8D%E4%BA%8B%E4%BB%B6 colour : this.eventColor var code = '{"type": "revisit"},\n'; return code; @@ -539,7 +539,7 @@ exit_s /* exit_s tooltip : exit: 立刻结束当前事件 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=exit%EF%BC%9A%E7%AB%8B%E5%88%BB%E7%BB%93%E6%9D%9F%E5%BD%93%E5%89%8D%E4%BA%8B%E4%BB%B6 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=exit%EF%BC%9A%E7%AB%8B%E5%88%BB%E7%BB%93%E6%9D%9F%E5%BD%93%E5%89%8D%E4%BA%8B%E4%BB%B6 colour : this.eventColor var code = '{"type": "exit"},\n'; return code; @@ -551,7 +551,7 @@ setBlock_s /* setBlock_s tooltip : setBlock:设置某个图块,忽略坐标楼层则为当前事件 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=setblock%EF%BC%9A%E8%AE%BE%E7%BD%AE%E6%9F%90%E4%B8%AA%E5%9B%BE%E5%9D%97 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=setblock%EF%BC%9A%E8%AE%BE%E7%BD%AE%E6%9F%90%E4%B8%AA%E5%9B%BE%E5%9D%97 colour : this.dataColor default : [0,"","",""] var floorstr = ''; @@ -569,7 +569,7 @@ showFloorImg_s /* showFloorImg_s tooltip : showFloorImg: 显示一个贴图,xy为左上角坐标,可用逗号分隔表示多个点 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=showFloorImg%ef%bc%9a%e6%98%be%e7%a4%ba%e8%b4%b4%e5%9b%be +helpUrl : https://h5mota.com/games/template/docs/#/event?id=showFloorImg%ef%bc%9a%e6%98%be%e7%a4%ba%e8%b4%b4%e5%9b%be default : ["","",""] colour : this.eventColor var floorstr = ''; @@ -600,7 +600,7 @@ hideFloorImg_s /* hideFloorImg_s tooltip : hideFloorImg: 隐藏一个贴图,xy为左上角坐标,可用逗号分隔表示多个点 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=hideFloorImg%ef%bc%9a%e9%9a%90%e8%97%8f%e8%b4%b4%e5%9b%be +helpUrl : https://h5mota.com/games/template/docs/#/event?id=hideFloorImg%ef%bc%9a%e9%9a%90%e8%97%8f%e8%b4%b4%e5%9b%be default : ["","",""] colour : this.eventColor var floorstr = ''; @@ -631,7 +631,7 @@ showBgFgMap_s /* showBgFgMap_s tooltip : showBgFgMap: 显示图层块,即背景图层/前景图层的某些图块,xy为左上角坐标,可用逗号分隔表示多个点 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=showFloorImg%ef%bc%9a%e6%98%be%e7%a4%ba%e8%b4%b4%e5%9b%be +helpUrl : https://h5mota.com/games/template/docs/#/event?id=showFloorImg%ef%bc%9a%e6%98%be%e7%a4%ba%e8%b4%b4%e5%9b%be default : ["bg","","",""] colour : this.eventColor var floorstr = ''; @@ -662,7 +662,7 @@ hideBgFgMap_s /* hideBgFgMap_s tooltip : hideBgFgMap: 隐藏图层块,即背景图层/前景图层的某些图块,xy为左上角坐标,可用逗号分隔表示多个点 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=hideFloorImg%ef%bc%9a%e9%9a%90%e8%97%8f%e8%b4%b4%e5%9b%be +helpUrl : https://h5mota.com/games/template/docs/#/event?id=hideFloorImg%ef%bc%9a%e9%9a%90%e8%97%8f%e8%b4%b4%e5%9b%be default : ["bg","","",""] colour : this.eventColor var floorstr = ''; @@ -693,7 +693,7 @@ setBgFgBlock_s /* setBgFgBlock_s tooltip : setBgFgBlock:设置某个图层块,忽略坐标楼层则为当前点 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=setblock%EF%BC%9A%E8%AE%BE%E7%BD%AE%E6%9F%90%E4%B8%AA%E5%9B%BE%E5%9D%97 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=setblock%EF%BC%9A%E8%AE%BE%E7%BD%AE%E6%9F%90%E4%B8%AA%E5%9B%BE%E5%9D%97 colour : this.eventColor default : ["bg",0,"","",""] var floorstr = ''; @@ -711,7 +711,7 @@ setHeroIcon_s /* setHeroIcon_s tooltip : setHeroIcon:更改角色行走图 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=setheroicon%EF%BC%9A%E6%9B%B4%E6%94%B9%E8%A7%92%E8%89%B2%E8%A1%8C%E8%B5%B0%E5%9B%BE +helpUrl : https://h5mota.com/games/template/docs/#/event?id=setheroicon%EF%BC%9A%E6%9B%B4%E6%94%B9%E8%A7%92%E8%89%B2%E8%A1%8C%E8%B5%B0%E5%9B%BE colour : this.dataColor default : ["hero.png"] EvalString_0 = EvalString_0 && (', "name": "'+EvalString_0+'"'); @@ -725,7 +725,7 @@ update_s /* update_s tooltip : update: 立刻更新状态栏和地图显伤 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=update%EF%BC%9A%E7%AB%8B%E5%88%BB%E6%9B%B4%E6%96%B0%E7%8A%B6%E6%80%81%E6%A0%8F%E5%92%8C%E5%9C%B0%E5%9B%BE%E6%98%BE%E4%BC%A4 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=update%EF%BC%9A%E7%AB%8B%E5%88%BB%E6%9B%B4%E6%96%B0%E7%8A%B6%E6%80%81%E6%A0%8F%E5%92%8C%E5%9C%B0%E5%9B%BE%E6%98%BE%E4%BC%A4 colour : this.dataColor var code = '{"type": "update"},\n'; return code; @@ -737,7 +737,7 @@ updateEnemys_s /* updateEnemys_s tooltip : updateEnemys: 立刻更新怪物数据 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=updateEnemys%ef%bc%9a%e6%9b%b4%e6%96%b0%e6%80%aa%e7%89%a9%e6%95%b0%e6%8d%ae +helpUrl : https://h5mota.com/games/template/docs/#/event?id=updateEnemys%ef%bc%9a%e6%9b%b4%e6%96%b0%e6%80%aa%e7%89%a9%e6%95%b0%e6%8d%ae colour : this.dataColor var code = '{"type": "updateEnemys"},\n'; return code; @@ -749,7 +749,7 @@ sleep_s /* sleep_s tooltip : sleep: 等待多少毫秒 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=sleep%EF%BC%9A%E7%AD%89%E5%BE%85%E5%A4%9A%E5%B0%91%E6%AF%AB%E7%A7%92 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=sleep%EF%BC%9A%E7%AD%89%E5%BE%85%E5%A4%9A%E5%B0%91%E6%AF%AB%E7%A7%92 default : [500] colour : this.soundColor var code = '{"type": "sleep", "time": '+Int_0+'},\n'; @@ -762,7 +762,7 @@ battle_s /* battle_s tooltip : battle: 强制战斗 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=battle%EF%BC%9A%E5%BC%BA%E5%88%B6%E6%88%98%E6%96%97 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=battle%EF%BC%9A%E5%BC%BA%E5%88%B6%E6%88%98%E6%96%97 default : ["greenSlime"] colour : this.dataColor var code = '{"type": "battle", "id": "'+IdString_0+'"},\n'; @@ -775,7 +775,7 @@ openDoor_s /* openDoor_s tooltip : openDoor: 开门,楼层可不填表示当前层 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=opendoor%EF%BC%9A%E5%BC%80%E9%97%A8 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=opendoor%EF%BC%9A%E5%BC%80%E9%97%A8 default : ["","",""] colour : this.dataColor IdString_0 = IdString_0 && (', "floorId": "'+IdString_0+'"'); @@ -793,7 +793,7 @@ changeFloor_s /* changeFloor_s tooltip : changeFloor: 楼层切换,动画时间可不填 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=changefloor%EF%BC%9A%E6%A5%BC%E5%B1%82%E5%88%87%E6%8D%A2 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=changefloor%EF%BC%9A%E6%A5%BC%E5%B1%82%E5%88%87%E6%8D%A2 default : ["MT1","0","0",null,500] colour : this.dataColor DirectionEx_List_0 = DirectionEx_List_0 && (', "direction": "'+DirectionEx_List_0+'"'); @@ -812,7 +812,7 @@ changePos_0_s /* changePos_0_s tooltip : changePos: 当前位置切换 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=changepos%EF%BC%9A%E5%BD%93%E5%89%8D%E4%BD%8D%E7%BD%AE%E5%88%87%E6%8D%A2%E5%8B%87%E5%A3%AB%E8%BD%AC%E5%90%91 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=changepos%EF%BC%9A%E5%BD%93%E5%89%8D%E4%BD%8D%E7%BD%AE%E5%88%87%E6%8D%A2%E5%8B%87%E5%A3%AB%E8%BD%AC%E5%90%91 default : ["","",null] colour : this.dataColor DirectionEx_List_0 = DirectionEx_List_0 && (', "direction": "'+DirectionEx_List_0+'"'); @@ -826,7 +826,7 @@ changePos_1_s /* changePos_1_s tooltip : changePos: 勇士转向 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=changepos%EF%BC%9A%E5%BD%93%E5%89%8D%E4%BD%8D%E7%BD%AE%E5%88%87%E6%8D%A2%E5%8B%87%E5%A3%AB%E8%BD%AC%E5%90%91 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=changepos%EF%BC%9A%E5%BD%93%E5%89%8D%E4%BD%8D%E7%BD%AE%E5%88%87%E6%8D%A2%E5%8B%87%E5%A3%AB%E8%BD%AC%E5%90%91 colour : this.dataColor default : [null] var code = '{"type": "changePos", "direction": "'+Direction_List_0+'"},\n'; @@ -839,7 +839,7 @@ openShop_s /* openShop_s tooltip : 全局商店 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=openshop%EF%BC%9A%E6%89%93%E5%BC%80%E4%B8%80%E4%B8%AA%E5%85%A8%E5%B1%80%E5%95%86%E5%BA%97 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=openshop%EF%BC%9A%E6%89%93%E5%BC%80%E4%B8%80%E4%B8%AA%E5%85%A8%E5%B1%80%E5%95%86%E5%BA%97 colour : this.dataColor default : ["shop1"] var code = '{"type": "openShop", "id": "'+IdString_0+'"},\n'; @@ -852,7 +852,7 @@ disableShop_s /* disableShop_s tooltip : 全局商店 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=disableshop%EF%BC%9A%E7%A6%81%E7%94%A8%E4%B8%80%E4%B8%AA%E5%85%A8%E5%B1%80%E5%95%86%E5%BA%97 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=disableshop%EF%BC%9A%E7%A6%81%E7%94%A8%E4%B8%80%E4%B8%AA%E5%85%A8%E5%B1%80%E5%95%86%E5%BA%97 default : ["shop1"] colour : this.eventColor var code = '{"type": "disableShop", "id": "'+IdString_0+'"},\n'; @@ -865,7 +865,7 @@ follow_s /* follow_s tooltip : follow: 跟随勇士 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=follow%ef%bc%9a%e8%b7%9f%e9%9a%8f%e5%8b%87%e5%a3%ab +helpUrl : https://h5mota.com/games/template/docs/#/event?id=follow%ef%bc%9a%e8%b7%9f%e9%9a%8f%e5%8b%87%e5%a3%ab default : ["npc.png"] colour : this.dataColor var code = '{"type": "follow", "name": "'+EvalString_0+'"},\n'; @@ -878,7 +878,7 @@ unfollow_s /* unfollow_s tooltip : unfollow: 取消跟随 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=unfollow%ef%bc%9a%e5%8f%96%e6%b6%88%e8%b7%9f%e9%9a%8f +helpUrl : https://h5mota.com/games/template/docs/#/event?id=unfollow%ef%bc%9a%e5%8f%96%e6%b6%88%e8%b7%9f%e9%9a%8f default : [""] colour : this.dataColor EvalString_0 = EvalString_0 ? (', "name": "' + EvalString_0 + '"') : ""; @@ -892,7 +892,7 @@ viberate_s /* viberate_s tooltip : viberate: 画面震动 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=viberate%ef%bc%9a%e7%94%bb%e9%9d%a2%e9%9c%87%e5%8a%a8 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=viberate%ef%bc%9a%e7%94%bb%e9%9d%a2%e9%9c%87%e5%8a%a8 default : [2000,false] colour : this.soundColor Int_0 = Int_0 ?(', "time": '+Int_0):''; @@ -907,7 +907,7 @@ animate_s /* animate_s tooltip : animate:显示动画,位置填hero或者1,2形式的位置,或者不填代表当前事件点 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=animate%EF%BC%9A%E6%98%BE%E7%A4%BA%E5%8A%A8%E7%94%BB +helpUrl : https://h5mota.com/games/template/docs/#/event?id=animate%EF%BC%9A%E6%98%BE%E7%A4%BA%E5%8A%A8%E7%94%BB default : ["zone","hero",false] colour : this.soundColor if (EvalString_0) { @@ -932,7 +932,7 @@ showImage_0_s /* showImage_0_s tooltip : showImage:显示图片 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=showimage%EF%BC%9A%E6%98%BE%E7%A4%BA%E5%9B%BE%E7%89%87 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=showimage%EF%BC%9A%E6%98%BE%E7%A4%BA%E5%9B%BE%E7%89%87 default : ["bg.jpg","0","0"] colour : this.printColor var code = '{"type": "showImage", "name": "'+EvalString_0+'", "loc": ['+PosString_0+','+PosString_1+']},\n'; @@ -945,7 +945,7 @@ showImage_1_s /* showImage_1_s tooltip : showImage:清除所有显示的图片 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=showimage%EF%BC%9A%E6%98%BE%E7%A4%BA%E5%9B%BE%E7%89%87 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=showimage%EF%BC%9A%E6%98%BE%E7%A4%BA%E5%9B%BE%E7%89%87 colour : this.printColor var code = '{"type": "showImage"},\n'; return code; @@ -957,7 +957,7 @@ animateImage_0_s /* animateImage_0_s tooltip : animageImage:图片淡入 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=animateimage%EF%BC%9A%E5%9B%BE%E7%89%87%E6%B7%A1%E5%85%A5%E6%B7%A1%E5%87%BA +helpUrl : https://h5mota.com/games/template/docs/#/event?id=animateimage%EF%BC%9A%E5%9B%BE%E7%89%87%E6%B7%A1%E5%85%A5%E6%B7%A1%E5%87%BA default : ["bg.jpg","0","0",500,true,false] colour : this.printColor var keep = Bool_0?', "keep": true':''; @@ -972,7 +972,7 @@ animateImage_1_s /* animateImage_1_s tooltip : animageImage:图片淡出 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=animateimage%EF%BC%9A%E5%9B%BE%E7%89%87%E6%B7%A1%E5%85%A5%E6%B7%A1%E5%87%BA +helpUrl : https://h5mota.com/games/template/docs/#/event?id=animateimage%EF%BC%9A%E5%9B%BE%E7%89%87%E6%B7%A1%E5%85%A5%E6%B7%A1%E5%87%BA default : ["bg.jpg","0","0",500,true,false] colour : this.printColor var keep = Bool_0?', "keep": true':''; @@ -987,7 +987,7 @@ showGif_0_s /* showGif_0_s tooltip : showGif:显示动图 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=showgif%EF%BC%9A%E6%98%BE%E7%A4%BA%E5%8A%A8%E5%9B%BE +helpUrl : https://h5mota.com/games/template/docs/#/event?id=showgif%EF%BC%9A%E6%98%BE%E7%A4%BA%E5%8A%A8%E5%9B%BE default : ["bg.gif","0","0"] colour : this.printColor var code = '{"type": "showGif", "name": "'+EvalString_0+'", "loc": ['+PosString_0+','+PosString_1+']},\n'; @@ -1000,7 +1000,7 @@ showGif_1_s /* showGif_1_s tooltip : showGif:清除所有显示的动图 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=showgif%EF%BC%9A%E6%98%BE%E7%A4%BA%E5%8A%A8%E5%9B%BE +helpUrl : https://h5mota.com/games/template/docs/#/event?id=showgif%EF%BC%9A%E6%98%BE%E7%A4%BA%E5%8A%A8%E5%9B%BE colour : this.printColor var code = '{"type": "showGif"},\n'; return code; @@ -1013,7 +1013,7 @@ moveImage_0_s /* moveImage_0_s tooltip : moveImage:图片移动 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=moveimage%EF%BC%9A%E5%9B%BE%E7%89%87%E7%A7%BB%E5%8A%A8 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=moveimage%EF%BC%9A%E5%9B%BE%E7%89%87%E7%A7%BB%E5%8A%A8 default : ["bg.jpg","0","0","0","0",500,true,false] colour : this.printColor var keep = Bool_0?', "keep": true':''; @@ -1028,7 +1028,7 @@ setFg_0_s /* setFg_0_s tooltip : setFg: 更改画面色调,动画时间可不填 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=setfg%EF%BC%9A%E6%9B%B4%E6%94%B9%E7%94%BB%E9%9D%A2%E8%89%B2%E8%B0%83 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=setfg%EF%BC%9A%E6%9B%B4%E6%94%B9%E7%94%BB%E9%9D%A2%E8%89%B2%E8%B0%83 default : [255,255,255,1,500,false] colour : this.soundColor var limit = function(v,min,max) { @@ -1052,7 +1052,7 @@ setFg_1_s /* setFg_1_s tooltip : setFg: 恢复画面色调,动画时间可不填 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=setfg%EF%BC%9A%E6%9B%B4%E6%94%B9%E7%94%BB%E9%9D%A2%E8%89%B2%E8%B0%83 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=setfg%EF%BC%9A%E6%9B%B4%E6%94%B9%E7%94%BB%E9%9D%A2%E8%89%B2%E8%B0%83 default : [500,false] colour : this.soundColor Int_0 = Int_0 ?(', "time": '+Int_0):''; @@ -1067,7 +1067,7 @@ setWeather_s /* setWeather_s tooltip : setWeather:更改天气 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=setweather%EF%BC%9A%E6%9B%B4%E6%94%B9%E5%A4%A9%E6%B0%94 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=setweather%EF%BC%9A%E6%9B%B4%E6%94%B9%E5%A4%A9%E6%B0%94 default : [null,1] colour : this.soundColor if(Int_0<1 || Int_0>10) throw new Error('天气的强度等级, 在1-10之间'); @@ -1082,7 +1082,7 @@ move_s /* move_s tooltip : move: 让某个NPC/怪物移动,位置可不填代表当前事件 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=move%EF%BC%9A%E8%AE%A9%E6%9F%90%E4%B8%AAnpc%E6%80%AA%E7%89%A9%E7%A7%BB%E5%8A%A8 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=move%EF%BC%9A%E8%AE%A9%E6%9F%90%E4%B8%AAnpc%E6%80%AA%E7%89%A9%E7%A7%BB%E5%8A%A8 default : ["","",500,false,"上右3下2左上左2"] colour : this.eventColor var floorstr = ''; @@ -1100,7 +1100,7 @@ moveHero_s /* moveHero_s tooltip : moveHero:移动勇士,用这种方式移动勇士的过程中将无视一切地形, 无视一切事件, 中毒状态也不会扣血 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=movehero%EF%BC%9A%E7%A7%BB%E5%8A%A8%E5%8B%87%E5%A3%AB +helpUrl : https://h5mota.com/games/template/docs/#/event?id=movehero%EF%BC%9A%E7%A7%BB%E5%8A%A8%E5%8B%87%E5%A3%AB default : [500,"上右3下2左上左2"] colour : this.dataColor Int_0 = Int_0 ?(', "time": '+Int_0):''; @@ -1114,7 +1114,7 @@ jump_s /* jump_s tooltip : jump: 让某个NPC/怪物跳跃 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=jump%EF%BC%9A%E8%AE%A9%E6%9F%90%E4%B8%AANPC%2F%E6%80%AA%E7%89%A9%E8%B7%B3%E8%B7%83 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=jump%EF%BC%9A%E8%AE%A9%E6%9F%90%E4%B8%AANPC%2F%E6%80%AA%E7%89%A9%E8%B7%B3%E8%B7%83 default : ["","","","",500,true] colour : this.eventColor var floorstr = ''; @@ -1135,7 +1135,7 @@ jumpHero_s /* jumpHero_s tooltip : jumpHero: 跳跃勇士 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=jumpHero%EF%BC%9A%E8%B7%B3%E8%B7%83%E5%8B%87%E5%A3%AB +helpUrl : https://h5mota.com/games/template/docs/#/event?id=jumpHero%EF%BC%9A%E8%B7%B3%E8%B7%83%E5%8B%87%E5%A3%AB default : ["","",500] colour : this.dataColor var floorstr = ''; @@ -1153,7 +1153,7 @@ playBgm_s /* playBgm_s tooltip : playBgm: 播放背景音乐 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=playbgm%EF%BC%9A%E6%92%AD%E6%94%BE%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=playbgm%EF%BC%9A%E6%92%AD%E6%94%BE%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90 default : ["bgm.mp3"] colour : this.soundColor var code = '{"type": "playBgm", "name": "'+EvalString_0+'"},\n'; @@ -1166,7 +1166,7 @@ pauseBgm_s /* pauseBgm_s tooltip : pauseBgm: 暂停背景音乐 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=pausebgm%EF%BC%9A%E6%9A%82%E5%81%9C%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=pausebgm%EF%BC%9A%E6%9A%82%E5%81%9C%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90 colour : this.soundColor var code = '{"type": "pauseBgm"},\n'; return code; @@ -1178,7 +1178,7 @@ resumeBgm_s /* resumeBgm_s tooltip : resumeBgm: 恢复背景音乐 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=resumebgm%EF%BC%9A%E6%81%A2%E5%A4%8D%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=resumebgm%EF%BC%9A%E6%81%A2%E5%A4%8D%E8%83%8C%E6%99%AF%E9%9F%B3%E4%B9%90 colour : this.soundColor var code = '{"type": "resumeBgm"},\n'; return code; @@ -1190,7 +1190,7 @@ playSound_s /* playSound_s tooltip : playSound: 播放音效 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=playsound%EF%BC%9A%E6%92%AD%E6%94%BE%E9%9F%B3%E6%95%88 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=playsound%EF%BC%9A%E6%92%AD%E6%94%BE%E9%9F%B3%E6%95%88 default : ["item.mp3"] colour : this.soundColor var code = '{"type": "playSound", "name": "'+EvalString_0+'"},\n'; @@ -1203,7 +1203,7 @@ setVolume_s /* setVolume_s tooltip : setVolume: 设置音量 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=setvolume%EF%BC%9A%E8%AE%BE%E7%BD%AE%E9%9F%B3%E9%87%8F +helpUrl : https://h5mota.com/games/template/docs/#/event?id=setvolume%EF%BC%9A%E8%AE%BE%E7%BD%AE%E9%9F%B3%E9%87%8F default : [90, 500, false] colour : this.soundColor Int_1 = Int_1?(', "time": '+Int_1):"" @@ -1218,7 +1218,7 @@ win_s /* win_s tooltip : win: 获得胜利, 该事件会显示获胜页面, 并重新游戏 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=win%EF%BC%9A%E8%8E%B7%E5%BE%97%E8%83%9C%E5%88%A9 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=win%EF%BC%9A%E8%8E%B7%E5%BE%97%E8%83%9C%E5%88%A9 default : ["",false] var code = '{"type": "win", "reason": "'+EvalString_0+'", "norank": '+(Bool_0?1:0)+'},\n'; return code; @@ -1230,7 +1230,7 @@ lose_s /* lose_s tooltip : lose: 游戏失败, 该事件会显示失败页面, 并重新开始游戏 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=lose%EF%BC%9A%E6%B8%B8%E6%88%8F%E5%A4%B1%E8%B4%A5 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=lose%EF%BC%9A%E6%B8%B8%E6%88%8F%E5%A4%B1%E8%B4%A5 default : [""] var code = '{"type": "lose", "reason": "'+EvalString_0+'"},\n'; return code; @@ -1242,7 +1242,7 @@ input_s /* input_s tooltip : input:接受用户输入数字, 事件只能接受非负整数输入, 所有非法的输入将全部变成0 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=input%ef%bc%9a%e6%8e%a5%e5%8f%97%e7%94%a8%e6%88%b7%e8%be%93%e5%85%a5%e6%95%b0%e5%ad%97 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=input%ef%bc%9a%e6%8e%a5%e5%8f%97%e7%94%a8%e6%88%b7%e8%be%93%e5%85%a5%e6%95%b0%e5%ad%97 default : ["请输入一个数"] colour : this.dataColor var code = '{"type": "input", "text": "'+EvalString_0+'"},\n'; @@ -1255,7 +1255,7 @@ input2_s /* input2_s tooltip : input2:接受用户输入文本, 允许用户输入任何形式的文本 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=input2%ef%bc%9a%e6%8e%a5%e5%8f%97%e7%94%a8%e6%88%b7%e8%be%93%e5%85%a5%e6%96%87%e6%9c%ac +helpUrl : https://h5mota.com/games/template/docs/#/event?id=input2%ef%bc%9a%e6%8e%a5%e5%8f%97%e7%94%a8%e6%88%b7%e8%be%93%e5%85%a5%e6%96%87%e6%9c%ac default : ["请输入文本"] colour : this.dataColor var code = '{"type": "input2", "text": "'+EvalString_0+'"},\n'; @@ -1268,7 +1268,7 @@ if_s /* if_s tooltip : if: 条件判断 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=if%EF%BC%9A%E6%9D%A1%E4%BB%B6%E5%88%A4%E6%96%AD +helpUrl : https://h5mota.com/games/template/docs/#/event?id=if%EF%BC%9A%E6%9D%A1%E4%BB%B6%E5%88%A4%E6%96%AD colour : this.eventColor var code = ['{"type": "if", "condition": "',expression_0,'",\n', '"true": [\n',action_0,'],\n', @@ -1283,7 +1283,7 @@ switch_s /* switch_s tooltip : switch: 多重条件分歧 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=switch%EF%BC%9A%E5%A4%9A%E9%87%8D%E6%9D%A1%E4%BB%B6%E5%88%86%E6%AD%A7 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=switch%EF%BC%9A%E5%A4%9A%E9%87%8D%E6%9D%A1%E4%BB%B6%E5%88%86%E6%AD%A7 default : ["判别值"] colour : this.eventColor var code = ['{"type": "switch", "condition": "',expression_0,'", "caseList": [\n', @@ -1298,7 +1298,7 @@ switchCase /* switchCase tooltip : 选项的选择 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=switch%EF%BC%9A%E5%A4%9A%E9%87%8D%E6%9D%A1%E4%BB%B6%E5%88%86%E6%AD%A7 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=switch%EF%BC%9A%E5%A4%9A%E9%87%8D%E6%9D%A1%E4%BB%B6%E5%88%86%E6%AD%A7 colour : this.subColor var code = '{"case": "'+expression_0+'", "action": [\n'+action_0+']},\n'; return code; @@ -1310,7 +1310,7 @@ choices_s /* choices_s tooltip : choices: 给用户提供选项 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=choices%EF%BC%9A%E7%BB%99%E7%94%A8%E6%88%B7%E6%8F%90%E4%BE%9B%E9%80%89%E9%A1%B9 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=choices%EF%BC%9A%E7%BB%99%E7%94%A8%E6%88%B7%E6%8F%90%E4%BE%9B%E9%80%89%E9%A1%B9 default : ["","流浪者","woman"] var title=''; if (EvalString_1==''){ @@ -1334,7 +1334,7 @@ choicesContext /* choicesContext tooltip : 选项的选择 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=choices%EF%BC%9A%E7%BB%99%E7%94%A8%E6%88%B7%E6%8F%90%E4%BE%9B%E9%80%89%E9%A1%B9 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=choices%EF%BC%9A%E7%BB%99%E7%94%A8%E6%88%B7%E6%8F%90%E4%BE%9B%E9%80%89%E9%A1%B9 default : ["提示文字:红钥匙"] colour : this.subColor var code = '{"text": "'+EvalString_0+'", "action": [\n'+action_0+']},\n'; @@ -1346,7 +1346,7 @@ while_s /* while_s tooltip : while:循环处理 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=while%EF%BC%9A%E5%BE%AA%E7%8E%AF%E5%A4%84%E7%90%86 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=while%EF%BC%9A%E5%BE%AA%E7%8E%AF%E5%A4%84%E7%90%86 colour : this.eventColor var code = ['{"type": "while", "condition": "',expression_0,'",\n', '"data": [\n',action_0,'],\n', @@ -1359,7 +1359,7 @@ break_s /* break_s tooltip : break:跳出循环, 如果break事件不在任何循环中被执行,则和exit等价,即会立刻结束当前事件! -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=break%EF%BC%9A%E8%B7%B3%E5%87%BA%E5%BE%AA%E7%8E%AF +helpUrl : https://h5mota.com/games/template/docs/#/event?id=break%EF%BC%9A%E8%B7%B3%E5%87%BA%E5%BE%AA%E7%8E%AF colour : this.eventColor var code = '{"type": "break"},\n'; return code; @@ -1370,7 +1370,7 @@ continue_s /* continue_s tooltip : continue:继续执行当前循环的下一轮, 如果continue事件不在任何循环中被执行,则和exit等价,即会立刻结束当前事件! -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=continue%EF%BC%9A%E7%BB%A7%E7%BB%AD%E6%89%A7%E8%A1%8C%E5%BD%93%E5%89%8D%E5%BE%AA%E7%8E%AF +helpUrl : https://h5mota.com/games/template/docs/#/event?id=continue%EF%BC%9A%E7%BB%A7%E7%BB%AD%E6%89%A7%E8%A1%8C%E5%BD%93%E5%89%8D%E5%BE%AA%E7%8E%AF colour : this.eventColor var code = '{"type": "continue"},\n'; return code; @@ -1383,7 +1383,7 @@ wait_s /* wait_s tooltip : wait: 等待用户操作并获得按键或点击信息(具体用法看文档) -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=wait%EF%BC%9A%E7%AD%89%E5%BE%85%E7%94%A8%E6%88%B7%E6%93%8D%E4%BD%9C +helpUrl : https://h5mota.com/games/template/docs/#/event?id=wait%EF%BC%9A%E7%AD%89%E5%BE%85%E7%94%A8%E6%88%B7%E6%93%8D%E4%BD%9C colour : this.soundColor var code = '{"type": "wait"},\n'; return code; @@ -1395,7 +1395,7 @@ function_s /* function_s tooltip : 可双击多行编辑,请勿使用异步代码。常见API参见文档附录。 -helpUrl : https://ckcz123.github.io/mota-js/#/event?id=function%EF%BC%9A%E8%87%AA%E5%AE%9A%E4%B9%89js%E8%84%9A%E6%9C%AC +helpUrl : https://h5mota.com/games/template/docs/#/event?id=function%EF%BC%9A%E8%87%AA%E5%AE%9A%E4%B9%89js%E8%84%9A%E6%9C%AC default : ["alert(core.getStatus(\"atk\"));"] colour : this.dataColor var code = '{"type": "function", "function": "function(){\\n'+JSON.stringify(RawEvalString_0).slice(1,-1).split('\\\\n').join('\\n')+'\\n}"},\n'; From b9e16241838766c8f313843c0d5cf4e0ee00e24e Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 25 Nov 2018 13:19:15 +0800 Subject: [PATCH 12/15] norank --- _server/blockly/MotaAction.g4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_server/blockly/MotaAction.g4 b/_server/blockly/MotaAction.g4 index 318ee7bf..6d75e759 100644 --- a/_server/blockly/MotaAction.g4 +++ b/_server/blockly/MotaAction.g4 @@ -1220,7 +1220,8 @@ win_s tooltip : win: 获得胜利, 该事件会显示获胜页面, 并重新游戏 helpUrl : https://h5mota.com/games/template/docs/#/event?id=win%EF%BC%9A%E8%8E%B7%E5%BE%97%E8%83%9C%E5%88%A9 default : ["",false] -var code = '{"type": "win", "reason": "'+EvalString_0+'", "norank": '+(Bool_0?1:0)+'},\n'; +Bool_0 = Bool_0?', "norank": 1':''; +var code = '{"type": "win", "reason": "'+EvalString_0+Bool_0+'},\n'; return code; */; From 417495cc33f77d6bc9776502c879a90ef5361887 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 25 Nov 2018 13:20:21 +0800 Subject: [PATCH 13/15] norank --- _server/blockly/MotaAction.g4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_server/blockly/MotaAction.g4 b/_server/blockly/MotaAction.g4 index 6d75e759..9d570ac4 100644 --- a/_server/blockly/MotaAction.g4 +++ b/_server/blockly/MotaAction.g4 @@ -1221,7 +1221,7 @@ tooltip : win: 获得胜利, 该事件会显示获胜页面, 并重新游戏 helpUrl : https://h5mota.com/games/template/docs/#/event?id=win%EF%BC%9A%E8%8E%B7%E5%BE%97%E8%83%9C%E5%88%A9 default : ["",false] Bool_0 = Bool_0?', "norank": 1':''; -var code = '{"type": "win", "reason": "'+EvalString_0+Bool_0+'},\n'; +var code = '{"type": "win", "reason": "'+EvalString_0+'"'+Bool_0+'},\n'; return code; */; From 62e9426ef78fc3084feb3f788c8ed35c26ac3201 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 25 Nov 2018 15:27:18 +0800 Subject: [PATCH 14/15] use strict mode --- libs/actions.js | 2 ++ libs/control.js | 2 ++ libs/core.js | 2 ++ libs/data.js | 2 ++ libs/enemys.js | 2 ++ libs/events.js | 2 ++ libs/icons.js | 2 ++ libs/items.js | 2 ++ libs/loader.js | 1 + libs/maps.js | 2 ++ libs/ui.js | 3 +++ libs/utils.js | 2 ++ 12 files changed, 24 insertions(+) diff --git a/libs/actions.js b/libs/actions.js index 6275251b..65782cd4 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -3,6 +3,8 @@ actions.js:用户交互的事件的处理 键盘、鼠标、触摸屏事件相关 */ +"use strict"; + function actions() { this.init(); } diff --git a/libs/control.js b/libs/control.js index 09b16d1c..d3853997 100644 --- a/libs/control.js +++ b/libs/control.js @@ -4,6 +4,8 @@ control.js:游戏主要逻辑控制 寻路算法和人物行走也在此文件内 */ +"use strict"; + function control() { this.init(); } diff --git a/libs/core.js b/libs/core.js index de889da3..cf4cff7a 100644 --- a/libs/core.js +++ b/libs/core.js @@ -2,6 +2,8 @@ * 初始化 start */ +"use strict"; + function core() { this.material = { 'animates': {}, diff --git a/libs/data.js b/libs/data.js index 965c3014..64c3864c 100644 --- a/libs/data.js +++ b/libs/data.js @@ -1,3 +1,5 @@ +"use strict"; + function data() { this.init(); } diff --git a/libs/enemys.js b/libs/enemys.js index 7f87fc4e..748dcbb0 100644 --- a/libs/enemys.js +++ b/libs/enemys.js @@ -1,3 +1,5 @@ +"use strict"; + function enemys() { this.init(); } diff --git a/libs/events.js b/libs/events.js index 30a24ad9..7a4310a6 100644 --- a/libs/events.js +++ b/libs/events.js @@ -1,3 +1,5 @@ +"use strict"; + function events() { this.init(); } diff --git a/libs/icons.js b/libs/icons.js index 149c1361..41855dcd 100644 --- a/libs/icons.js +++ b/libs/icons.js @@ -1,3 +1,5 @@ +"use strict"; + function icons() { this.init(); } diff --git a/libs/items.js b/libs/items.js index a20c62aa..ea6fcd59 100644 --- a/libs/items.js +++ b/libs/items.js @@ -1,3 +1,5 @@ +"use strict"; + function items() { this.init(); } diff --git a/libs/loader.js b/libs/loader.js index 3e84d733..d5a4d3d3 100644 --- a/libs/loader.js +++ b/libs/loader.js @@ -2,6 +2,7 @@ loader.js:负责对资源的加载 */ +"use strict"; function loader() { this.init(); diff --git a/libs/maps.js b/libs/maps.js index a28e3b1c..4d59b0f8 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -1,3 +1,5 @@ +"use strict"; + function maps() { this.init(); } diff --git a/libs/ui.js b/libs/ui.js index dec5c0a6..013243d6 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -3,6 +3,9 @@ * 包括: * 自动寻路、怪物手册、楼传器、存读档、菜单栏、NPC对话事件、等等 */ + +"use strict"; + function ui() { this.init(); } diff --git a/libs/utils.js b/libs/utils.js index ecf5178c..f609f6d3 100644 --- a/libs/utils.js +++ b/libs/utils.js @@ -3,6 +3,8 @@ utils.js 工具类 */ +"use strict"; + function utils() { this.init(); } From 90bbbf2c691cdcb7557688ddb6b40d411ed10b37 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 25 Nov 2018 16:51:46 +0800 Subject: [PATCH 15/15] Fix Book Damage --- libs/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ui.js b/libs/ui.js index 013243d6..444cc561 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -1393,7 +1393,7 @@ ui.prototype.drawBookDetail = function (index) { if (index>=enemys.length) index=enemys.length-1; var enemy = enemys[index], enemyId = enemy.id; - var hints=core.enemys.getSpecialHint(enemy); + var hints=core.enemys.getSpecialHint(enemyId); if (hints.length==0) hints.push("该怪物无特殊属性。");