From f01edc8f5a62c792284dcc3beb685b90af6fe069 Mon Sep 17 00:00:00 2001 From: chenxi Date: Mon, 24 Apr 2023 21:46:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=B4=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/battle/helper/battle_formula.lua | 2 +- lua/app/module/battle/helper/battle_helper.lua | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/app/module/battle/helper/battle_formula.lua b/lua/app/module/battle/helper/battle_formula.lua index d26bdd4a..03f9e73e 100644 --- a/lua/app/module/battle/helper/battle_formula.lua +++ b/lua/app/module/battle/helper/battle_formula.lua @@ -24,7 +24,7 @@ BattleFormula.calculateFormula = { local crit = unitComp.unitEntity:getCrit() if crit > 0 then if BattleHelper:random(1, DEFAULT_FACTOR) <= crit then -- 暴击了 - result = result * (DEFAULT_FACTOR + unitComp.unitEntity:getCrittime()) // DEFAULT_FACTOR + result = result * (BattleHelper:getDefaultCrittime() + unitComp.unitEntity:getCrittime()) // DEFAULT_FACTOR hurtState = HURT_STATE_CRIT end end diff --git a/lua/app/module/battle/helper/battle_helper.lua b/lua/app/module/battle/helper/battle_helper.lua index deb59cf9..6000eb26 100644 --- a/lua/app/module/battle/helper/battle_helper.lua +++ b/lua/app/module/battle/helper/battle_helper.lua @@ -62,6 +62,13 @@ function BattleHelper:getSupportInterval() return self.supportInterval end +function BattleHelper:getDefaultCrittime() + if self.defaultCrittime == nil then + self.defaultCrittime = GFunc.getConstIntValue("crit_dmg") + end + return self.defaultCrittime +end + function BattleHelper:loadBattleHeroModel(id, parent, callback) local pool = self.characterPools[id] if pool and #pool > 0 then