From 379ec5ca89737f9a3e35f081716183845dda0526 Mon Sep 17 00:00:00 2001 From: oc Date: Mon, 15 Apr 2019 20:23:23 +0800 Subject: [PATCH] betweenAttackMax --- _server/table/data.comment.js | 8 +++++++- project/data.js | 1 + project/functions.js | 8 +++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/_server/table/data.comment.js b/_server/table/data.comment.js index 8389ffd6..6b98a633 100644 --- a/_server/table/data.comment.js +++ b/_server/table/data.comment.js @@ -582,7 +582,13 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "_leaf": true, "_type": "checkbox", "_bool": "bool", - "_data": "夹击方式是向上取整还是向下取整。如果此项为true则为向上取整,为false则为向下取整" + "_data": "夹击上整还是下整。如果此项为true则夹击伤害值向上取整,为false则为向下取整" + }, + "betweenAttackMax": { + "_leaf": true, + "_type": "checkbox", + "_bool": "bool", + "_data": "夹击伤害是否不超过怪物伤害值。" }, "useLoop": { "_leaf": true, diff --git a/project/data.js b/project/data.js index e6c64c99..09feb8b9 100644 --- a/project/data.js +++ b/project/data.js @@ -395,6 +395,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "enableNegativeDamage": false, "hatredDecrease": true, "betweenAttackCeil": false, + "betweenAttackMax": false, "useLoop": false, "startUsingCanvas": false, "startDirectly": false, diff --git a/project/functions.js b/project/functions.js index b562f286..1cee5278 100644 --- a/project/functions.js +++ b/project/functions.js @@ -1203,10 +1203,16 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = } if (enemyId != null) { - var leftHp = core.status.hero.hp - (damage[x + "," + y] || 0); + var leftHp = core.status.hero.hp - (damage[loc] || 0); if (leftHp > 1) { // 上整/下整 var value = Math.floor((leftHp + (core.flags.betweenAttackCeil ? 1 : 0)) / 2); + // 是否不超过怪物伤害值 + if (core.flags.betweenAttackMax) { + var enemyDamage = core.getDamage(enemyId, x, y, floorId); + if (enemyDamage != null && enemyDamage < value) + value = enemyDamage; + } damage[loc] = (damage[loc] || 0) + value; type[loc] = "夹击伤害"; }