From 12fe7147035ef03aa79a1a3b54bfa9503fda9b61 Mon Sep 17 00:00:00 2001 From: oc Date: Sun, 14 Apr 2019 13:11:55 +0800 Subject: [PATCH 1/8] disableShopOnDamage & consoleOpened isPC --- libs/control.js | 10 ++++++++++ libs/utils.js | 1 + 2 files changed, 11 insertions(+) diff --git a/libs/control.js b/libs/control.js index 674b163a..ca98964e 100644 --- a/libs/control.js +++ b/libs/control.js @@ -919,6 +919,7 @@ control.prototype.checkBlock = function () { core.status.hero.hp -= damage; core.drawTip("受到"+(core.status.checkBlock.type[loc]||"伤害")+damage+"点"); this._checkBlock_soundAndAnimate(x, y); + this._checkBlock_disableQuickShop(); if (core.status.hero.hp <= 0) { core.status.hero.hp=0; core.updateStatusBar(); @@ -935,6 +936,15 @@ control.prototype._checkBlock_soundAndAnimate = function (x,y) { core.drawAnimate("zone", x, y); } +control.prototype._checkBlock_disableQuickShop = function () { + // 禁用快捷商店 + if (core.flags.disableShopOnDamage) { + for (var shopId in core.status.shops) { + core.status.shops[shopId].visited = false; + } + } +} + ////// 阻击 ////// control.prototype._checkBlock_snipe = function (snipe) { if (!snipe || snipe.length == 0) return; diff --git a/libs/utils.js b/libs/utils.js index 9da86c95..a527f9e9 100644 --- a/libs/utils.js +++ b/libs/utils.js @@ -1005,6 +1005,7 @@ utils.prototype.consoleOpened = function () { if (!core.flags.checkConsole) return false; if (window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized) return true; + if (!core.platform.isPC) return false; var threshold = 160; var zoom = Math.min(window.outerWidth / window.innerWidth, window.outerHeight / window.innerHeight); return window.outerWidth - zoom * window.innerWidth > threshold From bb0307fdebcf2c0995e2c1c194d069c23876c936 Mon Sep 17 00:00:00 2001 From: oc Date: Sun, 14 Apr 2019 13:16:12 +0800 Subject: [PATCH 2/8] extraDamage --- libs/control.js | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/control.js b/libs/control.js index ca98964e..4288890f 100644 --- a/libs/control.js +++ b/libs/control.js @@ -920,6 +920,7 @@ control.prototype.checkBlock = function () { core.drawTip("受到"+(core.status.checkBlock.type[loc]||"伤害")+damage+"点"); this._checkBlock_soundAndAnimate(x, y); this._checkBlock_disableQuickShop(); + core.status.hero.statistics.extraDamage += damage; if (core.status.hero.hp <= 0) { core.status.hero.hp=0; core.updateStatusBar(); From 28628ac9e58cb3c6a1f38398c524518ee68cea24 Mon Sep 17 00:00:00 2001 From: oc Date: Sun, 14 Apr 2019 13:23:10 +0800 Subject: [PATCH 3/8] cache --- project/functions.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/project/functions.js b/project/functions.js index 28c1e768..4e746d5e 100644 --- a/project/functions.js +++ b/project/functions.js @@ -522,7 +522,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = var guards = []; // 检查光环缓存 var index = x != null && y != null ? (x + "," + y) : "floor"; - var cache = ((core.status.checkBlock||{}).cache||{})[index]; + if (!core.status.checkBlock) core.status.checkBlock = {}; + if (!core.status.checkBlock.cache) core.status.checkBlock.cache = {}; + var cache = core.status.checkBlock.cache[index]; if (!cache) { // 没有该点的缓存,则遍历每个图块 core.status.maps[floorId].blocks.forEach(function (block) { @@ -1220,7 +1222,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = type: type, snipe: snipe, ambush: ambush, - cache: (core.status.checkBlock||{}).cache||{} + cache: {} // clear cache }; }, "moveOneStep": function (x, y) { From caa3d3d963d9396e04513785d0e82fa3ffb37e90 Mon Sep 17 00:00:00 2001 From: oc Date: Sun, 14 Apr 2019 13:24:13 +0800 Subject: [PATCH 4/8] cache --- project/functions.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/project/functions.js b/project/functions.js index 4e746d5e..b562f286 100644 --- a/project/functions.js +++ b/project/functions.js @@ -555,8 +555,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = } }); - // 放入缓存中 - core.status.checkBlock.cache = core.status.checkBlock.cache || {}; core.status.checkBlock.cache[index] = { "hp_buff": hp_buff, "atk_buff": atk_buff, "def_buff": def_buff, "guards": guards }; } else { // 直接使用缓存数据 From eebed2e6ed9dd9ffda0b557799bbf22d4a45cb7f Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Mon, 15 Apr 2019 13:17:04 +0800 Subject: [PATCH 5/8] core.clone filter --- _docs/api.md | 10 +++++++++- libs/utils.js | 11 +++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/_docs/api.md b/_docs/api.md index 2f167244..4194aa66 100644 --- a/_docs/api.md +++ b/_docs/api.md @@ -1913,9 +1913,17 @@ errorCallback可选,如果失败,则会将错误信息传入errorCallback() 此函数是异步的,只能通过回调函数来获得读取的结果或错误信息。 -core.clone(data) +core.clone(data, filter, recursion) 深拷贝一个对象。有关浅拷贝,深拷贝,基本类型和引用类型等相关知识可参见: https://zhuanlan.zhihu.com/p/26282765 +filter为过滤函数,如果设置且不为null则需传递一个可接受(name, value)的函数, +并返回true或false,表示该项是否应该被深拷贝。 +recursion表示该filter是否应递归向下传递,如果为true则递归函数也将传该filter。 +例如: +core.clone(core.status.hero, function(name, value) { + return name == 'items' || typeof value == 'number'; +}, false); +这个例子将会深拷贝勇士的属性和道具。 core.splitImage(image, width, height) diff --git a/libs/utils.js b/libs/utils.js index a527f9e9..9260a9c7 100644 --- a/libs/utils.js +++ b/libs/utils.js @@ -247,7 +247,7 @@ utils.prototype.removeLocalForage = function (key, successCallback, errorCallbac } ////// 深拷贝一个对象 ////// -utils.prototype.clone = function (data) { +utils.prototype.clone = function (data, filter, recursion) { if (!core.isset(data)) return null; // date if (data instanceof Date) { @@ -258,10 +258,9 @@ utils.prototype.clone = function (data) { // array if (data instanceof Array) { var copy = []; - // for (var i=0;i Date: Mon, 15 Apr 2019 20:23:23 +0800 Subject: [PATCH 6/8] betweenAttackMax --- _server/table/data.comment.js | 8 +++++++- project/data.js | 1 + project/functions.js | 8 +++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/_server/table/data.comment.js b/_server/table/data.comment.js index 8389ffd6..6b98a633 100644 --- a/_server/table/data.comment.js +++ b/_server/table/data.comment.js @@ -582,7 +582,13 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "_leaf": true, "_type": "checkbox", "_bool": "bool", - "_data": "夹击方式是向上取整还是向下取整。如果此项为true则为向上取整,为false则为向下取整" + "_data": "夹击上整还是下整。如果此项为true则夹击伤害值向上取整,为false则为向下取整" + }, + "betweenAttackMax": { + "_leaf": true, + "_type": "checkbox", + "_bool": "bool", + "_data": "夹击伤害是否不超过怪物伤害值。" }, "useLoop": { "_leaf": true, diff --git a/project/data.js b/project/data.js index e6c64c99..09feb8b9 100644 --- a/project/data.js +++ b/project/data.js @@ -395,6 +395,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "enableNegativeDamage": false, "hatredDecrease": true, "betweenAttackCeil": false, + "betweenAttackMax": false, "useLoop": false, "startUsingCanvas": false, "startDirectly": false, diff --git a/project/functions.js b/project/functions.js index b562f286..1cee5278 100644 --- a/project/functions.js +++ b/project/functions.js @@ -1203,10 +1203,16 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = } if (enemyId != null) { - var leftHp = core.status.hero.hp - (damage[x + "," + y] || 0); + var leftHp = core.status.hero.hp - (damage[loc] || 0); if (leftHp > 1) { // 上整/下整 var value = Math.floor((leftHp + (core.flags.betweenAttackCeil ? 1 : 0)) / 2); + // 是否不超过怪物伤害值 + if (core.flags.betweenAttackMax) { + var enemyDamage = core.getDamage(enemyId, x, y, floorId); + if (enemyDamage != null && enemyDamage < value) + value = enemyDamage; + } damage[loc] = (damage[loc] || 0) + value; type[loc] = "夹击伤害"; } From ceddecfd02bf3e241946c500833615159c0627a0 Mon Sep 17 00:00:00 2001 From: oc Date: Mon, 15 Apr 2019 20:25:56 +0800 Subject: [PATCH 7/8] betweenAttackMax --- _server/MotaAction.g4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_server/MotaAction.g4 b/_server/MotaAction.g4 index 98f8cdca..5db9a805 100644 --- a/_server/MotaAction.g4 +++ b/_server/MotaAction.g4 @@ -2036,8 +2036,8 @@ Global_Value_List Global_Flag_List - : '显示当前楼层'|'显示勇士图标'|'显示当前等级'|'启用生命上限'|'显示魔力值'|'显示魔防值'|'显示金币值'|'显示经验值'|'允许等级提升'|'升级扣除模式'|'显示钥匙数量'|'显示破炸飞'|'显示毒衰咒'|'显示当前技能'|'楼梯边才能楼传'|'破墙镐四方向'|'炸弹四方向'|'冰冻徽章四方向'|'铁门不需要钥匙'|'开启加点'|'开启负伤'|'仇恨怪战后扣减一半'|'夹击是否上整'|'循环计算临界'|'允许轻按'|'寻路算法不绕血瓶'|'允许走到将死领域'|'允许瞬间移动'|'允许查看禁用商店'|'阻激夹域后禁用快捷商店'|'检查控制台' - /*Global_Flag_List ['enableFloor','enableName','enableLv', 'enableHPMax', 'enableMana', 'enableMDef', 'enableMoney', 'enableExperience', 'enableLevelUp', 'levelUpLeftMode', 'enableKeys', 'enablePZF', 'enableDebuff', 'enableSkill', 'flyNearStair', 'pickaxeFourDirections', 'bombFourDirections', 'snowFourDirections', 'steelDoorWithoutKey', 'enableAddPoint', 'enableNegativeDamage', 'hatredDecrease', 'betweenAttackCeil', 'useLoop', 'enableGentleClick', 'potionWhileRouting', 'canGoDeadZone', 'enableMoveDirectly', 'enableDisabledShop', 'disableShopOnDamage', 'checkConsole']*/; + : '显示当前楼层'|'显示勇士图标'|'显示当前等级'|'启用生命上限'|'显示魔力值'|'显示魔防值'|'显示金币值'|'显示经验值'|'允许等级提升'|'升级扣除模式'|'显示钥匙数量'|'显示破炸飞'|'显示毒衰咒'|'显示当前技能'|'楼梯边才能楼传'|'破墙镐四方向'|'炸弹四方向'|'冰冻徽章四方向'|'铁门不需要钥匙'|'开启加点'|'开启负伤'|'仇恨怪战后扣减一半'|'夹击是否上整'|'夹击不超伤害值'|'循环计算临界'|'允许轻按'|'寻路算法不绕血瓶'|'允许走到将死领域'|'允许瞬间移动'|'允许查看禁用商店'|'阻激夹域后禁用快捷商店'|'检查控制台' + /*Global_Flag_List ['enableFloor','enableName','enableLv', 'enableHPMax', 'enableMana', 'enableMDef', 'enableMoney', 'enableExperience', 'enableLevelUp', 'levelUpLeftMode', 'enableKeys', 'enablePZF', 'enableDebuff', 'enableSkill', 'flyNearStair', 'pickaxeFourDirections', 'bombFourDirections', 'snowFourDirections', 'steelDoorWithoutKey', 'enableAddPoint', 'enableNegativeDamage', 'hatredDecrease', 'betweenAttackCeil', 'betweenAttackMax', 'useLoop', 'enableGentleClick', 'potionWhileRouting', 'canGoDeadZone', 'enableMoveDirectly', 'enableDisabledShop', 'disableShopOnDamage', 'checkConsole']*/; Colour : 'sdeirughvuiyasdeb'+ //为了被识别为复杂词法规则 From 94374d7e81cdc98f7381b0845c5c5e7920d8f9bc Mon Sep 17 00:00:00 2001 From: oc Date: Mon, 15 Apr 2019 20:52:42 +0800 Subject: [PATCH 8/8] map category & type:restart --- _docs/event.md | 4 ++++ _server/MotaAction.g4 | 43 +++++++++++++++++++++++++++------------ _server/editor_blockly.js | 29 ++++++++++++++------------ libs/events.js | 4 ++++ 4 files changed, 54 insertions(+), 26 deletions(-) diff --git a/_docs/event.md b/_docs/event.md index c68f267c..866a771c 100644 --- a/_docs/event.md +++ b/_docs/event.md @@ -1384,6 +1384,10 @@ async可选,如果为true则会异步执行(即不等待当前事件执行 该事件会显示失败页面,并重新开始游戏。 +### restart:直接回到标题界面 + +`{"type": "restart"}` 会中断一切执行的事件,并直接直接返回标题界面。 + ### callBook:呼出怪物手册 `{"type": "callBook"}` 可以呼出怪物手册,玩家可以自由查看当前楼层怪物数据和详细信息。 diff --git a/_server/MotaAction.g4 b/_server/MotaAction.g4 index 5db9a805..6906166b 100644 --- a/_server/MotaAction.g4 +++ b/_server/MotaAction.g4 @@ -324,6 +324,7 @@ action | setVolume_s | win_s | lose_s + | restart_s | if_s | if_1_s | switch_s @@ -581,7 +582,7 @@ show_s tooltip : show: 将禁用事件启用,楼层和动画时间可不填,xy可用逗号分隔表示多个点 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,false] -colour : this.eventColor +colour : this.mapColor var floorstr = ''; if (EvalString_0 && EvalString_1) { var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/; @@ -614,7 +615,7 @@ hide_s tooltip : hide: 将一个启用事件禁用,所有参数均可不填,代表禁用事件自身,xy可用逗号分隔表示多个点 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,false] -colour : this.eventColor +colour : this.mapColor var floorstr = ''; if (EvalString_0 && EvalString_1) { var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/; @@ -736,7 +737,7 @@ setBlock_s /* setBlock_s tooltip : setBlock:设置某个图块,忽略坐标楼层则为当前事件 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 +colour : this.mapColor default : ["yellowDoor","","",""] var floorstr = ''; if (PosString_0 && PosString_1) { @@ -755,7 +756,7 @@ showFloorImg_s tooltip : showFloorImg: 显示一个贴图,xy为左上角坐标,可用逗号分隔表示多个点 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 +colour : this.mapColor var floorstr = ''; if (EvalString_0 && EvalString_1) { var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/; @@ -786,7 +787,7 @@ hideFloorImg_s tooltip : hideFloorImg: 隐藏一个贴图,xy为左上角坐标,可用逗号分隔表示多个点 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 +colour : this.mapColor var floorstr = ''; if (EvalString_0 && EvalString_1) { var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/; @@ -817,7 +818,7 @@ showBgFgMap_s tooltip : showBgFgMap: 显示图层块,即背景图层/前景图层的某些图块,xy为左上角坐标,可用逗号分隔表示多个点 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 +colour : this.mapColor var floorstr = ''; if (EvalString_0 && EvalString_1) { var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/; @@ -848,7 +849,7 @@ hideBgFgMap_s tooltip : hideBgFgMap: 隐藏图层块,即背景图层/前景图层的某些图块,xy为左上角坐标,可用逗号分隔表示多个点 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 +colour : this.mapColor var floorstr = ''; if (EvalString_0 && EvalString_1) { var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/; @@ -878,7 +879,7 @@ setBgFgBlock_s /* setBgFgBlock_s tooltip : setBgFgBlock:设置某个图层块,忽略坐标楼层则为当前点 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 +colour : this.mapColor default : ["bg","yellowDoor","","",""] var floorstr = ''; if (PosString_0 && PosString_1) { @@ -989,7 +990,7 @@ openDoor_s tooltip : openDoor: 开门,楼层可不填表示当前层 helpUrl : https://h5mota.com/games/template/docs/#/event?id=opendoor%EF%BC%9A%E5%BC%80%E9%97%A8 default : ["","","",false] -colour : this.dataColor +colour : this.mapColor IdString_0 = IdString_0 && (', "floorId": "'+IdString_0+'"'); var floorstr = ''; if (PosString_0 && PosString_1) { @@ -1008,7 +1009,7 @@ closeDoor_s tooltip : closeDoor: 关门事件,需要该点本身无事件 helpUrl : https://h5mota.com/games/template/docs/#/event?id=opendoor%EF%BC%9A%E5%BC%80%E9%97%A8 default : ["","","yellowDoor"] -colour : this.dataColor +colour : this.mapColor var floorstr = ''; if (PosString_0 && PosString_1) { floorstr = ', "loc": ['+PosString_0+','+PosString_1+']'; @@ -1097,7 +1098,7 @@ disableShop_s tooltip : 全局商店 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 +colour : this.dataColor var code = '{"type": "disableShop", "id": "'+IdString_0+'"},\n'; return code; */; @@ -1352,7 +1353,7 @@ move_s tooltip : move: 让某个NPC/怪物移动,位置可不填代表当前事件 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,false,"上右3下2左上左2"] -colour : this.eventColor +colour : this.mapColor var floorstr = ''; if (PosString_0 && PosString_1) { floorstr = ', "loc": ['+PosString_0+','+PosString_1+']'; @@ -1387,7 +1388,7 @@ jump_s tooltip : jump: 让某个NPC/怪物跳跃 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,false] -colour : this.eventColor +colour : this.mapColor var floorstr = ''; if (PosString_0 && PosString_1) { floorstr += ', "from": ['+PosString_0+','+PosString_1+']'; @@ -1550,6 +1551,17 @@ var code = '{"type": "lose", "reason": "'+EvalString_0+'"},\n'; return code; */; +restart_s + : '直接回到标题界面' Newline + + +/* restart_s +tooltip : restart: 直接回到标题界面 +helpUrl : https://h5mota.com/games/template/docs/#/event?id=restart%ef%bc%9a%e7%9b%b4%e6%8e%a5%e5%9b%9e%e5%88%b0%e6%a0%87%e9%a2%98%e7%95%8c%e9%9d%a2 +var code = '{"type": "restart"},\n'; +return code; +*/; + input_s : '接受用户输入数字,提示' ':' EvalString Newline @@ -2142,6 +2154,7 @@ this.evisitor.dataColor=130; this.evisitor.eventColor=220; this.evisitor.soundColor=20; this.evisitor.commentColor=285; +this.evisitor.mapColor=175; */ /* Function_1 @@ -2687,6 +2700,10 @@ ActionParser.prototype.parseAction = function() { this.next = MotaActionBlocks['lose_s'].xmlText([ data.reason,this.next]); break; + case "restart": + this.next = MotaActionBlocks['restart_s'].xmlText([ + this.next]); + break; case "function": var func = data["function"]; func=func.split('{').slice(1).join('{').split('}').slice(0,-1).join('}').trim().split('\n').join('\\n'); diff --git a/_server/editor_blockly.js b/_server/editor_blockly.js index 90bf5962..ee3b9550 100644 --- a/_server/editor_blockly.js +++ b/_server/editor_blockly.js @@ -68,6 +68,7 @@ editor_blockly = function () { MotaActionBlocks['tip_s'].xmlText(), MotaActionBlocks['win_s'].xmlText(), MotaActionBlocks['lose_s'].xmlText(), + MotaActionBlocks['restart_s'].xmlText(), MotaActionBlocks['confirm_s'].xmlText(), MotaActionBlocks['choices_s'].xmlText([ '选择剑或者盾','流浪者','man',MotaActionBlocks['choicesContext'].xmlText([ @@ -99,16 +100,27 @@ editor_blockly = function () { MotaActionBlocks['changePos_0_s'].xmlText(), MotaActionBlocks['changePos_1_s'].xmlText(), MotaActionBlocks['battle_s'].xmlText(), - MotaActionBlocks['openDoor_s'].xmlText(), - MotaActionBlocks['closeDoor_s'].xmlText(), MotaActionBlocks['useItem_s'].xmlText(), MotaActionBlocks['openShop_s'].xmlText(), - MotaActionBlocks['setBlock_s'].xmlText(), - MotaActionBlocks['setBgFgBlock_s'].xmlText(), + MotaActionBlocks['disableShop_s'].xmlText(), MotaActionBlocks['setHeroIcon_s'].xmlText(), MotaActionBlocks['follow_s'].xmlText(), MotaActionBlocks['unfollow_s'].xmlText(), ], + '地图处理':[ + MotaActionBlocks['openDoor_s'].xmlText(), + MotaActionBlocks['closeDoor_s'].xmlText(), + MotaActionBlocks['show_s'].xmlText(), + MotaActionBlocks['hide_s'].xmlText(), + MotaActionBlocks['setBlock_s'].xmlText(), + MotaActionBlocks['move_s'].xmlText(), + MotaActionBlocks['jump_s'].xmlText(), + MotaActionBlocks['showBgFgMap_s'].xmlText(), + MotaActionBlocks['hideBgFgMap_s'].xmlText(), + MotaActionBlocks['setBgFgBlock_s'].xmlText(), + MotaActionBlocks['showFloorImg_s'].xmlText(), + MotaActionBlocks['hideFloorImg_s'].xmlText(), + ], '事件控制':[ MotaActionBlocks['if_s'].xmlText(), MotaActionBlocks['if_1_s'].xmlText(), @@ -123,18 +135,9 @@ editor_blockly = function () { MotaActionBlocks['continue_s'].xmlText(), MotaActionBlocks['revisit_s'].xmlText(), MotaActionBlocks['exit_s'].xmlText(), - MotaActionBlocks['show_s'].xmlText(), - MotaActionBlocks['hide_s'].xmlText(), - MotaActionBlocks['showFloorImg_s'].xmlText(), - MotaActionBlocks['hideFloorImg_s'].xmlText(), - MotaActionBlocks['showBgFgMap_s'].xmlText(), - MotaActionBlocks['hideBgFgMap_s'].xmlText(), MotaActionBlocks['trigger_s'].xmlText(), MotaActionBlocks['insert_1_s'].xmlText(), MotaActionBlocks['insert_2_s'].xmlText(), - MotaActionBlocks['move_s'].xmlText(), - MotaActionBlocks['jump_s'].xmlText(), - MotaActionBlocks['disableShop_s'].xmlText(), ], '特效/声音':[ MotaActionBlocks['sleep_s'].xmlText(), diff --git a/libs/events.js b/libs/events.js index 07ede640..7adeffb3 100644 --- a/libs/events.js +++ b/libs/events.js @@ -1448,6 +1448,10 @@ events.prototype._action_lose = function (data, x, y, prefix) { this.lose(data.reason); } +events.prototype._action_restart = function (data, x, y, prefix) { + core.restart(); +} + events.prototype._action_function = function (data, x, y, prefix) { var func = data["function"]; try {