批量开门事件
This commit is contained in:
parent
4dc47a5d58
commit
f73208a9a7
@ -562,7 +562,7 @@ return code;
|
||||
|
||||
// doorInfo 事件编辑器入口之一
|
||||
doorInfo_m
|
||||
: '门信息' '开关门时间' Int '开门音效' EvalString? '关门音效' EvalString? BGNL? Newline '需要钥匙' doorKeyList+ '如需撞到开门还需要把图块触发器改成 openDoor' BEND
|
||||
: '门信息' '开关门时间' Int '开门音效' EvalString? '关门音效' EvalString? BGNL? Newline '需要钥匙' doorKeyList+ '如需撞到开门还需要把图块触发器改成 openDoor' BGNL? Newline '开门后事件' action+ BEND
|
||||
|
||||
|
||||
/* doorInfo_m
|
||||
@ -571,7 +571,8 @@ default : [160, 'door.mp3', 'door.mp3']
|
||||
helpUrl : /_docs/#/instruction
|
||||
EvalString_0 = EvalString_0 && (', "openSound": "' + EvalString_0 + '"');
|
||||
EvalString_1 = EvalString_1 && (', "closeSound": "' + EvalString_1 + '"');
|
||||
var code = '{"time": '+Int_0+EvalString_0+EvalString_1+', "keys": {\n'+doorKeyList_0+'\n}}';
|
||||
if (action_0.trim()) action_0 = ', "afterOpenDoor": [\n' + action_0 + ']';
|
||||
var code = '{"time": '+Int_0+EvalString_0+EvalString_1+', "keys": {\n'+doorKeyList_0+'\n}'+action_0.trim()+'}';
|
||||
return code;
|
||||
*/;
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ ActionParser.prototype.parse = function (obj,type) {
|
||||
})
|
||||
return text_choices;
|
||||
}
|
||||
return MotaActionBlocks['doorInfo_m'].xmlText([obj.time || 160, obj.openSound, obj.closeSound, buildKeys(obj.keys)]);
|
||||
return MotaActionBlocks['doorInfo_m'].xmlText([obj.time || 160, obj.openSound, obj.closeSound, buildKeys(obj.keys), this.parseList(obj.afterOpenDoor)]);
|
||||
|
||||
case 'floorImage':
|
||||
if(!obj) obj=[];
|
||||
|
||||
@ -435,10 +435,15 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
||||
// 开一个门后触发的事件
|
||||
|
||||
var todo = [];
|
||||
// 检查该点的获得开门后事件。
|
||||
if (core.status.floorId == null) return;
|
||||
var event = core.floors[core.status.floorId].afterOpenDoor[x + "," + y];
|
||||
if (event) core.unshift(todo, event);
|
||||
// 检查该点的开门后事件
|
||||
if (core.status.floorId) {
|
||||
core.push(todo, core.floors[core.status.floorId].afterOpenDoor[x + "," + y]);
|
||||
}
|
||||
// 检查批量开门事件
|
||||
var door = core.getBlockById(doorId);
|
||||
if (door && door.event.doorInfo) {
|
||||
core.push(todo, door.event.doorInfo.afterOpenDoor);
|
||||
}
|
||||
|
||||
if (todo.length > 0) core.insertAction(todo, x, y);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user