vampire damage & drawStatistics B

This commit is contained in:
oc 2018-10-16 23:27:15 +08:00
parent 21553a7728
commit 3a83f5b65f
4 changed files with 30 additions and 3 deletions

View File

@ -309,6 +309,10 @@ actions.prototype.keyUp = function(keyCode) {
if (core.status.heroStop)
core.doSL("autoSave", "load");
break;
case 66: // B
if (core.status.heroStop)
core.ui.drawStatistics();
break;
case 83: // S
if (core.status.heroStop)
core.save(true);

View File

@ -288,6 +288,7 @@ control.prototype.resetStatus = function(hero, hard, floorId, route, maps, value
'totalTime': totalTime,
'currTime': 0,
'hp': 0,
"battle": 0,
'battleDamage': 0,
'poisonDamage': 0,
'extraDamage': 0,

View File

@ -1440,10 +1440,31 @@ ui.prototype.drawBookDetail = function (index) {
var enemyId=enemy.id;
var hints=core.enemys.getSpecialHint(core.material.enemys[enemyId]);
if (hints.length==0)
hints.push("该怪物无特殊属性。");
// 吸血怪的最低生命值
if (core.enemys.hasSpecial(core.material.enemys[enemyId].special, 11)) {
var damage = core.getDamage(enemyId);
if (damage != null) {
// 二分HP
var start = 1, end = 100 * damage;
var nowHp = core.status.hero.hp;
while (start<end) {
var mid = Math.floor((start+end)/2);
core.status.hero.hp = mid;
if (core.canBattle(enemyId)) end = mid;
else start = mid+1;
}
core.status.hero.hp = start;
if (core.canBattle(enemyId)) {
hints.push("");
hints.push("打死该怪物最低需要生命值:"+core.formatBigNumber(start));
}
core.status.hero.hp = nowHp;
}
}
hints.push("");
var criticals = core.enemys.nextCriticals(enemyId, 10).map(function (v) {
return v[0]+":"+v[1];
@ -2300,7 +2321,7 @@ ui.prototype.drawStatistics = function () {
+",总游戏时长"+formatTime(statistics.totalTime)
+"。\n瞬间移动次数"+statistics.moveDirectly+",共计少走"+statistics.ignoreSteps+"步。"
+"\n\n总计通过血瓶恢复生命值为"+core.formatBigNumber(statistics.hp)+"点。\n\n"
+"总计受到的伤害为"+core.formatBigNumber(statistics.battleDamage+statistics.poisonDamage+statistics.extraDamage)
+"总计打死了"+statistics.battle+"个怪物,受到的伤害为"+core.formatBigNumber(statistics.battleDamage+statistics.poisonDamage+statistics.extraDamage)
+",其中战斗伤害"+core.formatBigNumber(statistics.battleDamage)+"点"
+(core.flags.enableDebuff?(",中毒伤害"+core.formatBigNumber(statistics.poisonDamage)+"点"):"")
+",领域/夹击/阻击/血网伤害"+core.formatBigNumber(statistics.extraDamage)+"点。",

View File

@ -137,6 +137,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 记录
core.status.hero.statistics.battleDamage += damage;
core.status.hero.statistics.battle++;
if (core.status.hero.hp<=0) {
core.status.hero.hp=0;
@ -366,7 +367,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
[8, "反击", "战斗时,怪物每回合附加角色攻击的"+Math.floor(100*core.values.counterAttack||0)+"%作为伤害,无视角色防御"],
[9, "净化", "战斗前,怪物附加勇士魔防的"+core.values.purify+"倍作为伤害"],
[10, "模仿", "怪物的攻防和勇士攻防相等"],
[11, "吸血", function (enemy) {return "战斗前,怪物首先吸取角色的"+Math.floor(100*enemy.value||0)+"%生命作为伤害"+(enemy.add?",并把伤害数值加到自身生命上":"");}],
[11, "吸血", function (enemy) {return "战斗前,怪物首先吸取角色的"+Math.floor(100*enemy.value||0)+"%生命(约" + Math.floor((enemy.value||0)*core.getStatus('hp')) + "点)作为伤害"+(enemy.add?",并把伤害数值加到自身生命上":"");}],
[12, "中毒", "战斗后,勇士陷入中毒状态,每一步损失生命"+core.values.poisonDamage+"点"],
[13, "衰弱", "战斗后,勇士陷入衰弱状态,攻防暂时下降"+(core.values.weakValue>=1?core.values.weakValue+"点":parseInt(core.values.weakValue*100)+"%")],
[14, "诅咒", "战斗后,勇士陷入诅咒状态,战斗无法获得金币和经验"],