From 7be7d3706fa8ecbf7d3b8815d32ae7da0fed7cef Mon Sep 17 00:00:00 2001 From: oc Date: Thu, 13 Dec 2018 23:01:41 +0800 Subject: [PATCH] Loop Critical for Big Number --- libs/enemys.js | 4 +++- libs/ui.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/enemys.js b/libs/enemys.js index a3097af3..bc1563b5 100644 --- a/libs/enemys.js +++ b/libs/enemys.js @@ -179,7 +179,9 @@ enemys.prototype.nextCriticals = function (enemy, number, x, y, floorId) { } else { // 暴力for循环法 pre = info.damage; - for (var atk=hero_atk+1;atk<=mon_hp+mon_def;atk++) { + var per_add = Math.ceil(hero_atk / 5000); + if (per_add<0) per_add = 1; + for (var atk=hero_atk+per_add;atk<=mon_hp+mon_def;atk+=per_add) { var nextInfo = this.getDamageInfo(enemy, core.status.hero.hp, atk, core.status.hero.def, core.status.hero.mdef, x, y, floorId); if (nextInfo==null) break; if (pre>nextInfo.damage) { diff --git a/libs/ui.js b/libs/ui.js index ec7c1dec..15f0bd0e 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -1645,7 +1645,7 @@ ui.prototype.drawBookDetail = function (index) { u.push(t); } }); - hints.push(JSON.stringify(u.map(function (v) {return v[0]+":"+v[1];}))); + hints.push(JSON.stringify(u.map(function (v) {return core.formatBigNumber(v[0])+":"+core.formatBigNumber(v[1]);}))); } } @@ -1679,7 +1679,7 @@ ui.prototype.drawBookDetail = function (index) { hints.push(""); var criticals = core.enemys.nextCriticals(enemyId, 10).map(function (v) { - return v[0]+":"+v[1]; + return core.formatBigNumber(v[0])+":"+core.formatBigNumber(v[1]); }); while (criticals[0]=='0:0') criticals.shift(); hints.push("临界表:"+JSON.stringify(criticals))