Fix viewMap damage
This commit is contained in:
parent
eedd7d0a4c
commit
d1e164b66a
@ -1425,9 +1425,9 @@ control.prototype.updateDamage = function (floorId, canvas) {
|
|||||||
if (!core.hasItem('book')) return;
|
if (!core.hasItem('book')) return;
|
||||||
canvas.font = "bold 11px Arial";
|
canvas.font = "bold 11px Arial";
|
||||||
|
|
||||||
var hero_hp = core.status.hero.hp;
|
|
||||||
if (core.flags.displayEnemyDamage || core.flags.displayCritical) {
|
if (core.flags.displayEnemyDamage || core.flags.displayCritical) {
|
||||||
canvas.textAlign = 'left';
|
canvas.textAlign = 'left';
|
||||||
|
|
||||||
for (var b = 0; b < mapBlocks.length; b++) {
|
for (var b = 0; b < mapBlocks.length; b++) {
|
||||||
var x = mapBlocks[b].x, y = mapBlocks[b].y;
|
var x = mapBlocks[b].x, y = mapBlocks[b].y;
|
||||||
if (core.isset(mapBlocks[b].event) && mapBlocks[b].event.cls.indexOf('enemy')==0
|
if (core.isset(mapBlocks[b].event) && mapBlocks[b].event.cls.indexOf('enemy')==0
|
||||||
@ -1440,14 +1440,14 @@ control.prototype.updateDamage = function (floorId, canvas) {
|
|||||||
var id = mapBlocks[b].event.id;
|
var id = mapBlocks[b].event.id;
|
||||||
|
|
||||||
if (core.flags.displayEnemyDamage) {
|
if (core.flags.displayEnemyDamage) {
|
||||||
var damageString = core.enemys.getDamageString(id, x, y);
|
var damageString = core.enemys.getDamageString(id, x, y, floorId);
|
||||||
var damage = damageString.damage, color = damageString.color;
|
var damage = damageString.damage, color = damageString.color;
|
||||||
core.fillBoldText(canvas, damage, 32*x+1, 32*(y+1)-1, color);
|
core.fillBoldText(canvas, damage, 32*x+1, 32*(y+1)-1, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 临界显伤
|
// 临界显伤
|
||||||
if (core.flags.displayCritical) {
|
if (core.flags.displayCritical) {
|
||||||
var critical = core.enemys.nextCriticals(id);
|
var critical = core.enemys.nextCriticals(id, 1, x, y, floorId);
|
||||||
if (critical.length>0) critical=critical[0];
|
if (critical.length>0) critical=critical[0];
|
||||||
critical = core.formatBigNumber(critical[0], true);
|
critical = core.formatBigNumber(critical[0], true);
|
||||||
if (critical == '???') critical = '?';
|
if (critical == '???') critical = '?';
|
||||||
|
|||||||
@ -127,9 +127,9 @@ enemys.prototype.getExtraDamage = function (enemy) {
|
|||||||
return extra_damage;
|
return extra_damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
enemys.prototype.getDamageString = function (enemy, x, y) {
|
enemys.prototype.getDamageString = function (enemy, x, y, floorId) {
|
||||||
if (typeof enemy == 'string') enemy = core.material.enemys[enemy];
|
if (typeof enemy == 'string') enemy = core.material.enemys[enemy];
|
||||||
var damage = core.enemys.getDamage(enemy, x, y);
|
var damage = core.enemys.getDamage(enemy, x, y, floorId);
|
||||||
|
|
||||||
var color = '#000000';
|
var color = '#000000';
|
||||||
|
|
||||||
@ -328,7 +328,7 @@ enemys.prototype.getCurrentEnemys = function (floorId) {
|
|||||||
if (specialText.length>=3) specialText = "多属性...";
|
if (specialText.length>=3) specialText = "多属性...";
|
||||||
else specialText = specialText.join(" ");
|
else specialText = specialText.join(" ");
|
||||||
|
|
||||||
var critical = this.nextCriticals(enemyId);
|
var critical = this.nextCriticals(enemyId, 1, null, null, floorId);
|
||||||
if (critical.length>0) critical=critical[0];
|
if (critical.length>0) critical=critical[0];
|
||||||
|
|
||||||
var e = core.clone(enemy);
|
var e = core.clone(enemy);
|
||||||
|
|||||||
@ -228,6 +228,7 @@ ui.prototype.closePanel = function () {
|
|||||||
clearInterval(core.status.event.interval);
|
clearInterval(core.status.event.interval);
|
||||||
core.clearLastEvent();
|
core.clearLastEvent();
|
||||||
core.maps.generateGroundPattern();
|
core.maps.generateGroundPattern();
|
||||||
|
core.updateStatusBar();
|
||||||
core.unLockControl();
|
core.unLockControl();
|
||||||
core.status.event.data = null;
|
core.status.event.data = null;
|
||||||
core.status.event.id = null;
|
core.status.event.id = null;
|
||||||
@ -1543,6 +1544,7 @@ ui.prototype.drawBook = function (index) {
|
|||||||
var enemys = core.enemys.getCurrentEnemys(floorId);
|
var enemys = core.enemys.getCurrentEnemys(floorId);
|
||||||
|
|
||||||
core.clearLastEvent();
|
core.clearLastEvent();
|
||||||
|
core.clearMap('data');
|
||||||
|
|
||||||
// 生成groundPattern
|
// 生成groundPattern
|
||||||
core.maps.generateGroundPattern(floorId);
|
core.maps.generateGroundPattern(floorId);
|
||||||
@ -1768,7 +1770,7 @@ ui.prototype.drawBookDetail = function (index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hints.push("");
|
hints.push("");
|
||||||
var criticals = core.enemys.nextCriticals(enemyId, 10).map(function (v) {
|
var criticals = core.enemys.nextCriticals(enemyId, 10, null, null, floorId).map(function (v) {
|
||||||
return core.formatBigNumber(v[0])+":"+core.formatBigNumber(v[1]);
|
return core.formatBigNumber(v[0])+":"+core.formatBigNumber(v[1]);
|
||||||
});
|
});
|
||||||
while (criticals[0]=='0:0') criticals.shift();
|
while (criticals[0]=='0:0') criticals.shift();
|
||||||
@ -1929,6 +1931,7 @@ ui.prototype.drawMaps = function (index, x, y) {
|
|||||||
|
|
||||||
clearTimeout(core.interval.tipAnimate);
|
clearTimeout(core.interval.tipAnimate);
|
||||||
core.clearLastEvent();
|
core.clearLastEvent();
|
||||||
|
core.status.checkBlock.buff = {};
|
||||||
this.drawThumbnail(floorId, 'ui', core.status.maps[floorId].blocks, 0, 0, 416, x, y);
|
this.drawThumbnail(floorId, 'ui', core.status.maps[floorId].blocks, 0, 0, 416, x, y);
|
||||||
|
|
||||||
// 绘图
|
// 绘图
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user