Loop Critical for Big Number

This commit is contained in:
oc 2018-12-13 23:01:41 +08:00
parent 8d31055c52
commit 7be7d3706f
2 changed files with 5 additions and 3 deletions

View File

@ -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) {

View File

@ -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))