drawStatistics & flyTo
This commit is contained in:
parent
eff81904aa
commit
d42ce084d6
@ -127,6 +127,12 @@ functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
||||
"_leaf": false,
|
||||
"_type": "object",
|
||||
"_data": {
|
||||
"flyTo": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
"_lint": true,
|
||||
"_data": "使用楼层传送器飞到某层"
|
||||
},
|
||||
"updateStatusBar": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
@ -145,6 +151,12 @@ functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
||||
"_leaf": false,
|
||||
"_type": "object",
|
||||
"_data": {
|
||||
"drawStatistics": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
"_lint": true,
|
||||
"_data": "地图数据统计项的注册"
|
||||
},
|
||||
"drawAbout": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
|
||||
@ -969,17 +969,8 @@ actions.prototype.clickFly = function(x,y) {
|
||||
if ((x==10 || x==11) && y==10) core.ui.drawFly(core.status.event.data-10);
|
||||
if ((x==10 || x==11) && y==4) core.ui.drawFly(core.status.event.data+10);
|
||||
if (x>=5 && x<=7 && y==12) core.ui.closePanel();
|
||||
if (x>=0 && x<=9 && y>=3 && y<=11) {
|
||||
var index=core.status.hero.flyRange.indexOf(core.status.floorId);
|
||||
var stair=core.status.event.data<index?"upFloor":"downFloor";
|
||||
if (core.status.event.data==index && core.floors[core.status.floorId].underGround)
|
||||
stair = "upFloor";
|
||||
var floorId=core.status.event.data;
|
||||
var toFloor = core.status.hero.flyRange[floorId];
|
||||
core.status.route.push("fly:"+toFloor);
|
||||
core.ui.closePanel();
|
||||
core.changeFloor(toFloor, stair);
|
||||
}
|
||||
if (x>=0 && x<=9 && y>=3 && y<=11)
|
||||
core.control.flyTo(core.status.hero.flyRange[core.status.event.data]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -1901,14 +1901,10 @@ control.prototype.replay = function () {
|
||||
if (core.hasItem('fly') && toIndex>=0 && nowIndex>=0) {
|
||||
core.ui.drawFly(toIndex);
|
||||
setTimeout(function () {
|
||||
core.ui.closePanel();
|
||||
var stair=toIndex<nowIndex?"upFloor":"downFloor";
|
||||
if (toIndex==nowIndex && core.floors[core.status.floorId].underGround)
|
||||
stair = "upFloor";
|
||||
core.status.route.push("fly:"+floorId);
|
||||
core.changeFloor(floorId, stair, null, null, function () {
|
||||
core.replay();
|
||||
});
|
||||
if (!core.control.flyTo(floorId, function () {core.replay()})) {
|
||||
core.stopReplay();
|
||||
core.insertAction("录像文件出错");
|
||||
}
|
||||
}, 750 / Math.max(1, core.status.replay.speed));
|
||||
return;
|
||||
}
|
||||
@ -2059,6 +2055,10 @@ control.prototype.useFly = function (need) {
|
||||
return;
|
||||
}
|
||||
|
||||
control.prototype.flyTo = function (toId, callback) {
|
||||
return this.controldata.flyTo(toId, callback);
|
||||
}
|
||||
|
||||
////// 点击装备栏时的打开操作 //////
|
||||
control.prototype.openEquipbox = function (need) {
|
||||
if (core.isset(core.status.replay)&&core.status.replay.replaying) return;
|
||||
|
||||
18
libs/ui.js
18
libs/ui.js
@ -2159,21 +2159,15 @@ ui.prototype.drawStatistics = function () {
|
||||
// 5. 当前已走的步数;瞬间移动的步数,瞬间移动的次数(和少走的步数);游戏时长
|
||||
// 6. 当前已恢复的生命值;当前总伤害、战斗伤害、阻激夹域血网伤害、中毒伤害。
|
||||
|
||||
var ids = this.uidata.drawStatistics();
|
||||
var obj = {};
|
||||
ids.forEach(function (e) {obj[e] = 0;})
|
||||
|
||||
var total = {
|
||||
'monster': {
|
||||
'count': 0, 'money': 0, 'experience': 0, 'point': 0,
|
||||
},
|
||||
'count': {
|
||||
'yellowDoor': 0, 'blueDoor': 0, 'redDoor': 0, 'greenDoor': 0, 'steelDoor': 0,
|
||||
'yellowKey': 0, 'blueKey': 0, 'redKey': 0, 'greenKey': 0, 'steelKey': 0,
|
||||
'redJewel': 0, 'blueJewel': 0, 'greenJewel': 0, 'yellowJewel': 0,
|
||||
'redPotion': 0, 'bluePotion': 0, 'greenPotion': 0, 'yellowPotion': 0, 'superPotion': 0,
|
||||
'pickaxe': 0, 'bomb': 0, 'centerFly': 0,
|
||||
'poisonWine': 0, 'weakWine': 0, 'curseWine': 0, 'superWine': 0,
|
||||
'sword1': 0, 'sword2': 0, 'sword3': 0, 'sword4': 0, 'sword5': 0,
|
||||
'shield1': 0, 'shield2': 0, 'shield3': 0, 'shield4': 0, 'shield5': 0,
|
||||
},
|
||||
'count': obj,
|
||||
'add': {
|
||||
'hp': 0, 'atk': 0, 'def': 0, 'mdef': 0
|
||||
}
|
||||
@ -2265,13 +2259,13 @@ ui.prototype.drawStatistics = function () {
|
||||
Object.keys(data.count).forEach(function (key) {
|
||||
var value=data.count[key];
|
||||
if (value>0) {
|
||||
var name="";
|
||||
var name=null;
|
||||
if (key=='yellowDoor') name="黄门";
|
||||
else if (key=='blueDoor') name="蓝门";
|
||||
else if (key=='redDoor') name="红门";
|
||||
else if (key=='greenDoor') name="绿门";
|
||||
else if (key=='steelDoor') name="铁门";
|
||||
else name=core.material.items[key].name;
|
||||
else name=(core.material.items[key]||{}).name;
|
||||
if (core.isset(name)) {
|
||||
text+=name+value+"个;";
|
||||
}
|
||||
|
||||
@ -554,6 +554,31 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
||||
}
|
||||
},
|
||||
"control": {
|
||||
"flyTo": function (toId, callback) {
|
||||
// 楼层传送器的使用,从当前楼层飞往toId
|
||||
// 如果不能飞行请返回false
|
||||
|
||||
var fromId = core.status.floorId;
|
||||
|
||||
// 检查能否飞行
|
||||
if (!core.floors[fromId].canFlyTo || !core.floors[toId].canFlyTo) {
|
||||
core.drawTip("无法飞往" + core.floors[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.floorIds[fromId].underGround) stair = "upFloor";
|
||||
// 记录录像
|
||||
core.status.route.push("fly:"+toId);
|
||||
// 传送
|
||||
core.ui.closePanel();
|
||||
core.changeFloor(toId, stair, null, null, callback);
|
||||
|
||||
return true;
|
||||
},
|
||||
"updateStatusBar": function () {
|
||||
// 更新状态栏
|
||||
|
||||
@ -759,6 +784,21 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
||||
}
|
||||
},
|
||||
"ui": {
|
||||
"drawStatistics": function () {
|
||||
// 浏览地图时参与的统计项目
|
||||
|
||||
return [
|
||||
'yellowDoor', 'blueDoor', 'redDoor', 'greenDoor', 'steelDoor',
|
||||
'yellowKey', 'blueKey', 'redKey', 'greenKey', 'steelKey',
|
||||
'redJewel', 'blueJewel', 'greenJewel', 'yellowJewel',
|
||||
'redPotion', 'bluePotion', 'greenPotion', 'yellowPotion', 'superPotion',
|
||||
'pickaxe', 'bomb', 'centerFly',
|
||||
'poisonWine', 'weakWine', 'curseWine', 'superWine',
|
||||
'sword1', 'sword2', 'sword3', 'sword4', 'sword5',
|
||||
'shield1', 'shield2', 'shield3', 'shield4', 'shield5',
|
||||
// 在这里可以增加新的ID来进行统计个数,只能增加道具ID
|
||||
];
|
||||
},
|
||||
"drawAbout": function() {
|
||||
// 绘制“关于”界面
|
||||
if (!core.isPlaying()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user