From 1bb5bb0fb32c1e57f39d178e7d5396c9fbf5d1c6 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Fri, 18 Aug 2023 18:55:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=85=E5=92=92=E5=9B=9E=E8=A1=80=E8=A2=AB?= =?UTF-8?q?=E8=85=90=E8=B4=A5=E5=BD=B1=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/component/battle_unit_comp.lua | 2 ++ lua/app/module/battle/helper/battle_formula.lua | 9 +++++++++ 2 files changed, 11 insertions(+) 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