From 2d9278f8f68fe9b269b14ae545ac03f67f572815 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sat, 30 Dec 2017 18:05:21 +0800 Subject: [PATCH] Monster Detail --- libs/core.js | 12 +++++++++++- libs/enemys.js | 2 +- libs/events.js | 9 ++++++++- libs/ui.js | 2 +- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/libs/core.js b/libs/core.js index a16345c3..e572fe5b 100644 --- a/libs/core.js +++ b/libs/core.js @@ -614,6 +614,10 @@ core.prototype.keyUp = function(keyCode) { core.events.keyUpBook(keyCode); return; } + if (core.status.event.id=='book-detail' && (keyCode==13 || keyCode==32 || keyCode==67)) { + core.events.clickBookDetail(); + return; + } if (core.status.event.id=='fly') { core.events.keyUpFly(keyCode); return; @@ -856,6 +860,12 @@ core.prototype.onclick = function (x, y, stepPostfix) { return; } + // 怪物详细信息 + if (core.status.event.id == 'book-detail') { + core.events.clickBookDetail(x,y); + return; + } + // 楼层飞行器 if (core.status.event.id == 'fly') { core.events.clickFly(x,y); @@ -2081,7 +2091,7 @@ core.prototype.nearStair = function() { core.prototype.enemyExists = function (x, y, id,floorId) { var block = core.getBlock(x,y,floorId); if (block==null) return false; - return block.block.event.cls=='enemys' && block.block.event.id==id; + return block.block.event.cls=='enemys' && (core.isset(id)?block.block.event.id==id:true); } core.prototype.getBlock = function (x, y, floorId, needEnable) { diff --git a/libs/enemys.js b/libs/enemys.js index 759b505a..f9e29705 100644 --- a/libs/enemys.js +++ b/libs/enemys.js @@ -136,7 +136,7 @@ enemys.prototype.getSpecialHint = function (enemy, special) { case 12: return "中毒:战斗后,勇士陷入中毒状态,每一步损失生命"+core.values.poisonDamage+"点"; case 13: return "衰弱:战斗后,勇士陷入衰弱状态,攻防暂时下降"+core.values.weakValue+"点"; case 14: return "诅咒:战斗后,勇士陷入诅咒状态,战斗无法获得金币和经验"; - case 15: return "领域:经过怪物周围"+(enemy.range||1)+"格时自动减生命"+enemy.damage+"点"; + case 15: return "领域:经过怪物周围"+(enemy.range||1)+"格时自动减生命"+enemy.value+"点"; case 16: return "夹击:经过两只相同的怪物中间,勇士生命值变成一半"; case 17: return "仇恨:战斗前,怪物附加之前积累的仇恨值作为伤害;战斗后,释放一半的仇恨值。(每杀死一个怪物获得"+core.values.hatred+"点仇恨值)"; case 18: return "阻击:经过怪物的十字领域时自动减生命"+enemy.value+"点,同时怪物后退一格"; diff --git a/libs/events.js b/libs/events.js index 38cda26c..cd866e90 100644 --- a/libs/events.js +++ b/libs/events.js @@ -825,7 +825,7 @@ events.prototype.clickBook = function(x,y) { var page=parseInt(data/6); var index=6*page+parseInt(y/2); core.ui.drawEnemyBook(index); - core.ui.drawEnemyDetail(index); + core.ui.drawBookDetail(index); } return; } @@ -854,6 +854,13 @@ events.prototype.keyUpBook = function (keycode) { } } +events.prototype.clickBookDetail = function (x,y) { + core.clearMap('data', 0, 0, 416, 416); + + core.status.event.id = 'book'; + +} + events.prototype.clickFly = function(x,y) { if ((x==10 || x==11) && y==9) core.ui.drawFly(core.status.event.data-1); if ((x==10 || x==11) && y==5) core.ui.drawFly(core.status.event.data+1); diff --git a/libs/ui.js b/libs/ui.js index 0c0e60b3..f9480f9c 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -844,7 +844,7 @@ ui.prototype.drawEnemyBook = function (index) { this.drawPagination(page, totalPage); } -ui.prototype.drawEnemyDetail = function (index) { +ui.prototype.drawBookDetail = function (index) { var enemys = core.enemys.getCurrentEnemys(); if (enemys.length==0) return; if (index<0) index=0;