autoEvent blockly
This commit is contained in:
parent
1fd3bf657d
commit
ed4607e1dd
@ -26,6 +26,27 @@ return code;
|
|||||||
*/;
|
*/;
|
||||||
|
|
||||||
|
|
||||||
|
//自动事件 事件编辑器入口之一
|
||||||
|
autoEvent_m
|
||||||
|
: '自动事件' BGNL? Newline '触发条件' EvalString '优先级' Int BGNL? Newline '仅在本层检测' Bool '延迟执行' Bool '多次执行' Bool BGNL? Newline action+ BEND
|
||||||
|
|
||||||
|
|
||||||
|
/* autoEvent_m
|
||||||
|
tooltip : ?????
|
||||||
|
helpUrl : https://h5mota.com/games/template/_docs/#/event
|
||||||
|
default : ["flag:__door__==2",0,null,null,null,null]
|
||||||
|
var code = {
|
||||||
|
"condition": EvalString_0, // 条件不可为null
|
||||||
|
"currentFloor": Bool_0, // 是否仅在本层检测
|
||||||
|
"priority": Int_0, // 优先级
|
||||||
|
"delayExecute": Bool_1, // 延迟执行
|
||||||
|
"multiExecute": Bool_2, // 是否允许多次执行
|
||||||
|
"data": 'autoEvent_asdfefw', // 事件列表
|
||||||
|
};
|
||||||
|
code=JSON.stringify(code,null,2).split('"autoEvent_asdfefw"').join('[\n'+action_0+']\n');
|
||||||
|
return code;
|
||||||
|
*/;
|
||||||
|
|
||||||
//升级 事件编辑器入口之一
|
//升级 事件编辑器入口之一
|
||||||
level_m
|
level_m
|
||||||
: '等级提升' BGNL? Newline levelCase+ BEND
|
: '等级提升' BGNL? Newline levelCase+ BEND
|
||||||
@ -2755,6 +2776,12 @@ ActionParser.prototype.parse = function (obj,type) {
|
|||||||
obj.trigger==='action',obj.enable,obj.noPass,obj.displayDamage,this.parseList(obj.data)
|
obj.trigger==='action',obj.enable,obj.noPass,obj.displayDamage,this.parseList(obj.data)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
case 'autoEvent':
|
||||||
|
if(!obj)obj={};
|
||||||
|
return MotaActionBlocks['autoEvent_m'].xmlText([
|
||||||
|
obj.condition,obj.priority,obj.currentFloor,obj.delayExecute,obj.multiExecute,this.parseList(obj.data)
|
||||||
|
]);
|
||||||
|
|
||||||
case 'changeFloor':
|
case 'changeFloor':
|
||||||
if(!obj)obj={};
|
if(!obj)obj={};
|
||||||
if(!this.isset(obj.loc)) {
|
if(!this.isset(obj.loc)) {
|
||||||
|
|||||||
@ -253,16 +253,18 @@ editor.prototype.drawEventBlock = function () {
|
|||||||
var loc=(i+core.bigmap.offsetX/32)+","+(j+core.bigmap.offsetY/32);
|
var loc=(i+core.bigmap.offsetX/32)+","+(j+core.bigmap.offsetY/32);
|
||||||
if (editor.currentFloorData.events[loc])
|
if (editor.currentFloorData.events[loc])
|
||||||
color.push('#FF0000');
|
color.push('#FF0000');
|
||||||
if (editor.currentFloorData.changeFloor[loc])
|
if (editor.currentFloorData.autoEvent[loc])
|
||||||
color.push('#00FF00');
|
color.push('#FFA500');
|
||||||
if (editor.currentFloorData.afterBattle[loc])
|
if (editor.currentFloorData.afterBattle[loc])
|
||||||
color.push('#FFFF00');
|
color.push('#FFFF00');
|
||||||
|
if (editor.currentFloorData.changeFloor[loc])
|
||||||
|
color.push('#00FF00');
|
||||||
if (editor.currentFloorData.afterGetItem[loc])
|
if (editor.currentFloorData.afterGetItem[loc])
|
||||||
color.push('#00FFFF');
|
color.push('#00FFFF');
|
||||||
if (editor.currentFloorData.afterOpenDoor[loc])
|
|
||||||
color.push('#FF00FF');
|
|
||||||
if (editor.currentFloorData.cannotMove[loc])
|
if (editor.currentFloorData.cannotMove[loc])
|
||||||
color.push('#0000FF');
|
color.push('#0000FF');
|
||||||
|
if (editor.currentFloorData.afterOpenDoor[loc])
|
||||||
|
color.push('#FF00FF');
|
||||||
for(var kk=0,cc;cc=color[kk];kk++){
|
for(var kk=0,cc;cc=color[kk];kk++){
|
||||||
fg.fillStyle = cc;
|
fg.fillStyle = cc;
|
||||||
fg.fillRect(32*i+8*kk, 32*j+32-8, 8, 8);
|
fg.fillRect(32*i+8*kk, 32*j+32-8, 8, 8);
|
||||||
|
|||||||
@ -26,6 +26,16 @@ editor_blockly = function () {
|
|||||||
"本事件触发一次后会消失",
|
"本事件触发一次后会消失",
|
||||||
{"type": "hide", "time": 500},
|
{"type": "hide", "time": 500},
|
||||||
],'event'),
|
],'event'),
|
||||||
|
MotaActionFunctions.actionParser.parse({
|
||||||
|
"condition": "flag:__door__==2",
|
||||||
|
"currentFloor": true,
|
||||||
|
"priority": 0,
|
||||||
|
"delayExecute": false,
|
||||||
|
"multiExecute": false,
|
||||||
|
"data": [
|
||||||
|
{"type": "openDoor", "loc": [10,5]}
|
||||||
|
],
|
||||||
|
},'autoEvent'),
|
||||||
MotaActionBlocks['changeFloor_m'].xmlText(),
|
MotaActionBlocks['changeFloor_m'].xmlText(),
|
||||||
MotaActionFunctions.actionParser.parse([{
|
MotaActionFunctions.actionParser.parse([{
|
||||||
"id": "moneyShop1",
|
"id": "moneyShop1",
|
||||||
|
|||||||
@ -145,7 +145,7 @@ editor_table_wrapper = function (editor) {
|
|||||||
if (key === '_data') continue;
|
if (key === '_data') continue;
|
||||||
if (cobj[key] instanceof Function) cobj[key] = cobj[key](args);
|
if (cobj[key] instanceof Function) cobj[key] = cobj[key](args);
|
||||||
}
|
}
|
||||||
vobj = args.vobj;
|
pvobj[ii] = vobj = args.vobj;
|
||||||
// 标记为_hide的属性不展示
|
// 标记为_hide的属性不展示
|
||||||
if (cobj._hide) continue;
|
if (cobj._hide) continue;
|
||||||
if (!cobj._leaf) {
|
if (!cobj._leaf) {
|
||||||
@ -343,7 +343,7 @@ editor_table_wrapper = function (editor) {
|
|||||||
// 1.输入id
|
// 1.输入id
|
||||||
var newid = '3';
|
var newid = '3';
|
||||||
if (mode == 'loc') {
|
if (mode == 'loc') {
|
||||||
var ae = editor.currentFloorData.autoEvent[editor_mode.pos.x + ',' + editor_mode.pos.x];
|
var ae = editor.currentFloorData.autoEvent[editor_mode.pos.x + ',' + editor_mode.pos.y];
|
||||||
if (ae != null) {
|
if (ae != null) {
|
||||||
var testid;
|
var testid;
|
||||||
for (testid = 3; Object.hasOwnProperty.call(ae, testid); testid++); // 从3开始是因为comment中设置了始终显示012
|
for (testid = 3; Object.hasOwnProperty.call(ae, testid); testid++); // 从3开始是因为comment中设置了始终显示012
|
||||||
|
|||||||
@ -471,13 +471,14 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
|||||||
"_action": function (args) {
|
"_action": function (args) {
|
||||||
args.vobj=args.vobj||{};
|
args.vobj=args.vobj||{};
|
||||||
for(var ii=0;ii<3;ii++){
|
for(var ii=0;ii<3;ii++){
|
||||||
args.vobj[ii]=null;
|
args.vobj[ii]=args.vobj[ii]||null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"_data": function (key) {
|
"_data": function (key) {
|
||||||
return {
|
return {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "event",
|
||||||
|
"_event": "autoEvent",
|
||||||
"_data": "自动事件"
|
"_data": "自动事件"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -513,6 +514,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
|||||||
"afterBattle": {},
|
"afterBattle": {},
|
||||||
"afterGetItem": {},
|
"afterGetItem": {},
|
||||||
"afterOpenDoor": {},
|
"afterOpenDoor": {},
|
||||||
|
"autoEvent": {},
|
||||||
"cannotMove": {}
|
"cannotMove": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -195,6 +195,7 @@
|
|||||||
-->
|
-->
|
||||||
<select id="entryType" disabled="disabled" style="display: none">
|
<select id="entryType" disabled="disabled" style="display: none">
|
||||||
<option value="event">event</option>
|
<option value="event">event</option>
|
||||||
|
<option value="autoEvent">autoEvent</option>
|
||||||
<option value="changeFloor">changeFloor</option>
|
<option value="changeFloor">changeFloor</option>
|
||||||
<option value="level">level</option>
|
<option value="level">level</option>
|
||||||
<option value="shop">shop</option>
|
<option value="shop">shop</option>
|
||||||
|
|||||||
@ -191,6 +191,7 @@
|
|||||||
-->
|
-->
|
||||||
<select id="entryType" disabled="disabled" style="display: none">
|
<select id="entryType" disabled="disabled" style="display: none">
|
||||||
<option value="event">event</option>
|
<option value="event">event</option>
|
||||||
|
<option value="autoEvent">autoEvent</option>
|
||||||
<option value="changeFloor">changeFloor</option>
|
<option value="changeFloor">changeFloor</option>
|
||||||
<option value="level">level</option>
|
<option value="level">level</option>
|
||||||
<option value="shop">shop</option>
|
<option value="shop">shop</option>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user