flyTo
This commit is contained in:
parent
49f604caa4
commit
cebb4a73c0
@ -42,6 +42,12 @@ var functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"_lint": true,
|
"_lint": true,
|
||||||
"_data": "切换楼层后"
|
"_data": "切换楼层后"
|
||||||
},
|
},
|
||||||
|
"flyTo": {
|
||||||
|
"_leaf": true,
|
||||||
|
"_type": "textarea",
|
||||||
|
"_lint": true,
|
||||||
|
"_data": "楼层飞行"
|
||||||
|
},
|
||||||
"beforeBattle": {
|
"beforeBattle": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
@ -147,12 +153,6 @@ var functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"_lint": true,
|
"_lint": true,
|
||||||
"_data": "读档操作"
|
"_data": "读档操作"
|
||||||
},
|
},
|
||||||
"flyTo": {
|
|
||||||
"_leaf": true,
|
|
||||||
"_type": "textarea",
|
|
||||||
"_lint": true,
|
|
||||||
"_data": "楼层飞行"
|
|
||||||
},
|
|
||||||
"updateStatusBar": {
|
"updateStatusBar": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
|||||||
@ -1593,7 +1593,7 @@ events.prototype.useFly = function (fromUserAction) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
events.prototype.flyTo = function (toId, callback) {
|
events.prototype.flyTo = function (toId, callback) {
|
||||||
return this.controldata.flyTo(toId, callback);
|
return this.eventdata.flyTo(toId, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 点击装备栏时的打开操作 //////
|
////// 点击装备栏时的打开操作 //////
|
||||||
|
|||||||
@ -172,6 +172,32 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
core.visitFloor(floorId);
|
core.visitFloor(floorId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"flyTo": function (toId, callback) {
|
||||||
|
// 楼层传送器的使用,从当前楼层飞往toId
|
||||||
|
// 如果不能飞行请返回false
|
||||||
|
|
||||||
|
var fromId = core.status.floorId;
|
||||||
|
|
||||||
|
// 检查能否飞行
|
||||||
|
if (!core.status.maps[fromId].canFlyTo || !core.status.maps[toId].canFlyTo) {
|
||||||
|
core.drawTip("无法飞往" + core.status.maps[toId].title + "!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得两个楼层的索引,以决定是上楼梯还是下楼梯
|
||||||
|
var fromIndex = core.floorIds.indexOf(fromId),
|
||||||
|
toIndex = core.floorIds.indexOf(toId);
|
||||||
|
var stair = fromIndex <= toIndex ? "downFloor" : "upFloor";
|
||||||
|
// 地下层:同层传送至上楼梯
|
||||||
|
if (fromIndex == toIndex && core.status.maps[fromId].underGround) stair = "upFloor";
|
||||||
|
// 记录录像
|
||||||
|
core.status.route.push("fly:" + toId);
|
||||||
|
// 传送
|
||||||
|
core.ui.closePanel();
|
||||||
|
core.changeFloor(toId, stair, null, null, callback);
|
||||||
|
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
"beforeBattle": function (enemyId, x, y) {
|
"beforeBattle": function (enemyId, x, y) {
|
||||||
// 战斗前触发的事件,可以加上一些战前特效(详见下面支援的例子)
|
// 战斗前触发的事件,可以加上一些战前特效(详见下面支援的例子)
|
||||||
@ -946,31 +972,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
|
|
||||||
// 切换到对应的楼层
|
// 切换到对应的楼层
|
||||||
core.changeFloor(data.floorId, null, data.hero.loc, 0, callback, true);
|
core.changeFloor(data.floorId, null, data.hero.loc, 0, callback, true);
|
||||||
},
|
|
||||||
"flyTo": function (toId, callback) {
|
|
||||||
// 楼层传送器的使用,从当前楼层飞往toId
|
|
||||||
// 如果不能飞行请返回false
|
|
||||||
|
|
||||||
var fromId = core.status.floorId;
|
|
||||||
|
|
||||||
// 检查能否飞行
|
|
||||||
if (!core.status.maps[fromId].canFlyTo || !core.status.maps[toId].canFlyTo) {
|
|
||||||
core.drawTip("无法飞往" + core.status.maps[toId].title +"!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得两个楼层的索引,以决定是上楼梯还是下楼梯
|
|
||||||
var fromIndex = core.floorIds.indexOf(fromId), toIndex = core.floorIds.indexOf(toId);
|
|
||||||
var stair = fromIndex<=toIndex?"downFloor":"upFloor";
|
|
||||||
// 地下层:同层传送至上楼梯
|
|
||||||
if (fromIndex == toIndex && core.status.maps[fromId].underGround) stair = "upFloor";
|
|
||||||
// 记录录像
|
|
||||||
core.status.route.push("fly:"+toId);
|
|
||||||
// 传送
|
|
||||||
core.ui.closePanel();
|
|
||||||
core.changeFloor(toId, stair, null, null, callback);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
"updateStatusBar": function () {
|
"updateStatusBar": function () {
|
||||||
// 更新状态栏
|
// 更新状态栏
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user