eachArrive
This commit is contained in:
parent
09d95cc777
commit
4ee795a3c3
@ -183,6 +183,18 @@ var code = '[\n'+action_0+']\n';
|
||||
return code;
|
||||
*/;
|
||||
|
||||
//eachArrive 事件编辑器入口之一
|
||||
eachArrive_m
|
||||
: '每次到达楼层' BGNL? Newline action+ BEND
|
||||
|
||||
|
||||
/* eachArrive_m
|
||||
tooltip : 每次到达楼层
|
||||
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;
|
||||
*/;
|
||||
|
||||
//changeFloor 事件编辑器入口之一
|
||||
changeFloor_m
|
||||
: '楼梯, 传送门' BGNL? Newline Floor_List IdString? Stair_List 'x' Number ',' 'y' Number '朝向' DirectionEx_List '动画时间' Int? '允许穿透' Bool BEND
|
||||
|
||||
@ -330,6 +330,12 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
||||
"_event": "firstArrive",
|
||||
"_data": "第一次到该楼层触发的事件,可以双击进入事件编辑器。"
|
||||
},
|
||||
"eachArrive": {
|
||||
"_leaf": true,
|
||||
"_type": "event",
|
||||
"_event": "eachArrive",
|
||||
"_data": "每次到该楼层触发的事件,可以双击进入事件编辑器;该事件会比firstArrive先执行。"
|
||||
},
|
||||
"parallelDo": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
|
||||
@ -183,6 +183,7 @@ editor.prototype.mapInit = function () {
|
||||
editor.currentFloorData.fgmap = editor.fgmap;
|
||||
editor.currentFloorData.bgmap = editor.bgmap;
|
||||
editor.currentFloorData.firstArrive = [];
|
||||
editor.currentFloorData.eachArrive = [];
|
||||
editor.currentFloorData.events = {};
|
||||
editor.currentFloorData.changeFloor = {};
|
||||
editor.currentFloorData.afterBattle = {};
|
||||
|
||||
@ -52,6 +52,7 @@ editor_blockly = function () {
|
||||
MotaActionBlocks['afterGetItem_m'].xmlText(),
|
||||
MotaActionBlocks['afterOpenDoor_m'].xmlText(),
|
||||
MotaActionBlocks['firstArrive_m'].xmlText(),
|
||||
MotaActionBlocks['eachArrive_m'].xmlText(),
|
||||
MotaActionBlocks['level_m'].xmlText(),
|
||||
],
|
||||
'显示文字':[
|
||||
|
||||
@ -156,6 +156,7 @@ editor_file = function (editor, callback) {
|
||||
color: saveStatus?currData.color:null,
|
||||
weather: saveStatus?currData.weather:null,
|
||||
firstArrive: [],
|
||||
eachArrive: [],
|
||||
parallelDo: "",
|
||||
events: {},
|
||||
changeFloor: {},
|
||||
|
||||
@ -228,7 +228,7 @@
|
||||
除此以外,我们还能实现“对话框效果”,只要有`\b[...]`就可以。
|
||||
|
||||
- `\b[up]` 直接显示在当前点上方。同样把这里的up换成down则为下方。
|
||||
- 如果不存在当前点(如在firstArrive中调用),则显示在屏幕最上方(最下方)
|
||||
- 如果不存在当前点(如在firstArrive或eachArrive中调用),则显示在屏幕最上方(最下方)
|
||||
- `\b[up,hero]` 显示在勇士上方。同样把这里的up换成down则为下方。
|
||||
- `\b[up,x,y]` 显示在(x,y)点的上方(下方);x和y都为整数且在0到12之间。
|
||||
|
||||
@ -807,8 +807,6 @@ time为可选的,指定的话将作为楼层切换动画的时间。
|
||||
|
||||
**如果time指定为小于100,则视为没有楼层切换动画。**
|
||||
|
||||
!> **changeFloor到达一个新的楼层,将不会执行firstArrive事件!如有需求请在到达点设置自定义事件,然后使用type: trigger立刻调用之。**
|
||||
|
||||
### changePos:当前位置切换/勇士转向
|
||||
|
||||
有时候我们不想要楼层切换的动画效果,而是直接让勇士从A点到B点。
|
||||
|
||||
@ -174,6 +174,7 @@
|
||||
<option value="afterGetItem">afterGetItem</option>
|
||||
<option value="afterOpenDoor">afterOpenDoor</option>
|
||||
<option value="firstArrive">firstArrive</option>
|
||||
<option value="eachArrive">eachArrive</option>
|
||||
</select>
|
||||
<button onclick="editor_blockly.confirm()">确认</button>
|
||||
<button onclick="editor_blockly.parse()">解析</button>
|
||||
|
||||
@ -173,6 +173,7 @@
|
||||
<option value="afterGetItem">afterGetItem</option>
|
||||
<option value="afterOpenDoor">afterOpenDoor</option>
|
||||
<option value="firstArrive">firstArrive</option>
|
||||
<option value="eachArrive">firstArrive</option>
|
||||
</select>
|
||||
<button onclick="editor_blockly.confirm()">确认</button>
|
||||
<button onclick="editor_blockly.parse()">解析</button>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
||||
var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
||||
{
|
||||
"events": {
|
||||
"initGame": function() {
|
||||
@ -93,6 +93,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
||||
visited.push(floorId);
|
||||
core.setFlag("__visited__", visited);
|
||||
}
|
||||
// 每次抵达楼层时执行的事件
|
||||
if (!fromLoad) {
|
||||
core.insertAction(core.floors[floorId].eachArrive);
|
||||
}
|
||||
},
|
||||
"addPoint": function (enemy) {
|
||||
// 加点事件
|
||||
|
||||
Loading…
Reference in New Issue
Block a user