critical list
This commit is contained in:
parent
06b128e524
commit
4bfbe361fb
@ -132,37 +132,53 @@ enemys.prototype.getExtraDamage = function (monster) {
|
|||||||
return extra_damage;
|
return extra_damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 接下来若干个临界值计算 /////
|
||||||
|
enemys.prototype.nextCriticals = function (monsterId, number) {
|
||||||
|
|
||||||
|
number = number||1;
|
||||||
|
|
||||||
|
var monster = core.material.enemys[monsterId];
|
||||||
|
// 坚固、模仿怪物没有临界!
|
||||||
|
if (this.hasSpecial(monster.special, 3) || this.hasSpecial(monster.special, 10)) return [];
|
||||||
|
|
||||||
|
var info = this.getDamageInfo(monster, core.status.hero.hp, core.status.hero.atk, core.status.hero.def, core.status.hero.mdef);
|
||||||
|
|
||||||
|
if (info == null) {
|
||||||
|
if (core.status.hero.atk<=monster.def) {
|
||||||
|
return [(monster.def+1-core.status.hero.atk)+":?"];
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
if (info.damage <= 0) return [];
|
||||||
|
|
||||||
|
var mon_hp = info.mon_hp, hero_atk = core.status.hero.atk, mon_def = monster.def, turn = info.turn;
|
||||||
|
|
||||||
|
if (turn<=1) return [];
|
||||||
|
|
||||||
|
var list = [], pre = null;
|
||||||
|
|
||||||
|
for (var t = turn-1;t>=1;t--) {
|
||||||
|
var nextAtk = Math.ceil(mon_hp/t) + mon_def;
|
||||||
|
if (nextAtk<=hero_atk) break;
|
||||||
|
if (nextAtk!=pre) {
|
||||||
|
var nextInfo = this.getDamageInfo(monster, core.status.hero.hp, nextAtk, core.status.hero.def, core.status.hero.mdef);
|
||||||
|
if (nextInfo==null) break;
|
||||||
|
list.push((nextAtk-hero_atk)+":"+(info.damage-nextInfo.damage));
|
||||||
|
if (nextInfo.damage<=0) break;
|
||||||
|
pre = nextAtk;
|
||||||
|
}
|
||||||
|
if (list.length>=number)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
////// 临界值计算 //////
|
////// 临界值计算 //////
|
||||||
enemys.prototype.getCritical = function (monsterId) {
|
enemys.prototype.getCritical = function (monsterId) {
|
||||||
var monster = core.material.enemys[monsterId];
|
var monster = core.material.enemys[monsterId];
|
||||||
// 坚固、模仿怪物没有临界!
|
// 坚固、模仿怪物没有临界!
|
||||||
if (this.hasSpecial(monster.special, 3) || this.hasSpecial(monster.special, 10)) return "???";
|
if (this.hasSpecial(monster.special, 3) || this.hasSpecial(monster.special, 10)) return "???";
|
||||||
|
|
||||||
if (false) { // 采用回合方式
|
|
||||||
|
|
||||||
var last = this.calDamage(monster, core.status.hero.hp, core.status.hero.atk, core.status.hero.def, core.status.hero.mdef);
|
|
||||||
|
|
||||||
if (last == null) {
|
|
||||||
if (core.status.hero.atk<=monster.def)
|
|
||||||
return monster.def+1-core.status.hero.atk;
|
|
||||||
|
|
||||||
return '???';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (last <= 0) return 0;
|
|
||||||
|
|
||||||
for (var i = core.status.hero.atk + 1; i <= monster.hp + monster.def; i++) {
|
|
||||||
var damage = this.calDamage(monster, core.status.hero.hp, i, core.status.hero.def, core.status.hero.mdef);
|
|
||||||
if (damage == null) return '???';
|
|
||||||
if (damage < last)
|
|
||||||
return core.formatBigNumber(i - core.status.hero.atk);
|
|
||||||
last = damage;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
var info = this.getDamageInfo(monster, core.status.hero.hp, core.status.hero.atk, core.status.hero.def, core.status.hero.mdef);
|
var info = this.getDamageInfo(monster, core.status.hero.hp, core.status.hero.atk, core.status.hero.def, core.status.hero.mdef);
|
||||||
|
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
@ -182,7 +198,6 @@ enemys.prototype.getCritical = function (monsterId) {
|
|||||||
|
|
||||||
if (nextAtk <= hero_atk) return 0;
|
if (nextAtk <= hero_atk) return 0;
|
||||||
return nextAtk - hero_atk;
|
return nextAtk - hero_atk;
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1339,6 +1339,10 @@ ui.prototype.drawBookDetail = function (index) {
|
|||||||
|
|
||||||
if (hints.length==0)
|
if (hints.length==0)
|
||||||
hints.push("该怪物无特殊属性。");
|
hints.push("该怪物无特殊属性。");
|
||||||
|
|
||||||
|
hints.push("");
|
||||||
|
hints.push("临界表:"+JSON.stringify(core.enemys.nextCriticals(enemyId,10)))
|
||||||
|
|
||||||
var content=hints.join("\n");
|
var content=hints.join("\n");
|
||||||
|
|
||||||
core.status.event.id = 'book-detail';
|
core.status.event.id = 'book-detail';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user