diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 76a737e1..c0f4e4c2 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -3,6 +3,7 @@ local BattleHelper = require "app/module/battle/helper/battle_helper" local BattleBuffHandle = require "app/module/battle/helper/battle_buff_handle" local BATTLE_BOARD_SKILL_HANDLE = require "app/module/battle/skill/battle_board_skill_handle" local BATTLE_SKILL_CONDITION_HANDLE = require "app/module/battle/helper/battle_skill_condition_handle" +local BattleFormula = require "app/module/battle/helper/battle_formula" local BattlePassive = require "app/module/battle/helper/battle_passive" local BattleUnitComp = class("BattleUnitComp", LuaComponent) @@ -1630,6 +1631,7 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d end if num < 0 and atker.unitEntity:getBeDmgToHeal() > 0 then num = -num * atker.unitEntity:getBeDmgToHeal() // DEFAULT_FACTOR + num = BattleFormula:getAffectedHeal(num, self) end atker.unitEntity:addDamageCount(num) local showHurtCombo = atker:getHurtComboTag() diff --git a/lua/app/module/battle/helper/battle_formula.lua b/lua/app/module/battle/helper/battle_formula.lua index 6d12373b..2bd5f7a9 100644 --- a/lua/app/module/battle/helper/battle_formula.lua +++ b/lua/app/module/battle/helper/battle_formula.lua @@ -14,6 +14,10 @@ function BattleFormula:getDamageOrCureResult(unitComp, buff, targetUnitComp) return 0 end +function BattleFormula:getAffectedHeal(num, target) + return BattleFormula.calculateFormula[5](num, target) +end + function BattleFormula:getExpectedDamageResult(unitComp, count, targetUnitComp, skillId, atkCompMap) -- (元素个数*攻击者攻击力+链接技能的伤害) * 受击者伤害减免 -- 普攻 @@ -101,6 +105,11 @@ BattleFormula.calculateFormula = { (DEFAULT_FACTOR + unitComp.unitEntity:getDmgAddition() - unitComp.unitEntity:getDmgDec() + targetUnit.unitEntity:getWeakness(atkMatchType) - targetUnit.unitEntity:getDecDmg(atkMatchType)) // DEFAULT_FACTOR return result, 0 end, + -- 治疗量 * (治疗效果增减效果) + [5] = function(num, target) + local result = num * (target.unitEntity:getCureAddition() - target.unitEntity:getCureDec() + DEFAULT_FACTOR) // DEFAULT_FACTOR + return result, 0 + end } return BattleFormula \ No newline at end of file