commit
5398e02b48
10
_docs/api.md
10
_docs/api.md
@ -1913,9 +1913,17 @@ errorCallback可选,如果失败,则会将错误信息传入errorCallback()
|
|||||||
此函数是异步的,只能通过回调函数来获得读取的结果或错误信息。
|
此函数是异步的,只能通过回调函数来获得读取的结果或错误信息。
|
||||||
|
|
||||||
|
|
||||||
core.clone(data)
|
core.clone(data, filter, recursion)
|
||||||
深拷贝一个对象。有关浅拷贝,深拷贝,基本类型和引用类型等相关知识可参见:
|
深拷贝一个对象。有关浅拷贝,深拷贝,基本类型和引用类型等相关知识可参见:
|
||||||
https://zhuanlan.zhihu.com/p/26282765
|
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)
|
core.splitImage(image, width, height)
|
||||||
|
|||||||
@ -1384,6 +1384,10 @@ async可选,如果为true则会异步执行(即不等待当前事件执行
|
|||||||
|
|
||||||
该事件会显示失败页面,并重新开始游戏。
|
该事件会显示失败页面,并重新开始游戏。
|
||||||
|
|
||||||
|
### restart:直接回到标题界面
|
||||||
|
|
||||||
|
`{"type": "restart"}` 会中断一切执行的事件,并直接直接返回标题界面。
|
||||||
|
|
||||||
### callBook:呼出怪物手册
|
### callBook:呼出怪物手册
|
||||||
|
|
||||||
`{"type": "callBook"}` 可以呼出怪物手册,玩家可以自由查看当前楼层怪物数据和详细信息。
|
`{"type": "callBook"}` 可以呼出怪物手册,玩家可以自由查看当前楼层怪物数据和详细信息。
|
||||||
|
|||||||
@ -324,6 +324,7 @@ action
|
|||||||
| setVolume_s
|
| setVolume_s
|
||||||
| win_s
|
| win_s
|
||||||
| lose_s
|
| lose_s
|
||||||
|
| restart_s
|
||||||
| if_s
|
| if_s
|
||||||
| if_1_s
|
| if_1_s
|
||||||
| switch_s
|
| switch_s
|
||||||
@ -581,7 +582,7 @@ show_s
|
|||||||
tooltip : show: 将禁用事件启用,楼层和动画时间可不填,xy可用逗号分隔表示多个点
|
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
|
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]
|
default : ["","","",500,false]
|
||||||
colour : this.eventColor
|
colour : this.mapColor
|
||||||
var floorstr = '';
|
var floorstr = '';
|
||||||
if (EvalString_0 && EvalString_1) {
|
if (EvalString_0 && EvalString_1) {
|
||||||
var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/;
|
var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/;
|
||||||
@ -614,7 +615,7 @@ hide_s
|
|||||||
tooltip : hide: 将一个启用事件禁用,所有参数均可不填,代表禁用事件自身,xy可用逗号分隔表示多个点
|
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
|
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]
|
default : ["","","",500,false]
|
||||||
colour : this.eventColor
|
colour : this.mapColor
|
||||||
var floorstr = '';
|
var floorstr = '';
|
||||||
if (EvalString_0 && EvalString_1) {
|
if (EvalString_0 && EvalString_1) {
|
||||||
var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/;
|
var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/;
|
||||||
@ -736,7 +737,7 @@ setBlock_s
|
|||||||
/* setBlock_s
|
/* setBlock_s
|
||||||
tooltip : setBlock:设置某个图块,忽略坐标楼层则为当前事件
|
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
|
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","","",""]
|
default : ["yellowDoor","","",""]
|
||||||
var floorstr = '';
|
var floorstr = '';
|
||||||
if (PosString_0 && PosString_1) {
|
if (PosString_0 && PosString_1) {
|
||||||
@ -755,7 +756,7 @@ showFloorImg_s
|
|||||||
tooltip : showFloorImg: 显示一个贴图,xy为左上角坐标,可用逗号分隔表示多个点
|
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
|
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 : ["","",""]
|
default : ["","",""]
|
||||||
colour : this.eventColor
|
colour : this.mapColor
|
||||||
var floorstr = '';
|
var floorstr = '';
|
||||||
if (EvalString_0 && EvalString_1) {
|
if (EvalString_0 && EvalString_1) {
|
||||||
var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/;
|
var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/;
|
||||||
@ -786,7 +787,7 @@ hideFloorImg_s
|
|||||||
tooltip : hideFloorImg: 隐藏一个贴图,xy为左上角坐标,可用逗号分隔表示多个点
|
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
|
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 : ["","",""]
|
default : ["","",""]
|
||||||
colour : this.eventColor
|
colour : this.mapColor
|
||||||
var floorstr = '';
|
var floorstr = '';
|
||||||
if (EvalString_0 && EvalString_1) {
|
if (EvalString_0 && EvalString_1) {
|
||||||
var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/;
|
var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/;
|
||||||
@ -817,7 +818,7 @@ showBgFgMap_s
|
|||||||
tooltip : showBgFgMap: 显示图层块,即背景图层/前景图层的某些图块,xy为左上角坐标,可用逗号分隔表示多个点
|
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
|
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","","",""]
|
default : ["bg","","",""]
|
||||||
colour : this.eventColor
|
colour : this.mapColor
|
||||||
var floorstr = '';
|
var floorstr = '';
|
||||||
if (EvalString_0 && EvalString_1) {
|
if (EvalString_0 && EvalString_1) {
|
||||||
var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/;
|
var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/;
|
||||||
@ -848,7 +849,7 @@ hideBgFgMap_s
|
|||||||
tooltip : hideBgFgMap: 隐藏图层块,即背景图层/前景图层的某些图块,xy为左上角坐标,可用逗号分隔表示多个点
|
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
|
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","","",""]
|
default : ["bg","","",""]
|
||||||
colour : this.eventColor
|
colour : this.mapColor
|
||||||
var floorstr = '';
|
var floorstr = '';
|
||||||
if (EvalString_0 && EvalString_1) {
|
if (EvalString_0 && EvalString_1) {
|
||||||
var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/;
|
var pattern1 = /^flag:[0-9a-zA-Z_][0-9a-zA-Z_\-:]*$/;
|
||||||
@ -878,7 +879,7 @@ setBgFgBlock_s
|
|||||||
/* setBgFgBlock_s
|
/* setBgFgBlock_s
|
||||||
tooltip : setBgFgBlock:设置某个图层块,忽略坐标楼层则为当前点
|
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
|
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","","",""]
|
default : ["bg","yellowDoor","","",""]
|
||||||
var floorstr = '';
|
var floorstr = '';
|
||||||
if (PosString_0 && PosString_1) {
|
if (PosString_0 && PosString_1) {
|
||||||
@ -989,7 +990,7 @@ openDoor_s
|
|||||||
tooltip : openDoor: 开门,楼层可不填表示当前层
|
tooltip : openDoor: 开门,楼层可不填表示当前层
|
||||||
helpUrl : https://h5mota.com/games/template/docs/#/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 : ["","","",false]
|
default : ["","","",false]
|
||||||
colour : this.dataColor
|
colour : this.mapColor
|
||||||
IdString_0 = IdString_0 && (', "floorId": "'+IdString_0+'"');
|
IdString_0 = IdString_0 && (', "floorId": "'+IdString_0+'"');
|
||||||
var floorstr = '';
|
var floorstr = '';
|
||||||
if (PosString_0 && PosString_1) {
|
if (PosString_0 && PosString_1) {
|
||||||
@ -1008,7 +1009,7 @@ closeDoor_s
|
|||||||
tooltip : closeDoor: 关门事件,需要该点本身无事件
|
tooltip : closeDoor: 关门事件,需要该点本身无事件
|
||||||
helpUrl : https://h5mota.com/games/template/docs/#/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 : ["","","yellowDoor"]
|
default : ["","","yellowDoor"]
|
||||||
colour : this.dataColor
|
colour : this.mapColor
|
||||||
var floorstr = '';
|
var floorstr = '';
|
||||||
if (PosString_0 && PosString_1) {
|
if (PosString_0 && PosString_1) {
|
||||||
floorstr = ', "loc": ['+PosString_0+','+PosString_1+']';
|
floorstr = ', "loc": ['+PosString_0+','+PosString_1+']';
|
||||||
@ -1097,7 +1098,7 @@ disableShop_s
|
|||||||
tooltip : 全局商店
|
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
|
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"]
|
default : ["shop1"]
|
||||||
colour : this.eventColor
|
colour : this.dataColor
|
||||||
var code = '{"type": "disableShop", "id": "'+IdString_0+'"},\n';
|
var code = '{"type": "disableShop", "id": "'+IdString_0+'"},\n';
|
||||||
return code;
|
return code;
|
||||||
*/;
|
*/;
|
||||||
@ -1352,7 +1353,7 @@ move_s
|
|||||||
tooltip : move: 让某个NPC/怪物移动,位置可不填代表当前事件
|
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
|
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"]
|
default : ["","",500,false,false,"上右3下2左上左2"]
|
||||||
colour : this.eventColor
|
colour : this.mapColor
|
||||||
var floorstr = '';
|
var floorstr = '';
|
||||||
if (PosString_0 && PosString_1) {
|
if (PosString_0 && PosString_1) {
|
||||||
floorstr = ', "loc": ['+PosString_0+','+PosString_1+']';
|
floorstr = ', "loc": ['+PosString_0+','+PosString_1+']';
|
||||||
@ -1387,7 +1388,7 @@ jump_s
|
|||||||
tooltip : jump: 让某个NPC/怪物跳跃
|
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
|
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]
|
default : ["","","","",500,true,false]
|
||||||
colour : this.eventColor
|
colour : this.mapColor
|
||||||
var floorstr = '';
|
var floorstr = '';
|
||||||
if (PosString_0 && PosString_1) {
|
if (PosString_0 && PosString_1) {
|
||||||
floorstr += ', "from": ['+PosString_0+','+PosString_1+']';
|
floorstr += ', "from": ['+PosString_0+','+PosString_1+']';
|
||||||
@ -1550,6 +1551,17 @@ var code = '{"type": "lose", "reason": "'+EvalString_0+'"},\n';
|
|||||||
return code;
|
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
|
input_s
|
||||||
: '接受用户输入数字,提示' ':' EvalString Newline
|
: '接受用户输入数字,提示' ':' EvalString Newline
|
||||||
|
|
||||||
@ -2036,8 +2048,8 @@ Global_Value_List
|
|||||||
|
|
||||||
|
|
||||||
Global_Flag_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
|
Colour
|
||||||
: 'sdeirughvuiyasdeb'+ //为了被识别为复杂词法规则
|
: 'sdeirughvuiyasdeb'+ //为了被识别为复杂词法规则
|
||||||
@ -2142,6 +2154,7 @@ this.evisitor.dataColor=130;
|
|||||||
this.evisitor.eventColor=220;
|
this.evisitor.eventColor=220;
|
||||||
this.evisitor.soundColor=20;
|
this.evisitor.soundColor=20;
|
||||||
this.evisitor.commentColor=285;
|
this.evisitor.commentColor=285;
|
||||||
|
this.evisitor.mapColor=175;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Function_1
|
/* Function_1
|
||||||
@ -2687,6 +2700,10 @@ ActionParser.prototype.parseAction = function() {
|
|||||||
this.next = MotaActionBlocks['lose_s'].xmlText([
|
this.next = MotaActionBlocks['lose_s'].xmlText([
|
||||||
data.reason,this.next]);
|
data.reason,this.next]);
|
||||||
break;
|
break;
|
||||||
|
case "restart":
|
||||||
|
this.next = MotaActionBlocks['restart_s'].xmlText([
|
||||||
|
this.next]);
|
||||||
|
break;
|
||||||
case "function":
|
case "function":
|
||||||
var func = data["function"];
|
var func = data["function"];
|
||||||
func=func.split('{').slice(1).join('{').split('}').slice(0,-1).join('}').trim().split('\n').join('\\n');
|
func=func.split('{').slice(1).join('{').split('}').slice(0,-1).join('}').trim().split('\n').join('\\n');
|
||||||
|
|||||||
@ -68,6 +68,7 @@ editor_blockly = function () {
|
|||||||
MotaActionBlocks['tip_s'].xmlText(),
|
MotaActionBlocks['tip_s'].xmlText(),
|
||||||
MotaActionBlocks['win_s'].xmlText(),
|
MotaActionBlocks['win_s'].xmlText(),
|
||||||
MotaActionBlocks['lose_s'].xmlText(),
|
MotaActionBlocks['lose_s'].xmlText(),
|
||||||
|
MotaActionBlocks['restart_s'].xmlText(),
|
||||||
MotaActionBlocks['confirm_s'].xmlText(),
|
MotaActionBlocks['confirm_s'].xmlText(),
|
||||||
MotaActionBlocks['choices_s'].xmlText([
|
MotaActionBlocks['choices_s'].xmlText([
|
||||||
'选择剑或者盾','流浪者','man',MotaActionBlocks['choicesContext'].xmlText([
|
'选择剑或者盾','流浪者','man',MotaActionBlocks['choicesContext'].xmlText([
|
||||||
@ -99,16 +100,27 @@ editor_blockly = function () {
|
|||||||
MotaActionBlocks['changePos_0_s'].xmlText(),
|
MotaActionBlocks['changePos_0_s'].xmlText(),
|
||||||
MotaActionBlocks['changePos_1_s'].xmlText(),
|
MotaActionBlocks['changePos_1_s'].xmlText(),
|
||||||
MotaActionBlocks['battle_s'].xmlText(),
|
MotaActionBlocks['battle_s'].xmlText(),
|
||||||
MotaActionBlocks['openDoor_s'].xmlText(),
|
|
||||||
MotaActionBlocks['closeDoor_s'].xmlText(),
|
|
||||||
MotaActionBlocks['useItem_s'].xmlText(),
|
MotaActionBlocks['useItem_s'].xmlText(),
|
||||||
MotaActionBlocks['openShop_s'].xmlText(),
|
MotaActionBlocks['openShop_s'].xmlText(),
|
||||||
MotaActionBlocks['setBlock_s'].xmlText(),
|
MotaActionBlocks['disableShop_s'].xmlText(),
|
||||||
MotaActionBlocks['setBgFgBlock_s'].xmlText(),
|
|
||||||
MotaActionBlocks['setHeroIcon_s'].xmlText(),
|
MotaActionBlocks['setHeroIcon_s'].xmlText(),
|
||||||
MotaActionBlocks['follow_s'].xmlText(),
|
MotaActionBlocks['follow_s'].xmlText(),
|
||||||
MotaActionBlocks['unfollow_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_s'].xmlText(),
|
||||||
MotaActionBlocks['if_1_s'].xmlText(),
|
MotaActionBlocks['if_1_s'].xmlText(),
|
||||||
@ -123,18 +135,9 @@ editor_blockly = function () {
|
|||||||
MotaActionBlocks['continue_s'].xmlText(),
|
MotaActionBlocks['continue_s'].xmlText(),
|
||||||
MotaActionBlocks['revisit_s'].xmlText(),
|
MotaActionBlocks['revisit_s'].xmlText(),
|
||||||
MotaActionBlocks['exit_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['trigger_s'].xmlText(),
|
||||||
MotaActionBlocks['insert_1_s'].xmlText(),
|
MotaActionBlocks['insert_1_s'].xmlText(),
|
||||||
MotaActionBlocks['insert_2_s'].xmlText(),
|
MotaActionBlocks['insert_2_s'].xmlText(),
|
||||||
MotaActionBlocks['move_s'].xmlText(),
|
|
||||||
MotaActionBlocks['jump_s'].xmlText(),
|
|
||||||
MotaActionBlocks['disableShop_s'].xmlText(),
|
|
||||||
],
|
],
|
||||||
'特效/声音':[
|
'特效/声音':[
|
||||||
MotaActionBlocks['sleep_s'].xmlText(),
|
MotaActionBlocks['sleep_s'].xmlText(),
|
||||||
|
|||||||
@ -582,7 +582,13 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
|||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "checkbox",
|
"_type": "checkbox",
|
||||||
"_bool": "bool",
|
"_bool": "bool",
|
||||||
"_data": "夹击方式是向上取整还是向下取整。如果此项为true则为向上取整,为false则为向下取整"
|
"_data": "夹击上整还是下整。如果此项为true则夹击伤害值向上取整,为false则为向下取整"
|
||||||
|
},
|
||||||
|
"betweenAttackMax": {
|
||||||
|
"_leaf": true,
|
||||||
|
"_type": "checkbox",
|
||||||
|
"_bool": "bool",
|
||||||
|
"_data": "夹击伤害是否不超过怪物伤害值。"
|
||||||
},
|
},
|
||||||
"useLoop": {
|
"useLoop": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
|
|||||||
@ -919,6 +919,8 @@ control.prototype.checkBlock = function () {
|
|||||||
core.status.hero.hp -= damage;
|
core.status.hero.hp -= damage;
|
||||||
core.drawTip("受到"+(core.status.checkBlock.type[loc]||"伤害")+damage+"点");
|
core.drawTip("受到"+(core.status.checkBlock.type[loc]||"伤害")+damage+"点");
|
||||||
this._checkBlock_soundAndAnimate(x, y);
|
this._checkBlock_soundAndAnimate(x, y);
|
||||||
|
this._checkBlock_disableQuickShop();
|
||||||
|
core.status.hero.statistics.extraDamage += damage;
|
||||||
if (core.status.hero.hp <= 0) {
|
if (core.status.hero.hp <= 0) {
|
||||||
core.status.hero.hp=0;
|
core.status.hero.hp=0;
|
||||||
core.updateStatusBar();
|
core.updateStatusBar();
|
||||||
@ -935,6 +937,15 @@ control.prototype._checkBlock_soundAndAnimate = function (x,y) {
|
|||||||
core.drawAnimate("zone", 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) {
|
control.prototype._checkBlock_snipe = function (snipe) {
|
||||||
if (!snipe || snipe.length == 0) return;
|
if (!snipe || snipe.length == 0) return;
|
||||||
|
|||||||
@ -1448,6 +1448,10 @@ events.prototype._action_lose = function (data, x, y, prefix) {
|
|||||||
this.lose(data.reason);
|
this.lose(data.reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
events.prototype._action_restart = function (data, x, y, prefix) {
|
||||||
|
core.restart();
|
||||||
|
}
|
||||||
|
|
||||||
events.prototype._action_function = function (data, x, y, prefix) {
|
events.prototype._action_function = function (data, x, y, prefix) {
|
||||||
var func = data["function"];
|
var func = data["function"];
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -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;
|
if (!core.isset(data)) return null;
|
||||||
// date
|
// date
|
||||||
if (data instanceof Date) {
|
if (data instanceof Date) {
|
||||||
@ -258,10 +258,9 @@ utils.prototype.clone = function (data) {
|
|||||||
// array
|
// array
|
||||||
if (data instanceof Array) {
|
if (data instanceof Array) {
|
||||||
var copy = [];
|
var copy = [];
|
||||||
// for (var i=0;i<data.length;i++) {
|
|
||||||
for (var i in data) {
|
for (var i in data) {
|
||||||
// copy.push(core.clone(data[i]));
|
if (!filter || filter(i, data[i]))
|
||||||
copy[i] = core.clone(data[i]);
|
copy[i] = core.clone(data[i], recursion?filter:null, recursion);
|
||||||
}
|
}
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
@ -273,8 +272,8 @@ utils.prototype.clone = function (data) {
|
|||||||
if (data instanceof Object) {
|
if (data instanceof Object) {
|
||||||
var copy = {};
|
var copy = {};
|
||||||
for (var i in data) {
|
for (var i in data) {
|
||||||
if (data.hasOwnProperty(i))
|
if (data.hasOwnProperty(i) && (!filter || filter(i, data[i])))
|
||||||
copy[i] = core.clone(data[i]);
|
copy[i] = core.clone(data[i], recursion?filter:null, recursion);
|
||||||
}
|
}
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
@ -1005,6 +1004,7 @@ utils.prototype.consoleOpened = function () {
|
|||||||
if (!core.flags.checkConsole) return false;
|
if (!core.flags.checkConsole) return false;
|
||||||
if (window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized)
|
if (window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized)
|
||||||
return true;
|
return true;
|
||||||
|
if (!core.platform.isPC) return false;
|
||||||
var threshold = 160;
|
var threshold = 160;
|
||||||
var zoom = Math.min(window.outerWidth / window.innerWidth, window.outerHeight / window.innerHeight);
|
var zoom = Math.min(window.outerWidth / window.innerWidth, window.outerHeight / window.innerHeight);
|
||||||
return window.outerWidth - zoom * window.innerWidth > threshold
|
return window.outerWidth - zoom * window.innerWidth > threshold
|
||||||
|
|||||||
@ -395,6 +395,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"enableNegativeDamage": false,
|
"enableNegativeDamage": false,
|
||||||
"hatredDecrease": true,
|
"hatredDecrease": true,
|
||||||
"betweenAttackCeil": false,
|
"betweenAttackCeil": false,
|
||||||
|
"betweenAttackMax": false,
|
||||||
"useLoop": false,
|
"useLoop": false,
|
||||||
"startUsingCanvas": false,
|
"startUsingCanvas": false,
|
||||||
"startDirectly": false,
|
"startDirectly": false,
|
||||||
|
|||||||
@ -522,7 +522,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
var guards = [];
|
var guards = [];
|
||||||
// 检查光环缓存
|
// 检查光环缓存
|
||||||
var index = x != null && y != null ? (x + "," + y) : "floor";
|
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) {
|
if (!cache) {
|
||||||
// 没有该点的缓存,则遍历每个图块
|
// 没有该点的缓存,则遍历每个图块
|
||||||
core.status.maps[floorId].blocks.forEach(function (block) {
|
core.status.maps[floorId].blocks.forEach(function (block) {
|
||||||
@ -553,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 };
|
core.status.checkBlock.cache[index] = { "hp_buff": hp_buff, "atk_buff": atk_buff, "def_buff": def_buff, "guards": guards };
|
||||||
} else {
|
} else {
|
||||||
// 直接使用缓存数据
|
// 直接使用缓存数据
|
||||||
@ -1203,10 +1203,16 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (enemyId != null) {
|
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) {
|
if (leftHp > 1) {
|
||||||
// 上整/下整
|
// 上整/下整
|
||||||
var value = Math.floor((leftHp + (core.flags.betweenAttackCeil ? 1 : 0)) / 2);
|
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;
|
damage[loc] = (damage[loc] || 0) + value;
|
||||||
type[loc] = "夹击伤害";
|
type[loc] = "夹击伤害";
|
||||||
}
|
}
|
||||||
@ -1220,7 +1226,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
type: type,
|
type: type,
|
||||||
snipe: snipe,
|
snipe: snipe,
|
||||||
ambush: ambush,
|
ambush: ambush,
|
||||||
cache: (core.status.checkBlock||{}).cache||{}
|
cache: {} // clear cache
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
"moveOneStep": function (x, y) {
|
"moveOneStep": function (x, y) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user